@charisol/plexo-sdk 1.0.38 → 1.0.40

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.
@@ -1,6 +1,6 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, t as l, u } from "./iconSvgStatic-JHlo_YyU.js";
1
+ import { a as e, d as t, f as n, i as r, l as i, n as a, o, p as s, r as c, s as l, t as u, u as d } from "./iconSvgStatic-DOyb-nIf.js";
2
2
  //#region src/utilities/playground.constants.ts
3
- var d = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, f = [
3
+ var f = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, p = [
4
4
  {
5
5
  id: "all",
6
6
  label: "All sources"
@@ -17,7 +17,7 @@ var d = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, f
17
17
  id: "pixabay",
18
18
  label: "Pixabay"
19
19
  }
20
- ], p = [
20
+ ], m = [
21
21
  {
22
22
  id: "surface-book",
23
23
  label: "Surface Book",
@@ -84,7 +84,7 @@ var d = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, f
84
84
  width: 375,
85
85
  category: "mobile"
86
86
  }
87
- ], m = 1280, h = [
87
+ ], h = 1280, g = [
88
88
  {
89
89
  id: "facebook",
90
90
  label: "Facebook"
@@ -117,7 +117,7 @@ var d = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, f
117
117
  id: "tiktok",
118
118
  label: "TikTok"
119
119
  }
120
- ], g = [
120
+ ], _ = [
121
121
  {
122
122
  label: "Text",
123
123
  value: "text"
@@ -150,7 +150,7 @@ var d = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, f
150
150
  label: "Checkbox",
151
151
  value: "checkbox"
152
152
  }
153
- ], _ = [
153
+ ], v = [
154
154
  {
155
155
  label: "1 Column",
156
156
  widths: ["100%"],
@@ -199,7 +199,7 @@ var d = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, f
199
199
  "25%"
200
200
  ]
201
201
  }
202
- ], v = [
202
+ ], y = [
203
203
  {
204
204
  label: "Roboto",
205
205
  value: "'Roboto', sans-serif",
@@ -600,8 +600,8 @@ var d = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, f
600
600
  value: "'Great Vibes', cursive",
601
601
  style: "handwriting"
602
602
  }
603
- ], y = new Map(v.map((e) => [e.value, e.label]));
604
- function b(e, t = []) {
603
+ ], b = new Map(y.map((e) => [e.value, e.label]));
604
+ function x(e, t = []) {
605
605
  let n = /* @__PURE__ */ new Set(), r = (e) => {
606
606
  if (!e) return;
607
607
  let t = Array.isArray(e.columns) ? e.columns : [];
@@ -619,17 +619,17 @@ function b(e, t = []) {
619
619
  for (let e of t) typeof e == "string" && e.trim() && n.add(e.trim());
620
620
  return n;
621
621
  }
622
- function x(e) {
622
+ function S(e) {
623
623
  let t = /* @__PURE__ */ new Set();
624
624
  for (let n of e) {
625
- let e = y.get(n);
625
+ let e = b.get(n);
626
626
  e && t.add(e);
627
627
  }
628
628
  return t.size === 0 ? null : `https://fonts.googleapis.com/css?family=${Array.from(t).map((e) => `${encodeURIComponent(e).replace(/%20/g, "+")}:400,700`).join("|")}&display=swap`;
629
629
  }
630
630
  //#endregion
631
631
  //#region src/utilities/responsiveDefaults.ts
632
- var S = {
632
+ var C = {
633
633
  tablet: {
634
634
  thresholdPx: 24,
635
635
  scale: .85,
@@ -640,7 +640,7 @@ var S = {
640
640
  scale: .7,
641
641
  floorPx: 14
642
642
  }
643
- }, C = {
643
+ }, w = {
644
644
  tablet: {
645
645
  thresholdPx: 320,
646
646
  scale: .8,
@@ -651,7 +651,7 @@ var S = {
651
651
  scale: .55,
652
652
  floorPx: 140
653
653
  }
654
- }, w = {
654
+ }, T = {
655
655
  tablet: {
656
656
  thresholdPx: 48,
657
657
  scale: .75,
@@ -662,7 +662,7 @@ var S = {
662
662
  scale: .55,
663
663
  floorPx: 16
664
664
  }
665
- }, T = {
665
+ }, E = {
666
666
  tablet: {
667
667
  thresholdPx: 500,
668
668
  scale: 1,
@@ -673,11 +673,11 @@ var S = {
673
673
  scale: 1,
674
674
  floorPx: 0
675
675
  }
676
- }, E = ["fontSize"], D = [
676
+ }, D = ["fontSize"], O = [
677
677
  "height",
678
678
  "minHeight",
679
679
  "maxHeight"
680
- ], O = [
680
+ ], k = [
681
681
  "padding",
682
682
  "paddingTop",
683
683
  "paddingBottom",
@@ -686,8 +686,8 @@ var S = {
686
686
  "margin",
687
687
  "marginTop",
688
688
  "marginBottom"
689
- ], k = ["width", "maxWidth"];
690
- function A(e) {
689
+ ], A = ["width", "maxWidth"];
690
+ function j(e) {
691
691
  if (typeof e == "number" && Number.isFinite(e)) return e;
692
692
  if (typeof e != "string") return null;
693
693
  let t = e.trim().match(/^(-?\d+(?:\.\d+)?)px$/);
@@ -695,48 +695,48 @@ function A(e) {
695
695
  let n = parseFloat(t[1]);
696
696
  return Number.isFinite(n) ? n : null;
697
697
  }
698
- function j(e, t) {
698
+ function M(e, t) {
699
699
  return e < t.thresholdPx ? null : Math.max(Math.round(e * t.scale), t.floorPx);
700
700
  }
701
- function M(e, t) {
701
+ function N(e, t) {
702
702
  if (!e || typeof e != "object") return {};
703
703
  let n = {};
704
- for (let r of E) {
705
- let i = A(e[r]);
706
- if (i === null) continue;
707
- let a = j(i, S[t]);
708
- a !== null && (n[r] = `${a}px`);
709
- }
710
704
  for (let r of D) {
711
- let i = A(e[r]);
705
+ let i = j(e[r]);
712
706
  if (i === null) continue;
713
- let a = j(i, C[t]);
707
+ let a = M(i, C[t]);
714
708
  a !== null && (n[r] = `${a}px`);
715
709
  }
716
710
  for (let r of O) {
717
- let i = A(e[r]);
711
+ let i = j(e[r]);
718
712
  if (i === null) continue;
719
- let a = j(i, w[t]);
713
+ let a = M(i, w[t]);
720
714
  a !== null && (n[r] = `${a}px`);
721
715
  }
722
716
  for (let r of k) {
723
- let i = A(e[r]);
724
- i !== null && i >= T[t].thresholdPx && (n[r] = "100%");
717
+ let i = j(e[r]);
718
+ if (i === null) continue;
719
+ let a = M(i, T[t]);
720
+ a !== null && (n[r] = `${a}px`);
721
+ }
722
+ for (let r of A) {
723
+ let i = j(e[r]);
724
+ i !== null && i >= E[t].thresholdPx && (n[r] = "100%");
725
725
  }
726
726
  return n;
727
727
  }
728
- function N(e, t, n) {
728
+ function P(e, t, n) {
729
729
  let r = e || {};
730
730
  return n ? {
731
731
  ...r,
732
- ...M(r, n),
732
+ ...N(r, n),
733
733
  ...t || {}
734
734
  } : r;
735
735
  }
736
736
  //#endregion
737
737
  //#region src/utilities/compiler.ts
738
- var P = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", F = (e) => e === "twitter" ? "x" : e, I = (e, t = "currentColor") => {
739
- switch (F(e)) {
738
+ var F = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", I = (e) => e === "twitter" ? "x" : e, L = (e, t = "currentColor") => {
739
+ switch (I(e)) {
740
740
  case "facebook": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><path fill="${t}" d="M14 8h2V4h-2c-2.2 0-4 1.8-4 4v2H8v4h2v6h4v-6h2.5l.5-4H14V8c0-.55.45-1 1-1Z"/></svg>`;
741
741
  case "instagram": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><rect x="4" y="4" width="16" height="16" rx="5" ry="5" fill="none" stroke="${t}" stroke-width="2"/><circle cx="12" cy="12" r="3.5" fill="none" stroke="${t}" stroke-width="2"/><circle cx="17" cy="7" r="1" fill="${t}"/></svg>`;
742
742
  case "linkedin": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><circle cx="8" cy="9" r="1.25" fill="${t}"/><path fill="${t}" d="M7 11h2v6H7zM11 11h2v.9c.5-.7 1.34-1.15 2.4-1.15 2 0 3.1 1.25 3.1 3.6V17h-2v-2.2c0-1.3-.45-2.05-1.55-2.05-1.2 0-1.85.8-1.85 2.05V17h-2z"/></svg>`;
@@ -748,7 +748,7 @@ var P = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
748
748
  default: return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><circle cx="12" cy="12" r="4" fill="${t}"/></svg>`;
749
749
  }
750
750
  };
751
- function L(e) {
751
+ function R(e) {
752
752
  if (!e || typeof e != "object") return null;
753
753
  if (Array.isArray(e.columns) && e.columns.length > 0) return e;
754
754
  let t = (e.type || "").toLowerCase(), n = e.props || e.content || e.attributes || e.data || e.payload || e, r = e.style || {};
@@ -1002,7 +1002,7 @@ function L(e) {
1002
1002
  }
1003
1003
  }
1004
1004
  }
1005
- var R = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter(([e, t]) => t != null && t !== "").map(([e, t]) => {
1005
+ var z = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter(([e, t]) => t != null && t !== "").map(([e, t]) => {
1006
1006
  let n = e.replace(/([A-Z])/g, "-$1").toLowerCase(), r = t;
1007
1007
  return typeof t == "number" && [
1008
1008
  "padding",
@@ -1013,25 +1013,25 @@ var R = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter((
1013
1013
  "width",
1014
1014
  "height"
1015
1015
  ].some((t) => e.toLowerCase().includes(t)) && (r = `${t}px`), `${n}: ${r};`;
1016
- }).join(" "), z = (e = {}) => R(e).replace(/;(\s|$)/g, " !important;$1");
1017
- function B(e) {
1016
+ }).join(" "), B = (e = {}) => z(e).replace(/;(\s|$)/g, " !important;$1");
1017
+ function V(e) {
1018
1018
  if (typeof e != "string") return !1;
1019
1019
  let t = e.toLowerCase();
1020
1020
  return t.includes("javascript:") || t.includes("vbscript:") || t.includes("expression") || t.includes("url(") || t.includes("@import") || t.includes("-moz-binding") || t.includes("behavior") || t.includes("</style") || /\\/.test(e);
1021
1021
  }
1022
- function V(e, t, n, r, i) {
1022
+ function H(e, t, n, r, i) {
1023
1023
  let a = {
1024
- ...M(n, r),
1024
+ ...N(n, r),
1025
1025
  ...i || {}
1026
1026
  };
1027
- for (let e of Object.keys(a)) B(a[e]) && delete a[e];
1027
+ for (let e of Object.keys(a)) V(a[e]) && delete a[e];
1028
1028
  if (Object.keys(a).length === 0) return;
1029
- let o = z(a);
1029
+ let o = B(a);
1030
1030
  if (!o) return;
1031
1031
  let s = String(t).replace(/["\\]/g, "");
1032
1032
  e[r].push(`[data-plexo-id="${s}"] { ${o} }`);
1033
1033
  }
1034
- var H = () => ({
1034
+ var U = () => ({
1035
1035
  backgroundColor: "#ffffff",
1036
1036
  borderRadius: "20px",
1037
1037
  width: "100%",
@@ -1054,11 +1054,11 @@ var H = () => ({
1054
1054
  buttonPaddingRight: "14px",
1055
1055
  buttonFontSize: "13px",
1056
1056
  buttonFontWeight: "700"
1057
- }), U = (e) => (e || "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), W = (e, t) => {
1057
+ }), W = (e) => (e || "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), G = (e, t) => {
1058
1058
  if (typeof t != "string") return "";
1059
1059
  let n = t.trim();
1060
- return n ? ` ${e}="${U(n)}"` : "";
1061
- }, G = [
1060
+ return n ? ` ${e}="${W(n)}"` : "";
1061
+ }, K = [
1062
1062
  "fieldSpacing",
1063
1063
  "buttonBackgroundColor",
1064
1064
  "buttonTextColor",
@@ -1071,9 +1071,9 @@ var H = () => ({
1071
1071
  "buttonFontWeight",
1072
1072
  "buttonWidth",
1073
1073
  "buttonAlign"
1074
- ], K = (e) => {
1074
+ ], q = (e) => {
1075
1075
  if (!e || typeof e != "object") return "";
1076
- let t = e.kind || "text", n = U(e.name || e.label || "field"), r = e.required ? " required" : "", i = R({
1076
+ let t = e.kind || "text", n = W(e.name || e.label || "field"), r = e.required ? " required" : "", i = z({
1077
1077
  fontSize: e.fontSize || "13px",
1078
1078
  borderRadius: e.borderRadius || "12px",
1079
1079
  borderWidth: e.borderWidth || "1px",
@@ -1081,88 +1081,126 @@ var H = () => ({
1081
1081
  borderStyle: "solid",
1082
1082
  color: e.inputTextColor
1083
1083
  }), a = e.showLabel === !1 ? "" : `<label style="display: block; margin-bottom: 4px; font-size: ${e.fontSize || "12px"}; font-weight: ${e.labelFontWeight || "700"}; color: ${e.labelColor || "inherit"};">${e.label || ""}${e.required ? " <span style=\"color:#e11d48;\">*</span>" : ""}</label>`;
1084
- return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${U(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}></textarea>` : t === "select" ? `${a}<select name="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}>${(Array.isArray(e.options) ? e.options : []).map((e) => `<option value="${U(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>` : t === "radio" || t === "checkbox" ? `${a}<div style="display: flex; flex-wrap: wrap; gap: 8px;">${(Array.isArray(e.options) && e.options.length > 0 ? e.options : [{
1084
+ return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${W(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}></textarea>` : t === "select" ? `${a}<select name="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}>${(Array.isArray(e.options) ? e.options : []).map((e) => `<option value="${W(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>` : t === "radio" || t === "checkbox" ? `${a}<div style="display: flex; flex-wrap: wrap; gap: 8px;">${(Array.isArray(e.options) && e.options.length > 0 ? e.options : [{
1085
1085
  label: e.label || "Option",
1086
1086
  value: e.name || "option"
1087
- }]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${U(r?.value ?? "")}" />${r?.label ?? r?.value ?? ""}</label>`).join("")}</div>` : `${a}<input type="${U(t)}" name="${n}" placeholder="${U(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r} />`;
1087
+ }]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${W(r?.value ?? "")}" />${r?.label ?? r?.value ?? ""}</label>`).join("")}</div>` : `${a}<input type="${W(t)}" name="${n}" placeholder="${W(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r} />`;
1088
1088
  };
1089
- function q(e) {
1089
+ function J(e, t, n) {
1090
+ if (e === "none") return "";
1091
+ let r = W(t);
1092
+ return e === "plus" ? `<span data-acc-icon style="font-size: 14px; line-height: 1; font-weight: 700; color: ${r};">${n ? "−" : "+"}</span>` : e === "arrow" ? `<span data-acc-icon style="font-size: 14px; line-height: 1; display: inline-block; color: ${r}; transform: ${n ? "rotate(90deg)" : "none"}; transition: transform 0.2s ease;">›</span>` : `<svg data-acc-icon width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="${r}" stroke-width="2.5" style="flex-shrink: 0; transform: ${n ? "rotate(180deg)" : "none"}; transition: transform 0.2s ease;"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5"/></svg>`;
1093
+ }
1094
+ function Y(e, t, n) {
1095
+ return e.map((r, i) => {
1096
+ let a = i === e.length - 1, o = z({ borderBottom: n.showDividers && !a ? `1px solid ${t.dividerColor || "#e2e8f0"}` : void 0 }), s = z({
1097
+ display: "flex",
1098
+ alignItems: "center",
1099
+ gap: "8px",
1100
+ width: "100%",
1101
+ cursor: "pointer",
1102
+ textAlign: "left",
1103
+ flexDirection: n.iconOnLeft ? "row-reverse" : "row",
1104
+ padding: t.padding || "14px",
1105
+ backgroundColor: r.defaultOpen ? t.headerActiveBackgroundColor || t.headerBackgroundColor || "#ffffff" : t.headerBackgroundColor || "#ffffff",
1106
+ color: r.defaultOpen ? t.headerActiveTextColor || t.headerTextColor || "#0f172a" : t.headerTextColor || "#0f172a",
1107
+ fontSize: t.headerFontSize || "14px",
1108
+ fontWeight: t.headerFontWeight || 600,
1109
+ fontFamily: t.headerFontFamily,
1110
+ border: "none",
1111
+ font: "inherit",
1112
+ background: void 0
1113
+ }), c = z({
1114
+ display: "grid",
1115
+ gridTemplateRows: r.defaultOpen ? "1fr" : "0fr",
1116
+ transition: n.animated ? "grid-template-rows 0.25s ease" : void 0,
1117
+ backgroundColor: t.contentBackgroundColor || "#ffffff"
1118
+ }), l = z({
1119
+ padding: t.contentPadding || "14px",
1120
+ color: t.contentTextColor || "#475569",
1121
+ fontSize: t.contentFontSize || "13px",
1122
+ whiteSpace: "pre-wrap"
1123
+ }), u = J(n.iconStyle, t.iconColor || "#64748b", !!r.defaultOpen), d = W(r.title), f = W(r.content), p = r.children.length ? `<div class="plexo-acc-group" style="margin-top: 10px;">${Y(r.children, t, n)}</div>` : "";
1124
+ return `<div class="plexo-acc-item" style="${o}"><button type="button" data-acc-header data-acc-open="${r.defaultOpen ? "1" : "0"}" style="${s}"><span style="flex: 1;">${d}</span>${u}</button><div data-acc-panel style="${c}"><div style="overflow: hidden;"><div style="${l}">${f}${p}</div></div></div></div>`;
1125
+ }).join("");
1126
+ }
1127
+ function X(e) {
1090
1128
  return `<!-- Unsupported block ${String(e)} -->`;
1091
1129
  }
1092
- var J = (d) => {
1093
- if (!d || typeof d != "object") return "";
1094
- let f = d.style || {}, p = R(d.type === "form_container" ? {
1095
- ...H(),
1096
- ...f
1097
- } : f), m = d.attributes || {}, h = ` data-plexo-id="${U(d.id)}"`;
1098
- switch (d.type) {
1099
- case "heading": return `<h2${h} style="margin-top: 0; margin-bottom: 8px; ${p}">${m.text || "Heading"}</h2>`;
1100
- case "paragraph": return `<p${h} style="margin-top: 0; margin-bottom: 12px; ${p}">${m.text || "Paragraph text content."}</p>`;
1101
- case "text": return `<div${h} style="${p}">${m.text || ""}</div>`;
1130
+ var Z = (f) => {
1131
+ if (!f || typeof f != "object") return "";
1132
+ let p = f.style || {}, m = z(f.type === "form_container" ? {
1133
+ ...U(),
1134
+ ...p
1135
+ } : p), h = f.attributes || {}, g = ` data-plexo-id="${W(f.id)}"`;
1136
+ switch (f.type) {
1137
+ case "heading": return `<h2${g} style="margin-top: 0; margin-bottom: 8px; ${m}">${h.text || "Heading"}</h2>`;
1138
+ case "paragraph": return `<p${g} style="margin-top: 0; margin-bottom: 12px; ${m}">${h.text || "Paragraph text content."}</p>`;
1139
+ case "text": return `<div${g} style="${m}">${h.text || ""}</div>`;
1102
1140
  case "button": {
1103
- let e = o(d), t = R({
1104
- ...f,
1141
+ let e = c(f), t = z({
1142
+ ...p,
1105
1143
  width: e.width,
1106
1144
  height: e.height
1107
1145
  });
1108
- return `<div style="text-align: ${f.textAlign || "center"};"><a${h} href="${m.href || "#"}" target="${m.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${t}">${m.text || "Button"}</a></div>`;
1146
+ return `<div style="text-align: ${p.textAlign || "center"};"><a${g} href="${h.href || "#"}" target="${h.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${t}">${h.text || "Button"}</a></div>`;
1109
1147
  }
1110
1148
  case "image": {
1111
- let e = s(d), t = f.textAlign === "center" ? "margin: 0 auto; display: block;" : f.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", n = R({
1112
- ...f,
1149
+ let e = l(f), t = p.textAlign === "center" ? "margin: 0 auto; display: block;" : p.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", n = z({
1150
+ ...p,
1113
1151
  width: e.width,
1114
1152
  height: e.height
1115
1153
  });
1116
- return `<img${h} src="${m.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${m.alt || ""}" style="${n} ${t}" />`;
1154
+ return `<img${g} src="${h.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${h.alt || ""}" style="${n} ${t}" />`;
1117
1155
  }
1118
- case "divider": return `<hr${h} style="border: 0; border-top: ${f.borderWidth || "1px"} ${f.borderStyle || "solid"} ${f.borderColor || "#334155"}; ${p}" />`;
1119
- case "spacer": return `<div${h} style="height: ${f.height || "24px"};"></div>`;
1120
- case "card": return `<div${h} style="${p}">
1121
- <h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${m.title || "Card Title"}</h3>
1122
- <p style="margin: 0; color: #94a3b8; font-size: 14px;">${m.description || "Card description."}</p>
1156
+ case "divider": return `<hr${g} style="border: 0; border-top: ${p.borderWidth || "1px"} ${p.borderStyle || "solid"} ${p.borderColor || "#334155"}; ${m}" />`;
1157
+ case "spacer": return `<div${g} style="height: ${p.height || "24px"};"></div>`;
1158
+ case "card": return `<div${g} style="${m}">
1159
+ <h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${h.title || "Card Title"}</h3>
1160
+ <p style="margin: 0; color: #94a3b8; font-size: 14px;">${h.description || "Card description."}</p>
1123
1161
  </div>`;
1124
1162
  case "form_container": {
1125
- let e = {
1126
- ...H(),
1127
- ...f
1128
- }, t = {};
1129
- for (let n of Object.keys(e)) G.includes(n) || (t[n] = e[n]);
1130
- t.height = c(d);
1131
- let n = R(t), r = i(Array.isArray(m.fields) ? m.fields : []), a = e.fieldSpacing || "12px", o = r.map((e) => `<div style="margin-bottom: ${a};">${K(e)}</div>`).join(""), s = m.buttonAutoWidth === !1 ? e.buttonWidth || "100%" : "auto", l = e.buttonAlign === "left" ? "flex-start" : e.buttonAlign === "right" ? "flex-end" : "center", u = R({
1132
- backgroundColor: e.buttonBackgroundColor,
1133
- color: e.buttonTextColor,
1134
- borderRadius: e.buttonBorderRadius,
1135
- paddingTop: e.buttonPaddingTop,
1136
- paddingBottom: e.buttonPaddingBottom,
1137
- paddingLeft: e.buttonPaddingLeft,
1138
- paddingRight: e.buttonPaddingRight,
1139
- fontSize: e.buttonFontSize,
1140
- fontWeight: e.buttonFontWeight,
1141
- width: s
1163
+ let t = {
1164
+ ...U(),
1165
+ ...p
1166
+ }, n = {};
1167
+ for (let e of Object.keys(t)) K.includes(e) || (n[e] = t[e]);
1168
+ n.height = r(f);
1169
+ let i = z(n), a = e(Array.isArray(h.fields) ? h.fields : []), o = t.fieldSpacing || "12px", s = a.map((e) => `<div style="margin-bottom: ${o};">${q(e)}</div>`).join(""), c = h.buttonAutoWidth === !1 ? t.buttonWidth || "100%" : "auto", l = t.buttonAlign === "left" ? "flex-start" : t.buttonAlign === "right" ? "flex-end" : "center", u = z({
1170
+ backgroundColor: t.buttonBackgroundColor,
1171
+ color: t.buttonTextColor,
1172
+ borderRadius: t.buttonBorderRadius,
1173
+ paddingTop: t.buttonPaddingTop,
1174
+ paddingBottom: t.buttonPaddingBottom,
1175
+ paddingLeft: t.buttonPaddingLeft,
1176
+ paddingRight: t.buttonPaddingRight,
1177
+ fontSize: t.buttonFontSize,
1178
+ fontWeight: t.buttonFontWeight,
1179
+ width: c
1142
1180
  });
1143
- return `<form${h} action="${U(m.actionUrl || m.action || "#")}" method="${U(m.method || "POST")}" style="${n}">${o}<div style="display: flex; width: 100%; justify-content: ${l};"><button type="submit" style="border: 0; cursor: pointer; ${u}">${m.submitLabel || "Submit"}</button></div></form>`;
1181
+ return `<form${g} action="${W(h.actionUrl || h.action || "#")}" method="${W(h.method || "POST")}" style="${i}">${s}<div style="display: flex; width: 100%; justify-content: ${l};"><button type="submit" style="border: 0; cursor: pointer; ${u}">${h.submitLabel || "Submit"}</button></div></form>`;
1144
1182
  }
1145
1183
  case "input": {
1146
- let e = m.inputType || m.type || "text", t = U(m.name || m.fieldName || "field"), n = U(m.placeholder || ""), r = m.required ? " required" : "";
1147
- return `<input${h} type="${U(e)}" name="${t}" placeholder="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${p}"${r} />`;
1184
+ let e = h.inputType || h.type || "text", t = W(h.name || h.fieldName || "field"), n = W(h.placeholder || ""), r = h.required ? " required" : "";
1185
+ return `<input${g} type="${W(e)}" name="${t}" placeholder="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${m}"${r} />`;
1148
1186
  }
1149
- case "textarea": return `<textarea${h} name="${U(m.name || m.fieldName || "field")}" placeholder="${U(m.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${p}"${m.required ? " required" : ""}></textarea>`;
1150
- case "select": return `<select${h} name="${U(m.name || m.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${p}"${m.required ? " required" : ""}>${(Array.isArray(m.options) ? m.options : []).map((e) => `<option value="${U(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
1151
- case "html": return `<div${h} style="${R({
1152
- ...f,
1153
- height: e(d, "auto")
1154
- })}">${m.htmlContent || m.text || ""}</div>`;
1187
+ case "textarea": return `<textarea${g} name="${W(h.name || h.fieldName || "field")}" placeholder="${W(h.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${m}"${h.required ? " required" : ""}></textarea>`;
1188
+ case "select": return `<select${g} name="${W(h.name || h.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${m}"${h.required ? " required" : ""}>${(Array.isArray(h.options) ? h.options : []).map((e) => `<option value="${W(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
1189
+ case "html": return `<div${g} style="${z({
1190
+ ...p,
1191
+ height: o(f, "auto")
1192
+ })}">${h.htmlContent || h.text || ""}</div>`;
1155
1193
  case "social": {
1156
- let e = a(d), t = f.textAlign === "center" ? "center" : f.textAlign === "right" ? "flex-end" : "flex-start";
1157
- return `<div${h} style="${R({
1158
- padding: f.padding,
1159
- margin: f.margin,
1194
+ let e = d(f), t = p.textAlign === "center" ? "center" : p.textAlign === "right" ? "flex-end" : "flex-start";
1195
+ return `<div${g} style="${z({
1196
+ padding: p.padding,
1197
+ margin: p.margin,
1160
1198
  display: "flex",
1161
1199
  flexWrap: "wrap",
1162
- gap: f.iconSpacing || "8px",
1200
+ gap: p.iconSpacing || "8px",
1163
1201
  justifyContent: t
1164
1202
  })}">${e.map((e) => {
1165
- let t = R({
1203
+ let t = z({
1166
1204
  width: e.size,
1167
1205
  height: e.size,
1168
1206
  padding: "8px",
@@ -1174,121 +1212,135 @@ var J = (d) => {
1174
1212
  justifyContent: "center",
1175
1213
  overflow: "hidden"
1176
1214
  });
1177
- return `<a href="${U(e.url)}" style="${t} text-decoration: none;">${I(e.provider, e.color)}</a>`;
1215
+ return `<a href="${W(e.url)}" style="${t} text-decoration: none;">${L(e.provider, e.color)}</a>`;
1178
1216
  }).join("")}</div>`;
1179
1217
  }
1180
1218
  case "menu": {
1181
- let e = t(d), n = f.textAlign === "center" ? "center" : f.textAlign === "right" ? "flex-end" : "flex-start";
1182
- return `<div${h} style="${R({
1183
- ...f,
1219
+ let e = i(f), t = p.textAlign === "center" ? "center" : p.textAlign === "right" ? "flex-end" : "flex-start";
1220
+ return `<div${g} style="${z({
1221
+ ...p,
1184
1222
  display: "flex",
1185
1223
  flexWrap: "wrap",
1186
1224
  gap: "16px",
1187
- justifyContent: n
1188
- })}">${e.map((e) => `<a href="${U(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${f.fontWeight || 600};">${U(e.label)}</a>`).join("")}</div>`;
1225
+ justifyContent: t
1226
+ })}">${e.map((e) => `<a href="${W(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${p.fontWeight || 600};">${W(e.label)}</a>`).join("")}</div>`;
1189
1227
  }
1190
1228
  case "icon": {
1191
- let e = f.fontSize || `${m.iconSize || 48}px`, t = f.color || "#1e293b", n = parseInt(String(e), 10) || 48, r = l(m.iconName, n, t), i = f.textAlign === "right" ? "flex-end" : f.textAlign === "left" ? "flex-start" : "center", a = R({
1192
- padding: f.padding,
1193
- margin: f.margin,
1229
+ let e = p.fontSize || `${h.iconSize || 48}px`, t = p.color || "#1e293b", n = parseInt(String(e), 10) || 48, r = u(h.iconName, n, t), i = p.textAlign === "right" ? "flex-end" : p.textAlign === "left" ? "flex-start" : "center", a = z({
1230
+ padding: p.padding,
1231
+ margin: p.margin,
1194
1232
  display: "flex",
1195
1233
  justifyContent: i
1196
- }), o = typeof m.href == "string" ? m.href.trim() : "", s = `<span style="display: inline-flex; align-items: center; justify-content: center; color: ${t};">${r}</span>`;
1197
- return `<div style="${a}">${o ? `<a${h} href="${U(o)}" target="${m.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${h}>${s}</span>`}</div>`;
1234
+ }), o = typeof h.href == "string" ? h.href.trim() : "", s = `<span style="display: inline-flex; align-items: center; justify-content: center; color: ${t};">${r}</span>`;
1235
+ return `<div style="${a}">${o ? `<a${g} href="${W(o)}" target="${h.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${g}>${s}</span>`}</div>`;
1198
1236
  }
1199
1237
  case "table": {
1200
- let e = u(d), t = `${f.borderWidth || "1px"} ${f.borderStyle || "solid"} ${f.borderColor || "#cbd5e1"}`, n = (n, r, i) => {
1201
- let a = i ? "th" : "td", o = i ? f.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : f.contentBgColor || "#ffffff", s = i ? f.headerTextColor || "#1e293b" : f.contentTextColor || "#475569", c = i ? f.headerTextAlign || "left" : f.contentTextAlign || "left";
1202
- return `<tr>${n.map((e) => {
1203
- let n = R({
1204
- padding: f.cellPadding || "8px",
1205
- border: t,
1238
+ let e = t(f), n = `${p.borderWidth || "1px"} ${p.borderStyle || "solid"} ${p.borderColor || "#cbd5e1"}`, r = (t, r, i) => {
1239
+ let a = i ? "th" : "td", o = i ? p.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : p.contentBgColor || "#ffffff", s = i ? p.headerTextColor || "#1e293b" : p.contentTextColor || "#475569", c = i ? p.headerTextAlign || "left" : p.contentTextAlign || "left";
1240
+ return `<tr>${t.map((e) => {
1241
+ let t = z({
1242
+ padding: p.cellPadding || "8px",
1243
+ border: n,
1206
1244
  backgroundColor: o,
1207
1245
  color: s,
1208
1246
  textAlign: c,
1209
- lineHeight: f.contentLineHeight,
1210
- letterSpacing: f.contentLetterSpacing,
1247
+ lineHeight: p.contentLineHeight,
1248
+ letterSpacing: p.contentLetterSpacing,
1211
1249
  fontWeight: i ? "700" : void 0
1212
1250
  });
1213
- return `<${a} style="${n}">${e || "&nbsp;"}</${a}>`;
1251
+ return `<${a} style="${t}">${e || "&nbsp;"}</${a}>`;
1214
1252
  }).join("")}</tr>`;
1215
- }, r = e.enableHeader && e.cells.length > 0 ? `<thead>${n(e.cells[0], 0, !0)}</thead>` : "", i = +!!e.enableHeader, a = e.enableFooter ? e.cells.length - 1 : e.cells.length, o = e.cells.slice(i, Math.max(i, a)).map((e, t) => n(e, t, !1)).join(""), s = e.enableFooter && e.cells.length > i ? `<tfoot>${n(e.cells[e.cells.length - 1], e.cells.length - 1, !1)}</tfoot>` : "", c = R({
1253
+ }, i = e.enableHeader && e.cells.length > 0 ? `<thead>${r(e.cells[0], 0, !0)}</thead>` : "", a = +!!e.enableHeader, o = e.enableFooter ? e.cells.length - 1 : e.cells.length, s = e.cells.slice(a, Math.max(a, o)).map((e, t) => r(e, t, !1)).join(""), c = e.enableFooter && e.cells.length > a ? `<tfoot>${r(e.cells[e.cells.length - 1], e.cells.length - 1, !1)}</tfoot>` : "", l = z({
1216
1254
  borderCollapse: "collapse",
1217
1255
  width: "100%"
1218
1256
  });
1219
- return `<div${h} style="${R({
1220
- padding: f.padding,
1221
- margin: f.margin,
1257
+ return `<div${g} style="${z({
1258
+ padding: p.padding,
1259
+ margin: p.margin,
1222
1260
  overflowX: "auto"
1223
- })}"><table style="${c}">${r}<tbody>${o}</tbody>${s}</table></div>`;
1261
+ })}"><table style="${l}">${i}<tbody>${s}</tbody>${c}</table></div>`;
1224
1262
  }
1225
1263
  case "video": {
1226
- let e = r(m.videoUrl), t = m.linkType === "email" ? `mailto:${m.href || ""}` : m.href || m.videoUrl || "#", n = m.target || "_blank";
1227
- return `<div${h} style="${R({
1228
- padding: f.padding,
1229
- margin: f.margin,
1230
- borderRadius: f.borderRadius,
1264
+ let e = s(h.videoUrl), t = h.linkType === "email" ? `mailto:${h.href || ""}` : h.href || h.videoUrl || "#", n = h.target || "_blank";
1265
+ return `<div${g} style="${z({
1266
+ padding: p.padding,
1267
+ margin: p.margin,
1268
+ borderRadius: p.borderRadius,
1231
1269
  overflow: "hidden"
1232
- })}"><a href="${U(t)}" target="${U(n)}" style="position: relative; display: block; text-decoration: none;"><img src="${U(e.thumbnailUrl)}" alt="${U(m.alt || "Video preview")}" style="width: 100%; display: block;" /><span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 9999px; background: rgba(15, 23, 42, 0.75); display: flex; align-items: center; justify-content: center;"><span style="width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 16px solid #ffffff; margin-left: 4px;"></span></span></a></div>`;
1270
+ })}"><a href="${W(t)}" target="${W(n)}" style="position: relative; display: block; text-decoration: none;"><img src="${W(e.thumbnailUrl)}" alt="${W(h.alt || "Video preview")}" style="width: 100%; display: block;" /><span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 9999px; background: rgba(15, 23, 42, 0.75); display: flex; align-items: center; justify-content: center;"><span style="width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 16px solid #ffffff; margin-left: 4px;"></span></span></a></div>`;
1233
1271
  }
1234
1272
  case "timer": {
1235
- let e = m.showLabels !== !1, t = R({
1236
- fontFamily: f.digitsFontFamily,
1237
- fontSize: f.digitsFontSize || "40px",
1238
- color: f.digitsColor || "#1e293b",
1273
+ let e = h.showLabels !== !1, t = z({
1274
+ fontFamily: p.digitsFontFamily,
1275
+ fontSize: p.digitsFontSize || "40px",
1276
+ color: p.digitsColor || "#1e293b",
1239
1277
  fontWeight: "800"
1240
- }), r = R({
1241
- fontFamily: f.labelsFontFamily,
1242
- fontSize: f.labelsFontSize || "16px",
1243
- color: f.labelsColor || "#64748b"
1244
- }), i = R({
1245
- backgroundColor: f.backgroundColor || "#f8fafc",
1246
- borderRadius: f.borderRadius || "8px",
1247
- padding: f.padding || "16px",
1278
+ }), r = z({
1279
+ fontFamily: p.labelsFontFamily,
1280
+ fontSize: p.labelsFontSize || "16px",
1281
+ color: p.labelsColor || "#64748b"
1282
+ }), i = z({
1283
+ backgroundColor: p.backgroundColor || "#f8fafc",
1284
+ borderRadius: p.borderRadius || "8px",
1285
+ padding: p.padding || "16px",
1248
1286
  textAlign: "center"
1249
- }), a = (n, i, a) => `<div style="display: inline-flex; flex-direction: column; align-items: center; padding: 0 10px;"><span data-unit="${n}" style="${t}">${a}</span>${e ? `<span style="${r}">${i}</span>` : ""}</div>`, o = n(m.targetDate), s = U(m.targetDate || "2026-12-31T23:59:59"), c = `<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${d.id}"]`)});if(!wrap)return;var target=new Date(wrap.getAttribute('data-plexo-target')).getTime();function pad(n){return String(n).padStart(2,'0');}function tick(){var diff=target-Date.now();var d=wrap.querySelector('[data-unit="days"]'),h=wrap.querySelector('[data-unit="hours"]'),m=wrap.querySelector('[data-unit="minutes"]'),s=wrap.querySelector('[data-unit="seconds"]');if(diff<=0){[d,h,m,s].forEach(function(n){if(n)n.textContent='00';});clearInterval(iv);return;}var total=Math.floor(diff/1000);if(d)d.textContent=pad(Math.floor(total/86400));if(h)h.textContent=pad(Math.floor(total%86400/3600));if(m)m.textContent=pad(Math.floor(total%3600/60));if(s)s.textContent=pad(total%60);}tick();var iv=setInterval(tick,1000);})();<\/script>`;
1250
- return `<div${h} data-plexo-target="${s}" style="${i}"><div>${a("days", "Days", o.days)}${a("hours", "Hours", o.hours)}${a("minutes", "Mins", o.minutes)}${a("seconds", "Secs", o.seconds)}</div>${c}</div>`;
1287
+ }), a = (n, i, a) => `<div style="display: inline-flex; flex-direction: column; align-items: center; padding: 0 10px;"><span data-unit="${n}" style="${t}">${a}</span>${e ? `<span style="${r}">${i}</span>` : ""}</div>`, o = n(h.targetDate), s = W(h.targetDate || "2026-12-31T23:59:59"), c = `<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${f.id}"]`)});if(!wrap)return;var target=new Date(wrap.getAttribute('data-plexo-target')).getTime();function pad(n){return String(n).padStart(2,'0');}function tick(){var diff=target-Date.now();var d=wrap.querySelector('[data-unit="days"]'),h=wrap.querySelector('[data-unit="hours"]'),m=wrap.querySelector('[data-unit="minutes"]'),s=wrap.querySelector('[data-unit="seconds"]');if(diff<=0){[d,h,m,s].forEach(function(n){if(n)n.textContent='00';});clearInterval(iv);return;}var total=Math.floor(diff/1000);if(d)d.textContent=pad(Math.floor(total/86400));if(h)h.textContent=pad(Math.floor(total%86400/3600));if(m)m.textContent=pad(Math.floor(total%3600/60));if(s)s.textContent=pad(total%60);}tick();var iv=setInterval(tick,1000);})();<\/script>`;
1288
+ return `<div${g} data-plexo-target="${s}" style="${i}"><div>${a("days", "Days", o.days)}${a("hours", "Hours", o.hours)}${a("minutes", "Mins", o.minutes)}${a("seconds", "Secs", o.seconds)}</div>${c}</div>`;
1251
1289
  }
1252
1290
  case "carousel": {
1253
- let e = Array.isArray(m.images) ? m.images : [], t = R({
1254
- padding: f.padding || "10px",
1255
- margin: f.margin,
1256
- backgroundColor: f.backgroundColor,
1291
+ let e = Array.isArray(h.images) ? h.images : [], t = z({
1292
+ padding: p.padding || "10px",
1293
+ margin: p.margin,
1294
+ backgroundColor: p.backgroundColor,
1257
1295
  position: "relative",
1258
1296
  overflow: "hidden",
1259
1297
  borderRadius: "12px"
1260
1298
  });
1261
- if (e.length === 0) return `<div${h} style="${t}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
1262
- let n = Math.min(e.length - 1, Math.max(0, parseInt(String(m.activeIdx), 10) || 0)), r = e.map((e, t) => `<div data-slide-idx="${t}" style="display: ${t === n ? "block" : "none"};"><img src="${U(e.src)}" alt="${U(e.alt || e.caption || "")}" style="width: 100%; display: block;" />${e.caption ? `<div style="padding: 8px; text-align: center; background: rgba(15, 23, 42, 0.8); color: #fff; font-size: 12px; font-weight: 600;">${U(e.caption)}</div>` : ""}</div>`).join(""), i = e.length > 1 ? `<div style="display: flex; gap: 6px; justify-content: center; padding: 8px 0;">${e.map((e, t) => `<button type="button" data-dot-idx="${t}" style="width: 8px; height: 8px; border-radius: 9999px; border: none; background: ${t === n ? "#4f46e5" : "#cbd5e1"}; cursor: pointer;"></button>`).join("")}</div>` : "";
1263
- return `<div${h} data-active-idx="${n}" style="${t}">${e.length > 1 ? "<button type=\"button\" data-nav=\"prev\" style=\"position: absolute; left: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">‹</button><button type=\"button\" data-nav=\"next\" style=\"position: absolute; right: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">›</button>" : ""}${r}${i}${`<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${d.id}"]`)});if(!wrap)return;var slides=wrap.querySelectorAll('[data-slide-idx]');var dots=wrap.querySelectorAll('[data-dot-idx]');function show(n){var idx=(n+slides.length)%slides.length;slides.forEach(function(s,i){s.style.display=i===idx?'block':'none';});dots.forEach(function(d,i){d.style.background=i===idx?'#4f46e5':'#cbd5e1';});wrap.setAttribute('data-active-idx',String(idx));}var prev=wrap.querySelector('[data-nav="prev"]');var next=wrap.querySelector('[data-nav="next"]');if(prev)prev.addEventListener('click',function(){show(parseInt(wrap.getAttribute('data-active-idx')||'0',10)-1);});if(next)next.addEventListener('click',function(){show(parseInt(wrap.getAttribute('data-active-idx')||'0',10)+1);});dots.forEach(function(d,i){d.addEventListener('click',function(){show(i);});});})();<\/script>`}</div>`;
1299
+ if (e.length === 0) return `<div${g} style="${t}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
1300
+ let n = Math.min(e.length - 1, Math.max(0, parseInt(String(h.activeIdx), 10) || 0)), r = e.map((e, t) => `<div data-slide-idx="${t}" style="display: ${t === n ? "block" : "none"};"><img src="${W(e.src)}" alt="${W(e.alt || e.caption || "")}" style="width: 100%; display: block;" />${e.caption ? `<div style="padding: 8px; text-align: center; background: rgba(15, 23, 42, 0.8); color: #fff; font-size: 12px; font-weight: 600;">${W(e.caption)}</div>` : ""}</div>`).join(""), i = e.length > 1 ? `<div style="display: flex; gap: 6px; justify-content: center; padding: 8px 0;">${e.map((e, t) => `<button type="button" data-dot-idx="${t}" style="width: 8px; height: 8px; border-radius: 9999px; border: none; background: ${t === n ? "#4f46e5" : "#cbd5e1"}; cursor: pointer;"></button>`).join("")}</div>` : "";
1301
+ return `<div${g} data-active-idx="${n}" style="${t}">${e.length > 1 ? "<button type=\"button\" data-nav=\"prev\" style=\"position: absolute; left: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">‹</button><button type=\"button\" data-nav=\"next\" style=\"position: absolute; right: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">›</button>" : ""}${r}${i}${`<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${f.id}"]`)});if(!wrap)return;var slides=wrap.querySelectorAll('[data-slide-idx]');var dots=wrap.querySelectorAll('[data-dot-idx]');function show(n){var idx=(n+slides.length)%slides.length;slides.forEach(function(s,i){s.style.display=i===idx?'block':'none';});dots.forEach(function(d,i){d.style.background=i===idx?'#4f46e5':'#cbd5e1';});wrap.setAttribute('data-active-idx',String(idx));}var prev=wrap.querySelector('[data-nav="prev"]');var next=wrap.querySelector('[data-nav="next"]');if(prev)prev.addEventListener('click',function(){show(parseInt(wrap.getAttribute('data-active-idx')||'0',10)-1);});if(next)next.addEventListener('click',function(){show(parseInt(wrap.getAttribute('data-active-idx')||'0',10)+1);});dots.forEach(function(d,i){d.addEventListener('click',function(){show(i);});});})();<\/script>`}</div>`;
1302
+ }
1303
+ case "accordion": {
1304
+ let e = a(f), t = h.mode === "multi" ? "multi" : "single", n = h.iconStyle || "chevron", r = h.iconPosition === "left", i = h.showDividers !== !1, o = h.animation !== "none", s = z({
1305
+ border: `${p.borderWidth || "1px"} ${p.borderStyle || "solid"} ${p.borderColor || "#e2e8f0"}`,
1306
+ borderRadius: p.borderRadius || "10px",
1307
+ overflow: "hidden",
1308
+ margin: p.margin
1309
+ });
1310
+ return e.length === 0 ? `<div${g} style="${s}"></div>` : `<div${g} data-acc-mode="${t}" data-acc-icon-style="${n}" style="${s}"><div class="plexo-acc-group">${Y(e, p, {
1311
+ iconStyle: n,
1312
+ iconOnLeft: r,
1313
+ showDividers: i,
1314
+ animated: o
1315
+ })}</div>${`<script>(function(){var root=document.querySelector(${JSON.stringify(`[data-plexo-id="${f.id}"]`)});if(!root)return;var mode=root.getAttribute('data-acc-mode')||'single';var iconStyle=root.getAttribute('data-acc-icon-style')||'chevron';function setIconState(icon,open){if(!icon)return;if(iconStyle==='plus'){icon.textContent=open?'−':'+';}else if(iconStyle==='arrow'){icon.style.transform=open?'rotate(90deg)':'';}else if(iconStyle==='chevron'){icon.style.transform=open?'rotate(180deg)':'';}}var headers=root.querySelectorAll('[data-acc-header]');headers.forEach(function(header){header.addEventListener('click',function(){var item=header.parentElement;var group=item.parentElement;var panel=item.children[1];var isOpen=header.getAttribute('data-acc-open')==='1';if(mode!=='multi'&&group){Array.prototype.forEach.call(group.children,function(sib){if(sib===item)return;var sh=sib.children[0];var sp=sib.children[1];if(sh){sh.setAttribute('data-acc-open','0');setIconState(sh.querySelector('[data-acc-icon]'),false);}if(sp)sp.style.gridTemplateRows='0fr';});}var next=!isOpen;header.setAttribute('data-acc-open',next?'1':'0');panel.style.gridTemplateRows=next?'1fr':'0fr';setIconState(header.querySelector('[data-acc-icon]'),next);});});})();<\/script>`}</div>`;
1264
1316
  }
1265
- default: return q(d.type);
1317
+ default: return X(f.type);
1266
1318
  }
1267
- }, Y = (e, t) => {
1319
+ }, Q = (e, t) => {
1268
1320
  if (!e || typeof e != "object") return "";
1269
- let n = L(e);
1321
+ let n = R(e);
1270
1322
  if (!n) return `\n <!-- ROW SKIPPED (type="${typeof e.type == "string" ? e.type : "unknown"}"${e.id ? `, id="${e.id}"` : ""}): this row has no 'columns' array and its shorthand content (e.g. a list of items/links) can't be auto-converted without losing data. Provide a fully hydrated row with 'columns' and 'elements' instead. -->`;
1271
- let r = R(n.style || {}), i = W("id", n.htmlId), a = W("class", n.htmlClass), o = n.id || `row-${Math.random().toString(36).substring(2, 9)}`;
1272
- V(t, o, n.style, "tablet", n.styleTablet), V(t, o, n.style, "mobile", n.styleMobile);
1323
+ let r = z(n.style || {}), i = G("id", n.htmlId), a = G("class", n.htmlClass), o = n.id || `row-${Math.random().toString(36).substring(2, 9)}`;
1324
+ H(t, o, n.style, "tablet", n.styleTablet), H(t, o, n.style, "mobile", n.styleMobile);
1273
1325
  let s = `\n <!-- ROW START: ${n.id || "row"} -->`;
1274
1326
  s += `\n <div data-plexo-id="${o}"${i}${a} class="plexo-row" style="display: flex; flex-wrap: wrap; margin-left: -8px; margin-right: -8px; ${r}">`;
1275
1327
  let c = Array.isArray(n.columns) ? n.columns : [];
1276
1328
  for (let e of c) {
1277
1329
  if (!e) continue;
1278
- let n = e.styles || e.style || {}, r = R(n), i = W("id", e.attrs?.htmlId), a = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "", o = e.id || `col-${Math.random().toString(36).substring(2, 9)}`;
1279
- V(t, o, n, "tablet", e.stylesTablet), V(t, o, n, "mobile", e.stylesMobile), s += `\n <!-- COLUMN START: ${e.id || "col"} -->`, s += `\n <div data-plexo-id="${o}"${i} class="plexo-col${a}" style="box-sizing: border-box; padding-left: 8px; padding-right: 8px; width: ${e.width || "100%"}; ${r}">`;
1330
+ let n = e.styles || e.style || {}, r = z(n), i = G("id", e.attrs?.htmlId), a = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "", o = e.id || `col-${Math.random().toString(36).substring(2, 9)}`;
1331
+ H(t, o, n, "tablet", e.stylesTablet), H(t, o, n, "mobile", e.stylesMobile), s += `\n <!-- COLUMN START: ${e.id || "col"} -->`, s += `\n <div data-plexo-id="${o}"${i} class="plexo-col${a}" style="box-sizing: border-box; padding-left: 8px; padding-right: 8px; width: ${e.width || "100%"}; ${r}">`;
1280
1332
  let c = Array.isArray(e.elements) ? e.elements : [];
1281
1333
  for (let e of c) {
1282
1334
  if (!e) continue;
1283
- let n = e.attributes || {}, r = typeof n.htmlClassNames == "string" ? n.htmlClassNames : typeof n.htmlClass == "string" ? n.htmlClass : typeof n.className == "string" ? n.className : "", i = W("id", n.htmlId), a = W("class", r), o = e.style?.display, c = o === "inline-block" || o === "inline" || o === "inline-flex" ? `margin-bottom: 16px; display: ${o}; vertical-align: top;` : "margin-bottom: 16px;";
1284
- V(t, e.id, e.style, "tablet", e.styleTablet), V(t, e.id, e.style, "mobile", e.styleMobile), s += `\n <div${i}${a} style="${c}">`, s += `\n ${J(e)}`, s += "\n </div>";
1335
+ let n = e.attributes || {}, r = typeof n.htmlClassNames == "string" ? n.htmlClassNames : typeof n.htmlClass == "string" ? n.htmlClass : typeof n.className == "string" ? n.className : "", i = G("id", n.htmlId), a = G("class", r), o = e.style?.display, c = o === "inline-block" || o === "inline" || o === "inline-flex" ? `margin-bottom: 16px; display: ${o}; vertical-align: top;` : "margin-bottom: 16px;";
1336
+ H(t, e.id, e.style, "tablet", e.styleTablet), H(t, e.id, e.style, "mobile", e.styleMobile), s += `\n <div${i}${a} style="${c}">`, s += `\n ${Z(e)}`, s += "\n </div>";
1285
1337
  }
1286
1338
  let l = Array.isArray(e.nestedRows) ? e.nestedRows : [];
1287
- for (let e of l) s += Y(e, t);
1339
+ for (let e of l) s += Q(e, t);
1288
1340
  s += "\n </div>";
1289
1341
  }
1290
1342
  return s += "\n </div>", s;
1291
- }, X = (e) => {
1343
+ }, $ = (e) => {
1292
1344
  if (!e || typeof e != "object") return "<!-- Empty template -->";
1293
1345
  let t = e.designJson || e.template || e, n = t.body || (Array.isArray(t.rows) ? {
1294
1346
  style: t.style || {},
@@ -1315,20 +1367,20 @@ var J = (d) => {
1315
1367
  "textColor"
1316
1368
  ], a = {};
1317
1369
  for (let e of Object.keys(r)) i.includes(e) || (a[e] = r[e]);
1318
- let o = R(a), s = typeof r.htmlTitle == "string" && r.htmlTitle.trim() ? r.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", c = W("id", r.htmlId), l = W("class", r.htmlClass), u = typeof r.customCss == "string" && r.customCss.trim() ? r.customCss.trim() : "", d = typeof r.customJs == "string" && r.customJs.trim() ? r.customJs.trim() : "", f = Array.isArray(n.rows) ? n.rows : Array.isArray(t.rows) ? t.rows : Array.isArray(e.rows) ? e.rows : [], p = x(b(f, [r.fontFamily])), m = {
1370
+ let o = z(a), s = typeof r.htmlTitle == "string" && r.htmlTitle.trim() ? r.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", c = G("id", r.htmlId), l = G("class", r.htmlClass), u = typeof r.customCss == "string" && r.customCss.trim() ? r.customCss.trim() : "", d = typeof r.customJs == "string" && r.customJs.trim() ? r.customJs.trim() : "", f = Array.isArray(n.rows) ? n.rows : Array.isArray(t.rows) ? t.rows : Array.isArray(e.rows) ? e.rows : [], p = S(x(f, [r.fontFamily])), m = {
1319
1371
  tablet: [],
1320
1372
  mobile: []
1321
1373
  }, h = "";
1322
- for (let e of f) h += Y(e, m);
1374
+ for (let e of f) h += Q(e, m);
1323
1375
  let g = m.tablet.length ? `\n ${m.tablet.join("\n ")}` : "", _ = m.mobile.length ? `\n ${m.mobile.join("\n ")}` : "", v = `<!DOCTYPE html>
1324
1376
  <html>
1325
1377
  <head>
1326
1378
  <meta charset="utf-8">
1327
- <title>${U(s)}</title>
1379
+ <title>${W(s)}</title>
1328
1380
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
1329
1381
  ${p ? `<link rel="stylesheet" href="${p}">` : ""}
1330
1382
  <style>
1331
- body { margin: 0; font-family: ${P}; }
1383
+ body { margin: 0; font-family: ${F}; }
1332
1384
  .plexo-row {
1333
1385
  display: flex;
1334
1386
  flex-wrap: wrap;
@@ -1358,14 +1410,14 @@ ${d ? ` <script>\n${d}\n <\/script>` : ""}
1358
1410
  </body>
1359
1411
  </html>`, v = v.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1"), v;
1360
1412
  };
1361
- function Z(e) {
1362
- return X(e).replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
1413
+ function ee(e) {
1414
+ return $(e).replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
1363
1415
  }
1364
- function Q(e) {
1365
- return X(e);
1416
+ function te(e) {
1417
+ return $(e);
1366
1418
  }
1367
- function $(e) {
1419
+ function ne(e) {
1368
1420
  return e;
1369
1421
  }
1370
1422
  //#endregion
1371
- export { v as _, Q as a, f as b, H as c, N as d, x as f, g, p as h, X as i, z as l, _ as m, G as n, Z as o, b as p, V as r, L as s, P as t, $ as u, m as v, d as x, h as y };
1423
+ export { y as _, te as a, p as b, U as c, P as d, S as f, _ as g, m as h, $ as i, B as l, v as m, K as n, ee as o, x as p, H as r, R as s, F as t, ne as u, h as v, f as x, g as y };