vitepress-mermaid-preview
Version:
Mermaid preview for vitepress
1,135 lines (1,134 loc) • 732 kB
JavaScript
import { getCurrentScope as ax, onScopeDispose as ox, onMounted as ui, nextTick as Bn, watch as ki, getCurrentInstance as lf, toRef as lx, readonly as cx, ref as ft, customRef as hx, computed as bt, toValue as ge, shallowRef as _i, unref as wt, defineComponent as Si, reactive as ux, h as Bo, useAttrs as fx, watchEffect as sr, createElementBlock as Tt, openBlock as vt, Fragment as je, createCommentVNode as mr, createElementVNode as Ft, renderList as Lo, mergeProps as ls, createBlock as Zr, normalizeStyle as cs, normalizeClass as Be, withCtx as yr, renderSlot as pe, createVNode as ie, isVNode as Di, onBeforeUnmount as cf, resolveDynamicComponent as Ii, normalizeProps as sh, createTextVNode as ah, toDisplayString as Vn, onUnmounted as dx, useCssVars as px, withDirectives as gx, vShow as mx } from "vue";
function yx(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var hs = { exports: {} }, xx = hs.exports, oh;
function bx() {
return oh || (oh = 1, function(e, t) {
(function(r, i) {
e.exports = i();
})(xx, function() {
var r = 1e3, i = 6e4, n = 36e5, s = "millisecond", o = "second", a = "minute", l = "hour", c = "day", h = "week", u = "month", f = "quarter", d = "year", p = "date", m = "Invalid Date", y = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, b = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, x = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(M) {
var F = ["th", "st", "nd", "rd"], A = M % 100;
return "[" + M + (F[(A - 20) % 10] || F[A] || F[0]) + "]";
} }, v = function(M, F, A) {
var P = String(M);
return !P || P.length >= F ? M : "" + Array(F + 1 - P.length).join(A) + M;
}, w = { s: v, z: function(M) {
var F = -M.utcOffset(), A = Math.abs(F), P = Math.floor(A / 60), R = A % 60;
return (F <= 0 ? "+" : "-") + v(P, 2, "0") + ":" + v(R, 2, "0");
}, m: function M(F, A) {
if (F.date() < A.date()) return -M(A, F);
var P = 12 * (A.year() - F.year()) + (A.month() - F.month()), R = F.clone().add(P, u), q = A - R < 0, Y = F.clone().add(P + (q ? -1 : 1), u);
return +(-(P + (A - R) / (q ? R - Y : Y - R)) || 0);
}, a: function(M) {
return M < 0 ? Math.ceil(M) || 0 : Math.floor(M);
}, p: function(M) {
return { M: u, y: d, w: h, d: c, D: p, h: l, m: a, s: o, ms: s, Q: f }[M] || String(M || "").toLowerCase().replace(/s$/, "");
}, u: function(M) {
return M === void 0;
} }, C = "en", S = {};
S[C] = x;
var T = "$isDayjsObject", $ = function(M) {
return M instanceof D || !(!M || !M[T]);
}, k = function M(F, A, P) {
var R;
if (!F) return C;
if (typeof F == "string") {
var q = F.toLowerCase();
S[q] && (R = q), A && (S[q] = A, R = q);
var Y = F.split("-");
if (!R && Y.length > 1) return M(Y[0]);
} else {
var U = F.name;
S[U] = F, R = U;
}
return !P && R && (C = R), R || !P && C;
}, E = function(M, F) {
if ($(M)) return M.clone();
var A = typeof F == "object" ? F : {};
return A.date = M, A.args = arguments, new D(A);
}, L = w;
L.l = k, L.i = $, L.w = function(M, F) {
return E(M, { locale: F.$L, utc: F.$u, x: F.$x, $offset: F.$offset });
};
var D = function() {
function M(A) {
this.$L = k(A.locale, null, !0), this.parse(A), this.$x = this.$x || A.x || {}, this[T] = !0;
}
var F = M.prototype;
return F.parse = function(A) {
this.$d = function(P) {
var R = P.date, q = P.utc;
if (R === null) return /* @__PURE__ */ new Date(NaN);
if (L.u(R)) return /* @__PURE__ */ new Date();
if (R instanceof Date) return new Date(R);
if (typeof R == "string" && !/Z$/i.test(R)) {
var Y = R.match(y);
if (Y) {
var U = Y[2] - 1 || 0, rt = (Y[7] || "0").substring(0, 3);
return q ? new Date(Date.UTC(Y[1], U, Y[3] || 1, Y[4] || 0, Y[5] || 0, Y[6] || 0, rt)) : new Date(Y[1], U, Y[3] || 1, Y[4] || 0, Y[5] || 0, Y[6] || 0, rt);
}
}
return new Date(R);
}(A), this.init();
}, F.init = function() {
var A = this.$d;
this.$y = A.getFullYear(), this.$M = A.getMonth(), this.$D = A.getDate(), this.$W = A.getDay(), this.$H = A.getHours(), this.$m = A.getMinutes(), this.$s = A.getSeconds(), this.$ms = A.getMilliseconds();
}, F.$utils = function() {
return L;
}, F.isValid = function() {
return this.$d.toString() !== m;
}, F.isSame = function(A, P) {
var R = E(A);
return this.startOf(P) <= R && R <= this.endOf(P);
}, F.isAfter = function(A, P) {
return E(A) < this.startOf(P);
}, F.isBefore = function(A, P) {
return this.endOf(P) < E(A);
}, F.$g = function(A, P, R) {
return L.u(A) ? this[P] : this.set(R, A);
}, F.unix = function() {
return Math.floor(this.valueOf() / 1e3);
}, F.valueOf = function() {
return this.$d.getTime();
}, F.startOf = function(A, P) {
var R = this, q = !!L.u(P) || P, Y = L.p(A), U = function(lt, ct) {
var Ct = L.w(R.$u ? Date.UTC(R.$y, ct, lt) : new Date(R.$y, ct, lt), R);
return q ? Ct : Ct.endOf(c);
}, rt = function(lt, ct) {
return L.w(R.toDate()[lt].apply(R.toDate("s"), (q ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ct)), R);
}, J = this.$W, ut = this.$M, it = this.$D, Bt = "set" + (this.$u ? "UTC" : "");
switch (Y) {
case d:
return q ? U(1, 0) : U(31, 11);
case u:
return q ? U(1, ut) : U(0, ut + 1);
case h:
var I = this.$locale().weekStart || 0, xt = (J < I ? J + 7 : J) - I;
return U(q ? it - xt : it + (6 - xt), ut);
case c:
case p:
return rt(Bt + "Hours", 0);
case l:
return rt(Bt + "Minutes", 1);
case a:
return rt(Bt + "Seconds", 2);
case o:
return rt(Bt + "Milliseconds", 3);
default:
return this.clone();
}
}, F.endOf = function(A) {
return this.startOf(A, !1);
}, F.$set = function(A, P) {
var R, q = L.p(A), Y = "set" + (this.$u ? "UTC" : ""), U = (R = {}, R[c] = Y + "Date", R[p] = Y + "Date", R[u] = Y + "Month", R[d] = Y + "FullYear", R[l] = Y + "Hours", R[a] = Y + "Minutes", R[o] = Y + "Seconds", R[s] = Y + "Milliseconds", R)[q], rt = q === c ? this.$D + (P - this.$W) : P;
if (q === u || q === d) {
var J = this.clone().set(p, 1);
J.$d[U](rt), J.init(), this.$d = J.set(p, Math.min(this.$D, J.daysInMonth())).$d;
} else U && this.$d[U](rt);
return this.init(), this;
}, F.set = function(A, P) {
return this.clone().$set(A, P);
}, F.get = function(A) {
return this[L.p(A)]();
}, F.add = function(A, P) {
var R, q = this;
A = Number(A);
var Y = L.p(P), U = function(ut) {
var it = E(q);
return L.w(it.date(it.date() + Math.round(ut * A)), q);
};
if (Y === u) return this.set(u, this.$M + A);
if (Y === d) return this.set(d, this.$y + A);
if (Y === c) return U(1);
if (Y === h) return U(7);
var rt = (R = {}, R[a] = i, R[l] = n, R[o] = r, R)[Y] || 1, J = this.$d.getTime() + A * rt;
return L.w(J, this);
}, F.subtract = function(A, P) {
return this.add(-1 * A, P);
}, F.format = function(A) {
var P = this, R = this.$locale();
if (!this.isValid()) return R.invalidDate || m;
var q = A || "YYYY-MM-DDTHH:mm:ssZ", Y = L.z(this), U = this.$H, rt = this.$m, J = this.$M, ut = R.weekdays, it = R.months, Bt = R.meridiem, I = function(ct, Ct, Lt, ue) {
return ct && (ct[Ct] || ct(P, q)) || Lt[Ct].slice(0, ue);
}, xt = function(ct) {
return L.s(U % 12 || 12, ct, "0");
}, lt = Bt || function(ct, Ct, Lt) {
var ue = ct < 12 ? "AM" : "PM";
return Lt ? ue.toLowerCase() : ue;
};
return q.replace(b, function(ct, Ct) {
return Ct || function(Lt) {
switch (Lt) {
case "YY":
return String(P.$y).slice(-2);
case "YYYY":
return L.s(P.$y, 4, "0");
case "M":
return J + 1;
case "MM":
return L.s(J + 1, 2, "0");
case "MMM":
return I(R.monthsShort, J, it, 3);
case "MMMM":
return I(it, J);
case "D":
return P.$D;
case "DD":
return L.s(P.$D, 2, "0");
case "d":
return String(P.$W);
case "dd":
return I(R.weekdaysMin, P.$W, ut, 2);
case "ddd":
return I(R.weekdaysShort, P.$W, ut, 3);
case "dddd":
return ut[P.$W];
case "H":
return String(U);
case "HH":
return L.s(U, 2, "0");
case "h":
return xt(1);
case "hh":
return xt(2);
case "a":
return lt(U, rt, !0);
case "A":
return lt(U, rt, !1);
case "m":
return String(rt);
case "mm":
return L.s(rt, 2, "0");
case "s":
return String(P.$s);
case "ss":
return L.s(P.$s, 2, "0");
case "SSS":
return L.s(P.$ms, 3, "0");
case "Z":
return Y;
}
return null;
}(ct) || Y.replace(":", "");
});
}, F.utcOffset = function() {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
}, F.diff = function(A, P, R) {
var q, Y = this, U = L.p(P), rt = E(A), J = (rt.utcOffset() - this.utcOffset()) * i, ut = this - rt, it = function() {
return L.m(Y, rt);
};
switch (U) {
case d:
q = it() / 12;
break;
case u:
q = it();
break;
case f:
q = it() / 3;
break;
case h:
q = (ut - J) / 6048e5;
break;
case c:
q = (ut - J) / 864e5;
break;
case l:
q = ut / n;
break;
case a:
q = ut / i;
break;
case o:
q = ut / r;
break;
default:
q = ut;
}
return R ? q : L.a(q);
}, F.daysInMonth = function() {
return this.endOf(u).$D;
}, F.$locale = function() {
return S[this.$L];
}, F.locale = function(A, P) {
if (!A) return this.$L;
var R = this.clone(), q = k(A, P, !0);
return q && (R.$L = q), R;
}, F.clone = function() {
return L.w(this.$d, this);
}, F.toDate = function() {
return new Date(this.valueOf());
}, F.toJSON = function() {
return this.isValid() ? this.toISOString() : null;
}, F.toISOString = function() {
return this.$d.toISOString();
}, F.toString = function() {
return this.$d.toUTCString();
}, M;
}(), O = D.prototype;
return E.prototype = O, [["$ms", s], ["$s", o], ["$m", a], ["$H", l], ["$W", c], ["$M", u], ["$y", d], ["$D", p]].forEach(function(M) {
O[M[1]] = function(F) {
return this.$g(F, M[0], M[1]);
};
}), E.extend = function(M, F) {
return M.$i || (M(F, D, E), M.$i = !0), E;
}, E.locale = k, E.isDayjs = $, E.unix = function(M) {
return E(1e3 * M);
}, E.en = S[C], E.Ls = S, E.p = {}, E;
});
}(hs)), hs.exports;
}
var vx = bx();
const wx = /* @__PURE__ */ yx(vx), us = {
/* CLAMP */
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: (e) => e >= 255 ? 255 : e < 0 ? 0 : e,
g: (e) => e >= 255 ? 255 : e < 0 ? 0 : e,
b: (e) => e >= 255 ? 255 : e < 0 ? 0 : e,
h: (e) => e % 360,
s: (e) => e >= 100 ? 100 : e < 0 ? 0 : e,
l: (e) => e >= 100 ? 100 : e < 0 ? 0 : e,
a: (e) => e >= 1 ? 1 : e < 0 ? 0 : e
},
/* CONVERSION */
//SOURCE: https://planetcalc.com/7779
toLinear: (e) => {
const t = e / 255;
return e > 0.03928 ? Math.pow((t + 0.055) / 1.055, 2.4) : t / 12.92;
},
//SOURCE: https://gist.github.com/mjackson/5311256
hue2rgb: (e, t, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? e + (t - e) * 6 * r : r < 1 / 2 ? t : r < 2 / 3 ? e + (t - e) * (2 / 3 - r) * 6 : e),
hsl2rgb: ({ h: e, s: t, l: r }, i) => {
if (!t)
return r * 2.55;
e /= 360, t /= 100, r /= 100;
const n = r < 0.5 ? r * (1 + t) : r + t - r * t, s = 2 * r - n;
switch (i) {
case "r":
return us.hue2rgb(s, n, e + 1 / 3) * 255;
case "g":
return us.hue2rgb(s, n, e) * 255;
case "b":
return us.hue2rgb(s, n, e - 1 / 3) * 255;
}
},
rgb2hsl: ({ r: e, g: t, b: r }, i) => {
e /= 255, t /= 255, r /= 255;
const n = Math.max(e, t, r), s = Math.min(e, t, r), o = (n + s) / 2;
if (i === "l")
return o * 100;
if (n === s)
return 0;
const a = n - s, l = o > 0.5 ? a / (2 - n - s) : a / (n + s);
if (i === "s")
return l * 100;
switch (n) {
case e:
return ((t - r) / a + (t < r ? 6 : 0)) * 60;
case t:
return ((r - e) / a + 2) * 60;
case r:
return ((e - t) / a + 4) * 60;
default:
return -1;
}
}
}, Cx = {
/* API */
clamp: (e, t, r) => t > r ? Math.min(t, Math.max(r, e)) : Math.min(r, Math.max(t, e)),
round: (e) => Math.round(e * 1e10) / 1e10
}, kx = {
/* API */
dec2hex: (e) => {
const t = Math.round(e).toString(16);
return t.length > 1 ? t : `0${t}`;
}
}, at = {
channel: us,
lang: Cx,
unit: kx
}, rr = {};
for (let e = 0; e <= 255; e++)
rr[e] = at.unit.dec2hex(e);
const Ht = {
ALL: 0,
RGB: 1,
HSL: 2
};
class _x {
constructor() {
this.type = Ht.ALL;
}
/* API */
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 = Ht.ALL;
}
is(t) {
return this.type === t;
}
}
class Sx {
/* CONSTRUCTOR */
constructor(t, r) {
this.color = r, this.changed = !1, this.data = t, this.type = new _x();
}
/* API */
set(t, r) {
return this.color = r, this.changed = !1, this.data = t, this.type.type = Ht.ALL, this;
}
/* HELPERS */
_ensureHSL() {
const t = this.data, { h: r, s: i, l: n } = t;
r === void 0 && (t.h = at.channel.rgb2hsl(t, "h")), i === void 0 && (t.s = at.channel.rgb2hsl(t, "s")), n === void 0 && (t.l = at.channel.rgb2hsl(t, "l"));
}
_ensureRGB() {
const t = this.data, { r, g: i, b: n } = t;
r === void 0 && (t.r = at.channel.hsl2rgb(t, "r")), i === void 0 && (t.g = at.channel.hsl2rgb(t, "g")), n === void 0 && (t.b = at.channel.hsl2rgb(t, "b"));
}
/* GETTERS */
get r() {
const t = this.data, r = t.r;
return !this.type.is(Ht.HSL) && r !== void 0 ? r : (this._ensureHSL(), at.channel.hsl2rgb(t, "r"));
}
get g() {
const t = this.data, r = t.g;
return !this.type.is(Ht.HSL) && r !== void 0 ? r : (this._ensureHSL(), at.channel.hsl2rgb(t, "g"));
}
get b() {
const t = this.data, r = t.b;
return !this.type.is(Ht.HSL) && r !== void 0 ? r : (this._ensureHSL(), at.channel.hsl2rgb(t, "b"));
}
get h() {
const t = this.data, r = t.h;
return !this.type.is(Ht.RGB) && r !== void 0 ? r : (this._ensureRGB(), at.channel.rgb2hsl(t, "h"));
}
get s() {
const t = this.data, r = t.s;
return !this.type.is(Ht.RGB) && r !== void 0 ? r : (this._ensureRGB(), at.channel.rgb2hsl(t, "s"));
}
get l() {
const t = this.data, r = t.l;
return !this.type.is(Ht.RGB) && r !== void 0 ? r : (this._ensureRGB(), at.channel.rgb2hsl(t, "l"));
}
get a() {
return this.data.a;
}
/* SETTERS */
set r(t) {
this.type.set(Ht.RGB), this.changed = !0, this.data.r = t;
}
set g(t) {
this.type.set(Ht.RGB), this.changed = !0, this.data.g = t;
}
set b(t) {
this.type.set(Ht.RGB), this.changed = !0, this.data.b = t;
}
set h(t) {
this.type.set(Ht.HSL), this.changed = !0, this.data.h = t;
}
set s(t) {
this.type.set(Ht.HSL), this.changed = !0, this.data.s = t;
}
set l(t) {
this.type.set(Ht.HSL), this.changed = !0, this.data.l = t;
}
set a(t) {
this.changed = !0, this.data.a = t;
}
}
const da = new Sx({ r: 0, g: 0, b: 0, a: 0 }, "transparent"), ti = {
/* VARIABLES */
re: /^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,
/* API */
parse: (e) => {
if (e.charCodeAt(0) !== 35)
return;
const t = e.match(ti.re);
if (!t)
return;
const r = t[1], i = parseInt(r, 16), n = r.length, s = n % 4 === 0, o = n > 4, a = o ? 1 : 17, l = o ? 8 : 4, c = s ? 0 : -1, h = o ? 255 : 15;
return da.set({
r: (i >> l * (c + 3) & h) * a,
g: (i >> l * (c + 2) & h) * a,
b: (i >> l * (c + 1) & h) * a,
a: s ? (i & h) * a / 255 : 1
}, e);
},
stringify: (e) => {
const { r: t, g: r, b: i, a: n } = e;
return n < 1 ? `#${rr[Math.round(t)]}${rr[Math.round(r)]}${rr[Math.round(i)]}${rr[Math.round(n * 255)]}` : `#${rr[Math.round(t)]}${rr[Math.round(r)]}${rr[Math.round(i)]}`;
}
}, wr = {
/* VARIABLES */
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,
/* HELPERS */
_hue2deg: (e) => {
const t = e.match(wr.hueRe);
if (t) {
const [, r, i] = t;
switch (i) {
case "grad":
return at.channel.clamp.h(parseFloat(r) * 0.9);
case "rad":
return at.channel.clamp.h(parseFloat(r) * 180 / Math.PI);
case "turn":
return at.channel.clamp.h(parseFloat(r) * 360);
}
}
return at.channel.clamp.h(parseFloat(e));
},
/* API */
parse: (e) => {
const t = e.charCodeAt(0);
if (t !== 104 && t !== 72)
return;
const r = e.match(wr.re);
if (!r)
return;
const [, i, n, s, o, a] = r;
return da.set({
h: wr._hue2deg(i),
s: at.channel.clamp.s(parseFloat(n)),
l: at.channel.clamp.l(parseFloat(s)),
a: o ? at.channel.clamp.a(a ? parseFloat(o) / 100 : parseFloat(o)) : 1
}, e);
},
stringify: (e) => {
const { h: t, s: r, l: i, a: n } = e;
return n < 1 ? `hsla(${at.lang.round(t)}, ${at.lang.round(r)}%, ${at.lang.round(i)}%, ${n})` : `hsl(${at.lang.round(t)}, ${at.lang.round(r)}%, ${at.lang.round(i)}%)`;
}
}, ln = {
/* VARIABLES */
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"
},
/* API */
parse: (e) => {
e = e.toLowerCase();
const t = ln.colors[e];
if (t)
return ti.parse(t);
},
stringify: (e) => {
const t = ti.stringify(e);
for (const r in ln.colors)
if (ln.colors[r] === t)
return r;
}
}, Ji = {
/* VARIABLES */
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,
/* API */
parse: (e) => {
const t = e.charCodeAt(0);
if (t !== 114 && t !== 82)
return;
const r = e.match(Ji.re);
if (!r)
return;
const [, i, n, s, o, a, l, c, h] = r;
return da.set({
r: at.channel.clamp.r(n ? parseFloat(i) * 2.55 : parseFloat(i)),
g: at.channel.clamp.g(o ? parseFloat(s) * 2.55 : parseFloat(s)),
b: at.channel.clamp.b(l ? parseFloat(a) * 2.55 : parseFloat(a)),
a: c ? at.channel.clamp.a(h ? parseFloat(c) / 100 : parseFloat(c)) : 1
}, e);
},
stringify: (e) => {
const { r: t, g: r, b: i, a: n } = e;
return n < 1 ? `rgba(${at.lang.round(t)}, ${at.lang.round(r)}, ${at.lang.round(i)}, ${at.lang.round(n)})` : `rgb(${at.lang.round(t)}, ${at.lang.round(r)}, ${at.lang.round(i)})`;
}
}, Me = {
/* VARIABLES */
format: {
keyword: ln,
hex: ti,
rgb: Ji,
rgba: Ji,
hsl: wr,
hsla: wr
},
/* API */
parse: (e) => {
if (typeof e != "string")
return e;
const t = ti.parse(e) || Ji.parse(e) || wr.parse(e) || ln.parse(e);
if (t)
return t;
throw new Error(`Unsupported color format: "${e}"`);
},
stringify: (e) => !e.changed && e.color ? e.color : e.type.is(Ht.HSL) || e.data.r === void 0 ? wr.stringify(e) : e.a < 1 || !Number.isInteger(e.r) || !Number.isInteger(e.g) || !Number.isInteger(e.b) ? Ji.stringify(e) : ti.stringify(e)
}, hf = (e, t) => {
const r = Me.parse(e);
for (const i in t)
r[i] = at.channel.clamp[i](t[i]);
return Me.stringify(r);
}, cn = (e, t, r = 0, i = 1) => {
if (typeof e != "number")
return hf(e, { a: t });
const n = da.set({
r: at.channel.clamp.r(e),
g: at.channel.clamp.g(t),
b: at.channel.clamp.b(r),
a: at.channel.clamp.a(i)
});
return Me.stringify(n);
}, Tx = (e) => {
const { r: t, g: r, b: i } = Me.parse(e), n = 0.2126 * at.channel.toLinear(t) + 0.7152 * at.channel.toLinear(r) + 0.0722 * at.channel.toLinear(i);
return at.lang.round(n);
}, Bx = (e) => Tx(e) >= 0.5, Ln = (e) => !Bx(e), uf = (e, t, r) => {
const i = Me.parse(e), n = i[t], s = at.channel.clamp[t](n + r);
return n !== s && (i[t] = s), Me.stringify(i);
}, H = (e, t) => uf(e, "l", t), et = (e, t) => uf(e, "l", -t), B = (e, t) => {
const r = Me.parse(e), i = {};
for (const n in t)
t[n] && (i[n] = r[n] + t[n]);
return hf(e, i);
}, Lx = (e, t, r = 50) => {
const { r: i, g: n, b: s, a: o } = Me.parse(e), { r: a, g: l, b: c, a: h } = Me.parse(t), u = r / 100, f = u * 2 - 1, d = o - h, m = ((f * d === -1 ? f : (f + d) / (1 + f * d)) + 1) / 2, y = 1 - m, b = i * m + a * y, x = n * m + l * y, v = s * m + c * y, w = o * u + h * (1 - u);
return cn(b, x, v, w);
}, W = (e, t = 100) => {
const r = Me.parse(e);
return r.r = 255 - r.r, r.g = 255 - r.g, r.b = 255 - r.b, Lx(r, e, t);
};
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
const {
entries: ff,
setPrototypeOf: lh,
isFrozen: Ax,
getPrototypeOf: Ex,
getOwnPropertyDescriptor: Mx
} = Object;
let {
freeze: Qt,
seal: me,
create: df
} = Object, {
apply: Ao,
construct: Eo
} = typeof Reflect < "u" && Reflect;
Qt || (Qt = function(t) {
return t;
});
me || (me = function(t) {
return t;
});
Ao || (Ao = function(t, r, i) {
return t.apply(r, i);
});
Eo || (Eo = function(t, r) {
return new t(...r);
});
const Xn = Jt(Array.prototype.forEach), $x = Jt(Array.prototype.lastIndexOf), ch = Jt(Array.prototype.pop), Ri = Jt(Array.prototype.push), Fx = Jt(Array.prototype.splice), fs = Jt(String.prototype.toLowerCase), Ka = Jt(String.prototype.toString), hh = Jt(String.prototype.match), Pi = Jt(String.prototype.replace), Ox = Jt(String.prototype.indexOf), Dx = Jt(String.prototype.trim), xe = Jt(Object.prototype.hasOwnProperty), Gt = Jt(RegExp.prototype.test), Ni = Ix(TypeError);
function Jt(e) {
return function(t) {
t instanceof RegExp && (t.lastIndex = 0);
for (var r = arguments.length, i = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
i[n - 1] = arguments[n];
return Ao(e, t, i);
};
}
function Ix(e) {
return function() {
for (var t = arguments.length, r = new Array(t), i = 0; i < t; i++)
r[i] = arguments[i];
return Eo(e, r);
};
}
function ht(e, t) {
let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : fs;
lh && lh(e, null);
let i = t.length;
for (; i--; ) {
let n = t[i];
if (typeof n == "string") {
const s = r(n);
s !== n && (Ax(t) || (t[i] = s), n = s);
}
e[n] = !0;
}
return e;
}
function Rx(e) {
for (let t = 0; t < e.length; t++)
xe(e, t) || (e[t] = null);
return e;
}
function We(e) {
const t = df(null);
for (const [r, i] of ff(e))
xe(e, r) && (Array.isArray(i) ? t[r] = Rx(i) : i && typeof i == "object" && i.constructor === Object ? t[r] = We(i) : t[r] = i);
return t;
}
function zi(e, t) {
for (; e !== null; ) {
const i = Mx(e, t);
if (i) {
if (i.get)
return Jt(i.get);
if (typeof i.value == "function")
return Jt(i.value);
}
e = Ex(e);
}
function r() {
return null;
}
return r;
}
const uh = Qt(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Qa = Qt(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Ja = Qt(["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"]), Px = Qt(["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"]), to = Qt(["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"]), Nx = Qt(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), fh = Qt(["#text"]), dh = Qt(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), eo = Qt(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), ph = Qt(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), Zn = Qt(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), zx = me(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Wx = me(/<%[\w\W]*|[\w\W]*%>/gm), qx = me(/\$\{[\w\W]*/gm), Hx = me(/^data-[\-\w.\u00B7-\uFFFF]+$/), jx = me(/^aria-[\-\w]+$/), pf = me(
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
// eslint-disable-line no-useless-escape
), Ux = me(/^(?:\w+script|data):/i), Yx = me(
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
// eslint-disable-line no-control-regex
), gf = me(/^html$/i), Gx = me(/^[a-z][.\w]*(-[.\w]+)+$/i);
var gh = /* @__PURE__ */ Object.freeze({
__proto__: null,
ARIA_ATTR: jx,
ATTR_WHITESPACE: Yx,
CUSTOM_ELEMENT: Gx,
DATA_ATTR: Hx,
DOCTYPE_NAME: gf,
ERB_EXPR: Wx,
IS_ALLOWED_URI: pf,
IS_SCRIPT_OR_DATA: Ux,
MUSTACHE_EXPR: zx,
TMPLIT_EXPR: qx
});
const Wi = {
element: 1,
text: 3,
// Deprecated
progressingInstruction: 7,
comment: 8,
document: 9
}, Vx = function() {
return typeof window > "u" ? null : window;
}, Xx = function(t, r) {
if (typeof t != "object" || typeof t.createPolicy != "function")
return null;
let i = null;
const n = "data-tt-policy-suffix";
r && r.hasAttribute(n) && (i = r.getAttribute(n));
const s = "dompurify" + (i ? "#" + i : "");
try {
return t.createPolicy(s, {
createHTML(o) {
return o;
},
createScriptURL(o) {
return o;
}
});
} catch {
return console.warn("TrustedTypes policy " + s + " could not be created."), null;
}
}, mh = function() {
return {
afterSanitizeAttributes: [],
afterSanitizeElements: [],
afterSanitizeShadowDOM: [],
beforeSanitizeAttributes: [],
beforeSanitizeElements: [],
beforeSanitizeShadowDOM: [],
uponSanitizeAttribute: [],
uponSanitizeElement: [],
uponSanitizeShadowNode: []
};
};
function mf() {
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Vx();
const t = (tt) => mf(tt);
if (t.version = "3.2.6", t.removed = [], !e || !e.document || e.document.nodeType !== Wi.document || !e.Element)
return t.isSupported = !1, t;
let {
document: r
} = e;
const i = r, n = i.currentScript, {
DocumentFragment: s,
HTMLTemplateElement: o,
Node: a,
Element: l,
NodeFilter: c,
NamedNodeMap: h = e.NamedNodeMap || e.MozNamedAttrMap,
HTMLFormElement: u,
DOMParser: f,
trustedTypes: d
} = e, p = l.prototype, m = zi(p, "cloneNode"), y = zi(p, "remove"), b = zi(p, "nextSibling"), x = zi(p, "childNodes"), v = zi(p, "parentNode");
if (typeof o == "function") {
const tt = r.createElement("template");
tt.content && tt.content.ownerDocument && (r = tt.content.ownerDocument);
}
let w, C = "";
const {
implementation: S,
createNodeIterator: T,
createDocumentFragment: $,
getElementsByTagName: k
} = r, {
importNode: E
} = i;
let L = mh();
t.isSupported = typeof ff == "function" && typeof v == "function" && S && S.createHTMLDocument !== void 0;
const {
MUSTACHE_EXPR: D,
ERB_EXPR: O,
TMPLIT_EXPR: M,
DATA_ATTR: F,
ARIA_ATTR: A,
IS_SCRIPT_OR_DATA: P,
ATTR_WHITESPACE: R,
CUSTOM_ELEMENT: q
} = gh;
let {
IS_ALLOWED_URI: Y
} = gh, U = null;
const rt = ht({}, [...uh, ...Qa, ...Ja, ...to, ...fh]);
let J = null;
const ut = ht({}, [...dh, ...eo, ...ph, ...Zn]);
let it = Object.seal(df(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
}
})), Bt = null, I = null, xt = !0, lt = !0, ct = !1, Ct = !0, Lt = !1, ue = !0, Yt = !1, Wn = !1, Ha = !1, Wr = !1, qn = !1, Hn = !1, Wc = !0, qc = !1;
const Q0 = "user-content-";
let ja = !0, $i = !1, qr = {}, Hr = null;
const Hc = ht({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
let jc = null;
const Uc = ht({}, ["audio", "video", "img", "source", "image", "track"]);
let Ua = null;
const Yc = ht({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), jn = "http://www.w3.org/1998/Math/MathML", Un = "http://www.w3.org/2000/svg", De = "http://www.w3.org/1999/xhtml";
let jr = De, Ya = !1, Ga = null;
const J0 = ht({}, [jn, Un, De], Ka);
let Yn = ht({}, ["mi", "mo", "mn", "ms", "mtext"]), Gn = ht({}, ["annotation-xml"]);
const tx = ht({}, ["title", "style", "font", "a", "script"]);
let Fi = null;
const ex = ["application/xhtml+xml", "text/html"], rx = "text/html";
let Rt = null, Ur = null;
const ix = r.createElement("form"), Gc = function(_) {
return _ instanceof RegExp || _ instanceof Function;
}, Va = function() {
let _ = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
if (!(Ur && Ur === _)) {
if ((!_ || typeof _ != "object") && (_ = {}), _ = We(_), Fi = // eslint-disable-next-line unicorn/prefer-includes
ex.indexOf(_.PARSER_MEDIA_TYPE) === -1 ? rx : _.PARSER_MEDIA_TYPE, Rt = Fi === "application/xhtml+xml" ? Ka : fs, U = xe(_, "ALLOWED_TAGS") ? ht({}, _.ALLOWED_TAGS, Rt) : rt, J = xe(_, "ALLOWED_ATTR") ? ht({}, _.ALLOWED_ATTR, Rt) : ut, Ga = xe(_, "ALLOWED_NAMESPACES") ? ht({}, _.ALLOWED_NAMESPACES, Ka) : J0, Ua = xe(_, "ADD_URI_SAFE_ATTR") ? ht(We(Yc), _.ADD_URI_SAFE_ATTR, Rt) : Yc, jc = xe(_, "ADD_DATA_URI_TAGS") ? ht(We(Uc), _.ADD_DATA_URI_TAGS, Rt) : Uc, Hr = xe(_, "FORBID_CONTENTS") ? ht({}, _.FORBID_CONTENTS, Rt) : Hc, Bt = xe(_, "FORBID_TAGS") ? ht({}, _.FORBID_TAGS, Rt) : We({}), I = xe(_, "FORBID_ATTR") ? ht({}, _.FORBID_ATTR, Rt) : We({}), qr = xe(_, "USE_PROFILES") ? _.USE_PROFILES : !1, xt = _.ALLOW_ARIA_ATTR !== !1, lt = _.ALLOW_DATA_ATTR !== !1, ct = _.ALLOW_UNKNOWN_PROTOCOLS || !1, Ct = _.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Lt = _.SAFE_FOR_TEMPLATES || !1, ue = _.SAFE_FOR_XML !== !1, Yt = _.WHOLE_DOCUMENT || !1, Wr = _.RETURN_DOM || !1, qn = _.RETURN_DOM_FRAGMENT || !1, Hn = _.RETURN_TRUSTED_TYPE || !1, Ha = _.FORCE_BODY || !1, Wc = _.SANITIZE_DOM !== !1, qc = _.SANITIZE_NAMED_PROPS || !1, ja = _.KEEP_CONTENT !== !1, $i = _.IN_PLACE || !1, Y = _.ALLOWED_URI_REGEXP || pf, jr = _.NAMESPACE || De, Yn = _.MATHML_TEXT_INTEGRATION_POINTS || Yn, Gn = _.HTML_INTEGRATION_POINTS || Gn, it = _.CUSTOM_ELEMENT_HANDLING || {}, _.CUSTOM_ELEMENT_HANDLING && Gc(_.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (it.tagNameCheck = _.CUSTOM_ELEMENT_HANDLING.tagNameCheck), _.CUSTOM_ELEMENT_HANDLING && Gc(_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (it.attributeNameCheck = _.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), _.CUSTOM_ELEMENT_HANDLING && typeof _.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (it.allowCustomizedBuiltInElements = _.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Lt && (lt = !1), qn && (Wr = !0), qr && (U = ht({}, fh), J = [], qr.html === !0 && (ht(U, uh), ht(J, dh)), qr.svg === !0 && (ht(U, Qa), ht(J, eo), ht(J, Zn)), qr.svgFilters === !0 && (ht(U, Ja), ht(J, eo), ht(J, Zn)), qr.mathMl === !0 && (ht(U, to), ht(J, ph), ht(J, Zn))), _.ADD_TAGS && (U === rt && (U = We(U)), ht(U, _.ADD_TAGS, Rt)), _.ADD_ATTR && (J === ut && (J = We(J)), ht(J, _.ADD_ATTR, Rt)), _.ADD_URI_SAFE_ATTR && ht(Ua, _.ADD_URI_SAFE_ATTR, Rt), _.FORBID_CONTENTS && (Hr === Hc && (Hr = We(Hr)), ht(Hr, _.FORBID_CONTENTS, Rt)), ja && (U["#text"] = !0), Yt && ht(U, ["html", "head", "body"]), U.table && (ht(U, ["tbody"]), delete Bt.tbody), _.TRUSTED_TYPES_POLICY) {
if (typeof _.TRUSTED_TYPES_POLICY.createHTML != "function")
throw Ni('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
if (typeof _.TRUSTED_TYPES_POLICY.createScriptURL != "function")
throw Ni('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
w = _.TRUSTED_TYPES_POLICY, C = w.createHTML("");
} else
w === void 0 && (w = Xx(d, n)), w !== null && typeof C == "string" && (C = w.createHTML(""));
Qt && Qt(_), Ur = _;
}
}, Vc = ht({}, [...Qa, ...Ja, ...Px]), Xc = ht({}, [...to, ...Nx]), nx = function(_) {
let z = v(_);
(!z || !z.tagName) && (z = {
namespaceURI: jr,
tagName: "template"
});
const V = fs(_.tagName), _t = fs(z.tagName);
return Ga[_.namespaceURI] ? _.namespaceURI === Un ? z.namespaceURI === De ? V === "svg" : z.namespaceURI === jn ? V === "svg" && (_t === "annotation-xml" || Yn[_t]) : !!Vc[V] : _.namespaceURI === jn ? z.namespaceURI === De ? V === "math" : z.namespaceURI === Un ? V === "math" && Gn[_t] : !!Xc[V] : _.namespaceURI === De ? z.namespaceURI === Un && !Gn[_t] || z.namespaceURI === jn && !Yn[_t] ? !1 : !Xc[V] && (tx[V] || !Vc[V]) : !!(Fi === "application/xhtml+xml" && Ga[_.namespaceURI]) : !1;
}, ke = function(_) {
Ri(t.removed, {
element: _
});
try {
v(_).removeChild(_);
} catch {
y(_);
}
}, Yr = function(_, z) {
try {
Ri(t.removed, {
attribute: z.getAttributeNode(_),
from: z
});
} catch {
Ri(t.removed, {
attribute: null,
from: z
});
}
if (z.removeAttribute(_), _ === "is")
if (Wr || qn)
try {
ke(z);
} catch {
}
else
try {
z.setAttribute(_, "");
} catch {
}
}, Zc = function(_) {
let z = null, V = null;
if (Ha)
_ = "<remove></remove>" + _;
else {
const Mt = hh(_, /^[\r\n\t ]+/);
V = Mt && Mt[0];
}
Fi === "application/xhtml+xml" && jr === De && (_ = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + _ + "</body></html>");
const _t = w ? w.createHTML(_) : _;
if (jr === De)
try {
z = new f().parseFromString(_t, Fi);
} catch {
}
if (!z || !z.documentElement) {
z = S.createDocument(jr, "template", null);
try {
z.documentElement.innerHTML = Ya ? C : _t;
} catch {
}
}
const Wt = z.body || z.documentElement;
return _ && V && Wt.insertBefore(r.createTextNode(V), Wt.childNodes[0] || null), jr === De ? k.call(z, Yt ? "html" : "body")[0] : Yt ? z.documentElement : Wt;
}, Kc = function(_) {
return T.call(
_.ownerDocument || _,
_,
// eslint-disable-next-line no-bitwise
c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
null
);
}, Xa = function(_) {
return _ instanceof u && (typeof _.nodeName != "string" || typeof _.textContent != "string" || typeof _.removeChild != "function" || !(_.attributes instanceof h) || typeof _.removeAttribute != "function" || typeof _.setAttribute != "function" || typeof _.namespaceURI != "string" || typeof _.insertBefore != "function" || typeof _.hasChildNodes != "function");
}, Qc = function(_) {
return typeof a == "function" && _ instanceof a;
};
function Ie(tt, _, z) {
Xn(tt, (V) => {
V.call(t, _, z, Ur);
});
}
const Jc = function(_) {
let z = null;
if (Ie(L.beforeSanitizeElements, _, null), Xa(_))
return ke(_), !0;
const V = Rt(_.nodeName);
if (Ie(L.uponSanitizeElement, _, {
tagName: V,
allowedTags: U
}), ue && _.hasChildNodes() && !Qc(_.firstElementChild) && Gt(/<[/\w!]/g, _.innerHTML) && Gt(/<[/\w!]/g, _.textContent) || _.nodeType === Wi.progressingInstruction || ue && _.nodeType === Wi.comment && Gt(/<[/\w]/g, _.data))
return ke(_), !0;
if (!U[V] || Bt[V]) {
if (!Bt[V] && eh(V) && (it.tagNameCheck instanceof RegExp && Gt(it.tagNameCheck, V) || it.tagNameCheck instanceof Function && it.tagNameCheck(V)))
return !1;
if (ja && !Hr[V]) {
const _t = v(_) || _.parentNode, Wt = x(_) || _.childNodes;
if (Wt && _t) {
const Mt = Wt.length;
for (let te = Mt - 1; te >= 0; --te) {
const Re = m(Wt[te], !0);
Re.__removalCount = (_.__removalCount || 0) + 1, _t.insertBefore(Re, b(_));
}
}
}
return ke(_), !0;
}
return _ instanceof l && !nx(_) || (V === "noscript" || V === "noembed" || V === "noframes") && Gt(/<\/no(script|embed|frames)/i, _.innerHTML) ? (ke(_), !0) : (Lt && _.nodeType === Wi.text && (z = _.textContent, Xn([D, O, M], (_t) => {
z = Pi(z, _t, " ");
}), _.textContent !== z && (Ri(t.removed, {
element: _.cloneNode()
}), _.textContent = z)), Ie(L.afterSanitizeElements, _, null), !1);
}, th = function(_, z, V) {
if (Wc && (z === "id" || z === "name") && (V in r || V in ix))
return !1;
if (!(lt && !I[z] && Gt(F, z))) {
if (!(xt && Gt(A, z))) {
if (!J[z] || I[z]) {
if (
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck