@charisol/plexo-sdk 1.1.16 → 1.2.0

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.
Files changed (36) hide show
  1. package/dist/PlexoRenderer.d.ts +8 -0
  2. package/dist/{compiler-Dr4lNAM3.js → compiler-nmaKKdLq.js} +194 -188
  3. package/dist/compiler.js +2 -2
  4. package/dist/compilerClient-DW7b0Ifk.js +215 -0
  5. package/dist/compilerClient.js +2 -168
  6. package/dist/components/CodeViewer.d.ts +7 -0
  7. package/dist/components/editor/frame/AccordionHeaderOverlay.d.ts +15 -0
  8. package/dist/components/editor/frame/CompiledCanvasEditorOverlay.d.ts +30 -0
  9. package/dist/components/editor/frame/CompiledCanvasFrame.d.ts +16 -0
  10. package/dist/components/editor/frame/DndOverlayNode.d.ts +59 -0
  11. package/dist/components/editor/frame/FrameTextToolbar.d.ts +29 -0
  12. package/dist/components/editor/frame/TableCellOverlay.d.ts +23 -0
  13. package/dist/components/editor/frame/useAccordionHeaderRects.d.ts +21 -0
  14. package/dist/components/editor/frame/useCanvasEngine.d.ts +25 -0
  15. package/dist/components/editor/frame/useCompiledCanvasHtml.d.ts +41 -0
  16. package/dist/components/editor/frame/useFrameNodeRects.d.ts +18 -0
  17. package/dist/components/editor/frame/useFrameTextEditing.d.ts +47 -0
  18. package/dist/components/editor/frame/useMeasuredFrameNodes.d.ts +13 -0
  19. package/dist/components/editor/frame/useTableCellRects.d.ts +29 -0
  20. package/dist/{iconSvgStatic-D04qA352.js → iconSvgStatic-CGue7nyp.js} +64 -48
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.js +47234 -46851
  23. package/dist/mjmlBrowser-DFgIYJ2a.js +39283 -0
  24. package/dist/plexo-sdk.css +1 -1
  25. package/dist/sanitize.js +2 -0
  26. package/dist/sanitizeCompiledHtml-C_sPjL3B.js +5079 -0
  27. package/dist/utilities/compiler.d.ts +4 -1
  28. package/dist/utilities/compilerClient.d.ts +4 -1
  29. package/dist/utilities/elementResolvers.d.ts +26 -7
  30. package/dist/utilities/instrumentation.d.ts +54 -0
  31. package/dist/utilities/mjmlBrowser.d.ts +19 -0
  32. package/dist/utilities/playground.helpers.d.ts +0 -18
  33. package/dist/utilities/playground.interfaces.d.ts +13 -0
  34. package/dist/utilities/sanitizeCompiledHtml.d.ts +10 -0
  35. package/dist/utilities/useApiKeyValidation.d.ts +6 -0
  36. package/package.json +17 -2
@@ -1,6 +1,6 @@
1
- import { a as e, c as t, f as n, g as r, h as i, i as a, l as o, m as s, n as c, o as l, p as u, r as d, s as f, t as p, u as m, x as h, y as g } from "./iconSvgStatic-D04qA352.js";
1
+ import { a as e, c as t, d as n, f as r, g as i, h as a, i as o, l as s, m as c, n as l, o as u, p as d, r as f, s as p, t as m, u as h, x as g, y as _ } from "./iconSvgStatic-CGue7nyp.js";
2
2
  //#region src/utilities/playground.constants.ts
3
- var _ = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, v = [
3
+ var v = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, y = [
4
4
  {
5
5
  id: "all",
6
6
  label: "All sources"
@@ -17,7 +17,7 @@ var _ = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, v
17
17
  id: "pixabay",
18
18
  label: "Pixabay"
19
19
  }
20
- ], y = [
20
+ ], b = [
21
21
  {
22
22
  id: "surface-book",
23
23
  label: "Surface Book",
@@ -84,10 +84,10 @@ var _ = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, v
84
84
  width: 375,
85
85
  category: "mobile"
86
86
  }
87
- ], b = 1280, x = Object.entries(g).map(([e, t]) => ({
87
+ ], x = 1280, S = Object.entries(_).map(([e, t]) => ({
88
88
  id: e,
89
89
  label: t.label
90
- })), S = [
90
+ })), C = [
91
91
  {
92
92
  label: "Text",
93
93
  value: "text"
@@ -120,7 +120,7 @@ var _ = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, v
120
120
  label: "Checkbox",
121
121
  value: "checkbox"
122
122
  }
123
- ], C = [
123
+ ], w = [
124
124
  {
125
125
  label: "1 Column",
126
126
  widths: ["100%"],
@@ -169,7 +169,7 @@ var _ = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, v
169
169
  "25%"
170
170
  ]
171
171
  }
172
- ], w = [
172
+ ], T = [
173
173
  {
174
174
  label: "Roboto",
175
175
  value: "'Roboto', sans-serif",
@@ -570,8 +570,8 @@ var _ = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, v
570
570
  value: "'Great Vibes', cursive",
571
571
  style: "handwriting"
572
572
  }
573
- ], T = new Map(w.map((e) => [e.value, e.label]));
574
- function E(e, t = []) {
573
+ ], E = new Map(T.map((e) => [e.value, e.label]));
574
+ function D(e, t = []) {
575
575
  let n = /* @__PURE__ */ new Set(), r = (e) => {
576
576
  if (!e) return;
577
577
  let t = Array.isArray(e.columns) ? e.columns : [];
@@ -589,17 +589,17 @@ function E(e, t = []) {
589
589
  for (let e of t) typeof e == "string" && e.trim() && n.add(e.trim());
590
590
  return n;
591
591
  }
592
- function D(e) {
592
+ function O(e) {
593
593
  let t = /* @__PURE__ */ new Set();
594
594
  for (let n of e) {
595
- let e = T.get(n);
595
+ let e = E.get(n);
596
596
  e && t.add(e);
597
597
  }
598
598
  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`;
599
599
  }
600
600
  //#endregion
601
601
  //#region src/utilities/responsiveDefaults.ts
602
- var O = {
602
+ var k = {
603
603
  tablet: {
604
604
  thresholdPx: 24,
605
605
  scale: .85,
@@ -610,7 +610,7 @@ var O = {
610
610
  scale: .7,
611
611
  floorPx: 14
612
612
  }
613
- }, ee = {
613
+ }, A = {
614
614
  tablet: {
615
615
  thresholdPx: 320,
616
616
  scale: .8,
@@ -621,7 +621,7 @@ var O = {
621
621
  scale: .55,
622
622
  floorPx: 140
623
623
  }
624
- }, k = {
624
+ }, j = {
625
625
  tablet: {
626
626
  thresholdPx: 48,
627
627
  scale: .75,
@@ -632,7 +632,7 @@ var O = {
632
632
  scale: .55,
633
633
  floorPx: 16
634
634
  }
635
- }, A = {
635
+ }, M = {
636
636
  tablet: {
637
637
  thresholdPx: 500,
638
638
  scale: 1,
@@ -643,7 +643,7 @@ var O = {
643
643
  scale: 1,
644
644
  floorPx: 0
645
645
  }
646
- }, j = ["fontSize"], M = [
646
+ }, ee = ["fontSize"], te = [
647
647
  "height",
648
648
  "minHeight",
649
649
  "maxHeight"
@@ -671,27 +671,27 @@ function I(e, t) {
671
671
  function L(e, t) {
672
672
  if (!e || typeof e != "object") return {};
673
673
  let n = {};
674
- for (let r of j) {
674
+ for (let r of ee) {
675
675
  let i = F(e[r]);
676
676
  if (i === null) continue;
677
- let a = I(i, O[t]);
677
+ let a = I(i, k[t]);
678
678
  a !== null && (n[r] = `${a}px`);
679
679
  }
680
- for (let r of M) {
680
+ for (let r of te) {
681
681
  let i = F(e[r]);
682
682
  if (i === null) continue;
683
- let a = I(i, ee[t]);
683
+ let a = I(i, A[t]);
684
684
  a !== null && (n[r] = `${a}px`);
685
685
  }
686
686
  for (let r of N) {
687
687
  let i = F(e[r]);
688
688
  if (i === null) continue;
689
- let a = I(i, k[t]);
689
+ let a = I(i, j[t]);
690
690
  a !== null && (n[r] = `${a}px`);
691
691
  }
692
692
  for (let r of P) {
693
693
  let i = F(e[r]);
694
- i !== null && i >= A[t].thresholdPx && (n[r] = "100%");
694
+ i !== null && i >= M[t].thresholdPx && (n[r] = "100%");
695
695
  }
696
696
  return n;
697
697
  }
@@ -1044,7 +1044,7 @@ var K = () => ({
1044
1044
  "buttonWidth",
1045
1045
  "buttonHeight",
1046
1046
  "buttonAlign"
1047
- ], X = (e) => {
1047
+ ], ne = (e) => {
1048
1048
  if (!e || typeof e != "object") return "";
1049
1049
  let t = e.kind || "text", n = q(e.name || e.id || "field"), r = e.required ? " required" : "", i = V({
1050
1050
  fontSize: e.fontSize || "13px",
@@ -1059,14 +1059,14 @@ var K = () => ({
1059
1059
  value: e.name || "option"
1060
1060
  }]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${q(r?.value ?? "")}" />${r?.label ?? r?.value ?? ""}</label>`).join("")}</div>` : `${a}<input type="${q(t)}" name="${n}" placeholder="${q(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r} />`;
1061
1061
  };
1062
- function te(e, t, n) {
1062
+ function re(e, t, n) {
1063
1063
  if (e === "none") return "";
1064
1064
  let r = q(t);
1065
1065
  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>`;
1066
1066
  }
1067
- function Z(e, t, n) {
1068
- return e.map((r, i) => {
1069
- let a = i === e.length - 1, o = V({ borderBottom: n.showDividers && !a ? `1px solid ${t.dividerColor || "#e2e8f0"}` : void 0 }), s = V({
1067
+ function X(e, t, n, r, i = []) {
1068
+ return e.map((a, o) => {
1069
+ let s = [...i, o], c = o === e.length - 1, l = V({ borderBottom: n.showDividers && !c ? `1px solid ${t.dividerColor || "#e2e8f0"}` : void 0 }), u = V({
1070
1070
  display: "flex",
1071
1071
  alignItems: "center",
1072
1072
  gap: "8px",
@@ -1075,71 +1075,71 @@ function Z(e, t, n) {
1075
1075
  textAlign: "left",
1076
1076
  flexDirection: n.iconOnLeft ? "row-reverse" : "row",
1077
1077
  padding: t.padding || "14px",
1078
- backgroundColor: r.defaultOpen ? t.headerActiveBackgroundColor || t.headerBackgroundColor || "#ffffff" : t.headerBackgroundColor || "#ffffff",
1079
- color: r.defaultOpen ? t.headerActiveTextColor || t.headerTextColor || "#0f172a" : t.headerTextColor || "#0f172a",
1078
+ backgroundColor: a.defaultOpen ? t.headerActiveBackgroundColor || t.headerBackgroundColor || "#ffffff" : t.headerBackgroundColor || "#ffffff",
1079
+ color: a.defaultOpen ? t.headerActiveTextColor || t.headerTextColor || "#0f172a" : t.headerTextColor || "#0f172a",
1080
1080
  fontSize: t.headerFontSize || "14px",
1081
1081
  fontWeight: t.headerFontWeight || 600,
1082
1082
  fontFamily: t.headerFontFamily,
1083
1083
  border: "none",
1084
1084
  font: "inherit",
1085
1085
  background: void 0
1086
- }), c = V({
1086
+ }), d = V({
1087
1087
  display: "grid",
1088
- gridTemplateRows: r.defaultOpen ? "1fr" : "0fr",
1088
+ gridTemplateRows: a.defaultOpen ? "1fr" : "0fr",
1089
1089
  transition: n.animated ? "grid-template-rows 0.25s ease" : void 0,
1090
1090
  backgroundColor: t.contentBackgroundColor || "#ffffff"
1091
- }), l = V({
1091
+ }), f = V({
1092
1092
  padding: t.contentPadding || "14px",
1093
1093
  color: t.contentTextColor || "#475569",
1094
1094
  fontSize: t.contentFontSize || "13px",
1095
1095
  whiteSpace: "pre-wrap"
1096
- }), u = te(n.iconStyle, t.iconColor || "#64748b", !!r.defaultOpen), d = q(r.title), f = q(r.content), p = r.children.length ? `<div class="plexo-acc-group" style="margin-top: 10px;">${Z(r.children, t, n)}</div>` : "";
1097
- 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>`;
1096
+ }), p = re(n.iconStyle, t.iconColor || "#64748b", !!a.defaultOpen), m = q(a.title), h = q(a.content), g = a.children.length ? `<div class="plexo-acc-group" style="margin-top: 10px;">${X(a.children, t, n, r, s)}</div>` : "";
1097
+ return `<div class="plexo-acc-item" style="${l}"><button type="button"${` data-plexo-acc-item="${q(r)}|${s.join(".")}"`} data-acc-header data-acc-open="${a.defaultOpen ? "1" : "0"}" style="${u}"><span style="flex: 1;">${m}</span>${p}</button><div data-acc-panel style="${d}"><div style="overflow: hidden;"><div style="${f}">${h}${g}</div></div></div></div>`;
1098
1098
  }).join("");
1099
1099
  }
1100
- function ne(e) {
1100
+ function ie(e) {
1101
1101
  return `<!-- Unsupported block ${String(e)} -->`;
1102
1102
  }
1103
- var re = (h) => {
1104
- if (!h || typeof h != "object") return "";
1105
- let g = h.style || {}, _ = V(h.type === "form_container" ? {
1103
+ var ae = (g) => {
1104
+ if (!g || typeof g != "object") return "";
1105
+ let _ = g.style || {}, v = g.type === "heading" || g.type === "paragraph" || g.type === "text", y = v ? c(g).autoWidth : !1, b = y ? Object.fromEntries(Object.entries(_).filter(([e]) => e !== "width")) : _, x = V(g.type === "form_container" ? {
1106
1106
  ...K(),
1107
- ...g
1108
- } : g), v = h.attributes || {}, y = ` data-plexo-id="${q(h.id)}"`;
1109
- switch (h.type) {
1110
- case "heading": return `<h2${y} style="margin-top: 0; margin-bottom: 8px; ${_}">${v.text || "Heading"}</h2>`;
1111
- case "paragraph": return `<p${y} style="margin-top: 0; margin-bottom: 12px; ${_}">${v.text || "Paragraph text content."}</p>`;
1112
- case "text": return `<div${y} style="${_}">${v.text || ""}</div>`;
1107
+ ..._
1108
+ } : b), S = g.attributes || {}, C = ` data-plexo-id="${q(g.id)}"`, w = (e) => y ? `<div style="text-align: ${_.textAlign || "left"};">${e}</div>` : e, T = `${y ? "display: inline-block; " : ""}${v && _.height ? "overflow: hidden; " : ""}`;
1109
+ switch (g.type) {
1110
+ case "heading": return w(`<h2${C} style="margin-top: 0; margin-bottom: 8px; ${T}${x}">${S.text || "Heading"}</h2>`);
1111
+ case "paragraph": return w(`<p${C} style="margin-top: 0; margin-bottom: 12px; ${T}${x}">${S.text || "Paragraph text content."}</p>`);
1112
+ case "text": return w(`<div${C} style="${T}${x}">${S.text || ""}</div>`);
1113
1113
  case "button": {
1114
- let e = l(h), t = V({
1115
- ...g,
1114
+ let e = u(g), t = V({
1115
+ ..._,
1116
1116
  width: e.width,
1117
1117
  height: e.height
1118
1118
  });
1119
- return `<div style="text-align: ${g.textAlign || "center"};"><a${y} href="${v.href || "#"}" target="${v.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${t}">${v.text || "Button"}</a></div>`;
1119
+ return `<div style="text-align: ${_.textAlign || "center"};"><a${C} href="${S.href || "#"}" target="${S.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${t}">${S.text || "Button"}</a></div>`;
1120
1120
  }
1121
1121
  case "image": {
1122
- let e = m(h), t = g.textAlign === "center" ? "margin: 0 auto; display: block;" : g.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", n = V({
1123
- ...g,
1122
+ let e = h(g), t = _.textAlign === "center" ? "margin: 0 auto; display: block;" : _.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", n = V({
1123
+ ..._,
1124
1124
  width: e.width,
1125
1125
  height: e.height
1126
1126
  });
1127
- return `<img${y} src="${v.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${v.alt || ""}" style="${n} ${t}" />`;
1127
+ return `<img${C} src="${S.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${S.alt || ""}" style="${n} ${t}" />`;
1128
1128
  }
1129
- case "divider": return `<hr${y} style="border: 0; border-top: ${g.borderWidth || "1px"} ${g.borderStyle || "solid"} ${g.borderColor || "#334155"}; ${_}" />`;
1130
- case "spacer": return `<div${y} style="height: ${g.height || "24px"};"></div>`;
1131
- case "card": return `<div${y} style="${_}">
1132
- <h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${v.title || "Card Title"}</h3>
1133
- <p style="margin: 0; color: #94a3b8; font-size: 14px;">${v.description || "Card description."}</p>
1129
+ case "divider": return `<hr${C} style="border: 0; border-top: ${_.borderWidth || "1px"} ${_.borderStyle || "solid"} ${_.borderColor || "#334155"}; ${x}" />`;
1130
+ case "spacer": return `<div${C} style="height: ${_.height || "24px"};"></div>`;
1131
+ case "card": return `<div${C} style="${x}">
1132
+ <h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${S.title || "Card Title"}</h3>
1133
+ <p style="margin: 0; color: #94a3b8; font-size: 14px;">${S.description || "Card description."}</p>
1134
1134
  </div>`;
1135
1135
  case "form_container": {
1136
1136
  let n = {
1137
1137
  ...K(),
1138
- ...g
1138
+ ..._
1139
1139
  }, r = {};
1140
1140
  for (let e of Object.keys(n)) Y.includes(e) || (r[e] = n[e]);
1141
- r.height = f(h);
1142
- let i = V(r), a = c(t(Array.isArray(v.fields) ? v.fields : [])), o = n.fieldSpacing || "12px", s = a.map((e) => `<div style="margin-bottom: ${o};">${X(e)}</div>`).join(""), l = v.buttonAutoWidth === !1 ? n.buttonWidth || "100%" : "auto", u = n.buttonAlign === "left" ? "flex-start" : n.buttonAlign === "right" ? "flex-end" : "center", d = v.buttonAutoHeight === !1 && n.buttonHeight || "auto", p = V({
1141
+ r.height = p(g);
1142
+ let i = V(r), a = l(t(Array.isArray(S.fields) ? S.fields : [])), o = n.fieldSpacing || "12px", s = a.map((e) => `<div style="margin-bottom: ${o};">${ne(e)}</div>`).join(""), c = S.buttonAutoWidth === !1 ? n.buttonWidth || "100%" : "auto", u = n.buttonAlign === "left" ? "flex-start" : n.buttonAlign === "right" ? "flex-end" : "center", d = S.buttonAutoHeight === !1 && n.buttonHeight || "auto", f = V({
1143
1143
  backgroundColor: n.buttonBackgroundColor,
1144
1144
  color: n.buttonTextColor,
1145
1145
  borderRadius: n.buttonBorderRadius,
@@ -1153,21 +1153,21 @@ var re = (h) => {
1153
1153
  marginRight: e(n.buttonMarginRight, n.buttonMargin, "right"),
1154
1154
  fontSize: n.buttonFontSize,
1155
1155
  fontWeight: n.buttonFontWeight,
1156
- width: l,
1156
+ width: c,
1157
1157
  height: d
1158
1158
  });
1159
- return `<form${y} action="${q(v.actionUrl || v.action || "#")}" method="${q(v.method || "POST")}" style="${i}">${s}<div style="display: flex; width: 100%; justify-content: ${u};"><button type="submit" style="border: 0; cursor: pointer; ${p}">${v.submitLabel || "Submit"}</button></div></form>`;
1159
+ return `<form${C} action="${q(S.actionUrl || S.action || "#")}" method="${q(S.method || "POST")}" style="${i}">${s}<div style="display: flex; width: 100%; justify-content: ${u};"><button type="submit" style="border: 0; cursor: pointer; ${f}">${S.submitLabel || "Submit"}</button></div></form>`;
1160
1160
  }
1161
1161
  case "input": {
1162
- let e = v.inputType || v.type || "text", t = q(v.name || v.fieldName || "field"), n = q(v.placeholder || ""), r = v.required ? " required" : "";
1163
- return `<input${y} type="${q(e)}" name="${t}" placeholder="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${_}"${r} />`;
1162
+ let e = S.inputType || S.type || "text", t = q(S.name || S.fieldName || "field"), n = q(S.placeholder || ""), r = S.required ? " required" : "";
1163
+ return `<input${C} type="${q(e)}" name="${t}" placeholder="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${x}"${r} />`;
1164
1164
  }
1165
- case "textarea": return `<textarea${y} name="${q(v.name || v.fieldName || "field")}" placeholder="${q(v.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${_}"${v.required ? " required" : ""}></textarea>`;
1166
- case "select": return `<select${y} name="${q(v.name || v.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${_}"${v.required ? " required" : ""}>${(Array.isArray(v.options) ? v.options : []).map((e) => `<option value="${q(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
1167
- case "html": return `<div${y} style="${V({
1168
- ...g,
1169
- height: o(h, "auto")
1170
- })}">${v.htmlContent || v.text || ""}</div>`;
1165
+ case "textarea": return `<textarea${C} name="${q(S.name || S.fieldName || "field")}" placeholder="${q(S.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${x}"${S.required ? " required" : ""}></textarea>`;
1166
+ case "select": return `<select${C} name="${q(S.name || S.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${x}"${S.required ? " required" : ""}>${(Array.isArray(S.options) ? S.options : []).map((e) => `<option value="${q(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
1167
+ case "html": return `<div${C} style="${V({
1168
+ ..._,
1169
+ height: s(g, "auto")
1170
+ })}">${S.htmlContent || S.text || ""}</div>`;
1171
1171
  case "blog_title":
1172
1172
  case "blog_content":
1173
1173
  case "blog_featured_image":
@@ -1176,17 +1176,17 @@ var re = (h) => {
1176
1176
  case "blog_categories":
1177
1177
  case "blog_comments":
1178
1178
  case "blog_post_list": {
1179
- let e = h.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = V(g);
1180
- return `<div${y} data-plexo-blog-${e}="true"${J("data-plexo-blog-prefix", v.prefix)} style="${t}"></div>`;
1179
+ let e = g.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = V(_);
1180
+ return `<div${C} data-plexo-blog-${e}="true"${J("data-plexo-blog-prefix", S.prefix)} style="${t}"></div>`;
1181
1181
  }
1182
1182
  case "social": {
1183
- let e = u(h), t = g.textAlign === "center" ? "center" : g.textAlign === "right" ? "flex-end" : "flex-start";
1184
- return `<div${y} style="${V({
1185
- padding: g.padding,
1186
- margin: g.margin,
1183
+ let e = r(g), t = _.textAlign === "center" ? "center" : _.textAlign === "right" ? "flex-end" : "flex-start";
1184
+ return `<div${C} style="${V({
1185
+ padding: _.padding,
1186
+ margin: _.margin,
1187
1187
  display: "flex",
1188
1188
  flexWrap: "wrap",
1189
- gap: g.iconSpacing || "8px",
1189
+ gap: _.iconSpacing || "8px",
1190
1190
  justifyContent: t
1191
1191
  })}">${e.map((e) => {
1192
1192
  let t = V({
@@ -1201,150 +1201,153 @@ var re = (h) => {
1201
1201
  justifyContent: "center",
1202
1202
  overflow: "hidden"
1203
1203
  });
1204
- return `<a href="${q(e.url)}" style="${t} text-decoration: none;">${d(e.provider, e.color)}</a>`;
1204
+ return `<a href="${q(e.url)}" style="${t} text-decoration: none;">${f(e.provider, e.color)}</a>`;
1205
1205
  }).join("")}</div>`;
1206
1206
  }
1207
1207
  case "menu": {
1208
- let e = n(h), t = g.textAlign === "center" ? "center" : g.textAlign === "right" ? "flex-end" : "flex-start";
1209
- return `<div${y} style="${V({
1210
- ...g,
1208
+ let e = n(g), t = _.textAlign === "center" ? "center" : _.textAlign === "right" ? "flex-end" : "flex-start";
1209
+ return `<div${C} style="${V({
1210
+ ..._,
1211
1211
  display: "flex",
1212
1212
  flexWrap: "wrap",
1213
1213
  gap: "16px",
1214
1214
  justifyContent: t
1215
- })}">${e.map((e) => `<a href="${q(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${g.fontWeight || 600};">${q(e.label)}</a>`).join("")}</div>`;
1215
+ })}">${e.map((e) => `<a href="${q(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${_.fontWeight || 600};">${q(e.label)}</a>`).join("")}</div>`;
1216
1216
  }
1217
1217
  case "icon": {
1218
- let e = g.fontSize || `${v.iconSize || 48}px`, t = g.color || "#1e293b", n = parseInt(String(e), 10) || 48, r = p(v.iconName, n, t), i = g.textAlign === "right" ? "flex-end" : g.textAlign === "left" ? "flex-start" : "center", a = V({
1219
- padding: g.padding,
1220
- margin: g.margin,
1218
+ let e = _.fontSize || `${S.iconSize || 48}px`, t = _.color || "#1e293b", n = parseInt(String(e), 10) || 48, r = m(S.iconName, n, t), i = _.textAlign === "right" ? "flex-end" : _.textAlign === "left" ? "flex-start" : "center", a = V({
1219
+ padding: _.padding,
1220
+ margin: _.margin,
1221
1221
  display: "flex",
1222
1222
  justifyContent: i
1223
- }), o = typeof v.href == "string" ? v.href.trim() : "", s = `<span style="display: inline-flex; align-items: center; justify-content: center; color: ${t};">${r}</span>`;
1224
- return `<div style="${a}">${o ? `<a${y} href="${q(o)}" target="${v.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${y}>${s}</span>`}</div>`;
1223
+ }), o = typeof S.href == "string" ? S.href.trim() : "", s = `<span style="display: inline-flex; align-items: center; justify-content: center; color: ${t};">${r}</span>`;
1224
+ return `<div style="${a}">${o ? `<a${C} href="${q(o)}" target="${S.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${C}>${s}</span>`}</div>`;
1225
1225
  }
1226
1226
  case "table": {
1227
- let e = s(h), t = `${g.borderWidth || "1px"} ${g.borderStyle || "solid"} ${g.borderColor || "#cbd5e1"}`, n = (n, r, i) => {
1228
- let a = i ? "th" : "td", o = i ? g.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : g.contentBgColor || "#ffffff", s = i ? g.headerTextColor || "#1e293b" : g.contentTextColor || "#475569", c = i ? g.headerTextAlign || "left" : g.contentTextAlign || "left";
1229
- return `<tr>${n.map((e) => {
1230
- let n = V({
1231
- padding: g.cellPadding || "8px",
1227
+ let e = d(g), t = `${_.borderWidth || "1px"} ${_.borderStyle || "solid"} ${_.borderColor || "#cbd5e1"}`, n = (n, r, i, a) => {
1228
+ let o = a ? "th" : "td", s = a ? _.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : _.contentBgColor || "#ffffff", c = a ? _.headerTextColor || "#1e293b" : _.contentTextColor || "#475569", l = a ? _.headerTextAlign || "left" : _.contentTextAlign || "left";
1229
+ return `<tr>${n.map((e, n) => {
1230
+ let r = V({
1231
+ padding: _.cellPadding || "8px",
1232
1232
  border: t,
1233
- backgroundColor: o,
1234
- color: s,
1235
- textAlign: c,
1236
- lineHeight: g.contentLineHeight,
1237
- letterSpacing: g.contentLetterSpacing,
1238
- fontWeight: i ? "700" : void 0
1239
- });
1240
- return `<${a} style="${n}">${e || "&nbsp;"}</${a}>`;
1233
+ backgroundColor: s,
1234
+ color: c,
1235
+ textAlign: l,
1236
+ lineHeight: _.contentLineHeight,
1237
+ letterSpacing: _.contentLetterSpacing,
1238
+ fontWeight: a ? "700" : void 0
1239
+ }), u = ` data-plexo-cell="${q(g.id)}|${i}-${n}"`;
1240
+ return `<${o}${u} style="${r}">${e || "&nbsp;"}</${o}>`;
1241
1241
  }).join("")}</tr>`;
1242
- }, 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(""), c = e.enableFooter && e.cells.length > i ? `<tfoot>${n(e.cells[e.cells.length - 1], e.cells.length - 1, !1)}</tfoot>` : "", l = V({
1242
+ }, r = e.enableHeader && e.cells.length > 0 ? `<thead>${n(e.cells[0], 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, i + t, !1)).join(""), s = e.enableFooter && e.cells.length > i ? `<tfoot>${n(e.cells[e.cells.length - 1], e.cells.length - 1, e.cells.length - 1, !1)}</tfoot>` : "", c = V({
1243
1243
  borderCollapse: "collapse",
1244
1244
  width: "100%"
1245
1245
  });
1246
- return `<div${y} style="${V({
1247
- padding: g.padding,
1248
- margin: g.margin,
1246
+ return `<div${C} style="${V({
1247
+ padding: _.padding,
1248
+ margin: _.margin,
1249
1249
  overflowX: "auto"
1250
- })}"><table style="${l}">${r}<tbody>${o}</tbody>${c}</table></div>`;
1250
+ })}"><table style="${c}">${r}<tbody>${o}</tbody>${s}</table></div>`;
1251
1251
  }
