UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

1,815 lines 285 kB
import { n as d, t as De } from "./chunk-Y2CYZVJY-0JxdZxki.js"; import { h as ze, m as R } from "./src-DtRLxcYO.js"; var ai = { min: { r: 0, g: 0, b: 0, s: 0, l: 0, a: 0 }, max: { r: 255, g: 255, b: 255, h: 360, s: 100, l: 100, a: 1 }, clamp: { r: (t) => t >= 255 ? 255 : t < 0 ? 0 : t, g: (t) => t >= 255 ? 255 : t < 0 ? 0 : t, b: (t) => t >= 255 ? 255 : t < 0 ? 0 : t, h: (t) => t % 360, s: (t) => t >= 100 ? 100 : t < 0 ? 0 : t, l: (t) => t >= 100 ? 100 : t < 0 ? 0 : t, a: (t) => t >= 1 ? 1 : t < 0 ? 0 : t }, toLinear: (t) => { const i = t / 255; return t > 0.03928 ? Math.pow((i + 0.055) / 1.055, 2.4) : i / 12.92; }, hue2rgb: (t, i, e) => (e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? t + (i - t) * 6 * e : e < 1 / 2 ? i : e < 2 / 3 ? t + (i - t) * (2 / 3 - e) * 6 : t), hsl2rgb: ({ h: t, s: i, l: e }, l) => { if (!i) return e * 2.55; t /= 360, i /= 100, e /= 100; const s = e < 0.5 ? e * (1 + i) : e + i - e * i, u = 2 * e - s; switch (l) { case "r": return ai.hue2rgb(u, s, t + 1 / 3) * 255; case "g": return ai.hue2rgb(u, s, t) * 255; case "b": return ai.hue2rgb(u, s, t - 1 / 3) * 255; } }, rgb2hsl: ({ r: t, g: i, b: e }, l) => { t /= 255, i /= 255, e /= 255; const s = Math.max(t, i, e), u = Math.min(t, i, e), T = (s + u) / 2; if (l === "l") return T * 100; if (s === u) return 0; const B = s - u, S = T > 0.5 ? B / (2 - s - u) : B / (s + u); if (l === "s") return S * 100; switch (s) { case t: return ((i - e) / B + (i < e ? 6 : 0)) * 60; case i: return ((e - t) / B + 2) * 60; case e: return ((t - i) / B + 4) * 60; default: return -1; } } }, We = { clamp: (t, i, e) => i > e ? Math.min(i, Math.max(e, t)) : Math.min(e, Math.max(i, t)), round: (t) => Math.round(t * 1e10) / 1e10 }, Re = { dec2hex: (t) => { const i = Math.round(t).toString(16); return i.length > 1 ? i : `0${i}`; } }, y = { channel: ai, lang: We, unit: Re }, gt = {}; for (let t = 0; t <= 255; t++) gt[t] = y.unit.dec2hex(t); var W = { ALL: 0, RGB: 1, HSL: 2 }, Pe = class { constructor() { this.type = W.ALL; } get() { return this.type; } set(t) { if (this.type && this.type !== t) throw new Error("Cannot change both RGB and HSL channels at the same time"); this.type = t; } reset() { this.type = W.ALL; } is(t) { return this.type === t; } }, Ne = class { constructor(t, i) { this.color = i, this.changed = !1, this.data = t, this.type = new Pe(); } set(t, i) { return this.color = i, this.changed = !1, this.data = t, this.type.type = W.ALL, this; } _ensureHSL() { const t = this.data, { h: i, s: e, l } = t; i === void 0 && (t.h = y.channel.rgb2hsl(t, "h")), e === void 0 && (t.s = y.channel.rgb2hsl(t, "s")), l === void 0 && (t.l = y.channel.rgb2hsl(t, "l")); } _ensureRGB() { const t = this.data, { r: i, g: e, b: l } = t; i === void 0 && (t.r = y.channel.hsl2rgb(t, "r")), e === void 0 && (t.g = y.channel.hsl2rgb(t, "g")), l === void 0 && (t.b = y.channel.hsl2rgb(t, "b")); } get r() { const t = this.data, i = t.r; return !this.type.is(W.HSL) && i !== void 0 ? i : (this._ensureHSL(), y.channel.hsl2rgb(t, "r")); } get g() { const t = this.data, i = t.g; return !this.type.is(W.HSL) && i !== void 0 ? i : (this._ensureHSL(), y.channel.hsl2rgb(t, "g")); } get b() { const t = this.data, i = t.b; return !this.type.is(W.HSL) && i !== void 0 ? i : (this._ensureHSL(), y.channel.hsl2rgb(t, "b")); } get h() { const t = this.data, i = t.h; return !this.type.is(W.RGB) && i !== void 0 ? i : (this._ensureRGB(), y.channel.rgb2hsl(t, "h")); } get s() { const t = this.data, i = t.s; return !this.type.is(W.RGB) && i !== void 0 ? i : (this._ensureRGB(), y.channel.rgb2hsl(t, "s")); } get l() { const t = this.data, i = t.l; return !this.type.is(W.RGB) && i !== void 0 ? i : (this._ensureRGB(), y.channel.rgb2hsl(t, "l")); } get a() { return this.data.a; } set r(t) { this.type.set(W.RGB), this.changed = !0, this.data.r = t; } set g(t) { this.type.set(W.RGB), this.changed = !0, this.data.g = t; } set b(t) { this.type.set(W.RGB), this.changed = !0, this.data.b = t; } set h(t) { this.type.set(W.HSL), this.changed = !0, this.data.h = t; } set s(t) { this.type.set(W.HSL), this.changed = !0, this.data.s = t; } set l(t) { this.type.set(W.HSL), this.changed = !0, this.data.l = t; } set a(t) { this.changed = !0, this.data.a = t; } }, Ci = new Ne({ r: 0, g: 0, b: 0, a: 0 }, "transparent"), Mt = { re: /^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i, parse: (t) => { if (t.charCodeAt(0) !== 35) return; const i = t.match(Mt.re); if (!i) return; const e = i[1], l = parseInt(e, 16), s = e.length, u = s % 4 === 0, T = s > 4, B = T ? 1 : 17, S = T ? 8 : 4, D = u ? 0 : -1, z = T ? 255 : 15; return Ci.set({ r: (l >> S * (D + 3) & z) * B, g: (l >> S * (D + 2) & z) * B, b: (l >> S * (D + 1) & z) * B, a: u ? (l & z) * B / 255 : 1 }, t); }, stringify: (t) => { const { r: i, g: e, b: l, a: s } = t; return s < 1 ? `#${gt[Math.round(i)]}${gt[Math.round(e)]}${gt[Math.round(l)]}${gt[Math.round(s * 255)]}` : `#${gt[Math.round(i)]}${gt[Math.round(e)]}${gt[Math.round(l)]}`; } }, bt = { re: /^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i, hueRe: /^(.+?)(deg|grad|rad|turn)$/i, _hue2deg: (t) => { const i = t.match(bt.hueRe); if (i) { const [, e, l] = i; switch (l) { case "grad": return y.channel.clamp.h(parseFloat(e) * 0.9); case "rad": return y.channel.clamp.h(parseFloat(e) * 180 / Math.PI); case "turn": return y.channel.clamp.h(parseFloat(e) * 360); } } return y.channel.clamp.h(parseFloat(t)); }, parse: (t) => { const i = t.charCodeAt(0); if (i !== 104 && i !== 72) return; const e = t.match(bt.re); if (!e) return; const [, l, s, u, T, B] = e; return Ci.set({ h: bt._hue2deg(l), s: y.channel.clamp.s(parseFloat(s)), l: y.channel.clamp.l(parseFloat(u)), a: T ? y.channel.clamp.a(B ? parseFloat(T) / 100 : parseFloat(T)) : 1 }, t); }, stringify: (t) => { const { h: i, s: e, l, a: s } = t; return s < 1 ? `hsla(${y.lang.round(i)}, ${y.lang.round(e)}%, ${y.lang.round(l)}%, ${s})` : `hsl(${y.lang.round(i)}, ${y.lang.round(e)}%, ${y.lang.round(l)}%)`; } }, jt = { colors: { aliceblue: "#f0f8ff", antiquewhite: "#faebd7", aqua: "#00ffff", aquamarine: "#7fffd4", azure: "#f0ffff", beige: "#f5f5dc", bisque: "#ffe4c4", black: "#000000", blanchedalmond: "#ffebcd", blue: "#0000ff", blueviolet: "#8a2be2", brown: "#a52a2a", burlywood: "#deb887", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", cornflowerblue: "#6495ed", cornsilk: "#fff8dc", crimson: "#dc143c", cyanaqua: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", darkkhaki: "#bdb76b", darkmagenta: "#8b008b", darkolivegreen: "#556b2f", darkorange: "#ff8c00", darkorchid: "#9932cc", darkred: "#8b0000", darksalmon: "#e9967a", darkseagreen: "#8fbc8f", darkslateblue: "#483d8b", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", darkturquoise: "#00ced1", darkviolet: "#9400d3", deeppink: "#ff1493", deepskyblue: "#00bfff", dimgray: "#696969", dimgrey: "#696969", dodgerblue: "#1e90ff", firebrick: "#b22222", floralwhite: "#fffaf0", forestgreen: "#228b22", fuchsia: "#ff00ff", gainsboro: "#dcdcdc", ghostwhite: "#f8f8ff", gold: "#ffd700", goldenrod: "#daa520", gray: "#808080", green: "#008000", greenyellow: "#adff2f", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", indianred: "#cd5c5c", indigo: "#4b0082", ivory: "#fffff0", khaki: "#f0e68c", lavender: "#e6e6fa", lavenderblush: "#fff0f5", lawngreen: "#7cfc00", lemonchiffon: "#fffacd", lightblue: "#add8e6", lightcoral: "#f08080", lightcyan: "#e0ffff", lightgoldenrodyellow: "#fafad2", lightgray: "#d3d3d3", lightgreen: "#90ee90", lightgrey: "#d3d3d3", lightpink: "#ffb6c1", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", lightskyblue: "#87cefa", lightslategray: "#778899", lightslategrey: "#778899", lightsteelblue: "#b0c4de", lightyellow: "#ffffe0", lime: "#00ff00", limegreen: "#32cd32", linen: "#faf0e6", magenta: "#ff00ff", maroon: "#800000", mediumaquamarine: "#66cdaa", mediumblue: "#0000cd", mediumorchid: "#ba55d3", mediumpurple: "#9370db", mediumseagreen: "#3cb371", mediumslateblue: "#7b68ee", mediumspringgreen: "#00fa9a", mediumturquoise: "#48d1cc", mediumvioletred: "#c71585", midnightblue: "#191970", mintcream: "#f5fffa", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", navajowhite: "#ffdead", navy: "#000080", oldlace: "#fdf5e6", olive: "#808000", olivedrab: "#6b8e23", orange: "#ffa500", orangered: "#ff4500", orchid: "#da70d6", palegoldenrod: "#eee8aa", palegreen: "#98fb98", paleturquoise: "#afeeee", palevioletred: "#db7093", papayawhip: "#ffefd5", peachpuff: "#ffdab9", peru: "#cd853f", pink: "#ffc0cb", plum: "#dda0dd", powderblue: "#b0e0e6", purple: "#800080", rebeccapurple: "#663399", red: "#ff0000", rosybrown: "#bc8f8f", royalblue: "#4169e1", saddlebrown: "#8b4513", salmon: "#fa8072", sandybrown: "#f4a460", seagreen: "#2e8b57", seashell: "#fff5ee", sienna: "#a0522d", silver: "#c0c0c0", skyblue: "#87ceeb", slateblue: "#6a5acd", slategray: "#708090", slategrey: "#708090", snow: "#fffafa", springgreen: "#00ff7f", tan: "#d2b48c", teal: "#008080", thistle: "#d8bfd8", transparent: "#00000000", turquoise: "#40e0d0", violet: "#ee82ee", wheat: "#f5deb3", white: "#ffffff", whitesmoke: "#f5f5f5", yellow: "#ffff00", yellowgreen: "#9acd32" }, parse: (t) => { t = t.toLowerCase(); const i = jt.colors[t]; if (i) return Mt.parse(i); }, stringify: (t) => { const i = Mt.stringify(t); for (const e in jt.colors) if (jt.colors[e] === i) return e; } }, Gt = { re: /^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i, parse: (t) => { const i = t.charCodeAt(0); if (i !== 114 && i !== 82) return; const e = t.match(Gt.re); if (!e) return; const [, l, s, u, T, B, S, D, z] = e; return Ci.set({ r: y.channel.clamp.r(s ? parseFloat(l) * 2.55 : parseFloat(l)), g: y.channel.clamp.g(T ? parseFloat(u) * 2.55 : parseFloat(u)), b: y.channel.clamp.b(S ? parseFloat(B) * 2.55 : parseFloat(B)), a: D ? y.channel.clamp.a(z ? parseFloat(D) / 100 : parseFloat(D)) : 1 }, t); }, stringify: (t) => { const { r: i, g: e, b: l, a: s } = t; return s < 1 ? `rgba(${y.lang.round(i)}, ${y.lang.round(e)}, ${y.lang.round(l)}, ${y.lang.round(s)})` : `rgb(${y.lang.round(i)}, ${y.lang.round(e)}, ${y.lang.round(l)})`; } }, et = { format: { keyword: jt, hex: Mt, rgb: Gt, rgba: Gt, hsl: bt, hsla: bt }, parse: (t) => { if (typeof t != "string") return t; const i = Mt.parse(t) || Gt.parse(t) || bt.parse(t) || jt.parse(t); if (i) return i; throw new Error(`Unsupported color format: "${t}"`); }, stringify: (t) => !t.changed && t.color ? t.color : t.type.is(W.HSL) || t.data.r === void 0 ? bt.stringify(t) : t.a < 1 || !Number.isInteger(t.r) || !Number.isInteger(t.g) || !Number.isInteger(t.b) ? Gt.stringify(t) : Mt.stringify(t) }, $r = (t, i) => { const e = et.parse(t); for (const l in i) e[l] = y.channel.clamp[l](i[l]); return et.stringify(e); }, pt = (t, i, e = 0, l = 1) => { if (typeof t != "number") return $r(t, { a: i }); const s = Ci.set({ r: y.channel.clamp.r(t), g: y.channel.clamp.g(i), b: y.channel.clamp.b(e), a: y.channel.clamp.a(l) }); return et.stringify(s); }, He = (t) => { const { r: i, g: e, b: l } = et.parse(t), s = 0.2126 * y.channel.toLinear(i) + 0.7152 * y.channel.toLinear(e) + 0.0722 * y.channel.toLinear(l); return y.lang.round(s); }, Ue = (t) => He(t) >= 0.5, K = (t) => !Ue(t), jr = (t, i, e) => { const l = et.parse(t), s = l[i], u = y.channel.clamp[i](s + e); return s !== u && (l[i] = u), et.stringify(l); }, n = (t, i) => jr(t, "l", i), c = (t, i) => jr(t, "l", -i), r = (t, i) => { const e = et.parse(t), l = {}; for (const s in i) i[s] && (l[s] = e[s] + i[s]); return $r(t, l); }, Ge = (t, i, e = 50) => { const { r: l, g: s, b: u, a: T } = et.parse(t), { r: B, g: S, b: D, a: z } = et.parse(i), Y = e / 100, St = Y * 2 - 1, mt = T - z, Ft = ((St * mt === -1 ? St : (St + mt) / (1 + St * mt)) + 1) / 2, Z = 1 - Ft; return pt(l * Ft + B * Z, s * Ft + S * Z, u * Ft + D * Z, T * Y + z * (1 - Y)); }, a = (t, i = 100) => { const e = et.parse(t); return e.r = 255 - e.r, e.g = 255 - e.g, e.b = 255 - e.b, Ge(e, t, i); }; function Fr(t, i) { (i == null || i > t.length) && (i = t.length); for (var e = 0, l = Array(i); e < i; e++) l[e] = t[e]; return l; } function $e(t) { if (Array.isArray(t)) return t; } function je(t, i) { var e = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (e != null) { var l, s, u, T, B = [], S = !0, D = !1; try { if (u = (e = e.call(t)).next, i !== 0) for (; !(S = (l = u.call(e)).done) && (B.push(l.value), B.length !== i); S = !0) ; } catch (z) { D = !0, s = z; } finally { try { if (!S && e.return != null && (T = e.return(), Object(T) !== T)) return; } finally { if (D) throw s; } } return B; } } function Ve() { throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } function Ye(t, i) { return $e(t) || je(t, i) || Xe(t, i) || Ve(); } function Xe(t, i) { if (t) { if (typeof t == "string") return Fr(t, i); var e = {}.toString.call(t).slice(8, -1); return e === "Object" && t.constructor && (e = t.constructor.name), e === "Map" || e === "Set" ? Array.from(t) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? Fr(t, i) : void 0; } } var Vr = Object.entries, Lr = Object.setPrototypeOf, Ke = Object.isFrozen, Ze = Object.getPrototypeOf, Je = Object.getOwnPropertyDescriptor, I = Object.freeze, M = Object.seal, It = Object.create, Yr = typeof Reflect < "u" && Reflect, Pi = Yr.apply, Ni = Yr.construct; I || (I = function(i) { return i; }); M || (M = function(i) { return i; }); Pi || (Pi = function(i, e) { for (var l = arguments.length, s = new Array(l > 2 ? l - 2 : 0), u = 2; u < l; u++) s[u - 2] = arguments[u]; return i.apply(e, s); }); Ni || (Ni = function(i) { for (var e = arguments.length, l = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++) l[s - 1] = arguments[s]; return new i(...l); }); var Ot = A(Array.prototype.forEach), Qe = A(Array.prototype.lastIndexOf), vr = A(Array.prototype.pop), qt = A(Array.prototype.push), to = A(Array.prototype.splice), ut = Array.isArray, $t = A(String.prototype.toLowerCase), Mi = A(String.prototype.toString), _r = A(String.prototype.match), Ht = A(String.prototype.replace), Er = A(String.prototype.indexOf), io = A(String.prototype.trim), ro = A(Number.prototype.toString), eo = A(Boolean.prototype.toString), Ar = typeof BigInt > "u" ? null : A(BigInt.prototype.toString), wr = typeof Symbol > "u" ? null : A(Symbol.prototype.toString), O = A(Object.prototype.hasOwnProperty), Ut = A(Object.prototype.toString), w = A(RegExp.prototype.test), kt = oo(TypeError); function A(t) { return function(i) { i instanceof RegExp && (i.lastIndex = 0); for (var e = arguments.length, l = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++) l[s - 1] = arguments[s]; return Pi(t, i, l); }; } function oo(t) { return function() { for (var i = arguments.length, e = new Array(i), l = 0; l < i; l++) e[l] = arguments[l]; return Ni(t, e); }; } function k(t, i) { let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : $t; if (Lr && Lr(t, null), !ut(i)) return t; let l = i.length; for (; l--; ) { let s = i[l]; if (typeof s == "string") { const u = e(s); u !== s && (Ke(i) || (i[l] = u), s = u); } t[s] = !0; } return t; } function so(t) { for (let i = 0; i < t.length; i++) O(t, i) || (t[i] = null); return t; } function U(t) { const i = It(null); for (const l of Vr(t)) { var e = Ye(l, 2); const s = e[0], u = e[1]; O(t, s) && (ut(u) ? i[s] = so(u) : u && typeof u == "object" && u.constructor === Object ? i[s] = U(u) : i[s] = u); } return i; } function ao(t) { switch (typeof t) { case "string": return t; case "number": return ro(t); case "boolean": return eo(t); case "bigint": return Ar ? Ar(t) : "0"; case "symbol": return wr ? wr(t) : "Symbol()"; case "undefined": return Ut(t); case "function": case "object": { if (t === null) return Ut(t); const i = t, e = rt(i, "toString"); if (typeof e == "function") { const l = e(i); return typeof l == "string" ? l : Ut(l); } return Ut(t); } default: return Ut(t); } } function rt(t, i) { for (; t !== null; ) { const l = Je(t, i); if (l) { if (l.get) return A(l.get); if (typeof l.value == "function") return A(l.value); } t = Ze(t); } function e() { return null; } return e; } function lo(t) { try { return w(t, ""), !0; } catch { return !1; } } var Or = I([ "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" ]), Di = I([ "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" ]), zi = I([ "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" ]), ho = I([ "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" ]), Wi = I([ "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" ]), no = I([ "maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none" ]), qr = I(["#text"]), Ir = I([ "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" ]), Ri = I([ "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" ]), Mr = I([ "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" ]), si = I([ "xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink" ]), co = M(/{{[\w\W]*|^[\w\W]*}}/g), Co = M(/<%[\w\W]*|^[\w\W]*%>/g), go = M(/\${[\w\W]*/g), uo = M(/^data-[\-\w.\u00B7-\uFFFF]+$/), po = M(/^aria-[\-\w]+$/), Dr = M(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), mo = M(/^(?:\w+script|data):/i), yo = M(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), xo = M(/^html$/i), fo = M(/^[a-z][.\w]*(-[.\w]+)+$/i), zr = M(/<[/\w!]/g), Wr = M(/<[/\w]/g), To = M(/<\/no(script|embed|frames)/i), ko = M(/\/>/i), V = { element: 1, attribute: 2, text: 3, cdataSection: 4, entityReference: 5, entityNode: 6, processingInstruction: 7, comment: 8, document: 9, documentType: 10, documentFragment: 11, notation: 12 }, bo = function() { return typeof window > "u" ? null : window; }, Bo = function(i, e) { if (typeof i != "object" || typeof i.createPolicy != "function") return null; let l = null; const s = "data-tt-policy-suffix"; e && e.hasAttribute(s) && (l = e.getAttribute(s)); const u = "dompurify" + (l ? "#" + l : ""); try { return i.createPolicy(u, { createHTML(T) { return T; }, createScriptURL(T) { return T; } }); } catch { return console.warn("TrustedTypes policy " + u + " could not be created."), null; } }, Rr = function() { return { afterSanitizeAttributes: [], afterSanitizeElements: [], afterSanitizeShadowDOM: [], beforeSanitizeAttributes: [], beforeSanitizeElements: [], beforeSanitizeShadowDOM: [], uponSanitizeAttribute: [], uponSanitizeElement: [], uponSanitizeShadowNode: [] }; }, Ct = function(i, e, l, s) { return O(i, e) && ut(i[e]) ? k(s.base ? U(s.base) : {}, i[e], s.transform) : l; }; function Xr() { let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : bo(); const i = (g) => Xr(g); if (i.version = "3.4.12", i.removed = [], !t || !t.document || t.document.nodeType !== V.document || !t.Element) return i.isSupported = !1, i; let e = t.document; const l = e, s = l.currentScript; t.DocumentFragment; const u = t.HTMLTemplateElement, T = t.Node, B = t.Element, S = t.NodeFilter; t.NamedNodeMap === void 0 && (t.NamedNodeMap || t.MozNamedAttrMap), t.HTMLFormElement; const D = t.DOMParser, z = t.trustedTypes, Y = B.prototype, St = rt(Y, "cloneNode"), mt = rt(Y, "remove"), Ft = rt(Y, "nextSibling"), Z = rt(Y, "childNodes"), yt = rt(Y, "parentNode"), Ki = rt(Y, "shadowRoot"), pi = rt(Y, "attributes"), N = T && T.prototype ? rt(T.prototype, "nodeType") : null, J = T && T.prototype ? rt(T.prototype, "nodeName") : null; if (typeof u == "function") { const g = e.createElement("template"); g.content && g.content.ownerDocument && (e = g.content.ownerDocument); } let G, xt = "", mi, Zi = !1, Wt = 0; const Ji = function() { if (Wt > 0) throw kt('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.'); }, Lt = function(o) { Ji(), Wt++; try { return G.createHTML(o); } finally { Wt--; } }, he = function(o) { Ji(), Wt++; try { return G.createScriptURL(o); } finally { Wt--; } }, ne = function() { return Zi || (mi = Bo(z, s), Zi = !0), mi; }, Kt = e, yi = Kt.implementation, Qi = Kt.createNodeIterator, ce = Kt.createDocumentFragment, de = Kt.getElementsByTagName, Ce = l.importNode; let L = Rr(); i.isSupported = typeof Vr == "function" && typeof yt == "function" && yi && yi.createHTMLDocument !== void 0; const ge = co, ue = Co, pe = go, me = uo, ye = po, xe = mo, tr = yo, fe = fo; let ir = Dr, v = null; const rr = k({}, [ ...Or, ...Di, ...zi, ...Wi, ...qr ]); let _ = null; const er = k({}, [ ...Ir, ...Ri, ...Mr, ...si ]); let E = Object.seal(It(null, { tagNameCheck: { writable: !0, configurable: !1, enumerable: !0, value: null }, attributeNameCheck: { writable: !0, configurable: !1, enumerable: !0, value: null }, allowCustomizedBuiltInElements: { writable: !0, configurable: !1, enumerable: !0, value: !1 } })), Rt = null, or = null; const at = Object.seal(It(null, { tagCheck: { writable: !0, configurable: !1, enumerable: !0, value: null }, attributeCheck: { writable: !0, configurable: !1, enumerable: !0, value: null } })); let sr = !0, xi = !0, ar = !1, lr = !0, lt = !1, ht = !0, ft = !1, fi = !1, Ti = null, ki = null, bi = !1, vt = !1, Zt = !1, Jt = !1, hr = !0, nr = !1; const cr = "user-content-"; let Bi = !0, Si = !1, _t = {}, Q = null; const Fi = k({}, [ "annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "selectedcontent", "style", "svg", "template", "thead", "title", "video", "xmp" ]); let dr = null; const Cr = k({}, [ "audio", "video", "img", "source", "image", "track" ]); let Li = null; const gr = k({}, [ "alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns" ]), Qt = "http://www.w3.org/1998/Math/MathML", ti = "http://www.w3.org/2000/svg", tt = "http://www.w3.org/1999/xhtml"; let Et = tt, vi = !1, _i = null; const Te = k({}, [ Qt, ti, tt ], Mi), ur = I([ "mi", "mo", "mn", "ms", "mtext" ]); let Ei = k({}, ur); const pr = I(["annotation-xml"]); let Ai = k({}, pr); const ke = k({}, [ "title", "style", "font", "a", "script" ]); let Pt = null; const be = ["application/xhtml+xml", "text/html"], Be = "text/html"; let F = null, At = null; const Se = e.createElement("form"), mr = function(o) { return o instanceof RegExp || o instanceof Function; }, wi = function() { let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; if (At && At === o) return; (!o || typeof o != "object") && (o = {}), o = U(o), Pt = be.indexOf(o.PARSER_MEDIA_TYPE) === -1 ? Be : o.PARSER_MEDIA_TYPE, F = Pt === "application/xhtml+xml" ? Mi : $t, v = Ct(o, "ALLOWED_TAGS", rr, { transform: F }), _ = Ct(o, "ALLOWED_ATTR", er, { transform: F }), _i = Ct(o, "ALLOWED_NAMESPACES", Te, { transform: Mi }), Li = Ct(o, "ADD_URI_SAFE_ATTR", gr, { transform: F, base: gr }), dr = Ct(o, "ADD_DATA_URI_TAGS", Cr, { transform: F, base: Cr }), Q = Ct(o, "FORBID_CONTENTS", Fi, { transform: F }), Rt = Ct(o, "FORBID_TAGS", U({}), { transform: F }), or = Ct(o, "FORBID_ATTR", U({}), { transform: F }), _t = O(o, "USE_PROFILES") ? o.USE_PROFILES && typeof o.USE_PROFILES == "object" ? U(o.USE_PROFILES) : o.USE_PROFILES : !1, sr = o.ALLOW_ARIA_ATTR !== !1, xi = o.ALLOW_DATA_ATTR !== !1, ar = o.ALLOW_UNKNOWN_PROTOCOLS || !1, lr = o.ALLOW_SELF_CLOSE_IN_ATTR !== !1, lt = o.SAFE_FOR_TEMPLATES || !1, ht = o.SAFE_FOR_XML !== !1, ft = o.WHOLE_DOCUMENT || !1, vt = o.RETURN_DOM || !1, Zt = o.RETURN_DOM_FRAGMENT || !1, Jt = o.RETURN_TRUSTED_TYPE || !1, bi = o.FORCE_BODY || !1, hr = o.SANITIZE_DOM !== !1, nr = o.SANITIZE_NAMED_PROPS || !1, Bi = o.KEEP_CONTENT !== !1, Si = o.IN_PLACE || !1, ir = lo(o.ALLOWED_URI_REGEXP) ? o.ALLOWED_URI_REGEXP : Dr, Et = typeof o.NAMESPACE == "string" ? o.NAMESPACE : tt, Ei = O(o, "MATHML_TEXT_INTEGRATION_POINTS") && o.MATHML_TEXT_INTEGRATION_POINTS && typeof o.MATHML_TEXT_INTEGRATION_POINTS == "object" ? U(o.MATHML_TEXT_INTEGRATION_POINTS) : k({}, ur), Ai = O(o, "HTML_INTEGRATION_POINTS") && o.HTML_INTEGRATION_POINTS && typeof o.HTML_INTEGRATION_POINTS == "object" ? U(o.HTML_INTEGRATION_POINTS) : k({}, pr); const h = O(o, "CUSTOM_ELEMENT_HANDLING") && o.CUSTOM_ELEMENT_HANDLING && typeof o.CUSTOM_ELEMENT_HANDLING == "object" ? U(o.CUSTOM_ELEMENT_HANDLING) : It(null); if (E = It(null), O(h, "tagNameCheck") && mr(h.tagNameCheck) && (E.tagNameCheck = h.tagNameCheck), O(h, "attributeNameCheck") && mr(h.attributeNameCheck) && (E.attributeNameCheck = h.attributeNameCheck), O(h, "allowCustomizedBuiltInElements") && typeof h.allowCustomizedBuiltInElements == "boolean" && (E.allowCustomizedBuiltInElements = h.allowCustomizedBuiltInElements), M(E), lt && (xi = !1), Zt && (vt = !0), _t && (v = k({}, qr), _ = It(null), _t.html === !0 && (k(v, Or), k(_, Ir)), _t.svg === !0 && (k(v, Di), k(_, Ri), k(_, si)), _t.svgFilters === !0 && (k(v, zi), k(_, Ri), k(_, si)), _t.mathMl === !0 && (k(v, Wi), k(_, Mr), k(_, si))), at.tagCheck = null, at.attributeCheck = null, O(o, "ADD_TAGS") && (typeof o.ADD_TAGS == "function" ? at.tagCheck = o.ADD_TAGS : ut(o.ADD_TAGS) && (v === rr && (v = U(v)), k(v, o.ADD_TAGS, F))), O(o, "ADD_ATTR") && (typeof o.ADD_ATTR == "function" ? at.attributeCheck = o.ADD_ATTR : ut(o.ADD_ATTR) && (_ === er && (_ = U(_)), k(_, o.ADD_ATTR, F))), O(o, "ADD_URI_SAFE_ATTR") && ut(o.ADD_URI_SAFE_ATTR) && k(Li, o.ADD_URI_SAFE_ATTR, F), O(o, "FORBID_CONTENTS") && ut(o.FORBID_CONTENTS) && (Q === Fi && (Q = U(Q)), k(Q, o.FORBID_CONTENTS, F)), O(o, "ADD_FORBID_CONTENTS") && ut(o.ADD_FORBID_CONTENTS) && (Q === Fi && (Q = U(Q)), k(Q, o.ADD_FORBID_CONTENTS, F)), Bi && (v["#text"] = !0), ft && k(v, [ "html", "head", "body" ]), v.table && (k(v, ["tbody"]), delete Rt.tbody), o.TRUSTED_TYPES_POLICY) { if (typeof o.TRUSTED_TYPES_POLICY.createHTML != "function") throw kt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); if (typeof o.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw kt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); const C = G; G = o.TRUSTED_TYPES_POLICY; try { xt = Lt(""); } catch (p) { throw G = C, p; } } else o.TRUSTED_TYPES_POLICY === null ? (G = void 0, xt = "") : (G === void 0 && (G = ne()), G && typeof xt == "string" && (xt = Lt(""))); I && I(o), At = o; }, yr = k({}, [ ...Di, ...zi, ...ho ]), xr = k({}, [...Wi, ...no]), Fe = function(o, h, C) { return h.namespaceURI === tt ? o === "svg" : h.namespaceURI === Qt ? o === "svg" && (C === "annotation-xml" || Ei[C]) : !!yr[o]; }, Le = function(o, h, C) { return h.namespaceURI === tt ? o === "math" : h.namespaceURI === ti ? o === "math" && Ai[C] : !!xr[o]; }, ve = function(o, h, C) { return h.namespaceURI === ti && !Ai[C] || h.namespaceURI === Qt && !Ei[C] ? !1 : !xr[o] && (ke[o] || !yr[o]); }, _e = function(o) { let h = yt(o); (!h || !h.tagName) && (h = { namespaceURI: Et, tagName: "template" }); const C = $t(o.tagName), p = $t(h.tagName); return _i[o.namespaceURI] ? o.namespaceURI === ti ? Fe(C, h, p) : o.namespaceURI === Qt ? Le(C, h, p) : o.namespaceURI === tt ? ve(C, h, p) : !!(Pt === "application/xhtml+xml" && _i[o.namespaceURI]) : !1; }, nt = function(o) { qt(i.removed, { element: o }); try { yt(o).removeChild(o); } catch { if (mt(o), !yt(o)) throw kt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place"); } }, ii = function(o) { Oi(o); const h = Z(o); if (h) { const p = []; Ot(h, (f) => { qt(p, f); }), Ot(p, (f) => { try { mt(f); } catch { } }); } const C = pi(o); if (C) for (let p = C.length - 1; p >= 0; --p) { const f = C[p], x = f && f.name; if (typeof x == "string") try { o.removeAttribute(x); } catch { } } }, Tt = function(o, h) { try { qt(i.removed, { attribute: h.getAttributeNode(o), from: h }); } catch { qt(i.removed, { attribute: null, from: h }); } if (h.removeAttribute(o), o === "is") if (vt || Zt) try { nt(h); } catch { } else try { h.setAttribute(o, ""); } catch { } }, Ee = function(o) { const h = pi(o); if (h) for (let C = h.length - 1; C >= 0; --C) { const p = h[C], f = p && p.name; if (!(typeof f != "string" || _[F(f)])) try { o.removeAttribute(f); } catch { } } }, Oi = function(o) { const h = [o]; for (; h.length > 0; ) { const C = h.pop(); (N ? N(C) : C.nodeType) === V.element && Ee(C); const p = Z(C); if (p) for (let f = p.length - 1; f >= 0; --f) h.push(p[f]); } }, Ae = function(o) { if (!ht) return; const h = [o]; for (; h.length > 0; ) { const C = h.pop(), p = N ? N(C) : C.nodeType; if (p === V.processingInstruction || p === V.comment && w(Wr, C.data)) { try { mt(C); } catch { } continue; } if (p === V.element) { const x = C, b = F(J ? J(C) : C.nodeName); try { x.hasAttribute && x.hasAttribute("patchsrc") && x.removeAttribute("patchsrc"), x.hasAttribute && x.hasAttribute("for") && b !== "label" && b !== "output" && x.removeAttribute("for"); } catch { } } const f = Z(C); if (f) for (let x = f.length - 1; x >= 0; --x) h.push(f[x]); } }, fr = function(o) { let h = null, C = null; if (bi) o = "<remove></remove>" + o; else { const x = _r(o, /^[\r\n\t ]+/); C = x && x[0]; } Pt === "application/xhtml+xml" && Et === tt && (o = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + o + "</body></html>"); const p = G ? Lt(o) : o; if (Et === tt) try { h = new D().parseFromString(p, Pt); } catch { } if (!h || !h.documentElement) { h = yi.createDocument(Et, "template", null); try { h.documentElement.innerHTML = vi ? xt : p; } catch { } } const f = h.body || h.documentElement; return o && C && f.insertBefore(e.createTextNode(C), f.childNodes[0] || null), Et === tt ? de.call(h, ft ? "html" : "body")[0] : ft ? h.documentElement : f; }, Tr = function(o) { return Qi.call(o.ownerDocument || o, o, S.SHOW_ELEMENT | S.SHOW_COMMENT | S.SHOW_TEXT | S.SHOW_PROCESSING_INSTRUCTION | S.SHOW_CDATA_SECTION, null); }, ri = function(o) { return o = Ht(o, ge, " "), o = Ht(o, ue, " "), o = Ht(o, pe, " "), o; }, qi = function(o) { var h; o.normalize(); const C = Qi.call(o.ownerDocument || o, o, S.SHOW_TEXT | S.SHOW_COMMENT | S.SHOW_CDATA_SECTION | S.SHOW_PROCESSING_INSTRUCTION, null); let p = C.nextNode(); for (; p; ) p.data = ri(p.data), p = C.nextNode(); const f = (h = o.querySelectorAll) === null || h === void 0 ? void 0 : h.call(o, "template"); f && Ot(f, (x) => { wt(x.content) && qi(x.content); }); }, ei = function(o) { const h = J ? J(o) : null; return typeof h != "string" || F(h) !== "form" ? !1 : typeof o.nodeName != "string" || typeof o.textContent != "string" || typeof o.removeChild != "function" || o.attributes !== pi(o) || typeof o.removeAttribute != "function" || typeof o.setAttribute != "function" || typeof o.namespaceURI != "string" || typeof o.insertBefore != "function" || typeof o.hasChildNodes != "function" || o.nodeType !== N(o) || o.childNodes !== Z(o); }, wt = function(o) { if (!N || typeof o != "object" || o === null) return !1; try { return N(o) === V.documentFragment; } catch { return !1; } }, Nt = function(o) { if (!N || typeof o != "object" || o === null) return !1; try { return typeof N(o) == "number"; } catch { return !1; } }; function it(g, o, h) { g.length !== 0 && Ot(g, (C) => { C.call(i, o, h, At); }); } const we = function(o, h) { return !!(ht && o.hasChildNodes() && !Nt(o.firstElementChild) && w(zr, o.textContent) && w(zr, o.innerHTML) || ht && o.namespaceURI === tt && h === "style" && Nt(o.firstElementChild) || o.nodeType === V.processingInstruction || ht && o.nodeType === V.comment && w(Wr, o.data)); }, Oe = function(o, h) { if (!Rt[h] && Br(h) && (E.tagNameCheck instanceof RegExp && w(E.tagNameCheck, h) || E.tagNameCheck instanceof Function && E.tagNameCheck(h))) return !1; if (Bi && !Q[h]) { const C = yt(o), p = Z(o); if (p && C) { const f = p.length; for (let x = f - 1; x >= 0; --x) { const b = Si ? p[x] : St(p[x], !0); C.insertBefore(b, Ft(o)); } } } return nt(o), !0; }, kr = function(o, h) { if (it(L.beforeSanitizeElements, o, null), o !== h && yt(o) === null) return !0; if (ei(o)) return nt(o), !0; const C = F(J ? J(o) : o.nodeName); if (it(L.uponSanitizeElement, o, { tagName: C, allowedTags: v }), o !== h && yt(o) === null) return !0; if (we(o, C)) return nt(o), !0; if (Rt[C] || !(at.tagCheck instanceof Function && at.tagCheck(C)) && !v[C]) { const p = Oe(o, C); return p === !1 && it(L.afterSanitizeElements, o, null), p; } if ((N ? N(o) : o.nodeType) === V.element && !_e(o) || (C === "noscript" || C === "noembed" || C === "noframes") && w(To, o.innerHTML)) return nt(o), !0; if (lt && o.nodeType === V.text) { const p = ri(o.textContent); o.textContent !== p && (qt(i.removed, { element: o.cloneNode() }), o.textContent = p); } return it(L.afterSanitizeElements, o, null), !1; }, br = function(o, h, C) { if (or[h] || ht && h === "patchsrc" || ht && h === "for" && o !== "label" && o !== "output" || hr && (h === "id" || h === "name") && (C in e || C in Se)) return !1; const p = _[h] || at.attributeCheck instanceof Function && at.attributeCheck(h, o); if (!(xi && w(me, h))) { if (!(sr && w(ye, h))) { if (p) { if (!Li[h]) { if (!w(ir, Ht(C, tr, ""))) { if (!((h === "src" || h === "xlink:href" || h === "href") && o !== "script" && Er(C, "data:") === 0 && dr[o])) { if (!(ar && !w(xe, Ht(C, tr, "")))) { if (C) return !1; } } } } } else if (!(Br(o) && (E.tagNameCheck instanceof RegExp && w(E.tagNameCheck, o) || E.tagNameCheck instanceof Function && E.tagNameCheck(o)) && (E.attributeNameCheck instanceof RegExp && w(E.attributeNameCheck, h) || E.attributeNameCheck instanceof Function && E.attributeNameCheck(h, o)) || h === "is" && E.allowCustomizedBuiltInElements && (E.tagNameCheck instanceof RegExp && w(E.tagNameCheck, C) || E.tagNameCheck instanceof Function && E.tagNameCheck(C)))) return !1; } } return !0; }, qe = k({}, [ "annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph" ]), Br = function(o) { return !qe[$t(o)] && w(fe, o); }, Ie = function(o, h, C, p) { if (G && typeof z == "object" && typeof z.getAttributeType == "function" && !C) switch (z.getAttributeType(o, h)) { case "TrustedHTML": return Lt(p); case "TrustedScriptURL": return he(p); } return p; }, Me = function(o, h, C, p) { try { C ? o.setAttributeNS(C, h, p) : o.setAttribute(h, p), ei(o) ? nt(o) : vr(i.removed); } catch { Tt(h, o); } }, Sr = function(o) { it(L.beforeSanitizeAttributes, o, null); const h = o.attributes; if (!h || ei(o)) return; const C = { attrName: "", attrValue: "", keepAttr: !0, allowedAttributes: _, forceKeepAttr: void 0 }; let p = h.length; const f = F(o.nodeName); for (; p--; ) { const x = h[p], b = x.name, ct = x.namespaceURI, dt = x.value, $ = F(b), X = dt; let H = b === "value" ? X : io(X); if (C.attrName = $, C.attrValue = H, C.keepAttr = !0, C.forceKeepAttr = void 0, it(L.uponSanitizeAttribute, o, C), H = C.attrValue, nr && ($ === "id" || $ === "name") && Er(H, cr) !== 0 && (Tt(b, o), H = cr + H), ht && w(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, H)) { Tt(b, o); continue; } if ($ === "attributename" && _r(H, "href")) { Tt(b, o); continue; } if (!C.forceKeepAttr) { if (!C.keepAttr) { Tt(b, o); continue; } if (!lr && w(ko, H)) { Tt(b, o); continue; } if (lt && (H = ri(H)), !br(f, $, H)) { Tt(b, o); continue; } H = Ie(f, $, ct, H), H !== X && Me(o, b, ct, H); } } it(L.afterSanitizeAttributes, o, null); }, oi = function(o) { let h = null; const C = Tr(o); for (it(L.beforeSanitizeShadowDOM, o, null); h = C.nextNode(); ) if (it(L.uponSanitizeShadowNode, h, null), kr(h, o), Sr(h), wt(h.content) && oi(h.content), (N ? N(h) : h.nodeType) === V.element) { const p = Ki(h); wt(p) && (Ii(p), oi(p)); } it(L.afterSanitizeShadowDOM, o, null); }, Ii = function(o) { const h = [{ node: o, shadow: null }]; for (; h.length > 0; ) { const C = h.pop(); if (C.shadow) { oi(C.shadow); continue; } const p = C.node, f = (N ? N(p) : p.nodeType) === V.element, x = Z(p); if (x) for (let b = x.length - 1; b >= 0; --b) h.push({ node: x[b], shadow: null }); if (f) { const b = J ? J(p) : null; if (typeof b == "string" && F(b) === "template") { const ct = p.content; wt(ct) && h.push({ node: ct, shadow: null }); } } if (f) { const b = Ki(p); wt(b) && h.push({ node: null, shadow: b }, { node: b, shadow: null }); } } }; return i.sanitize = function(g) { let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = null, C = null, p = null, f = null; if (vi = !g, vi && (g = "<!-->"), typeof g != "string" && !Nt(g) && (g = ao(g), typeof g != "string")) throw kt("dirty is not a string, aborting"); if (!i.isSupported) return g; fi ? (v = Ti, _ = ki) : wi(o), (L.uponSanitizeElement.length > 0 || L.uponSanitizeAttribute.length > 0) && (v = U(v)), L.uponSanitizeAttribute.length > 0 && (_ = U(_)), i.removed =