import { n as e } from "./rolldown-runtime-Dqa2HsxW.js";
import { An as t, Cn as n, Dn as r, En as i, Fn as a, In as o, Nn as s, On as c, Pn as l, jn as ee, kn as u } from "./features-CUYy5kZQ.js";
//#region ../quality/src/types.ts
var te = {
	altMaxLength: 125,
	minFontSize: 14,
	allCapsMinLength: 20,
	minTouchTargetPx: 44
}, ne = [
	"localhost",
	"127.0.0.1",
	"0.0.0.0",
	"*.local",
	"*.staging.*",
	"*.dev.*"
];
//#endregion
//#region ../quality/src/contrast.ts
function re(e, t) {
	let n = d(e), r = d(t);
	if (!n || !r) return NaN;
	let i = se(n), a = se(r), o = Math.max(i, a), s = Math.min(i, a);
	return (o + .05) / (s + .05);
}
var ie = /^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i, ae = /^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i, oe = /^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;
function d(e) {
	if (typeof e != "string") return null;
	let t = e.trim(), n = oe.exec(t);
	if (n) return n[4].toLowerCase() === "ff" ? {
		r: parseInt(n[1], 16),
		g: parseInt(n[2], 16),
		b: parseInt(n[3], 16)
	} : null;
	let r = ae.exec(t);
	if (r) return {
		r: parseInt(r[1], 16),
		g: parseInt(r[2], 16),
		b: parseInt(r[3], 16)
	};
	let i = ie.exec(t);
	return i ? {
		r: parseInt(i[1] + i[1], 16),
		g: parseInt(i[2] + i[2], 16),
		b: parseInt(i[3] + i[3], 16)
	} : null;
}
function f(e) {
	return d(e ?? "") !== null;
}
function se({ r: e, g: t, b: n }) {
	let r = p(e / 255), i = p(t / 255), a = p(n / 255);
	return .2126 * r + .7152 * i + .0722 * a;
}
function p(e) {
	return e <= .03928 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
}
//#endregion
//#region ../quality/src/walk.ts
var ce = "#ffffff";
function m(e, n) {
	let r = f(e.settings.backgroundColor) ? e.settings.backgroundColor.toLowerCase() : ce, i = (e, r) => {
		let a = e.styles?.backgroundColor, o = f(a) ? a.toLowerCase() : r.resolvedBackgroundColor;
		n(e, o === r.resolvedBackgroundColor ? r : {
			...r,
			resolvedBackgroundColor: o
		}), t(e) && e.children.forEach((t, n) => {
			t.forEach((t) => i(t, {
				parent: e,
				section: e,
				columnIndex: n,
				depth: r.depth + 1,
				resolvedBackgroundColor: o
			}));
		});
	};
	for (let t of e.blocks) i(t, {
		parent: null,
		section: null,
		columnIndex: null,
		depth: 0,
		resolvedBackgroundColor: r
	});
}
//#endregion
//#region ../quality/src/run-rules.ts
function h(e, t, n, r) {
	let i = [];
	function a(e, t, i) {
		return {
			blockId: i.blockId,
			ruleId: e,
			severity: t,
			message: r(n.locale, e, i.params),
			fix: i.fix
		};
	}
	m(e, (e, r) => {
		for (let o of t) {
			let t = n.severity(o.meta.id);
			if (t === "off" || !o.block) continue;
			let s = o.block(e, r, n);
			s !== null && i.push(a(o.meta.id, t, s));
		}
	});
	for (let r of t) {
		let t = n.severity(r.meta.id);
		if (t === "off" || !r.template) continue;
		let o = r.template(e, n);
		for (let e of o) i.push(a(r.meta.id, t, e));
	}
	return i;
}
function g(e) {
	let t = e.overrides ?? {}, n = {
		...te,
		...e.thresholds ?? {}
	}, r = { nonProductionHosts: e.nonProductionHosts ?? ne }, i = e.locale ?? "en", a = e.rules;
	return {
		locale: i,
		rules: t,
		thresholds: n,
		links: r,
		severity: (e) => {
			let n = t[e];
			return n === void 0 ? a.find((t) => t.meta.id === e)?.meta.severity ?? "warning" : n;
		}
	};
}
function le(e, t, n) {
	return g({
		locale: e,
		rules: n,
		overrides: t.rules,
		thresholds: t.thresholds,
		nonProductionHosts: void 0
	});
}
function ue(e, t, n) {
	return g({
		locale: e,
		rules: n,
		overrides: t.rules,
		thresholds: void 0,
		nonProductionHosts: void 0
	});
}
function de(e, t, n) {
	return g({
		locale: e,
		rules: n,
		overrides: t.rules,
		thresholds: void 0,
		nonProductionHosts: t.nonProductionHosts
	});
}
//#endregion
//#region ../quality/src/accessibility/messages/de.ts
var fe = /* @__PURE__ */ e({ default: () => pe }), pe = {
	"a11y.img-missing-alt": "Bild ohne Alt-Text. Füge eine kurze Beschreibung hinzu oder markiere das Bild als dekorativ.",
	"a11y.img-alt-is-filename": "Alt-Text sieht wie ein Dateiname aus (\"{alt}\"). Beschreibe stattdessen kurz, was das Bild zeigt.",
	"a11y.img-alt-too-long": "Alt-Text ist {length} Zeichen lang; bleibe unter {max}.",
	"a11y.img-decorative-needs-empty-alt": "Dekoratives Bild hat Alt-Text. Entferne den Alt-Text oder hebe die Markierung als dekorativ auf.",
	"a11y.img-linked-no-context": "Verlinktes Bild beschreibt nur das Motiv, nicht das Linkziel. Nenne das Ziel (z. B. „Frühlingssale ansehen“).",
	"a11y.heading-empty": "Überschrift ist leer. Füge Text hinzu oder entferne den Block.",
	"a11y.heading-skip-level": "Überschrift springt von H{from} auf H{to}. Eine Ebene pro Schritt.",
	"a11y.heading-multiple-h1": "E-Mail enthält mehr als eine H1. Verwende H1 nur einmal für die Hauptüberschrift.",
	"a11y.link-empty": "Ein Link in diesem Block hat keinen Text und kein beschriebenes Bild.",
	"a11y.link-vague-text": "Link-Text „{text}“ ist unspezifisch. Beschreibe stattdessen das Ziel.",
	"a11y.link-href-empty": "Ein Link in diesem Block hat ein leeres oder „#“-href.",
	"a11y.link-target-blank-no-rel": "Link öffnet in neuem Tab, aber rel=\"noopener\" fehlt – ergänze es, damit das Ziel nicht auf window.opener zugreifen kann.",
	"a11y.link-nested-anchor": "Ein Link liegt innerhalb eines anderen Links. Verschachtelte Anker sind ungültiges HTML und werden von E-Mail-Clients unterschiedlich gerendert – flache einen einzigen Anker daraus.",
	"a11y.text-all-caps": "Längere Texte in Großbuchstaben sind schwerer lesbar. Verwende Groß- und Kleinschreibung.",
	"a11y.text-low-contrast": "Überschriftskontrast beträgt {ratio}:1; WCAG AA verlangt mindestens {required}:1.",
	"a11y.text-too-small": "Text ist {size}px; mindestens {min}px verwenden.",
	"a11y.button-vague-label": "Button-Beschriftung „{text}“ ist unspezifisch. Beschreibe die Aktion.",
	"a11y.button-touch-target": "Button ist etwa {height}px hoch; mindestens {min}px verwenden, um Fehltipper auf Mobilgeräten zu vermeiden.",
	"a11y.button-low-contrast": "Buttontextkontrast beträgt {ratio}:1; WCAG AA verlangt mindestens {required}:1.",
	"a11y.missing-preheader": "Kein Preheader-Text gesetzt. Postfächer zeigen sonst Bruchstücke des ersten Blocks an."
}, me = /* @__PURE__ */ e({ default: () => _ }), _ = {
	"a11y.img-missing-alt": "Image is missing alt text. Add a short description, or mark the image as decorative.",
	"a11y.img-alt-is-filename": "Alt text looks like a filename (\"{alt}\"). Replace with a short description of what the image conveys.",
	"a11y.img-alt-too-long": "Alt text is {length} characters; aim for under {max}.",
	"a11y.img-decorative-needs-empty-alt": "Decorative image has alt text. Either clear the alt text or unmark the image as decorative.",
	"a11y.img-linked-no-context": "Linked image alt describes the image but not the link destination. Include where the link goes (e.g. 'Buy spring sale').",
	"a11y.heading-empty": "Heading is empty. Add text or remove the block.",
	"a11y.heading-skip-level": "Heading jumps from H{from} to H{to}. Step one level at a time.",
	"a11y.heading-multiple-h1": "Email has more than one H1. Use H1 once for the main heading.",
	"a11y.link-empty": "A link in this block has no text and no described image.",
	"a11y.link-vague-text": "Link text \"{text}\" is vague. Describe the destination instead.",
	"a11y.link-href-empty": "A link in this block has an empty or '#' href.",
	"a11y.link-target-blank-no-rel": "Link opens in a new tab but is missing rel=\"noopener\" — add it to prevent the destination from accessing window.opener.",
	"a11y.link-nested-anchor": "A link is nested inside another link. Nested anchors are invalid HTML and clients render them inconsistently — flatten to a single anchor.",
	"a11y.text-all-caps": "Long all-caps text is harder to read for everyone. Use sentence case.",
	"a11y.text-low-contrast": "Heading contrast is {ratio}:1; WCAG AA requires at least {required}:1.",
	"a11y.text-too-small": "Text is {size}px; aim for at least {min}px.",
	"a11y.button-vague-label": "Button label \"{text}\" is vague. Describe the action.",
	"a11y.button-touch-target": "Button is roughly {height}px tall; aim for at least {min}px to avoid mis-taps on mobile.",
	"a11y.button-low-contrast": "Button text contrast is {ratio}:1; WCAG AA requires at least {required}:1.",
	"a11y.missing-preheader": "No preheader text set. Inboxes will fall back to fragments of the first block."
}, he = /* @__PURE__ */ Object.assign({
	"./de.ts": fe,
	"./en.ts": me
}), v = {};
for (let e in he) {
	let t = /\.\/([^/]+)\.ts$/.exec(e);
	if (!t) continue;
	let n = t[1];
	n !== "index" && (v[n] = he[e].default);
}
function ge(e) {
	return v[e.split("-")[0]?.toLowerCase() ?? "en"] ?? v.en ?? _;
}
function _e(e, t, n) {
	let r = ge(e)[t] ?? _[t];
	return n ? r.replace(/\{(\w+)\}/g, (e, t) => {
		let r = n[t];
		return r === void 0 ? `{${t}}` : String(r);
	}) : r;
}
var ve = {
	meta: {
		id: "a11y.img-missing-alt",
		severity: "error"
	},
	block(e) {
		return !r(e) || e.decorative === !0 || (e.alt?.trim() ?? "") !== "" || (e.src ?? "").trim() === "" ? null : { blockId: e.id };
	}
}, ye = {
	id: "a11y.img-alt-is-filename",
	severity: "warning"
}, be = [
	/\.(jpe?g|png|gif|webp|svg)$/i,
	/^IMG[_-]?\d+/i,
	/^Untitled/i,
	/^Screen[\s_-]?Shot/i,
	/^DSC[_-]?\d+/i
], xe = {
	meta: ye,
	block(e) {
		if (!r(e) || e.decorative === !0) return null;
		let t = e.alt?.trim() ?? "";
		return t === "" || !be.some((e) => e.test(t)) ? null : {
			blockId: e.id,
			params: { alt: t }
		};
	}
}, Se = {
	meta: {
		id: "a11y.img-alt-too-long",
		severity: "warning"
	},
	block(e, t, n) {
		if (!r(e) || e.decorative === !0) return null;
		let i = e.alt ?? "";
		return i.length <= n.thresholds.altMaxLength ? null : {
			blockId: e.id,
			params: {
				length: i.length,
				max: n.thresholds.altMaxLength
			}
		};
	}
}, Ce = {
	meta: {
		id: "a11y.img-decorative-needs-empty-alt",
		severity: "info"
	},
	block(e) {
		return !r(e) || e.decorative !== !0 || (e.alt ?? "").trim() === "" ? null : {
			blockId: e.id,
			fix: {
				description: "Clear alt text",
				apply: (t) => t.updateBlock(e.id, { alt: "" })
			}
		};
	}
}, we = /* @__PURE__ */ e({ default: () => Te }), Te = {
	vagueLinkText: [
		"hier klicken",
		"hier",
		"mehr lesen",
		"mehr",
		"weiter",
		"weiterlesen",
		"siehe mehr",
		"dies",
		"dieser link",
		"link",
		"klick"
	],
	vagueButtonLabels: [
		"hier klicken",
		"klicken",
		"senden",
		"los",
		"ok",
		"okay",
		"ja",
		"nein"
	],
	linkedImageActionHints: [
		"kaufen",
		"shoppen",
		"ansehen",
		"lesen",
		"lernen",
		"öffnen",
		"los",
		"sehen",
		"entdecken",
		"erkunden",
		"stöbern",
		"herunterladen",
		"holen",
		"abholen",
		"einlösen",
		"anschauen",
		"jetzt"
	]
}, Ee = /* @__PURE__ */ e({ default: () => De }), De = {
	vagueLinkText: [
		"click here",
		"here",
		"read more",
		"more",
		"learn more",
		"see more",
		"this",
		"this link",
		"link",
		"click"
	],
	vagueButtonLabels: [
		"click here",
		"click",
		"submit",
		"go",
		"ok",
		"okay",
		"yes",
		"no"
	],
	linkedImageActionHints: [
		"buy",
		"shop",
		"view",
		"read",
		"learn",
		"open",
		"go",
		"see",
		"explore",
		"discover",
		"browse",
		"download",
		"get",
		"claim",
		"redeem",
		"watch"
	]
}, Oe = /* @__PURE__ */ Object.assign({
	"./de.ts": we,
	"./en.ts": Ee
}), ke = {};
for (let e in Oe) {
	let t = /\.\/([^/]+)\.ts$/.exec(e);
	if (!t) continue;
	let n = t[1];
	n !== "index" && (ke[n] = Oe[e].default);
}
function y(e) {
	return Ae;
}
function b(e) {
	let t = /* @__PURE__ */ new Set();
	for (let n of Object.values(ke)) for (let r of e(n)) t.add(r);
	return Array.from(t);
}
var Ae = {
	vagueLinkText: b((e) => e.vagueLinkText),
	vagueButtonLabels: b((e) => e.vagueButtonLabels),
	linkedImageActionHints: b((e) => e.linkedImageActionHints)
};
function je(e) {
	return e.toLowerCase().replace(/\s+/g, " ").replace(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, "").trim();
}
var Me = {
	meta: {
		id: "a11y.img-linked-no-context",
		severity: "warning"
	},
	block(e, t, n) {
		if (!r(e) || e.decorative === !0 || !e.linkUrl || e.linkUrl.trim() === "") return null;
		let i = (e.alt ?? "").trim();
		if (i === "") return null;
		let a = i.toLocaleLowerCase().split(/[^\p{L}\p{N}]+/u).filter(Boolean), o = y(n.locale).linkedImageActionHints;
		return a.some((e) => o.includes(e)) ? null : { blockId: e.id };
	}
}, Ne = new Map([
	[0, 65533],
	[128, 8364],
	[130, 8218],
	[131, 402],
	[132, 8222],
	[133, 8230],
	[134, 8224],
	[135, 8225],
	[136, 710],
	[137, 8240],
	[138, 352],
	[139, 8249],
	[140, 338],
	[142, 381],
	[145, 8216],
	[146, 8217],
	[147, 8220],
	[148, 8221],
	[149, 8226],
	[150, 8211],
	[151, 8212],
	[152, 732],
	[153, 8482],
	[154, 353],
	[155, 8250],
	[156, 339],
	[158, 382],
	[159, 376]
]);
function Pe(e) {
	return e >= 55296 && e <= 57343 || e > 1114111 ? 65533 : Ne.get(e) ?? e;
}
//#endregion
//#region ../../node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/internal/decode-shared.js
function x(e) {
	let t = atob(e), n = t.length & -2, r = new Uint16Array(n / 2);
	for (let e = 0, i = 0; e < n; e += 2) {
		let n = t.charCodeAt(e), a = t.charCodeAt(e + 1);
		r[i++] = n | a << 8;
	}
	return r;
}
//#endregion
//#region ../../node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/generated/decode-data-html.js
var Fe = /* @__PURE__ */ x(" "), Ie = /* @__PURE__ */ x("AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg"), S;
(function(e) {
	e[e.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e[e.FLAG13 = 8192] = "FLAG13", e[e.BRANCH_LENGTH = 8064] = "BRANCH_LENGTH", e[e.JUMP_TABLE = 127] = "JUMP_TABLE";
})(S ||= {});
//#endregion
//#region ../../node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/decode.js
var C;
(function(e) {
	e[e.NUM = 35] = "NUM", e[e.SEMI = 59] = "SEMI", e[e.EQUALS = 61] = "EQUALS", e[e.ZERO = 48] = "ZERO", e[e.NINE = 57] = "NINE", e[e.LOWER_A = 97] = "LOWER_A", e[e.LOWER_F = 102] = "LOWER_F", e[e.LOWER_X = 120] = "LOWER_X", e[e.LOWER_Z = 122] = "LOWER_Z", e[e.UPPER_A = 65] = "UPPER_A", e[e.UPPER_F = 70] = "UPPER_F", e[e.UPPER_Z = 90] = "UPPER_Z";
})(C ||= {});
var w = 32;
function T(e) {
	return e >= C.ZERO && e <= C.NINE;
}
function Le(e) {
	return e >= C.UPPER_A && e <= C.UPPER_F || e >= C.LOWER_A && e <= C.LOWER_F;
}
function Re(e) {
	return e >= C.UPPER_A && e <= C.UPPER_Z || e >= C.LOWER_A && e <= C.LOWER_Z || T(e);
}
function ze(e) {
	return e === C.EQUALS || Re(e);
}
var E;
(function(e) {
	e[e.EntityStart = 0] = "EntityStart", e[e.NumericStart = 1] = "NumericStart", e[e.NumericDecimal = 2] = "NumericDecimal", e[e.NumericHex = 3] = "NumericHex", e[e.NamedEntity = 4] = "NamedEntity";
})(E ||= {});
var D;
(function(e) {
	e[e.Legacy = 0] = "Legacy", e[e.Strict = 1] = "Strict", e[e.Attribute = 2] = "Attribute";
})(D ||= {});
var Be = class {
	decodeTree;
	emitCodePoint;
	errors;
	constructor(e, t, n) {
		this.decodeTree = e, this.emitCodePoint = t, this.errors = n;
	}
	state = E.EntityStart;
	consumed = 1;
	result = 0;
	treeIndex = 0;
	excess = 1;
	decodeMode = D.Strict;
	runConsumed = 0;
	startEntity(e) {
		this.decodeMode = e, this.state = E.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1, this.runConsumed = 0;
	}
	write(e, t) {
		switch (this.state) {
			case E.EntityStart: return e.charCodeAt(t) === C.NUM ? (this.state = E.NumericStart, this.consumed += 1, this.stateNumericStart(e, t + 1)) : (this.state = E.NamedEntity, this.stateNamedEntity(e, t));
			case E.NumericStart: return this.stateNumericStart(e, t);
			case E.NumericDecimal: return this.stateNumericDecimal(e, t);
			case E.NumericHex: return this.stateNumericHex(e, t);
			case E.NamedEntity: return this.stateNamedEntity(e, t);
		}
	}
	stateNumericStart(e, t) {
		return t >= e.length ? -1 : (e.charCodeAt(t) | w) === C.LOWER_X ? (this.state = E.NumericHex, this.consumed += 1, this.stateNumericHex(e, t + 1)) : (this.state = E.NumericDecimal, this.stateNumericDecimal(e, t));
	}
	stateNumericHex(e, t) {
		for (; t < e.length;) {
			let n = e.charCodeAt(t);
			if (T(n) || Le(n)) {
				let e = n <= C.NINE ? n - C.ZERO : (n | w) - C.LOWER_A + 10;
				this.result = this.result * 16 + e, this.consumed++, t++;
			} else return this.emitNumericEntity(n, 3);
		}
		return -1;
	}
	stateNumericDecimal(e, t) {
		for (; t < e.length;) {
			let n = e.charCodeAt(t);
			if (T(n)) this.result = this.result * 10 + (n - C.ZERO), this.consumed++, t++;
			else return this.emitNumericEntity(n, 2);
		}
		return -1;
	}
	emitNumericEntity(e, t) {
		if (this.consumed <= t) return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
		if (e === C.SEMI) this.consumed += 1;
		else if (this.decodeMode === D.Strict) return 0;
		return this.emitCodePoint(Pe(this.result), this.consumed), this.errors && (e !== C.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
	}
	stateNamedEntity(e, t) {
		let { decodeTree: n } = this, r = n[this.treeIndex], i = (r & S.VALUE_LENGTH) >> 14;
		for (; t < e.length;) {
			if (i === 0 && (r & S.FLAG13) !== 0) {
				let a = (r & S.BRANCH_LENGTH) >> 7;
				if (this.runConsumed === 0) {
					let n = r & S.JUMP_TABLE;
					if (e.charCodeAt(t) !== n) return this.result === 0 ? 0 : this.emitNotTerminatedNamedEntity();
					t++, this.excess++, this.runConsumed++;
				}
				for (; this.runConsumed < a;) {
					if (t >= e.length) return -1;
					let r = this.runConsumed - 1, i = n[this.treeIndex + 1 + (r >> 1)], a = r % 2 == 0 ? i & 255 : i >> 8 & 255;
					if (e.charCodeAt(t) !== a) return this.runConsumed = 0, this.result === 0 ? 0 : this.emitNotTerminatedNamedEntity();
					t++, this.excess++, this.runConsumed++;
				}
				this.runConsumed = 0, this.treeIndex += 1 + (a >> 1), r = n[this.treeIndex], i = (r & S.VALUE_LENGTH) >> 14;
			}
			if (t >= e.length) break;
			let a = e.charCodeAt(t);
			if (a === C.SEMI && i !== 0 && (r & S.FLAG13) !== 0) return this.emitNamedEntityData(this.treeIndex, i, this.consumed + this.excess);
			if (this.treeIndex = Ve(n, r, this.treeIndex + Math.max(1, i), a), this.treeIndex < 0) return this.result === 0 || this.decodeMode === D.Attribute && (i === 0 || ze(a)) ? 0 : this.emitNotTerminatedNamedEntity();
			if (r = n[this.treeIndex], i = (r & S.VALUE_LENGTH) >> 14, i !== 0) {
				if (a === C.SEMI) return this.emitNamedEntityData(this.treeIndex, i, this.consumed + this.excess);
				this.decodeMode !== D.Strict && (r & S.FLAG13) === 0 && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
			}
			t++, this.excess++;
		}
		return -1;
	}
	emitNotTerminatedNamedEntity() {
		let { result: e, decodeTree: t } = this, n = (t[e] & S.VALUE_LENGTH) >> 14;
		return this.emitNamedEntityData(e, n, this.consumed), this.errors?.missingSemicolonAfterCharacterReference(), this.consumed;
	}
	emitNamedEntityData(e, t, n) {
		let { decodeTree: r } = this;
		return this.emitCodePoint(t === 1 ? r[e] & ~(S.VALUE_LENGTH | S.FLAG13) : r[e + 1], n), t === 3 && this.emitCodePoint(r[e + 2], n), n;
	}
	end() {
		switch (this.state) {
			case E.NamedEntity: return this.result !== 0 && (this.decodeMode !== D.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
			case E.NumericDecimal: return this.emitNumericEntity(0, 2);
			case E.NumericHex: return this.emitNumericEntity(0, 3);
			case E.NumericStart: return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
			case E.EntityStart: return 0;
		}
	}
};
function Ve(e, t, n, r) {
	let i = (t & S.BRANCH_LENGTH) >> 7, a = t & S.JUMP_TABLE;
	if (i === 0) return a !== 0 && r === a ? n : -1;
	if (a) {
		let t = r - a;
		return t < 0 || t >= i ? -1 : e[n + t] - 1;
	}
	let o = i + 1 >> 1, s = 0, c = i - 1;
	for (; s <= c;) {
		let t = s + c >>> 1, i = e[n + (t >> 1)] >> (t & 1) * 8 & 255;
		if (i < r) s = t + 1;
		else if (i > r) c = t - 1;
		else return e[n + o + t];
	}
	return -1;
}
//#endregion
//#region ../../node_modules/.pnpm/htmlparser2@12.0.0/node_modules/htmlparser2/dist/Tokenizer.js
var O;
(function(e) {
	e[e.Tab = 9] = "Tab", e[e.NewLine = 10] = "NewLine", e[e.FormFeed = 12] = "FormFeed", e[e.CarriageReturn = 13] = "CarriageReturn", e[e.Space = 32] = "Space", e[e.ExclamationMark = 33] = "ExclamationMark", e[e.Number = 35] = "Number", e[e.Amp = 38] = "Amp", e[e.SingleQuote = 39] = "SingleQuote", e[e.DoubleQuote = 34] = "DoubleQuote", e[e.Dash = 45] = "Dash", e[e.Slash = 47] = "Slash", e[e.Zero = 48] = "Zero", e[e.Nine = 57] = "Nine", e[e.Semi = 59] = "Semi", e[e.Lt = 60] = "Lt", e[e.Eq = 61] = "Eq", e[e.Gt = 62] = "Gt", e[e.Questionmark = 63] = "Questionmark", e[e.UpperA = 65] = "UpperA", e[e.LowerA = 97] = "LowerA", e[e.UpperF = 70] = "UpperF", e[e.LowerF = 102] = "LowerF", e[e.UpperZ = 90] = "UpperZ", e[e.LowerZ = 122] = "LowerZ", e[e.LowerX = 120] = "LowerX", e[e.OpeningSquareBracket = 91] = "OpeningSquareBracket";
})(O ||= {});
var k;
(function(e) {
	e[e.Text = 1] = "Text", e[e.BeforeTagName = 2] = "BeforeTagName", e[e.InTagName = 3] = "InTagName", e[e.InSelfClosingTag = 4] = "InSelfClosingTag", e[e.BeforeClosingTagName = 5] = "BeforeClosingTagName", e[e.InClosingTagName = 6] = "InClosingTagName", e[e.AfterClosingTagName = 7] = "AfterClosingTagName", e[e.BeforeAttributeName = 8] = "BeforeAttributeName", e[e.InAttributeName = 9] = "InAttributeName", e[e.AfterAttributeName = 10] = "AfterAttributeName", e[e.BeforeAttributeValue = 11] = "BeforeAttributeValue", e[e.InAttributeValueDq = 12] = "InAttributeValueDq", e[e.InAttributeValueSq = 13] = "InAttributeValueSq", e[e.InAttributeValueNq = 14] = "InAttributeValueNq", e[e.BeforeDeclaration = 15] = "BeforeDeclaration", e[e.InDeclaration = 16] = "InDeclaration", e[e.InProcessingInstruction = 17] = "InProcessingInstruction", e[e.BeforeComment = 18] = "BeforeComment", e[e.CDATASequence = 19] = "CDATASequence", e[e.DeclarationSequence = 20] = "DeclarationSequence", e[e.InSpecialComment = 21] = "InSpecialComment", e[e.InCommentLike = 22] = "InCommentLike", e[e.SpecialStartSequence = 23] = "SpecialStartSequence", e[e.InSpecialTag = 24] = "InSpecialTag", e[e.InPlainText = 25] = "InPlainText", e[e.InEntity = 26] = "InEntity";
})(k ||= {});
function A(e) {
	return e === O.Space || e === O.NewLine || e === O.Tab || e === O.FormFeed || e === O.CarriageReturn;
}
function j(e) {
	return e === O.Slash || e === O.Gt || A(e);
}
function He(e) {
	return e >= O.LowerA && e <= O.LowerZ || e >= O.UpperA && e <= O.UpperZ;
}
var M;
(function(e) {
	e[e.NoValue = 0] = "NoValue", e[e.Unquoted = 1] = "Unquoted", e[e.Single = 2] = "Single", e[e.Double = 3] = "Double";
})(M ||= {});
var N = {
	Empty: new Uint8Array(),
	Cdata: new Uint8Array([
		67,
		68,
		65,
		84,
		65,
		91
	]),
	CdataEnd: new Uint8Array([
		93,
		93,
		62
	]),
	CommentEnd: new Uint8Array([
		45,
		45,
		33,
		62
	]),
	Doctype: new Uint8Array([
		100,
		111,
		99,
		116,
		121,
		112,
		101
	]),
	IframeEnd: new Uint8Array([
		60,
		47,
		105,
		102,
		114,
		97,
		109,
		101
	]),
	NoembedEnd: new Uint8Array([
		60,
		47,
		110,
		111,
		101,
		109,
		98,
		101,
		100
	]),
	NoframesEnd: new Uint8Array([
		60,
		47,
		110,
		111,
		102,
		114,
		97,
		109,
		101,
		115
	]),
	Plaintext: new Uint8Array([
		60,
		47,
		112,
		108,
		97,
		105,
		110,
		116,
		101,
		120,
		116
	]),
	ScriptEnd: new Uint8Array([
		60,
		47,
		115,
		99,
		114,
		105,
		112,
		116
	]),
	StyleEnd: new Uint8Array([
		60,
		47,
		115,
		116,
		121,
		108,
		101
	]),
	TitleEnd: new Uint8Array([
		60,
		47,
		116,
		105,
		116,
		108,
		101
	]),
	TextareaEnd: new Uint8Array([
		60,
		47,
		116,
		101,
		120,
		116,
		97,
		114,
		101,
		97
	]),
	XmpEnd: new Uint8Array([
		60,
		47,
		120,
		109,
		112
	])
}, Ue = new Map([
	[N.IframeEnd[2], N.IframeEnd],
	[N.NoembedEnd[2], N.NoembedEnd],
	[N.Plaintext[2], N.Plaintext],
	[N.ScriptEnd[2], N.ScriptEnd],
	[N.TitleEnd[2], N.TitleEnd],
	[N.XmpEnd[2], N.XmpEnd]
]), We = class {
	cbs;
	state = k.Text;
	buffer = "";
	sectionStart = 0;
	index = 0;
	entityStart = 0;
	baseState = k.Text;
	isSpecial = !1;
	running = !0;
	offset = 0;
	xmlMode;
	decodeEntities;
	recognizeSelfClosing;
	entityDecoder;
	constructor({ xmlMode: e = !1, decodeEntities: t = !0, recognizeSelfClosing: n = e }, r) {
		this.cbs = r, this.xmlMode = e, this.decodeEntities = t, this.recognizeSelfClosing = n, this.entityDecoder = new Be(e ? Ie : Fe, (e, t) => this.emitCodePoint(e, t));
	}
	reset() {
		this.state = k.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.baseState = k.Text, this.isSpecial = !1, this.currentSequence = N.Empty, this.sequenceIndex = 0, this.running = !0, this.offset = 0;
	}
	write(e) {
		this.offset += this.buffer.length, this.buffer = e, this.parse();
	}
	end() {
		this.running && this.finish();
	}
	pause() {
		this.running = !1;
	}
	resume() {
		this.running = !0, this.index < this.buffer.length + this.offset && this.parse();
	}
	stateText(e) {
		e === O.Lt || !this.decodeEntities && this.fastForwardTo(O.Lt) ? (this.index > this.sectionStart && this.cbs.ontext(this.sectionStart, this.index), this.state = k.BeforeTagName, this.sectionStart = this.index) : this.decodeEntities && e === O.Amp && this.startEntity();
	}
	currentSequence = N.Empty;
	sequenceIndex = 0;
	enterTagBody() {
		this.currentSequence === N.Plaintext ? (this.currentSequence = N.Empty, this.state = k.InPlainText) : this.isSpecial ? (this.state = k.InSpecialTag, this.sequenceIndex = 0) : this.state = k.Text;
	}
	stateSpecialStartSequence(e) {
		let t = e | 32;
		if (this.sequenceIndex < this.currentSequence.length) {
			if (t === this.currentSequence[this.sequenceIndex]) {
				this.sequenceIndex++;
				return;
			}
			if (this.sequenceIndex === 3) {
				if (this.currentSequence === N.ScriptEnd && t === N.StyleEnd[3]) {
					this.currentSequence = N.StyleEnd, this.sequenceIndex = 4;
					return;
				}
				if (this.currentSequence === N.TitleEnd && t === N.TextareaEnd[3]) {
					this.currentSequence = N.TextareaEnd, this.sequenceIndex = 4;
					return;
				}
			} else if (this.sequenceIndex === 4 && this.currentSequence === N.NoembedEnd && t === N.NoframesEnd[4]) {
				this.currentSequence = N.NoframesEnd, this.sequenceIndex = 5;
				return;
			}
		} else if (j(e)) {
			this.sequenceIndex = 0, this.state = k.InTagName, this.stateInTagName(e);
			return;
		}
		this.isSpecial = !1, this.currentSequence = N.Empty, this.sequenceIndex = 0, this.state = k.InTagName, this.stateInTagName(e);
	}
	stateCDATASequence(e) {
		e === N.Cdata[this.sequenceIndex] ? ++this.sequenceIndex === N.Cdata.length && (this.state = k.InCommentLike, this.currentSequence = N.CdataEnd, this.sequenceIndex = 0, this.sectionStart = this.index + 1) : (this.sequenceIndex = 0, this.xmlMode ? (this.state = k.InDeclaration, this.stateInDeclaration(e)) : (this.state = k.InSpecialComment, this.stateInSpecialComment(e)));
	}
	fastForwardTo(e) {
		for (; ++this.index < this.buffer.length + this.offset;) if (this.buffer.charCodeAt(this.index - this.offset) === e) return !0;
		return this.index = this.buffer.length + this.offset - 1, !1;
	}
	emitComment(e) {
		this.cbs.oncomment(this.sectionStart, this.index, e), this.sequenceIndex = 0, this.sectionStart = this.index + 1, this.state = k.Text;
	}
	stateInCommentLike(e) {
		!this.xmlMode && this.currentSequence === N.CommentEnd && this.sequenceIndex <= 1 && this.index === this.sectionStart + this.sequenceIndex && e === O.Gt ? this.emitComment(this.sequenceIndex) : this.currentSequence === N.CommentEnd && this.sequenceIndex === 2 && e === O.Gt ? this.emitComment(2) : this.currentSequence === N.CommentEnd && this.sequenceIndex === this.currentSequence.length - 1 && e !== O.Gt ? this.sequenceIndex = Number(e === O.Dash) : e === this.currentSequence[this.sequenceIndex] ? ++this.sequenceIndex === this.currentSequence.length && (this.currentSequence === N.CdataEnd ? this.cbs.oncdata(this.sectionStart, this.index, 2) : this.cbs.oncomment(this.sectionStart, this.index, 3), this.sequenceIndex = 0, this.sectionStart = this.index + 1, this.state = k.Text) : this.sequenceIndex === 0 ? this.fastForwardTo(this.currentSequence[0]) && (this.sequenceIndex = 1) : e !== this.currentSequence[this.sequenceIndex - 1] && (this.sequenceIndex = 0);
	}
	isTagStartChar(e) {
		return this.xmlMode ? !j(e) : He(e);
	}
	stateInSpecialTag(e) {
		if (this.sequenceIndex === this.currentSequence.length) {
			if (j(e)) {
				let t = this.index - this.currentSequence.length;
				if (this.sectionStart < t) {
					let e = this.index;
					this.index = t, this.cbs.ontext(this.sectionStart, t), this.index = e;
				}
				this.isSpecial = !1, this.sectionStart = t + 2, this.stateInClosingTagName(e);
				return;
			}
			this.sequenceIndex = 0;
		}
		(e | 32) === this.currentSequence[this.sequenceIndex] ? this.sequenceIndex += 1 : this.sequenceIndex === 0 ? this.currentSequence === N.TitleEnd || this.currentSequence === N.TextareaEnd ? this.decodeEntities && e === O.Amp && this.startEntity() : this.fastForwardTo(O.Lt) && (this.sequenceIndex = 1) : this.sequenceIndex = Number(e === O.Lt);
	}
	stateBeforeTagName(e) {
		if (e === O.ExclamationMark) this.state = k.BeforeDeclaration, this.sectionStart = this.index + 1;
		else if (e === O.Questionmark) this.xmlMode ? (this.state = k.InProcessingInstruction, this.sequenceIndex = 0, this.sectionStart = this.index + 1) : (this.state = k.InSpecialComment, this.sectionStart = this.index);
		else if (this.isTagStartChar(e)) {
			this.sectionStart = this.index;
			let t = this.xmlMode || this.cbs.isInForeignContext?.() ? void 0 : Ue.get(e | 32);
			t === void 0 ? this.state = k.InTagName : (this.isSpecial = !0, this.currentSequence = t, this.sequenceIndex = 3, this.state = k.SpecialStartSequence);
		} else e === O.Slash ? this.state = k.BeforeClosingTagName : (this.state = k.Text, this.stateText(e));
	}
	stateInTagName(e) {
		j(e) && (this.cbs.onopentagname(this.sectionStart, this.index), this.sectionStart = -1, this.state = k.BeforeAttributeName, this.stateBeforeAttributeName(e));
	}
	stateBeforeClosingTagName(e) {
		A(e) ? this.xmlMode || (this.state = k.InSpecialComment, this.sectionStart = this.index) : e === O.Gt ? (this.state = k.Text, this.xmlMode || (this.sectionStart = this.index + 1)) : (this.state = this.isTagStartChar(e) ? k.InClosingTagName : k.InSpecialComment, this.sectionStart = this.index);
	}
	stateInClosingTagName(e) {
		j(e) && (this.cbs.onclosetag(this.sectionStart, this.index), this.sectionStart = -1, this.state = k.AfterClosingTagName, this.stateAfterClosingTagName(e));
	}
	stateAfterClosingTagName(e) {
		(e === O.Gt || this.fastForwardTo(O.Gt)) && (this.state = k.Text, this.sectionStart = this.index + 1);
	}
	stateBeforeAttributeName(e) {
		e === O.Gt ? (this.cbs.onopentagend(this.index), this.enterTagBody(), this.sectionStart = this.index + 1) : e === O.Slash ? this.state = k.InSelfClosingTag : A(e) || (this.state = k.InAttributeName, this.sectionStart = this.index);
	}
	stateInSelfClosingTag(e) {
		if (e === O.Gt) {
			if (this.cbs.onselfclosingtag(this.index), this.sectionStart = this.index + 1, !this.recognizeSelfClosing) {
				this.enterTagBody();
				return;
			}
			this.state = k.Text, this.isSpecial = !1, this.currentSequence = N.Empty;
		} else A(e) || (this.state = k.BeforeAttributeName, this.stateBeforeAttributeName(e));
	}
	stateInAttributeName(e) {
		(e === O.Eq || j(e)) && (this.cbs.onattribname(this.sectionStart, this.index), this.sectionStart = this.index, this.state = k.AfterAttributeName, this.stateAfterAttributeName(e));
	}
	stateAfterAttributeName(e) {
		e === O.Eq ? this.state = k.BeforeAttributeValue : e === O.Slash || e === O.Gt ? (this.cbs.onattribend(M.NoValue, this.sectionStart), this.sectionStart = -1, this.state = k.BeforeAttributeName, this.stateBeforeAttributeName(e)) : A(e) || (this.cbs.onattribend(M.NoValue, this.sectionStart), this.state = k.InAttributeName, this.sectionStart = this.index);
	}
	stateBeforeAttributeValue(e) {
		e === O.DoubleQuote ? (this.state = k.InAttributeValueDq, this.sectionStart = this.index + 1) : e === O.SingleQuote ? (this.state = k.InAttributeValueSq, this.sectionStart = this.index + 1) : A(e) || (this.sectionStart = this.index, this.state = k.InAttributeValueNq, this.stateInAttributeValueNoQuotes(e));
	}
	handleInAttributeValue(e, t) {
		e === t || !this.decodeEntities && this.fastForwardTo(t) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(t === O.DoubleQuote ? M.Double : M.Single, this.index + 1), this.state = k.BeforeAttributeName) : this.decodeEntities && e === O.Amp && this.startEntity();
	}
	stateInAttributeValueDoubleQuotes(e) {
		this.handleInAttributeValue(e, O.DoubleQuote);
	}
	stateInAttributeValueSingleQuotes(e) {
		this.handleInAttributeValue(e, O.SingleQuote);
	}
	stateInAttributeValueNoQuotes(e) {
		A(e) || e === O.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(M.Unquoted, this.index), this.state = k.BeforeAttributeName, this.stateBeforeAttributeName(e)) : this.decodeEntities && e === O.Amp && this.startEntity();
	}
	stateBeforeDeclaration(e) {
		e === O.OpeningSquareBracket ? (this.state = k.CDATASequence, this.sequenceIndex = 0) : this.xmlMode ? this.state = e === O.Dash ? k.BeforeComment : k.InDeclaration : (e | 32) === N.Doctype[0] ? (this.state = k.DeclarationSequence, this.currentSequence = N.Doctype, this.sequenceIndex = 1) : e === O.Gt ? (this.cbs.oncomment(this.sectionStart, this.index, 0), this.state = k.Text, this.sectionStart = this.index + 1) : e === O.Dash ? this.state = k.BeforeComment : this.state = k.InSpecialComment;
	}
	stateDeclarationSequence(e) {
		this.sequenceIndex === this.currentSequence.length ? (this.state = k.InDeclaration, this.stateInDeclaration(e)) : (e | 32) === this.currentSequence[this.sequenceIndex] ? this.sequenceIndex += 1 : e === O.Gt ? (this.cbs.oncomment(this.sectionStart, this.index, 0), this.state = k.Text, this.sectionStart = this.index + 1) : this.state = k.InSpecialComment;
	}
	stateInDeclaration(e) {
		(e === O.Gt || this.fastForwardTo(O.Gt)) && (this.cbs.ondeclaration(this.sectionStart, this.index), this.state = k.Text, this.sectionStart = this.index + 1);
	}
	stateInProcessingInstruction(e) {
		e === O.Questionmark ? this.sequenceIndex = 1 : e === O.Gt && this.sequenceIndex === 1 ? (this.cbs.onprocessinginstruction(this.sectionStart, this.index - 1), this.sequenceIndex = 0, this.state = k.Text, this.sectionStart = this.index + 1) : this.sequenceIndex = Number(this.fastForwardTo(O.Questionmark));
	}
	stateBeforeComment(e) {
		e === O.Dash ? (this.state = k.InCommentLike, this.currentSequence = N.CommentEnd, this.sequenceIndex = 0, this.sectionStart = this.index + 1) : this.xmlMode ? this.state = k.InDeclaration : e === O.Gt ? (this.cbs.oncomment(this.sectionStart, this.index, 0), this.state = k.Text, this.sectionStart = this.index + 1) : this.state = k.InSpecialComment;
	}
	stateInSpecialComment(e) {
		(e === O.Gt || this.fastForwardTo(O.Gt)) && (this.cbs.oncomment(this.sectionStart, this.index, 0), this.state = k.Text, this.sectionStart = this.index + 1);
	}
	startEntity() {
		this.baseState = this.state, this.state = k.InEntity, this.entityStart = this.index, this.entityDecoder.startEntity(this.xmlMode ? D.Strict : this.baseState === k.Text || this.baseState === k.InSpecialTag ? D.Legacy : D.Attribute);
	}
	stateInEntity() {
		let e = this.index - this.offset, t = this.entityDecoder.write(this.buffer, e);
		if (t >= 0) this.state = this.baseState, t === 0 && --this.index;
		else {
			if (e < this.buffer.length && this.buffer.charCodeAt(e) === O.Amp) {
				this.state = this.baseState, --this.index;
				return;
			}
			this.index = this.offset + this.buffer.length - 1;
		}
	}
	cleanup() {
		this.running && this.sectionStart !== this.index && (this.state === k.Text || this.state === k.InPlainText || this.state === k.InSpecialTag && this.sequenceIndex === 0 ? (this.cbs.ontext(this.sectionStart, this.index), this.sectionStart = this.index) : (this.state === k.InAttributeValueDq || this.state === k.InAttributeValueSq || this.state === k.InAttributeValueNq) && (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = this.index));
	}
	shouldContinue() {
		return this.index < this.buffer.length + this.offset && this.running;
	}
	parse() {
		for (; this.shouldContinue();) {
			let e = this.buffer.charCodeAt(this.index - this.offset);
			switch (this.state) {
				case k.Text:
					this.stateText(e);
					break;
				case k.InPlainText:
					this.index = this.buffer.length + this.offset - 1;
					break;
				case k.SpecialStartSequence:
					this.stateSpecialStartSequence(e);
					break;
				case k.InSpecialTag:
					this.stateInSpecialTag(e);
					break;
				case k.CDATASequence:
					this.stateCDATASequence(e);
					break;
				case k.DeclarationSequence:
					this.stateDeclarationSequence(e);
					break;
				case k.InAttributeValueDq:
					this.stateInAttributeValueDoubleQuotes(e);
					break;
				case k.InAttributeName:
					this.stateInAttributeName(e);
					break;
				case k.InCommentLike:
					this.stateInCommentLike(e);
					break;
				case k.InSpecialComment:
					this.stateInSpecialComment(e);
					break;
				case k.BeforeAttributeName:
					this.stateBeforeAttributeName(e);
					break;
				case k.InTagName:
					this.stateInTagName(e);
					break;
				case k.InClosingTagName:
					this.stateInClosingTagName(e);
					break;
				case k.BeforeTagName:
					this.stateBeforeTagName(e);
					break;
				case k.AfterAttributeName:
					this.stateAfterAttributeName(e);
					break;
				case k.InAttributeValueSq:
					this.stateInAttributeValueSingleQuotes(e);
					break;
				case k.BeforeAttributeValue:
					this.stateBeforeAttributeValue(e);
					break;
				case k.BeforeClosingTagName:
					this.stateBeforeClosingTagName(e);
					break;
				case k.AfterClosingTagName:
					this.stateAfterClosingTagName(e);
					break;
				case k.InAttributeValueNq:
					this.stateInAttributeValueNoQuotes(e);
					break;
				case k.InSelfClosingTag:
					this.stateInSelfClosingTag(e);
					break;
				case k.InDeclaration:
					this.stateInDeclaration(e);
					break;
				case k.BeforeDeclaration:
					this.stateBeforeDeclaration(e);
					break;
				case k.BeforeComment:
					this.stateBeforeComment(e);
					break;
				case k.InProcessingInstruction:
					this.stateInProcessingInstruction(e);
					break;
				case k.InEntity:
					this.stateInEntity();
					break;
			}
			this.index++;
		}
		this.cleanup();
	}
	finish() {
		this.state === k.InEntity && (this.entityDecoder.end(), this.state = this.baseState), this.handleTrailingData(), this.cbs.onend();
	}
	handleTrailingCommentLikeData(e) {
		if (this.state !== k.InCommentLike) return !1;
		if (this.currentSequence === N.CdataEnd) if (this.xmlMode) this.sectionStart < e && this.cbs.oncdata(this.sectionStart, e, 0);
		else {
			let t = this.sectionStart - N.Cdata.length - 1;
			this.cbs.oncomment(t, e, 0);
		}
		else {
			let t = this.xmlMode ? 0 : Math.min(this.sequenceIndex, N.CommentEnd.length - 1);
			this.cbs.oncomment(this.sectionStart, e, t);
		}
		return !0;
	}
	handleTrailingMarkupDeclaration(e) {
		if (this.xmlMode) switch (this.state) {
			case k.InSpecialComment:
			case k.BeforeComment:
			case k.CDATASequence:
			case k.DeclarationSequence:
			case k.InDeclaration: return this.cbs.ontext(this.sectionStart, e), !0;
			default: return !1;
		}
		switch (this.state) {
			case k.BeforeDeclaration:
			case k.InSpecialComment:
			case k.BeforeComment:
			case k.CDATASequence: return this.cbs.oncomment(this.sectionStart, e, 0), !0;
			case k.DeclarationSequence: return this.sequenceIndex !== N.Doctype.length && this.cbs.oncomment(this.sectionStart, e, 0), !0;
			case k.InDeclaration: return !0;
			default: return !1;
		}
	}
	handleTrailingData() {
		let e = this.buffer.length + this.offset;
		if (!(this.handleTrailingCommentLikeData(e) || this.handleTrailingMarkupDeclaration(e)) && !(this.sectionStart >= e)) switch (this.state) {
			case k.InTagName:
			case k.BeforeAttributeName:
			case k.BeforeAttributeValue:
			case k.AfterAttributeName:
			case k.InAttributeName:
			case k.InAttributeValueSq:
			case k.InAttributeValueDq:
			case k.InAttributeValueNq:
			case k.InClosingTagName: break;
			default: this.cbs.ontext(this.sectionStart, e);
		}
	}
	emitCodePoint(e, t) {
		this.baseState !== k.Text && this.baseState !== k.InSpecialTag ? (this.sectionStart < this.entityStart && this.cbs.onattribdata(this.sectionStart, this.entityStart), this.sectionStart = this.entityStart + t, this.index = this.sectionStart - 1, this.cbs.onattribentity(e)) : (this.sectionStart < this.entityStart && this.cbs.ontext(this.sectionStart, this.entityStart), this.sectionStart = this.entityStart + t, this.index = this.sectionStart - 1, this.cbs.ontextentity(e, this.sectionStart));
	}
}, { fromCodePoint: Ge } = String, P = new Set([
	"input",
	"option",
	"optgroup",
	"select",
	"button",
	"datalist",
	"textarea"
]), F = new Set(["p"]), I = new Set([
	"h1",
	"h2",
	"h3",
	"h4",
	"h5",
	"h6",
	"p"
]), L = new Set(["thead", "tbody"]), R = new Set(["dd", "dt"]), z = new Set(["rt", "rp"]), Ke = new Map([
	["tr", new Set([
		"tr",
		"th",
		"td"
	])],
	["th", new Set(["th"])],
	["td", new Set([
		"thead",
		"th",
		"td"
	])],
	["body", new Set([
		"head",
		"link",
		"script"
	])],
	["a", new Set(["a"])],
	["li", new Set(["li"])],
	["p", F],
	["h1", I],
	["h2", I],
	["h3", I],
	["h4", I],
	["h5", I],
	["h6", I],
	["select", P],
	["input", P],
	["output", P],
	["button", P],
	["datalist", P],
	["textarea", P],
	["option", new Set(["option"])],
	["optgroup", new Set(["optgroup", "option"])],
	["dd", R],
	["dt", R],
	["address", F],
	["article", F],
	["aside", F],
	["blockquote", F],
	["details", F],
	["div", F],
	["dl", F],
	["fieldset", F],
	["figcaption", F],
	["figure", F],
	["footer", F],
	["form", F],
	["header", F],
	["hr", F],
	["main", F],
	["nav", F],
	["ol", F],
	["pre", F],
	["section", F],
	["table", F],
	["ul", F],
	["rt", z],
	["rp", z],
	["tbody", L],
	["tfoot", L]
]), qe = "doctype", Je = new Set([
	"area",
	"base",
	"basefont",
	"br",
	"col",
	"command",
	"embed",
	"frame",
	"hr",
	"img",
	"input",
	"isindex",
	"keygen",
	"link",
	"meta",
	"param",
	"source",
	"track",
	"wbr"
]), Ye = new Set(["math", "svg"]), B = new Set([
	"mi",
	"mo",
	"mn",
	"ms",
	"mtext",
	"annotation-xml",
	"foreignObject",
	"desc",
	"title"
]), V = new Map([
	["altglyph", "altGlyph"],
	["altglyphdef", "altGlyphDef"],
	["altglyphitem", "altGlyphItem"],
	["animatecolor", "animateColor"],
	["animatemotion", "animateMotion"],
	["animatetransform", "animateTransform"],
	["clippath", "clipPath"],
	["feblend", "feBlend"],
	["fecolormatrix", "feColorMatrix"],
	["fecomponenttransfer", "feComponentTransfer"],
	["fecomposite", "feComposite"],
	["feconvolvematrix", "feConvolveMatrix"],
	["fediffuselighting", "feDiffuseLighting"],
	["fedisplacementmap", "feDisplacementMap"],
	["fedistantlight", "feDistantLight"],
	["fedropshadow", "feDropShadow"],
	["feflood", "feFlood"],
	["fefunca", "feFuncA"],
	["fefuncb", "feFuncB"],
	["fefuncg", "feFuncG"],
	["fefuncr", "feFuncR"],
	["fegaussianblur", "feGaussianBlur"],
	["feimage", "feImage"],
	["femerge", "feMerge"],
	["femergenode", "feMergeNode"],
	["femorphology", "feMorphology"],
	["feoffset", "feOffset"],
	["fepointlight", "fePointLight"],
	["fespecularlighting", "feSpecularLighting"],
	["fespotlight", "feSpotLight"],
	["fetile", "feTile"],
	["feturbulence", "feTurbulence"],
	["foreignobject", "foreignObject"],
	["glyphref", "glyphRef"],
	["lineargradient", "linearGradient"],
	["radialgradient", "radialGradient"],
	["textpath", "textPath"]
]), H;
(function(e) {
	e[e.None = 0] = "None", e[e.Svg = 1] = "Svg", e[e.MathML = 2] = "MathML";
})(H ||= {});
var Xe = /\s|\//, U = class {
	options;
	startIndex = 0;
	endIndex = 0;
	openTagStart = 0;
	tagname = "";
	attribname = "";
	attribvalue = "";
	attribs = null;
	stack = [];
	foreignContext;
	cbs;
	lowerCaseTagNames;
	lowerCaseAttributeNames;
	recognizeSelfClosing;
	htmlMode;
	tokenizer;
	buffers = [];
	bufferOffset = 0;
	writeIndex = 0;
	ended = !1;
	constructor(e, t = {}) {
		this.options = t, this.cbs = e ?? {}, this.htmlMode = !this.options.xmlMode, this.lowerCaseTagNames = t.lowerCaseTags ?? this.htmlMode, this.lowerCaseAttributeNames = t.lowerCaseAttributeNames ?? this.htmlMode, this.recognizeSelfClosing = t.recognizeSelfClosing ?? !this.htmlMode, this.tokenizer = new (t.Tokenizer ?? We)(this.options, this), this.foreignContext = [H.None], this.cbs.onparserinit?.(this);
	}
	ontext(e, t) {
		let n = this.getSlice(e, t);
		this.endIndex = t - 1, this.cbs.ontext?.(n), this.startIndex = t;
	}
	ontextentity(e, t) {
		this.endIndex = t - 1, this.cbs.ontext?.(Ge(e)), this.startIndex = t;
	}
	isInForeignContext() {
		return this.foreignContext[0] !== H.None;
	}
	isVoidElement(e) {
		return this.htmlMode && Je.has(e);
	}
	readTagName(e, t) {
		let n = this.lowerCaseTagNames ? this.getSlice(e, t).toLowerCase() : this.getSlice(e, t);
		if (!(this.lowerCaseTagNames && this.htmlMode)) return n;
		if (this.foreignContext[0] === H.Svg) return V.get(n) ?? n;
		if (this.foreignContext.length > 1) {
			let e = V.get(n);
			if (e !== void 0 && this.stack.includes(e)) return e;
		}
		return this.isInForeignContext() ? n : n === "image" ? "img" : n;
	}
	onopentagname(e, t) {
		this.endIndex = t, this.emitOpenTag(this.readTagName(e, t));
	}
	emitOpenTag(e) {
		if (this.openTagStart = this.startIndex, this.tagname = e, this.htmlMode && e === "form" && this.stack.includes("form")) {
			this.tagname = "";
			return;
		}
		let t = this.htmlMode && Ke.get(e);
		if (t) for (; this.stack.length > 0 && t.has(this.stack[0]);) this.popElement(!0);
		this.isVoidElement(e) || (this.stack.unshift(e), this.htmlMode && (e === "svg" ? this.foreignContext.unshift(H.Svg) : e === "math" ? this.foreignContext.unshift(H.MathML) : B.has(e) && this.foreignContext.unshift(H.None))), this.cbs.onopentagname?.(e), this.cbs.onopentag && (this.attribs = {});
	}
	endOpenTag(e) {
		this.startIndex = this.openTagStart, this.attribs &&= (this.cbs.onopentag?.(this.tagname, this.attribs, e), null), this.cbs.onclosetag && this.isVoidElement(this.tagname) && this.cbs.onclosetag(this.tagname, !0), this.tagname = "";
	}
	onopentagend(e) {
		this.endIndex = e, this.endOpenTag(!1), this.startIndex = e + 1;
	}
	onclosetag(e, t) {
		this.endIndex = t;
		let n = this.readTagName(e, t);
		if (this.isVoidElement(n)) this.htmlMode && n === "br" && (this.cbs.onopentagname?.("br"), this.cbs.onopentag?.("br", {}, !0), this.cbs.onclosetag?.("br", !1));
		else {
			let e = this.stack.indexOf(n);
			if (e !== -1) {
				for (let t = 0; t < e; t++) this.popElement(!0);
				this.popElement(!1);
			} else this.htmlMode && n === "p" && (this.emitOpenTag("p"), this.closeCurrentTag(!0));
		}
		this.startIndex = t + 1;
	}
	onselfclosingtag(e) {
		this.endIndex = e, this.recognizeSelfClosing || this.isInForeignContext() ? (this.closeCurrentTag(!1), this.startIndex = e + 1) : this.onopentagend(e);
	}
	popElement(e) {
		let t = this.stack.shift();
		this.htmlMode && (Ye.has(t) || B.has(t)) && this.foreignContext.shift(), this.cbs.onclosetag?.(t, e);
	}
	closeCurrentTag(e) {
		let t = this.tagname;
		this.endOpenTag(e), this.stack[0] === t && this.popElement(!e);
	}
	onattribname(e, t) {
		this.startIndex = e;
		let n = this.getSlice(e, t);
		this.attribname = this.lowerCaseAttributeNames ? n.toLowerCase() : n;
	}
	onattribdata(e, t) {
		this.attribvalue += this.getSlice(e, t);
	}
	onattribentity(e) {
		this.attribvalue += Ge(e);
	}
	onattribend(e, t) {
		this.endIndex = t, this.cbs.onattribute?.(this.attribname, this.attribvalue, e === M.Double ? "\"" : e === M.Single ? "'" : e === M.NoValue ? void 0 : null), this.attribs && !Object.hasOwn(this.attribs, this.attribname) && (this.attribs[this.attribname] = this.attribvalue), this.attribvalue = "";
	}
	getInstructionName(e) {
		let t = e.search(Xe), n = t < 0 ? e : e.substr(0, t);
		return this.lowerCaseTagNames && (n = n.toLowerCase()), n;
	}
	ondeclaration(e, t) {
		this.endIndex = t;
		let n = this.getSlice(e, t);
		if (this.cbs.onprocessinginstruction) {
			let e = this.htmlMode ? this.lowerCaseTagNames ? qe : n.slice(0, 7) : this.getInstructionName(n);
			this.cbs.onprocessinginstruction(`!${e}`, `!${n}`);
		}
		this.startIndex = t + 1;
	}
	onprocessinginstruction(e, t) {
		this.endIndex = t;
		let n = this.getSlice(e, t);
		if (this.cbs.onprocessinginstruction) {
			let e = this.getInstructionName(n);
			this.cbs.onprocessinginstruction(`?${e}`, `?${n}`);
		}
		this.startIndex = t + 1;
	}
	oncomment(e, t, n) {
		this.endIndex = t, this.cbs.oncomment?.(this.getSlice(e, t - n)), this.cbs.oncommentend?.(), this.startIndex = t + 1;
	}
	oncdata(e, t, n) {
		this.endIndex = t;
		let r = this.getSlice(e, t - n);
		!this.htmlMode || this.options.recognizeCDATA ? (this.cbs.oncdatastart?.(), this.cbs.ontext?.(r), this.cbs.oncdataend?.()) : this.isInForeignContext() ? this.cbs.ontext?.(r) : (this.cbs.oncomment?.(`[CDATA[${r}]]`), this.cbs.oncommentend?.()), this.startIndex = t + 1;
	}
	onend() {
		if (this.cbs.onclosetag) {
			this.endIndex = this.startIndex;
			for (let e = 0; e < this.stack.length; e++) this.cbs.onclosetag(this.stack[e], !0);
		}
		this.cbs.onend?.();
	}
	reset() {
		this.cbs.onreset?.(), this.tokenizer.reset(), this.tagname = "", this.attribname = "", this.attribvalue = "", this.attribs = null, this.stack.length = 0, this.startIndex = 0, this.endIndex = 0, this.cbs.onparserinit?.(this), this.buffers.length = 0, this.foreignContext.length = 0, this.foreignContext.unshift(H.None), this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1;
	}
	parseComplete(e) {
		this.reset(), this.end(e);
	}
	getSlice(e, t) {
		if (e === t) return "";
		for (; e - this.bufferOffset >= this.buffers[0].length;) this.shiftBuffer();
		let n = this.buffers[0].slice(e - this.bufferOffset, t - this.bufferOffset);
		for (; t - this.bufferOffset > this.buffers[0].length;) this.shiftBuffer(), n += this.buffers[0].slice(0, t - this.bufferOffset);
		return n;
	}
	shiftBuffer() {
		this.bufferOffset += this.buffers[0].length, this.writeIndex--, this.buffers.shift();
	}
	write(e) {
		if (this.ended) {
			this.cbs.onerror?.(/* @__PURE__ */ Error(".write() after done!"));
			return;
		}
		this.buffers.push(e), this.tokenizer.running && (this.tokenizer.write(e), this.writeIndex++);
	}
	end(e) {
		if (this.ended) {
			this.cbs.onerror?.(/* @__PURE__ */ Error(".end() after done!"));
			return;
		}
		e && this.write(e), this.ended = !0, this.tokenizer.end();
	}
	pause() {
		this.tokenizer.pause();
	}
	resume() {
		for (this.tokenizer.resume(); this.tokenizer.running && this.writeIndex < this.buffers.length;) this.tokenizer.write(this.buffers[this.writeIndex++]);
		this.ended && this.tokenizer.end();
	}
};
//#endregion
//#region ../quality/src/html-utils.ts
function W(e) {
	let t = [], n = null, r = "", i = () => {
		n !== null && (n.text = r.trim(), t.push(n), n = null, r = "");
	}, a = new U({
		onopentag(e, t) {
			if (e === "a") {
				i(), n = {
					href: t.href ?? "",
					text: "",
					target: t.target ?? null,
					rel: t.rel ?? null,
					hasImageWithAlt: !1
				};
				return;
			}
			e === "img" && n !== null && (t.alt ?? "").trim() !== "" && (n.hasImageWithAlt = !0);
		},
		ontext(e) {
			n !== null && (r += e);
		},
		onclosetag(e) {
			e === "a" && i();
		}
	});
	return a.write(e), a.end(), i(), t;
}
function Ze(e) {
	let t = e.replace(/<!--[\s\S]*?-->/g, "").matchAll(/<\/?a\b[^>]*>/gi), n = 0;
	for (let e of t) {
		if (e[0].startsWith("</")) {
			n > 0 && n--;
			continue;
		}
		if (n > 0) return !0;
		n++;
	}
	return !1;
}
function G(e) {
	let t = "", n = new U({ ontext(e) {
		t += e;
	} });
	return n.write(e), n.end(), t.trim();
}
var Qe = {
	meta: {
		id: "a11y.heading-empty",
		severity: "error"
	},
	block(e) {
		return !l(e) || G(e.content ?? "") !== "" ? null : { blockId: e.id };
	}
}, $e = {
	id: "a11y.heading-skip-level",
	severity: "error"
};
function K(e, n) {
	for (let r of e) {
		if (l(r)) {
			n.push(r);
			continue;
		}
		if (t(r)) for (let e of r.children) K(e, n);
	}
}
var et = {
	meta: $e,
	template(e) {
		let t = [];
		K(e.blocks, t);
		let n = [], r = 0;
		for (let e of t) r !== 0 && e.level > r + 1 && n.push({
			blockId: e.id,
			params: {
				from: r,
				to: e.level
			}
		}), r = e.level;
		return n;
	}
}, tt = {
	id: "a11y.heading-multiple-h1",
	severity: "warning"
};
function q(e, n) {
	for (let r of e) {
		if (l(r)) {
			n.push(r);
			continue;
		}
		if (t(r)) for (let e of r.children) q(e, n);
	}
}
var nt = {
	meta: tt,
	template(e) {
		let t = [];
		q(e.blocks, t);
		let n = t.filter((e) => e.level === 1);
		return n.length <= 1 ? [] : n.slice(1).map((e) => ({ blockId: e.id }));
	}
}, rt = {
	id: "a11y.link-empty",
	severity: "error"
};
function it(e) {
	return u(e) || l(e) ? e.content : null;
}
var at = {
	meta: rt,
	block(e) {
		let t = it(e);
		return t === null || !W(t).find((e) => e.text === "" && !e.hasImageWithAlt) ? null : { blockId: e.id };
	}
}, ot = {
	id: "a11y.link-vague-text",
	severity: "warning"
};
function st(e) {
	return u(e) || l(e) ? e.content : null;
}
var ct = {
	meta: ot,
	block(e, t, n) {
		let r = st(e);
		if (r === null) return null;
		let i = y(n.locale).vagueLinkText, a = W(r).find((e) => {
			let t = je(e.text);
			return t !== "" && i.includes(t);
		});
		return a ? {
			blockId: e.id,
			params: { text: a.text }
		} : null;
	}
}, lt = {
	id: "a11y.link-href-empty",
	severity: "error"
};
function ut(e) {
	return u(e) || l(e) ? e.content : null;
}
var dt = {
	meta: lt,
	block(e) {
		let t = ut(e);
		return t === null || !W(t).find((e) => {
			let t = e.href.trim();
			return t === "" || t === "#";
		}) ? null : { blockId: e.id };
	}
}, ft = {
	id: "a11y.link-target-blank-no-rel",
	severity: "warning"
};
function pt(e) {
	return u(e) || l(e) ? e.content : null;
}
function mt(e) {
	if (e === null) return !1;
	let t = e.toLowerCase().split(/\s+/);
	return t.includes("noopener") || t.includes("noreferrer");
}
var ht = {
	meta: ft,
	block(e) {
		let t = pt(e);
		return t === null || !W(t).find((e) => e.target === "_blank" && !mt(e.rel)) ? null : {
			blockId: e.id,
			fix: {
				description: "Add rel=\"noopener\"",
				apply: (t) => {
					if (!u(e) && !l(e)) return;
					let n = yt(e.content ?? "");
					t.updateBlock(e.id, { content: n });
				}
			}
		};
	}
}, gt = /([^\s"'>/=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;
function _t(e) {
	let t = [], n = new RegExp(gt.source, gt.flags), r;
	for (; (r = n.exec(e)) !== null;) t.push({
		raw: r[0],
		name: r[1],
		value: r[2] ?? r[3] ?? r[4] ?? null,
		start: r.index
	});
	return t;
}
function vt(e) {
	return e.some((e) => e.name.toLowerCase() === "target" && e.value !== null && e.value.toLowerCase() === "_blank");
}
function yt(e) {
	return e.replace(/<a\b([^>]*)>/gi, (e, t) => {
		let n = _t(t);
		if (!vt(n)) return e;
		let r = n.find((e) => e.name.toLowerCase() === "rel");
		if (r) {
			let n = (r.value ?? "").toLowerCase().split(/\s+/);
			if (n.includes("noopener") || n.includes("noreferrer")) return e;
			let i = `${r.value ?? ""} noopener`.trim();
			return `<a${t.slice(0, r.start)}rel="${i}"${t.slice(r.start + r.raw.length)}>`;
		}
		return `<a${t} rel="noopener">`;
	});
}
//#endregion
//#region ../quality/src/accessibility/rules/link-nested-anchor.ts
var bt = {
	id: "a11y.link-nested-anchor",
	severity: "error"
};
function xt(e) {
	return u(e) || l(e) ? e.content : null;
}
var St = {
	meta: bt,
	block(e) {
		let t = xt(e);
		return t === null || !Ze(t) ? null : { blockId: e.id };
	}
}, Ct = {
	meta: {
		id: "a11y.text-all-caps",
		severity: "warning"
	},
	block(e, t, n) {
		if (!u(e) && !l(e)) return null;
		let r = G(e.content ?? "").replace(/[^\p{L}]/gu, "");
		return r.length < n.thresholds.allCapsMinLength || r !== r.toLocaleUpperCase() ? null : { blockId: e.id };
	}
}, wt = {
	meta: {
		id: "a11y.text-low-contrast",
		severity: "error"
	},
	block(e, t) {
		if (!l(e) || !f(e.color) || !f(t.resolvedBackgroundColor)) return null;
		let n = o[e.level] >= 24 ? 3 : 4.5, r = re(e.color, t.resolvedBackgroundColor);
		return Number.isNaN(r) || r >= n ? null : {
			blockId: e.id,
			params: {
				ratio: r.toFixed(2),
				required: n
			}
		};
	}
}, Tt = {
	id: "a11y.text-too-small",
	severity: "warning"
};
function Et(e) {
	return c(e) || s(e) ? e.fontSize : null;
}
//#endregion
//#region ../quality/src/accessibility/index.ts
var Dt = [
	ve,
	xe,
	Se,
	Ce,
	Me,
	Qe,
	et,
	nt,
	at,
	ct,
	dt,
	ht,
	St,
	Ct,
	wt,
	{
		meta: Tt,
		block(e, t, n) {
			let r = Et(e);
			return r === null || r >= n.thresholds.minFontSize ? null : {
				blockId: e.id,
				params: {
					size: r,
					min: n.thresholds.minFontSize
				}
			};
		}
	},
	{
		meta: {
			id: "a11y.button-vague-label",
			severity: "warning"
		},
		block(e, t, r) {
			if (!n(e)) return null;
			let i = je(e.text ?? "");
			return i === "" || !y(r.locale).vagueButtonLabels.includes(i) ? null : {
				blockId: e.id,
				params: { text: e.text }
			};
		}
	},
	{
		meta: {
			id: "a11y.button-touch-target",
			severity: "warning"
		},
		block(e, t, r) {
			if (!n(e)) return null;
			let i = e.buttonPadding;
			if (!i) return null;
			let a = e.fontSize * 1.4 + i.top + i.bottom;
			return a >= r.thresholds.minTouchTargetPx ? null : {
				blockId: e.id,
				params: {
					height: Math.round(a),
					min: r.thresholds.minTouchTargetPx
				}
			};
		}
	},
	{
		meta: {
			id: "a11y.button-low-contrast",
			severity: "error"
		},
		block(e) {
			if (!n(e)) return null;
			let t = re(e.textColor, e.backgroundColor);
			if (Number.isNaN(t)) return null;
			let r = e.fontSize >= 24 ? 3 : 4.5;
			return t >= r ? null : {
				blockId: e.id,
				params: {
					ratio: t.toFixed(2),
					required: r
				}
			};
		}
	},
	{
		meta: {
			id: "a11y.missing-preheader",
			severity: "info"
		},
		template(e) {
			return (e.settings.preheaderText?.trim() ?? "") === "" ? [{ blockId: null }] : [];
		}
	}
];
function Ot(e, t = {}) {
	return t.disabled === !0 || t.accessibility === !1 ? [] : h(e, Dt, le(t.locale, t.accessibility ?? {}, Dt), (e, t, n) => _e(e, t, n));
}
//#endregion
//#region ../quality/src/structure/messages/de.ts
var kt = /* @__PURE__ */ e({ default: () => At }), At = {
	"structure.duplicate-block-id": "Block-ID erscheint {count}-mal im Baum. Jeder Block muss eine eindeutige ID haben.",
	"structure.section-column-mismatch": "Sektion verwendet Layout „{layout}\" (erwartet {expected} Spalten), hat aber {actual}. Deutet auf beschädigten Zustand hin.",
	"structure.nested-section": "Sektion ist in einer anderen Sektion verschachtelt. Sektionen können nicht verschachtelt werden – der Renderer wird sich falsch verhalten.",
	"structure.empty-section": "Sektion enthält keine Blöcke. Entferne sie oder füge Inhalt hinzu.",
	"structure.empty-column": "Spalte {columnIndex} dieser Sektion ist leer. Füge Inhalt hinzu oder reduziere die Spaltenanzahl."
}, jt = /* @__PURE__ */ e({ default: () => J }), J = {
	"structure.duplicate-block-id": "Block id appears {count} times in the tree. Each block must have a unique id.",
	"structure.section-column-mismatch": "Section uses layout \"{layout}\" (expects {expected} columns) but has {actual}. Indicates corrupted state.",
	"structure.nested-section": "Section is nested inside another section. Sections cannot nest — the renderer will misbehave.",
	"structure.empty-section": "Section has no blocks. Remove it or add content.",
	"structure.empty-column": "Column {columnIndex} of this section is empty. Add content or reduce the column count."
}, Y = /* @__PURE__ */ Object.assign({
	"./de.ts": kt,
	"./en.ts": jt
}), X = {};
for (let e in Y) {
	let t = /\.\/([^/]+)\.ts$/.exec(e);
	if (!t) continue;
	let n = t[1];
	n !== "index" && (X[n] = Y[e].default);
}
function Mt(e) {
	return X[e.split("-")[0]?.toLowerCase() ?? "en"] ?? X.en ?? J;
}
function Nt(e, t, n) {
	let r = Mt(e)[t] ?? J[t];
	return n ? r.replace(/\{(\w+)\}/g, (e, t) => {
		let r = n[t];
		return r === void 0 ? `{${t}}` : String(r);
	}) : r;
}
//#endregion
//#region ../quality/src/structure/rules/duplicate-block-id.ts
var Pt = {
	id: "structure.duplicate-block-id",
	severity: "error"
};
function Ft(e, n) {
	for (let r of e) if (n.set(r.id, (n.get(r.id) ?? 0) + 1), t(r)) for (let e of r.children) Ft(e, n);
}
var It = {
	meta: Pt,
	template(e) {
		let t = /* @__PURE__ */ new Map();
		Ft(e.blocks, t);
		let n = [];
		for (let [e, r] of t) r > 1 && n.push({
			blockId: e,
			params: { count: r }
		});
		return n;
	}
}, Lt = {
	id: "structure.empty-column",
	severity: "warning"
};
function Rt(e, n) {
	for (let r of e) {
		if (!t(r)) continue;
		let e = r;
		e.children.length > 1 && e.children.forEach((t, r) => {
			t.length === 0 && n.push({
				blockId: e.id,
				params: { columnIndex: r + 1 }
			});
		});
		for (let t of e.children) Rt(t, n);
	}
}
var zt = {
	meta: Lt,
	template(e) {
		let t = [];
		return Rt(e.blocks, t), t;
	}
}, Bt = {
	id: "structure.empty-section",
	severity: "warning"
};
function Vt(e) {
	return e.children.length === 0 ? !0 : e.children.every((e) => e.length === 0);
}
var Ht = {
	meta: Bt,
	block(e) {
		if (!t(e)) return null;
		let n = e;
		return Vt(n) ? {
			blockId: n.id,
			fix: {
				description: "Remove the empty section",
				apply: (e) => {
					e.removeBlock(n.id);
				}
			}
		} : null;
	}
}, Ut = {
	meta: {
		id: "structure.nested-section",
		severity: "error"
	},
	block(e, n) {
		return !t(e) || n.section === null ? null : {
			blockId: e.id,
			params: { parentId: n.section.id }
		};
	}
}, Wt = {
	id: "structure.section-column-mismatch",
	severity: "error"
};
function Gt(e) {
	return e === "1" ? 1 : e === "3" ? 3 : 2;
}
//#endregion
//#region ../quality/src/structure/index.ts
var Kt = [
	It,
	Ht,
	zt,
	Ut,
	{
		meta: Wt,
		block(e) {
			if (!t(e)) return null;
			let n = e, r = Gt(n.columns), i = n.children.length;
			return i === r ? null : {
				blockId: n.id,
				params: {
					layout: n.columns,
					expected: r,
					actual: i
				}
			};
		}
	}
];
function qt(e, t = {}) {
	return t.disabled === !0 || t.structure === !1 ? [] : h(e, Kt, ue(t.locale, t.structure ?? {}, Kt), (e, t, n) => Nt(e, t, n));
}
//#endregion
//#region ../quality/src/links/messages/de.ts
var Jt = /* @__PURE__ */ e({ default: () => Yt }), Yt = {
	"link.javascript-protocol": "Die URL verwendet das „javascript:\"-Protokoll, das aus Sicherheitsgründen beim Rendern entfernt wird. Ersetze sie durch eine echte URL oder entferne sie.",
	"link.unsupported-protocol": "Die URL verwendet das Protokoll „{protocol}\", das von den meisten E-Mail-Clients nicht unterstützt wird. Verwende http, https, mailto, tel oder sms.",
	"link.malformed-mailto": "Der mailto:-Link ist fehlerhaft. Erwartet wird eine einzelne Empfängeradresse vor einer eventuellen Querystring (z. B. mailto:hallo@example.com).",
	"link.malformed-tel": "Der tel:-Link enthält Zeichen, die keine Ziffern, +, Leerzeichen, Bindestriche, Klammern oder Punkte sind.",
	"link.localhost-or-staging": "Der URL-Host „{host}\" entspricht einem Nicht-Produktionsmuster. Ersetze ihn vor dem Versand durch die Produktions-URL."
}, Xt = /* @__PURE__ */ e({ default: () => Z }), Z = {
	"link.javascript-protocol": "URL uses the \"javascript:\" protocol, which is stripped at render time for safety. Replace it with a real link or remove the URL.",
	"link.unsupported-protocol": "URL uses the \"{protocol}\" protocol, which most email clients do not support. Use http, https, mailto, tel, or sms.",
	"link.malformed-mailto": "mailto: link is malformed. Expected a single recipient address before any query string (e.g. mailto:hello@example.com).",
	"link.malformed-tel": "tel: link contains characters that are not digits, +, spaces, dashes, parentheses, or dots.",
	"link.localhost-or-staging": "URL host \"{host}\" matches a non-production pattern. Replace with the production URL before sending."
}, Zt = /* @__PURE__ */ Object.assign({
	"./de.ts": Jt,
	"./en.ts": Xt
}), Q = {};
for (let e in Zt) {
	let t = /\.\/([^/]+)\.ts$/.exec(e);
	if (!t) continue;
	let n = t[1];
	n !== "index" && (Q[n] = Zt[e].default);
}
function Qt(e) {
	return Q[e.split("-")[0]?.toLowerCase() ?? "en"] ?? Q.en ?? Z;
}
function $t(e, t, n) {
	let r = Qt(e)[t] ?? Z[t];
	return n ? r.replace(/\{(\w+)\}/g, (e, t) => {
		let r = n[t];
		return r === void 0 ? `{${t}}` : String(r);
	}) : r;
}
//#endregion
//#region ../quality/src/url-walker.ts
function $(e) {
	let t = [];
	return m(e, (e) => {
		if (l(e) || u(e) || i(e)) {
			for (let n of W(e.content)) t.push({
				url: n.href,
				blockId: e.id,
				source: "anchor",
				label: n.text
			});
			return;
		}
		if (n(e)) {
			t.push({
				url: e.url,
				blockId: e.id,
				source: "button",
				label: e.text
			});
			return;
		}
		if (r(e)) {
			e.linkUrl && e.linkUrl !== "" && t.push({
				url: e.linkUrl,
				blockId: e.id,
				source: "image-link",
				label: e.alt || void 0
			});
			return;
		}
		if (a(e)) {
			t.push({
				url: e.url,
				blockId: e.id,
				source: "video",
				label: e.alt || void 0
			});
			return;
		}
		if (c(e)) {
			for (let n of e.items) t.push({
				url: n.url,
				blockId: e.id,
				source: "menu-item",
				label: n.text
			});
			return;
		}
		if (ee(e)) {
			for (let n of e.icons) t.push({
				url: n.url,
				blockId: e.id,
				source: "social-icon",
				label: n.platform
			});
			return;
		}
	}), t;
}
//#endregion
//#region ../quality/src/links/rules/javascript-protocol.ts
var en = {
	id: "link.javascript-protocol",
	severity: "error"
};
function tn(e) {
	if (!e) return !1;
	let t = e.replace(/\s+/g, "");
	return /^javascript:/i.test(t);
}
var nn = {
	meta: en,
	template(e) {
		let t = [];
		for (let n of $(e)) tn(n.url) && t.push({ blockId: n.blockId });
		return t;
	}
}, rn = {
	id: "link.unsupported-protocol",
	severity: "warning"
}, an = new Set([
	"http",
	"https",
	"mailto",
	"tel",
	"sms"
]);
function on(e) {
	if (!e) return null;
	let t = e.trim(), n = /^([a-z][a-z0-9+\-.]*):/i.exec(t);
	return n ? n[1].toLowerCase() : null;
}
var sn = {
	meta: rn,
	template(e) {
		let t = [];
		for (let n of $(e)) {
			let e = on(n.url);
			e !== null && e !== "javascript" && (an.has(e) || t.push({
				blockId: n.blockId,
				params: { protocol: e }
			}));
		}
		return t;
	}
}, cn = {
	id: "link.malformed-mailto",
	severity: "warning"
};
function ln(e) {
	let t = e.trim();
	if (!/^mailto:/i.test(t)) return !1;
	let [n] = t.slice(7).split("?", 2);
	if (n.trim() === "") return !0;
	let r = n.split(",").map((e) => e.trim());
	for (let e of r) {
		if (e === "") return !0;
		let t = e.split("@");
		if (t.length !== 2) return !0;
		let [n, r] = t;
		if (n === "" || r === "" || !r.includes(".")) return !0;
	}
	return !1;
}
var un = {
	meta: cn,
	template(e) {
		let t = [];
		for (let n of $(e)) ln(n.url) && t.push({ blockId: n.blockId });
		return t;
	}
}, dn = {
	id: "link.malformed-tel",
	severity: "warning"
}, fn = /^[+0-9\s().\-]+$/, pn = /^[A-Za-z0-9-]+(=[^;]+)?$/;
function mn(e) {
	let t = e.trim();
	if (!/^tel:/i.test(t)) return !1;
	let n = t.slice(4).trim();
	if (n === "") return !0;
	let [r, ...i] = n.split(";");
	return fn.test(r) ? i.some((e) => !pn.test(e)) : !0;
}
var hn = {
	meta: dn,
	template(e) {
		let t = [];
		for (let n of $(e)) mn(n.url) && t.push({ blockId: n.blockId });
		return t;
	}
}, gn = {
	id: "link.localhost-or-staging",
	severity: "warning"
};
function _n(e) {
	let t = e.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*");
	return RegExp(`^${t}$`, "i");
}
function vn(e) {
	if (!e) return null;
	let t = e.trim();
	if (!/^(https?|ftps?):\/\//i.test(t)) return null;
	try {
		return new URL(t).hostname.toLowerCase();
	} catch {
		return null;
	}
}
//#endregion
//#region ../quality/src/links/index.ts
var yn = [
	nn,
	sn,
	un,
	hn,
	{
		meta: gn,
		template(e, t) {
			let n = t.links.nonProductionHosts;
			if (n.length === 0) return [];
			let r = n.map(_n), i = [];
			for (let t of $(e)) {
				let e = vn(t.url);
				e !== null && r.some((t) => t.test(e)) && i.push({
					blockId: t.blockId,
					params: { host: e }
				});
			}
			return i;
		}
	}
];
function bn(e, t = {}) {
	return t.disabled === !0 || t.links === !1 ? [] : h(e, yn, de(t.locale, t.links ?? {}, yn), (e, t, n) => $t(e, t, n));
}
//#endregion
//#region ../quality/src/index.ts
var xn = /* @__PURE__ */ e({
	lintAccessibility: () => Ot,
	lintLinks: () => bn,
	lintStructure: () => qt
});
//#endregion
export { xn as t };

//# sourceMappingURL=quality-BTPRPGB-.js.map