@charisol/plexo-sdk 2.0.19 → 2.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/plexo-sdk.css +1 -1
- package/dist/{v1-DDI8uqDD.js → v1-DQojvrOj.js} +603 -557
- package/dist/v2/context/EditorContext.d.ts +11 -0
- package/dist/v2/host/HostContext.d.ts +20 -1
- package/dist/v2/index.d.ts +2 -2
- package/dist/v2/sol/index.d.ts +1 -1
- package/dist/v2/sol/parse.d.ts +13 -0
- package/dist/v2-compile.js +6 -6
- package/dist/v2.js +1183 -1065
- package/package.json +1 -1
|
@@ -14735,9 +14735,55 @@ function Yo(e) {
|
|
|
14735
14735
|
error: o.length ? "I couldn't understand the changes SOL suggested. Try asking again." : void 0
|
|
14736
14736
|
};
|
|
14737
14737
|
}
|
|
14738
|
+
var Xo = /```[ \t]*plexo-commands[ \t]*\r?\n/i, Zo = "```plexo-commands";
|
|
14739
|
+
function Qo(e) {
|
|
14740
|
+
for (let t = Math.min(19, e.length); t >= 3; t--) {
|
|
14741
|
+
let n = e.slice(-t);
|
|
14742
|
+
if (n[0] === "`" && Zo.startsWith(n.trimEnd().toLowerCase())) return e.slice(0, -t);
|
|
14743
|
+
}
|
|
14744
|
+
return e;
|
|
14745
|
+
}
|
|
14746
|
+
function $o(e) {
|
|
14747
|
+
let t = Xo.exec(e);
|
|
14748
|
+
if (!t) return {
|
|
14749
|
+
text: Qo(e).trim(),
|
|
14750
|
+
commands: [],
|
|
14751
|
+
writing: !1
|
|
14752
|
+
};
|
|
14753
|
+
let n = e.slice(0, t.index), r = e.slice(t.index + t[0].length), i = r.indexOf("```"), a = i === -1 ? r : r.slice(0, i), o = i === -1 ? "" : r.slice(i + 3), s = [], c = a.indexOf("[");
|
|
14754
|
+
if (c !== -1) {
|
|
14755
|
+
let e = 1, t = !1, n = -1;
|
|
14756
|
+
for (let r = c + 1; r < a.length && e > 0; r++) {
|
|
14757
|
+
let i = a[r];
|
|
14758
|
+
if (t) {
|
|
14759
|
+
i === "\\" ? r++ : (i === "\"" || i === "”") && (t = !1);
|
|
14760
|
+
continue;
|
|
14761
|
+
}
|
|
14762
|
+
if (i === "\"" || i === "“") t = !0;
|
|
14763
|
+
else if (i === "{") e === 1 && (n = r), e++;
|
|
14764
|
+
else if (i === "}") {
|
|
14765
|
+
if (e--, e === 1 && n !== -1) {
|
|
14766
|
+
let e;
|
|
14767
|
+
try {
|
|
14768
|
+
e = JSON.parse(Jo(a.slice(n, r + 1)));
|
|
14769
|
+
} catch {
|
|
14770
|
+
e = void 0;
|
|
14771
|
+
}
|
|
14772
|
+
let t = bo.safeParse(e);
|
|
14773
|
+
s.push(t.success ? t.data : null), n = -1;
|
|
14774
|
+
}
|
|
14775
|
+
} else i === "[" ? e++ : i === "]" && e--;
|
|
14776
|
+
}
|
|
14777
|
+
}
|
|
14778
|
+
return {
|
|
14779
|
+
text: `${n}${i === -1 ? "" : o}`.replace(/\n{3,}/g, "\n\n").trim(),
|
|
14780
|
+
commands: s,
|
|
14781
|
+
writing: i === -1
|
|
14782
|
+
};
|
|
14783
|
+
}
|
|
14738
14784
|
//#endregion
|
|
14739
14785
|
//#region src/v2/sol/summarize.ts
|
|
14740
|
-
var
|
|
14786
|
+
var es = {
|
|
14741
14787
|
primaryColor: "main colour",
|
|
14742
14788
|
secondaryColor: "second colour",
|
|
14743
14789
|
headingFont: "heading font",
|
|
@@ -14745,7 +14791,7 @@ var Xo = {
|
|
|
14745
14791
|
neutrals: "background feel",
|
|
14746
14792
|
roundness: "corner roundness"
|
|
14747
14793
|
};
|
|
14748
|
-
function
|
|
14794
|
+
function ts(e, t) {
|
|
14749
14795
|
let n = (e) => t.find((t) => t.id === e || t.name.toLowerCase() === e.toLowerCase()), r = (e) => {
|
|
14750
14796
|
for (let n of t) {
|
|
14751
14797
|
let t = (n.rootNode.children ?? []).find((t) => t.id === e);
|
|
@@ -14772,22 +14818,22 @@ function Zo(e, t) {
|
|
|
14772
14818
|
case "removeSection": return `Remove ${i(e.sectionId)}${a(e.sectionId)}`;
|
|
14773
14819
|
case "moveSection": return `Move ${i(e.sectionId)}${a(e.sectionId)}`;
|
|
14774
14820
|
case "duplicateSection": return `Make a copy of ${i(e.sectionId)}${a(e.sectionId)}`;
|
|
14775
|
-
case "setBrand": return `Update the brand (${Object.keys(e.tokens).map((e) =>
|
|
14821
|
+
case "setBrand": return `Update the brand (${Object.keys(e.tokens).map((e) => es[e] ?? "a brand setting").join(", ")})`;
|
|
14776
14822
|
case "addPage": return `Add a new page called "${e.name}"`;
|
|
14777
14823
|
case "renamePage": return `Rename ${n(e.pageId)?.name ?? "a page"} to "${e.name}"`;
|
|
14778
14824
|
}
|
|
14779
14825
|
}
|
|
14780
14826
|
//#endregion
|
|
14781
14827
|
//#region src/v2/sol/prompt.ts
|
|
14782
|
-
var
|
|
14783
|
-
function
|
|
14828
|
+
var ns = "You are SOL, a friendly assistant inside a website builder. The site owner is not technical: speak plainly, never mention JSON, ids, code or \"blocks\" in what you say to them.\n\nYou are given two JSON documents: \"catalog\" (every kind of section you can add, its layouts and the fields you can fill in) and \"design\" (the site's pages, their sections in order, and the brand). Only use kinds, layouts and fields that appear in the catalog, and only refer to pages and sections by the ids in \"design\".\n\nWhen the owner asks for a change, reply with one or two short, warm sentences explaining what you suggest, then a fenced block of changes like this:\n\n```plexo-commands\n[\n {\"op\": \"addSection\", \"pageId\": \"<page id>\", \"kind\": \"hero\", \"variant\": \"<layout id>\", \"content\": {\"headline\": \"...\"}, \"afterSectionId\": \"<section id>\"},\n {\"op\": \"updateSection\", \"sectionId\": \"<section id>\", \"content\": {\"heading\": \"...\"}, \"variant\": \"<layout id>\", \"style\": {\"background\": \"surface\", \"align\": \"center\", \"spacing\": \"airy\"}},\n {\"op\": \"removeSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"moveSection\", \"sectionId\": \"<section id>\", \"index\": 0},\n {\"op\": \"duplicateSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"setBrand\", \"tokens\": {\"primaryColor\": \"#1D4ED8\", \"headingFont\": \"Poppins\", \"bodyFont\": \"Inter\", \"neutrals\": \"warm\", \"roundness\": \"round\"}},\n {\"op\": \"addPage\", \"name\": \"About\", \"templateId\": \"<optional, from catalog.pageTemplates>\"},\n {\"op\": \"renamePage\", \"pageId\": \"<page id>\", \"name\": \"Our story\"}\n]\n```\n\nRules:\n- The owner always reviews and approves your changes before anything happens, so suggest them confidently, but keep each suggestion small and focused.\n- Content keys are the field paths from the catalog (\"headline\", \"items.0.title\"). A list field needs the whole list. Keep text within each field's \"max\".\n- Write real, specific copy for the owner's business; never lorem ipsum.\n- Sections marked freeForm in \"design\" were designed by hand: you may move, copy or remove them but not edit their content. Add a new section instead.\n- If you only need to answer a question or give advice, reply in plain text with no block.", rs = 16;
|
|
14829
|
+
function is(e, t, n = 0) {
|
|
14784
14830
|
return n > 12 ? e : e.replace(/var\(\s*(--[A-Za-z0-9_-]+)\s*(?:,\s*((?:[^()]|\([^()]*\))*))?\)/g, (e, r, i) => {
|
|
14785
14831
|
let a = t.get(r);
|
|
14786
|
-
return a ?
|
|
14832
|
+
return a ? is(O(a), t, n + 1) : i === void 0 ? "NaN" : is(i.trim(), t, n + 1);
|
|
14787
14833
|
});
|
|
14788
14834
|
}
|
|
14789
|
-
function
|
|
14790
|
-
let n =
|
|
14835
|
+
function as(e, t) {
|
|
14836
|
+
let n = is(e.trim(), t.tokens ?? /* @__PURE__ */ new Map()), r = 0, i = () => {
|
|
14791
14837
|
for (; r < n.length && /\s/.test(n[r]);) r += 1;
|
|
14792
14838
|
}, a = () => {
|
|
14793
14839
|
throw Error("bad");
|
|
@@ -14876,57 +14922,57 @@ function ts(e, t) {
|
|
|
14876
14922
|
return null;
|
|
14877
14923
|
}
|
|
14878
14924
|
}
|
|
14879
|
-
var
|
|
14925
|
+
var os = {
|
|
14880
14926
|
tablet: .8,
|
|
14881
14927
|
mobile: .6
|
|
14882
|
-
},
|
|
14883
|
-
function
|
|
14928
|
+
}, ss = 40;
|
|
14929
|
+
function cs(e, t) {
|
|
14884
14930
|
return t === "desktop" || e.responsive?.tablet?.fontSize !== void 0 ? !1 : t === "tablet" || e.responsive?.mobile?.fontSize === void 0;
|
|
14885
14931
|
}
|
|
14886
|
-
function
|
|
14887
|
-
return e <=
|
|
14932
|
+
function ls(e, t) {
|
|
14933
|
+
return e <= ss ? e : Math.max(ss, e * os[t]);
|
|
14888
14934
|
}
|
|
14889
|
-
function
|
|
14935
|
+
function us(e, t) {
|
|
14890
14936
|
let n = e.trim(), r = /^(\d*\.?\d+)(px|rem)$/i.exec(n);
|
|
14891
14937
|
if (r) {
|
|
14892
14938
|
let e = parseFloat(r[1]) * (r[2].toLowerCase() === "rem" ? 16 : 1);
|
|
14893
|
-
if (e <=
|
|
14894
|
-
let i =
|
|
14939
|
+
if (e <= ss) return n;
|
|
14940
|
+
let i = ls(e, t);
|
|
14895
14941
|
return r[2].toLowerCase() === "rem" ? `${Math.round(i / 16 * 1e3) / 1e3}rem` : `${Math.round(i * 10) / 10}px`;
|
|
14896
14942
|
}
|
|
14897
|
-
return /^(?:var|calc|clamp|min|max)\(/i.test(n) && n.length < 300 ? `max(min(${n}, ${
|
|
14943
|
+
return /^(?:var|calc|clamp|min|max)\(/i.test(n) && n.length < 300 ? `max(min(${n}, ${ss}px), calc(${n} * ${os[t]}))` : n;
|
|
14898
14944
|
}
|
|
14899
|
-
var
|
|
14900
|
-
function
|
|
14945
|
+
var ds = (e, t = 10) => Math.round(e * t) / t;
|
|
14946
|
+
function fs(e, t) {
|
|
14901
14947
|
return je(t.textStyle) ? t.textStyle : e.type === "heading" ? Ie(e.props?.level) : null;
|
|
14902
14948
|
}
|
|
14903
|
-
function
|
|
14904
|
-
return e ?
|
|
14949
|
+
function ps(e, t) {
|
|
14950
|
+
return e ? as(/^-?[\d.]+$/.test(e.trim()) ? `${e.trim()}px` : e, {
|
|
14905
14951
|
...t,
|
|
14906
14952
|
tokens: t.tokens
|
|
14907
14953
|
}) : null;
|
|
14908
14954
|
}
|
|
14909
|
-
function
|
|
14910
|
-
let i = E(n), a = fe[r], o =
|
|
14955
|
+
function ms(e, t, n, r) {
|
|
14956
|
+
let i = E(n), a = fe[r], o = fs(e, t), s = o ? Me(o) : null, c = {
|
|
14911
14957
|
tokens: i,
|
|
14912
14958
|
width: a,
|
|
14913
14959
|
fontPx: 16
|
|
14914
|
-
}, l =
|
|
14960
|
+
}, l = ps(t.fontSize, c), u = l !== null && cs(e, r) ? ls(l, r) : l, d = s ? as(s.size[r], c) : null, f = u ?? d ?? 16, p = {
|
|
14915
14961
|
...c,
|
|
14916
14962
|
fontPx: f
|
|
14917
14963
|
}, m = null, h = !1;
|
|
14918
14964
|
if (t.lineHeight) {
|
|
14919
14965
|
let e = String(t.lineHeight).trim(), n = /^-?[\d.]+$/.test(e) ? parseFloat(e) : /%$/.test(e) ? parseFloat(e) / 100 : (() => {
|
|
14920
|
-
let t =
|
|
14966
|
+
let t = as(e, p);
|
|
14921
14967
|
return t === null ? null : t / f;
|
|
14922
14968
|
})();
|
|
14923
14969
|
n !== null && Number.isFinite(n) && n > 0 && (m = n, h = !0);
|
|
14924
14970
|
}
|
|
14925
|
-
m === null && (m = s ?
|
|
14926
|
-
let g = t.isBold ? 700 : Number(t.fontWeight ?? (s ?
|
|
14971
|
+
m === null && (m = s ? as(s.line, p) : null), m === null && (m = 1.5);
|
|
14972
|
+
let g = t.isBold ? 700 : Number(t.fontWeight ?? (s ? as(s.weight, p) : 400)), _ = t.fontFamily ?? is(s && s.family === "heading" ? "var(--semantic-font-family-heading, var(--font-family-sans))" : "var(--semantic-font-family-body, var(--font-family-sans))", i);
|
|
14927
14973
|
return {
|
|
14928
|
-
fontSize:
|
|
14929
|
-
lineHeight:
|
|
14974
|
+
fontSize: ds(f),
|
|
14975
|
+
lineHeight: ds(m, 100),
|
|
14930
14976
|
fontWeight: Number.isFinite(g) ? g : 400,
|
|
14931
14977
|
fontFamily: v(_),
|
|
14932
14978
|
textStyle: o,
|
|
@@ -14940,7 +14986,7 @@ function us(e, t, n, r) {
|
|
|
14940
14986
|
}
|
|
14941
14987
|
//#endregion
|
|
14942
14988
|
//#region src/v2/design/css.ts
|
|
14943
|
-
var
|
|
14989
|
+
var hs = {
|
|
14944
14990
|
compact: {
|
|
14945
14991
|
desktop: {
|
|
14946
14992
|
y: "3.5rem",
|
|
@@ -14993,11 +15039,11 @@ var ds = {
|
|
|
14993
15039
|
}
|
|
14994
15040
|
}
|
|
14995
15041
|
};
|
|
14996
|
-
function
|
|
15042
|
+
function gs(e) {
|
|
14997
15043
|
return Object.fromEntries(e.tokens.map((e) => [e.key, O(e)]));
|
|
14998
15044
|
}
|
|
14999
|
-
function
|
|
15000
|
-
let n =
|
|
15045
|
+
function _s(e, t) {
|
|
15046
|
+
let n = hs[e.options?.density ?? "comfortable"][t], r = E(e), i = r.get("--color-action-primary-bg"), a = r.get("--color-action-primary-text"), o = i && Ha(ie(r, O(i)), a ? ie(r, O(a)) : void 0) || "#FFFFFF";
|
|
15001
15047
|
return {
|
|
15002
15048
|
...Pe(t),
|
|
15003
15049
|
"--plx-on-accent": o,
|
|
@@ -15008,39 +15054,39 @@ function ps(e, t) {
|
|
|
15008
15054
|
"--plx-accent": "var(--color-action-primary-bg)"
|
|
15009
15055
|
};
|
|
15010
15056
|
}
|
|
15011
|
-
function
|
|
15057
|
+
function vs(e, t) {
|
|
15012
15058
|
return {
|
|
15013
|
-
...
|
|
15014
|
-
...
|
|
15059
|
+
...gs(e),
|
|
15060
|
+
..._s(e, t)
|
|
15015
15061
|
};
|
|
15016
15062
|
}
|
|
15017
|
-
var
|
|
15018
|
-
function
|
|
15019
|
-
let n = E(e), r =
|
|
15063
|
+
var ys = /var\(\s*(--[A-Za-z0-9_-]+)/g, bs = (e) => [...e.matchAll(ys)].map((e) => e[1]);
|
|
15064
|
+
function xs(e, t) {
|
|
15065
|
+
let n = E(e), r = _s(e, "desktop"), i = _s(e, "tablet"), a = _s(e, "mobile"), o = (e) => {
|
|
15020
15066
|
if (e in r) return r[e];
|
|
15021
15067
|
let t = n.get(e);
|
|
15022
15068
|
return t ? O(t) : void 0;
|
|
15023
|
-
}, s = /* @__PURE__ */ new Set(), c = {}, l =
|
|
15069
|
+
}, s = /* @__PURE__ */ new Set(), c = {}, l = bs(t);
|
|
15024
15070
|
for (; l.length;) {
|
|
15025
15071
|
let e = l.pop();
|
|
15026
15072
|
if (s.has(e)) continue;
|
|
15027
15073
|
let t = o(e);
|
|
15028
|
-
t !== void 0 && (s.add(e), c[e] = t, l.push(...
|
|
15074
|
+
t !== void 0 && (s.add(e), c[e] = t, l.push(...bs(t)), e in i && l.push(...bs(i[e])), e in a && l.push(...bs(a[e])));
|
|
15029
15075
|
}
|
|
15030
15076
|
return {
|
|
15031
15077
|
needed: s,
|
|
15032
15078
|
vars: c
|
|
15033
15079
|
};
|
|
15034
15080
|
}
|
|
15035
|
-
function
|
|
15036
|
-
let { vars: r } =
|
|
15081
|
+
function Ss(e, t, n) {
|
|
15082
|
+
let { vars: r } = xs(e, `${n} var(--color-brand-primary-500) var(--color-text-primary) var(--color-text-muted) var(--color-border-default) var(--color-bg-surface) var(--color-bg-canvas) var(--radius-lg) var(--font-family-body)`);
|
|
15037
15083
|
return {
|
|
15038
15084
|
...r,
|
|
15039
|
-
...
|
|
15085
|
+
..._s(e, t)
|
|
15040
15086
|
};
|
|
15041
15087
|
}
|
|
15042
|
-
function
|
|
15043
|
-
let { needed: n } =
|
|
15088
|
+
function Cs(e, t) {
|
|
15089
|
+
let { needed: n } = xs(e, t), r = E(e), i = /* @__PURE__ */ new Set();
|
|
15044
15090
|
for (let e of n) {
|
|
15045
15091
|
let t = r.get(e);
|
|
15046
15092
|
if (!t || t.type !== "font family") continue;
|
|
@@ -15049,17 +15095,17 @@ function ys(e, t) {
|
|
|
15049
15095
|
}
|
|
15050
15096
|
return [...i];
|
|
15051
15097
|
}
|
|
15052
|
-
function
|
|
15053
|
-
let { needed: n, vars: r } =
|
|
15098
|
+
function ws(e, t) {
|
|
15099
|
+
let { needed: n, vars: r } = xs(e, t), i = (e, t) => e.map((e) => `${e}:${t[e]}`).join(";"), a = [`.plx-page{${i([...n], r)}}`];
|
|
15054
15100
|
for (let [t, r] of [["tablet", "(max-width: 1023px)"], ["mobile", "(max-width: 599px)"]]) {
|
|
15055
|
-
let o =
|
|
15101
|
+
let o = _s(e, t), s = _s(e, t === "tablet" ? "desktop" : "tablet"), c = Object.keys(o).filter((e) => n.has(e) && o[e] !== s[e]);
|
|
15056
15102
|
c.length && a.push(`@container plx-page ${r}{.plx-page>*{${i(c, o)}}}`);
|
|
15057
15103
|
}
|
|
15058
15104
|
return a.join("\n");
|
|
15059
15105
|
}
|
|
15060
15106
|
//#endregion
|
|
15061
15107
|
//#region src/v2/design/audit.ts
|
|
15062
|
-
var
|
|
15108
|
+
var Ts = [
|
|
15063
15109
|
"color",
|
|
15064
15110
|
"font",
|
|
15065
15111
|
"fontSize",
|
|
@@ -15067,7 +15113,7 @@ var xs = [
|
|
|
15067
15113
|
"radius",
|
|
15068
15114
|
"shadow",
|
|
15069
15115
|
"spacing"
|
|
15070
|
-
],
|
|
15116
|
+
], Es = {
|
|
15071
15117
|
color: {
|
|
15072
15118
|
one: "colour",
|
|
15073
15119
|
many: "colours",
|
|
@@ -15103,14 +15149,14 @@ var xs = [
|
|
|
15103
15149
|
many: "spacings",
|
|
15104
15150
|
nearest: "brand spacing"
|
|
15105
15151
|
}
|
|
15106
|
-
},
|
|
15152
|
+
}, Ds = [
|
|
15107
15153
|
"textColor",
|
|
15108
15154
|
"backgroundColor",
|
|
15109
15155
|
"darkModeBackgroundColor",
|
|
15110
15156
|
"borderColor",
|
|
15111
15157
|
"linkColor",
|
|
15112
15158
|
"linkHoverColor"
|
|
15113
|
-
],
|
|
15159
|
+
], Os = [
|
|
15114
15160
|
"padding",
|
|
15115
15161
|
"paddingTop",
|
|
15116
15162
|
"paddingBottom",
|
|
@@ -15123,56 +15169,56 @@ var xs = [
|
|
|
15123
15169
|
"marginRight",
|
|
15124
15170
|
"gap",
|
|
15125
15171
|
"gridGap"
|
|
15126
|
-
],
|
|
15127
|
-
let t =
|
|
15172
|
+
], ks = /^(#[0-9a-f]{3,8}|rgba?\([^)]*\)|hsla?\([^)]*\)|white|black)$/i, As = /#[0-9a-f]{8}\b|#[0-9a-f]{6}\b|#[0-9a-f]{3,4}\b|rgba?\([^)]*\)|hsla?\([^)]*\)/gi, js = /^(\d*\.?\d+)(px|rem)$/i, Ms = (e, t = 2) => Math.round(e * 10 ** t) / 10 ** t, Ns = (e) => {
|
|
15173
|
+
let t = js.exec(e.trim());
|
|
15128
15174
|
if (!t) return null;
|
|
15129
15175
|
let n = parseFloat(t[1]);
|
|
15130
15176
|
return t[2].toLowerCase() === "rem" ? n * 16 : n;
|
|
15131
|
-
},
|
|
15177
|
+
}, Ps = (e) => ks.test(e.trim()) && (f(e)?.a ?? 0) > 0, Fs = (e) => {
|
|
15132
15178
|
let t = f(e);
|
|
15133
15179
|
return !t || t.a <= 0 ? null : m({
|
|
15134
15180
|
...t,
|
|
15135
|
-
a:
|
|
15181
|
+
a: Ms(t.a, 2)
|
|
15136
15182
|
}).toLowerCase();
|
|
15137
|
-
},
|
|
15138
|
-
function
|
|
15183
|
+
}, Is = (e) => e.trim().toLowerCase().replace(/\s+/g, " ").replace(/\s*,\s*/g, ",").replace(/\(\s+/g, "(").replace(/\s+\)/g, ")");
|
|
15184
|
+
function Ls(e, t) {
|
|
15139
15185
|
switch (e) {
|
|
15140
|
-
case "color": return
|
|
15186
|
+
case "color": return Fs(t);
|
|
15141
15187
|
case "font": return v(t).toLowerCase() || null;
|
|
15142
15188
|
case "fontSize":
|
|
15143
15189
|
case "radius":
|
|
15144
15190
|
case "spacing": {
|
|
15145
|
-
let e =
|
|
15146
|
-
return e === null || e <= 0 ? null : `${
|
|
15191
|
+
let e = Ns(t);
|
|
15192
|
+
return e === null || e <= 0 ? null : `${Ms(e)}px`;
|
|
15147
15193
|
}
|
|
15148
15194
|
case "lineHeight": {
|
|
15149
15195
|
let e = parseFloat(t);
|
|
15150
|
-
return Number.isFinite(e) && e > 0 ? String(
|
|
15196
|
+
return Number.isFinite(e) && e > 0 ? String(Ms(e)) : null;
|
|
15151
15197
|
}
|
|
15152
|
-
case "shadow": return
|
|
15198
|
+
case "shadow": return Is(t) || null;
|
|
15153
15199
|
}
|
|
15154
15200
|
}
|
|
15155
|
-
function
|
|
15201
|
+
function Rs(e, t) {
|
|
15156
15202
|
if (!e) return e;
|
|
15157
15203
|
let n = null, r = e, i = (e, t) => {
|
|
15158
15204
|
t !== r[e] && (n ??= { ...r }, n[e] = t);
|
|
15159
15205
|
}, a = (e) => typeof r[e] == "string" && !r[e].includes("var(") ? r[e].trim() : null;
|
|
15160
|
-
for (let e of
|
|
15206
|
+
for (let e of Ds) {
|
|
15161
15207
|
let n = a(e);
|
|
15162
|
-
if (n &&
|
|
15208
|
+
if (n && Ps(n)) {
|
|
15163
15209
|
let r = t("color", n);
|
|
15164
15210
|
r !== void 0 && i(e, r);
|
|
15165
15211
|
}
|
|
15166
15212
|
}
|
|
15167
15213
|
let o = typeof r.backgroundGradient == "string" ? r.backgroundGradient : null;
|
|
15168
|
-
o && i("backgroundGradient", o.replace(
|
|
15214
|
+
o && i("backgroundGradient", o.replace(As, (e) => Ps(e) ? t("color", e) ?? e : e));
|
|
15169
15215
|
let s = a("fontFamily");
|
|
15170
15216
|
if (s && !/^(inherit|initial|unset)$/i.test(s)) {
|
|
15171
15217
|
let e = t("font", s);
|
|
15172
15218
|
e !== void 0 && i("fontFamily", e);
|
|
15173
15219
|
}
|
|
15174
15220
|
let c = a("fontSize");
|
|
15175
|
-
if (c &&
|
|
15221
|
+
if (c && js.test(c)) {
|
|
15176
15222
|
let e = t("fontSize", c);
|
|
15177
15223
|
e !== void 0 && i("fontSize", e);
|
|
15178
15224
|
}
|
|
@@ -15189,21 +15235,21 @@ function Ps(e, t) {
|
|
|
15189
15235
|
let d = (e, n) => {
|
|
15190
15236
|
let r = a(e);
|
|
15191
15237
|
if (!r || r.includes("(")) return;
|
|
15192
|
-
let o = r.split(/\s+/).map((e) =>
|
|
15238
|
+
let o = r.split(/\s+/).map((e) => js.test(e) && (Ns(e) ?? 0) > 0 ? t(n, e) ?? e : e).join(" ");
|
|
15193
15239
|
i(e, o);
|
|
15194
15240
|
};
|
|
15195
15241
|
d("borderRadius", "radius");
|
|
15196
|
-
for (let e of
|
|
15242
|
+
for (let e of Os) d(e, "spacing");
|
|
15197
15243
|
return n ?? e;
|
|
15198
15244
|
}
|
|
15199
|
-
var
|
|
15245
|
+
var zs = (e) => {
|
|
15200
15246
|
let t = e.type === "section" ? e.props?.block : void 0;
|
|
15201
15247
|
return t && typeof t == "object" && typeof t.kind == "string" ? t : null;
|
|
15202
|
-
},
|
|
15203
|
-
function
|
|
15248
|
+
}, Bs = "__", Vs = (e, t) => t === e ? "@section" : t.startsWith(`${e}${Bs}`) ? t.slice(e.length + 2) : t;
|
|
15249
|
+
function Hs(e, t) {
|
|
15204
15250
|
if (!e.overrides) return e;
|
|
15205
15251
|
let n = !1, r = Object.fromEntries(Object.entries(e.overrides).map(([e, r]) => {
|
|
15206
|
-
let i =
|
|
15252
|
+
let i = Rs(r.styles, t), a = Rs(r.responsive?.tablet, t), o = Rs(r.responsive?.mobile, t);
|
|
15207
15253
|
return i === r.styles && a === r.responsive?.tablet && o === r.responsive?.mobile ? [e, r] : (n = !0, [e, {
|
|
15208
15254
|
...r,
|
|
15209
15255
|
styles: i,
|
|
@@ -15219,13 +15265,13 @@ function Rs(e, t) {
|
|
|
15219
15265
|
overrides: r
|
|
15220
15266
|
} : e;
|
|
15221
15267
|
}
|
|
15222
|
-
function
|
|
15223
|
-
let r =
|
|
15268
|
+
function Us(e, t, n) {
|
|
15269
|
+
let r = zs(e);
|
|
15224
15270
|
if (r) {
|
|
15225
|
-
let i =
|
|
15271
|
+
let i = Hs(r, t);
|
|
15226
15272
|
if (!n || i === r) return e;
|
|
15227
15273
|
let a = i.overrides ?? {};
|
|
15228
|
-
return
|
|
15274
|
+
return Ws({
|
|
15229
15275
|
...e,
|
|
15230
15276
|
props: {
|
|
15231
15277
|
...e.props,
|
|
@@ -15233,7 +15279,7 @@ function zs(e, t, n) {
|
|
|
15233
15279
|
}
|
|
15234
15280
|
}, e.id, a);
|
|
15235
15281
|
}
|
|
15236
|
-
let i =
|
|
15282
|
+
let i = Rs(e.styles, t), a = Rs(e.responsive?.tablet, t), o = Rs(e.responsive?.mobile, t), s = e.children?.map((e) => Us(e, t, n)), c = !s || s.every((t, n) => t === e.children[n]);
|
|
15237
15283
|
return i === e.styles && a === e.responsive?.tablet && o === e.responsive?.mobile && c ? e : {
|
|
15238
15284
|
...e,
|
|
15239
15285
|
styles: i,
|
|
@@ -15245,9 +15291,9 @@ function zs(e, t, n) {
|
|
|
15245
15291
|
...s ? { children: s } : {}
|
|
15246
15292
|
};
|
|
15247
15293
|
}
|
|
15248
|
-
function
|
|
15294
|
+
function Ws(e, t, n) {
|
|
15249
15295
|
let r = (e) => {
|
|
15250
|
-
let i = n[
|
|
15296
|
+
let i = n[Vs(t, e.id)], a = e.children?.map(r);
|
|
15251
15297
|
return i ? {
|
|
15252
15298
|
...e,
|
|
15253
15299
|
...a ? { children: a } : {},
|
|
@@ -15272,7 +15318,7 @@ function Bs(e, t, n) {
|
|
|
15272
15318
|
};
|
|
15273
15319
|
return r(e);
|
|
15274
15320
|
}
|
|
15275
|
-
var
|
|
15321
|
+
var Gs = {
|
|
15276
15322
|
font: "--font-family-",
|
|
15277
15323
|
fontSize: "--font-size-",
|
|
15278
15324
|
lineHeight: "--line-height-",
|
|
@@ -15280,27 +15326,27 @@ var Vs = {
|
|
|
15280
15326
|
shadow: "--shadow-",
|
|
15281
15327
|
spacing: "--space-"
|
|
15282
15328
|
};
|
|
15283
|
-
function
|
|
15329
|
+
function Ks(e) {
|
|
15284
15330
|
let t = (e.name && !e.name.startsWith("--") ? e.name : e.key.replace(/^--/, "").replace(/-/g, " ")).replace(/^(Color|Semantic) /i, "");
|
|
15285
15331
|
return t = t.replace(/^Brand (Primary|Secondary) 500$/i, "$1").replace(/^Brand /i, ""), t;
|
|
15286
15332
|
}
|
|
15287
|
-
function
|
|
15288
|
-
let n = [], r =
|
|
15333
|
+
function qs(e, t) {
|
|
15334
|
+
let n = [], r = Gs[t];
|
|
15289
15335
|
for (let i of e.tokens) {
|
|
15290
15336
|
if (t === "color" ? !(i.type === "color" && i.layer !== "component") : !(r && i.key.startsWith(r))) continue;
|
|
15291
15337
|
let a = T(e, i.key);
|
|
15292
15338
|
if (a === void 0) continue;
|
|
15293
|
-
let o =
|
|
15339
|
+
let o = Ls(t, a);
|
|
15294
15340
|
o && n.push({
|
|
15295
15341
|
key: i.key,
|
|
15296
|
-
name:
|
|
15342
|
+
name: Ks(i),
|
|
15297
15343
|
norm: o,
|
|
15298
15344
|
layer: i.layer
|
|
15299
15345
|
});
|
|
15300
15346
|
}
|
|
15301
15347
|
return n;
|
|
15302
15348
|
}
|
|
15303
|
-
function
|
|
15349
|
+
function Js(e) {
|
|
15304
15350
|
let t = f(e), n = (e) => {
|
|
15305
15351
|
let t = e / 255;
|
|
15306
15352
|
return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
@@ -15315,16 +15361,16 @@ function Ws(e) {
|
|
|
15315
15361
|
200 * (l(s) - l(c))
|
|
15316
15362
|
];
|
|
15317
15363
|
}
|
|
15318
|
-
var
|
|
15319
|
-
function
|
|
15320
|
-
let n = Math.abs(
|
|
15364
|
+
var Ys = (e) => f(e)?.a ?? 1;
|
|
15365
|
+
function Xs(e, t) {
|
|
15366
|
+
let n = Math.abs(Ys(e) - Ys(t));
|
|
15321
15367
|
if (n > .06) return Infinity;
|
|
15322
|
-
let [r, i, a] =
|
|
15368
|
+
let [r, i, a] = Js(e), [o, s, c] = Js(t);
|
|
15323
15369
|
return Math.sqrt((r - o) ** 2 + (i - s) ** 2 + (a - c) ** 2) + n * 100;
|
|
15324
15370
|
}
|
|
15325
|
-
function
|
|
15371
|
+
function Zs(e, t, n) {
|
|
15326
15372
|
switch (e) {
|
|
15327
|
-
case "color": return
|
|
15373
|
+
case "color": return Xs(t, n);
|
|
15328
15374
|
case "fontSize":
|
|
15329
15375
|
case "radius":
|
|
15330
15376
|
case "spacing": return Math.abs(parseFloat(t) - parseFloat(n));
|
|
@@ -15332,8 +15378,8 @@ function qs(e, t, n) {
|
|
|
15332
15378
|
default: return t === n ? 0 : Infinity;
|
|
15333
15379
|
}
|
|
15334
15380
|
}
|
|
15335
|
-
var
|
|
15336
|
-
function
|
|
15381
|
+
var Qs = (e) => e === "color" ? 1.5 : e === "lineHeight" ? .02 : .5;
|
|
15382
|
+
function $s(e, t, n, r) {
|
|
15337
15383
|
return e === "color" ? {
|
|
15338
15384
|
ok: t <= 10,
|
|
15339
15385
|
level: t <= 3 ? "almost identical" : t <= 6 ? "very close" : "close"
|
|
@@ -15351,15 +15397,15 @@ function Ys(e, t, n, r) {
|
|
|
15351
15397
|
level: "almost identical"
|
|
15352
15398
|
};
|
|
15353
15399
|
}
|
|
15354
|
-
var
|
|
15400
|
+
var ec = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""), tc = (e) => {
|
|
15355
15401
|
let t = f(e);
|
|
15356
15402
|
return Math.max(t.r, t.g, t.b) - Math.min(t.r, t.g, t.b) < 24;
|
|
15357
15403
|
};
|
|
15358
|
-
function
|
|
15404
|
+
function nc(e, t, n, r) {
|
|
15359
15405
|
let i;
|
|
15360
15406
|
switch (e) {
|
|
15361
15407
|
case "color":
|
|
15362
|
-
i =
|
|
15408
|
+
i = tc(t) ? {
|
|
15363
15409
|
key: "--color-neutral-custom",
|
|
15364
15410
|
name: "Neutral",
|
|
15365
15411
|
numbered: !0
|
|
@@ -15371,10 +15417,10 @@ function Qs(e, t, n, r) {
|
|
|
15371
15417
|
break;
|
|
15372
15418
|
case "font": {
|
|
15373
15419
|
let e = v(n);
|
|
15374
|
-
return
|
|
15420
|
+
return rc(`--font-family-${ec(e) || "custom"}`, e, !1, r);
|
|
15375
15421
|
}
|
|
15376
15422
|
case "fontSize":
|
|
15377
|
-
i = (
|
|
15423
|
+
i = (Ns(t) ?? 0) >= 28 ? {
|
|
15378
15424
|
key: "--font-size-heading",
|
|
15379
15425
|
name: "Heading size",
|
|
15380
15426
|
numbered: !0
|
|
@@ -15413,9 +15459,9 @@ function Qs(e, t, n, r) {
|
|
|
15413
15459
|
};
|
|
15414
15460
|
break;
|
|
15415
15461
|
}
|
|
15416
|
-
return
|
|
15462
|
+
return rc(i.key, i.name, !0, r);
|
|
15417
15463
|
}
|
|
15418
|
-
function
|
|
15464
|
+
function rc(e, t, n, r) {
|
|
15419
15465
|
if (!n) {
|
|
15420
15466
|
let n = e, i = 2;
|
|
15421
15467
|
for (; r.has(n);) n = `${e}-${i++}`;
|
|
@@ -15431,10 +15477,10 @@ function $s(e, t, n, r) {
|
|
|
15431
15477
|
name: `${t} ${i}`
|
|
15432
15478
|
};
|
|
15433
15479
|
}
|
|
15434
|
-
function
|
|
15480
|
+
function ic(e) {
|
|
15435
15481
|
let t = /* @__PURE__ */ new Map();
|
|
15436
|
-
for (let n of e)
|
|
15437
|
-
let i =
|
|
15482
|
+
for (let n of e) Us(n.rootNode, (e, r) => {
|
|
15483
|
+
let i = Ls(e, r);
|
|
15438
15484
|
if (!i) return;
|
|
15439
15485
|
let a = `${e}:${i}`, o = t.get(a);
|
|
15440
15486
|
o || t.set(a, o = {
|
|
@@ -15447,25 +15493,25 @@ function ec(e) {
|
|
|
15447
15493
|
}, !1);
|
|
15448
15494
|
return t;
|
|
15449
15495
|
}
|
|
15450
|
-
var
|
|
15451
|
-
function
|
|
15452
|
-
let r = n.minorBelow ?? 2, i =
|
|
15453
|
-
for (let e of
|
|
15454
|
-
let n =
|
|
15496
|
+
var ac = (e) => [...e.entries()].sort((e, t) => t[1] - e[1])[0][0];
|
|
15497
|
+
function oc(e, t, n = {}) {
|
|
15498
|
+
let r = n.minorBelow ?? 2, i = ic(e), a = new Set(t.tokens.map((e) => e.key)), o = [];
|
|
15499
|
+
for (let e of Ts) {
|
|
15500
|
+
let n = qs(t, e), s = new Set(n.map((e) => e.norm)), c = [...i.values()].filter((t) => t.kind === e && !s.has(t.norm)).sort((e, t) => t.uses - e.uses || e.norm.localeCompare(t.norm)), l = [];
|
|
15455
15501
|
for (let t of c) {
|
|
15456
|
-
let n = l.find((n) =>
|
|
15502
|
+
let n = l.find((n) => Zs(e, n.rep.norm, t.norm) <= Qs(e));
|
|
15457
15503
|
n ? n.members.push(t) : l.push({
|
|
15458
15504
|
rep: t,
|
|
15459
15505
|
members: [t]
|
|
15460
15506
|
});
|
|
15461
15507
|
}
|
|
15462
15508
|
for (let { rep: t, members: i } of l) {
|
|
15463
|
-
let s = i.reduce((e, t) => e + t.uses, 0), c =
|
|
15509
|
+
let s = i.reduce((e, t) => e + t.uses, 0), c = ac(t.raws), l = [...new Set(i.flatMap((e) => [...e.pages]))], u = [...new Set(i.flatMap((e) => [...e.raws.keys()]))], d, f = Infinity;
|
|
15464
15510
|
for (let r of n) {
|
|
15465
|
-
if (e !== "color" && e !== "font" && e !== "shadow" && parseFloat(r.norm) === 0 || e === "color" &&
|
|
15466
|
-
let i =
|
|
15511
|
+
if (e !== "color" && e !== "font" && e !== "shadow" && parseFloat(r.norm) === 0 || e === "color" && Ys(r.norm) === 0) continue;
|
|
15512
|
+
let i = Zs(e, t.norm, r.norm);
|
|
15467
15513
|
if (i < f || i === f && d && r.layer === "brand" && n.find((e) => e.key === d.tokenKey)?.layer !== "brand") {
|
|
15468
|
-
let n =
|
|
15514
|
+
let n = $s(e, i, t.norm, r.norm);
|
|
15469
15515
|
n.ok && (f = i, d = {
|
|
15470
15516
|
tokenKey: r.key,
|
|
15471
15517
|
name: r.name,
|
|
@@ -15473,9 +15519,9 @@ function nc(e, t, n = {}) {
|
|
|
15473
15519
|
});
|
|
15474
15520
|
}
|
|
15475
15521
|
}
|
|
15476
|
-
let p =
|
|
15522
|
+
let p = nc(e, t.norm, c, a);
|
|
15477
15523
|
a.add(p.key);
|
|
15478
|
-
let m =
|
|
15524
|
+
let m = Es[e];
|
|
15479
15525
|
o.push({
|
|
15480
15526
|
id: `${e}:${t.norm}`,
|
|
15481
15527
|
kind: e,
|
|
@@ -15497,23 +15543,23 @@ function nc(e, t, n = {}) {
|
|
|
15497
15543
|
}
|
|
15498
15544
|
}
|
|
15499
15545
|
o.sort((e, t) => t.uses - e.uses || e.id.localeCompare(t.id));
|
|
15500
|
-
let s = Object.fromEntries(
|
|
15546
|
+
let s = Object.fromEntries(Ts.map((e) => [e, o.filter((t) => t.kind === e)]));
|
|
15501
15547
|
return {
|
|
15502
15548
|
findings: o,
|
|
15503
15549
|
byKind: s,
|
|
15504
|
-
counts: Object.fromEntries(
|
|
15550
|
+
counts: Object.fromEntries(Ts.map((e) => [e, s[e].length])),
|
|
15505
15551
|
total: o.length,
|
|
15506
15552
|
minorCount: o.filter((e) => e.minor).length
|
|
15507
15553
|
};
|
|
15508
15554
|
}
|
|
15509
|
-
function
|
|
15510
|
-
let t =
|
|
15555
|
+
function sc(e) {
|
|
15556
|
+
let t = Ts.filter((t) => e.counts[t] > 0).map((t) => `${e.counts[t]} ${e.counts[t] === 1 ? Es[t].one : Es[t].many}`);
|
|
15511
15557
|
return t.length <= 1 ? t.join("") : `${t.slice(0, -1).join(", ")} and ${t[t.length - 1]}`;
|
|
15512
15558
|
}
|
|
15513
|
-
function
|
|
15559
|
+
function cc(e) {
|
|
15514
15560
|
return Object.fromEntries(e.findings.map((e) => [e.id, e.minor ? "keep" : e.suggestion.action]));
|
|
15515
15561
|
}
|
|
15516
|
-
function
|
|
15562
|
+
function lc(e, t) {
|
|
15517
15563
|
let n = e.value;
|
|
15518
15564
|
if (e.kind === "color") {
|
|
15519
15565
|
let r = f(n);
|
|
@@ -15542,7 +15588,7 @@ function ac(e, t) {
|
|
|
15542
15588
|
layer: "brand",
|
|
15543
15589
|
comment: "Added from your pages"
|
|
15544
15590
|
});
|
|
15545
|
-
let r =
|
|
15591
|
+
let r = js.exec(n.trim());
|
|
15546
15592
|
return C(t, e.add.key, String(parseFloat(r[1])), {
|
|
15547
15593
|
name: e.add.name,
|
|
15548
15594
|
type: "dimension",
|
|
@@ -15551,21 +15597,21 @@ function ac(e, t) {
|
|
|
15551
15597
|
comment: "Added from your pages"
|
|
15552
15598
|
});
|
|
15553
15599
|
}
|
|
15554
|
-
function
|
|
15555
|
-
let i =
|
|
15600
|
+
function uc(e, t, n, r = {}) {
|
|
15601
|
+
let i = oc(e, t, r), a = t, o = /* @__PURE__ */ new Map(), s = ic(e);
|
|
15556
15602
|
for (let e of i.findings) {
|
|
15557
15603
|
let t = n[e.id] ?? "keep", r;
|
|
15558
|
-
if (t === "add" ? (a =
|
|
15604
|
+
if (t === "add" ? (a = lc(e, a), r = e.add.key) : t === "match" && e.match && (r = e.match.tokenKey), r) for (let t of s.values()) t.kind === e.kind && (t.norm === e.id.slice(e.kind.length + 1) || Zs(e.kind, e.id.slice(e.kind.length + 1), t.norm) <= Qs(e.kind)) && o.set(`${t.kind}:${t.norm}`, `var(${r})`);
|
|
15559
15605
|
}
|
|
15560
15606
|
if (!o.size) return {
|
|
15561
15607
|
pages: e,
|
|
15562
15608
|
designSystem: t
|
|
15563
15609
|
};
|
|
15564
15610
|
let c = (e, t) => {
|
|
15565
|
-
let n =
|
|
15611
|
+
let n = Ls(e, t), r = n ? o.get(`${e}:${n}`) : void 0;
|
|
15566
15612
|
if (r) return r;
|
|
15567
15613
|
}, l = e.map((e) => {
|
|
15568
|
-
let t =
|
|
15614
|
+
let t = Us(e.rootNode, c, !0);
|
|
15569
15615
|
return t === e.rootNode ? e : {
|
|
15570
15616
|
...e,
|
|
15571
15617
|
rootNode: t
|
|
@@ -15579,21 +15625,21 @@ function oc(e, t, n, r = {}) {
|
|
|
15579
15625
|
designSystem: u
|
|
15580
15626
|
};
|
|
15581
15627
|
}
|
|
15582
|
-
function
|
|
15628
|
+
function dc(e, t) {
|
|
15583
15629
|
let n = /* @__PURE__ */ new Map();
|
|
15584
15630
|
for (let e of ["color", "font"]) {
|
|
15585
|
-
let r =
|
|
15631
|
+
let r = qs(t, e).sort((e, t) => Number(t.layer === "brand") - Number(e.layer === "brand"));
|
|
15586
15632
|
for (let t of r) {
|
|
15587
|
-
if (e === "color" &&
|
|
15633
|
+
if (e === "color" && Ys(t.norm) === 0) continue;
|
|
15588
15634
|
let r = `${e}:${t.norm}`;
|
|
15589
15635
|
n.has(r) || n.set(r, `var(${t.key})`);
|
|
15590
15636
|
}
|
|
15591
15637
|
}
|
|
15592
15638
|
let r = (e, t) => {
|
|
15593
|
-
let r =
|
|
15639
|
+
let r = Ls(e, t);
|
|
15594
15640
|
return r ? n.get(`${e}:${r}`) : void 0;
|
|
15595
15641
|
}, i = !1, a = e.map((e) => {
|
|
15596
|
-
let t =
|
|
15642
|
+
let t = Us(e.rootNode, r, !0);
|
|
15597
15643
|
return t === e.rootNode ? e : (i = !0, {
|
|
15598
15644
|
...e,
|
|
15599
15645
|
rootNode: t
|
|
@@ -15601,7 +15647,7 @@ function sc(e, t) {
|
|
|
15601
15647
|
});
|
|
15602
15648
|
return i ? a : e;
|
|
15603
15649
|
}
|
|
15604
|
-
var
|
|
15650
|
+
var fc = (e) => {
|
|
15605
15651
|
let t = f(e);
|
|
15606
15652
|
if (!t) return null;
|
|
15607
15653
|
let n = t.r / 255, r = t.g / 255, i = t.b / 255, a = Math.max(n, r, i), o = Math.min(n, r, i), s = (a + o) / 2, c = a - o;
|
|
@@ -15618,31 +15664,31 @@ var cc = (e) => {
|
|
|
15618
15664
|
l: s,
|
|
15619
15665
|
a: t.a ?? 1
|
|
15620
15666
|
};
|
|
15621
|
-
},
|
|
15667
|
+
}, pc = (e, t) => {
|
|
15622
15668
|
let n = Math.abs(e - t) % 360;
|
|
15623
15669
|
return n > 180 ? 360 - n : n;
|
|
15624
15670
|
};
|
|
15625
|
-
function
|
|
15671
|
+
function mc(e, t) {
|
|
15626
15672
|
let n = new Set(t.tokens.map((e) => e.key));
|
|
15627
15673
|
if (!n.has("--color-brand-primary-500")) return e;
|
|
15628
|
-
let r = [...
|
|
15674
|
+
let r = [...ic(e).values()].filter((e) => e.kind === "color").map((e) => ({
|
|
15629
15675
|
e,
|
|
15630
|
-
c:
|
|
15676
|
+
c: fc(e.norm)
|
|
15631
15677
|
})).filter((e) => !!e.c && e.c.a > .99 && e.c.s >= .3 && e.c.l >= .1 && e.c.l <= .92).sort((e, t) => t.e.uses - e.e.uses);
|
|
15632
15678
|
if (!r.length) return e;
|
|
15633
15679
|
let i = [], a = /* @__PURE__ */ new Map();
|
|
15634
15680
|
for (let { e, c: t } of r) {
|
|
15635
|
-
let r = i.findIndex((e) =>
|
|
15681
|
+
let r = i.findIndex((e) => pc(e, t.h) <= 28);
|
|
15636
15682
|
if (r === -1 && i.length < 2 && (i.push(t.h), r = i.length - 1), r === -1) continue;
|
|
15637
15683
|
let o = t.l < .35 ? "700" : t.l > .68 ? "300" : "500", s = r === 0 ? `--color-brand-primary-${o}` : n.has("--color-brand-secondary-500") ? "--color-brand-secondary-500" : null;
|
|
15638
15684
|
s && n.has(s) && a.set(`color:${e.norm}`, `var(${s})`);
|
|
15639
15685
|
}
|
|
15640
15686
|
if (!a.size) return e;
|
|
15641
15687
|
let o = (e, t) => {
|
|
15642
|
-
let n =
|
|
15688
|
+
let n = Ls(e, t);
|
|
15643
15689
|
return n ? a.get(`${e}:${n}`) : void 0;
|
|
15644
15690
|
}, s = !1, c = e.map((e) => {
|
|
15645
|
-
let t =
|
|
15691
|
+
let t = Us(e.rootNode, o, !0);
|
|
15646
15692
|
return t === e.rootNode ? e : (s = !0, {
|
|
15647
15693
|
...e,
|
|
15648
15694
|
rootNode: t
|
|
@@ -15652,7 +15698,7 @@ function uc(e, t) {
|
|
|
15652
15698
|
}
|
|
15653
15699
|
//#endregion
|
|
15654
15700
|
//#region src/v2/render/runtime.ts
|
|
15655
|
-
function
|
|
15701
|
+
function hc(e) {
|
|
15656
15702
|
let t = [], n = (t) => Array.prototype.slice.call(e.querySelectorAll(t)), r = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, i = n(".plx-in");
|
|
15657
15703
|
if (i.length && !r && typeof IntersectionObserver == "function") {
|
|
15658
15704
|
let n = e.querySelector(".plx-page") || e;
|
|
@@ -15757,23 +15803,23 @@ function dc(e) {
|
|
|
15757
15803
|
e.addEventListener("submit", n), t.push(() => e.removeEventListener("submit", n));
|
|
15758
15804
|
}), () => t.forEach((e) => e());
|
|
15759
15805
|
}
|
|
15760
|
-
var
|
|
15761
|
-
function
|
|
15806
|
+
var gc = `(function(){var __name=function(f){return f};return ${hc.toString()}})()`, _c = 1e5, vc = (e) => typeof e == "string" && /^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(e.trim()) ? e.trim() : null, yc = (e) => vc(e.replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^[^A-Za-z]+/, "").slice(0, 64)) ?? "";
|
|
15807
|
+
function bc(e) {
|
|
15762
15808
|
if (typeof e != "string") return { code: "" };
|
|
15763
15809
|
let t = e.trim();
|
|
15764
15810
|
return t ? t.length > 1e5 ? {
|
|
15765
15811
|
code: "",
|
|
15766
|
-
warning: `The site's custom code is too long (over ${
|
|
15812
|
+
warning: `The site's custom code is too long (over ${_c.toLocaleString("en-US")} characters), so it was left out. Shorten it or load it from a file instead.`
|
|
15767
15813
|
} : { code: t.replace(/<\/(script)/gi, "<\\/$1").replace(/<!--/g, "<\\!--") } : { code: "" };
|
|
15768
15814
|
}
|
|
15769
15815
|
//#endregion
|
|
15770
15816
|
//#region src/v2/utils/css.ts
|
|
15771
|
-
function
|
|
15817
|
+
function xc(e) {
|
|
15772
15818
|
return `url("${e.replace(/["\\\n\r\f]/g, (e) => `\\${e.charCodeAt(0).toString(16)} `)}")`;
|
|
15773
15819
|
}
|
|
15774
15820
|
//#endregion
|
|
15775
15821
|
//#region src/v2/render/nodeStyle.ts
|
|
15776
|
-
var
|
|
15822
|
+
var Sc = [
|
|
15777
15823
|
"flex-start",
|
|
15778
15824
|
"center",
|
|
15779
15825
|
"flex-end",
|
|
@@ -15781,25 +15827,25 @@ var vc = [
|
|
|
15781
15827
|
"start",
|
|
15782
15828
|
"end",
|
|
15783
15829
|
"baseline"
|
|
15784
|
-
],
|
|
15830
|
+
], Cc = [
|
|
15785
15831
|
"hidden",
|
|
15786
15832
|
"visible",
|
|
15787
15833
|
"auto",
|
|
15788
15834
|
"clip"
|
|
15789
|
-
],
|
|
15835
|
+
], wc = ["normal", "nowrap"], Tc = [
|
|
15790
15836
|
"auto",
|
|
15791
15837
|
"pointer",
|
|
15792
15838
|
"default",
|
|
15793
15839
|
"text",
|
|
15794
15840
|
"grab",
|
|
15795
15841
|
"not-allowed"
|
|
15796
|
-
],
|
|
15842
|
+
], Ec = [
|
|
15797
15843
|
"ease",
|
|
15798
15844
|
"linear",
|
|
15799
15845
|
"ease-in",
|
|
15800
15846
|
"ease-out",
|
|
15801
15847
|
"ease-in-out"
|
|
15802
|
-
],
|
|
15848
|
+
], Dc = {
|
|
15803
15849
|
all: ["all"],
|
|
15804
15850
|
opacity: ["opacity"],
|
|
15805
15851
|
transform: ["transform"],
|
|
@@ -15809,7 +15855,7 @@ var vc = [
|
|
|
15809
15855
|
"border-color",
|
|
15810
15856
|
"box-shadow"
|
|
15811
15857
|
]
|
|
15812
|
-
},
|
|
15858
|
+
}, Oc = (e, t) => typeof e == "string" && t.includes(e) ? e : void 0, kc = (e) => typeof e == "string" && /^(?:(?:left|right|top|bottom|center|-?\d{1,3}(?:\.\d+)?%)(?: |$)){1,2}$/.test(e.trim() + " ") ? e.trim() : void 0, Ac = (e) => {
|
|
15813
15859
|
let t = typeof e == "number" ? e : typeof e == "string" ? parseFloat(e) : NaN;
|
|
15814
15860
|
if (!Number.isFinite(t) || t <= 0) return {};
|
|
15815
15861
|
let n = `blur(${Math.round(Math.min(40, t) * 10) / 10}px)`;
|
|
@@ -15818,18 +15864,18 @@ var vc = [
|
|
|
15818
15864
|
WebkitBackdropFilter: n
|
|
15819
15865
|
};
|
|
15820
15866
|
};
|
|
15821
|
-
function
|
|
15822
|
-
let t =
|
|
15867
|
+
function jc(e) {
|
|
15868
|
+
let t = Oc(e.transitionProperty, Object.keys(Dc));
|
|
15823
15869
|
if (!t) return;
|
|
15824
|
-
let n = typeof e.transitionDuration == "number" ? e.transitionDuration : 200, r = Math.round(Math.min(2e3, Math.max(0, Number.isFinite(n) ? n : 200))), i =
|
|
15825
|
-
return
|
|
15870
|
+
let n = typeof e.transitionDuration == "number" ? e.transitionDuration : 200, r = Math.round(Math.min(2e3, Math.max(0, Number.isFinite(n) ? n : 200))), i = Oc(e.transitionEasing, Ec) ?? "ease";
|
|
15871
|
+
return Dc[t].map((e) => `${e} ${r}ms ${i}`).join(", ");
|
|
15826
15872
|
}
|
|
15827
|
-
var
|
|
15873
|
+
var Mc = [
|
|
15828
15874
|
"lift",
|
|
15829
15875
|
"grow",
|
|
15830
15876
|
"fade",
|
|
15831
15877
|
"glow"
|
|
15832
|
-
],
|
|
15878
|
+
], Nc = {
|
|
15833
15879
|
lift: {
|
|
15834
15880
|
translate: "0 -6px",
|
|
15835
15881
|
boxShadow: "0 16px 32px rgba(0,0,0,0.18)"
|
|
@@ -15838,19 +15884,19 @@ var Oc = [
|
|
|
15838
15884
|
fade: { opacity: .8 },
|
|
15839
15885
|
glow: { boxShadow: "0 10px 30px rgba(0,0,0,0.28)" }
|
|
15840
15886
|
};
|
|
15841
|
-
function
|
|
15842
|
-
let t =
|
|
15843
|
-
return t ?
|
|
15887
|
+
function Pc(e) {
|
|
15888
|
+
let t = Oc(e.hoverEffect, Mc);
|
|
15889
|
+
return t ? Nc[t] : void 0;
|
|
15844
15890
|
}
|
|
15845
|
-
var
|
|
15891
|
+
var Fc = [
|
|
15846
15892
|
"fade",
|
|
15847
15893
|
"slide-up",
|
|
15848
15894
|
"slide-left",
|
|
15849
15895
|
"slide-right",
|
|
15850
15896
|
"zoom"
|
|
15851
15897
|
];
|
|
15852
|
-
function
|
|
15853
|
-
let t =
|
|
15898
|
+
function Ic(e) {
|
|
15899
|
+
let t = Oc(e.entrance, Fc);
|
|
15854
15900
|
if (!t) return;
|
|
15855
15901
|
let n = typeof e.entranceDelay == "number" && Number.isFinite(e.entranceDelay) ? e.entranceDelay : 0;
|
|
15856
15902
|
return {
|
|
@@ -15858,7 +15904,7 @@ function Mc(e) {
|
|
|
15858
15904
|
delay: Math.round(Math.min(1500, Math.max(0, n)))
|
|
15859
15905
|
};
|
|
15860
15906
|
}
|
|
15861
|
-
function
|
|
15907
|
+
function Lc(e, t, n) {
|
|
15862
15908
|
let { viewport: r } = n, i = je(t.textStyle) ? t.textStyle : e.type === "heading" ? Ie(e.props?.level) : null, a = i ? Fe(i) : {}, o = t.position !== "static" && (typeof t.x == "number" || typeof t.y == "number" || t.position === "absolute"), s = t.flexDirection;
|
|
15863
15909
|
r === "mobile" && t.stackOnMobile && t.display === "flex" && (s = "column");
|
|
15864
15910
|
let c = t.isFullWidth ? "100%" : t.customWidth || t.width, l = t.maxWidth;
|
|
@@ -15909,9 +15955,9 @@ function Nc(e, t, n) {
|
|
|
15909
15955
|
gridRow: n.isGridChild && t.gridRowSpan ? `span ${t.gridRowSpan}` : void 0,
|
|
15910
15956
|
flexDirection: s,
|
|
15911
15957
|
justifyContent: t.justifyContent,
|
|
15912
|
-
alignItems:
|
|
15913
|
-
alignSelf:
|
|
15914
|
-
alignContent:
|
|
15958
|
+
alignItems: Oc(t.alignItems, Sc),
|
|
15959
|
+
alignSelf: Oc(t.alignSelf, Sc),
|
|
15960
|
+
alignContent: Oc(t.alignContent, [
|
|
15915
15961
|
"start",
|
|
15916
15962
|
"center",
|
|
15917
15963
|
"end",
|
|
@@ -15959,7 +16005,7 @@ function Nc(e, t, n) {
|
|
|
15959
16005
|
color: t.textColor,
|
|
15960
16006
|
textAlign: t.textAlign,
|
|
15961
16007
|
backgroundColor: t.backgroundColor,
|
|
15962
|
-
backgroundImage: S ? "none" : C ?
|
|
16008
|
+
backgroundImage: S ? "none" : C ? xc(C) : t.backgroundGradient || void 0,
|
|
15963
16009
|
aspectRatio: t.aspectRatio,
|
|
15964
16010
|
backgroundSize: t.backgroundSize,
|
|
15965
16011
|
backgroundPosition: t.backgroundPosition,
|
|
@@ -15969,13 +16015,13 @@ function Nc(e, t, n) {
|
|
|
15969
16015
|
borderStyle: t.borderStyle,
|
|
15970
16016
|
borderColor: t.borderColor,
|
|
15971
16017
|
boxShadow: t.boxShadow,
|
|
15972
|
-
overflow:
|
|
15973
|
-
whiteSpace:
|
|
15974
|
-
objectPosition:
|
|
15975
|
-
...
|
|
16018
|
+
overflow: Oc(t.overflow, Cc),
|
|
16019
|
+
whiteSpace: Oc(t.whiteSpace, wc),
|
|
16020
|
+
objectPosition: kc(t.objectPosition),
|
|
16021
|
+
...Ac(t.backdropFilter),
|
|
15976
16022
|
pointerEvents: t.pointerEvents
|
|
15977
16023
|
};
|
|
15978
|
-
n.forPublish && (w.cursor =
|
|
16024
|
+
n.forPublish && (w.cursor = Oc(t.cursor, Tc), w.transition = jc(t) ?? (Pc(t) ? "translate 200ms ease, scale 200ms ease, opacity 200ms ease, box-shadow 200ms ease" : void 0)), typeof w.fontSize == "string" && t.fontSize !== void 0 && cs(e, r) && (w.fontSize = us(w.fontSize, r)), e.type === "columns" && !f && (w.display = "grid", w.gridTemplateColumns = `repeat(${r === "mobile" ? 1 : r === "tablet" ? 2 : t.gridColumns || 3}, minmax(0, 1fr))`), n.isRootPage && (w.maxWidth = t.maxWidth || void 0, w.marginLeft = t.horizontalAlign === "left" ? "0px" : t.horizontalAlign === "right" ? "auto" : t.marginLeft || "auto", w.marginRight = t.horizontalAlign === "left" ? "auto" : t.horizontalAlign === "right" ? "0px" : t.marginRight || "auto"), e.type === "section" && t.pinned && (w.position = "sticky", w.top = "0px", w.zIndex = 40);
|
|
15979
16025
|
for (let e of Object.keys(w)) w[e] === void 0 && delete w[e];
|
|
15980
16026
|
return {
|
|
15981
16027
|
css: w,
|
|
@@ -15989,7 +16035,7 @@ function Nc(e, t, n) {
|
|
|
15989
16035
|
}
|
|
15990
16036
|
//#endregion
|
|
15991
16037
|
//#region src/v2/render/iconSet.ts
|
|
15992
|
-
var
|
|
16038
|
+
var Rc = {
|
|
15993
16039
|
star: [["path", { d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z" }]],
|
|
15994
16040
|
heart: [["path", { d: "M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5" }]],
|
|
15995
16041
|
check: [["path", { d: "M20 6 9 17l-5-5" }]],
|
|
@@ -17659,7 +17705,7 @@ var Pc = {
|
|
|
17659
17705
|
["path", { d: "m13 14 8-2" }],
|
|
17660
17706
|
["path", { d: "m13 19 8-2" }]
|
|
17661
17707
|
]
|
|
17662
|
-
},
|
|
17708
|
+
}, zc = {
|
|
17663
17709
|
Popular: [
|
|
17664
17710
|
"star",
|
|
17665
17711
|
"heart",
|
|
@@ -17865,20 +17911,20 @@ var Pc = {
|
|
|
17865
17911
|
"spray-can"
|
|
17866
17912
|
]
|
|
17867
17913
|
};
|
|
17868
|
-
Object.keys(
|
|
17869
|
-
var
|
|
17914
|
+
Object.keys(Rc);
|
|
17915
|
+
var Bc = [["circle", {
|
|
17870
17916
|
cx: "12",
|
|
17871
17917
|
cy: "12",
|
|
17872
17918
|
r: "9"
|
|
17873
17919
|
}]];
|
|
17874
|
-
function
|
|
17875
|
-
return typeof e != "string" || !e.trim() ?
|
|
17920
|
+
function Vc(e) {
|
|
17921
|
+
return typeof e != "string" || !e.trim() ? Rc.star : Object.prototype.hasOwnProperty.call(Rc, e) ? Rc[e] : Bc;
|
|
17876
17922
|
}
|
|
17877
17923
|
//#endregion
|
|
17878
17924
|
//#region src/v2/render/elements.ts
|
|
17879
|
-
var
|
|
17880
|
-
function
|
|
17881
|
-
let t =
|
|
17925
|
+
var Hc = "_hp_field", Uc = (e) => e.props ?? {}, Wc = (e) => M("div", { class: "plx-empty" }, e);
|
|
17926
|
+
function Gc(e) {
|
|
17927
|
+
let t = Uc(e), n = Vc(t.iconName), r = F(t.label, 200).trim();
|
|
17882
17928
|
return M("span", {
|
|
17883
17929
|
class: "plx-el plx-icon",
|
|
17884
17930
|
...r ? {
|
|
@@ -17895,9 +17941,9 @@ function Vc(e) {
|
|
|
17895
17941
|
"aria-hidden": "true"
|
|
17896
17942
|
}, n.map(([e, t]) => M(e, t))));
|
|
17897
17943
|
}
|
|
17898
|
-
function
|
|
17899
|
-
let n =
|
|
17900
|
-
if (!r.length) return M("div", { class: "plx-el plx-carousel" },
|
|
17944
|
+
function Kc(e, t) {
|
|
17945
|
+
let n = Uc(e), r = Et(n.slides, 30);
|
|
17946
|
+
if (!r.length) return M("div", { class: "plx-el plx-carousel" }, Wc("Add a slide to start your carousel"));
|
|
17901
17947
|
let i = r.map((e, n) => `${t.uid}-s${n + 1}`), a = r.length, o = r.map((e, t) => {
|
|
17902
17948
|
let n = vt(e.src), r = F(e.caption, 300), o = [n ? M("img", {
|
|
17903
17949
|
src: n,
|
|
@@ -17956,13 +18002,13 @@ function Hc(e, t) {
|
|
|
17956
18002
|
"aria-label": `Go to slide ${t + 1}`
|
|
17957
18003
|
}))));
|
|
17958
18004
|
}
|
|
17959
|
-
var
|
|
18005
|
+
var qc = {
|
|
17960
18006
|
"16:9": "16 / 9",
|
|
17961
18007
|
"4:3": "4 / 3",
|
|
17962
18008
|
"1:1": "1 / 1",
|
|
17963
18009
|
"9:16": "9 / 16"
|
|
17964
18010
|
};
|
|
17965
|
-
function
|
|
18011
|
+
function Jc(e) {
|
|
17966
18012
|
let t = e.trim();
|
|
17967
18013
|
if (!/^https?:\/\//i.test(t)) return null;
|
|
17968
18014
|
let n;
|
|
@@ -17988,12 +18034,12 @@ function Wc(e) {
|
|
|
17988
18034
|
src: t
|
|
17989
18035
|
} : null;
|
|
17990
18036
|
}
|
|
17991
|
-
function
|
|
17992
|
-
let n =
|
|
18037
|
+
function Yc(e, t) {
|
|
18038
|
+
let n = Uc(e), r = Jc(F(n.url, 2e3)), i = qc[n.ratio ?? "16:9"] ?? qc["16:9"], a = (e) => ({
|
|
17993
18039
|
...M("div", { class: "plx-el plx-video" }, e),
|
|
17994
18040
|
style: { "aspect-ratio": i }
|
|
17995
18041
|
});
|
|
17996
|
-
if (!r) return a(
|
|
18042
|
+
if (!r) return a(Wc("Paste a YouTube, Vimeo or video file link"));
|
|
17997
18043
|
if (r.kind === "file") {
|
|
17998
18044
|
let e = vt(n.poster);
|
|
17999
18045
|
return a(M("video", {
|
|
@@ -18018,8 +18064,8 @@ function Gc(e, t) {
|
|
|
18018
18064
|
referrerpolicy: "strict-origin-when-cross-origin"
|
|
18019
18065
|
}));
|
|
18020
18066
|
}
|
|
18021
|
-
function
|
|
18022
|
-
let t =
|
|
18067
|
+
function Xc(e) {
|
|
18068
|
+
let t = Uc(e), n = Et(t.links, 20).filter((e) => e && e.network in Xt), r = Tt(t.size, 20, 96, 40), i = t.shape === "square" || t.shape === "plain" ? t.shape : "circle", a = t.colorMode === "mono";
|
|
18023
18069
|
return n.length ? {
|
|
18024
18070
|
...M("nav", {
|
|
18025
18071
|
class: `plx-el plx-social plx-social--${i}`,
|
|
@@ -18049,11 +18095,11 @@ function Kc(e) {
|
|
|
18049
18095
|
};
|
|
18050
18096
|
})),
|
|
18051
18097
|
style: { "--plx-size": `${r}px` }
|
|
18052
|
-
} : M("div", { class: "plx-el plx-social" },
|
|
18098
|
+
} : M("div", { class: "plx-el plx-social" }, Wc("Add your social links"));
|
|
18053
18099
|
}
|
|
18054
|
-
function
|
|
18055
|
-
let t =
|
|
18056
|
-
if (!n.length) return M("nav", { class: "plx-el plx-menu" },
|
|
18100
|
+
function Zc(e) {
|
|
18101
|
+
let t = Uc(e), n = Et(t.links, 40);
|
|
18102
|
+
if (!n.length) return M("nav", { class: "plx-el plx-menu" }, Wc("Add menu links"));
|
|
18057
18103
|
let r = n.map((e) => M("li", null, M("a", { href: P(e.href) }, F(e.label, 120) || "Link"))), i = t.layout === "vertical", a = !i && (n.length > 4 || n.reduce((e, t) => e + F(t.label, 120).length, 0) > 36);
|
|
18058
18104
|
return M("nav", {
|
|
18059
18105
|
class: `plx-el plx-menu${i ? " plx-menu--vertical" : ""}${a ? " plx-menu--long" : ""}${t.mobile === "expanded" ? " plx-menu--expanded" : ""}`,
|
|
@@ -18069,19 +18115,19 @@ function qc(e) {
|
|
|
18069
18115
|
"stroke-linecap": "round"
|
|
18070
18116
|
}))), M("ul", null, r)));
|
|
18071
18117
|
}
|
|
18072
|
-
function
|
|
18073
|
-
let n =
|
|
18118
|
+
function Qc(e, t) {
|
|
18119
|
+
let n = Uc(e), r = F(n.code, 1e5);
|
|
18074
18120
|
return r.trim() ? M("div", { class: "plx-el plx-html" }, M("iframe", {
|
|
18075
18121
|
srcdoc: r,
|
|
18076
18122
|
sandbox: `allow-popups allow-popups-to-escape-sandbox allow-forms${t.allowEmbedScripts ? " allow-scripts" : ""}`,
|
|
18077
18123
|
title: F(n.title, 120) || "Embedded content",
|
|
18078
18124
|
loading: "lazy",
|
|
18079
18125
|
referrerpolicy: "no-referrer"
|
|
18080
|
-
})) : M("div", { class: "plx-el plx-html" },
|
|
18126
|
+
})) : M("div", { class: "plx-el plx-html" }, Wc("Paste your embed code in the settings"));
|
|
18081
18127
|
}
|
|
18082
|
-
function
|
|
18083
|
-
let t =
|
|
18084
|
-
if (!n.length) return M("div", { class: "plx-el plx-table-wrap" },
|
|
18128
|
+
function $c(e) {
|
|
18129
|
+
let t = Uc(e), n = Et(t.rows, 200).map((e) => Et(e, 30).map((e) => F(e, 500)));
|
|
18130
|
+
if (!n.length) return M("div", { class: "plx-el plx-table-wrap" }, Wc("Add rows to your table"));
|
|
18085
18131
|
let r = t.headerRow !== !1, i = Math.max(...n.map((e) => e.length)), a = (e) => Array.from({ length: i }, (t, n) => e[n] ?? "");
|
|
18086
18132
|
return M("div", {
|
|
18087
18133
|
class: "plx-el plx-table-wrap",
|
|
@@ -18090,8 +18136,8 @@ function Yc(e) {
|
|
|
18090
18136
|
"aria-label": "Table"
|
|
18091
18137
|
}, M("table", { class: `plx-table${t.striped === !1 ? "" : " plx-striped"}` }, r && M("thead", null, M("tr", null, a(n[0]).map((e) => M("th", { scope: "col" }, e)))), M("tbody", null, n.slice(+!!r).map((e) => M("tr", null, a(e).map((e) => M("td", null, e)))))));
|
|
18092
18138
|
}
|
|
18093
|
-
var
|
|
18094
|
-
function
|
|
18139
|
+
var el = (e) => String(Math.max(0, e)).padStart(2, "0");
|
|
18140
|
+
function tl(e, t) {
|
|
18095
18141
|
let n = Date.parse(e);
|
|
18096
18142
|
if (!Number.isFinite(n)) return {
|
|
18097
18143
|
done: !0,
|
|
@@ -18117,11 +18163,11 @@ function Zc(e, t) {
|
|
|
18117
18163
|
s: i % 60
|
|
18118
18164
|
};
|
|
18119
18165
|
}
|
|
18120
|
-
function
|
|
18121
|
-
let n =
|
|
18166
|
+
function nl(e, t) {
|
|
18167
|
+
let n = Uc(e), r = F(n.target, 40), i = tl(r, t.now), a = (e, t, r) => M("div", { class: "plx-unit" }, M("span", {
|
|
18122
18168
|
class: "plx-num",
|
|
18123
18169
|
"data-plx-unit": e
|
|
18124
|
-
},
|
|
18170
|
+
}, el(t)), n.showLabels !== !1 && M("span", { class: "plx-lbl" }, r));
|
|
18125
18171
|
return M("div", {
|
|
18126
18172
|
class: "plx-el plx-timer",
|
|
18127
18173
|
role: "timer",
|
|
@@ -18134,7 +18180,7 @@ function Qc(e, t) {
|
|
|
18134
18180
|
a("s", i.s, "Seconds")
|
|
18135
18181
|
]);
|
|
18136
18182
|
}
|
|
18137
|
-
function
|
|
18183
|
+
function rl(e, t) {
|
|
18138
18184
|
let n = wt(e.id, "field"), r = n, i = F(e.label, 200) || n, a = e.required ? !0 : void 0, o = F(e.placeholder, 200) || void 0, s = e.required ? M("span", {
|
|
18139
18185
|
class: "plx-req",
|
|
18140
18186
|
"aria-hidden": "true"
|
|
@@ -18162,24 +18208,24 @@ function $c(e, t) {
|
|
|
18162
18208
|
});
|
|
18163
18209
|
return M("label", { class: "plx-field" }, M("span", { class: "plx-label" }, i, s), c);
|
|
18164
18210
|
}
|
|
18165
|
-
function
|
|
18211
|
+
function il(e) {
|
|
18166
18212
|
let t = xt(e.buttonColor), n = xt(e.buttonTextColor) ?? (t && !t.startsWith("var(") ? Ha(t) ?? void 0 : void 0), r = St(e.buttonRadius), i = {};
|
|
18167
18213
|
return t && (i["--plx-btn-bg"] = t), n && (i["--plx-btn-fg"] = n), r && (i["--plx-btn-radius"] = r), Object.keys(i).length ? i : void 0;
|
|
18168
18214
|
}
|
|
18169
|
-
function
|
|
18170
|
-
let n =
|
|
18215
|
+
function al(e, t) {
|
|
18216
|
+
let n = Uc(e), r = Et(n.fields, 40);
|
|
18171
18217
|
return r.length ? M("form", {
|
|
18172
18218
|
class: "plx-el plx-form",
|
|
18173
18219
|
method: "post",
|
|
18174
18220
|
action: (n.action && P(n.action) !== "#" ? P(n.action) : "") || t.formAction?.(e.id) || void 0,
|
|
18175
18221
|
"data-plx-form": t.uid,
|
|
18176
18222
|
"data-plx-success": F(n.successMessage, 300) || "Thanks! We got your message."
|
|
18177
|
-
}, r.map((e) =>
|
|
18223
|
+
}, r.map((e) => rl(e, t.uid)), M("div", {
|
|
18178
18224
|
class: "plx-hp",
|
|
18179
18225
|
"aria-hidden": "true"
|
|
18180
18226
|
}, M("label", null, "Leave this field blank", M("input", {
|
|
18181
18227
|
type: "text",
|
|
18182
|
-
name:
|
|
18228
|
+
name: Hc,
|
|
18183
18229
|
tabindex: "-1",
|
|
18184
18230
|
autocomplete: "off"
|
|
18185
18231
|
}))), {
|
|
@@ -18187,11 +18233,11 @@ function tl(e, t) {
|
|
|
18187
18233
|
type: "submit",
|
|
18188
18234
|
class: "plx-submit"
|
|
18189
18235
|
}, F(n.submitLabel, 80) || "Submit"),
|
|
18190
|
-
...
|
|
18191
|
-
}) : M("div", { class: "plx-el plx-form" },
|
|
18236
|
+
...il(n) ? { style: il(n) } : {}
|
|
18237
|
+
}) : M("div", { class: "plx-el plx-form" }, Wc("Add a field to your form"));
|
|
18192
18238
|
}
|
|
18193
|
-
function
|
|
18194
|
-
let n =
|
|
18239
|
+
function ol(e, t) {
|
|
18240
|
+
let n = Uc(e), r = Et(n.items, 50);
|
|
18195
18241
|
return r.length ? M("div", { class: "plx-el plx-accordion" }, r.map((e, r) => M("details", {
|
|
18196
18242
|
...n.allowMultiple ? {} : { name: t.uid },
|
|
18197
18243
|
open: n.openFirst !== !1 && r === 0 || void 0
|
|
@@ -18206,30 +18252,30 @@ function nl(e, t) {
|
|
|
18206
18252
|
"stroke-width": 2.2,
|
|
18207
18253
|
"stroke-linecap": "round",
|
|
18208
18254
|
"stroke-linejoin": "round"
|
|
18209
|
-
}))), M("div", { class: "plx-body" }, F(e.content, 5e3).split(/\n{2,}/).map((e) => M("p", null, e)))))) : M("div", { class: "plx-el plx-accordion" },
|
|
18255
|
+
}))), M("div", { class: "plx-body" }, F(e.content, 5e3).split(/\n{2,}/).map((e) => M("p", null, e)))))) : M("div", { class: "plx-el plx-accordion" }, Wc("Add a question to start"));
|
|
18210
18256
|
}
|
|
18211
|
-
function
|
|
18257
|
+
function sl(e, t) {
|
|
18212
18258
|
if (Ot(e.type)) return Gt(e, t);
|
|
18213
18259
|
switch (e.type) {
|
|
18214
|
-
case "icon": return
|
|
18215
|
-
case "carousel": return
|
|
18216
|
-
case "video": return
|
|
18217
|
-
case "social": return
|
|
18218
|
-
case "menu": return
|
|
18219
|
-
case "html": return
|
|
18220
|
-
case "table": return
|
|
18221
|
-
case "timer": return
|
|
18222
|
-
case "form": return
|
|
18223
|
-
case "accordion": return
|
|
18260
|
+
case "icon": return Gc(e);
|
|
18261
|
+
case "carousel": return Kc(e, t);
|
|
18262
|
+
case "video": return Yc(e, t);
|
|
18263
|
+
case "social": return Xc(e);
|
|
18264
|
+
case "menu": return Zc(e);
|
|
18265
|
+
case "html": return Qc(e, t);
|
|
18266
|
+
case "table": return $c(e);
|
|
18267
|
+
case "timer": return nl(e, t);
|
|
18268
|
+
case "form": return al(e, t);
|
|
18269
|
+
case "accordion": return ol(e, t);
|
|
18224
18270
|
default: return null;
|
|
18225
18271
|
}
|
|
18226
18272
|
}
|
|
18227
18273
|
//#endregion
|
|
18228
18274
|
//#region src/v2/render/elementCss.ts
|
|
18229
|
-
var il = ".plx-el{box-sizing:border-box;width:100%;height:100%;min-width:0;color:inherit;font:inherit;text-align:left}\n.plx-el *,.plx-el *::before,.plx-el *::after{box-sizing:border-box}\n.plx-el ul,.plx-el ol{list-style:none!important;padding-left:0!important;margin:0}\n.plx-el li{display:block!important}\n.plx-empty{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:72px;padding:16px;border:1.5px dashed currentColor;border-radius:10px;opacity:.5;font-size:13px;text-align:center}\n.plx-ph{width:100%;height:100%;min-height:60px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.32))}\n\n.plx-icon{display:inline-flex;width:auto;height:auto;line-height:1;font-size:inherit}\n.plx-icon svg{display:block;width:1em;height:1em}\n\n.plx-carousel{position:relative;overflow:hidden;border-radius:inherit}\n.plx-track{display:flex;width:100%;height:100%;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none;-webkit-overflow-scrolling:touch}\n.plx-track::-webkit-scrollbar{display:none}\n.plx-slide{position:relative;flex:0 0 100%;height:100%;margin:0;scroll-snap-align:center;overflow:hidden}\n.plx-slide a{display:block;width:100%;height:100%;color:inherit;text-decoration:none}\n.plx-slide img{display:block;width:100%;height:100%;object-fit:cover;user-select:none}\n.plx-slide figcaption{position:absolute;left:0;right:0;bottom:0;padding:28px 20px 16px;color:#fff;font-size:15px;background:linear-gradient(transparent,rgba(0,0,0,.6))}\n.plx-arrow{display:none;position:absolute;top:50%;width:40px;height:40px;margin-top:-20px;align-items:center;justify-content:center;border-radius:999px;background:rgba(0,0,0,.45);color:#fff;text-decoration:none;backdrop-filter:blur(4px);transition:background .15s}\n[data-plx-ready] .plx-arrow{display:flex;align-items:center;justify-content:center}\n.plx-arrow:hover{background:rgba(0,0,0,.7)}\n.plx-arrow svg{width:20px;height:20px}\n.plx-prev{left:12px}.plx-next{right:12px}\n.plx-dots{position:absolute;left:0;right:0;bottom:12px;display:flex;justify-content:center;gap:8px;pointer-events:none}\n.plx-dots a{pointer-events:auto;width:9px;height:9px;border-radius:999px;background:rgba(255,255,255,.55);box-shadow:0 0 0 1px rgba(0,0,0,.2);transition:transform .15s,background .15s}\n.plx-dots a[aria-current=\"true\"]{background:#fff;transform:scale(1.25)}\n\n.plx-video{position:relative;width:100%;height:auto;overflow:hidden;border-radius:inherit;background:#000}\n.plx-video iframe,.plx-video video{position:absolute;inset:0;width:100%;height:100%;border:0;background:#000}\n.plx-video .plx-empty{position:absolute;inset:0;background:#111;color:#e5e7eb;opacity:1;border-color:rgba(255,255,255,.3)}\n\n.plx-social{display:flex;flex-wrap:wrap;align-items:center;gap:12px;width:auto;height:auto}\n.plx-social a{display:inline-flex;align-items:center;justify-content:center;width:var(--plx-size,40px);height:var(--plx-size,40px);color:inherit;text-decoration:none;transition:transform .15s,opacity .15s}\n.plx-social a:hover{transform:translateY(-2px);opacity:.85}\n.plx-social svg{width:52%;height:52%}\n.plx-social--circle a,.plx-social--square a{background:var(--plx-brand,currentColor);color:#fff}\n.plx-social--circle a{border-radius:999px}\n.plx-social--square a{border-radius:10px}\n.plx-social--plain a svg{width:70%;height:70%}\n\n.plx-menu{width:auto;height:auto}\n.plx-menu ul{display:flex;flex-wrap:wrap;gap:8px 28px;margin:0;padding:0;list-style:none}\n.plx-menu--vertical ul{flex-direction:column;gap:12px}\n.plx-menu a{color:inherit;text-decoration:none;font-weight:500}\n.plx-menu a:hover{text-decoration:underline;text-underline-offset:4px}\n.plx-menu-m{display:none;position:relative}\n.plx-menu-m summary{display:flex;width:40px;height:40px;align-items:center;justify-content:center;list-style:none;cursor:pointer;border-radius:8px}\n.plx-menu-m summary::-webkit-details-marker{display:none}\n.plx-menu-m summary svg{width:24px;height:24px}\n/* Fixed (not absolute) so the header's own clipping can't cut it off, and inset from both screen edges so it never runs off the side. */\n.plx-menu-m ul{position:fixed;z-index:50;left:12px;right:12px;top:auto;margin-top:6px;max-height:70vh;overflow-y:auto;flex-direction:column;gap:2px;padding:8px;border-radius:12px;background:#fff;color:#111;box-shadow:0 12px 32px rgba(0,0,0,.18)}\n.plx-menu-m li a{display:block;padding:10px 12px;border-radius:8px}\n.plx-menu-m li a:hover{background:rgba(0,0,0,.06);text-decoration:none}\n@container plx-page (max-width: 599px){\n .plx-menu:not(.plx-menu--expanded) .plx-menu-list{display:none}\n .plx-menu:not(.plx-menu--expanded) .plx-menu-m{display:block}\n}\n/* A long row of links doesn't fit beside a logo and button on a tablet, and wrapping onto a second row looks broken — so it folds into the menu button from tablet width. */\n@container plx-page (max-width: 1023px){\n .plx-menu--long:not(.plx-menu--expanded) .plx-menu-list{display:none}\n .plx-menu--long:not(.plx-menu--expanded) .plx-menu-m{display:block}\n}\n\n.plx-html{overflow:hidden;border-radius:inherit}\n.plx-html iframe{display:block;width:100%;height:100%;min-height:200px;border:0;background:transparent}\n\n.plx-table-wrap{width:100%;height:auto;overflow-x:auto;border-radius:inherit}\n.plx-table{width:100%;border-collapse:collapse;font-size:15px}\n.plx-table th,.plx-table td{padding:12px 16px;text-align:left;border-bottom:1px solid rgba(128,128,128,.28)}\n.plx-table th{font-weight:600;border-bottom:2px solid rgba(128,128,128,.5)}\n.plx-striped tbody tr:nth-child(even){background:rgba(128,128,128,.08)}\n\n.plx-timer{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;width:auto;height:auto}\n.plx-unit{display:flex;flex-direction:column;align-items:center;min-width:72px;padding:14px 12px;border-radius:12px;background:rgba(128,128,128,.14)}\n.plx-num{font-size:34px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}\n.plx-lbl{margin-top:6px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;opacity:.65}\n.plx-expired{font-size:18px;font-weight:600}\n\n.plx-form{display:flex;flex-direction:column;gap:14px;height:auto}\n.plx-field{display:flex;flex-direction:column;gap:6px}\n.plx-label,.plx-check{font-size:14px;font-weight:500}\n.plx-req{color:#e11d48}\n.plx-form input[type=text],.plx-form input[type=email],.plx-form input[type=tel],.plx-form textarea,.plx-form select{width:100%;padding:11px 13px;border:1px solid var(--color-border-default,rgba(128,128,128,.45));border-radius:var(--radius-lg,10px);background:var(--color-bg-surface,rgba(255,255,255,.92));color:var(--color-text-primary,#111);font:inherit;font-size:15px}\n.plx-form ::placeholder{color:var(--color-text-muted,#9ca3af);opacity:1}\n.plx-form textarea{resize:vertical;min-height:96px}\n.plx-form input:focus,.plx-form textarea:focus,.plx-form select:focus{outline:2px solid var(--plx-accent,#2563eb);outline-offset:1px}\n.plx-check{display:flex;align-items:center;gap:10px}\n.plx-check input{width:18px;height:18px}\n.plx-submit{align-self:flex-start;padding:12px 22px;border:0;border-radius:var(--plx-btn-radius,10px);background:var(--plx-btn-bg,var(--plx-accent,#111827));color:var(--plx-btn-fg,var(--plx-on-accent,#fff));font:inherit;font-weight:600;cursor:pointer;transition:opacity .15s}\n.plx-submit:hover{opacity:.9}\n.plx-submit:disabled{opacity:.6;cursor:default}\n.plx-hp{position:absolute;width:0;height:0;overflow:hidden;opacity:0;pointer-events:none}\n.plx-form-note{padding:12px 14px;border-radius:10px;background:rgba(34,197,94,.14);font-weight:500}\n.plx-form-note[data-error]{background:rgba(225,29,72,.14)}\n\n.plx-accordion{display:flex;flex-direction:column;gap:10px;height:auto}\n.plx-accordion details{border:1px solid rgba(128,128,128,.32);border-radius:12px;overflow:hidden}\n.plx-accordion summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px;list-style:none;cursor:pointer;font-weight:600}\n.plx-accordion summary::-webkit-details-marker{display:none}\n.plx-chev{flex:none;width:20px;height:20px;transition:transform .2s}\n.plx-accordion details[open] .plx-chev{transform:rotate(180deg)}\n.plx-body{padding:0 18px 16px;opacity:.85;line-height:1.6}\n.plx-body p+p{margin-top:.75em}\n.plx-dyn{display:flex;flex-direction:column;gap:12px;height:auto;min-height:72px;padding:18px;border:1.5px dashed rgba(128,128,128,.55);border-radius:12px;background:rgba(128,128,128,.07)}\n.plx-dyn-head{display:flex;align-items:center;gap:8px;font-size:14px}\n.plx-dyn-tag{padding:2px 8px;border-radius:999px;background:rgba(128,128,128,.22);font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase}\n.plx-dyn-note{font-size:12px;opacity:.65}\n.plx-dyn-body{display:flex;flex-direction:column;gap:10px}\n.plx-dyn-bar{display:block;height:10px;border-radius:999px;background:rgba(128,128,128,.28)}\n.plx-dyn-bar--thick{height:16px}\n.plx-dyn-img{display:block;width:100%;border-radius:8px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.34))}\n.plx-dyn-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:14px;align-items:center}\n.plx-dyn-row--tight{grid-template-columns:56px minmax(0,1fr)}\n.plx-dyn-stack{display:flex;flex-direction:column;gap:8px}\n.plx-dyn-grid{display:grid;gap:12px}\n.plx-dyn-card{display:flex;flex-direction:column;gap:8px}\n.plx-dyn-line{display:flex;justify-content:space-between;gap:12px}\n.plx-dyn-line .plx-dyn-bar{flex:0 1 40%}\n.plx-dyn-text{font-size:14px;opacity:.8}\n.plx-dyn-field{display:flex;flex-direction:column;gap:4px}\n.plx-dyn-lbl{font-size:12px;opacity:.7}\n.plx-dyn-input{display:block;height:36px;border:1px solid rgba(128,128,128,.4);border-radius:8px;background:rgba(128,128,128,.08)}\n.plx-dyn-btn{align-self:flex-start;padding:9px 18px;border-radius:8px;background:rgba(128,128,128,.4);font-size:13px;font-weight:600}\n.plx-dyn-chips{display:flex;flex-wrap:wrap;gap:8px}\n.plx-dyn-chip{padding:6px 12px;border:1px solid rgba(128,128,128,.45);border-radius:999px;font-size:12px}\n.plx-dyn-tick{display:flex;width:44px;height:44px;align-items:center;justify-content:center;border-radius:999px;background:rgba(34,197,94,.25);font-size:22px}";
|
|
18275
|
+
var cl = ".plx-el{box-sizing:border-box;width:100%;height:100%;min-width:0;color:inherit;font:inherit;text-align:left}\n.plx-el *,.plx-el *::before,.plx-el *::after{box-sizing:border-box}\n.plx-el ul,.plx-el ol{list-style:none!important;padding-left:0!important;margin:0}\n.plx-el li{display:block!important}\n.plx-empty{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:72px;padding:16px;border:1.5px dashed currentColor;border-radius:10px;opacity:.5;font-size:13px;text-align:center}\n.plx-ph{width:100%;height:100%;min-height:60px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.32))}\n\n.plx-icon{display:inline-flex;width:auto;height:auto;line-height:1;font-size:inherit}\n.plx-icon svg{display:block;width:1em;height:1em}\n\n.plx-carousel{position:relative;overflow:hidden;border-radius:inherit}\n.plx-track{display:flex;width:100%;height:100%;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none;-webkit-overflow-scrolling:touch}\n.plx-track::-webkit-scrollbar{display:none}\n.plx-slide{position:relative;flex:0 0 100%;height:100%;margin:0;scroll-snap-align:center;overflow:hidden}\n.plx-slide a{display:block;width:100%;height:100%;color:inherit;text-decoration:none}\n.plx-slide img{display:block;width:100%;height:100%;object-fit:cover;user-select:none}\n.plx-slide figcaption{position:absolute;left:0;right:0;bottom:0;padding:28px 20px 16px;color:#fff;font-size:15px;background:linear-gradient(transparent,rgba(0,0,0,.6))}\n.plx-arrow{display:none;position:absolute;top:50%;width:40px;height:40px;margin-top:-20px;align-items:center;justify-content:center;border-radius:999px;background:rgba(0,0,0,.45);color:#fff;text-decoration:none;backdrop-filter:blur(4px);transition:background .15s}\n[data-plx-ready] .plx-arrow{display:flex;align-items:center;justify-content:center}\n.plx-arrow:hover{background:rgba(0,0,0,.7)}\n.plx-arrow svg{width:20px;height:20px}\n.plx-prev{left:12px}.plx-next{right:12px}\n.plx-dots{position:absolute;left:0;right:0;bottom:12px;display:flex;justify-content:center;gap:8px;pointer-events:none}\n.plx-dots a{pointer-events:auto;width:9px;height:9px;border-radius:999px;background:rgba(255,255,255,.55);box-shadow:0 0 0 1px rgba(0,0,0,.2);transition:transform .15s,background .15s}\n.plx-dots a[aria-current=\"true\"]{background:#fff;transform:scale(1.25)}\n\n.plx-video{position:relative;width:100%;height:auto;overflow:hidden;border-radius:inherit;background:#000}\n.plx-video iframe,.plx-video video{position:absolute;inset:0;width:100%;height:100%;border:0;background:#000}\n.plx-video .plx-empty{position:absolute;inset:0;background:#111;color:#e5e7eb;opacity:1;border-color:rgba(255,255,255,.3)}\n\n.plx-social{display:flex;flex-wrap:wrap;align-items:center;gap:12px;width:auto;height:auto}\n.plx-social a{display:inline-flex;align-items:center;justify-content:center;width:var(--plx-size,40px);height:var(--plx-size,40px);color:inherit;text-decoration:none;transition:transform .15s,opacity .15s}\n.plx-social a:hover{transform:translateY(-2px);opacity:.85}\n.plx-social svg{width:52%;height:52%}\n.plx-social--circle a,.plx-social--square a{background:var(--plx-brand,currentColor);color:#fff}\n.plx-social--circle a{border-radius:999px}\n.plx-social--square a{border-radius:10px}\n.plx-social--plain a svg{width:70%;height:70%}\n\n.plx-menu{width:auto;height:auto}\n.plx-menu ul{display:flex;flex-wrap:wrap;gap:8px 28px;margin:0;padding:0;list-style:none}\n.plx-menu--vertical ul{flex-direction:column;gap:12px}\n.plx-menu a{color:inherit;text-decoration:none;font-weight:500}\n.plx-menu a:hover{text-decoration:underline;text-underline-offset:4px}\n.plx-menu-m{display:none;position:relative}\n.plx-menu-m summary{display:flex;width:40px;height:40px;align-items:center;justify-content:center;list-style:none;cursor:pointer;border-radius:8px}\n.plx-menu-m summary::-webkit-details-marker{display:none}\n.plx-menu-m summary svg{width:24px;height:24px}\n/* Fixed (not absolute) so the header's own clipping can't cut it off, and inset from both screen edges so it never runs off the side. */\n.plx-menu-m ul{position:fixed;z-index:50;left:12px;right:12px;top:auto;margin-top:6px;max-height:70vh;overflow-y:auto;flex-direction:column;gap:2px;padding:8px;border-radius:12px;background:#fff;color:#111;box-shadow:0 12px 32px rgba(0,0,0,.18)}\n.plx-menu-m li a{display:block;padding:10px 12px;border-radius:8px}\n.plx-menu-m li a:hover{background:rgba(0,0,0,.06);text-decoration:none}\n@container plx-page (max-width: 599px){\n .plx-menu:not(.plx-menu--expanded) .plx-menu-list{display:none}\n .plx-menu:not(.plx-menu--expanded) .plx-menu-m{display:block}\n}\n/* A long row of links doesn't fit beside a logo and button on a tablet, and wrapping onto a second row looks broken — so it folds into the menu button from tablet width. */\n@container plx-page (max-width: 1023px){\n .plx-menu--long:not(.plx-menu--expanded) .plx-menu-list{display:none}\n .plx-menu--long:not(.plx-menu--expanded) .plx-menu-m{display:block}\n}\n\n.plx-html{overflow:hidden;border-radius:inherit}\n.plx-html iframe{display:block;width:100%;height:100%;min-height:200px;border:0;background:transparent}\n\n.plx-table-wrap{width:100%;height:auto;overflow-x:auto;border-radius:inherit}\n.plx-table{width:100%;border-collapse:collapse;font-size:15px}\n.plx-table th,.plx-table td{padding:12px 16px;text-align:left;border-bottom:1px solid rgba(128,128,128,.28)}\n.plx-table th{font-weight:600;border-bottom:2px solid rgba(128,128,128,.5)}\n.plx-striped tbody tr:nth-child(even){background:rgba(128,128,128,.08)}\n\n.plx-timer{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;width:auto;height:auto}\n.plx-unit{display:flex;flex-direction:column;align-items:center;min-width:72px;padding:14px 12px;border-radius:12px;background:rgba(128,128,128,.14)}\n.plx-num{font-size:34px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}\n.plx-lbl{margin-top:6px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;opacity:.65}\n.plx-expired{font-size:18px;font-weight:600}\n\n.plx-form{display:flex;flex-direction:column;gap:14px;height:auto}\n.plx-field{display:flex;flex-direction:column;gap:6px}\n.plx-label,.plx-check{font-size:14px;font-weight:500}\n.plx-req{color:#e11d48}\n.plx-form input[type=text],.plx-form input[type=email],.plx-form input[type=tel],.plx-form textarea,.plx-form select{width:100%;padding:11px 13px;border:1px solid var(--color-border-default,rgba(128,128,128,.45));border-radius:var(--radius-lg,10px);background:var(--color-bg-surface,rgba(255,255,255,.92));color:var(--color-text-primary,#111);font:inherit;font-size:15px}\n.plx-form ::placeholder{color:var(--color-text-muted,#9ca3af);opacity:1}\n.plx-form textarea{resize:vertical;min-height:96px}\n.plx-form input:focus,.plx-form textarea:focus,.plx-form select:focus{outline:2px solid var(--plx-accent,#2563eb);outline-offset:1px}\n.plx-check{display:flex;align-items:center;gap:10px}\n.plx-check input{width:18px;height:18px}\n.plx-submit{align-self:flex-start;padding:12px 22px;border:0;border-radius:var(--plx-btn-radius,10px);background:var(--plx-btn-bg,var(--plx-accent,#111827));color:var(--plx-btn-fg,var(--plx-on-accent,#fff));font:inherit;font-weight:600;cursor:pointer;transition:opacity .15s}\n.plx-submit:hover{opacity:.9}\n.plx-submit:disabled{opacity:.6;cursor:default}\n.plx-hp{position:absolute;width:0;height:0;overflow:hidden;opacity:0;pointer-events:none}\n.plx-form-note{padding:12px 14px;border-radius:10px;background:rgba(34,197,94,.14);font-weight:500}\n.plx-form-note[data-error]{background:rgba(225,29,72,.14)}\n\n.plx-accordion{display:flex;flex-direction:column;gap:10px;height:auto}\n.plx-accordion details{border:1px solid rgba(128,128,128,.32);border-radius:12px;overflow:hidden}\n.plx-accordion summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px;list-style:none;cursor:pointer;font-weight:600}\n.plx-accordion summary::-webkit-details-marker{display:none}\n.plx-chev{flex:none;width:20px;height:20px;transition:transform .2s}\n.plx-accordion details[open] .plx-chev{transform:rotate(180deg)}\n.plx-body{padding:0 18px 16px;opacity:.85;line-height:1.6}\n.plx-body p+p{margin-top:.75em}\n.plx-dyn{display:flex;flex-direction:column;gap:12px;height:auto;min-height:72px;padding:18px;border:1.5px dashed rgba(128,128,128,.55);border-radius:12px;background:rgba(128,128,128,.07)}\n.plx-dyn-head{display:flex;align-items:center;gap:8px;font-size:14px}\n.plx-dyn-tag{padding:2px 8px;border-radius:999px;background:rgba(128,128,128,.22);font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase}\n.plx-dyn-note{font-size:12px;opacity:.65}\n.plx-dyn-body{display:flex;flex-direction:column;gap:10px}\n.plx-dyn-bar{display:block;height:10px;border-radius:999px;background:rgba(128,128,128,.28)}\n.plx-dyn-bar--thick{height:16px}\n.plx-dyn-img{display:block;width:100%;border-radius:8px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.34))}\n.plx-dyn-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:14px;align-items:center}\n.plx-dyn-row--tight{grid-template-columns:56px minmax(0,1fr)}\n.plx-dyn-stack{display:flex;flex-direction:column;gap:8px}\n.plx-dyn-grid{display:grid;gap:12px}\n.plx-dyn-card{display:flex;flex-direction:column;gap:8px}\n.plx-dyn-line{display:flex;justify-content:space-between;gap:12px}\n.plx-dyn-line .plx-dyn-bar{flex:0 1 40%}\n.plx-dyn-text{font-size:14px;opacity:.8}\n.plx-dyn-field{display:flex;flex-direction:column;gap:4px}\n.plx-dyn-lbl{font-size:12px;opacity:.7}\n.plx-dyn-input{display:block;height:36px;border:1px solid rgba(128,128,128,.4);border-radius:8px;background:rgba(128,128,128,.08)}\n.plx-dyn-btn{align-self:flex-start;padding:9px 18px;border-radius:8px;background:rgba(128,128,128,.4);font-size:13px;font-weight:600}\n.plx-dyn-chips{display:flex;flex-wrap:wrap;gap:8px}\n.plx-dyn-chip{padding:6px 12px;border:1px solid rgba(128,128,128,.45);border-radius:999px;font-size:12px}\n.plx-dyn-tick{display:flex;width:44px;height:44px;align-items:center;justify-content:center;border-radius:999px;background:rgba(34,197,94,.25);font-size:22px}";
|
|
18230
18276
|
//#endregion
|
|
18231
18277
|
//#region src/v2/render/formAction.ts
|
|
18232
|
-
function
|
|
18278
|
+
function ll(e, t, n) {
|
|
18233
18279
|
let r = e?.trim();
|
|
18234
18280
|
if (r) return {
|
|
18235
18281
|
kind: "custom",
|
|
@@ -18244,14 +18290,14 @@ function al(e, t, n) {
|
|
|
18244
18290
|
url: `/api/public/forms/${encodeURIComponent(n.templateId)}/submit?form=${encodeURIComponent(t)}`
|
|
18245
18291
|
} : { kind: "none" };
|
|
18246
18292
|
}
|
|
18247
|
-
var
|
|
18248
|
-
let n =
|
|
18293
|
+
var ul = (e) => (t) => {
|
|
18294
|
+
let n = ll(void 0, t, e);
|
|
18249
18295
|
return n.kind === "none" ? void 0 : n.url;
|
|
18250
|
-
},
|
|
18251
|
-
function
|
|
18296
|
+
}, dl = (e) => e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
18297
|
+
function fl(e) {
|
|
18252
18298
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
18253
18299
|
if (e.type === "section") {
|
|
18254
|
-
let r = wt((typeof e.props?.anchor == "string" ?
|
|
18300
|
+
let r = wt((typeof e.props?.anchor == "string" ? dl(e.props.anchor) : "") || dl(e.name || "") || "section", "section"), i = r;
|
|
18255
18301
|
for (let e = 2; n.has(i); e++) i = `${r}-${e}`;
|
|
18256
18302
|
n.add(i), t.set(e.id, i);
|
|
18257
18303
|
}
|
|
@@ -18261,23 +18307,23 @@ function cl(e) {
|
|
|
18261
18307
|
}
|
|
18262
18308
|
//#endregion
|
|
18263
18309
|
//#region src/v2/render/boxTags.ts
|
|
18264
|
-
var
|
|
18310
|
+
var pl = [
|
|
18265
18311
|
"header",
|
|
18266
18312
|
"nav",
|
|
18267
18313
|
"main",
|
|
18268
18314
|
"footer",
|
|
18269
18315
|
"aside",
|
|
18270
18316
|
"article"
|
|
18271
|
-
],
|
|
18317
|
+
], ml = {
|
|
18272
18318
|
section: [
|
|
18273
18319
|
"section",
|
|
18274
|
-
...
|
|
18320
|
+
...pl,
|
|
18275
18321
|
"div"
|
|
18276
18322
|
],
|
|
18277
18323
|
container: [
|
|
18278
18324
|
"div",
|
|
18279
18325
|
"section",
|
|
18280
|
-
...
|
|
18326
|
+
...pl
|
|
18281
18327
|
],
|
|
18282
18328
|
card: [
|
|
18283
18329
|
"div",
|
|
@@ -18288,52 +18334,52 @@ var ll = [
|
|
|
18288
18334
|
columns: [
|
|
18289
18335
|
"div",
|
|
18290
18336
|
"section",
|
|
18291
|
-
...
|
|
18337
|
+
...pl
|
|
18292
18338
|
],
|
|
18293
18339
|
column: [
|
|
18294
18340
|
"div",
|
|
18295
18341
|
"section",
|
|
18296
|
-
...
|
|
18342
|
+
...pl
|
|
18297
18343
|
]
|
|
18298
|
-
},
|
|
18344
|
+
}, hl = {
|
|
18299
18345
|
section: "section",
|
|
18300
18346
|
container: "div",
|
|
18301
18347
|
card: "div",
|
|
18302
18348
|
columns: "div",
|
|
18303
18349
|
column: "div"
|
|
18304
|
-
},
|
|
18305
|
-
function
|
|
18350
|
+
}, gl = null, _l = () => gl ??= ue(), vl = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
18351
|
+
function yl(e) {
|
|
18306
18352
|
if (!/^(?:repeating-)?(?:linear|radial|conic)-gradient\(/i.test(e) || e.length > 600 || !/^[A-Za-z0-9\s.,#%()\-+*/]+$/.test(e) || /url\s*\(|expression|javascript|image-set|\/\*/i.test(e)) return !1;
|
|
18307
18353
|
let t = 0;
|
|
18308
18354
|
for (let n of e) if (n === "(") t += 1;
|
|
18309
18355
|
else if (n === ")" && --t < 0) return !1;
|
|
18310
18356
|
return t === 0 && e.endsWith(")");
|
|
18311
18357
|
}
|
|
18312
|
-
function
|
|
18358
|
+
function bl(e, t) {
|
|
18313
18359
|
if (typeof t == "number") return Number.isFinite(t) ? String(t) : null;
|
|
18314
18360
|
let n = t.trim();
|
|
18315
|
-
return n ? e === "backgroundImage" ? n === "none" || /^url\("(?:[^"\\\n]|\\[0-9a-f]{1,6} )*"\)$/i.test(n) ||
|
|
18361
|
+
return n ? e === "backgroundImage" ? n === "none" || /^url\("(?:[^"\\\n]|\\[0-9a-f]{1,6} )*"\)$/i.test(n) || yl(n) ? n : null : /[;{}<>\\]|\/\*|@import|expression\s*\(|javascript:|behavior\s*:|-moz-binding|url\s*\(/i.test(n) ? null : n : null;
|
|
18316
18362
|
}
|
|
18317
|
-
function
|
|
18363
|
+
function xl(e) {
|
|
18318
18364
|
let t = [];
|
|
18319
18365
|
for (let [n, r] of Object.entries(e)) {
|
|
18320
18366
|
if (r === void 0) continue;
|
|
18321
|
-
let e =
|
|
18322
|
-
e !== null && t.push(`${
|
|
18367
|
+
let e = bl(n, r);
|
|
18368
|
+
e !== null && t.push(`${vl(n)}:${e}`);
|
|
18323
18369
|
}
|
|
18324
18370
|
return t.join(";");
|
|
18325
18371
|
}
|
|
18326
|
-
function
|
|
18372
|
+
function Sl(e, t) {
|
|
18327
18373
|
let n = {};
|
|
18328
18374
|
for (let r of Object.keys(t)) e[r] !== t[r] && (n[r] = t[r]);
|
|
18329
18375
|
for (let r of Object.keys(e)) r in t || (n[r] = r === "display" ? "revert" : "unset");
|
|
18330
18376
|
return n;
|
|
18331
18377
|
}
|
|
18332
|
-
var
|
|
18378
|
+
var Cl = (e) => {
|
|
18333
18379
|
let t = e?.split(",")[0]?.trim().replace(/^['"]|['"]$/g, "");
|
|
18334
18380
|
return t && x(t) ? t : null;
|
|
18335
18381
|
};
|
|
18336
|
-
function
|
|
18382
|
+
function wl(e, t) {
|
|
18337
18383
|
if (t && e.includes(t)) {
|
|
18338
18384
|
let [n, ...r] = e.split(t);
|
|
18339
18385
|
return [
|
|
@@ -18344,7 +18390,7 @@ function bl(e, t) {
|
|
|
18344
18390
|
}
|
|
18345
18391
|
return [e];
|
|
18346
18392
|
}
|
|
18347
|
-
function
|
|
18393
|
+
function Tl(e, t = {}) {
|
|
18348
18394
|
let n = Se(ba(e)), r = {
|
|
18349
18395
|
desktop: De(n.rootNode, "desktop"),
|
|
18350
18396
|
tablet: De(n.rootNode, "tablet"),
|
|
@@ -18353,7 +18399,7 @@ function xl(e, t = {}) {
|
|
|
18353
18399
|
apiKey: t.apiKey,
|
|
18354
18400
|
templateId: t.templateId,
|
|
18355
18401
|
formAction: t.formAction
|
|
18356
|
-
}, m =
|
|
18402
|
+
}, m = fl(n.rootNode), h = (e, n) => {
|
|
18357
18403
|
if (e.hidden) return null;
|
|
18358
18404
|
let l = e.type === "page", h = {
|
|
18359
18405
|
desktop: !0,
|
|
@@ -18368,14 +18414,14 @@ function xl(e, t = {}) {
|
|
|
18368
18414
|
_[t] = { display: "none" };
|
|
18369
18415
|
continue;
|
|
18370
18416
|
}
|
|
18371
|
-
let r = de(e, t), i =
|
|
18417
|
+
let r = de(e, t), i = Lc(e, r, {
|
|
18372
18418
|
viewport: t,
|
|
18373
18419
|
isGridChild: (n ? de(n, t).layoutMode : void 0) === "grid",
|
|
18374
18420
|
isRootPage: l,
|
|
18375
18421
|
forPublish: !0
|
|
18376
18422
|
}).css;
|
|
18377
18423
|
e.type === "section" && (i.overflow = "hidden"), e.props?.isFlowSpacer && (i.visibility = "hidden"), _[t] = i;
|
|
18378
|
-
let s =
|
|
18424
|
+
let s = Cl(r.fontFamily);
|
|
18379
18425
|
s && a.add(s);
|
|
18380
18426
|
let c = r.isBold ? 700 : Number(r.fontWeight);
|
|
18381
18427
|
Number.isInteger(c) && c >= 100 && c <= 900 && o.add(c);
|
|
@@ -18384,22 +18430,22 @@ function xl(e, t = {}) {
|
|
|
18384
18430
|
cls: g,
|
|
18385
18431
|
rule: _
|
|
18386
18432
|
});
|
|
18387
|
-
let y =
|
|
18433
|
+
let y = Pc(de(e, "desktop"));
|
|
18388
18434
|
y && u.push({
|
|
18389
18435
|
cls: g,
|
|
18390
18436
|
css: y
|
|
18391
18437
|
});
|
|
18392
18438
|
let b = [g, Ct(de(e, "desktop").customClasses)].filter(Boolean).join(" "), x = () => (e.children ?? []).map((t) => v(t, e)).filter((e) => e !== null);
|
|
18393
18439
|
if (qt(e.type)) {
|
|
18394
|
-
let n =
|
|
18440
|
+
let n = sl(e, {
|
|
18395
18441
|
uid: wt(e.id),
|
|
18396
18442
|
editing: !1,
|
|
18397
18443
|
allowEmbedScripts: t.allowEmbedScripts !== !1,
|
|
18398
|
-
formAction:
|
|
18444
|
+
formAction: ul(p),
|
|
18399
18445
|
now: f,
|
|
18400
18446
|
templateId: t.templateId
|
|
18401
18447
|
});
|
|
18402
|
-
return n ? ((e.type === "carousel" || e.type === "timer" || e.type === "form") && (c = !0), e.type === "form" &&
|
|
18448
|
+
return n ? ((e.type === "carousel" || e.type === "timer" || e.type === "form") && (c = !0), e.type === "form" && ll((e.props ?? {}).action, e.id, p).kind === "none" && s.push(`The form "${e.name}" has nowhere to send messages. Give it an address, or set one for the whole site.`), e.type === "signupForm" && !n.attrs?.["data-plexo-template-id"] && s.push(`The sign-up form "${e.name}" isn't connected to a funnel yet, so visitors can't sign up.`), {
|
|
18403
18449
|
...n,
|
|
18404
18450
|
attrs: {
|
|
18405
18451
|
...n.attrs,
|
|
@@ -18413,10 +18459,10 @@ function xl(e, t = {}) {
|
|
|
18413
18459
|
class: b,
|
|
18414
18460
|
id: m.get(e.id)
|
|
18415
18461
|
}, x());
|
|
18416
|
-
case "heading": return M(`h${Tt(e.props?.level, 1, 6, 2)}`, { class: b },
|
|
18417
|
-
case "paragraph": return M("p", { class: b },
|
|
18462
|
+
case "heading": return M(`h${Tt(e.props?.level, 1, 6, 2)}`, { class: b }, wl(e.content ?? "", e.props?.highlightText));
|
|
18463
|
+
case "paragraph": return M("p", { class: b }, wl(e.content ?? "", e.props?.highlightText));
|
|
18418
18464
|
case "button": {
|
|
18419
|
-
let t = e.props?.href ? P(e.props.href) : "", n =
|
|
18465
|
+
let t = e.props?.href ? P(e.props.href) : "", n = wl(e.content ?? "", e.props?.highlightText);
|
|
18420
18466
|
return t && t !== "#" ? M("a", {
|
|
18421
18467
|
class: `${b} plx-btn`,
|
|
18422
18468
|
href: t
|
|
@@ -18425,7 +18471,7 @@ function xl(e, t = {}) {
|
|
|
18425
18471
|
type: "button"
|
|
18426
18472
|
}, n);
|
|
18427
18473
|
}
|
|
18428
|
-
case "badge": return M("div", { class: b },
|
|
18474
|
+
case "badge": return M("div", { class: b }, wl(e.content ?? "", e.props?.highlightText));
|
|
18429
18475
|
case "image": {
|
|
18430
18476
|
let t = vt(e.props?.src);
|
|
18431
18477
|
return M("div", { class: `${b} plx-image` }, t ? {
|
|
@@ -18453,10 +18499,10 @@ function xl(e, t = {}) {
|
|
|
18453
18499
|
if (!n) return n;
|
|
18454
18500
|
let r = {}, i = typeof e.props?.ariaLabel == "string" ? e.props.ariaLabel.trim().slice(0, 200) : "";
|
|
18455
18501
|
i && (r["aria-label"] = i), e.props?.ariaHidden === !0 && (r["aria-hidden"] = "true");
|
|
18456
|
-
let a =
|
|
18502
|
+
let a = ml[e.type] && typeof e.props?.htmlTag == "string" && ml[e.type].includes(e.props.htmlTag) ? e.props.htmlTag : null, o = a ? {
|
|
18457
18503
|
...n,
|
|
18458
18504
|
tag: a
|
|
18459
|
-
} : n, s = e.type === "page" ? void 0 :
|
|
18505
|
+
} : n, s = e.type === "page" ? void 0 : Ic(de(e, "desktop"));
|
|
18460
18506
|
s && (c = !0, l = !0, r.class = `${o.attrs?.class ?? ""} plx-in plx-in-${s.kind}`.trim());
|
|
18461
18507
|
let u = Object.keys(r).length ? {
|
|
18462
18508
|
...o,
|
|
@@ -18468,7 +18514,7 @@ function xl(e, t = {}) {
|
|
|
18468
18514
|
...o.style,
|
|
18469
18515
|
"--plx-delay": `${s.delay}ms`
|
|
18470
18516
|
} } : {}
|
|
18471
|
-
} : o, d = e.type === "section" ? null :
|
|
18517
|
+
} : o, d = e.type === "section" ? null : vc(e.props?.htmlId);
|
|
18472
18518
|
if (!d) return u;
|
|
18473
18519
|
let f = d;
|
|
18474
18520
|
for (let e = 2; g.has(f); e++) f = `${d}-${e}`;
|
|
@@ -18485,7 +18531,7 @@ function xl(e, t = {}) {
|
|
|
18485
18531
|
for (let [n, i] of r[e]) i === "outside" && r.desktop.get(n) !== "outside" && (t += 1);
|
|
18486
18532
|
t && s.push(`On ${e}, ${t === 1 ? "1 element is" : `${t} elements are`} outside the screen and won't appear. Open the ${e} view and choose "Fit to this screen".`);
|
|
18487
18533
|
}
|
|
18488
|
-
let y = t.designSystem ? te(t.designSystem) :
|
|
18534
|
+
let y = t.designSystem ? te(t.designSystem) : _l(), x = v(n.rootNode, null) ?? M("div", { class: "plx-page" }), S = RegExp(`"type":"(${Kt.join("|")})"`).test(JSON.stringify(n.rootNode)), C = [
|
|
18489
18535
|
":where(.plx-page,.plx-page *,.plx-page *::before,.plx-page *::after){box-sizing:border-box}",
|
|
18490
18536
|
":where(.plx-page *){margin:0;padding:0;border:0 solid}",
|
|
18491
18537
|
".plx-page{position:relative;overflow-x:clip;container-type:inline-size;container-name:plx-page;-webkit-text-size-adjust:100%;font-family:var(--semantic-font-family-body, var(--font-family-sans))}",
|
|
@@ -18501,29 +18547,29 @@ function xl(e, t = {}) {
|
|
|
18501
18547
|
".plx-hl{color:#FBBF24;font-style:italic;font-family:serif;font-weight:400}",
|
|
18502
18548
|
".plx-ph{width:100%;height:100%;min-height:60px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.32))}"
|
|
18503
18549
|
];
|
|
18504
|
-
S && C.push(
|
|
18550
|
+
S && C.push(cl);
|
|
18505
18551
|
for (let { cls: e, rule: t } of i) {
|
|
18506
|
-
let n = t.desktop ?
|
|
18552
|
+
let n = t.desktop ? xl(t.desktop) : "";
|
|
18507
18553
|
n && C.push(`.${e}{${n}}`);
|
|
18508
18554
|
}
|
|
18509
|
-
u.length && C.push(`@media (hover:hover){${u.map((e) => `.${e.cls}:hover{${
|
|
18555
|
+
u.length && C.push(`@media (hover:hover){${u.map((e) => `.${e.cls}:hover{${xl(e.css)}}`).join("")}}`), l && C.push("@media (prefers-reduced-motion:no-preference){.plx-anim .plx-in{opacity:0;transition:opacity .6s ease-out var(--plx-delay,0ms),translate .6s ease-out var(--plx-delay,0ms),scale .6s ease-out var(--plx-delay,0ms)}.plx-anim .plx-in.plx-in-slide-up{translate:0 28px}.plx-anim .plx-in.plx-in-slide-left{translate:-36px 0}.plx-anim .plx-in.plx-in-slide-right{translate:36px 0}.plx-anim .plx-in.plx-in-zoom{scale:.92}.plx-anim .plx-in.plx-in-on{opacity:1;translate:none;scale:none}}");
|
|
18510
18556
|
for (let e of ["tablet", "mobile"]) {
|
|
18511
18557
|
let t = e === "tablet" ? "desktop" : "tablet", n = [];
|
|
18512
18558
|
for (let { cls: r, rule: a } of i) {
|
|
18513
|
-
let i =
|
|
18559
|
+
let i = xl(Sl(a[t] ?? {}, a[e] ?? {}));
|
|
18514
18560
|
i && n.push(`.${r}{${i}}`);
|
|
18515
18561
|
}
|
|
18516
18562
|
n.length && C.push(`@container plx-page ${pe[e]}{${n.join("")}}`);
|
|
18517
18563
|
}
|
|
18518
18564
|
let w = C.join("\n");
|
|
18519
|
-
for (let e of
|
|
18565
|
+
for (let e of Cs(y, w)) a.add(e);
|
|
18520
18566
|
let ee = [...a], T = new Set(ee.filter((e) => _(y.fonts, e)).map((e) => e.toLowerCase())), E = ae(y.fonts, T), D = b(ee.filter((e) => !T.has(e.toLowerCase())).map((e) => ({
|
|
18521
18567
|
family: e,
|
|
18522
18568
|
weights: [...o]
|
|
18523
18569
|
})));
|
|
18524
18570
|
return {
|
|
18525
18571
|
tree: x,
|
|
18526
|
-
css: `${E ? `${E}\n` : ""}${
|
|
18572
|
+
css: `${E ? `${E}\n` : ""}${ws(y, w)}\n${w}`,
|
|
18527
18573
|
usesRuntime: c,
|
|
18528
18574
|
fonts: ee,
|
|
18529
18575
|
fontLinks: D,
|
|
@@ -18532,7 +18578,7 @@ function xl(e, t = {}) {
|
|
|
18532
18578
|
}
|
|
18533
18579
|
//#endregion
|
|
18534
18580
|
//#region src/v2/compile/html.ts
|
|
18535
|
-
var
|
|
18581
|
+
var El = (e) => {
|
|
18536
18582
|
let t = "";
|
|
18537
18583
|
for (let [n, r] of Object.entries(e.attrs ?? {})) r === void 0 || r === !1 || (t += r === !0 ? ` ${n}` : ` ${n}="${N(String(r))}"`);
|
|
18538
18584
|
if (e.style) {
|
|
@@ -18541,13 +18587,13 @@ var Sl = (e) => {
|
|
|
18541
18587
|
}
|
|
18542
18588
|
return t;
|
|
18543
18589
|
};
|
|
18544
|
-
function
|
|
18590
|
+
function Dl(e) {
|
|
18545
18591
|
if (typeof e == "string") return ht(e);
|
|
18546
|
-
let t = `<${e.tag}${
|
|
18547
|
-
return ct.has(e.tag) ? t : `${t}${(e.children ?? []).map(
|
|
18592
|
+
let t = `<${e.tag}${El(e)}>`;
|
|
18593
|
+
return ct.has(e.tag) ? t : `${t}${(e.children ?? []).map(Dl).join("")}</${e.tag}>`;
|
|
18548
18594
|
}
|
|
18549
|
-
function
|
|
18550
|
-
let n =
|
|
18595
|
+
function Ol(e, t = {}) {
|
|
18596
|
+
let n = Tl(e, t), r = Dl(n.tree), i = t.runtime === "none" || !n.usesRuntime ? "" : `(${gc})(document);`.replace(/<\/script/gi, "<\\/script"), a = bc(t.customJs);
|
|
18551
18597
|
a.warning && n.warnings.push(a.warning);
|
|
18552
18598
|
let o = a.code ? `${i}${i ? "\n" : ""}${a.code}` : i, s = n.fontLinks.length ? `<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>${n.fontLinks.map((e) => `<link rel="stylesheet" href="${N(e)}">`).join("")}` : "", c = `<!doctype html>
|
|
18553
18599
|
<html lang="${N(t.lang ?? "en")}">
|
|
@@ -18573,14 +18619,14 @@ ${i ? `<script>${i}<\/script>\n` : ""}${a.code ? `<script>\n${a.code}\n<\/script
|
|
|
18573
18619
|
}
|
|
18574
18620
|
//#endregion
|
|
18575
18621
|
//#region src/v2/email/support.ts
|
|
18576
|
-
var
|
|
18622
|
+
var kl = /* @__PURE__ */ new Set([
|
|
18577
18623
|
"page",
|
|
18578
18624
|
"section",
|
|
18579
18625
|
"container",
|
|
18580
18626
|
"columns",
|
|
18581
18627
|
"column",
|
|
18582
18628
|
"card"
|
|
18583
|
-
]),
|
|
18629
|
+
]), Al = /* @__PURE__ */ new Set([
|
|
18584
18630
|
"heading",
|
|
18585
18631
|
"paragraph",
|
|
18586
18632
|
"button",
|
|
@@ -18588,18 +18634,18 @@ var Tl = /* @__PURE__ */ new Set([
|
|
|
18588
18634
|
"divider",
|
|
18589
18635
|
"spacer",
|
|
18590
18636
|
"badge"
|
|
18591
|
-
]),
|
|
18592
|
-
t(e, n), e.children?.forEach((n) =>
|
|
18637
|
+
]), jl = (e) => kl.has(e) || Al.has(e), Ml = 600, Nl = (e, t, n = null) => {
|
|
18638
|
+
t(e, n), e.children?.forEach((n) => Nl(n, t, e));
|
|
18593
18639
|
};
|
|
18594
|
-
function
|
|
18640
|
+
function Pl(e) {
|
|
18595
18641
|
let t = [];
|
|
18596
|
-
return
|
|
18642
|
+
return Nl(e.rootNode, (e) => {
|
|
18597
18643
|
let n = (n) => t.push({
|
|
18598
18644
|
nodeId: e.id,
|
|
18599
18645
|
name: e.name,
|
|
18600
18646
|
message: n
|
|
18601
18647
|
});
|
|
18602
|
-
if (!
|
|
18648
|
+
if (!jl(e.type)) {
|
|
18603
18649
|
n(`“${e.name}” is a ${e.type}, which email apps can't show, so it is left out.`);
|
|
18604
18650
|
return;
|
|
18605
18651
|
}
|
|
@@ -18609,7 +18655,7 @@ function Al(e) {
|
|
|
18609
18655
|
}
|
|
18610
18656
|
//#endregion
|
|
18611
18657
|
//#region src/v2/email/compile.ts
|
|
18612
|
-
var
|
|
18658
|
+
var Fl = (e) => {
|
|
18613
18659
|
let t = f(e);
|
|
18614
18660
|
return t && t.a > .05 ? [
|
|
18615
18661
|
t.r,
|
|
@@ -18617,7 +18663,7 @@ var jl = (e) => {
|
|
|
18617
18663
|
t.b
|
|
18618
18664
|
] : null;
|
|
18619
18665
|
};
|
|
18620
|
-
function
|
|
18666
|
+
function Il([e, t, n]) {
|
|
18621
18667
|
let r = e / 255, i = t / 255, a = n / 255, o = Math.max(r, i, a), s = Math.min(r, i, a), c = (o + s) / 2;
|
|
18622
18668
|
if (o === s) return [
|
|
18623
18669
|
0,
|
|
@@ -18631,7 +18677,7 @@ function Ml([e, t, n]) {
|
|
|
18631
18677
|
c
|
|
18632
18678
|
];
|
|
18633
18679
|
}
|
|
18634
|
-
var
|
|
18680
|
+
var Ll = (e, t, n) => {
|
|
18635
18681
|
let { r, g: i, b: a } = p(e, Math.max(0, Math.min(1, t)) * 100, Math.max(0, Math.min(1, n)) * 100);
|
|
18636
18682
|
return m({
|
|
18637
18683
|
r,
|
|
@@ -18640,14 +18686,14 @@ var Nl = (e, t, n) => {
|
|
|
18640
18686
|
a: 1
|
|
18641
18687
|
});
|
|
18642
18688
|
};
|
|
18643
|
-
function
|
|
18644
|
-
let n =
|
|
18689
|
+
function Rl(e, t) {
|
|
18690
|
+
let n = Fl(t);
|
|
18645
18691
|
if (!n) return null;
|
|
18646
|
-
let [r, i, a] =
|
|
18647
|
-
return e === "bg" ? a >= .55 ?
|
|
18692
|
+
let [r, i, a] = Il(n);
|
|
18693
|
+
return e === "bg" ? a >= .55 ? Ll(r, Math.min(i, .35) * .6, .045 + (a - .55) * .2) : null : e === "text" || e === "border" ? a >= .5 ? null : i > .25 ? Ll(r, Math.min(i, .7), Math.max(a, .64)) : e === "border" ? Ll(r, i, Math.max(a, .55)) : Ll(r, i * .8, Math.min(.93, .93 - a * .5)) : e === "btnbg" ? a < .2 && i < .25 ? Ll(r, i * .3, .92) : a < .34 ? Ll(r, i, .44) : null : e === "btntext" ? a > .8 ? Ll(r, Math.min(i, .3), .1) : null : a > .6 ? Ll(r, i * .5, .2 + (a - .6) * .15) : null;
|
|
18648
18694
|
}
|
|
18649
|
-
var
|
|
18650
|
-
function
|
|
18695
|
+
var zl = "Arial, Helvetica, sans-serif", W = (e) => `${Math.round(e * 100) / 100}px`;
|
|
18696
|
+
function Bl(e) {
|
|
18651
18697
|
if (typeof e == "number" && Number.isFinite(e)) return e;
|
|
18652
18698
|
if (typeof e != "string") return;
|
|
18653
18699
|
let t = /^\s*(-?\d+(?:\.\d+)?)\s*(px|rem|em)?\s*$/.exec(e);
|
|
@@ -18655,11 +18701,11 @@ function Il(e) {
|
|
|
18655
18701
|
let n = parseFloat(t[1]);
|
|
18656
18702
|
return t[2] === "rem" || t[2] === "em" ? n * 16 : n;
|
|
18657
18703
|
}
|
|
18658
|
-
var
|
|
18704
|
+
var Vl = (e) => {
|
|
18659
18705
|
let t = typeof e == "string" ? /^\s*(\d+(?:\.\d+)?)\s*%\s*$/.exec(e) : null;
|
|
18660
18706
|
return t ? parseFloat(t[1]) : void 0;
|
|
18661
18707
|
};
|
|
18662
|
-
function
|
|
18708
|
+
function Hl(e, t, n, r, i) {
|
|
18663
18709
|
let a = [
|
|
18664
18710
|
0,
|
|
18665
18711
|
0,
|
|
@@ -18667,7 +18713,7 @@ function Rl(e, t, n, r, i) {
|
|
|
18667
18713
|
0
|
|
18668
18714
|
];
|
|
18669
18715
|
if (typeof e == "string" || typeof e == "number") {
|
|
18670
|
-
let t = String(e).trim().split(/\s+/).map((e) =>
|
|
18716
|
+
let t = String(e).trim().split(/\s+/).map((e) => Bl(e) ?? 0);
|
|
18671
18717
|
t.length === 1 ? a = [
|
|
18672
18718
|
t[0],
|
|
18673
18719
|
t[0],
|
|
@@ -18690,7 +18736,7 @@ function Rl(e, t, n, r, i) {
|
|
|
18690
18736
|
n,
|
|
18691
18737
|
r,
|
|
18692
18738
|
i
|
|
18693
|
-
].map((e) =>
|
|
18739
|
+
].map((e) => Bl(e));
|
|
18694
18740
|
return [
|
|
18695
18741
|
o[0] ?? a[0],
|
|
18696
18742
|
o[1] ?? a[1],
|
|
@@ -18698,9 +18744,9 @@ function Rl(e, t, n, r, i) {
|
|
|
18698
18744
|
o[3] ?? a[3]
|
|
18699
18745
|
];
|
|
18700
18746
|
}
|
|
18701
|
-
function
|
|
18702
|
-
let n = Se(e), r = E(t.designSystem ? te(t.designSystem) : ue()), i = Math.min(800, Math.max(320, t.width ?? 600)), a =
|
|
18703
|
-
if (!n || t.dark === "off" || !
|
|
18747
|
+
function Ul(e, t = {}) {
|
|
18748
|
+
let n = Se(e), r = E(t.designSystem ? te(t.designSystem) : ue()), i = Math.min(800, Math.max(320, t.width ?? 600)), a = Pl(n).map((e) => e.message), o = [], s = /* @__PURE__ */ new Map(), c = (e, n) => {
|
|
18749
|
+
if (!n || t.dark === "off" || !Rl(e, n)) return "";
|
|
18704
18750
|
let r = `${e}:${n.toLowerCase()}`, i = s.get(r);
|
|
18705
18751
|
return i || (i = {
|
|
18706
18752
|
cls: `plx-${e[0]}${s.size}`,
|
|
@@ -18713,7 +18759,7 @@ function zl(e, t = {}) {
|
|
|
18713
18759
|
return /^var\(/.test(t) ? void 0 : bt(t);
|
|
18714
18760
|
}, d = (e) => {
|
|
18715
18761
|
try {
|
|
18716
|
-
return
|
|
18762
|
+
return as(e, {
|
|
18717
18763
|
width: i,
|
|
18718
18764
|
fontPx: 16,
|
|
18719
18765
|
tokens: r
|
|
@@ -18721,12 +18767,12 @@ function zl(e, t = {}) {
|
|
|
18721
18767
|
} catch {
|
|
18722
18768
|
return;
|
|
18723
18769
|
}
|
|
18724
|
-
}, f = (e) => typeof e == "string" ?
|
|
18770
|
+
}, f = (e) => typeof e == "string" ? Bl(e) ?? (/var\(|calc\(/.test(e) ? d(e) : void 0) : Bl(e), p = (() => {
|
|
18725
18771
|
let e = ie(r, "var(--semantic-font-family-body, var(--font-family-sans))");
|
|
18726
|
-
return e && !/^var\(/.test(e) ? e :
|
|
18772
|
+
return e && !/^var\(/.test(e) ? e : zl;
|
|
18727
18773
|
})(), m = /* @__PURE__ */ new Map(), h = (e) => {
|
|
18728
18774
|
let t = (typeof e == "string" ? ie(r, e.trim()) : "").split(",")[0]?.replace(/["']/g, "").trim();
|
|
18729
|
-
return !t || /^var\(/.test(t) || !/^[\w\s-]{1,60}$/.test(t) ? p.includes(",") ? p : `${p}, ${
|
|
18775
|
+
return !t || /^var\(/.test(t) || !/^[\w\s-]{1,60}$/.test(t) ? p.includes(",") ? p : `${p}, ${zl}` : (m.has(t) || m.set(t, /* @__PURE__ */ new Set()), `'${t}', ${/(serif|georgia|times|garamond|playfair|fraunces|lora|merriweather|cormorant|libre baskerville|dm serif|crimson|spectral|newsreader|source serif)/i.test(t) && !/sans/i.test(t) ? "Georgia, 'Times New Roman', serif" : zl}`);
|
|
18730
18776
|
}, g = (e, t) => {
|
|
18731
18777
|
let n = je(t.textStyle) ? t.textStyle : e.type === "heading" ? Ie(e.props?.level) : null;
|
|
18732
18778
|
return n ? Me(n) : null;
|
|
@@ -18738,7 +18784,7 @@ function zl(e, t = {}) {
|
|
|
18738
18784
|
lh: p,
|
|
18739
18785
|
family: _
|
|
18740
18786
|
};
|
|
18741
|
-
}, v = (e) => ht(e).replace(/\r?\n/g, "<br>"), y = (e) => e.replace(/\s+/g, " ").trim(), x = (e) =>
|
|
18787
|
+
}, v = (e) => ht(e).replace(/\r?\n/g, "<br>"), y = (e) => e.replace(/\s+/g, " ").trim(), x = (e) => Hl(e.padding, e.paddingTop, e.paddingRight, e.paddingBottom, e.paddingLeft), S = (e) => e === "center" ? "center" : e === "right" || e === "flex-end" ? "right" : e === "left" || e === "flex-start" ? "left" : void 0, C = (e) => {
|
|
18742
18788
|
let t = f(e.borderWidth), n = u(e.borderColor), r = e.borderStyle && e.borderStyle !== "none" ? e.borderStyle : void 0;
|
|
18743
18789
|
return t && n && r ? `border:${W(t)} ${r} ${n};` : "";
|
|
18744
18790
|
}, w = (e) => {
|
|
@@ -18757,7 +18803,7 @@ function zl(e, t = {}) {
|
|
|
18757
18803
|
return r.length >= 2 && r.length <= 5 ? `background-image:linear-gradient(${t[1]},${r.join(",")});` : "";
|
|
18758
18804
|
};
|
|
18759
18805
|
function D(e, n) {
|
|
18760
|
-
if (!
|
|
18806
|
+
if (!jl(e.type)) return "";
|
|
18761
18807
|
let r = e.styles ?? {};
|
|
18762
18808
|
if (r.display === "none") return "";
|
|
18763
18809
|
switch (e.type) {
|
|
@@ -18781,17 +18827,17 @@ function zl(e, t = {}) {
|
|
|
18781
18827
|
f || 28,
|
|
18782
18828
|
p || 14,
|
|
18783
18829
|
m || 28
|
|
18784
|
-
], ee = S(r.textAlign) ?? S(r.alignSelf) ?? "left", T = r.backgroundColor === "transparent", E = w(r) || "border-radius:8px;", te = C(r), D = `${T ? "" : `background-color:${a};`}${E}${te}`, O = T ? null :
|
|
18830
|
+
], ee = S(r.textAlign) ?? S(r.alignSelf) ?? "left", T = r.backgroundColor === "transparent", E = w(r) || "border-radius:8px;", te = C(r), D = `${T ? "" : `background-color:${a};`}${E}${te}`, O = T ? null : Rl("btnbg", a), ne = O ? Fl(O) : null, re = !!ne && Il(ne)[2] > .8 && !!Rl("btntext", s), ie = r.widthSizing === "fill" || r.width === "100%" || r.isFullWidth;
|
|
18785
18831
|
return `<table role="presentation" cellpadding="0" cellspacing="0" border="0"${ie ? " width=\"100%\"" : ""} align="${ee}"><tr><td${T ? "" : ` bgcolor="${a}"`}${l([T ? "" : c("btnbg", a), te && u(r.borderColor) ? c("border", u(r.borderColor)) : ""].filter(Boolean).join(" "))} align="center" style="${N(D)}"><a href="${N(i)}" target="_blank"${l(T ? c("text", u(r.textColor) ?? a) : re ? c("btntext", s) : "")} style="${N(`display:${ie ? "block" : "inline-block"};padding:${W(h)} ${W(g)} ${W(v)} ${W(b)};font-family:${t.family};font-size:${W(t.size)};line-height:${W(Math.round(t.size * 1.2))};font-weight:${t.weight === "400" ? "600" : t.weight};color:${T ? u(r.textColor) ?? a : s};text-decoration:none;white-space:nowrap;${E}`)}">${ht(n)}</a></td></tr></table>`;
|
|
18786
18832
|
}
|
|
18787
18833
|
case "image": {
|
|
18788
18834
|
let i = vt(e.props?.src);
|
|
18789
18835
|
if (!i) return "";
|
|
18790
|
-
let a = typeof e.props?.alt == "string" ? e.props.alt : "", o = f(r.customWidth ?? r.width), s =
|
|
18836
|
+
let a = typeof e.props?.alt == "string" ? e.props.alt : "", o = f(r.customWidth ?? r.width), s = Vl(r.customWidth ?? r.width), c = Math.round(Math.min(n, o ?? (s ? n * s / 100 : n))), l = S(r.alignSelf) ?? S(r.textAlign), u = `display:block;border:0;outline:none;text-decoration:none;width:${W(c)};max-width:100%;height:auto;${w(r)}`, d = t.dark === "off" ? "" : vt(e.props?.srcDark), p = d ? `<img class="plx-light" src="${N(i)}" alt="${N(a)}" width="${c}" style="${N(u)}"><img class="plx-dark" src="${N(d)}" alt="${N(a)}" width="${c}" style="${N(`${u}display:none;max-height:0;overflow:hidden;`)}">` : `<img src="${N(i)}" alt="${N(a)}" width="${c}" style="${N(u)}">`;
|
|
18791
18837
|
return l && l !== "left" ? `<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="${l}"><tr><td>${p}</td></tr></table>` : p;
|
|
18792
18838
|
}
|
|
18793
18839
|
case "divider": {
|
|
18794
|
-
let e = u(r.borderColor) ?? u("var(--color-border-default)") ?? "#e5e7eb", t = f(r.borderWidth?.toString().split(/\s+/).find((e) =>
|
|
18840
|
+
let e = u(r.borderColor) ?? u("var(--color-border-default)") ?? "#e5e7eb", t = f(r.borderWidth?.toString().split(/\s+/).find((e) => Bl(e))) ?? 1;
|
|
18795
18841
|
return `<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td height="${t}"${l(c("line", e))} style="font-size:1px;line-height:1px;border-top:${W(t)} solid ${e};"> </td></tr></table>`;
|
|
18796
18842
|
}
|
|
18797
18843
|
case "spacer": {
|
|
@@ -18802,10 +18848,10 @@ function zl(e, t = {}) {
|
|
|
18802
18848
|
}
|
|
18803
18849
|
}
|
|
18804
18850
|
function O(e, t, n = !1) {
|
|
18805
|
-
let r = e.styles ?? {}, i = (e.children ?? []).filter((e) =>
|
|
18851
|
+
let r = e.styles ?? {}, i = (e.children ?? []).filter((e) => jl(e.type) && (e.styles ?? {}).display !== "none"), [a, o, s, d] = x(r), p = u(r.backgroundColor), m = f(r.customWidth ?? r.width) ?? f(r.maxWidth), h = Math.max(40, Math.min(t, m ?? t)), g = h - d - o, _ = ee(r), v = e.type === "columns" || r.layoutMode !== "grid" && r.flexDirection === "row" && e.type !== "section" && e.type !== "page", y = S(r.alignItems), b = r.alignItems === "center" ? "middle" : r.alignItems === "flex-end" ? "bottom" : "top", E = "";
|
|
18806
18852
|
if (i.length) if (v) {
|
|
18807
18853
|
let e = i.map((e) => {
|
|
18808
|
-
let t = e.styles ?? {}, n = f(t.customWidth ?? t.width), r =
|
|
18854
|
+
let t = e.styles ?? {}, n = f(t.customWidth ?? t.width), r = Vl(t.customWidth ?? t.width);
|
|
18809
18855
|
return n === void 0 ? r !== void 0 && r < 99 ? g * r / 100 : void 0 : n;
|
|
18810
18856
|
}), t = e.reduce((e, t) => e + (t ?? 0), 0), n = e.filter((e) => e === void 0).length, c = n ? Math.max(40, (g - t - _ * (i.length - 1)) / n) : 0, l = i.map((t, n) => {
|
|
18811
18857
|
let a = Math.floor(e[n] ?? c), o = n === i.length - 1, s = D(t, a);
|
|
@@ -18815,15 +18861,15 @@ function zl(e, t = {}) {
|
|
|
18815
18861
|
} else E = i.map((e, t) => {
|
|
18816
18862
|
let n = e.styles ?? {}, r = S(n.alignSelf) ?? y ?? (e.type === "button" || e.type, void 0), c = r === "center" || n.marginLeft === "auto" && n.marginRight === "auto" || n.margin === "0 auto" ? " align=\"center\"" : r === "right" || n.marginLeft === "auto" ? " align=\"right\"" : "", l = D(e, g);
|
|
18817
18863
|
if (!l) return "";
|
|
18818
|
-
let u = t === 0 ? a : _, [f, , p] =
|
|
18864
|
+
let u = t === 0 ? a : _, [f, , p] = Hl(n.margin, n.marginTop, n.marginRight, n.marginBottom, n.marginLeft);
|
|
18819
18865
|
return `<tr><td${c} style="${N(`padding:${W(u + f)} ${W(o)} ${W(t === i.length - 1 ? s + p : p)} ${W(d)};`)}">${l}</td></tr>`;
|
|
18820
18866
|
}).join("");
|
|
18821
18867
|
else a + s > 0 && (E = `<tr><td height="${a + s}" style="font-size:1px;line-height:${W(a + s)};"> </td></tr>`);
|
|
18822
18868
|
let te = `${p ? `background-color:${p};` : ""}${T(r)}${w(r)}${C(r)}`, O = n ? " width=\"100%\"" : ` width="${Math.round(h)}"`, ne = n ? "" : `max-width:${W(h)};width:100%;`;
|
|
18823
18869
|
return `<table role="presentation"${O}${p ? ` bgcolor="${p}"` : ""}${l(c("bg", p))} cellpadding="0" cellspacing="0" border="0" style="${N(`${ne}${te}`)}">${E}</table>`;
|
|
18824
18870
|
}
|
|
18825
|
-
let ne = n.rootNode, re = u((ne.styles ?? {}).backgroundColor) ?? u("var(--color-bg-canvas)") ?? "#ffffff", ae = (ne.children ?? []).filter((e) =>
|
|
18826
|
-
let t = e.styles ?? {}, n = u(t.backgroundColor), r =
|
|
18871
|
+
let ne = n.rootNode, re = u((ne.styles ?? {}).backgroundColor) ?? u("var(--color-bg-canvas)") ?? "#ffffff", ae = (ne.children ?? []).filter((e) => jl(e.type)).map((e) => {
|
|
18872
|
+
let t = e.styles ?? {}, n = u(t.backgroundColor), r = kl.has(e.type) ? O(e, i) : D(e, i);
|
|
18827
18873
|
return r ? `<tr><td align="center"${n ? ` bgcolor="${n}"` : ""}${l(c("bg", n))} style="${N(`${n ? `background-color:${n};` : ""}${T(t)}`)}">${r}</td></tr>` : "";
|
|
18828
18874
|
}).join(""), oe = t.title ?? n.name, k = b([...m].map(([e, t]) => ({
|
|
18829
18875
|
family: e,
|
|
@@ -18833,7 +18879,7 @@ function zl(e, t = {}) {
|
|
|
18833
18879
|
700
|
|
18834
18880
|
]
|
|
18835
18881
|
}))).map((e) => `<link href="${N(e)}" rel="stylesheet">\n`).join(""), se = t.preheader ? `<div style="display:none;max-height:0;overflow:hidden;opacity:0;color:transparent;mso-hide:all;">${ht(t.preheader)}${" ‌".repeat(40)}</div>` : "", ce = c("bg", re), le = t.dark !== "off", de = (e) => {
|
|
18836
|
-
let t =
|
|
18882
|
+
let t = Rl(e.kind, e.color);
|
|
18837
18883
|
if (!t) return [];
|
|
18838
18884
|
let n = e.kind === "bg" || e.kind === "btnbg", r = n ? "background-color" : e.kind === "text" || e.kind === "btntext" ? "color" : e.kind === "border" ? "border-color" : "border-top-color", i = n ? "ogsb" : "ogsc";
|
|
18839
18885
|
return [`.${e.cls}{${r}:${t}!important}`, `[data-${i}] .${e.cls}{${r}:${t}!important}`];
|
|
@@ -18868,7 +18914,7 @@ ${se}<table role="presentation" width="100%" cellpadding="0" cellspacing="0" bor
|
|
|
18868
18914
|
}
|
|
18869
18915
|
//#endregion
|
|
18870
18916
|
//#region src/v2/email/blank.ts
|
|
18871
|
-
var
|
|
18917
|
+
var Wl = (e) => ({
|
|
18872
18918
|
id: k("page"),
|
|
18873
18919
|
type: "page",
|
|
18874
18920
|
name: "Email",
|
|
@@ -18882,22 +18928,22 @@ var Bl = (e) => ({
|
|
|
18882
18928
|
},
|
|
18883
18929
|
children: e
|
|
18884
18930
|
});
|
|
18885
|
-
function
|
|
18931
|
+
function Gl() {
|
|
18886
18932
|
return [{
|
|
18887
18933
|
id: k("page"),
|
|
18888
18934
|
name: "Email",
|
|
18889
18935
|
slug: "email",
|
|
18890
18936
|
isHome: !0,
|
|
18891
|
-
rootNode:
|
|
18937
|
+
rootNode: Wl([Ji(Fi("emailText", "plain"))])
|
|
18892
18938
|
}];
|
|
18893
18939
|
}
|
|
18894
|
-
function
|
|
18940
|
+
function Kl() {
|
|
18895
18941
|
return [{
|
|
18896
18942
|
id: k("page"),
|
|
18897
18943
|
name: "Email",
|
|
18898
18944
|
slug: "email",
|
|
18899
18945
|
isHome: !0,
|
|
18900
|
-
rootNode:
|
|
18946
|
+
rootNode: Wl([
|
|
18901
18947
|
["emailHeader", "centered"],
|
|
18902
18948
|
["emailHero", "centered"],
|
|
18903
18949
|
["emailFeatures", "columns"],
|
|
@@ -18908,48 +18954,48 @@ function Hl() {
|
|
|
18908
18954
|
}
|
|
18909
18955
|
//#endregion
|
|
18910
18956
|
//#region src/v2/migrate/legacy.ts
|
|
18911
|
-
var
|
|
18957
|
+
var ql = 1400, Jl = (e) => {
|
|
18912
18958
|
let t = e;
|
|
18913
18959
|
return !!t && typeof t == "object" && !!t.nodes && typeof t.nodes == "object" && !Array.isArray(t.nodes) && Array.isArray(t.pageOrder);
|
|
18914
|
-
},
|
|
18960
|
+
}, Yl = {
|
|
18915
18961
|
sm: "0 1px 3px rgba(15,23,42,0.14)",
|
|
18916
18962
|
md: "0 6px 16px rgba(15,23,42,0.18)",
|
|
18917
18963
|
lg: "0 16px 40px rgba(15,23,42,0.24)"
|
|
18918
|
-
}, G = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, K = (e) => typeof e == "string" && e ? e : void 0,
|
|
18964
|
+
}, G = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, K = (e) => typeof e == "string" && e ? e : void 0, Xl = (e) => `${Math.round(e * 100) / 100}px`, Zl = [
|
|
18919
18965
|
{
|
|
18920
18966
|
name: "desktop",
|
|
18921
|
-
k: fe.desktop /
|
|
18967
|
+
k: fe.desktop / ql,
|
|
18922
18968
|
minFont: 0
|
|
18923
18969
|
},
|
|
18924
18970
|
{
|
|
18925
18971
|
name: "tablet",
|
|
18926
|
-
k: fe.tablet /
|
|
18972
|
+
k: fe.tablet / ql,
|
|
18927
18973
|
minFont: 12
|
|
18928
18974
|
},
|
|
18929
18975
|
{
|
|
18930
18976
|
name: "mobile",
|
|
18931
|
-
k: fe.mobile /
|
|
18977
|
+
k: fe.mobile / ql,
|
|
18932
18978
|
minFont: 11
|
|
18933
18979
|
}
|
|
18934
18980
|
];
|
|
18935
|
-
function
|
|
18981
|
+
function Ql(e, t, n) {
|
|
18936
18982
|
let r = {};
|
|
18937
|
-
return n && (e.x !== void 0 && (r.x = Math.round(e.x * t.k)), e.y !== void 0 && (r.y = Math.round(e.y * t.k))), e.width !== void 0 && (r.width =
|
|
18983
|
+
return n && (e.x !== void 0 && (r.x = Math.round(e.x * t.k)), e.y !== void 0 && (r.y = Math.round(e.y * t.k))), e.width !== void 0 && (r.width = Xl(e.width * t.k), r.customWidth = r.width), e.height !== void 0 && (r.height = Xl(e.height * t.k)), e.minHeight !== void 0 && (r.minHeight = Xl(e.minHeight * t.k)), e.fontSize !== void 0 && (r.fontSize = Xl(Math.max(e.fontSize * t.k, t.minFont))), e.gap !== void 0 && (r.gap = Xl(e.gap * t.k)), r;
|
|
18938
18984
|
}
|
|
18939
|
-
function
|
|
18985
|
+
function $l(e, t) {
|
|
18940
18986
|
let { nodes: n } = e, r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
18941
18987
|
let t = {}, n = G(e.borderWidth);
|
|
18942
|
-
n && n > 0 && (t.borderWidth =
|
|
18988
|
+
n && n > 0 && (t.borderWidth = Xl(n), t.borderStyle = [
|
|
18943
18989
|
"solid",
|
|
18944
18990
|
"dashed",
|
|
18945
18991
|
"dotted"
|
|
18946
18992
|
].includes(String(e.borderStyle)) ? e.borderStyle : "solid", t.borderColor = K(e.borderColor) ?? "#0f172a");
|
|
18947
18993
|
let r = G(e.borderRadius);
|
|
18948
|
-
r !== void 0 && (t.borderRadius =
|
|
18949
|
-
let i =
|
|
18994
|
+
r !== void 0 && (t.borderRadius = Xl(r));
|
|
18995
|
+
let i = Yl[String(e.boxShadowPreset)];
|
|
18950
18996
|
return i && (t.boxShadow = i), t;
|
|
18951
18997
|
}, a = (e, t, n) => {
|
|
18952
|
-
let [r, i, a] =
|
|
18998
|
+
let [r, i, a] = Zl.map((n) => Ql(e, n, t)), o = (e, t) => Object.fromEntries(Object.entries(t).filter(([t, n]) => e[t] !== n));
|
|
18953
18999
|
return {
|
|
18954
19000
|
styles: {
|
|
18955
19001
|
...n,
|
|
@@ -19185,7 +19231,7 @@ function Yl(e, t) {
|
|
|
19185
19231
|
}
|
|
19186
19232
|
//#endregion
|
|
19187
19233
|
//#region src/v2/compile/sanitizeHtml.ts
|
|
19188
|
-
var
|
|
19234
|
+
var eu = new Map(Object.entries({
|
|
19189
19235
|
amp: "&",
|
|
19190
19236
|
lt: "<",
|
|
19191
19237
|
gt: ">",
|
|
@@ -19217,9 +19263,9 @@ var Xl = new Map(Object.entries({
|
|
|
19217
19263
|
hyphen: "-",
|
|
19218
19264
|
dash: "-"
|
|
19219
19265
|
}).map(([e, t]) => [e.toLowerCase(), t]));
|
|
19220
|
-
function
|
|
19266
|
+
function tu(e) {
|
|
19221
19267
|
return e.replace(/&(?:#[xX]([0-9a-fA-F]{1,8})|#(\d{1,10})|([A-Za-z][A-Za-z0-9]{1,31}));?/g, (e, t, n, r) => {
|
|
19222
|
-
if (r !== void 0) return
|
|
19268
|
+
if (r !== void 0) return eu.get(r.toLowerCase()) ?? e;
|
|
19223
19269
|
let i = t === void 0 ? parseInt(n, 10) : parseInt(t, 16);
|
|
19224
19270
|
if (!Number.isFinite(i) || i <= 0 || i > 1114111) return "�";
|
|
19225
19271
|
try {
|
|
@@ -19229,40 +19275,40 @@ function Zl(e) {
|
|
|
19229
19275
|
}
|
|
19230
19276
|
});
|
|
19231
19277
|
}
|
|
19232
|
-
var
|
|
19233
|
-
function
|
|
19234
|
-
let t = e.replace(
|
|
19235
|
-
return !t || /^(https?|mailto|tel|sms):/i.test(t) ||
|
|
19278
|
+
var nu = (e) => e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), ru = /[\u0000-\u0020\u007f-\u009f\u200b-\u200f\u2028\u2029\ufeff]/g, iu = (e) => /^(\/(?!\/)|\.{0,2}\/|#|\?)/.test(e) || !/^[a-z][a-z0-9+.-]*:/i.test(e) && !e.startsWith("//");
|
|
19279
|
+
function au(e) {
|
|
19280
|
+
let t = e.replace(ru, "");
|
|
19281
|
+
return !t || /^(https?|mailto|tel|sms):/i.test(t) || iu(t);
|
|
19236
19282
|
}
|
|
19237
|
-
var
|
|
19238
|
-
function
|
|
19239
|
-
let t = e.replace(
|
|
19240
|
-
return !t ||
|
|
19283
|
+
var ou = /^data:image\/(png|jpe?g|gif|webp|avif|svg\+xml)[;,]/i;
|
|
19284
|
+
function su(e) {
|
|
19285
|
+
let t = e.replace(ru, "");
|
|
19286
|
+
return !t || ou.test(t) || /^https?:\/\//i.test(t) || /^(\/(?!\/)|\.{0,2}\/)/.test(t) || !/^[a-z][a-z0-9+.-]*:/i.test(t) && !t.startsWith("//");
|
|
19241
19287
|
}
|
|
19242
|
-
var
|
|
19243
|
-
let t = e.replace(
|
|
19288
|
+
var cu = (e) => {
|
|
19289
|
+
let t = e.replace(ru, "");
|
|
19244
19290
|
return !t || /^https?:\/\//i.test(t) || /^(\/(?!\/)|\.{0,2}\/)/.test(t) || !/^[a-z][a-z0-9+.-]*:/i.test(t) && !t.startsWith("//");
|
|
19245
19291
|
};
|
|
19246
|
-
function
|
|
19292
|
+
function lu(e) {
|
|
19247
19293
|
let t;
|
|
19248
19294
|
try {
|
|
19249
|
-
t = new URL(e.replace(
|
|
19295
|
+
t = new URL(e.replace(ru, ""));
|
|
19250
19296
|
} catch {
|
|
19251
19297
|
return !1;
|
|
19252
19298
|
}
|
|
19253
19299
|
return t.protocol !== "https:" || t.username || t.password || t.port ? !1 : t.hostname === "www.youtube-nocookie.com" || t.hostname === "youtube-nocookie.com" ? /^\/embed\/[\w-]{6,20}\/?$/.test(t.pathname) : t.hostname === "player.vimeo.com" && /^\/video\/\d{6,}\/?$/.test(t.pathname);
|
|
19254
19300
|
}
|
|
19255
|
-
function
|
|
19301
|
+
function uu(e) {
|
|
19256
19302
|
return e.replace(/\/\*[\s\S]*?(?:\*\/|$)/g, "").replace(/\\([0-9a-fA-F]{1,6})[ \t\n\r\f]?/g, (e, t) => {
|
|
19257
19303
|
let n = parseInt(t, 16);
|
|
19258
19304
|
return n > 0 && n <= 1114111 ? String.fromCodePoint(n) : "�";
|
|
19259
19305
|
}).replace(/\\([\s\S])/g, "$1").toLowerCase();
|
|
19260
19306
|
}
|
|
19261
|
-
var
|
|
19262
|
-
function
|
|
19263
|
-
let n = e.replace(
|
|
19307
|
+
var du = /^data:(?:font\/(?:woff2?|ttf|otf|sfnt)|application\/(?:font-woff2?|x-font-(?:woff2?|ttf|otf|truetype|opentype)|octet-stream));base64,[a-z0-9+/=]+$/i;
|
|
19308
|
+
function fu(e, t) {
|
|
19309
|
+
let n = e.replace(ru, "");
|
|
19264
19310
|
if (!n) return !1;
|
|
19265
|
-
if (
|
|
19311
|
+
if (du.test(n)) return !0;
|
|
19266
19312
|
if (/^https:\/\//i.test(n)) {
|
|
19267
19313
|
let e;
|
|
19268
19314
|
try {
|
|
@@ -19274,19 +19320,19 @@ function cu(e, t) {
|
|
|
19274
19320
|
}
|
|
19275
19321
|
return /^\/(?!\/)/.test(n);
|
|
19276
19322
|
}
|
|
19277
|
-
function
|
|
19323
|
+
function pu(e, t) {
|
|
19278
19324
|
let n = /url\(\s*(?:"([^"]*)"|'([^']*)'|([^)]*))\s*\)/g, r;
|
|
19279
19325
|
for (; r = n.exec(e);) {
|
|
19280
19326
|
let e = (r[1] ?? r[2] ?? r[3] ?? "").trim();
|
|
19281
|
-
if (!e.startsWith("#") && (t ? !
|
|
19327
|
+
if (!e.startsWith("#") && (t ? !fu(e, t.fontOrigins) : !su(e))) return !1;
|
|
19282
19328
|
}
|
|
19283
19329
|
return (e.match(/url\(/g) ?? []).length === (e.match(n) ?? []).length;
|
|
19284
19330
|
}
|
|
19285
|
-
function
|
|
19286
|
-
let n =
|
|
19287
|
-
return !/expression\s*\(|javascript:|vbscript:|livescript:|(?:^|[^a-z-])behavior\s*:|-moz-binding|@import|image-set\s*\(|\bsrc\s*\(|<\/?script|<!--/.test(n) &&
|
|
19331
|
+
function mu(e, t) {
|
|
19332
|
+
let n = uu(e).replace(/\s+/g, " ");
|
|
19333
|
+
return !/expression\s*\(|javascript:|vbscript:|livescript:|(?:^|[^a-z-])behavior\s*:|-moz-binding|@import|image-set\s*\(|\bsrc\s*\(|<\/?script|<!--/.test(n) && pu(n, t);
|
|
19288
19334
|
}
|
|
19289
|
-
var
|
|
19335
|
+
var hu = (e, t) => !e.trim().startsWith("@") && e.includes(":") && !e.includes("<") && mu(e, t), gu = /* @__PURE__ */ new Set([
|
|
19290
19336
|
"media",
|
|
19291
19337
|
"container",
|
|
19292
19338
|
"supports",
|
|
@@ -19297,7 +19343,7 @@ var du = (e, t) => !e.trim().startsWith("@") && e.includes(":") && !e.includes("
|
|
|
19297
19343
|
"page",
|
|
19298
19344
|
"property"
|
|
19299
19345
|
]);
|
|
19300
|
-
function
|
|
19346
|
+
function _u(e, t = {}) {
|
|
19301
19347
|
let n = (t.fontOrigins ?? []).map((e) => e.trim().replace(/\/+$/, "").toLowerCase()), r = 0, i = e.length, a = (t) => {
|
|
19302
19348
|
let n = e[t];
|
|
19303
19349
|
if (n === "\"" || n === "'") {
|
|
@@ -19338,22 +19384,22 @@ function pu(e, t = {}) {
|
|
|
19338
19384
|
r += 1;
|
|
19339
19385
|
}
|
|
19340
19386
|
let f = e.slice(l, Math.min(r, i));
|
|
19341
|
-
if (d === ";") r += 1,
|
|
19387
|
+
if (d === ";") r += 1, hu(f, s) ? c += `${f};` : /^\s*$/.test(f) && (c += f + ";");
|
|
19342
19388
|
else if (d === "{") {
|
|
19343
19389
|
r += 1;
|
|
19344
|
-
let t =
|
|
19390
|
+
let t = uu(f).trim(), i = r, a = o(!0, /^@font-face\b/.test(t) ? { fontOrigins: n } : void 0), s = e.slice(i, r).trim() !== "";
|
|
19345
19391
|
if (e[r] === "}" && (r += 1), s && a.trim() === "") continue;
|
|
19346
19392
|
if (t.startsWith("@")) {
|
|
19347
19393
|
let e = /^@([a-z-]+)/.exec(t)?.[1] ?? "";
|
|
19348
|
-
|
|
19349
|
-
} else
|
|
19350
|
-
} else (/^\s*$/.test(f) ||
|
|
19394
|
+
gu.has(e) && mu(f) && (c += `${f}{${a}}`);
|
|
19395
|
+
} else mu(f) && !/[<]/.test(f) && (c += `${f}{${a}}`);
|
|
19396
|
+
} else (/^\s*$/.test(f) || hu(f, s)) && (c += f);
|
|
19351
19397
|
}
|
|
19352
19398
|
return c;
|
|
19353
19399
|
};
|
|
19354
19400
|
return o(!1);
|
|
19355
19401
|
}
|
|
19356
|
-
var
|
|
19402
|
+
var vu = /* @__PURE__ */ new Set([
|
|
19357
19403
|
"script",
|
|
19358
19404
|
"style",
|
|
19359
19405
|
"textarea",
|
|
@@ -19364,8 +19410,8 @@ var mu = /* @__PURE__ */ new Set([
|
|
|
19364
19410
|
"noframes",
|
|
19365
19411
|
"noscript",
|
|
19366
19412
|
"plaintext"
|
|
19367
|
-
]),
|
|
19368
|
-
function
|
|
19413
|
+
]), yu = (e, t) => Object.prototype.hasOwnProperty.call(e, t), bu = (e) => e === " " || e === " " || e === "\n" || e === "\r" || e === "\f", xu = (e) => !!e && /[A-Za-z]/.test(e);
|
|
19414
|
+
function Su(e) {
|
|
19369
19415
|
let t = [], n = e.length, r = 0, i = "", a = () => {
|
|
19370
19416
|
i &&= (t.push({
|
|
19371
19417
|
k: "text",
|
|
@@ -19397,10 +19443,10 @@ function vu(e) {
|
|
|
19397
19443
|
continue;
|
|
19398
19444
|
}
|
|
19399
19445
|
if (o === "/") {
|
|
19400
|
-
if (
|
|
19446
|
+
if (xu(e[r + 2])) {
|
|
19401
19447
|
a();
|
|
19402
19448
|
let i = r + 2;
|
|
19403
|
-
for (; i < n && !
|
|
19449
|
+
for (; i < n && !bu(e[i]) && e[i] !== "/" && e[i] !== ">";) i += 1;
|
|
19404
19450
|
let o = e.slice(r + 2, i).toLowerCase(), s = e.indexOf(">", i);
|
|
19405
19451
|
t.push({
|
|
19406
19452
|
k: "end",
|
|
@@ -19413,27 +19459,27 @@ function vu(e) {
|
|
|
19413
19459
|
}
|
|
19414
19460
|
continue;
|
|
19415
19461
|
}
|
|
19416
|
-
if (!
|
|
19462
|
+
if (!xu(o)) {
|
|
19417
19463
|
i += "<", r += 1;
|
|
19418
19464
|
continue;
|
|
19419
19465
|
}
|
|
19420
19466
|
let s = r + 1;
|
|
19421
|
-
for (; s < n && !
|
|
19467
|
+
for (; s < n && !bu(e[s]) && e[s] !== "/" && e[s] !== ">";) s += 1;
|
|
19422
19468
|
let c = e.slice(r + 1, s).toLowerCase(), l = [], u = !1, d = !1;
|
|
19423
19469
|
for (; s < n;) {
|
|
19424
|
-
for (; s < n && (
|
|
19470
|
+
for (; s < n && (bu(e[s]) || e[s] === "/");) e[s] === "/" && e[s + 1] === ">" && (u = !0), s += 1;
|
|
19425
19471
|
if (e[s] === ">") {
|
|
19426
19472
|
d = !0, s += 1;
|
|
19427
19473
|
break;
|
|
19428
19474
|
}
|
|
19429
19475
|
if (s >= n) break;
|
|
19430
19476
|
let t = s;
|
|
19431
|
-
for (s += 1; s < n && !
|
|
19477
|
+
for (s += 1; s < n && !bu(e[s]) && e[s] !== "/" && e[s] !== ">" && e[s] !== "=";) s += 1;
|
|
19432
19478
|
let r = e.slice(t, s).toLowerCase();
|
|
19433
|
-
for (; s < n &&
|
|
19479
|
+
for (; s < n && bu(e[s]);) s += 1;
|
|
19434
19480
|
let i = null;
|
|
19435
19481
|
if (e[s] === "=") {
|
|
19436
|
-
for (s += 1; s < n &&
|
|
19482
|
+
for (s += 1; s < n && bu(e[s]);) s += 1;
|
|
19437
19483
|
let t = e[s];
|
|
19438
19484
|
if (t === "\"" || t === "'") {
|
|
19439
19485
|
let r = e.indexOf(t, s + 1);
|
|
@@ -19444,7 +19490,7 @@ function vu(e) {
|
|
|
19444
19490
|
i = e.slice(s + 1, r), s = r + 1;
|
|
19445
19491
|
} else {
|
|
19446
19492
|
let t = s;
|
|
19447
|
-
for (; s < n && !
|
|
19493
|
+
for (; s < n && !bu(e[s]) && e[s] !== ">";) s += 1;
|
|
19448
19494
|
i = e.slice(t, s);
|
|
19449
19495
|
}
|
|
19450
19496
|
}
|
|
@@ -19458,7 +19504,7 @@ function vu(e) {
|
|
|
19458
19504
|
r = n;
|
|
19459
19505
|
break;
|
|
19460
19506
|
}
|
|
19461
|
-
if (r = s,
|
|
19507
|
+
if (r = s, vu.has(c)) {
|
|
19462
19508
|
if (c === "plaintext") {
|
|
19463
19509
|
t.push({
|
|
19464
19510
|
k: "raw",
|
|
@@ -19490,7 +19536,7 @@ function vu(e) {
|
|
|
19490
19536
|
}
|
|
19491
19537
|
return a(), t;
|
|
19492
19538
|
}
|
|
19493
|
-
var
|
|
19539
|
+
var Cu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.section.article.aside.header.footer.main.nav.h1.h2.h3.h4.h5.h6.p.a.button.img.hr.br.wbr.ul.ol.li.figure.figcaption.details.summary.table.thead.tbody.tfoot.tr.th.td.caption.colgroup.col.form.label.input.textarea.select.option.optgroup.fieldset.legend.video.strong.em.b.i.u.s.small.sub.sup.code.pre.blockquote.mark.abbr.time.dl.dt.dd.address.cite.q.span".split(".")), wu = /* @__PURE__ */ new Set([
|
|
19494
19540
|
"img",
|
|
19495
19541
|
"hr",
|
|
19496
19542
|
"br",
|
|
@@ -19499,7 +19545,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
19499
19545
|
"col",
|
|
19500
19546
|
"meta",
|
|
19501
19547
|
"link"
|
|
19502
|
-
]),
|
|
19548
|
+
]), Tu = /* @__PURE__ */ new Set([
|
|
19503
19549
|
"svg",
|
|
19504
19550
|
"g",
|
|
19505
19551
|
"path",
|
|
@@ -19509,7 +19555,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
19509
19555
|
"polyline",
|
|
19510
19556
|
"polygon",
|
|
19511
19557
|
"ellipse"
|
|
19512
|
-
]),
|
|
19558
|
+
]), Eu = /* @__PURE__ */ new Set([
|
|
19513
19559
|
"open",
|
|
19514
19560
|
"required",
|
|
19515
19561
|
"disabled",
|
|
@@ -19525,7 +19571,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
19525
19571
|
"allowfullscreen",
|
|
19526
19572
|
"hidden",
|
|
19527
19573
|
"novalidate"
|
|
19528
|
-
]),
|
|
19574
|
+
]), Du = {
|
|
19529
19575
|
id: /^[\w:.[\]-]{1,200}$/,
|
|
19530
19576
|
role: /^[a-z-]{1,30}$/,
|
|
19531
19577
|
tabindex: /^-?\d{1,3}$/,
|
|
@@ -19533,11 +19579,11 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
19533
19579
|
dir: /^(ltr|rtl|auto)$/i,
|
|
19534
19580
|
draggable: /^(true|false)$/,
|
|
19535
19581
|
translate: /^(yes|no)$/
|
|
19536
|
-
},
|
|
19582
|
+
}, Ou = /* @__PURE__ */ new Set([
|
|
19537
19583
|
"class",
|
|
19538
19584
|
"title",
|
|
19539
19585
|
"hidden"
|
|
19540
|
-
]), q = /^\d{1,5}(?:\.\d+)?(?:px|%|em|rem)?$/,
|
|
19586
|
+
]), q = /^\d{1,5}(?:\.\d+)?(?:px|%|em|rem)?$/, ku = /^[\w:.[\]-]{1,200}$/, Au = /* @__PURE__ */ new Set([
|
|
19541
19587
|
"text",
|
|
19542
19588
|
"email",
|
|
19543
19589
|
"tel",
|
|
@@ -19556,7 +19602,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
19556
19602
|
"file",
|
|
19557
19603
|
"color",
|
|
19558
19604
|
"range"
|
|
19559
|
-
]),
|
|
19605
|
+
]), ju = /^(#[0-9a-f]{3,8}|[a-z]{3,20}|rgba?\(\s*[\d.\s,%]+\))$/i, Mu = {
|
|
19560
19606
|
a: {
|
|
19561
19607
|
href: "href",
|
|
19562
19608
|
target: /^(_blank|_self)$/,
|
|
@@ -19585,7 +19631,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
19585
19631
|
button: {
|
|
19586
19632
|
type: /^(submit|button|reset)$/,
|
|
19587
19633
|
disabled: "bool",
|
|
19588
|
-
name:
|
|
19634
|
+
name: ku,
|
|
19589
19635
|
value: "plain"
|
|
19590
19636
|
},
|
|
19591
19637
|
form: {
|
|
@@ -19596,7 +19642,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
19596
19642
|
enctype: /^(application\/x-www-form-urlencoded|multipart\/form-data|text\/plain)$/
|
|
19597
19643
|
},
|
|
19598
19644
|
input: {
|
|
19599
|
-
name:
|
|
19645
|
+
name: ku,
|
|
19600
19646
|
value: "plain",
|
|
19601
19647
|
placeholder: "plain",
|
|
19602
19648
|
required: "bool",
|
|
@@ -19614,7 +19660,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
19614
19660
|
size: /^\d{1,3}$/
|
|
19615
19661
|
},
|
|
19616
19662
|
textarea: {
|
|
19617
|
-
name:
|
|
19663
|
+
name: ku,
|
|
19618
19664
|
rows: /^\d{1,3}$/,
|
|
19619
19665
|
cols: /^\d{1,3}$/,
|
|
19620
19666
|
placeholder: "plain",
|
|
@@ -19626,7 +19672,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
19626
19672
|
autocomplete: /^[\w\s-]{1,60}$/
|
|
19627
19673
|
},
|
|
19628
19674
|
select: {
|
|
19629
|
-
name:
|
|
19675
|
+
name: ku,
|
|
19630
19676
|
required: "bool",
|
|
19631
19677
|
multiple: "bool",
|
|
19632
19678
|
disabled: "bool",
|
|
@@ -19642,10 +19688,10 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
19642
19688
|
label: "plain",
|
|
19643
19689
|
disabled: "bool"
|
|
19644
19690
|
},
|
|
19645
|
-
label: { for:
|
|
19691
|
+
label: { for: ku },
|
|
19646
19692
|
details: {
|
|
19647
19693
|
open: "bool",
|
|
19648
|
-
name:
|
|
19694
|
+
name: ku
|
|
19649
19695
|
},
|
|
19650
19696
|
table: {
|
|
19651
19697
|
width: q,
|
|
@@ -19654,7 +19700,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
19654
19700
|
cellpadding: /^\d{1,3}$/,
|
|
19655
19701
|
cellspacing: /^\d{1,3}$/,
|
|
19656
19702
|
border: /^\d{1,2}$/,
|
|
19657
|
-
bgcolor:
|
|
19703
|
+
bgcolor: ju
|
|
19658
19704
|
},
|
|
19659
19705
|
th: {
|
|
19660
19706
|
scope: /^(col|row|colgroup|rowgroup)$/,
|
|
@@ -19664,7 +19710,7 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
19664
19710
|
height: q,
|
|
19665
19711
|
align: /^(left|center|right)$/,
|
|
19666
19712
|
valign: /^(top|middle|bottom|baseline)$/,
|
|
19667
|
-
bgcolor:
|
|
19713
|
+
bgcolor: ju
|
|
19668
19714
|
},
|
|
19669
19715
|
td: {
|
|
19670
19716
|
colspan: /^\d{1,3}$/,
|
|
@@ -19673,90 +19719,90 @@ var yu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
19673
19719
|
height: q,
|
|
19674
19720
|
align: /^(left|center|right)$/,
|
|
19675
19721
|
valign: /^(top|middle|bottom|baseline)$/,
|
|
19676
|
-
bgcolor:
|
|
19722
|
+
bgcolor: ju
|
|
19677
19723
|
},
|
|
19678
19724
|
col: { span: /^\d{1,3}$/ },
|
|
19679
19725
|
time: { datetime: "plain" },
|
|
19680
19726
|
html: {},
|
|
19681
19727
|
body: {}
|
|
19682
|
-
},
|
|
19728
|
+
}, Nu = /* @__PURE__ */ new Set(/* @__PURE__ */ "viewbox.fill.stroke.stroke-width.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-dasharray.stroke-dashoffset.fill-rule.clip-rule.opacity.fill-opacity.stroke-opacity.d.cx.cy.r.rx.ry.x.y.x1.y1.x2.y2.points.width.height.transform.xmlns.preserveaspectratio.focusable.vector-effect".split(".")), Pu = {
|
|
19683
19729
|
viewbox: "viewBox",
|
|
19684
19730
|
preserveaspectratio: "preserveAspectRatio"
|
|
19685
|
-
},
|
|
19731
|
+
}, Fu = /^[\w\s.,#%()+\-:/]*$/, Iu = /* @__PURE__ */ new Set([
|
|
19686
19732
|
"allow-popups",
|
|
19687
19733
|
"allow-popups-to-escape-sandbox",
|
|
19688
19734
|
"allow-forms",
|
|
19689
19735
|
"allow-scripts",
|
|
19690
19736
|
"allow-presentation"
|
|
19691
|
-
]),
|
|
19692
|
-
function
|
|
19693
|
-
let n = e.raw, r = n === null ? "" :
|
|
19694
|
-
return t === "bool" ? n === null || n === "" || n.toLowerCase() === e.name ? n === null ? "" : i : null : t === "plain" ? i : t === "href" ?
|
|
19737
|
+
]), Lu = /^[\w\s;*-]{0,200}$/, Ru = `(${gc})(document);`.replace(/<\/script/gi, "<\\/script");
|
|
19738
|
+
function zu(e, t) {
|
|
19739
|
+
let n = e.raw, r = n === null ? "" : tu(n), i = n === null ? "" : `="${n.replace(/"/g, """)}"`;
|
|
19740
|
+
return t === "bool" ? n === null || n === "" || n.toLowerCase() === e.name ? n === null ? "" : i : null : t === "plain" ? i : t === "href" ? au(r) ? i : e.name === "href" ? ((e) => `="${nu(e)}"`)("#") : null : t === "image" ? su(r) ? i : null : t === "media" ? cu(r) ? i : null : t.test(r) ? i : null;
|
|
19695
19741
|
}
|
|
19696
|
-
function
|
|
19742
|
+
function Bu(e) {
|
|
19697
19743
|
if (e.raw === null) return null;
|
|
19698
|
-
let t =
|
|
19699
|
-
return n === t ? `="${e.raw.replace(/"/g, """)}"` : n.trim() ? `="${
|
|
19744
|
+
let t = tu(e.raw), n = _u(t);
|
|
19745
|
+
return n === t ? `="${e.raw.replace(/"/g, """)}"` : n.trim() ? `="${nu(n)}"` : null;
|
|
19700
19746
|
}
|
|
19701
|
-
function
|
|
19702
|
-
let r = "", i =
|
|
19747
|
+
function Vu(e, t, n) {
|
|
19748
|
+
let r = "", i = yu(Mu, e) ? Mu[e] : {};
|
|
19703
19749
|
for (let e of t) {
|
|
19704
19750
|
let t = e.name;
|
|
19705
19751
|
if (!/^[a-z][a-z0-9:_.-]*$/.test(t) || t.startsWith("on")) continue;
|
|
19706
19752
|
let a = null;
|
|
19707
|
-
if (t === "style") a =
|
|
19753
|
+
if (t === "style") a = Bu(e);
|
|
19708
19754
|
else if (n) {
|
|
19709
|
-
if (
|
|
19710
|
-
let n = e.raw === null ? "" :
|
|
19711
|
-
a = t === "class" || t === "id" || t === "role" ?
|
|
19755
|
+
if (Nu.has(t) || t === "class" || /^aria-[a-z-]+$/.test(t) || t === "role" || t === "id") {
|
|
19756
|
+
let n = e.raw === null ? "" : tu(e.raw);
|
|
19757
|
+
a = t === "class" || t === "id" || t === "role" ? zu(e, yu(Du, t) ? Du[t] : "plain") : Fu.test(n) && !/javascript:|data:/i.test(n) ? e.raw === null ? "" : `="${e.raw.replace(/"/g, """)}"` : null;
|
|
19712
19758
|
}
|
|
19713
|
-
} else /^data-(plx|plexo)-[a-z0-9_-]+$/.test(t) || /^aria-[a-z-]+$/.test(t) ? a = e.raw === null ? "" : `="${e.raw.replace(/"/g, """)}"` :
|
|
19759
|
+
} else /^data-(plx|plexo)-[a-z0-9_-]+$/.test(t) || /^aria-[a-z-]+$/.test(t) ? a = e.raw === null ? "" : `="${e.raw.replace(/"/g, """)}"` : yu(i, t) ? a = zu(e, i[t]) : yu(Du, t) ? a = zu(e, Du[t]) : Ou.has(t) && (a = t === "hidden" ? zu(e, "bool") : zu(e, "plain"));
|
|
19714
19760
|
if (a === null) continue;
|
|
19715
19761
|
let o = /^data-(plx|plexo)-/.test(t) && e.written && e.written.toLowerCase() === t ? e.written : t;
|
|
19716
|
-
r += ` ${/^data-/.test(t) ? o : n &&
|
|
19762
|
+
r += ` ${/^data-/.test(t) ? o : n && yu(Pu, t) ? Pu[t] : t}${Eu.has(t) && a === "" ? "" : a}`;
|
|
19717
19763
|
}
|
|
19718
19764
|
return r;
|
|
19719
19765
|
}
|
|
19720
|
-
function
|
|
19766
|
+
function Hu(e, t) {
|
|
19721
19767
|
if (e === "input") {
|
|
19722
19768
|
let e = "";
|
|
19723
19769
|
for (let n of t) if (n.name === "type") {
|
|
19724
|
-
let t = n.raw === null ? "text" :
|
|
19725
|
-
e += ` type="${
|
|
19726
|
-
} else e +=
|
|
19770
|
+
let t = n.raw === null ? "text" : tu(n.raw).trim().toLowerCase();
|
|
19771
|
+
e += ` type="${Au.has(t) ? nu(t) : "text"}"`;
|
|
19772
|
+
} else e += Vu("input", [n], !1);
|
|
19727
19773
|
return e;
|
|
19728
19774
|
}
|
|
19729
|
-
return
|
|
19775
|
+
return Vu(e, t, !1);
|
|
19730
19776
|
}
|
|
19731
|
-
function
|
|
19777
|
+
function Uu(e, t) {
|
|
19732
19778
|
let n = (t) => e.find((e) => e.name === t), r = n("src"), i = n("srcdoc"), a = () => {
|
|
19733
19779
|
let t = "";
|
|
19734
19780
|
for (let n of e) {
|
|
19735
|
-
let e = n.raw === null ? "" :
|
|
19781
|
+
let e = n.raw === null ? "" : tu(n.raw);
|
|
19736
19782
|
if (n.name === "title" || n.name === "loading" || n.name === "referrerpolicy" || n.name === "allowfullscreen") {
|
|
19737
|
-
let e =
|
|
19783
|
+
let e = zu(n, n.name === "loading" ? /^(lazy|eager)$/ : n.name === "referrerpolicy" ? /^[a-z-]{1,40}$/ : n.name === "allowfullscreen" ? "bool" : "plain");
|
|
19738
19784
|
e !== null && (t += ` ${n.name}${e}`);
|
|
19739
|
-
} else if (n.name === "allow" &&
|
|
19740
|
-
else if (n.name === "width" || n.name === "height") q.test(e) && (t += ` ${n.name}="${
|
|
19741
|
-
else if (n.name === "class") t += ` class${
|
|
19785
|
+
} else if (n.name === "allow" && Lu.test(e)) t += ` allow${zu(n, "plain")}`;
|
|
19786
|
+
else if (n.name === "width" || n.name === "height") q.test(e) && (t += ` ${n.name}="${nu(e)}"`);
|
|
19787
|
+
else if (n.name === "class") t += ` class${zu(n, "plain")}`;
|
|
19742
19788
|
else if (n.name === "style") {
|
|
19743
|
-
let e =
|
|
19789
|
+
let e = Bu(n);
|
|
19744
19790
|
e !== null && (t += ` style${e}`);
|
|
19745
19791
|
} else /^data-(plx|plexo)-[a-z0-9_-]+$/.test(n.name) && (t += ` ${n.name}${n.raw === null ? "" : `="${n.raw.replace(/"/g, """)}"`}`);
|
|
19746
19792
|
}
|
|
19747
19793
|
return t;
|
|
19748
19794
|
};
|
|
19749
|
-
if (r && r.raw !== null &&
|
|
19795
|
+
if (r && r.raw !== null && lu(tu(r.raw))) return ` src="${r.raw.replace(/"/g, """)}"${a()}`;
|
|
19750
19796
|
let o = n("sandbox");
|
|
19751
19797
|
if (i && o) {
|
|
19752
|
-
let n = (o.raw === null ? "" :
|
|
19753
|
-
for (let t of e) t.name === "srcdoc" ? s += ` srcdoc="${(t.raw ?? "").replace(/"/g, """)}"` : t.name === "sandbox" && (s += ` sandbox="${r === i ? (t.raw ?? "").replace(/"/g, """) :
|
|
19798
|
+
let n = (o.raw === null ? "" : tu(o.raw)).split(/\s+/).filter(Boolean), r = n.filter((e) => Iu.has(e.toLowerCase()) && (t.allowEmbedScripts !== !1 || e.toLowerCase() !== "allow-scripts")).map((e) => e.toLowerCase()).join(" "), i = n.join(" "), s = "";
|
|
19799
|
+
for (let t of e) t.name === "srcdoc" ? s += ` srcdoc="${(t.raw ?? "").replace(/"/g, """)}"` : t.name === "sandbox" && (s += ` sandbox="${r === i ? (t.raw ?? "").replace(/"/g, """) : nu(r)}"`);
|
|
19754
19800
|
return `${s}${a()}`;
|
|
19755
19801
|
}
|
|
19756
19802
|
return null;
|
|
19757
19803
|
}
|
|
19758
|
-
function
|
|
19759
|
-
let n = /* @__PURE__ */ new Set([
|
|
19804
|
+
function Wu(e, t = {}) {
|
|
19805
|
+
let n = /* @__PURE__ */ new Set([Ru, ...t.allowedScripts ?? []]), r = Su(typeof e == "string" ? e : ""), i = "", a = 0;
|
|
19760
19806
|
for (let e of r) switch (e.k) {
|
|
19761
19807
|
case "text":
|
|
19762
19808
|
i += e.v;
|
|
@@ -19767,43 +19813,43 @@ function Bu(e, t = {}) {
|
|
|
19767
19813
|
case "raw":
|
|
19768
19814
|
if (a > 0) break;
|
|
19769
19815
|
if (e.name === "script") e.attrs.length === 0 && n.has(e.content) && (i += `<script>${e.content}<\/script>`);
|
|
19770
|
-
else if (e.name === "style") i += `<style>${
|
|
19771
|
-
else if (e.name === "textarea") i += `<textarea${
|
|
19816
|
+
else if (e.name === "style") i += `<style>${_u(e.content, t)}</style>`;
|
|
19817
|
+
else if (e.name === "textarea") i += `<textarea${Vu("textarea", e.attrs, !1)}>${e.content.replace(/</g, "<")}</textarea>`;
|
|
19772
19818
|
else if (e.name === "title") i += `<title>${e.content.replace(/</g, "<")}</title>`;
|
|
19773
19819
|
else if (e.name === "iframe") {
|
|
19774
|
-
let n =
|
|
19820
|
+
let n = Uu(e.attrs, t);
|
|
19775
19821
|
n !== null && (i += `<iframe${n}></iframe>`);
|
|
19776
19822
|
}
|
|
19777
19823
|
break;
|
|
19778
19824
|
case "start": {
|
|
19779
19825
|
let { name: t } = e;
|
|
19780
19826
|
if (t === "svg") {
|
|
19781
|
-
i += `<svg${
|
|
19827
|
+
i += `<svg${Vu("svg", e.attrs, !0)}${e.selfClose ? "/" : ""}>`, e.selfClose || (a += 1);
|
|
19782
19828
|
break;
|
|
19783
19829
|
}
|
|
19784
19830
|
if (a > 0) {
|
|
19785
|
-
|
|
19831
|
+
Tu.has(t) && (i += `<${t}${Vu(t, e.attrs, !0)}${e.selfClose ? "/" : ""}>`);
|
|
19786
19832
|
break;
|
|
19787
19833
|
}
|
|
19788
|
-
if (
|
|
19834
|
+
if (Cu.has(t)) i += `<${t}${Hu(t, e.attrs)}>`;
|
|
19789
19835
|
else if (t === "meta") {
|
|
19790
19836
|
let t = (t) => e.attrs.find((e) => e.name === t), n = t("charset"), r = t("name"), a = t("content");
|
|
19791
19837
|
n && n.raw !== null && /^utf-8$/i.test(n.raw) ? i += `<meta charset="${n.raw}">` : r && r.raw?.toLowerCase() === "viewport" && a && a.raw !== null && /^[\w=,.\s-]{1,120}$/.test(a.raw) && (i += `<meta name="viewport" content="${a.raw}">`);
|
|
19792
19838
|
} else if (t === "link") {
|
|
19793
19839
|
let t = (t) => e.attrs.find((e) => e.name === t), n = t("rel"), r = t("href"), a = "";
|
|
19794
19840
|
try {
|
|
19795
|
-
a = r && r.raw !== null ? new URL(
|
|
19841
|
+
a = r && r.raw !== null ? new URL(tu(r.raw)).hostname : "";
|
|
19796
19842
|
} catch {
|
|
19797
19843
|
a = "";
|
|
19798
19844
|
}
|
|
19799
|
-
let o = r && r.raw !== null && /^https:\/\//i.test(
|
|
19845
|
+
let o = r && r.raw !== null && /^https:\/\//i.test(tu(r.raw).trim());
|
|
19800
19846
|
n && n.raw !== null && /^(stylesheet|preconnect|dns-prefetch)$/i.test(n.raw) && o && (a === "fonts.googleapis.com" || a === "fonts.gstatic.com") && (i += `<link rel="${n.raw.toLowerCase()}" href="${r.raw.replace(/"/g, """)}"${t("crossorigin") ? " crossorigin" : ""}>`);
|
|
19801
19847
|
}
|
|
19802
19848
|
break;
|
|
19803
19849
|
}
|
|
19804
19850
|
case "end": {
|
|
19805
19851
|
let { name: t } = e;
|
|
19806
|
-
t === "svg" ? a > 0 && (--a, i += "</svg>") : a > 0 ?
|
|
19852
|
+
t === "svg" ? a > 0 && (--a, i += "</svg>") : a > 0 ? Tu.has(t) && (i += `</${t}>`) : Cu.has(t) && !wu.has(t) && (i += `</${t}>`);
|
|
19807
19853
|
break;
|
|
19808
19854
|
}
|
|
19809
19855
|
}
|
|
@@ -19812,7 +19858,7 @@ function Bu(e, t = {}) {
|
|
|
19812
19858
|
}
|
|
19813
19859
|
//#endregion
|
|
19814
19860
|
//#region src/v2/compile/schema.ts
|
|
19815
|
-
var
|
|
19861
|
+
var Gu = 5e3, Ku = 40, qu = /* @__PURE__ */ "page.section.container.columns.column.heading.paragraph.button.image.badge.divider.spacer.card.icon.carousel.video.social.menu.html.table.timer.form.accordion.blogTitle.blogContent.blogFeaturedImage.blogDate.blogAuthor.blogCategories.blogComments.blogPostList.shopGrid.product.booking.cart.checkout.orderConfirmation.orderTracking.signupForm".split("."), Ju = [
|
|
19816
19862
|
"blogTitle",
|
|
19817
19863
|
"blogContent",
|
|
19818
19864
|
"blogFeaturedImage",
|
|
@@ -19829,70 +19875,70 @@ var Vu = 5e3, Hu = 40, Uu = /* @__PURE__ */ "page.section.container.columns.colu
|
|
|
19829
19875
|
"orderConfirmation",
|
|
19830
19876
|
"orderTracking",
|
|
19831
19877
|
"signupForm"
|
|
19832
|
-
],
|
|
19878
|
+
], Yu = r([t().int().min(1).max(96), n().max(4)]), Xu = a({
|
|
19833
19879
|
prefix: n().max(80),
|
|
19834
19880
|
productId: n().max(100),
|
|
19835
19881
|
serviceId: n().max(100),
|
|
19836
19882
|
mode: n().max(40),
|
|
19837
19883
|
storeMode: i(),
|
|
19838
|
-
limit:
|
|
19884
|
+
limit: Yu,
|
|
19839
19885
|
category: n().max(100),
|
|
19840
19886
|
sort: n().max(100),
|
|
19841
|
-
itemsPerRow:
|
|
19842
|
-
itemsPerPage:
|
|
19887
|
+
itemsPerRow: Yu,
|
|
19888
|
+
itemsPerPage: Yu,
|
|
19843
19889
|
paginated: i(),
|
|
19844
19890
|
templateId: n().max(100)
|
|
19845
|
-
}).partial().passthrough(),
|
|
19891
|
+
}).partial().passthrough(), Zu = r([
|
|
19846
19892
|
n().max(2e3),
|
|
19847
19893
|
t(),
|
|
19848
19894
|
i()
|
|
19849
|
-
]),
|
|
19895
|
+
]), Qu = d(n(), Zu.optional()), $u = o(() => a({
|
|
19850
19896
|
id: n().min(1).max(200),
|
|
19851
|
-
type: u(
|
|
19897
|
+
type: u(qu),
|
|
19852
19898
|
name: n().max(300),
|
|
19853
19899
|
content: n().max(1e5).optional(),
|
|
19854
19900
|
props: d(n(), s()).optional(),
|
|
19855
|
-
styles:
|
|
19901
|
+
styles: Qu,
|
|
19856
19902
|
responsive: a({
|
|
19857
|
-
tablet:
|
|
19858
|
-
mobile:
|
|
19903
|
+
tablet: Qu.optional(),
|
|
19904
|
+
mobile: Qu.optional()
|
|
19859
19905
|
}).optional(),
|
|
19860
19906
|
responsiveVisibility: a({
|
|
19861
19907
|
hideOnDesktop: i().optional(),
|
|
19862
19908
|
hideOnTablet: i().optional(),
|
|
19863
19909
|
hideOnMobile: i().optional()
|
|
19864
19910
|
}).optional(),
|
|
19865
|
-
children: c(
|
|
19911
|
+
children: c($u).optional(),
|
|
19866
19912
|
locked: i().optional(),
|
|
19867
19913
|
hidden: i().optional()
|
|
19868
19914
|
}).superRefine((e, t) => {
|
|
19869
|
-
if (!
|
|
19870
|
-
let n =
|
|
19915
|
+
if (!Ju.includes(e.type) || !e.props) return;
|
|
19916
|
+
let n = Xu.safeParse(e.props);
|
|
19871
19917
|
n.success || t.addIssue({
|
|
19872
19918
|
code: "custom",
|
|
19873
19919
|
path: ["props", ...n.error.issues[0].path],
|
|
19874
19920
|
message: `The settings of "${e.name}" aren't valid (${n.error.issues[0].path.join(" › ") || "settings"}: ${n.error.issues[0].message})`
|
|
19875
19921
|
});
|
|
19876
|
-
})),
|
|
19922
|
+
})), ed = a({
|
|
19877
19923
|
id: n().min(1).max(200),
|
|
19878
19924
|
name: n().max(300),
|
|
19879
19925
|
slug: n().max(300),
|
|
19880
19926
|
isHome: i().optional(),
|
|
19881
|
-
rootNode:
|
|
19927
|
+
rootNode: $u
|
|
19882
19928
|
});
|
|
19883
|
-
function
|
|
19884
|
-
if (n.n += 1, n.n > 5e3) return `This design is too large (more than ${
|
|
19929
|
+
function td(e, t, n) {
|
|
19930
|
+
if (n.n += 1, n.n > 5e3) return `This design is too large (more than ${Gu} elements).`;
|
|
19885
19931
|
if (t > 40) return "This design is nested too deeply.";
|
|
19886
19932
|
if (n.ids.has(e.id)) return `Two elements share the same id ("${e.id}"). Each element needs its own.`;
|
|
19887
19933
|
n.ids.add(e.id);
|
|
19888
19934
|
for (let r of e.children ?? []) {
|
|
19889
|
-
let e =
|
|
19935
|
+
let e = td(r, t + 1, n);
|
|
19890
19936
|
if (e) return e;
|
|
19891
19937
|
}
|
|
19892
19938
|
return null;
|
|
19893
19939
|
}
|
|
19894
|
-
function
|
|
19895
|
-
let t = c(
|
|
19940
|
+
function nd(e) {
|
|
19941
|
+
let t = c(ed).min(1, "A design needs at least one page.").safeParse(e);
|
|
19896
19942
|
if (!t.success) {
|
|
19897
19943
|
let e = t.error.issues[0], n = e.path.length ? ` (at ${e.path.filter((e) => typeof e == "string" && e !== "children" && e !== "rootNode").join(" › ") || "the design"})` : "";
|
|
19898
19944
|
return {
|
|
@@ -19902,7 +19948,7 @@ function Qu(e) {
|
|
|
19902
19948
|
}
|
|
19903
19949
|
let n = t.data;
|
|
19904
19950
|
for (let e of n) {
|
|
19905
|
-
let t =
|
|
19951
|
+
let t = td(e.rootNode, 0, {
|
|
19906
19952
|
n: 0,
|
|
19907
19953
|
ids: /* @__PURE__ */ new Set()
|
|
19908
19954
|
});
|
|
@@ -19918,7 +19964,7 @@ function Qu(e) {
|
|
|
19918
19964
|
}
|
|
19919
19965
|
//#endregion
|
|
19920
19966
|
//#region src/v2/migrate/v1.ts
|
|
19921
|
-
var
|
|
19967
|
+
var rd = {
|
|
19922
19968
|
blog_title: "blogTitle",
|
|
19923
19969
|
blog_content: "blogContent",
|
|
19924
19970
|
blog_featured_image: "blogFeaturedImage",
|
|
@@ -19935,7 +19981,7 @@ var $u = {
|
|
|
19935
19981
|
order_tracking: "orderTracking",
|
|
19936
19982
|
booking: "booking",
|
|
19937
19983
|
maildrip_form: null
|
|
19938
|
-
},
|
|
19984
|
+
}, id = !0, ad = [
|
|
19939
19985
|
"prefix",
|
|
19940
19986
|
"productId",
|
|
19941
19987
|
"serviceId",
|
|
@@ -19947,7 +19993,7 @@ var $u = {
|
|
|
19947
19993
|
"itemsPerRow",
|
|
19948
19994
|
"itemsPerPage",
|
|
19949
19995
|
"paginated"
|
|
19950
|
-
],
|
|
19996
|
+
], od = {
|
|
19951
19997
|
blog_title: "blog title",
|
|
19952
19998
|
blog_content: "blog post text",
|
|
19953
19999
|
blog_featured_image: "blog picture",
|
|
@@ -19963,7 +20009,7 @@ var $u = {
|
|
|
19963
20009
|
checkout_flow: "checkout",
|
|
19964
20010
|
order_confirmation: "order confirmation",
|
|
19965
20011
|
order_tracking: "order tracking"
|
|
19966
|
-
},
|
|
20012
|
+
}, sd = (e) => !!e && typeof e == "object" && !Array.isArray(e), J = (e) => sd(e) ? e : {}, Y = (e, t = 500) => Array.isArray(e) ? e.slice(0, t) : [], X = (e) => typeof e == "string" ? e : typeof e == "number" && Number.isFinite(e) ? String(e) : "", cd = {
|
|
19967
20013
|
amp: "&",
|
|
19968
20014
|
lt: "<",
|
|
19969
20015
|
gt: ">",
|
|
@@ -19978,7 +20024,7 @@ var $u = {
|
|
|
19978
20024
|
ndash: "–",
|
|
19979
20025
|
hellip: "…",
|
|
19980
20026
|
copy: "©"
|
|
19981
|
-
},
|
|
20027
|
+
}, ld = (e) => e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi, (e, t) => {
|
|
19982
20028
|
if (t[0] === "#") {
|
|
19983
20029
|
let e = t[1].toLowerCase() === "x" ? parseInt(t.slice(2), 16) : parseInt(t.slice(1), 10);
|
|
19984
20030
|
try {
|
|
@@ -19987,37 +20033,37 @@ var $u = {
|
|
|
19987
20033
|
return "";
|
|
19988
20034
|
}
|
|
19989
20035
|
}
|
|
19990
|
-
return
|
|
20036
|
+
return cd[t.toLowerCase()] ?? e;
|
|
19991
20037
|
});
|
|
19992
20038
|
function Z(e) {
|
|
19993
20039
|
let t = /<(a|b|strong|i|em|u|s|span|font|ul|ol|li|img|sup|sub|mark|code)\b/i.test(e);
|
|
19994
20040
|
return {
|
|
19995
|
-
text:
|
|
20041
|
+
text: ld(e.replace(/<\s*br\s*\/?>/gi, "\n").replace(/<\/(p|div|li|h[1-6])\s*>/gi, "\n").replace(/<[^>]*>/g, "")).replace(/[ \t\f\v]+/g, " ").replace(/ ?\n ?/g, "\n").replace(/\n{3,}/g, "\n\n").trim().slice(0, 2e4),
|
|
19996
20042
|
rich: t
|
|
19997
20043
|
};
|
|
19998
20044
|
}
|
|
19999
|
-
var
|
|
20045
|
+
var ud = /[;{}<>\\]|\/\*|javascript:|expression\s*\(|@import|behavior\s*:|-moz-binding/i, dd = (e) => {
|
|
20000
20046
|
let t = X(e).trim();
|
|
20001
|
-
return t && t.length <= 300 && !
|
|
20002
|
-
},
|
|
20047
|
+
return t && t.length <= 300 && !ud.test(t) ? t : void 0;
|
|
20048
|
+
}, fd = /* @__PURE__ */ new Set([
|
|
20003
20049
|
"left",
|
|
20004
20050
|
"center",
|
|
20005
20051
|
"right",
|
|
20006
20052
|
"justify"
|
|
20007
|
-
]),
|
|
20053
|
+
]), pd = /* @__PURE__ */ new Set([
|
|
20008
20054
|
"solid",
|
|
20009
20055
|
"dashed",
|
|
20010
20056
|
"dotted",
|
|
20011
20057
|
"none"
|
|
20012
|
-
]),
|
|
20058
|
+
]), md = /* @__PURE__ */ new Set([
|
|
20013
20059
|
"none",
|
|
20014
20060
|
"uppercase",
|
|
20015
20061
|
"lowercase",
|
|
20016
20062
|
"capitalize"
|
|
20017
|
-
]),
|
|
20063
|
+
]), hd = (e) => {
|
|
20018
20064
|
let t = /url\(\s*(?:"([^"]*)"|'([^']*)'|([^)]*))\s*\)/i.exec(e), n = (t?.[1] ?? t?.[2] ?? t?.[3] ?? "").trim();
|
|
20019
20065
|
return n && vt(n) || void 0;
|
|
20020
|
-
},
|
|
20066
|
+
}, gd = /* @__PURE__ */ new Set([
|
|
20021
20067
|
"autoHeight",
|
|
20022
20068
|
"autoWidth",
|
|
20023
20069
|
"position",
|
|
@@ -20035,13 +20081,13 @@ var od = /[;{}<>\\]|\/\*|javascript:|expression\s*\(|@import|behavior\s*:|-moz-b
|
|
|
20035
20081
|
"verticalAlign",
|
|
20036
20082
|
"float"
|
|
20037
20083
|
]);
|
|
20038
|
-
function
|
|
20084
|
+
function _d(e) {
|
|
20039
20085
|
let t = J(e), n = {}, r = [], i = (e, t) => {
|
|
20040
20086
|
t !== void 0 && (n[e] = t);
|
|
20041
20087
|
};
|
|
20042
20088
|
for (let [e, a] of Object.entries(t)) {
|
|
20043
|
-
if (a == null || a === "" ||
|
|
20044
|
-
let t =
|
|
20089
|
+
if (a == null || a === "" || gd.has(e)) continue;
|
|
20090
|
+
let t = dd(a);
|
|
20045
20091
|
switch (e) {
|
|
20046
20092
|
case "color":
|
|
20047
20093
|
i("textColor", t);
|
|
@@ -20062,7 +20108,7 @@ function pd(e) {
|
|
|
20062
20108
|
i("letterSpacing", t);
|
|
20063
20109
|
break;
|
|
20064
20110
|
case "textTransform":
|
|
20065
|
-
t &&
|
|
20111
|
+
t && md.has(t) && (n.textTransform = t);
|
|
20066
20112
|
break;
|
|
20067
20113
|
case "fontStyle":
|
|
20068
20114
|
t === "italic" && (n.isItalic = !0);
|
|
@@ -20071,7 +20117,7 @@ function pd(e) {
|
|
|
20071
20117
|
t && /underline/.test(t) && (n.isUnderline = !0);
|
|
20072
20118
|
break;
|
|
20073
20119
|
case "textAlign":
|
|
20074
|
-
t &&
|
|
20120
|
+
t && fd.has(t) && (n.textAlign = t);
|
|
20075
20121
|
break;
|
|
20076
20122
|
case "backgroundColor":
|
|
20077
20123
|
i("backgroundColor", t);
|
|
@@ -20080,7 +20126,7 @@ function pd(e) {
|
|
|
20080
20126
|
case "backgroundImage":
|
|
20081
20127
|
if (t && /gradient\(/i.test(t)) n.backgroundGradient = t;
|
|
20082
20128
|
else if (t && /url\(/i.test(t)) {
|
|
20083
|
-
let i =
|
|
20129
|
+
let i = hd(t);
|
|
20084
20130
|
i ? (n.backgroundImage = i, n.backgroundSize ??= "cover", n.backgroundPosition ??= "center") : r.push(e);
|
|
20085
20131
|
} else e === "background" ? i("backgroundColor", t) : t && r.push(e);
|
|
20086
20132
|
break;
|
|
@@ -20118,7 +20164,7 @@ function pd(e) {
|
|
|
20118
20164
|
i("gap", t);
|
|
20119
20165
|
break;
|
|
20120
20166
|
case "borderStyle":
|
|
20121
|
-
t &&
|
|
20167
|
+
t && pd.has(t) && (n.borderStyle = t);
|
|
20122
20168
|
break;
|
|
20123
20169
|
case "border": {
|
|
20124
20170
|
let i = t ? /^([\d.]+(?:px|rem|em)?)\s+(solid|dashed|dotted|none)\s*(.*)$/i.exec(t) : null;
|
|
@@ -20141,11 +20187,11 @@ function pd(e) {
|
|
|
20141
20187
|
unmapped: r
|
|
20142
20188
|
};
|
|
20143
20189
|
}
|
|
20144
|
-
var
|
|
20190
|
+
var vd = (e, ...t) => t.some((t) => X(e[t]).trim() !== ""), Q = (e, t) => {
|
|
20145
20191
|
e.seen.has(t) || (e.seen.add(t), e.warnings.push(t));
|
|
20146
|
-
},
|
|
20147
|
-
function
|
|
20148
|
-
let r =
|
|
20192
|
+
}, yd = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
20193
|
+
function bd(e, t, n) {
|
|
20194
|
+
let r = _d(t.style), i = _d(t.styleTablet), a = _d(t.styleMobile), o = [.../* @__PURE__ */ new Set([
|
|
20149
20195
|
...r.unmapped,
|
|
20150
20196
|
...i.unmapped,
|
|
20151
20197
|
...a.unmapped
|
|
@@ -20157,7 +20203,7 @@ function gd(e, t, n) {
|
|
|
20157
20203
|
responsive: Object.keys(s).length ? s : void 0
|
|
20158
20204
|
};
|
|
20159
20205
|
}
|
|
20160
|
-
function
|
|
20206
|
+
function xd(e, t) {
|
|
20161
20207
|
t !== "center" && t !== "right" || (!e.width && !e.widthSizing && (e.widthSizing = "hug"), e.marginLeft ||= "auto", !e.marginRight && t === "center" && (e.marginRight = "auto"));
|
|
20162
20208
|
}
|
|
20163
20209
|
var $ = (e, t, n, r, i = {}) => ({
|
|
@@ -20166,12 +20212,12 @@ var $ = (e, t, n, r, i = {}) => ({
|
|
|
20166
20212
|
name: n,
|
|
20167
20213
|
styles: r,
|
|
20168
20214
|
...i
|
|
20169
|
-
}),
|
|
20215
|
+
}), Sd = {
|
|
20170
20216
|
layoutMode: "flow",
|
|
20171
20217
|
display: "flex",
|
|
20172
20218
|
flexDirection: "column",
|
|
20173
20219
|
width: "100%"
|
|
20174
|
-
},
|
|
20220
|
+
}, Cd = {
|
|
20175
20221
|
1: "32px",
|
|
20176
20222
|
2: "24px",
|
|
20177
20223
|
3: "19px",
|
|
@@ -20179,8 +20225,8 @@ var $ = (e, t, n, r, i = {}) => ({
|
|
|
20179
20225
|
5: "13px",
|
|
20180
20226
|
6: "11px"
|
|
20181
20227
|
};
|
|
20182
|
-
function
|
|
20183
|
-
let r = X(t.type), i = J(t.attributes), { styles: a, responsive: o } =
|
|
20228
|
+
function wd(e, t, n) {
|
|
20229
|
+
let r = X(t.type), i = J(t.attributes), { styles: a, responsive: o } = bd(e, t, `${od[r] ?? r.replace(/_/g, " ")} block`), s = a.textAlign, c = (e, t, r = {}, i = a) => $(n, e, t, i, {
|
|
20184
20230
|
...o ? { responsive: o } : {},
|
|
20185
20231
|
...r
|
|
20186
20232
|
});
|
|
@@ -20189,7 +20235,7 @@ function bd(e, t, n) {
|
|
|
20189
20235
|
let { text: n, rich: r } = Z(X(i.text) || "Heading");
|
|
20190
20236
|
r && (e.approx = !0, Q(e, "Bold, italic and links inside text are simplified to plain text."));
|
|
20191
20237
|
let o = /^h([1-6])$/i.exec(X(i.headingType)), s = o ? Number(o[1]) : 2, l = { ...a };
|
|
20192
|
-
return l.fontSize ??=
|
|
20238
|
+
return l.fontSize ??= Cd[s], l.fontWeight ??= "700", vd(J(t.style), "margin", "marginBottom") || (l.marginBottom = "8px"), [c("heading", n.slice(0, 40) || "Heading", {
|
|
20193
20239
|
content: n,
|
|
20194
20240
|
props: { level: s }
|
|
20195
20241
|
}, l)];
|
|
@@ -20199,14 +20245,14 @@ function bd(e, t, n) {
|
|
|
20199
20245
|
let s = X(i.text) || (r === "paragraph" ? "Paragraph text content." : ""), { rich: l } = Z(s);
|
|
20200
20246
|
l && (e.approx = !0, Q(e, "Bold, italic and links inside text are simplified to plain text."));
|
|
20201
20247
|
let u = s.split(/<\/p\s*>|(?:<br\s*\/?>\s*){2,}/i).map((e) => Z(e).text).filter(Boolean), d = u.length ? u : [""], f = { ...a };
|
|
20202
|
-
return r === "paragraph" && !
|
|
20248
|
+
return r === "paragraph" && !vd(J(t.style), "margin", "marginBottom") && (f.marginBottom = "12px"), d.map((e, t) => t === 0 ? c("paragraph", e.slice(0, 40) || "Text", { content: e }, f) : $(`${n}-p${t + 1}`, "paragraph", e.slice(0, 40) || "Text", f, {
|
|
20203
20249
|
content: e,
|
|
20204
20250
|
...o ? { responsive: o } : {}
|
|
20205
20251
|
}));
|
|
20206
20252
|
}
|
|
20207
20253
|
case "button": {
|
|
20208
20254
|
let t = { ...a };
|
|
20209
|
-
|
|
20255
|
+
xd(t, s), !t.widthSizing && !t.width && (t.widthSizing = "hug");
|
|
20210
20256
|
let n = X(i.href).trim();
|
|
20211
20257
|
return i.openInNewTab && (e.approx = !0, Q(e, "Buttons can't open in a new tab yet, so they open in the same one.")), [c("button", "Button", {
|
|
20212
20258
|
content: Z(X(i.text) || "Button").text,
|
|
@@ -20215,7 +20261,7 @@ function bd(e, t, n) {
|
|
|
20215
20261
|
}
|
|
20216
20262
|
case "image": {
|
|
20217
20263
|
let e = { ...a };
|
|
20218
|
-
return i.autoHeight !== !1 && delete e.height, e.width ??= "100%",
|
|
20264
|
+
return i.autoHeight !== !1 && delete e.height, e.width ??= "100%", xd(e, s), [c("image", X(i.alt).slice(0, 40) || "Image", { props: {
|
|
20219
20265
|
src: vt(i.src),
|
|
20220
20266
|
alt: X(i.alt)
|
|
20221
20267
|
} }, e)];
|
|
@@ -20229,7 +20275,7 @@ function bd(e, t, n) {
|
|
|
20229
20275
|
case "spacer": return [c("spacer", "Spacer", {}, { height: a.height ?? "24px" })];
|
|
20230
20276
|
case "card": {
|
|
20231
20277
|
let e = {
|
|
20232
|
-
...
|
|
20278
|
+
...Sd,
|
|
20233
20279
|
gap: "8px",
|
|
20234
20280
|
...a
|
|
20235
20281
|
};
|
|
@@ -20246,10 +20292,10 @@ function bd(e, t, n) {
|
|
|
20246
20292
|
}, { content: Z(X(i.description) || "Card description.").text })] }, e)];
|
|
20247
20293
|
}
|
|
20248
20294
|
case "icon": {
|
|
20249
|
-
let t =
|
|
20295
|
+
let t = yd(X(i.iconName)), n = t in Rc;
|
|
20250
20296
|
n || (e.approx = !0, Q(e, `The icon "${X(i.iconName) || "unnamed"}" isn't in the V2 icon set, so a star stands in for it.`)), X(i.href).trim() && (e.approx = !0, Q(e, "Icons can't be links yet; the icon is kept without its link."));
|
|
20251
20297
|
let r = { ...a };
|
|
20252
|
-
return r.fontSize ??= `${parseInt(X(i.iconSize), 10) || 48}px`, r.textColor ??= "#1e293b",
|
|
20298
|
+
return r.fontSize ??= `${parseInt(X(i.iconSize), 10) || 48}px`, r.textColor ??= "#1e293b", xd(r, s === "left" ? void 0 : s ?? "center"), [c("icon", "Icon", { props: {
|
|
20253
20299
|
iconName: n ? t : "star",
|
|
20254
20300
|
strokeWidth: 2,
|
|
20255
20301
|
label: X(i.alt) || X(i.label)
|
|
@@ -20277,7 +20323,7 @@ function bd(e, t, n) {
|
|
|
20277
20323
|
})).filter((e) => e.network in Xt);
|
|
20278
20324
|
r.length < n.length && (e.approx = !0, Q(e, "A social link to a network V2 has no icon for was left out."));
|
|
20279
20325
|
let o = parseInt(X(J(n[0]).size) || X(J(t.style).iconSize), 10), l = { ...a };
|
|
20280
|
-
return
|
|
20326
|
+
return xd(l, s), [c("social", "Social links", { props: {
|
|
20281
20327
|
links: r,
|
|
20282
20328
|
size: Number.isFinite(o) ? Math.min(96, Math.max(20, o)) : 40,
|
|
20283
20329
|
shape: X(i.iconType ?? J(n[0]).iconType) === "square" ? "square" : "circle",
|
|
@@ -20289,7 +20335,7 @@ function bd(e, t, n) {
|
|
|
20289
20335
|
label: X(e.label).trim() || "Link",
|
|
20290
20336
|
href: P(X(e.href) || "#")
|
|
20291
20337
|
})), t = { ...a };
|
|
20292
|
-
return (s === "center" || s === "right") &&
|
|
20338
|
+
return (s === "center" || s === "right") && xd(t, s), [c("menu", "Menu", { props: {
|
|
20293
20339
|
links: e,
|
|
20294
20340
|
layout: "horizontal",
|
|
20295
20341
|
mobile: "hamburger"
|
|
@@ -20334,15 +20380,15 @@ function bd(e, t, n) {
|
|
|
20334
20380
|
openFirst: n === 0
|
|
20335
20381
|
} })];
|
|
20336
20382
|
}
|
|
20337
|
-
case "form_container": return X(i.provider) === "maildrip" ?
|
|
20338
|
-
default: return r in
|
|
20383
|
+
case "form_container": return X(i.provider) === "maildrip" ? Td(e, "maildrip_form", "a MailDrip sign-up form", n, i) : [Dd(e, n, i, Y(i.fields, 40).map(J), a, o)];
|
|
20384
|
+
default: return r in rd ? Td(e, r, od[r] ?? r, n, i, a, o) : (e.lost = !0, Q(e, `A "${r || "unknown"}" block isn't supported in the new editor and was left out.`), []);
|
|
20339
20385
|
}
|
|
20340
20386
|
}
|
|
20341
|
-
function
|
|
20342
|
-
let s =
|
|
20387
|
+
function Td(e, t, n, r, i, a = {}, o) {
|
|
20388
|
+
let s = rd[t];
|
|
20343
20389
|
if (s) {
|
|
20344
20390
|
let e = {};
|
|
20345
|
-
for (let t of
|
|
20391
|
+
for (let t of ad) {
|
|
20346
20392
|
let n = i[t];
|
|
20347
20393
|
(typeof n == "string" || typeof n == "boolean" || typeof n == "number" && Number.isFinite(n)) && (e[t] = n);
|
|
20348
20394
|
}
|
|
@@ -20355,11 +20401,11 @@ function xd(e, t, n, r, i, a = {}, o) {
|
|
|
20355
20401
|
})];
|
|
20356
20402
|
}
|
|
20357
20403
|
return e.lost = !0, Q(e, `The ${n} can't be carried over automatically and was left out. Add it again from the new editor's Add panel.`), [$(r, "container", `Needs attention: ${n}`, {
|
|
20358
|
-
...
|
|
20404
|
+
...Sd,
|
|
20359
20405
|
minHeight: "40px"
|
|
20360
20406
|
}, { hidden: !0 })];
|
|
20361
20407
|
}
|
|
20362
|
-
var
|
|
20408
|
+
var Ed = {
|
|
20363
20409
|
text: "text",
|
|
20364
20410
|
email: "email",
|
|
20365
20411
|
tel: "tel",
|
|
@@ -20371,15 +20417,15 @@ var Sd = {
|
|
|
20371
20417
|
number: "text",
|
|
20372
20418
|
date: "text"
|
|
20373
20419
|
};
|
|
20374
|
-
function
|
|
20420
|
+
function Dd(e, t, n, r, i, a) {
|
|
20375
20421
|
let o = /* @__PURE__ */ new Set(), s = [];
|
|
20376
20422
|
for (let t of r) {
|
|
20377
|
-
let n = X(t.kind) || X(t.type) || X(t.inputType) || "text", r =
|
|
20378
|
-
(n === "radio" || n === "number" || n === "date" || !(n in
|
|
20423
|
+
let n = X(t.kind) || X(t.type) || X(t.inputType) || "text", r = Ed[n] ?? "text";
|
|
20424
|
+
(n === "radio" || n === "number" || n === "date" || !(n in Ed)) && (e.approx = !0, Q(e, `A "${n}" form field is now a ${r === "select" ? "drop-down" : "text"} field.`));
|
|
20379
20425
|
let i = Z(X(t.label) || X(t.placeholder) || X(t.name) || "Field").text, a = (X(t.name) || X(t.fieldName) || i).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "field", c = a;
|
|
20380
20426
|
for (let e = 2; o.has(a); e++) a = `${c}-${e}`;
|
|
20381
20427
|
o.add(a);
|
|
20382
|
-
let l = Y(t.options, 50).map((e) =>
|
|
20428
|
+
let l = Y(t.options, 50).map((e) => sd(e) ? X(e.label) || X(e.value) : X(e)).filter(Boolean);
|
|
20383
20429
|
s.push({
|
|
20384
20430
|
id: a,
|
|
20385
20431
|
label: i,
|
|
@@ -20407,12 +20453,12 @@ function Cd(e, t, n, r, i, a) {
|
|
|
20407
20453
|
...a ? { responsive: a } : {}
|
|
20408
20454
|
});
|
|
20409
20455
|
}
|
|
20410
|
-
var
|
|
20456
|
+
var Od = /* @__PURE__ */ new Set([
|
|
20411
20457
|
"input",
|
|
20412
20458
|
"textarea",
|
|
20413
20459
|
"select"
|
|
20414
20460
|
]);
|
|
20415
|
-
function
|
|
20461
|
+
function kd(e) {
|
|
20416
20462
|
let t = J(e.attributes), n = X(e.type);
|
|
20417
20463
|
return {
|
|
20418
20464
|
kind: n === "input" ? X(t.inputType) || X(t.type) || "text" : n,
|
|
@@ -20423,8 +20469,8 @@ function Td(e) {
|
|
|
20423
20469
|
options: t.options
|
|
20424
20470
|
};
|
|
20425
20471
|
}
|
|
20426
|
-
function
|
|
20427
|
-
let t = Y(e.elements, 200).filter(
|
|
20472
|
+
function Ad(e) {
|
|
20473
|
+
let t = Y(e.elements, 200).filter(sd), n = Y(e.nestedRows, 50).filter(sd), r = /* @__PURE__ */ new Map();
|
|
20428
20474
|
for (let e of t) r.set(X(e.id), {
|
|
20429
20475
|
kind: "el",
|
|
20430
20476
|
item: e
|
|
@@ -20448,11 +20494,11 @@ function Ed(e) {
|
|
|
20448
20494
|
});
|
|
20449
20495
|
return i;
|
|
20450
20496
|
}
|
|
20451
|
-
function
|
|
20497
|
+
function jd(e, t = 1) {
|
|
20452
20498
|
return e.nodes + t > 4980 ? (e.capped || (e.capped = !0, e.lost = !0, Q(e, "This design is very large, so the last part of it was left out.")), !1) : (e.nodes += t, !0);
|
|
20453
20499
|
}
|
|
20454
|
-
function
|
|
20455
|
-
let i = [], a =
|
|
20500
|
+
function Md(e, t, n, r) {
|
|
20501
|
+
let i = [], a = Ad(t), o = 0;
|
|
20456
20502
|
for (let t = 0; t < a.length; t++) {
|
|
20457
20503
|
let s = a[t];
|
|
20458
20504
|
if (o += 1, s.kind === "row") {
|
|
@@ -20460,35 +20506,35 @@ function Od(e, t, n, r) {
|
|
|
20460
20506
|
e.lost = !0, Q(e, "Rows nested very deeply were left out.");
|
|
20461
20507
|
continue;
|
|
20462
20508
|
}
|
|
20463
|
-
let t =
|
|
20509
|
+
let t = Pd(e, s.item, `${n}-r${o}`, r + 1, !1);
|
|
20464
20510
|
t && i.push(t);
|
|
20465
20511
|
continue;
|
|
20466
20512
|
}
|
|
20467
|
-
if (
|
|
20513
|
+
if (Od.has(X(s.item.type))) {
|
|
20468
20514
|
let r = [s.item];
|
|
20469
|
-
for (; t + 1 < a.length && a[t + 1].kind === "el" &&
|
|
20470
|
-
if (!
|
|
20471
|
-
e.approx = !0, Q(e, "Separate form fields were grouped into one form. Check its button and where it sends messages."), i.push(
|
|
20515
|
+
for (; t + 1 < a.length && a[t + 1].kind === "el" && Od.has(X(a[t + 1].item.type));) r.push(a[t + 1].item), t += 1;
|
|
20516
|
+
if (!jd(e)) continue;
|
|
20517
|
+
e.approx = !0, Q(e, "Separate form fields were grouped into one form. Check its button and where it sends messages."), i.push(Dd(e, `${n}-e${o}`, {}, r.map(kd), bd(e, r[0], "form field").styles, void 0));
|
|
20472
20518
|
continue;
|
|
20473
20519
|
}
|
|
20474
|
-
|
|
20520
|
+
jd(e, 2) && i.push(...wd(e, s.item, `${n}-e${o}`));
|
|
20475
20521
|
}
|
|
20476
20522
|
return i;
|
|
20477
20523
|
}
|
|
20478
|
-
var
|
|
20524
|
+
var Nd = (e) => {
|
|
20479
20525
|
let t = parseFloat(X(e));
|
|
20480
20526
|
return Number.isFinite(t) && t > 0 ? t : 0;
|
|
20481
20527
|
};
|
|
20482
|
-
function
|
|
20483
|
-
if (!
|
|
20484
|
-
let { styles: a, responsive: o } =
|
|
20528
|
+
function Pd(e, t, n, r, i) {
|
|
20529
|
+
if (!jd(e, 3)) return null;
|
|
20530
|
+
let { styles: a, responsive: o } = bd(e, {
|
|
20485
20531
|
style: t.style,
|
|
20486
20532
|
styleTablet: t.styleTablet,
|
|
20487
20533
|
styleMobile: t.styleMobile
|
|
20488
|
-
}, "row"), s = Y(t.columns, 12).filter(
|
|
20534
|
+
}, "row"), s = Y(t.columns, 12).filter(sd), c = a.gap ?? (s.length > 1 ? "16px" : void 0);
|
|
20489
20535
|
delete a.gap;
|
|
20490
20536
|
let l = s.map((t, i) => {
|
|
20491
|
-
let a = `${n}-c${i + 1}`, { styles: o, responsive: s } =
|
|
20537
|
+
let a = `${n}-c${i + 1}`, { styles: o, responsive: s } = bd(e, {
|
|
20492
20538
|
style: t.styles,
|
|
20493
20539
|
styleTablet: t.stylesTablet,
|
|
20494
20540
|
styleMobile: t.stylesMobile
|
|
@@ -20497,13 +20543,13 @@ function Ad(e, t, n, r, i) {
|
|
|
20497
20543
|
cid: a,
|
|
20498
20544
|
cs: o,
|
|
20499
20545
|
cr: s,
|
|
20500
|
-
children:
|
|
20546
|
+
children: Md(e, t, a, r)
|
|
20501
20547
|
};
|
|
20502
20548
|
}), u;
|
|
20503
20549
|
if (l.length === 1) {
|
|
20504
20550
|
let e = l[0];
|
|
20505
20551
|
u = $(`${n}-body`, "container", "Content", {
|
|
20506
|
-
...
|
|
20552
|
+
...Sd,
|
|
20507
20553
|
...e.cs,
|
|
20508
20554
|
width: "100%"
|
|
20509
20555
|
}, {
|
|
@@ -20511,7 +20557,7 @@ function Ad(e, t, n, r, i) {
|
|
|
20511
20557
|
...e.cr ? { responsive: e.cr } : {}
|
|
20512
20558
|
});
|
|
20513
20559
|
} else {
|
|
20514
|
-
let e = s.map((e) =>
|
|
20560
|
+
let e = s.map((e) => Nd(e.width)), t = e.reduce((e, t) => e + t, 0), r = l.map((n, r) => t > 0 && e[r] > 0 ? Math.round(e[r] / t * 1e3) / 10 : 100 / Math.max(1, l.length)).map((e) => `minmax(0, ${e}fr)`).join(" "), i = l.length <= 2 ? r : "minmax(0, 1fr) minmax(0, 1fr)";
|
|
20515
20561
|
u = $(`${n}-cols`, "columns", "Columns", {
|
|
20516
20562
|
layoutMode: "grid",
|
|
20517
20563
|
display: "grid",
|
|
@@ -20525,7 +20571,7 @@ function Ad(e, t, n, r, i) {
|
|
|
20525
20571
|
mobile: { gridTemplateColumns: "minmax(0, 1fr)" }
|
|
20526
20572
|
},
|
|
20527
20573
|
children: l.map((e) => $(e.cid, "column", "Column", {
|
|
20528
|
-
...
|
|
20574
|
+
...Sd,
|
|
20529
20575
|
...e.cs,
|
|
20530
20576
|
width: "100%"
|
|
20531
20577
|
}, {
|
|
@@ -20548,7 +20594,7 @@ function Ad(e, t, n, r, i) {
|
|
|
20548
20594
|
}
|
|
20549
20595
|
return "";
|
|
20550
20596
|
})(u.children ?? []), p = d && d.replace(/[-_]+/g, " ") || f || (i ? "Section" : "Row"), m = Ct(X(t.htmlClass)), h = {
|
|
20551
|
-
...
|
|
20597
|
+
...Sd,
|
|
20552
20598
|
...a,
|
|
20553
20599
|
...m ? { customClasses: m } : {}
|
|
20554
20600
|
};
|
|
@@ -20561,7 +20607,7 @@ function Ad(e, t, n, r, i) {
|
|
|
20561
20607
|
...o ? { responsive: o } : {}
|
|
20562
20608
|
});
|
|
20563
20609
|
}
|
|
20564
|
-
var
|
|
20610
|
+
var Fd = (e, t = {}) => ({
|
|
20565
20611
|
id: e.id ?? "v1-page",
|
|
20566
20612
|
name: e.name ?? "Home",
|
|
20567
20613
|
slug: e.slug ?? "home",
|
|
@@ -20574,7 +20620,7 @@ var jd = (e, t = {}) => ({
|
|
|
20574
20620
|
children: []
|
|
20575
20621
|
}
|
|
20576
20622
|
});
|
|
20577
|
-
function
|
|
20623
|
+
function Id(e, t = {}) {
|
|
20578
20624
|
let n = {
|
|
20579
20625
|
warnings: [],
|
|
20580
20626
|
seen: /* @__PURE__ */ new Set(),
|
|
@@ -20584,14 +20630,14 @@ function Md(e, t = {}) {
|
|
|
20584
20630
|
capped: !1
|
|
20585
20631
|
}, r = {};
|
|
20586
20632
|
try {
|
|
20587
|
-
let i = J(e), a =
|
|
20633
|
+
let i = J(e), a = sd(i.body) ? i.body : null;
|
|
20588
20634
|
if (!a) return Q(n, "This doesn't look like a design from the old editor, so an empty page was made instead."), {
|
|
20589
|
-
page:
|
|
20635
|
+
page: Fd(t),
|
|
20590
20636
|
warnings: n.warnings,
|
|
20591
20637
|
fidelity: "partial",
|
|
20592
20638
|
extras: r
|
|
20593
20639
|
};
|
|
20594
|
-
let o = J(a.style), { styles: s, unmapped: c } =
|
|
20640
|
+
let o = J(a.style), { styles: s, unmapped: c } = _d(Object.fromEntries(Object.entries(o).filter(([e]) => ![
|
|
20595
20641
|
"customJs",
|
|
20596
20642
|
"customCss",
|
|
20597
20643
|
"favicon",
|
|
@@ -20600,17 +20646,17 @@ function Md(e, t = {}) {
|
|
|
20600
20646
|
c.length && (n.approx = !0, Q(n, `Some page-wide styling (${c.slice(0, 4).join(", ")}) can't be carried over.`));
|
|
20601
20647
|
let l = X(o.customJs).trim();
|
|
20602
20648
|
l && (r.customJs = l), X(o.customCss).trim() && (n.approx = !0, Q(n, "The page's custom CSS can't be carried over; check the page's look.")), X(o.favicon).trim() && (n.approx = !0, Q(n, "Set the site icon again in the site settings."));
|
|
20603
|
-
let u =
|
|
20649
|
+
let u = Fd(t, { ...s }), d = X(o.contentMaxWidth).trim();
|
|
20604
20650
|
u.rootNode.styles.layoutMode = "flow", u.rootNode.styles.display = "flex", u.rootNode.styles.flexDirection = "column";
|
|
20605
|
-
let f = Y(a.rows, 200).filter(
|
|
20651
|
+
let f = Y(a.rows, 200).filter(sd), p = [];
|
|
20606
20652
|
if (f.forEach((e, t) => {
|
|
20607
|
-
let r =
|
|
20653
|
+
let r = Pd(n, e, `v1-s${t + 1}`, 0, !0);
|
|
20608
20654
|
r && p.push(r);
|
|
20609
20655
|
}), d && d !== "1200px") {
|
|
20610
|
-
let e = d.toLowerCase() === "none" ? "100%" :
|
|
20656
|
+
let e = d.toLowerCase() === "none" ? "100%" : dd(d);
|
|
20611
20657
|
if (e) for (let t of p) for (let n of t.children ?? []) n.styles.maxWidth = e;
|
|
20612
20658
|
}
|
|
20613
|
-
u.rootNode.children = p,
|
|
20659
|
+
u.rootNode.children = p, Ld(u.rootNode) > 40 && (n.lost = !0, Q(n, "Rows nested too deeply were left out."), u.rootNode.children = p.map((e) => Rd(e, 0)));
|
|
20614
20660
|
let m = n.lost ? "partial" : n.approx ? "approximate" : "exact";
|
|
20615
20661
|
return {
|
|
20616
20662
|
page: u,
|
|
@@ -20620,26 +20666,26 @@ function Md(e, t = {}) {
|
|
|
20620
20666
|
};
|
|
20621
20667
|
} catch {
|
|
20622
20668
|
return {
|
|
20623
|
-
page:
|
|
20669
|
+
page: Fd(t),
|
|
20624
20670
|
warnings: [...n.warnings, "This design could not be read, so an empty page was made instead."],
|
|
20625
20671
|
fidelity: "partial",
|
|
20626
20672
|
extras: r
|
|
20627
20673
|
};
|
|
20628
20674
|
}
|
|
20629
20675
|
}
|
|
20630
|
-
function
|
|
20676
|
+
function Ld(e) {
|
|
20631
20677
|
let t = 0;
|
|
20632
|
-
for (let n of e.children ?? []) t = Math.max(t,
|
|
20678
|
+
for (let n of e.children ?? []) t = Math.max(t, Ld(n));
|
|
20633
20679
|
return t + 1;
|
|
20634
20680
|
}
|
|
20635
|
-
function
|
|
20681
|
+
function Rd(e, t) {
|
|
20636
20682
|
return t >= 38 ? {
|
|
20637
20683
|
...e,
|
|
20638
20684
|
children: []
|
|
20639
20685
|
} : {
|
|
20640
20686
|
...e,
|
|
20641
|
-
children: e.children?.map((e) =>
|
|
20687
|
+
children: e.children?.map((e) => Rd(e, t + 1))
|
|
20642
20688
|
};
|
|
20643
20689
|
}
|
|
20644
20690
|
//#endregion
|
|
20645
|
-
export {
|
|
20691
|
+
export { ms as $, sa as $t, _c as A, ge as An, Ma as At, Xs as B, Ji as Bt, ll as C, Me as Cn, Ya as Ct, Rc as D, he as Dn, Ua as Dt, Jc as E, we as En, Ra as Et, hc as F, pe as Fn, Oa as Ft, cc as G, fa as Gt, Ks as H, Fi as Ht, Ts as I, de as In, ba as It, Cs as J, Yi as Jt, ws as K, oa as Kt, Es as L, ue as Ln, da as Lt, yc as M, Se as Mn, wa as Mt, vc as N, _e as Nn, ja as Nt, zc as O, xe as On, Pa as Ot, gc as P, fe as Pn, Ea as Pt, rs as Q, ea as Qt, uc as R, k as Rn, aa as Rt, ul as S, Fe as Sn, ro as St, sl as T, De as Tn, La as Tt, mc as U, ra as Ut, sc as V, la as Vt, dc as W, ia as Wt, Ss as X, ca as Xt, vs as Y, pa as Yt, _s as Z, $i as Zt, Dl as _, ke as _n, to as _t, Gu as a, Oi as an, $o as at, hl as b, je as bn, $a as bt, Wu as c, qt as cn, bo as ct, Gl as d, Lt as dn, mo as dt, na as en, as as et, Kl as f, zt as fn, oo as ft, Ol as g, ut as gn, io as gt, Pl as h, ct as hn, no as ht, Ku as i, V as in, Yo as it, bc as j, ve as jn, Aa as jt, Lc as k, ye as kn, Sa as kt, $l as l, Dt as ln, go as lt, Ml as m, wt as mn, Za as mt, id as n, ha as nn, ns as nt, nd as o, Xt as on, Go as ot, Ul as p, Ot as pn, so as pt, gs as q, ya as qt, Id as r, ki as rn, ts as rt, _u as s, Yt as sn, So as st, rd as t, ta as tn, fs as tt, Jl as u, Rt as un, ho as ut, Tl as v, Ae as vn, lo as vt, cl as w, Pe as wn, co as wt, fl as x, Ie as xn, Ja as xt, ml as y, Le as yn, ao as yt, oc as z, H as zt };
|