1252
1252
  case "video": {
1253
- let e = r(v.videoUrl), t = v.linkType === "email" ? `mailto:${v.href || ""}` : v.href || v.videoUrl || "#", n = v.target || "_blank";
1254
- return `<div${y} style="${V({
1255
- padding: g.padding,
1256
- margin: g.margin,
1257
- borderRadius: g.borderRadius,
1253
+ let e = i(S.videoUrl), t = S.linkType === "email" ? `mailto:${S.href || ""}` : S.href || S.videoUrl || "#", n = S.target || "_blank";
1254
+ return `<div${C} style="${V({
1255
+ padding: _.padding,
1256
+ margin: _.margin,
1257
+ borderRadius: _.borderRadius,
1258
1258
  overflow: "hidden"
1259
- })}"><a href="${q(t)}" target="${q(n)}" style="position: relative; display: block; text-decoration: none;"><img src="${q(e.thumbnailUrl)}" alt="${q(v.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>`;
1259
+ })}"><a href="${q(t)}" target="${q(n)}" style="position: relative; display: block; text-decoration: none;"><img src="${q(e.thumbnailUrl)}" alt="${q(S.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>`;
1260
1260
  }
1261
1261
  case "timer": {
1262
- let e = v.showLabels !== !1, t = V({
1263
- fontFamily: g.digitsFontFamily,
1264
- fontSize: g.digitsFontSize || "40px",
1265
- color: g.digitsColor || "#1e293b",
1262
+ let e = S.showLabels !== !1, t = V({
1263
+ fontFamily: _.digitsFontFamily,
1264
+ fontSize: _.digitsFontSize || "40px",
1265
+ color: _.digitsColor || "#1e293b",
1266
1266
  fontWeight: "800"
1267
1267
  }), n = V({
1268
- fontFamily: g.labelsFontFamily,
1269
- fontSize: g.labelsFontSize || "16px",
1270
- color: g.labelsColor || "#64748b"
1268
+ fontFamily: _.labelsFontFamily,
1269
+ fontSize: _.labelsFontSize || "16px",
1270
+ color: _.labelsColor || "#64748b"
1271
1271
  }), r = V({
1272
- backgroundColor: g.backgroundColor || "#f8fafc",
1273
- borderRadius: g.borderRadius || "8px",
1274
- padding: g.padding || "16px",
1272
+ backgroundColor: _.backgroundColor || "#f8fafc",
1273
+ borderRadius: _.borderRadius || "8px",
1274
+ padding: _.padding || "16px",
1275
1275
  textAlign: "center"
1276
- }), a = (r, i, a) => `<div style="display: inline-flex; flex-direction: column; align-items: center; padding: 0 10px;"><span data-unit="${r}" style="${t}">${a}</span>${e ? `<span style="${n}">${i}</span>` : ""}</div>`, o = i(v.targetDate), s = q(v.targetDate || "2026-12-31T23:59:59"), c = `<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${h.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>`;
1277
- return `<div${y} data-plexo-target="${s}" style="${r}"><div>${a("days", "Days", o.days)}${a("hours", "Hours", o.hours)}${a("minutes", "Mins", o.minutes)}${a("seconds", "Secs", o.seconds)}</div>${c}</div>`;
1276
+ }), i = (r, i, a) => `<div style="display: inline-flex; flex-direction: column; align-items: center; padding: 0 10px;"><span data-unit="${r}" style="${t}">${a}</span>${e ? `<span style="${n}">${i}</span>` : ""}</div>`, o = a(S.targetDate, S.timezone), s = q(new Date(o.targetTimestamp).toISOString()), c = `<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${g.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>`;
1277
+ return `<div${C} data-plexo-target="${s}" style="${r}"><div>${i("days", "Days", o.days)}${i("hours", "Hours", o.hours)}${i("minutes", "Mins", o.minutes)}${i("seconds", "Secs", o.seconds)}</div>${c}</div>`;
1278
1278
  }
1279
1279
  case "carousel": {
1280
- let e = Array.isArray(v.images) ? v.images : [], t = V({
1281
- padding: g.padding || "10px",
1282
- margin: g.margin,
1283
- backgroundColor: g.backgroundColor,
1280
+ let e = Array.isArray(S.images) ? S.images : [], t = V({
1281
+ padding: _.padding || "10px",
1282
+ margin: _.margin,
1283
+ backgroundColor: _.backgroundColor,
1284
1284
  position: "relative",
1285
1285
  overflow: "hidden",
1286
1286
  borderRadius: "12px"
1287
1287
  });
1288
- if (e.length === 0) return `<div${y} style="${t}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
1289
- let n = Math.min(e.length - 1, Math.max(0, parseInt(String(v.activeIdx), 10) || 0)), r = e.map((e, t) => `<div data-slide-idx="${t}" style="display: ${t === n ? "block" : "none"};"><img src="${q(e.src)}" alt="${q(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;">${q(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>` : "";
1290
- return `<div${y} 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="${h.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>`;
1288
+ if (e.length === 0) return `<div${C} style="${t}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
1289
+ let n = Math.min(e.length - 1, Math.max(0, parseInt(String(S.activeIdx), 10) || 0)), r = e.map((e, t) => `<div data-slide-idx="${t}" style="display: ${t === n ? "block" : "none"};"><img src="${q(e.src)}" alt="${q(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;">${q(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>` : "";
1290
+ return `<div${C} 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="${g.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>`;
1291
1291
  }
1292
1292
  case "accordion": {
1293
- let e = a(h), t = v.mode === "multi" ? "multi" : "single", n = v.iconStyle || "chevron", r = v.iconPosition === "left", i = v.showDividers !== !1, o = v.animation !== "none", s = V({
1294
- border: `${g.borderWidth || "1px"} ${g.borderStyle || "solid"} ${g.borderColor || "#e2e8f0"}`,
1295
- borderRadius: g.borderRadius || "10px",
1293
+ let e = o(g), t = S.mode === "multi" ? "multi" : "single", n = S.iconStyle || "chevron", r = S.iconPosition === "left", i = S.showDividers !== !1, a = S.animation !== "none", s = V({
1294
+ border: `${_.borderWidth || "1px"} ${_.borderStyle || "solid"} ${_.borderColor || "#e2e8f0"}`,
1295
+ borderRadius: _.borderRadius || "10px",
1296
1296
  overflow: "hidden",
1297
- margin: g.margin
1297
+ margin: _.margin
1298
1298
  });
1299
- return e.length === 0 ? `<div${y} style="${s}"></div>` : `<div${y} data-acc-mode="${t}" data-acc-icon-style="${n}" style="${s}"><div class="plexo-acc-group">${Z(e, g, {
1299
+ return e.length === 0 ? `<div${C} style="${s}"></div>` : `<div${C} data-acc-mode="${t}" data-acc-icon-style="${n}" style="${s}"><div class="plexo-acc-group">${X(e, _, {
1300
1300
  iconStyle: n,
1301
1301
  iconOnLeft: r,
1302
1302
  showDividers: i,
1303
- animated: o
1304
- })}</div>${`<script>(function(){var root=document.querySelector(${JSON.stringify(`[data-plexo-id="${h.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>`;
1303
+ animated: a
1304
+ }, g.id)}</div>${`<script>(function(){var root=document.querySelector(${JSON.stringify(`[data-plexo-id="${g.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>`;
1305
1305
  }
1306
- default: return ne(h.type);
1306
+ default: return ie(g.type);
1307
1307
  }
1308
- }, Q = (e, t) => {
1308
+ }, Z = (e, t, n) => {
1309
1309
  if (!e || typeof e != "object") return "";
1310
- let n = B(e);
1311
- 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. -->`;
1312
- let r = V(n.style || {}), i = J("id", n.htmlId), a = J("class", n.htmlClass), o = n.id || `row-${Math.random().toString(36).substring(2, 9)}`;
1313
- W(t, o, n.style, "tablet", n.styleTablet), W(t, o, n.style, "mobile", n.styleMobile);
1314
- let s = `\n <!-- ROW START: ${n.id || "row"} -->`;
1315
- 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}">`;
1316
- let c = Array.isArray(n.columns) ? n.columns : [];
1317
- for (let e of c) {
1310
+ let r = B(e);
1311
+ if (!r) 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. -->`;
1312
+ let i = V(r.style || {}), a = J("id", r.htmlId), o = J("class", r.htmlClass), s = r.id || `row-${Math.random().toString(36).substring(2, 9)}`;
1313
+ W(t, s, r.style, "tablet", r.styleTablet), W(t, s, r.style, "mobile", r.styleMobile);
1314
+ let c = `\n <!-- ROW START: ${r.id || "row"} -->`;
1315
+ c += `\n <div data-plexo-id="${s}"${a}${o} class="plexo-row" style="display: flex; flex-wrap: wrap; margin-left: -8px; margin-right: -8px; ${i}">`;
1316
+ let l = Array.isArray(r.columns) ? r.columns : [];
1317
+ for (let e of l) {
1318
1318
  if (!e) continue;
1319
- let n = e.styles || e.style || {}, r = V(n), i = n.gap || "16px", a = J("id", e.attrs?.htmlId), o = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "", c = e.id || `col-${Math.random().toString(36).substring(2, 9)}`;
1320
- W(t, c, n, "tablet", e.stylesTablet), W(t, c, n, "mobile", e.stylesMobile), s += `\n <!-- COLUMN START: ${e.id || "col"} -->`, s += `\n <div data-plexo-id="${c}"${a} class="plexo-col${o}" style="box-sizing: border-box; padding-left: 8px; padding-right: 8px; width: ${e.width || "100%"}; --plexo-col-gap: ${i}; ${r}">`;
1321
- let l = Array.isArray(e.elements) ? e.elements : [], u = Array.isArray(e.nestedRows) ? e.nestedRows : [], d = new Map(l.map((e) => [e.id, e])), f = new Map(u.map((e) => [e.id, e]));
1322
- for (let n of h({
1319
+ let r = e.styles || e.style || {}, i = V(r), a = r.gap || "16px", o = J("id", e.attrs?.htmlId), s = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "", l = e.id || `col-${Math.random().toString(36).substring(2, 9)}`;
1320
+ W(t, l, r, "tablet", e.stylesTablet), W(t, l, r, "mobile", e.stylesMobile);
1321
+ let u = Array.isArray(e.elements) ? e.elements : [], d = Array.isArray(e.nestedRows) ? e.nestedRows : [], f = n && u.length === 0 && d.length === 0 ? "min-height: 148px; " : "";
1322
+ c += `\n <!-- COLUMN START: ${e.id || "col"} -->`, c += `\n <div data-plexo-id="${l}"${o} class="plexo-col${s}" style="box-sizing: border-box; padding-left: 8px; padding-right: 8px; width: ${e.width || "100%"}; --plexo-col-gap: ${a}; ${f}${i}">`;
1323
+ let p = new Map(u.map((e) => [e.id, e])), m = new Map(d.map((e) => [e.id, e]));
1324
+ for (let r of g({
1323
1325
  ...e,
1324
- elements: l,
1325
- nestedRows: u
1326
+ elements: u,
1327
+ nestedRows: d
1326
1328
  })) {
1327
- let e = d.get(n);
1329
+ let e = p.get(r);
1328
1330
  if (e) {
1329
- let n = e.attributes || {}, r = typeof n.htmlClassNames == "string" ? n.htmlClassNames : typeof n.htmlClass == "string" ? n.htmlClass : typeof n.className == "string" ? n.className : "", a = J("id", n.htmlId), o = J("class", r), c = e.style?.display, l = c === "inline-block" || c === "inline" || c === "inline-flex" ? `margin-bottom: ${i}; display: ${c}; vertical-align: top;` : `margin-bottom: ${i};`;
1330
- W(t, e.id, e.style, "tablet", G(e, e.styleTablet)), W(t, e.id, e.style, "mobile", G(e, e.styleMobile)), s += `\n <div${a}${o} style="${l}">`, s += `\n ${re(e)}`, s += "\n </div>";
1331
+ let n = e.attributes || {}, r = typeof n.htmlClassNames == "string" ? n.htmlClassNames : typeof n.htmlClass == "string" ? n.htmlClass : typeof n.className == "string" ? n.className : "", i = J("id", n.htmlId), o = J("class", r), s = e.style?.display, l = s === "inline-block" || s === "inline" || s === "inline-flex" ? `margin-bottom: ${a}; display: ${s}; vertical-align: top;` : `margin-bottom: ${a};`;
1332
+ W(t, e.id, e.style, "tablet", G(e, e.styleTablet)), W(t, e.id, e.style, "mobile", G(e, e.styleMobile)), c += `\n <div${i}${o} style="${l}">`, c += `\n ${ae(e)}`, c += "\n </div>";
1331
1333
  continue;
1332
1334
  }
1333
- let r = f.get(n);
1334
- r && (s += Q(r, t));
1335
+ let i = m.get(r);
1336
+ i && (c += Z(i, t, n));
1335
1337
  }
1336
- s += "\n </div>";
1338
+ c += "\n </div>";
1337
1339
  }
1338
- return s += "\n </div>", s;
1339
- }, $ = (e) => {
1340
+ return c += "\n </div>", c;
1341
+ }, Q = (e, t) => {
1342
+ let n = t?.canvasEditorPadding ?? !1;
1340
1343
  if (!e || typeof e != "object") return "<!-- Empty template -->";
1341
- let t = e.designJson || e.template || e, n = t.body || (Array.isArray(t.rows) ? {
1342
- style: t.style || {},
1343
- rows: t.rows
1344
+ let r = e.designJson || e.template || e, i = r.body || (Array.isArray(r.rows) ? {
1345
+ style: r.style || {},
1346
+ rows: r.rows
1344
1347
  } : {
1345
1348
  style: {},
1346
1349
  rows: []
1347
- }), r = { ...n.style || {} };
1350
+ }), a = { ...i.style || {} };
1348
1351
  for (let e of [
1349
1352
  "backgroundColor",
1350
1353
  "background",
@@ -1352,9 +1355,9 @@ var re = (h) => {
1352
1355
  "textColor",
1353
1356
  "fontFamily",
1354
1357
  "htmlTitle"
1355
- ]) r[e] === void 0 && (n[e] === void 0 ? t[e] !== void 0 && (r[e] = t[e]) : r[e] = n[e]);
1356
- r.backgroundColor && !r.background ? r.background = r.backgroundColor : r.background && !r.backgroundColor && (r.backgroundColor = r.background), r.textColor && !r.color && (r.color = r.textColor);
1357
- let i = [
1358
+ ]) a[e] === void 0 && (i[e] === void 0 ? r[e] !== void 0 && (a[e] = r[e]) : a[e] = i[e]);
1359
+ a.backgroundColor && !a.background ? a.background = a.backgroundColor : a.background && !a.backgroundColor && (a.backgroundColor = a.background), a.textColor && !a.color && (a.color = a.textColor);
1360
+ let o = [
1358
1361
  "htmlTitle",
1359
1362
  "htmlId",
1360
1363
  "htmlClass",
@@ -1362,21 +1365,21 @@ var re = (h) => {
1362
1365
  "customJs",
1363
1366
  "textColor",
1364
1367
  "favicon"
1365
- ], a = {};
1366
- for (let e of Object.keys(r)) i.includes(e) || (a[e] = r[e]);
1367
- let o = V(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 = J("id", r.htmlId), l = J("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 = typeof r.favicon == "string" && r.favicon.trim() ? r.favicon.trim() : "", p = Array.isArray(n.rows) ? n.rows : Array.isArray(t.rows) ? t.rows : Array.isArray(e.rows) ? e.rows : [], m = D(E(p, [r.fontFamily])), h = {
1368
+ ], s = {};
1369
+ for (let e of Object.keys(a)) o.includes(e) || (s[e] = a[e]);
1370
+ let c = V(s), l = typeof a.htmlTitle == "string" && a.htmlTitle.trim() ? a.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", u = J("id", a.htmlId), d = J("class", a.htmlClass), f = typeof a.customCss == "string" && a.customCss.trim() ? a.customCss.trim() : "", p = typeof a.customJs == "string" && a.customJs.trim() ? a.customJs.trim() : "", m = typeof a.favicon == "string" && a.favicon.trim() ? a.favicon.trim() : "", h = Array.isArray(i.rows) ? i.rows : Array.isArray(r.rows) ? r.rows : Array.isArray(e.rows) ? e.rows : [], g = O(D(h, [a.fontFamily])), _ = {
1368
1371
  tablet: [],
1369
1372
  mobile: []
1370
- }, g = "";
1371
- for (let e of p) g += Q(e, h);
1372
- let _ = h.tablet.length ? `\n ${h.tablet.join("\n ")}` : "", v = h.mobile.length ? `\n ${h.mobile.join("\n ")}` : "", y = `<!DOCTYPE html>
1373
+ }, v = "";
1374
+ for (let e of h) v += Z(e, _, n);
1375
+ let y = _.tablet.length ? `\n ${_.tablet.join("\n ")}` : "", b = _.mobile.length ? `\n ${_.mobile.join("\n ")}` : "", x = `<!DOCTYPE html>
1373
1376
  <html>
1374
1377
  <head>
1375
1378
  <meta charset="utf-8">
1376
- <title>${q(s)}</title>
1377
- ${f ? `<link rel="icon" href="${q(f)}">` : ""}
1379
+ <title>${q(l)}</title>
1380
+ ${m ? `<link rel="icon" href="${q(m)}">` : ""}
1378
1381
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
1379
- ${m ? `<link rel="stylesheet" href="${m}">` : ""}
1382
+ ${g ? `<link rel="stylesheet" href="${g}">` : ""}
1380
1383
  <style>
1381
1384
  body { margin: 0; font-family: ${z}; }
1382
1385
  .plexo-row {
@@ -1386,7 +1389,7 @@ var re = (h) => {
1386
1389
  /* Tablet: auto-scaled fonts/heights/spacing (see utilities/responsiveDefaults.ts) and
1387
1390
  any explicit per-element styleTablet/stylesTablet override — columns stay side by
1388
1391
  side at this width. */
1389
- @media (min-width: 769px) and (max-width: 1024px) {${_}
1392
+ @media (min-width: 769px) and (max-width: 1024px) {${y}
1390
1393
  }
1391
1394
  @media (max-width: 768px) {
1392
1395
  .plexo-row {
@@ -1396,26 +1399,29 @@ var re = (h) => {
1396
1399
  width: 100% !important;
1397
1400
  max-width: 100% !important;
1398
1401
  margin-bottom: var(--plexo-col-gap, 16px);
1399
- }${v}
1402
+ }${b}
1400
1403
  }
1401
1404
  </style>
1402
- ${u ? `<style>\n${u}\n </style>` : ""}
1405
+ ${f ? `<style>\n${f}\n </style>` : ""}
1403
1406
  </head>
1404
- <body${c}${l} style="${o}">
1407
+ <body${u}${d} style="${c}">
1405
1408
  <div style="max-width: 1200px; margin: 0 auto; width: 100%;">`;
1406
- return y += g, y += `\n </div>
1407
- ${d ? ` <script>\n${d}\n <\/script>` : ""}
1409
+ return x += v, x += `\n </div>
1410
+ ${p ? ` <script>\n${p}\n <\/script>` : ""}
1408
1411
  </body>
1409
- </html>`, y = y.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1"), y;
1412
+ </html>`, x = x.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1"), x;
1410
1413
  };
1411
- function ie(e) {
1412
- return $(e).replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
1413
- }
1414
- function ae(e) {
1415
- return $(e);
1414
+ function $(e) {
1415
+ return e.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
1416
1416
  }
1417
1417
  function oe(e) {
1418
+ return $(Q(e));
1419
+ }
1420
+ function se(e) {
1421
+ return Q(e);
1422
+ }
1423
+ function ce(e) {
1418
1424
  return e;
1419
1425
  }
1420
1426
  //#endregion
1421
- export { w as _, ae as a, v as b, K as c, R as d, D as f, S as g, y as h, $ as i, H as l, C as m, Y as n, ie as o, E as p, W as r, B as s, z as t, oe as u, b as v, _ as x, x as y };
1427
+ export { v as S, C as _, se as a, S as b, K as c, ce as d, R as f, b as g, w as h, Q as i, H as l, D as m, Y as n, oe as o, O as p, W as r, B as s, z as t, $ as u, T as v, y as x, x as y };