//#region node_modules/dompurify/dist/purify.es.mjs
function e(e, t) {
	(t == null || t > e.length) && (t = e.length);
	for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
	return r;
}
function t(e) {
	if (Array.isArray(e)) return e;
}
function n(e, t) {
	var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
	if (n != null) {
		var r, i, a, o, s = [], c = !0, l = !1;
		try {
			if (a = (n = n.call(e)).next, t !== 0) for (; !(c = (r = a.call(n)).done) && (s.push(r.value), s.length !== t); c = !0);
		} catch (e) {
			l = !0, i = e;
		} finally {
			try {
				if (!c && n.return != null && (o = n.return(), Object(o) !== o)) return;
			} finally {
				if (l) throw i;
			}
		}
		return s;
	}
}
function r() {
	throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function i(e, i) {
	return t(e) || n(e, i) || a(e, i) || r();
}
function a(t, n) {
	if (t) {
		if (typeof t == "string") return e(t, n);
		var r = {}.toString.call(t).slice(8, -1);
		return r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set" ? Array.from(t) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? e(t, n) : void 0;
	}
}
var o = Object.entries, s = Object.setPrototypeOf, c = Object.isFrozen, l = Object.getPrototypeOf, u = Object.getOwnPropertyDescriptor, d = Object.freeze, f = Object.seal, p = Object.create, m = typeof Reflect < "u" && Reflect, h = m.apply, ee = m.construct;
d ||= function(e) {
	return e;
}, f ||= function(e) {
	return e;
}, h ||= function(e, t) {
	var n = [...arguments].slice(2);
	return e.apply(t, n);
}, ee ||= function(e) {
	return new e(...[...arguments].slice(1));
};
var te = w(Array.prototype.forEach), ne = w(Array.prototype.lastIndexOf), re = w(Array.prototype.pop), g = w(Array.prototype.push), ie = w(Array.prototype.splice), _ = Array.isArray, ae = w(String.prototype.toLowerCase), oe = w(String.prototype.toString), se = w(String.prototype.match), ce = w(String.prototype.replace), le = w(String.prototype.indexOf), ue = w(String.prototype.trim), de = w(Number.prototype.toString), fe = w(Boolean.prototype.toString), v = typeof BigInt > "u" ? null : w(BigInt.prototype.toString), y = typeof Symbol > "u" ? null : w(Symbol.prototype.toString), b = w(Object.prototype.hasOwnProperty), x = w(Object.prototype.toString), S = w(RegExp.prototype.test), C = T(TypeError);
function w(e) {
	return function(t) {
		t instanceof RegExp && (t.lastIndex = 0);
		var n = [...arguments].slice(1);
		return h(e, t, n);
	};
}
function T(e) {
	return function() {
		return ee(e, [...arguments]);
	};
}
function E(e, t) {
	let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ae;
	if (s && s(e, null), !_(t)) return e;
	let r = t.length;
	for (; r--;) {
		let i = t[r];
		if (typeof i == "string") {
			let e = n(i);
			e !== i && (c(t) || (t[r] = e), i = e);
		}
		e[i] = !0;
	}
	return e;
}
function D(e) {
	for (let t = 0; t < e.length; t++) b(e, t) || (e[t] = null);
	return e;
}
function O(e) {
	let t = p(null);
	for (let r of o(e)) {
		var n = i(r, 2);
		let a = n[0], o = n[1];
		b(e, a) && (_(o) ? t[a] = D(o) : o && typeof o == "object" && o.constructor === Object ? t[a] = O(o) : t[a] = o);
	}
	return t;
}
function pe(e) {
	switch (typeof e) {
		case "string": return e;
		case "number": return de(e);
		case "boolean": return fe(e);
		case "bigint": return v ? v(e) : "0";
		case "symbol": return y ? y(e) : "Symbol()";
		case "undefined": return x(e);
		case "function":
		case "object": {
			if (e === null) return x(e);
			let t = e, n = k(t, "toString");
			if (typeof n == "function") {
				let e = n(t);
				return typeof e == "string" ? e : x(e);
			}
			return x(e);
		}
		default: return x(e);
	}
}
function k(e, t) {
	for (; e !== null;) {
		let n = u(e, t);
		if (n) {
			if (n.get) return w(n.get);
			if (typeof n.value == "function") return w(n.value);
		}
		e = l(e);
	}
	function n() {
		return null;
	}
	return n;
}
function me(e) {
	try {
		return S(e, ""), !0;
	} catch {
		return !1;
	}
}
var he = d(/* @__PURE__ */ "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".split(".")), ge = d(/* @__PURE__ */ "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".split(".")), _e = d([
	"feBlend",
	"feColorMatrix",
	"feComponentTransfer",
	"feComposite",
	"feConvolveMatrix",
	"feDiffuseLighting",
	"feDisplacementMap",
	"feDistantLight",
	"feDropShadow",
	"feFlood",
	"feFuncA",
	"feFuncB",
	"feFuncG",
	"feFuncR",
	"feGaussianBlur",
	"feImage",
	"feMerge",
	"feMergeNode",
	"feMorphology",
	"feOffset",
	"fePointLight",
	"feSpecularLighting",
	"feSpotLight",
	"feTile",
	"feTurbulence"
]), ve = d([
	"animate",
	"color-profile",
	"cursor",
	"discard",
	"font-face",
	"font-face-format",
	"font-face-name",
	"font-face-src",
	"font-face-uri",
	"foreignobject",
	"hatch",
	"hatchpath",
	"mesh",
	"meshgradient",
	"meshpatch",
	"meshrow",
	"missing-glyph",
	"script",
	"set",
	"solidcolor",
	"unknown",
	"use"
]), ye = d(/* @__PURE__ */ "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".split(".")), be = d([
	"maction",
	"maligngroup",
	"malignmark",
	"mlongdiv",
	"mscarries",
	"mscarry",
	"msgroup",
	"mstack",
	"msline",
	"msrow",
	"semantics",
	"annotation",
	"annotation-xml",
	"mprescripts",
	"none"
]), xe = d(["#text"]), Se = d(/* @__PURE__ */ "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".split(".")), Ce = d(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), we = d(/* @__PURE__ */ "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".split(".")), Te = d([
	"xlink:href",
	"xml:id",
	"xlink:title",
	"xml:space",
	"xmlns:xlink"
]), Ee = f(/{{[\w\W]*|^[\w\W]*}}/g), De = f(/<%[\w\W]*|^[\w\W]*%>/g), Oe = f(/\${[\w\W]*/g), ke = f(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ae = f(/^aria-[\-\w]+$/), je = f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Me = f(/^(?:\w+script|data):/i), Ne = f(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Pe = f(/^html$/i), Fe = f(/^[a-z][.\w]*(-[.\w]+)+$/i), Ie = f(/<[/\w!]/g), Le = f(/<[/\w]/g), Re = f(/<\/no(script|embed|frames)/i), ze = f(/\/>/i), A = {
	element: 1,
	attribute: 2,
	text: 3,
	cdataSection: 4,
	entityReference: 5,
	entityNode: 6,
	processingInstruction: 7,
	comment: 8,
	document: 9,
	documentType: 10,
	documentFragment: 11,
	notation: 12
}, Be = function() {
	return typeof window > "u" ? null : window;
}, Ve = function(e, t) {
	if (typeof e != "object" || typeof e.createPolicy != "function") return null;
	let n = null, r = "data-tt-policy-suffix";
	t && t.hasAttribute(r) && (n = t.getAttribute(r));
	let i = "dompurify" + (n ? "#" + n : "");
	try {
		return e.createPolicy(i, {
			createHTML(e) {
				return e;
			},
			createScriptURL(e) {
				return e;
			}
		});
	} catch {
		return console.warn("TrustedTypes policy " + i + " could not be created."), null;
	}
}, He = function() {
	return {
		afterSanitizeAttributes: [],
		afterSanitizeElements: [],
		afterSanitizeShadowDOM: [],
		beforeSanitizeAttributes: [],
		beforeSanitizeElements: [],
		beforeSanitizeShadowDOM: [],
		uponSanitizeAttribute: [],
		uponSanitizeElement: [],
		uponSanitizeShadowNode: []
	};
}, j = function(e, t, n, r) {
	return b(e, t) && _(e[t]) ? E(r.base ? O(r.base) : {}, e[t], r.transform) : n;
};
function Ue() {
	let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Be(), t = (e) => Ue(e);
	if (t.version = "3.4.11", t.removed = [], !e || !e.document || e.document.nodeType !== A.document || !e.Element) return t.isSupported = !1, t;
	let n = e.document, r = n, i = r.currentScript;
	e.DocumentFragment;
	let a = e.HTMLTemplateElement, s = e.Node, c = e.Element, l = e.NodeFilter;
	e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
	let u = e.DOMParser, m = e.trustedTypes, h = c.prototype, ee = k(h, "cloneNode"), de = k(h, "remove"), fe = k(h, "nextSibling"), v = k(h, "childNodes"), y = k(h, "parentNode"), x = k(h, "shadowRoot"), w = k(h, "attributes"), T = s && s.prototype ? k(s.prototype, "nodeType") : null, D = s && s.prototype ? k(s.prototype, "nodeName") : null;
	if (typeof a == "function") {
		let e = n.createElement("template");
		e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
	}
	let M, N = "", We, Ge = !1, P = 0, Ke = function() {
		if (P > 0) throw C("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.");
	}, F = function(e) {
		Ke(), P++;
		try {
			return M.createHTML(e);
		} finally {
			P--;
		}
	}, qe = function(e) {
		Ke(), P++;
		try {
			return M.createScriptURL(e);
		} finally {
			P--;
		}
	}, Je = function() {
		return Ge ||= (We = Ve(m, i), !0), We;
	}, Ye = n, Xe = Ye.implementation, Ze = Ye.createNodeIterator, Qe = Ye.createDocumentFragment, $e = Ye.getElementsByTagName, et = r.importNode, I = He();
	t.isSupported = typeof o == "function" && typeof y == "function" && Xe && Xe.createHTMLDocument !== void 0;
	let tt = Ee, nt = De, rt = Oe, it = ke, at = Ae, ot = Me, st = Ne, ct = Fe, lt = je, L = null, ut = E({}, [
		...he,
		...ge,
		..._e,
		...ye,
		...xe
	]), R = null, dt = E({}, [
		...Se,
		...Ce,
		...we,
		...Te
	]), z = Object.seal(p(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
		}
	})), ft = null, pt = null, B = Object.seal(p(null, {
		tagCheck: {
			writable: !0,
			configurable: !1,
			enumerable: !0,
			value: null
		},
		attributeCheck: {
			writable: !0,
			configurable: !1,
			enumerable: !0,
			value: null
		}
	})), mt = !0, ht = !0, gt = !1, _t = !0, V = !1, vt = !0, H = !1, yt = !1, bt = null, xt = null, St = !1, U = !1, Ct = !1, wt = !1, Tt = !0, Et = !1, Dt = "user-content-", Ot = !0, kt = !1, W = {}, G = null, At = E({}, /* @__PURE__ */ "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".split(".")), jt = null, Mt = E({}, [
		"audio",
		"video",
		"img",
		"source",
		"image",
		"track"
	]), Nt = null, Pt = E({}, [
		"alt",
		"class",
		"for",
		"id",
		"label",
		"name",
		"pattern",
		"placeholder",
		"role",
		"summary",
		"title",
		"value",
		"style",
		"xmlns"
	]), Ft = "http://www.w3.org/1998/Math/MathML", It = "http://www.w3.org/2000/svg", K = "http://www.w3.org/1999/xhtml", q = K, Lt = !1, Rt = null, zt = E({}, [
		Ft,
		It,
		K
	], oe), Bt = d([
		"mi",
		"mo",
		"mn",
		"ms",
		"mtext"
	]), Vt = E({}, Bt), Ht = d(["annotation-xml"]), Ut = E({}, Ht), Wt = E({}, [
		"title",
		"style",
		"font",
		"a",
		"script"
	]), Gt = null, Kt = ["application/xhtml+xml", "text/html"], J = null, Y = null, qt = n.createElement("form"), Jt = function(e) {
		return e instanceof RegExp || e instanceof Function;
	}, Yt = function() {
		let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
		if (Y && Y === e) return;
		(!e || typeof e != "object") && (e = {}), e = O(e), Gt = Kt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, J = Gt === "application/xhtml+xml" ? oe : ae, L = j(e, "ALLOWED_TAGS", ut, { transform: J }), R = j(e, "ALLOWED_ATTR", dt, { transform: J }), Rt = j(e, "ALLOWED_NAMESPACES", zt, { transform: oe }), Nt = j(e, "ADD_URI_SAFE_ATTR", Pt, {
			transform: J,
			base: Pt
		}), jt = j(e, "ADD_DATA_URI_TAGS", Mt, {
			transform: J,
			base: Mt
		}), G = j(e, "FORBID_CONTENTS", At, { transform: J }), ft = j(e, "FORBID_TAGS", O({}), { transform: J }), pt = j(e, "FORBID_ATTR", O({}), { transform: J }), W = b(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? O(e.USE_PROFILES) : e.USE_PROFILES : !1, mt = e.ALLOW_ARIA_ATTR !== !1, ht = e.ALLOW_DATA_ATTR !== !1, gt = e.ALLOW_UNKNOWN_PROTOCOLS || !1, _t = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = e.SAFE_FOR_TEMPLATES || !1, vt = e.SAFE_FOR_XML !== !1, H = e.WHOLE_DOCUMENT || !1, U = e.RETURN_DOM || !1, Ct = e.RETURN_DOM_FRAGMENT || !1, wt = e.RETURN_TRUSTED_TYPE || !1, St = e.FORCE_BODY || !1, Tt = e.SANITIZE_DOM !== !1, Et = e.SANITIZE_NAMED_PROPS || !1, Ot = e.KEEP_CONTENT !== !1, kt = e.IN_PLACE || !1, lt = me(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : je, q = typeof e.NAMESPACE == "string" ? e.NAMESPACE : K, Vt = b(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? O(e.MATHML_TEXT_INTEGRATION_POINTS) : E({}, Bt), Ut = b(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? O(e.HTML_INTEGRATION_POINTS) : E({}, Ht);
		let t = b(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? O(e.CUSTOM_ELEMENT_HANDLING) : p(null);
		if (z = p(null), b(t, "tagNameCheck") && Jt(t.tagNameCheck) && (z.tagNameCheck = t.tagNameCheck), b(t, "attributeNameCheck") && Jt(t.attributeNameCheck) && (z.attributeNameCheck = t.attributeNameCheck), b(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (z.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), f(z), V && (ht = !1), Ct && (U = !0), W && (L = E({}, xe), R = p(null), W.html === !0 && (E(L, he), E(R, Se)), W.svg === !0 && (E(L, ge), E(R, Ce), E(R, Te)), W.svgFilters === !0 && (E(L, _e), E(R, Ce), E(R, Te)), W.mathMl === !0 && (E(L, ye), E(R, we), E(R, Te))), B.tagCheck = null, B.attributeCheck = null, b(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? B.tagCheck = e.ADD_TAGS : _(e.ADD_TAGS) && (L === ut && (L = O(L)), E(L, e.ADD_TAGS, J))), b(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? B.attributeCheck = e.ADD_ATTR : _(e.ADD_ATTR) && (R === dt && (R = O(R)), E(R, e.ADD_ATTR, J))), b(e, "ADD_URI_SAFE_ATTR") && _(e.ADD_URI_SAFE_ATTR) && E(Nt, e.ADD_URI_SAFE_ATTR, J), b(e, "FORBID_CONTENTS") && _(e.FORBID_CONTENTS) && (G === At && (G = O(G)), E(G, e.FORBID_CONTENTS, J)), b(e, "ADD_FORBID_CONTENTS") && _(e.ADD_FORBID_CONTENTS) && (G === At && (G = O(G)), E(G, e.ADD_FORBID_CONTENTS, J)), Ot && (L["#text"] = !0), H && E(L, [
			"html",
			"head",
			"body"
		]), L.table && (E(L, ["tbody"]), delete ft.tbody), e.TRUSTED_TYPES_POLICY) {
			if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw C("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
			if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw C("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
			let t = M;
			M = e.TRUSTED_TYPES_POLICY;
			try {
				N = F("");
			} catch (e) {
				throw M = t, e;
			}
		} else e.TRUSTED_TYPES_POLICY === null ? (M = void 0, N = "") : (M === void 0 && (M = Je()), M && typeof N == "string" && (N = F("")));
		d && d(e), Y = e;
	}, Xt = E({}, [
		...ge,
		..._e,
		...ve
	]), Zt = E({}, [...ye, ...be]), Qt = function(e, t, n) {
		return t.namespaceURI === K ? e === "svg" : t.namespaceURI === Ft ? e === "svg" && (n === "annotation-xml" || Vt[n]) : !!Xt[e];
	}, $t = function(e, t, n) {
		return t.namespaceURI === K ? e === "math" : t.namespaceURI === It ? e === "math" && Ut[n] : !!Zt[e];
	}, en = function(e, t, n) {
		return t.namespaceURI === It && !Ut[n] || t.namespaceURI === Ft && !Vt[n] ? !1 : !Zt[e] && (Wt[e] || !Xt[e]);
	}, tn = function(e) {
		let t = y(e);
		(!t || !t.tagName) && (t = {
			namespaceURI: q,
			tagName: "template"
		});
		let n = ae(e.tagName), r = ae(t.tagName);
		return Rt[e.namespaceURI] ? e.namespaceURI === It ? Qt(n, t, r) : e.namespaceURI === Ft ? $t(n, t, r) : e.namespaceURI === K ? en(n, t, r) : !!(Gt === "application/xhtml+xml" && Rt[e.namespaceURI]) : !1;
	}, X = function(e) {
		g(t.removed, { element: e });
		try {
			y(e).removeChild(e);
		} catch {
			if (de(e), !y(e)) throw C("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
		}
	}, nn = function(e) {
		let t = v(e);
		if (t) {
			let e = [];
			te(t, (t) => {
				g(e, t);
			}), te(e, (e) => {
				try {
					de(e);
				} catch {}
			});
		}
		let n = w(e);
		if (n) for (let t = n.length - 1; t >= 0; --t) {
			let r = n[t], i = r && r.name;
			if (typeof i == "string") try {
				e.removeAttribute(i);
			} catch {}
		}
	}, Z = function(e, n) {
		try {
			g(t.removed, {
				attribute: n.getAttributeNode(e),
				from: n
			});
		} catch {
			g(t.removed, {
				attribute: null,
				from: n
			});
		}
		if (n.removeAttribute(e), e === "is") if (U || Ct) try {
			X(n);
		} catch {}
		else try {
			n.setAttribute(e, "");
		} catch {}
	}, rn = function(e) {
		let t = w(e);
		if (t) for (let n = t.length - 1; n >= 0; --n) {
			let r = t[n], i = r && r.name;
			if (!(typeof i != "string" || R[J(i)])) try {
				e.removeAttribute(i);
			} catch {}
		}
	}, an = function(e) {
		let t = [e];
		for (; t.length > 0;) {
			let e = t.pop();
			(T ? T(e) : e.nodeType) === A.element && rn(e);
			let n = v(e);
			if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
		}
	}, on = function(e) {
		let t = null, r = null;
		if (St) e = "<remove></remove>" + e;
		else {
			let t = se(e, /^[\r\n\t ]+/);
			r = t && t[0];
		}
		Gt === "application/xhtml+xml" && q === K && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
		let i = M ? F(e) : e;
		if (q === K) try {
			t = new u().parseFromString(i, Gt);
		} catch {}
		if (!t || !t.documentElement) {
			t = Xe.createDocument(q, "template", null);
			try {
				t.documentElement.innerHTML = Lt ? N : i;
			} catch {}
		}
		let a = t.body || t.documentElement;
		return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), q === K ? $e.call(t, H ? "html" : "body")[0] : H ? t.documentElement : a;
	}, sn = function(e) {
		return Ze.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
	}, cn = function(e) {
		return e = ce(e, tt, " "), e = ce(e, nt, " "), e = ce(e, rt, " "), e;
	}, ln = function(e) {
		e.normalize();
		let t = Ze.call(e.ownerDocument || e, e, l.SHOW_TEXT | l.SHOW_COMMENT | l.SHOW_CDATA_SECTION | l.SHOW_PROCESSING_INSTRUCTION, null), n = t.nextNode();
		for (; n;) n.data = cn(n.data), n = t.nextNode();
		let r = e.querySelectorAll?.call(e, "template");
		r && te(r, (e) => {
			Q(e.content) && ln(e.content);
		});
	}, un = function(e) {
		let t = D ? D(e) : null;
		return typeof t != "string" || J(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== w(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== T(e) || e.childNodes !== v(e);
	}, Q = function(e) {
		if (!T || typeof e != "object" || !e) return !1;
		try {
			return T(e) === A.documentFragment;
		} catch {
			return !1;
		}
	}, dn = function(e) {
		if (!T || typeof e != "object" || !e) return !1;
		try {
			return typeof T(e) == "number";
		} catch {
			return !1;
		}
	};
	function $(e, n, r) {
		e.length !== 0 && te(e, (e) => {
			e.call(t, n, r, Y);
		});
	}
	let fn = function(e, t) {
		return !!(vt && e.hasChildNodes() && !dn(e.firstElementChild) && S(Ie, e.textContent) && S(Ie, e.innerHTML) || vt && e.namespaceURI === K && t === "style" && dn(e.firstElementChild) || e.nodeType === A.processingInstruction || vt && e.nodeType === A.comment && S(Le, e.data));
	}, pn = function(e, t) {
		if (!ft[t] && _n(t) && (z.tagNameCheck instanceof RegExp && S(z.tagNameCheck, t) || z.tagNameCheck instanceof Function && z.tagNameCheck(t))) return !1;
		if (Ot && !G[t]) {
			let t = y(e), n = v(e);
			if (n && t) {
				let r = n.length;
				for (let i = r - 1; i >= 0; --i) {
					let r = kt ? n[i] : ee(n[i], !0);
					t.insertBefore(r, fe(e));
				}
			}
		}
		return X(e), !0;
	}, mn = function(e) {
		if ($(I.beforeSanitizeElements, e, null), un(e)) return X(e), !0;
		let n = J(D ? D(e) : e.nodeName);
		if ($(I.uponSanitizeElement, e, {
			tagName: n,
			allowedTags: L
		}), fn(e, n)) return X(e), !0;
		if (ft[n] || !(B.tagCheck instanceof Function && B.tagCheck(n)) && !L[n]) return pn(e, n);
		if ((T ? T(e) : e.nodeType) === A.element && !tn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && S(Re, e.innerHTML)) return X(e), !0;
		if (V && e.nodeType === A.text) {
			let n = cn(e.textContent);
			e.textContent !== n && (g(t.removed, { element: e.cloneNode() }), e.textContent = n);
		}
		return $(I.afterSanitizeElements, e, null), !1;
	}, hn = function(e, t, r) {
		if (pt[t] || Tt && (t === "id" || t === "name") && (r in n || r in qt)) return !1;
		let i = R[t] || B.attributeCheck instanceof Function && B.attributeCheck(t, e);
		if (!(ht && S(it, t)) && !(mt && S(at, t))) {
			if (!i) {
				if (!(_n(e) && (z.tagNameCheck instanceof RegExp && S(z.tagNameCheck, e) || z.tagNameCheck instanceof Function && z.tagNameCheck(e)) && (z.attributeNameCheck instanceof RegExp && S(z.attributeNameCheck, t) || z.attributeNameCheck instanceof Function && z.attributeNameCheck(t, e)) || t === "is" && z.allowCustomizedBuiltInElements && (z.tagNameCheck instanceof RegExp && S(z.tagNameCheck, r) || z.tagNameCheck instanceof Function && z.tagNameCheck(r)))) return !1;
			} else if (!Nt[t] && !S(lt, ce(r, st, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && le(r, "data:") === 0 && jt[e]) && !(gt && !S(ot, ce(r, st, ""))) && r) return !1;
		}
		return !0;
	}, gn = E({}, [
		"annotation-xml",
		"color-profile",
		"font-face",
		"font-face-format",
		"font-face-name",
		"font-face-src",
		"font-face-uri",
		"missing-glyph"
	]), _n = function(e) {
		return !gn[ae(e)] && S(ct, e);
	}, vn = function(e, t, n, r) {
		if (M && typeof m == "object" && typeof m.getAttributeType == "function" && !n) switch (m.getAttributeType(e, t)) {
			case "TrustedHTML": return F(r);
			case "TrustedScriptURL": return qe(r);
		}
		return r;
	}, yn = function(e, n, r, i) {
		try {
			r ? e.setAttributeNS(r, n, i) : e.setAttribute(n, i), un(e) ? X(e) : re(t.removed);
		} catch {
			Z(n, e);
		}
	}, bn = function(e) {
		$(I.beforeSanitizeAttributes, e, null);
		let t = e.attributes;
		if (!t || un(e)) return;
		let n = {
			attrName: "",
			attrValue: "",
			keepAttr: !0,
			allowedAttributes: R,
			forceKeepAttr: void 0
		}, r = t.length, i = J(e.nodeName);
		for (; r--;) {
			let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, l = J(o), u = c, d = o === "value" ? u : ue(u);
			if (n.attrName = l, n.attrValue = d, n.keepAttr = !0, n.forceKeepAttr = void 0, $(I.uponSanitizeAttribute, e, n), d = n.attrValue, Et && (l === "id" || l === "name") && le(d, Dt) !== 0 && (Z(o, e), d = Dt + d), vt && S(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
				Z(o, e);
				continue;
			}
			if (l === "attributename" && se(d, "href")) {
				Z(o, e);
				continue;
			}
			if (!n.forceKeepAttr) {
				if (!n.keepAttr) {
					Z(o, e);
					continue;
				}
				if (!_t && S(ze, d)) {
					Z(o, e);
					continue;
				}
				if (V && (d = cn(d)), !hn(i, l, d)) {
					Z(o, e);
					continue;
				}
				d = vn(i, l, s, d), d !== u && yn(e, o, s, d);
			}
		}
		$(I.afterSanitizeAttributes, e, null);
	}, xn = function(e) {
		let t = null, n = sn(e);
		for ($(I.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if ($(I.uponSanitizeShadowNode, t, null), mn(t), bn(t), Q(t.content) && xn(t.content), (T ? T(t) : t.nodeType) === A.element) {
			let e = x(t);
			Q(e) && (Sn(e), xn(e));
		}
		$(I.afterSanitizeShadowDOM, e, null);
	}, Sn = function(e) {
		let t = [{
			node: e,
			shadow: null
		}];
		for (; t.length > 0;) {
			let e = t.pop();
			if (e.shadow) {
				xn(e.shadow);
				continue;
			}
			let n = e.node, r = (T ? T(n) : n.nodeType) === A.element, i = v(n);
			if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
				node: i[e],
				shadow: null
			});
			if (r) {
				let e = D ? D(n) : null;
				if (typeof e == "string" && J(e) === "template") {
					let e = n.content;
					Q(e) && t.push({
						node: e,
						shadow: null
					});
				}
			}
			if (r) {
				let e = x(n);
				Q(e) && t.push({
					node: null,
					shadow: e
				}, {
					node: e,
					shadow: null
				});
			}
		}
	};
	return t.sanitize = function(e) {
		let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
		if (Lt = !e, Lt && (e = "<!-->"), typeof e != "string" && !dn(e) && (e = pe(e), typeof e != "string")) throw C("dirty is not a string, aborting");
		if (!t.isSupported) return e;
		yt ? (L = bt, R = xt) : Yt(n), (I.uponSanitizeElement.length > 0 || I.uponSanitizeAttribute.length > 0) && (L = O(L)), I.uponSanitizeAttribute.length > 0 && (R = O(R)), t.removed = [];
		let c = kt && typeof e != "string" && dn(e);
		if (c) {
			let t = D ? D(e) : e.nodeName;
			if (typeof t == "string") {
				let e = J(t);
				if (!L[e] || ft[e]) throw C("root node is forbidden and cannot be sanitized in-place");
			}
			if (un(e)) throw C("root node is clobbered and cannot be sanitized in-place");
			try {
				Sn(e);
			} catch (t) {
				throw nn(e), t;
			}
		} else if (dn(e)) i = on("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === A.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), Sn(a);
		else {
			if (!U && !V && !H && e.indexOf("<") === -1) return M && wt ? F(e) : e;
			if (i = on(e), !i) return U ? null : wt ? N : "";
		}
		i && St && X(i.firstChild);
		let l = sn(c ? e : i);
		try {
			for (; o = l.nextNode();) mn(o), bn(o), Q(o.content) && xn(o.content);
		} catch (t) {
			throw c && nn(e), t;
		}
		if (c) return te(t.removed, (e) => {
			e.element && an(e.element);
		}), V && ln(e), e;
		if (U) {
			if (V && ln(i), Ct) for (s = Qe.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
			else s = i;
			return (R.shadowroot || R.shadowrootmode) && (s = et.call(r, s, !0)), s;
		}
		let u = H ? i.outerHTML : i.innerHTML;
		return H && L["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && S(Pe, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), V && (u = cn(u)), M && wt ? F(u) : u;
	}, t.setConfig = function() {
		Yt(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), yt = !0, bt = L, xt = R;
	}, t.clearConfig = function() {
		Y = null, yt = !1, bt = null, xt = null, M = We, N = "";
	}, t.isValidAttribute = function(e, t, n) {
		return Y || Yt({}), hn(J(e), J(t), n);
	}, t.addHook = function(e, t) {
		typeof t == "function" && b(I, e) && g(I[e], t);
	}, t.removeHook = function(e, t) {
		if (b(I, e)) {
			if (t !== void 0) {
				let n = ne(I[e], t);
				return n === -1 ? void 0 : ie(I[e], n, 1)[0];
			}
			return re(I[e]);
		}
	}, t.removeHooks = function(e) {
		b(I, e) && (I[e] = []);
	}, t.removeAllHooks = function() {
		I = He();
	}, t;
}
var M = Ue();
//#endregion
//#region src/utils/sanitize.ts
function N(e) {
	return {
		USE_PROFILES: e?.allowSvg === !0 ? {
			svg: !0,
			html: !0
		} : { html: !0 },
		ADD_ATTR: ["target", "rel"],
		FORBID_ATTR: [],
		WHOLE_DOCUMENT: !1
	};
}
var We = !1;
function Ge() {
	We || (We = !0, M.addHook("afterSanitizeAttributes", (e) => {
		e.getAttribute("target") === "_blank" && e.setAttribute("rel", "noopener noreferrer");
	}));
}
function P(e) {
	return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
}
function Ke(e, t) {
	return Ge(), M.sanitize(e, N(t));
}
function F(e, t) {
	return Ge(), M.sanitize(e, {
		...N(t),
		RETURN_DOM_FRAGMENT: !0
	});
}
function qe(e, t) {
	return F(e, t);
}
function Je(e, t, n) {
	e.replaceChildren(F(t, n));
}
function Ye(e, t, n) {
	Je(e, t, n);
}
function Xe(e, t) {
	if (e.namespaceURI === "http://www.w3.org/2000/svg" && e.localName.toLowerCase() === "svg") {
		let n = F(`<svg xmlns="http://www.w3.org/2000/svg">${t}</svg>`, { allowSvg: !0 }).querySelector("svg");
		e.replaceChildren(...n === null ? [] : Array.from(n.childNodes));
		return;
	}
	Je(e, t, { allowSvg: !0 });
}
function Ze(e, t) {
	Xe(e, t);
}
//#endregion
export { Ye as a, Je as c, Ke as i, M as l, F as n, Ze as o, P as r, Xe as s, qe as t };

//# sourceMappingURL=sanitize-uWpY18N9.js.map