reverse-machine
Version:
**Next-generation JavaScript deobfuscation powered by AI**
1,187 lines (1,186 loc) • 185 kB
JavaScript
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b2) => {
for (var prop in b2 || (b2 = {}))
if (__hasOwnProp.call(b2, prop))
__defNormalProp(a, prop, b2[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b2)) {
if (__propIsEnum.call(b2, prop))
__defNormalProp(a, prop, b2[prop]);
}
return a;
};
var __spreadProps = (a, b2) => __defProps(a, __getOwnPropDescs(b2));
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
var on = Object.defineProperty;
var un = (t7) => {
throw TypeError(t7);
};
var Ai = (t7, e, r) => e in t7 ? on(t7, e, { enumerable: true, configurable: true, writable: true, value: r }) : t7[e] = r;
var ln = (t7, e) => {
for (var r in e) on(t7, r, { get: e[r], enumerable: true });
};
var lr = (t7, e, r) => Ai(t7, typeof e != "symbol" ? e + "" : e, r), cn = (t7, e, r) => e.has(t7) || un("Cannot " + r);
var R = (t7, e, r) => (cn(t7, e, "read from private field"), r ? r.call(t7) : e.get(t7)), At = (t7, e, r) => e.has(t7) ? un("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t7) : e.set(t7, r), pn = (t7, e, r, n) => (cn(t7, e, "write to private field"), e.set(t7, r), r);
var rn = {};
ln(rn, { languages: () => Hs, options: () => Us, parsers: () => tn, printers: () => uu });
var Di = (t7, e, r, n) => {
if (!(t7 && e == null)) return e.replaceAll ? e.replaceAll(r, n) : r.global ? e.replace(r, n) : e.split(r).join(n);
}, w = Di;
var we = "string", ze = "array", Ye = "cursor", be = "indent", Te = "align", je = "trim", xe = "group", ke = "fill", ce = "if-break", Be = "indent-if-break", Ke = "line-suffix", Xe = "line-suffix-boundary", j = "line", Qe = "label", Le = "break-parent", Dt = /* @__PURE__ */ new Set([Ye, be, Te, je, xe, ke, ce, Be, Ke, Xe, j, Qe, Le]);
var vi = (t7, e, r) => {
if (!(t7 && e == null)) return Array.isArray(e) || typeof e == "string" ? e[r < 0 ? e.length + r : r] : e.at(r);
}, K = vi;
function yi(t7) {
if (typeof t7 == "string") return we;
if (Array.isArray(t7)) return ze;
if (!t7) return;
let { type: e } = t7;
if (Dt.has(e)) return e;
}
var Fe = yi;
var wi = (t7) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(t7);
function bi(t7) {
let e = t7 === null ? "null" : typeof t7;
if (e !== "string" && e !== "object") return `Unexpected doc '${e}',
Expected it to be 'string' or 'object'.`;
if (Fe(t7)) throw new Error("doc is valid.");
let r = Object.prototype.toString.call(t7);
if (r !== "[object Object]") return `Unexpected doc '${r}'.`;
let n = wi([...Dt].map((s) => `'${s}'`));
return `Unexpected doc.type '${t7.type}'.
Expected it to be ${n}.`;
}
var cr = class extends Error {
constructor(e) {
super(bi(e));
__publicField(this, "name", "InvalidDocError");
this.doc = e;
}
}, pr = cr;
function hr(t7, e) {
if (typeof t7 == "string") return e(t7);
let r = /* @__PURE__ */ new Map();
return n(t7);
function n(i) {
if (r.has(i)) return r.get(i);
let a = s(i);
return r.set(i, a), a;
}
function s(i) {
switch (Fe(i)) {
case ze:
return e(i.map(n));
case ke:
return e(__spreadProps(__spreadValues({}, i), { parts: i.parts.map(n) }));
case ce:
return e(__spreadProps(__spreadValues({}, i), { breakContents: n(i.breakContents), flatContents: n(i.flatContents) }));
case xe: {
let { expandedStates: a, contents: o } = i;
return a ? (a = a.map(n), o = a[0]) : o = n(o), e(__spreadProps(__spreadValues({}, i), { contents: o, expandedStates: a }));
}
case Te:
case be:
case Be:
case Qe:
case Ke:
return e(__spreadProps(__spreadValues({}, i), { contents: n(i.contents) }));
case we:
case Ye:
case je:
case Xe:
case j:
case Le:
return e(i);
default:
throw new pr(i);
}
}
}
function B(t7, e = hn) {
return hr(t7, (r) => typeof r == "string" ? H(e, r.split(`
`)) : r);
}
var mr = () => {
}, fr = mr;
function k(t7) {
return { type: be, contents: t7 };
}
function fn(t7, e) {
return { type: Te, contents: e, n: t7 };
}
function E(t7, e = {}) {
return fr(e.expandedStates), { type: xe, id: e.id, contents: t7, break: !!e.shouldBreak, expandedStates: e.expandedStates };
}
function dn(t7) {
return fn(Number.NEGATIVE_INFINITY, t7);
}
function gn(t7) {
return fn({ type: "root" }, t7);
}
function vt(t7) {
return { type: ke, parts: t7 };
}
function pe(t7, e = "", r = {}) {
return { type: ce, breakContents: t7, flatContents: e, groupId: r.groupId };
}
function Cn(t7, e) {
return { type: Be, contents: t7, groupId: e.groupId, negate: e.negate };
}
var ne = { type: Le };
var xi = { type: j, hard: true }, ki = { type: j, hard: true, literal: true }, _ = { type: j }, v = { type: j, soft: true }, S = [xi, ne], hn = [ki, ne];
function H(t7, e) {
let r = [];
for (let n = 0; n < e.length; n++) n !== 0 && r.push(t7), r.push(e[n]);
return r;
}
var yt = "'", Sn = '"';
function Bi(t7, e) {
let r = e === true || e === yt ? yt : Sn, n = r === yt ? Sn : yt, s = 0, i = 0;
for (let a of t7) a === r ? s++ : a === n && i++;
return s > i ? n : r;
}
var _n = Bi;
function dr(t7) {
if (typeof t7 != "string") throw new TypeError("Expected a string");
return t7.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
}
var V, gr = class {
constructor(e) {
At(this, V);
pn(this, V, new Set(e));
}
getLeadingWhitespaceCount(e) {
let r = R(this, V), n = 0;
for (let s = 0; s < e.length && r.has(e.charAt(s)); s++) n++;
return n;
}
getTrailingWhitespaceCount(e) {
let r = R(this, V), n = 0;
for (let s = e.length - 1; s >= 0 && r.has(e.charAt(s)); s--) n++;
return n;
}
getLeadingWhitespace(e) {
let r = this.getLeadingWhitespaceCount(e);
return e.slice(0, r);
}
getTrailingWhitespace(e) {
let r = this.getTrailingWhitespaceCount(e);
return e.slice(e.length - r);
}
hasLeadingWhitespace(e) {
return R(this, V).has(e.charAt(0));
}
hasTrailingWhitespace(e) {
return R(this, V).has(K(false, e, -1));
}
trimStart(e) {
let r = this.getLeadingWhitespaceCount(e);
return e.slice(r);
}
trimEnd(e) {
let r = this.getTrailingWhitespaceCount(e);
return e.slice(0, e.length - r);
}
trim(e) {
return this.trimEnd(this.trimStart(e));
}
split(e, r = false) {
let n = `[${dr([...R(this, V)].join(""))}]+`, s = new RegExp(r ? `(${n})` : n, "u");
return e.split(s);
}
hasWhitespaceCharacter(e) {
let r = R(this, V);
return Array.prototype.some.call(e, (n) => r.has(n));
}
hasNonWhitespaceCharacter(e) {
let r = R(this, V);
return Array.prototype.some.call(e, (n) => !r.has(n));
}
isWhitespaceOnly(e) {
let r = R(this, V);
return Array.prototype.every.call(e, (n) => r.has(n));
}
};
V = /* @__PURE__ */ new WeakMap();
var En = gr;
var Li = [" ", `
`, "\f", "\r", " "], Fi = new En(Li), O = Fi;
var Cr = class extends Error {
constructor(e, r, n = "type") {
super(`Unexpected ${r} node ${n}: ${JSON.stringify(e[n])}.`);
__publicField(this, "name", "UnexpectedNodeError");
this.node = e;
}
}, An = Cr;
function Pi(t7) {
return (t7 == null ? void 0 : t7.type) === "front-matter";
}
var Pe = Pi;
var Ni = /* @__PURE__ */ new Set(["sourceSpan", "startSourceSpan", "endSourceSpan", "nameSpan", "valueSpan", "keySpan", "tagDefinition", "tokens", "valueTokens", "switchValueSourceSpan", "expSourceSpan", "valueSourceSpan"]), Ii = /* @__PURE__ */ new Set(["if", "else if", "for", "switch", "case"]);
function Dn(t7, e) {
var r;
if (t7.type === "text" || t7.type === "comment" || Pe(t7) || t7.type === "yaml" || t7.type === "toml") return null;
if (t7.type === "attribute" && delete e.value, t7.type === "docType" && delete e.value, t7.type === "angularControlFlowBlock" && ((r = t7.parameters) != null && r.children)) for (let n of e.parameters.children) Ii.has(t7.name) ? delete n.expression : n.expression = n.expression.trim();
t7.type === "angularIcuExpression" && (e.switchValue = t7.switchValue.trim()), t7.type === "angularLetDeclarationInitializer" && delete e.value;
}
Dn.ignoredProperties = Ni;
var vn = Dn;
async function Ri(t7, e) {
if (t7.language === "yaml") {
let r = t7.value.trim(), n = r ? await e(r, { parser: "yaml" }) : "";
return gn([t7.startDelimiter, t7.explicitLanguage, S, n, n ? S : "", t7.endDelimiter]);
}
}
var yn = Ri;
function he(t7, e = true) {
return [k([v, t7]), e ? v : ""];
}
function X(t7, e) {
let r = t7.type === "NGRoot" ? t7.node.type === "NGMicrosyntax" && t7.node.body.length === 1 && t7.node.body[0].type === "NGMicrosyntaxExpression" ? t7.node.body[0].expression : t7.node : t7.type === "JsExpressionRoot" ? t7.node : t7;
return r && (r.type === "ObjectExpression" || r.type === "ArrayExpression" || (e.parser === "__vue_expression" || e.parser === "__vue_ts_expression") && (r.type === "TemplateLiteral" || r.type === "StringLiteral"));
}
async function T(t7, e, r, n) {
r = __spreadValues({ __isInHtmlAttribute: true, __embeddedInHtml: true }, r);
let s = true;
n && (r.__onHtmlBindingRoot = (a, o) => {
s = n(a, o);
});
let i = await e(t7, r, e);
return s ? E(i) : he(i);
}
function $i(t7, e, r, n) {
let { node: s } = r, i = n.originalText.slice(s.sourceSpan.start.offset, s.sourceSpan.end.offset);
return /^\s*$/u.test(i) ? "" : T(i, t7, { parser: "__ng_directive", __isInHtmlAttribute: false }, X);
}
var wn = $i;
var Oi = (t7, e) => {
if (!(t7 && e == null)) return e.toReversed || !Array.isArray(e) ? e.toReversed() : [...e].reverse();
}, bn = Oi;
function Mi(t7) {
return Array.isArray(t7) && t7.length > 0;
}
var me = Mi;
var Tn, xn, kn, Bn, Ln, qi = ((Tn = globalThis.Deno) == null ? void 0 : Tn.build.os) === "windows" || ((kn = (xn = globalThis.navigator) == null ? void 0 : xn.platform) == null ? void 0 : kn.startsWith("Win")) || ((Ln = (Bn = globalThis.process) == null ? void 0 : Bn.platform) == null ? void 0 : Ln.startsWith("win")) || false;
function Fn(t7) {
if (t7 = t7 instanceof URL ? t7 : new URL(t7), t7.protocol !== "file:") throw new TypeError(`URL must be a file URL: received "${t7.protocol}"`);
return t7;
}
function Hi(t7) {
return t7 = Fn(t7), decodeURIComponent(t7.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
}
function Vi(t7) {
t7 = Fn(t7);
let e = decodeURIComponent(t7.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25")).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\");
return t7.hostname !== "" && (e = `\\\\${t7.hostname}${e}`), e;
}
function Pn(t7) {
return qi ? Vi(t7) : Hi(t7);
}
var Nn = Pn;
var Ui = (t7) => String(t7).split(/[/\\]/u).pop();
function In(t7, e) {
var _a2;
if (!e) return;
let r = Ui(e).toLowerCase();
return (_a2 = t7.find(({ filenames: n }) => n == null ? void 0 : n.some((s) => s.toLowerCase() === r))) != null ? _a2 : t7.find(({ extensions: n }) => n == null ? void 0 : n.some((s) => r.endsWith(s)));
}
function Wi(t7, e) {
var _a2, _b;
if (e) return (_b = (_a2 = t7.find(({ name: r }) => r.toLowerCase() === e)) != null ? _a2 : t7.find(({ aliases: r }) => r == null ? void 0 : r.includes(e))) != null ? _b : t7.find(({ extensions: r }) => r == null ? void 0 : r.includes(`.${e}`));
}
function Rn(t7, e) {
if (e) {
if (String(e).startsWith("file:")) try {
e = Nn(e);
} catch (e2) {
return;
}
if (typeof e == "string") return t7.find(({ isSupported: r }) => r == null ? void 0 : r({ filepath: e }));
}
}
function Gi(t7, e) {
var _a2, _b, _c, _d, _e2;
let r = bn(false, t7.plugins).flatMap((s) => {
var _a3;
return (_a3 = s.languages) != null ? _a3 : [];
}), n = (_e2 = (_d = (_c = (_b = (_a2 = Wi(r, e.language)) != null ? _a2 : In(r, e.physicalFile)) != null ? _b : In(r, e.file)) != null ? _c : Rn(r, e.physicalFile)) != null ? _d : Rn(r, e.file)) != null ? _e2 : (e.physicalFile, void 0);
return n == null ? void 0 : n.parsers[0];
}
var Ne = Gi;
var $n = "inline", Sr = { area: "none", base: "none", basefont: "none", datalist: "none", head: "none", link: "none", meta: "none", noembed: "none", noframes: "none", param: "block", rp: "none", script: "block", style: "none", template: "inline", title: "none", html: "block", body: "block", address: "block", blockquote: "block", center: "block", dialog: "block", div: "block", figure: "block", figcaption: "block", footer: "block", form: "block", header: "block", hr: "block", legend: "block", listing: "block", main: "block", p: "block", plaintext: "block", pre: "block", search: "block", xmp: "block", slot: "contents", ruby: "ruby", rt: "ruby-text", article: "block", aside: "block", h1: "block", h2: "block", h3: "block", h4: "block", h5: "block", h6: "block", hgroup: "block", nav: "block", section: "block", dir: "block", dd: "block", dl: "block", dt: "block", menu: "block", ol: "block", ul: "block", li: "list-item", table: "table", caption: "table-caption", colgroup: "table-column-group", col: "table-column", thead: "table-header-group", tbody: "table-row-group", tfoot: "table-footer-group", tr: "table-row", td: "table-cell", th: "table-cell", input: "inline-block", button: "inline-block", fieldset: "block", details: "block", summary: "block", marquee: "inline-block", source: "block", track: "block", meter: "inline-block", progress: "inline-block", object: "inline-block", video: "inline-block", audio: "inline-block", select: "inline-block", option: "block", optgroup: "block" }, On = "normal", _r = { listing: "pre", plaintext: "pre", pre: "pre", xmp: "pre", nobr: "nowrap", table: "initial", textarea: "pre-wrap" };
function zi(t7) {
return t7.type === "element" && !t7.hasExplicitNamespace && !["html", "svg"].includes(t7.namespace);
}
var fe = zi;
var Yi = (t7) => w(false, t7, /^[\t\f\r ]*\n/gu, ""), Er = (t7) => Yi(O.trimEnd(t7)), Mn = (t7) => {
let e = t7, r = O.getLeadingWhitespace(e);
r && (e = e.slice(r.length));
let n = O.getTrailingWhitespace(e);
return n && (e = e.slice(0, -n.length)), { leadingWhitespace: r, trailingWhitespace: n, text: e };
};
function wt(t7, e) {
return !!(t7.type === "ieConditionalComment" && t7.lastChild && !t7.lastChild.isSelfClosing && !t7.lastChild.endSourceSpan || t7.type === "ieConditionalComment" && !t7.complete || de(t7) && t7.children.some((r) => r.type !== "text" && r.type !== "interpolation") || xt(t7, e) && !W(t7, e) && t7.type !== "interpolation");
}
function ge(t7) {
return t7.type === "attribute" || !t7.parent || !t7.prev ? false : ji(t7.prev);
}
function ji(t7) {
return t7.type === "comment" && t7.value.trim() === "prettier-ignore";
}
function $(t7) {
return t7.type === "text" || t7.type === "comment";
}
function W(t7, e) {
return t7.type === "element" && (t7.fullName === "script" || t7.fullName === "style" || t7.fullName === "svg:style" || t7.fullName === "svg:script" || t7.fullName === "mj-style" && e.parser === "mjml" || fe(t7) && (t7.name === "script" || t7.name === "style"));
}
function qn(t7, e) {
return t7.children && !W(t7, e);
}
function Hn(t7, e) {
return W(t7, e) || t7.type === "interpolation" || Ar(t7);
}
function Ar(t7) {
return Jn(t7).startsWith("pre");
}
function Vn(t7, e) {
var s, i;
let r = n();
if (r && !t7.prev && ((i = (s = t7.parent) == null ? void 0 : s.tagDefinition) != null && i.ignoreFirstLf)) return t7.type === "interpolation";
return r;
function n() {
return Pe(t7) || t7.type === "angularControlFlowBlock" ? false : (t7.type === "text" || t7.type === "interpolation") && t7.prev && (t7.prev.type === "text" || t7.prev.type === "interpolation") ? true : !t7.parent || t7.parent.cssDisplay === "none" ? false : de(t7.parent) ? true : !(!t7.prev && (t7.parent.type === "root" || de(t7) && t7.parent || W(t7.parent, e) || et(t7.parent, e) || !ea(t7.parent.cssDisplay)) || t7.prev && !na(t7.prev.cssDisplay));
}
}
function Un(t7, e) {
return Pe(t7) || t7.type === "angularControlFlowBlock" ? false : (t7.type === "text" || t7.type === "interpolation") && t7.next && (t7.next.type === "text" || t7.next.type === "interpolation") ? true : !t7.parent || t7.parent.cssDisplay === "none" ? false : de(t7.parent) ? true : !(!t7.next && (t7.parent.type === "root" || de(t7) && t7.parent || W(t7.parent, e) || et(t7.parent, e) || !ta(t7.parent.cssDisplay)) || t7.next && !ra(t7.next.cssDisplay));
}
function Wn(t7, e) {
return sa(t7.cssDisplay) && !W(t7, e);
}
function Je(t7) {
return Pe(t7) || t7.next && t7.sourceSpan.end && t7.sourceSpan.end.line + 1 < t7.next.sourceSpan.start.line;
}
function Gn(t7) {
return Dr(t7) || t7.type === "element" && t7.children.length > 0 && (["body", "script", "style"].includes(t7.name) || t7.children.some((e) => Xi(e))) || t7.firstChild && t7.firstChild === t7.lastChild && t7.firstChild.type !== "text" && Yn(t7.firstChild) && (!t7.lastChild.isTrailingSpaceSensitive || jn(t7.lastChild));
}
function Dr(t7) {
return t7.type === "element" && t7.children.length > 0 && (["html", "head", "ul", "ol", "select"].includes(t7.name) || t7.cssDisplay.startsWith("table") && t7.cssDisplay !== "table-cell");
}
function bt(t7) {
return Kn(t7) || t7.prev && Ki(t7.prev) || zn(t7);
}
function Ki(t7) {
return Kn(t7) || t7.type === "element" && t7.fullName === "br" || zn(t7);
}
function zn(t7) {
return Yn(t7) && jn(t7);
}
function Yn(t7) {
return t7.hasLeadingSpaces && (t7.prev ? t7.prev.sourceSpan.end.line < t7.sourceSpan.start.line : t7.parent.type === "root" || t7.parent.startSourceSpan.end.line < t7.sourceSpan.start.line);
}
function jn(t7) {
return t7.hasTrailingSpaces && (t7.next ? t7.next.sourceSpan.start.line > t7.sourceSpan.end.line : t7.parent.type === "root" || t7.parent.endSourceSpan && t7.parent.endSourceSpan.start.line > t7.sourceSpan.end.line);
}
function Kn(t7) {
switch (t7.type) {
case "ieConditionalComment":
case "comment":
case "directive":
return true;
case "element":
return ["script", "select"].includes(t7.name);
}
return false;
}
function Tt(t7) {
return t7.lastChild ? Tt(t7.lastChild) : t7;
}
function Xi(t7) {
var e;
return (e = t7.children) == null ? void 0 : e.some((r) => r.type !== "text");
}
function Xn(t7) {
if (t7) switch (t7) {
case "module":
case "text/javascript":
case "text/babel":
case "text/jsx":
case "application/javascript":
return "babel";
case "application/x-typescript":
return "typescript";
case "text/markdown":
return "markdown";
case "text/html":
return "html";
case "text/x-handlebars-template":
return "glimmer";
default:
if (t7.endsWith("json") || t7.endsWith("importmap") || t7 === "speculationrules") return "json";
}
}
function Qi(t7, e) {
var _a2;
let { name: r, attrMap: n } = t7;
if (r !== "script" || Object.prototype.hasOwnProperty.call(n, "src")) return;
let { type: s, lang: i } = t7.attrMap;
return !i && !s ? "babel" : (_a2 = Ne(e, { language: i })) != null ? _a2 : Xn(s);
}
function Ji(t7, e) {
var _a2;
if (!xt(t7, e)) return;
let { attrMap: r } = t7;
if (Object.prototype.hasOwnProperty.call(r, "src")) return;
let { type: n, lang: s } = r;
return (_a2 = Ne(e, { language: s })) != null ? _a2 : Xn(n);
}
function Zi(t7, e) {
if (t7.name === "style") {
let { lang: r } = t7.attrMap;
return r ? Ne(e, { language: r }) : "css";
}
if (t7.name === "mj-style" && e.parser === "mjml") return "css";
}
function vr(t7, e) {
var _a2, _b;
return (_b = (_a2 = Qi(t7, e)) != null ? _a2 : Zi(t7, e)) != null ? _b : Ji(t7, e);
}
function Ze(t7) {
return t7 === "block" || t7 === "list-item" || t7.startsWith("table");
}
function ea(t7) {
return !Ze(t7) && t7 !== "inline-block";
}
function ta(t7) {
return !Ze(t7) && t7 !== "inline-block";
}
function ra(t7) {
return !Ze(t7);
}
function na(t7) {
return !Ze(t7);
}
function sa(t7) {
return !Ze(t7) && t7 !== "inline-block";
}
function de(t7) {
return Jn(t7).startsWith("pre");
}
function ia(t7, e) {
let r = t7;
for (; r; ) {
if (e(r)) return true;
r = r.parent;
}
return false;
}
function Qn(t7, e) {
var n;
if (Ce(t7, e)) return "block";
if (((n = t7.prev) == null ? void 0 : n.type) === "comment") {
let s = t7.prev.value.match(/^\s*display:\s*([a-z]+)\s*$/u);
if (s) return s[1];
}
let r = false;
if (t7.type === "element" && t7.namespace === "svg") if (ia(t7, (s) => s.fullName === "svg:foreignObject")) r = true;
else return t7.name === "svg" ? "inline-block" : "block";
switch (e.htmlWhitespaceSensitivity) {
case "strict":
return "inline";
case "ignore":
return "block";
default:
if (t7.type === "element" && (!t7.namespace || r || fe(t7)) && Object.prototype.hasOwnProperty.call(Sr, t7.name)) return Sr[t7.name];
}
return $n;
}
function Jn(t7) {
return t7.type === "element" && (!t7.namespace || fe(t7)) && Object.prototype.hasOwnProperty.call(_r, t7.name) ? _r[t7.name] : On;
}
function aa(t7) {
let e = Number.POSITIVE_INFINITY;
for (let r of t7.split(`
`)) {
if (r.length === 0) continue;
let n = O.getLeadingWhitespaceCount(r);
if (n === 0) return 0;
r.length !== n && n < e && (e = n);
}
return e === Number.POSITIVE_INFINITY ? 0 : e;
}
function yr(t7, e = aa(t7)) {
return e === 0 ? t7 : t7.split(`
`).map((r) => r.slice(e)).join(`
`);
}
function wr(t7) {
return w(false, w(false, t7, "'", "'"), """, '"');
}
function P(t7) {
return wr(t7.value);
}
var oa = /* @__PURE__ */ new Set(["template", "style", "script"]);
function et(t7, e) {
return Ce(t7, e) && !oa.has(t7.fullName);
}
function Ce(t7, e) {
return e.parser === "vue" && t7.type === "element" && t7.parent.type === "root" && t7.fullName.toLowerCase() !== "html";
}
function xt(t7, e) {
return Ce(t7, e) && (et(t7, e) || t7.attrMap.lang && t7.attrMap.lang !== "html");
}
function Zn(t7) {
let e = t7.fullName;
return e.charAt(0) === "#" || e === "slot-scope" || e === "v-slot" || e.startsWith("v-slot:");
}
function es(t7, e) {
let r = t7.parent;
if (!Ce(r, e)) return false;
let n = r.fullName, s = t7.fullName;
return n === "script" && s === "setup" || n === "style" && s === "vars";
}
function kt(t7, e = t7.value) {
return t7.parent.isWhitespaceSensitive ? t7.parent.isIndentationSensitive ? B(e) : B(yr(Er(e)), S) : H(_, O.split(e));
}
function Bt(t7, e) {
return Ce(t7, e) && t7.name === "script";
}
var br = new RegExp("\\{\\{(.+?)\\}\\}", "su");
async function ts(t7, e) {
let r = [];
for (let [n, s] of t7.split(br).entries()) if (n % 2 === 0) r.push(B(s));
else try {
r.push(E(["{{", k([_, await T(s, e, { parser: "__ng_interpolation", __isInHtmlInterpolation: true })]), _, "}}"]));
} catch (e2) {
r.push("{{", B(s), "}}");
}
return r;
}
function Tr({ parser: t7 }) {
return (e, r, n) => T(P(n.node), e, { parser: t7 }, X);
}
var ua = Tr({ parser: "__ng_action" }), la = Tr({ parser: "__ng_binding" }), ca = Tr({ parser: "__ng_directive" });
function pa(t7, e) {
if (e.parser !== "angular") return;
let { node: r } = t7, n = r.fullName;
if (n.startsWith("(") && n.endsWith(")") || n.startsWith("on-")) return ua;
if (n.startsWith("[") && n.endsWith("]") || /^bind(?:on)?-/u.test(n) || /^ng-(?:if|show|hide|class|style)$/u.test(n)) return la;
if (n.startsWith("*")) return ca;
let s = P(r);
if (/^i18n(?:-.+)?$/u.test(n)) return () => he(vt(kt(r, s.trim())), !s.includes("@@"));
if (br.test(s)) return (i) => ts(s, i);
}
var rs = pa;
function ha(t7, e) {
let { node: r } = t7, n = P(r);
if (r.fullName === "class" && !e.parentParser && !n.includes("{{")) return () => n.trim().split(/\s+/u).join(" ");
}
var ns = ha;
function ss(t7) {
return t7 === " " || t7 === `
` || t7 === "\f" || t7 === "\r" || t7 === " ";
}
var ma = /^[ \t\n\r\u000c]+/, fa = /^[, \t\n\r\u000c]+/, da = /^[^ \t\n\r\u000c]+/, ga = /[,]+$/, is = /^\d+$/, Ca = /^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;
function Sa(t7) {
let e = t7.length, r, n, s, i, a, o = 0, u;
function p(C) {
let A, D = C.exec(t7.substring(o));
if (D) return [A] = D, o += A.length, A;
}
let l = [];
for (; ; ) {
if (p(fa), o >= e) {
if (l.length === 0) throw new Error("Must contain one or more image candidate strings.");
return l;
}
u = o, r = p(da), n = [], r.slice(-1) === "," ? (r = r.replace(ga, ""), f()) : m();
}
function m() {
for (p(ma), s = "", i = "in descriptor"; ; ) {
if (a = t7.charAt(o), i === "in descriptor") if (ss(a)) s && (n.push(s), s = "", i = "after descriptor");
else if (a === ",") {
o += 1, s && n.push(s), f();
return;
} else if (a === "(") s += a, i = "in parens";
else if (a === "") {
s && n.push(s), f();
return;
} else s += a;
else if (i === "in parens") if (a === ")") s += a, i = "in descriptor";
else if (a === "") {
n.push(s), f();
return;
} else s += a;
else if (i === "after descriptor" && !ss(a)) if (a === "") {
f();
return;
} else i = "in descriptor", o -= 1;
o += 1;
}
}
function f() {
let C = false, A, D, I, F, c = {}, g, y, q, x, U;
for (F = 0; F < n.length; F++) g = n[F], y = g[g.length - 1], q = g.substring(0, g.length - 1), x = parseInt(q, 10), U = parseFloat(q), is.test(q) && y === "w" ? ((A || D) && (C = true), x === 0 ? C = true : A = x) : Ca.test(q) && y === "x" ? ((A || D || I) && (C = true), U < 0 ? C = true : D = U) : is.test(q) && y === "h" ? ((I || D) && (C = true), x === 0 ? C = true : I = x) : C = true;
if (!C) c.source = { value: r, startOffset: u }, A && (c.width = { value: A }), D && (c.density = { value: D }), I && (c.height = { value: I }), l.push(c);
else throw new Error(`Invalid srcset descriptor found in "${t7}" at "${g}".`);
}
}
var as = Sa;
function _a(t7) {
if (t7.node.fullName === "srcset" && (t7.parent.fullName === "img" || t7.parent.fullName === "source")) return () => Aa(P(t7.node));
}
var os = { width: "w", height: "h", density: "x" }, Ea = Object.keys(os);
function Aa(t7) {
let e = as(t7), r = Ea.filter((l) => e.some((m) => Object.prototype.hasOwnProperty.call(m, l)));
if (r.length > 1) throw new Error("Mixed descriptor in srcset is not supported");
let [n] = r, s = os[n], i = e.map((l) => l.source.value), a = Math.max(...i.map((l) => l.length)), o = e.map((l) => l[n] ? String(l[n].value) : ""), u = o.map((l) => {
let m = l.indexOf(".");
return m === -1 ? l.length : m;
}), p = Math.max(...u);
return he(H([",", _], i.map((l, m) => {
let f = [l], C = o[m];
if (C) {
let A = a - l.length + 1, D = p - u[m], I = " ".repeat(A + D);
f.push(pe(I, " "), C + s);
}
return f;
})));
}
var us = _a;
function ls(t7, e) {
let { node: r } = t7, n = P(t7.node).trim();
if (r.fullName === "style" && !e.parentParser && !n.includes("{{")) return async (s) => he(await s(n, { parser: "css", __isHTMLStyleAttribute: true }));
}
var xr = /* @__PURE__ */ new WeakMap();
function Da(t7, e) {
let { root: r } = t7;
return xr.has(r) || xr.set(r, r.children.some((n) => Bt(n, e) && ["ts", "typescript"].includes(n.attrMap.lang))), xr.get(r);
}
var Ie = Da;
function cs(t7, e, r) {
let { node: n } = r, s = P(n);
return T(`type T<${s}> = any`, t7, { parser: "babel-ts", __isEmbeddedTypescriptGenericParameters: true }, X);
}
function ps(t7, e, { parseWithTs: r }) {
return T(`function _(${t7}) {}`, e, { parser: r ? "babel-ts" : "babel", __isVueBindings: true });
}
async function hs(t7, e, r, n) {
let s = P(r.node), { left: i, operator: a, right: o } = va(s), u = Ie(r, n);
return [E(await T(`function _(${i}) {}`, t7, { parser: u ? "babel-ts" : "babel", __isVueForBindingLeft: true })), " ", a, " ", await T(o, t7, { parser: u ? "__ts_expression" : "__js_expression" })];
}
function va(t7) {
let e = new RegExp("(.*?)\\s+(in|of)\\s+(.*)", "su"), r = /,([^,\]}]*)(?:,([^,\]}]*))?$/u, n = /^\(|\)$/gu, s = t7.match(e);
if (!s) return;
let i = {};
if (i.for = s[3].trim(), !i.for) return;
let a = w(false, s[1].trim(), n, ""), o = a.match(r);
o ? (i.alias = a.replace(r, ""), i.iterator1 = o[1].trim(), o[2] && (i.iterator2 = o[2].trim())) : i.alias = a;
let u = [i.alias, i.iterator1, i.iterator2];
if (!u.some((p, l) => !p && (l === 0 || u.slice(l + 1).some(Boolean)))) return { left: u.filter(Boolean).join(","), operator: s[2], right: i.for };
}
function ya(t7, e) {
if (e.parser !== "vue") return;
let { node: r } = t7, n = r.fullName;
if (n === "v-for") return hs;
if (n === "generic" && Bt(r.parent, e)) return cs;
let s = P(r), i = Ie(t7, e);
if (Zn(r) || es(r, e)) return (a) => ps(s, a, { parseWithTs: i });
if (n.startsWith("@") || n.startsWith("v-on:")) return (a) => wa(s, a, { parseWithTs: i });
if (n.startsWith(":") || n.startsWith(".") || n.startsWith("v-bind:")) return (a) => ba(s, a, { parseWithTs: i });
if (n.startsWith("v-")) return (a) => ms(s, a, { parseWithTs: i });
}
async function wa(t7, e, { parseWithTs: r }) {
var n;
try {
return await ms(t7, e, { parseWithTs: r });
} catch (s) {
if (((n = s.cause) == null ? void 0 : n.code) !== "BABEL_PARSER_SYNTAX_ERROR") throw s;
}
return T(t7, e, { parser: r ? "__vue_ts_event_binding" : "__vue_event_binding" }, X);
}
function ba(t7, e, { parseWithTs: r }) {
return T(t7, e, { parser: r ? "__vue_ts_expression" : "__vue_expression" }, X);
}
function ms(t7, e, { parseWithTs: r }) {
return T(t7, e, { parser: r ? "__ts_expression" : "__js_expression" }, X);
}
var fs = ya;
function Ta(t7, e) {
let { node: r } = t7;
if (r.value) {
if (/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(e.originalText.slice(r.valueSpan.start.offset, r.valueSpan.end.offset)) || e.parser === "lwc" && r.value.startsWith("{") && r.value.endsWith("}")) return [r.rawName, "=", r.value];
for (let n of [us, ls, ns, fs, rs]) {
let s = n(t7, e);
if (s) return xa(s);
}
}
}
function xa(t7) {
return async (e, r, n, s) => {
let i = await t7(e, r, n, s);
if (i) return i = hr(i, (a) => typeof a == "string" ? w(false, a, '"', """) : a), [n.node.rawName, '="', E(i), '"'];
};
}
var ds = Ta;
var ka = new Proxy(() => {
}, { get: () => ka });
function J(t7) {
return t7.sourceSpan.start.offset;
}
function se(t7) {
return t7.sourceSpan.end.offset;
}
function tt(t7, e) {
return [t7.isSelfClosing ? "" : Ba(t7, e), Se(t7, e)];
}
function Ba(t7, e) {
return t7.lastChild && Ae(t7.lastChild) ? "" : [La(t7, e), Lt(t7, e)];
}
function Se(t7, e) {
return (t7.next ? Q(t7.next) : Ee(t7.parent)) ? "" : [_e(t7, e), G(t7, e)];
}
function La(t7, e) {
return Ee(t7) ? _e(t7.lastChild, e) : "";
}
function G(t7, e) {
return Ae(t7) ? Lt(t7.parent, e) : rt(t7) ? Ft(t7.next, e) : "";
}
function Lt(t7, e) {
if (Cs(t7, e)) return "";
switch (t7.type) {
case "ieConditionalComment":
return "<!";
case "element":
if (t7.hasHtmComponentClosingTag) return "<//";
default:
return `</${t7.rawName}`;
}
}
function _e(t7, e) {
if (Cs(t7, e)) return "";
switch (t7.type) {
case "ieConditionalComment":
case "ieConditionalEndComment":
return "[endif]-->";
case "ieConditionalStartComment":
return "]><!-->";
case "interpolation":
return "}}";
case "angularIcuExpression":
return "}";
case "element":
if (t7.isSelfClosing) return "/>";
default:
return ">";
}
}
function Cs(t7, e) {
return !t7.isSelfClosing && !t7.endSourceSpan && (ge(t7) || wt(t7.parent, e));
}
function Q(t7) {
return t7.prev && t7.prev.type !== "docType" && t7.type !== "angularControlFlowBlock" && !$(t7.prev) && t7.isLeadingSpaceSensitive && !t7.hasLeadingSpaces;
}
function Ee(t7) {
var e;
return ((e = t7.lastChild) == null ? void 0 : e.isTrailingSpaceSensitive) && !t7.lastChild.hasTrailingSpaces && !$(Tt(t7.lastChild)) && !de(t7);
}
function Ae(t7) {
return !t7.next && !t7.hasTrailingSpaces && t7.isTrailingSpaceSensitive && $(Tt(t7));
}
function rt(t7) {
return t7.next && !$(t7.next) && $(t7) && t7.isTrailingSpaceSensitive && !t7.hasTrailingSpaces;
}
function Fa(t7) {
let e = t7.trim().match(new RegExp("^prettier-ignore-attribute(?:\\s+(.+))?$", "su"));
return e ? e[1] ? e[1].split(/\s+/u) : true : false;
}
function nt(t7) {
return !t7.prev && t7.isLeadingSpaceSensitive && !t7.hasLeadingSpaces;
}
function Pa(t7, e, r) {
var m;
let { node: n } = t7;
if (!me(n.attrs)) return n.isSelfClosing ? " " : "";
let s = ((m = n.prev) == null ? void 0 : m.type) === "comment" && Fa(n.prev.value), i = typeof s == "boolean" ? () => s : Array.isArray(s) ? (f) => s.includes(f.rawName) : () => false, a = t7.map(({ node: f }) => i(f) ? B(e.originalText.slice(J(f), se(f))) : r(), "attrs"), o = n.type === "element" && n.fullName === "script" && n.attrs.length === 1 && n.attrs[0].fullName === "src" && n.children.length === 0, p = e.singleAttributePerLine && n.attrs.length > 1 && !Ce(n, e) ? S : _, l = [k([o ? " " : _, H(p, a)])];
return n.firstChild && nt(n.firstChild) || n.isSelfClosing && Ee(n.parent) || o ? l.push(n.isSelfClosing ? " " : "") : l.push(e.bracketSameLine ? n.isSelfClosing ? " " : "" : n.isSelfClosing ? _ : v), l;
}
function Na(t7) {
return t7.firstChild && nt(t7.firstChild) ? "" : Pt(t7);
}
function st(t7, e, r) {
let { node: n } = t7;
return [De(n, e), Pa(t7, e, r), n.isSelfClosing ? "" : Na(n)];
}
function De(t7, e) {
return t7.prev && rt(t7.prev) ? "" : [z(t7, e), Ft(t7, e)];
}
function z(t7, e) {
return nt(t7) ? Pt(t7.parent) : Q(t7) ? _e(t7.prev, e) : "";
}
var gs = "<!doctype";
function Ft(t7, e) {
switch (t7.type) {
case "ieConditionalComment":
case "ieConditionalStartComment":
return `<!--[if ${t7.condition}`;
case "ieConditionalEndComment":
return "<!--<!";
case "interpolation":
return "{{";
case "docType": {
if (t7.value === "html") {
let { filepath: n } = e;
if (n && /\.html?$/u.test(n)) return gs;
}
let r = J(t7);
return e.originalText.slice(r, r + gs.length);
}
case "angularIcuExpression":
return "{";
case "element":
if (t7.condition) return `<!--[if ${t7.condition}]><!--><${t7.rawName}`;
default:
return `<${t7.rawName}`;
}
}
function Pt(t7) {
switch (t7.type) {
case "ieConditionalComment":
return "]>";
case "element":
if (t7.condition) return "><!--<![endif]-->";
default:
return ">";
}
}
function Ia(t7, e) {
if (!t7.endSourceSpan) return "";
let r = t7.startSourceSpan.end.offset;
t7.firstChild && nt(t7.firstChild) && (r -= Pt(t7).length);
let n = t7.endSourceSpan.start.offset;
return t7.lastChild && Ae(t7.lastChild) ? n += Lt(t7, e).length : Ee(t7) && (n -= _e(t7.lastChild, e).length), e.originalText.slice(r, n);
}
var Nt = Ia;
var Ra = /* @__PURE__ */ new Set(["if", "else if", "for", "switch", "case"]);
function $a(t7, e) {
let { node: r } = t7;
switch (r.type) {
case "element":
if (W(r, e) || r.type === "interpolation") return;
if (!r.isSelfClosing && xt(r, e)) {
let n = vr(r, e);
return n ? async (s, i) => {
let a = Nt(r, e), o = /^\s*$/u.test(a), u = "";
return o || (u = await s(Er(a), { parser: n, __embeddedInHtml: true }), o = u === ""), [z(r, e), E(st(t7, e, i)), o ? "" : S, u, o ? "" : S, tt(r, e), G(r, e)];
} : void 0;
}
break;
case "text":
if (W(r.parent, e)) {
let n = vr(r.parent, e);
if (n) return async (s) => {
let i = n === "markdown" ? yr(r.value.replace(/^[^\S\n]*\n/u, "")) : r.value, a = { parser: n, __embeddedInHtml: true };
if (e.parser === "html" && n === "babel") {
let o = "script", { attrMap: u } = r.parent;
u && (u.type === "module" || (u.type === "text/babel" || u.type === "text/jsx") && u["data-type"] === "module") && (o = "module"), a.__babelSourceType = o;
}
return [ne, z(r, e), await s(i, a), G(r, e)];
};
} else if (r.parent.type === "interpolation") return async (n) => {
let s = { __isInHtmlInterpolation: true, __embeddedInHtml: true };
return e.parser === "angular" ? s.parser = "__ng_interpolation" : e.parser === "vue" ? s.parser = Ie(t7, e) ? "__vue_ts_expression" : "__vue_expression" : s.parser = "__js_expression", [k([_, await n(r.value, s)]), r.parent.next && Q(r.parent.next) ? " " : _];
};
break;
case "attribute":
return ds(t7, e);
case "front-matter":
return (n) => yn(r, n);
case "angularControlFlowBlockParameters":
return Ra.has(t7.parent.name) ? wn : void 0;
case "angularLetDeclarationInitializer":
return (n) => T(r.value, n, { parser: "__ng_binding", __isInHtmlAttribute: false });
}
}
var Ss = $a;
var it = null;
function at(t7) {
if (it !== null && typeof it.property) {
let e = it;
return it = at.prototype = null, e;
}
return it = at.prototype = t7 != null ? t7 : /* @__PURE__ */ Object.create(null), new at();
}
var Oa = 10;
for (let t7 = 0; t7 <= Oa; t7++) at();
function kr(t7) {
return at(t7);
}
function Ma(t7, e = "type") {
kr(t7);
function r(n) {
let s = n[e], i = t7[s];
if (!Array.isArray(i)) throw Object.assign(new Error(`Missing visitor keys for '${s}'.`), { node: n });
return i;
}
return r;
}
var _s = Ma;
var qa = { "front-matter": [], root: ["children"], element: ["attrs", "children"], ieConditionalComment: ["children"], ieConditionalStartComment: [], ieConditionalEndComment: [], interpolation: ["children"], text: ["children"], docType: [], comment: [], attribute: [], cdata: [], angularControlFlowBlock: ["children", "parameters"], angularControlFlowBlockParameters: ["children"], angularControlFlowBlockParameter: [], angularLetDeclaration: ["init"], angularLetDeclarationInitializer: [], angularIcuExpression: ["cases"], angularIcuCase: ["expression"] }, Es = qa;
var Ha = _s(Es), As = Ha;
var Ds = "format";
var vs = /^\s*<!--\s*@(?:noformat|noprettier)\s*-->/u, ys = /^\s*<!--\s*@(?:format|prettier)\s*-->/u;
function ws(t7) {
return ys.test(t7);
}
function bs(t7) {
return vs.test(t7);
}
function Ts(t7) {
return `<!-- @${Ds} -->
${t7}`;
}
var xs = /* @__PURE__ */ new Map([["if", /* @__PURE__ */ new Set(["else if", "else"])], ["else if", /* @__PURE__ */ new Set(["else if", "else"])], ["for", /* @__PURE__ */ new Set(["empty"])], ["defer", /* @__PURE__ */ new Set(["placeholder", "error", "loading"])], ["placeholder", /* @__PURE__ */ new Set(["placeholder", "error", "loading"])], ["error", /* @__PURE__ */ new Set(["placeholder", "error", "loading"])], ["loading", /* @__PURE__ */ new Set(["placeholder", "error", "loading"])]]);
function ks(t7) {
let e = se(t7);
return t7.type === "element" && !t7.endSourceSpan && me(t7.children) ? Math.max(e, ks(K(false, t7.children, -1))) : e;
}
function ot(t7, e, r) {
let n = t7.node;
if (ge(n)) {
let s = ks(n);
return [z(n, e), B(O.trimEnd(e.originalText.slice(J(n) + (n.prev && rt(n.prev) ? Ft(n).length : 0), s - (n.next && Q(n.next) ? _e(n, e).length : 0)))), G(n, e)];
}
return r();
}
function It(t7, e) {
return $(t7) && $(e) ? t7.isTrailingSpaceSensitive ? t7.hasTrailingSpaces ? bt(e) ? S : _ : "" : bt(e) ? S : v : rt(t7) && (ge(e) || e.firstChild || e.isSelfClosing || e.type === "element" && e.attrs.length > 0) || t7.type === "element" && t7.isSelfClosing && Q(e) ? "" : !e.isLeadingSpaceSensitive || bt(e) || Q(e) && t7.lastChild && Ae(t7.lastChild) && t7.lastChild.lastChild && Ae(t7.lastChild.lastChild) ? S : e.hasLeadingSpaces ? _ : v;
}
function Re(t7, e, r) {
let { node: n } = t7;
if (Dr(n)) return [ne, ...t7.map((i) => {
let a = i.node, o = a.prev ? It(a.prev, a) : "";
return [o ? [o, Je(a.prev) ? S : ""] : "", ot(i, e, r)];
}, "children")];
let s = n.children.map(() => Symbol(""));
return t7.map((i, a) => {
let o = i.node;
if ($(o)) {
if (o.prev && $(o.prev)) {
let A = It(o.prev, o);
if (A) return Je(o.prev) ? [S, S, ot(i, e, r)] : [A, ot(i, e, r)];
}
return ot(i, e, r);
}
let u = [], p = [], l = [], m = [], f = o.prev ? It(o.prev, o) : "", C = o.next ? It(o, o.next) : "";
return f && (Je(o.prev) ? u.push(S, S) : f === S ? u.push(S) : $(o.prev) ? p.push(f) : p.push(pe("", v, { groupId: s[a - 1] }))), C && (Je(o) ? $(o.next) && m.push(S, S) : C === S ? $(o.next) && m.push(S) : l.push(C)), [...u, E([...p, E([ot(i, e, r), ...l], { id: s[a] })]), ...m];
}, "children");
}
function Bs(t7, e, r) {
let { node: n } = t7, s = [];
Va(t7) && s.push("} "), s.push("@", n.name), n.parameters && s.push(" (", E(r("parameters")), ")"), s.push(" {");
let i = Ls(n);
return n.children.length > 0 ? (n.firstChild.hasLeadingSpaces = true, n.lastChild.hasTrailingSpaces = true, s.push(k([S, Re(t7, e, r)])), i && s.push(S, "}")) : i && s.push("}"), E(s, { shouldBreak: true });
}
function Ls(t7) {
var e, r;
return !(((e = t7.next) == null ? void 0 : e.type) === "angularControlFlowBlock" && ((r = xs.get(t7.name)) != null && r.has(t7.next.name)));
}
function Va(t7) {
let { previous: e } = t7;
return (e == null ? void 0 : e.type) === "angularControlFlowBlock" && !ge(e) && !Ls(e);
}
function Fs(t7, e, r) {
return [k([v, H([";", _], t7.map(r, "children"))]), v];
}
function Ps(t7, e, r) {
let { node: n } = t7;
return [De(n, e), E([n.switchValue.trim(), ", ", n.clause, n.cases.length > 0 ? [",", k([_, H(_, t7.map(r, "cases"))])] : "", v]), Se(n, e)];
}
function Ns(t7, e, r) {
let { node: n } = t7;
return [n.value, " {", E([k([v, t7.map(({ node: s, isLast: i }) => {
let a = [r()];
return s.type === "text" && (s.hasLeadingSpaces && a.unshift(_), s.hasTrailingSpaces && !i && a.push(_)), a;
}, "expression")]), v]), "}"];
}
function Is(t7, e, r) {
let { node: n } = t7;
if (wt(n, e)) return [z(n, e), E(st(t7, e, r)), B(Nt(n, e)), ...tt(n, e), G(n, e)];
let s = n.children.length === 1 && (n.firstChild.type === "interpolation" || n.firstChild.type === "angularIcuExpression") && n.firstChild.isLeadingSpaceSensitive && !n.firstChild.hasLeadingSpaces && n.lastChild.isTrailingSpaceSensitive && !n.lastChild.hasTrailingSpaces, i = Symbol("element-attr-group-id"), a = (l) => E([E(st(t7, e, r), { id: i }), l, tt(n, e)]), o = (l) => s ? Cn(l, { groupId: i }) : (W(n, e) || et(n, e)) && n.parent.type === "root" && e.parser === "vue" && !e.vueIndentScriptAndStyle ? l : k(l), u = () => s ? pe(v, "", { groupId: i }) : n.firstChild.hasLeadingSpaces && n.firstChild.isLeadingSpaceSensitive ? _ : n.firstChild.type === "text" && n.isWhitespaceSensitive && n.isIndentationSensitive ? dn(v) : v, p = () => (n.next ? Q(n.next) : Ee(n.parent)) ? n.lastChild.hasTrailingSpaces && n.lastChild.isTrailingSpaceSensitive ? " " : "" : s ? pe(v, "", { groupId: i }) : n.lastChild.hasTrailingSpaces && n.lastChild.isTrailingSpaceSensitive ? _ : (n.lastChild.type === "comment" || n.lastChild.type === "text" && n.isWhitespaceSensitive && n.isIndentationSensitive) && new RegExp(`\\n[\\t ]{${e.tabWidth * (t7.ancestors.length - 1)}}$`, "u").test(n.lastChild.value) ? "" : v;
return n.children.length === 0 ? a(n.hasDanglingSpaces && n.isDanglingSpaceSensitive ? _ : "") : a([Gn(n) ? ne : "", o([u(), Re(t7, e, r)]), p()]);
}
function ut(t7) {
return t7 >= 9 && t7 <= 32 || t7 == 160;
}
function Rt(t7) {
return 48 <= t7 && t7 <= 57;
}
function lt(t7) {
return t7 >= 97 && t7 <= 122 || t7 >= 65 && t7 <= 90;
}
function Rs(t7) {
return t7 >= 97 && t7 <= 102 || t7 >= 65 && t7 <= 70 || Rt(t7);
}
function $t(t7) {
return t7 === 10 || t7 === 13;
}
function Br(t7) {
return 48 <= t7 && t7 <= 55;
}
function Ot(t7) {
return t7 === 39 || t7 === 34 || t7 === 96;
}
var Ua = /-+([a-z0-9])/g;
function Os(t7) {
return t7.replace(Ua, (...e) => e[1].toUpperCase());
}
var ie = class t {
constructor(e, r, n, s) {
this.file = e, this.offset = r, this.line = n, this.col = s;
}
toString() {
return this.offset != null ? `${this.file.url}@${this.line}:${this.col}` : this.file.url;
}
moveBy(e) {
let r = this.file.content, n = r.length, s = this.offset, i = this.line, a = this.col;
for (; s > 0 && e < 0; ) if (s--, e++, r.charCodeAt(s) == 10) {
i--;
let u = r.substring(0, s - 1).lastIndexOf(String.fromCharCode(10));
a = u > 0 ? s - u : s;
} else a--;
for (; s < n && e > 0; ) {
let o = r.charCodeAt(s);
s++, e--, o == 10 ? (i++, a = 0) : a++;
}
return new t(this.file, s, i, a);
}
getContext(e, r) {
let n = this.file.content, s = this.offset;
if (s != null) {
s > n.length - 1 && (s = n.length - 1);
let i = s, a = 0, o = 0;
for (; a < e && s > 0 && (s--, a++, !(n[s] == `
` && ++o == r)); ) ;
for (a = 0, o = 0; a < e && i < n.length - 1 && (i++, a++, !(n[i] == `
` && ++o == r)); ) ;
return { before: n.substring(s, this.offset), after: n.substring(this.offset, i + 1) };
}
return null;
}
}, ve = class {
constructor(e, r) {
this.content = e, this.url = r;
}
}, h = class {
constructor(e, r, n = e, s = null) {
this.start = e, this.end = r, this.fullStart = n, this.details = s;
}
toString() {
return this.start.file.content.substring(this.start.offset, this.end.offset);
}
}, Mt;
(function(t7) {
t7[t7.WARNING = 0] = "WARNING", t7[t7.ERROR = 1] = "ERROR";
})(Mt || (Mt = {}));
var Oe = class {
constructor(e, r, n = Mt.ERROR, s) {
this.span = e, this.msg = r, this.level = n, this.relatedError = s;
}
contextualMessage() {
let e = this.span.start.getContext(100, 3);
return e ? `${this.msg} ("${e.before}[${Mt[this.level]} ->]${e.after}")` : this.msg;
}
toString() {
let e = this.span.details ? `, ${this.span.details}` : "";
return `${this.contextualMessage()}: ${this.span.start}${e}`;
}
};
var Wa = [za, Ya, Ka, Qa, Ja, to, Za, eo, ro, Xa];
function Ga(t7, e) {
for (let r of Wa) r(t7, e);
return t7;
}
function za(t7) {
t7.walk((e) => {
if (e.type === "element" && e.tagDefinition.ignoreFirstLf && e.children.length > 0 && e.children[0].type === "text" && e.children[0].value[0] === `
`) {
let r = e.children[0];
r.value.length === 1 ? e.removeChild(r) : r.value = r.value.slice(1);
}
});
}
function Ya(t7) {
let e = (r) => {
var n, s;
return r.type === "element" && ((n = r.prev) == null ? void 0 : n.type) === "ieConditionalStartComment" && r.prev.sourceSpan.end.offset === r.startSourceSpan.start.offset && ((s = r.firstChild) == null ? void 0 : s.type) === "ieConditionalEndComment" && r.firstChild.sourceSpan.start.offset === r.startSourceSpan.end.offset;
};
t7.walk((r) => {
if (r.children) for (let n = 0; n < r.children.length; n++) {
let s = r.children[n];
if (!e(s)) continue;
let i = s.prev, a = s.firstChild;
r.removeChild(i), n--;
let o = new h(i.sourceSpan.start, a.sourceSpan.end), u = new h(o.start, s.sourceSpan.end);
s.condition = i.condition, s.sourceSpan = u, s.startSourceSpan = o, s.removeChild(a);
}
});
}
function ja(t7, e, r) {
t7.walk((n) => {
if (n.children) for (let s = 0; s < n.children.length; s++) {
let i = n.children[s];
if (i.type !== "text" && !e(i)) continue;
i.type !== "text" && (i.type = "text", i.value = r(i));
let a = i.prev;
!a || a.type !== "text" || (a.value += i.value, a.sourceSpan = new h(a.sourceSpan.start, i.sourceSpan.end), n.removeChild(i), s--);
}
});
}
function Ka(t7) {
return ja(t7, (e) => e.type === "cdata", (e) => `<![CDATA[${e.value}]]>`);
}
function Xa(t7) {
let e = (r) => {
var n, s;
return r.type === "element" && r.attrs.length === 0 && r.children.length === 1 && r.firstChild.type === "text" && !O.hasWhitespaceCharacter(r.children[0].value) && !r.firstChild.hasLeadingSpaces && !r.firstChild.hasTrailingSpaces && r.isLeadingSpaceSensitive && !r.hasLeadingSpaces && r.isTrailingSpaceSensitive && !r.hasTrailingSpaces && ((n = r.prev) == null ? void 0 : n.type) === "text" && ((s = r.next) == null ? void 0 : s.type) === "text";
};
t7.walk((r) => {
if (r.children) for (let n = 0; n < r.children.length; n++) {
let s = r.children[n];
if (!e(s)) continue;
let i = s.prev, a = s.next;
i.value += `<${s.rawName}>` + s.firstChild.value + `</${s.rawName}>` + a.value, i.sourceSpan = new h(i.sourceSpan.start, a.sourceSpan.end), i.isTrailingSpaceSensitive = a.isTrailingSpaceSensitive, i.hasTrailingSpaces = a.hasTrailingSpaces, r.removeChild(s), n--, r.removeChild(a);
}
});
}
function Qa(t7, e) {
if (e.parser === "html") return;
let r = new RegExp("\\{\\{(.+?)\\}\\}", "su");
t7.walk((n) => {
if (qn(n, e)) for (let s of n.children) {
if (s.type !== "text") continue;
let i = s.sourceSpan.start, a = null, o = s.value.split(r);
for (let u = 0; u < o.length; u++, i = a) {
let p = o[u];
if (u % 2 === 0) {
a = i.moveBy(p.length), p.length > 0 && n.insertChildBefore(s, { type: "text", value: p, sourceSpan: new h(i, a) });
continue;
}
a = i.moveBy(p.length + 4), n.insertChildBefore(s, { type: "interpolation", sourceSpan: new h(i, a), children: p.length === 0 ? [] : [{ type: "text", value: p, sourceSpan: new h(i.moveBy(2), a.moveBy(-2)) }] });
}
n.removeChild(s);
}
});
}
function Ja(t7, e) {
t7.walk((r) => {
let n = r.$children;
if (!n) return;
if (n.length === 0 || n.length