@emabuild/core 0.1.4 → 0.1.5

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,7 +1,8 @@
1
1
  import { html as p, LitElement as $, css as k } from "lit";
2
2
  import { property as b, customElement as C, state as pt } from "lit/decorators.js";
3
3
  import { unsafeHTML as U } from "lit/directives/unsafe-html.js";
4
- function ht() {
4
+ import { styleMap as ht } from "lit/directives/style-map.js";
5
+ function ut() {
5
6
  const e = {};
6
7
  return {
7
8
  getCounters() {
@@ -18,7 +19,7 @@ function ht() {
18
19
  }
19
20
  };
20
21
  }
21
- class ut {
22
+ class gt {
22
23
  constructor() {
23
24
  this.listeners = /* @__PURE__ */ new Map();
24
25
  }
@@ -45,7 +46,7 @@ class ut {
45
46
  t ? this.listeners.delete(t) : this.listeners.clear();
46
47
  }
47
48
  }
48
- class gt {
49
+ class ft {
49
50
  constructor(t = 50) {
50
51
  this.undoStack = [], this.redoStack = [], this.maxHistory = t;
51
52
  }
@@ -78,7 +79,7 @@ class gt {
78
79
  this.undoStack = [], this.redoStack = [];
79
80
  }
80
81
  }
81
- function ft() {
82
+ function bt() {
82
83
  return {
83
84
  counters: { u_row: 0, u_column: 0 },
84
85
  body: {
@@ -123,7 +124,7 @@ function ft() {
123
124
  schemaVersion: 16
124
125
  };
125
126
  }
126
- function bt(e, t) {
127
+ function mt(e, t) {
127
128
  const o = e.next("u_row"), n = t.map(() => {
128
129
  const i = e.next("u_column");
129
130
  return {
@@ -156,7 +157,7 @@ function bt(e, t) {
156
157
  }
157
158
  };
158
159
  }
159
- function mt(e, t, o = {}) {
160
+ function xt(e, t, o = {}) {
160
161
  const n = e.next(`u_content_${t}`), i = `u_content_${t}_${n}`;
161
162
  return {
162
163
  id: i,
@@ -188,21 +189,21 @@ function W(e, t) {
188
189
  if (i) return i;
189
190
  }
190
191
  }
191
- function xt(e, t) {
192
+ function yt(e, t) {
192
193
  for (const o of e.body.rows)
193
194
  for (const n of o.columns)
194
195
  if (n.contents.some((i) => i.id === t)) return n;
195
196
  }
196
- function yt(e, t) {
197
+ function wt(e, t) {
197
198
  for (const o of e.body.rows)
198
199
  if (o.columns.some((n) => n.id === t)) return o;
199
200
  }
200
201
  function q(e, t) {
201
202
  return e.body.rows.findIndex((o) => o.id === t);
202
203
  }
203
- class wt {
204
+ class vt {
204
205
  constructor() {
205
- this.history = new gt(), this.counterManager = ht(), this.subscribers = /* @__PURE__ */ new Set(), this.channelSubscribers = /* @__PURE__ */ new Map(), this.events = new ut(), this._selectedId = null, this._hoveredId = null, this._viewMode = "desktop", this._activeTab = "content", this.design = ft();
206
+ this.history = new ft(), this.counterManager = ut(), this.subscribers = /* @__PURE__ */ new Set(), this.channelSubscribers = /* @__PURE__ */ new Map(), this.events = new gt(), this._selectedId = null, this._hoveredId = null, this._viewMode = "desktop", this._activeTab = "content", this.design = bt();
206
207
  }
207
208
  // ── Subscriptions ──────────────────────────────────────────
208
209
  /** Subscribe to ALL state changes (legacy). Returns an unsubscribe function. */
@@ -329,8 +330,8 @@ class wt {
329
330
  const n = structuredClone(o), i = this.counterManager.next("u_row");
330
331
  n.id = `u_row_${i}`, n.values._meta = { htmlID: n.id, htmlClassNames: "u_row" };
331
332
  for (const r of n.columns) {
332
- const l = this.counterManager.next("u_column");
333
- r.id = `u_column_${l}`, r.values._meta = { htmlID: r.id, htmlClassNames: "u_column" };
333
+ const a = this.counterManager.next("u_column");
334
+ r.id = `u_column_${a}`, r.values._meta = { htmlID: r.id, htmlClassNames: "u_column" };
334
335
  for (const d of r.contents) {
335
336
  const c = this.counterManager.next(`u_content_${d.type}`);
336
337
  d.id = `u_content_${d.type}_${c}`, d.values._meta = { htmlID: d.id, htmlClassNames: `u_content_${d.type}` };
@@ -385,10 +386,10 @@ class wt {
385
386
  if (!i) return;
386
387
  this.history.push(this.design);
387
388
  for (const r of this.design.body.rows)
388
- for (const l of r.columns) {
389
- const d = l.contents.findIndex((c) => c.id === t);
389
+ for (const a of r.columns) {
390
+ const d = a.contents.findIndex((c) => c.id === t);
390
391
  if (d !== -1) {
391
- l.contents.splice(d, 1);
392
+ a.contents.splice(d, 1);
392
393
  break;
393
394
  }
394
395
  }
@@ -404,8 +405,8 @@ class wt {
404
405
  const s = i.contents.findIndex((r) => r.id === t);
405
406
  if (s !== -1) {
406
407
  this.history.push(this.design);
407
- const r = structuredClone(o), l = this.counterManager.next(`u_content_${o.type}`);
408
- r.id = `u_content_${o.type}_${l}`, r.values._meta = { htmlID: r.id, htmlClassNames: `u_content_${o.type}` }, i.contents.splice(s + 1, 0, r), this.syncCounters(), this.notifyChannels("design"), this.emitUpdate("content_added", r);
408
+ const r = structuredClone(o), a = this.counterManager.next(`u_content_${o.type}`);
409
+ r.id = `u_content_${o.type}_${a}`, r.values._meta = { htmlID: r.id, htmlClassNames: `u_content_${o.type}` }, i.contents.splice(s + 1, 0, r), this.syncCounters(), this.notifyChannels("design"), this.emitUpdate("content_added", r);
409
410
  return;
410
411
  }
411
412
  }
@@ -426,20 +427,20 @@ class wt {
426
427
  return W(this.design, t);
427
428
  }
428
429
  findParentColumn(t) {
429
- return xt(this.design, t);
430
+ return yt(this.design, t);
430
431
  }
431
432
  findParentRow(t) {
432
- return yt(this.design, t);
433
+ return wt(this.design, t);
433
434
  }
434
435
  // ── Factory Methods (delegate to design-factory) ───────────
435
436
  /** Create a new row with the given column layout */
436
437
  createRow(t) {
437
- const o = bt(this.counterManager, t);
438
+ const o = mt(this.counterManager, t);
438
439
  return this.syncCounters(), o;
439
440
  }
440
441
  /** Create a new content block for the given tool type */
441
442
  createContent(t, o = {}) {
442
- const n = mt(this.counterManager, t, o);
443
+ const n = xt(this.counterManager, t, o);
443
444
  return this.syncCounters(), n;
444
445
  }
445
446
  // ── Private Helpers ────────────────────────────────────────
@@ -450,7 +451,7 @@ class wt {
450
451
  this.events.emit("design:updated", { type: t, item: o });
451
452
  }
452
453
  }
453
- class vt {
454
+ class $t {
454
455
  constructor() {
455
456
  this.tools = /* @__PURE__ */ new Map(), this.lazyLoaders = /* @__PURE__ */ new Map(), this.lazyMeta = /* @__PURE__ */ new Map(), this.loadingPromises = /* @__PURE__ */ new Map();
456
457
  }
@@ -563,10 +564,10 @@ function Z(e) {
563
564
  function tt(e, t, o, n, i = "4px") {
564
565
  e.parentNode !== t && (e.remove(), t.appendChild(e));
565
566
  const r = (t instanceof ShadowRoot ? t.host : t).getBoundingClientRect();
566
- let l;
567
- o.length === 0 || n === 0 ? l = o.length === 0 ? 0 : o[0].getBoundingClientRect().top - r.top : n >= o.length ? l = o[o.length - 1].getBoundingClientRect().bottom - r.top : l = o[n].getBoundingClientRect().top - r.top, Object.assign(e.style, {
567
+ let a;
568
+ o.length === 0 || n === 0 ? a = o.length === 0 ? 0 : o[0].getBoundingClientRect().top - r.top : n >= o.length ? a = o[o.length - 1].getBoundingClientRect().bottom - r.top : a = o[n].getBoundingClientRect().top - r.top, Object.assign(e.style, {
568
569
  display: "block",
569
- top: `${l}px`,
570
+ top: `${a}px`,
570
571
  left: i,
571
572
  right: i,
572
573
  width: "auto"
@@ -588,11 +589,11 @@ function et(e, t) {
588
589
  n.matches?.(t) && o.push(n);
589
590
  }), o;
590
591
  }
591
- class $t {
592
+ class kt {
592
593
  constructor(t, o, n) {
593
594
  this.currentDrop = null, this.contentIndicator = null, this.rowIndicator = null, this.onDragOver = (i) => {
594
- const s = i.dataTransfer?.types || [], r = s.includes("application/maileditor-tool"), l = s.includes("application/maileditor-layout"), d = s.includes("application/maileditor-content") || !!L.draggingContentId;
595
- !r && !d && !l || (i.preventDefault(), i.dataTransfer.dropEffect = r || l ? "copy" : "move", l ? (this.currentDrop = this.findRowDropTarget(i.clientY), I(this.contentIndicator), this.showRowIndicator()) : (this.currentDrop = this.findContentDropTarget(i.clientX, i.clientY), I(this.rowIndicator), this.showContentIndicator()));
595
+ const s = i.dataTransfer?.types || [], r = s.includes("application/maileditor-tool"), a = s.includes("application/maileditor-layout"), d = s.includes("application/maileditor-content") || !!L.draggingContentId;
596
+ !r && !d && !a || (i.preventDefault(), i.dataTransfer.dropEffect = r || a ? "copy" : "move", a ? (this.currentDrop = this.findRowDropTarget(i.clientY), I(this.contentIndicator), this.showRowIndicator()) : (this.currentDrop = this.findContentDropTarget(i.clientX, i.clientY), I(this.rowIndicator), this.showContentIndicator()));
596
597
  }, this.onDrop = (i) => {
597
598
  i.preventDefault(), this.hideAllIndicators();
598
599
  const s = this.currentDrop, r = i.dataTransfer?.getData("application/maileditor-layout");
@@ -600,9 +601,9 @@ class $t {
600
601
  this.handleLayoutDrop(JSON.parse(r), s), this.reset();
601
602
  return;
602
603
  }
603
- const l = i.dataTransfer?.getData("application/maileditor-tool");
604
- if (l) {
605
- this.handleToolDrop(l, s), this.reset();
604
+ const a = i.dataTransfer?.getData("application/maileditor-tool");
605
+ if (a) {
606
+ this.handleToolDrop(a, s), this.reset();
606
607
  return;
607
608
  }
608
609
  const d = i.dataTransfer?.getData("application/maileditor-content") || L.draggingContentId;
@@ -649,8 +650,8 @@ class $t {
649
650
  if (n.length === 0) return { type: "row", rowIndex: 0, y: 0 };
650
651
  let i = Math.abs(t - n[0].getBoundingClientRect().top), s = { type: "row", rowIndex: 0, y: n[0].getBoundingClientRect().top };
651
652
  for (let r = 0; r < n.length; r++) {
652
- const l = n[r].getBoundingClientRect().bottom, d = Math.abs(t - l);
653
- d < i && (i = d, s = { type: "row", rowIndex: r + 1, y: l });
653
+ const a = n[r].getBoundingClientRect().bottom, d = Math.abs(t - a);
654
+ d < i && (i = d, s = { type: "row", rowIndex: r + 1, y: a });
654
655
  }
655
656
  return s;
656
657
  }
@@ -658,22 +659,22 @@ class $t {
658
659
  const n = et(this.root, "me-column-renderer");
659
660
  let i = null, s = 1 / 0;
660
661
  for (const r of n) {
661
- const l = r.dataset.columnId;
662
- if (!l || !r.shadowRoot) continue;
662
+ const a = r.dataset.columnId;
663
+ if (!a || !r.shadowRoot) continue;
663
664
  const d = r.getBoundingClientRect();
664
665
  if (t < d.left || t > d.right) continue;
665
666
  const c = Array.from(r.shadowRoot.querySelectorAll("me-content-renderer"));
666
667
  if (c.length === 0) {
667
668
  const u = Math.abs(o - (d.top + d.height / 2));
668
- u < s && (s = u, i = { type: "content", columnId: l, contentIndex: 0, y: d.top + d.height / 2 });
669
+ u < s && (s = u, i = { type: "content", columnId: a, contentIndex: 0, y: d.top + d.height / 2 });
669
670
  continue;
670
671
  }
671
672
  const h = c[0].getBoundingClientRect().top;
672
673
  let g = Math.abs(o - h);
673
- g < s && (s = g, i = { type: "content", columnId: l, contentIndex: 0, y: h });
674
+ g < s && (s = g, i = { type: "content", columnId: a, contentIndex: 0, y: h });
674
675
  for (let u = 0; u < c.length; u++) {
675
676
  const f = c[u].getBoundingClientRect(), y = c[u + 1]?.getBoundingClientRect(), x = y ? (f.bottom + y.top) / 2 : f.bottom;
676
- g = Math.abs(o - x), g < s && (s = g, i = { type: "content", columnId: l, contentIndex: u + 1, y: x });
677
+ g = Math.abs(o - x), g < s && (s = g, i = { type: "content", columnId: a, contentIndex: u + 1, y: x });
677
678
  }
678
679
  }
679
680
  return i;
@@ -706,7 +707,7 @@ class $t {
706
707
  this.currentDrop = null, L.reset();
707
708
  }
708
709
  }
709
- function a(e, t, o = "") {
710
+ function l(e, t, o = "") {
710
711
  const n = e[t];
711
712
  return typeof n == "string" && n !== "" ? n : typeof n == "number" ? String(n) : o;
712
713
  }
@@ -723,7 +724,7 @@ function nt(e) {
723
724
  }
724
725
  return {};
725
726
  }
726
- function kt(e) {
727
+ function Ct(e) {
727
728
  const t = e.action;
728
729
  if (t && typeof t == "object") {
729
730
  const o = t.values;
@@ -733,8 +734,8 @@ function kt(e) {
733
734
  };
734
735
  }
735
736
  return {
736
- href: a(e, "href"),
737
- target: a(e, "target", "_blank")
737
+ href: l(e, "href"),
738
+ target: l(e, "target", "_blank")
738
739
  };
739
740
  }
740
741
  function it(e, t = "") {
@@ -743,9 +744,9 @@ function it(e, t = "") {
743
744
  const n = e.textJson;
744
745
  if (typeof n == "string")
745
746
  try {
746
- const i = JSON.parse(n), s = [], r = (l) => {
747
- typeof l.text == "string" && s.push(l.text), l.type === "linebreak" && s.push("<br/>");
748
- const d = l.children;
747
+ const i = JSON.parse(n), s = [], r = (a) => {
748
+ typeof a.text == "string" && s.push(a.text), a.type === "linebreak" && s.push("<br/>");
749
+ const d = a.children;
749
750
  d && d.forEach(r);
750
751
  };
751
752
  if (r(i.root || i), s.length > 0) return s.join("");
@@ -761,15 +762,15 @@ function Y(e, t = "arial,helvetica,sans-serif") {
761
762
  if (s && typeof document < "u") {
762
763
  const r = `emabuild-font-${i.replace(/[^a-z]/gi, "")}`;
763
764
  if (!document.getElementById(r)) {
764
- const l = document.createElement("link");
765
- l.id = r, l.rel = "stylesheet", l.href = s, document.head.appendChild(l);
765
+ const a = document.createElement("link");
766
+ a.id = r, a.rel = "stylesheet", a.href = s, document.head.appendChild(a);
766
767
  }
767
768
  }
768
769
  return i;
769
770
  }
770
771
  return t;
771
772
  }
772
- function me(e, t) {
773
+ function ye(e, t) {
773
774
  if (typeof e != "string") return t;
774
775
  try {
775
776
  return JSON.parse(e);
@@ -785,8 +786,8 @@ function z(e, t) {
785
786
  </td></tr></tbody>
786
787
  </table>`;
787
788
  }
788
- function Ct(e, t, o) {
789
- const { bgColor: n, textColor: i, fontSize: s, fontWeight: r, borderRadius: l } = o, d = parseInt(l) || 0;
789
+ function _t(e, t, o) {
790
+ const { bgColor: n, textColor: i, fontSize: s, fontWeight: r, borderRadius: a } = o, d = parseInt(a) || 0;
790
791
  if (d <= 0) return "";
791
792
  const c = Math.round(d / 20 * 100);
792
793
  return `<!--[if mso]>
@@ -796,7 +797,7 @@ function Ct(e, t, o) {
796
797
  </v:roundrect>
797
798
  <![endif]-->`;
798
799
  }
799
- const _t = {
800
+ const Dt = {
800
801
  name: "text",
801
802
  label: "Text",
802
803
  icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7V4h16v3"/><path d="M9 20h6"/><path d="M12 4v16"/></svg>',
@@ -859,7 +860,7 @@ const _t = {
859
860
  },
860
861
  renderer: {
861
862
  renderEditor(e) {
862
- const t = a(e, "containerPadding", "10px"), o = a(e, "backgroundColor", "transparent"), n = a(e, "color", "inherit"), i = a(e, "lineHeight", "140%"), s = Y(e), r = a(e, "text");
863
+ const t = l(e, "containerPadding", "10px"), o = l(e, "backgroundColor", "transparent"), n = l(e, "color", "inherit"), i = l(e, "lineHeight", "140%"), s = Y(e), r = l(e, "text");
863
864
  return p`
864
865
  <div style="padding:${t};background-color:${o};color:${n};line-height:${i};font-family:${s};word-break:break-word;">
865
866
  ${U(r)}
@@ -867,11 +868,12 @@ const _t = {
867
868
  `;
868
869
  },
869
870
  renderHtml(e) {
870
- const t = a(e, "containerPadding", "10px"), o = a(e, "backgroundColor"), n = a(e, "color", "#000000"), i = a(e, "lineHeight", "140%"), s = a(e, "textAlign", "left"), r = a(e, "text"), l = o ? `background-color:${o};` : "", d = `<div style="font-size:14px;color:${n};line-height:${i};text-align:${s};">${r}</div>`;
871
- return z(d, { padding: t, extraTdStyle: l });
871
+ const t = l(e, "containerPadding", "10px"), o = l(e, "backgroundColor"), n = l(e, "color", "#000000"), i = l(e, "lineHeight", "140%"), s = l(e, "textAlign", "left"), r = l(e, "text"), a = o ? `background-color:${o};` : "", d = `<div style="font-size:14px;color:${n};line-height:${i};text-align:${s};">${r}</div>`;
872
+ return z(d, { padding: t, extraTdStyle: a });
872
873
  }
873
874
  }
874
- }, Dt = {
875
+ };
876
+ const St = {
875
877
  name: "heading",
876
878
  label: "Heading",
877
879
  icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 12h12"/><path d="M6 4v16"/><path d="M18 4v16"/></svg>',
@@ -903,6 +905,7 @@ const _t = {
903
905
  defaultValue: "22px",
904
906
  widget: "dropdown",
905
907
  widgetParams: { options: [
908
+ { label: "12px", value: "12px" },
906
909
  { label: "14px", value: "14px" },
907
910
  { label: "16px", value: "16px" },
908
911
  { label: "18px", value: "18px" },
@@ -973,19 +976,24 @@ const _t = {
973
976
  },
974
977
  renderer: {
975
978
  renderEditor(e) {
976
- const t = a(e, "containerPadding", "10px"), o = a(e, "fontSize", "22px"), n = a(e, "color", "#000000"), i = a(e, "textAlign", "left"), s = a(e, "fontWeight", "700"), r = a(e, "lineHeight", "140%"), l = Y(e), d = it(e, "Heading");
977
- return p`
978
- <div style="padding:${t};font-size:${o};color:${n};text-align:${i};font-weight:${s};line-height:${r};font-family:${l};">
979
- ${U(d)}
980
- </div>
981
- `;
979
+ const t = {
980
+ padding: l(e, "containerPadding", "10px"),
981
+ fontSize: l(e, "fontSize", "22px"),
982
+ color: l(e, "color", "#000000"),
983
+ textAlign: l(e, "textAlign", "left"),
984
+ fontWeight: l(e, "fontWeight", "700"),
985
+ lineHeight: l(e, "lineHeight", "140%"),
986
+ letterSpacing: l(e, "letterSpacing", "normal"),
987
+ fontFamily: Y(e)
988
+ }, o = it(e, "Heading");
989
+ return p`<div style=${ht(t)}>${U(o)}</div>`;
982
990
  },
983
991
  renderHtml(e) {
984
- const t = a(e, "containerPadding", "10px"), o = a(e, "fontSize", "22px"), n = a(e, "color", "#000000"), i = a(e, "textAlign", "left"), s = a(e, "fontWeight", "700"), r = a(e, "lineHeight", "140%"), l = a(e, "letterSpacing", "normal"), d = Y(e), c = a(e, "headingType", "h1"), h = it(e, "Heading"), g = `<${c} style="margin:0;font-size:${o};color:${n};text-align:${i};font-weight:${s};line-height:${r};letter-spacing:${l};font-family:${d};">${h}</${c}>`;
992
+ const t = l(e, "containerPadding", "10px"), o = l(e, "fontSize", "22px"), n = l(e, "color", "#000000"), i = l(e, "textAlign", "left"), s = l(e, "fontWeight", "700"), r = l(e, "lineHeight", "140%"), a = l(e, "letterSpacing", "normal"), d = Y(e), c = l(e, "headingType", "h1"), h = it(e, "Heading"), g = `<${c} style="margin:0;font-size:${o};color:${n};text-align:${i};font-weight:${s};line-height:${r};letter-spacing:${a};font-family:${d};">${h}</${c}>`;
985
993
  return z(g, { padding: t });
986
994
  }
987
995
  }
988
- }, St = {
996
+ }, Rt = {
989
997
  name: "paragraph",
990
998
  label: "Paragraph",
991
999
  icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/><line x1="3" y1="14" x2="17" y2="14"/></svg>',
@@ -1028,15 +1036,15 @@ const _t = {
1028
1036
  },
1029
1037
  renderer: {
1030
1038
  renderEditor(e) {
1031
- const t = a(e, "containerPadding", "10px"), o = a(e, "color", "#374151"), n = a(e, "lineHeight", "160%");
1032
- return p`<div style="padding:${t};color:${o};line-height:${n};word-break:break-word;">${U(a(e, "text"))}</div>`;
1039
+ const t = l(e, "containerPadding", "10px"), o = l(e, "color", "#374151"), n = l(e, "lineHeight", "160%");
1040
+ return p`<div style="padding:${t};color:${o};line-height:${n};word-break:break-word;">${U(l(e, "text"))}</div>`;
1033
1041
  },
1034
1042
  renderHtml(e) {
1035
- const t = a(e, "containerPadding", "10px"), o = a(e, "color", "#374151"), n = a(e, "lineHeight", "160%"), i = a(e, "textAlign", "left"), s = a(e, "letterSpacing", "normal"), r = `<div style="font-size:14px;color:${o};line-height:${n};text-align:${i};letter-spacing:${s};word-wrap:break-word;">${a(e, "text")}</div>`;
1043
+ const t = l(e, "containerPadding", "10px"), o = l(e, "color", "#374151"), n = l(e, "lineHeight", "160%"), i = l(e, "textAlign", "left"), s = l(e, "letterSpacing", "normal"), r = `<div style="font-size:14px;color:${o};line-height:${n};text-align:${i};letter-spacing:${s};word-wrap:break-word;">${l(e, "text")}</div>`;
1036
1044
  return z(r, { padding: t });
1037
1045
  }
1038
1046
  }
1039
- }, Rt = {
1047
+ }, Tt = {
1040
1048
  name: "image",
1041
1049
  label: "Image",
1042
1050
  icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',
@@ -1097,18 +1105,18 @@ const _t = {
1097
1105
  },
1098
1106
  renderer: {
1099
1107
  renderEditor(e) {
1100
- const t = a(e, "containerPadding", "10px"), o = ot(e.src), n = a(e, "alt"), s = nt(e.src).maxWidth || a(e, "width", "100%"), r = a(e, "borderRadius", "0px"), l = a(e, "textAlign", a(e, "align", "center"));
1101
- return o ? p`<div style="padding:${t};text-align:${l};"><img src=${o} alt=${n} style="display:inline-block;max-width:100%;width:${s};border-radius:${r};border:0;" /></div>` : p`<div style="padding:${t};text-align:${l};"><div style="background:#f1f5f9;border:2px dashed #cbd5e1;border-radius:8px;padding:40px 20px;text-align:center;color:#94a3b8;font-size:13px;">No image set. Enter a URL in the property panel.</div></div>`;
1108
+ const t = l(e, "containerPadding", "10px"), o = ot(e.src), n = l(e, "alt"), s = nt(e.src).maxWidth || l(e, "width", "100%"), r = l(e, "borderRadius", "0px"), a = l(e, "textAlign", l(e, "align", "center"));
1109
+ return o ? p`<div style="padding:${t};text-align:${a};"><img src=${o} alt=${n} style="display:inline-block;max-width:100%;width:${s};border-radius:${r};border:0;" /></div>` : p`<div style="padding:${t};text-align:${a};"><div style="background:#f1f5f9;border:2px dashed #cbd5e1;border-radius:8px;padding:40px 20px;text-align:center;color:#94a3b8;font-size:13px;">No image set. Enter a URL in the property panel.</div></div>`;
1102
1110
  },
1103
1111
  renderHtml(e, t) {
1104
- const o = a(e, "containerPadding", "10px"), n = ot(e.src), i = a(e, "alt"), s = kt(e), r = nt(e.src), l = r.maxWidth || a(e, "width", "100%"), d = a(e, "borderRadius", "0px"), c = a(e, "textAlign", a(e, "align", "center"));
1112
+ const o = l(e, "containerPadding", "10px"), n = ot(e.src), i = l(e, "alt"), s = Ct(e), r = nt(e.src), a = r.maxWidth || l(e, "width", "100%"), d = l(e, "borderRadius", "0px"), c = l(e, "textAlign", l(e, "align", "center"));
1105
1113
  let h;
1106
- l.includes("%") ? h = Math.round(t.columnWidth * (parseFloat(l) / 100)) : l === "auto" ? h = r.width || t.columnWidth : h = parseInt(l) || t.columnWidth;
1114
+ a.includes("%") ? h = Math.round(t.columnWidth * (parseFloat(a) / 100)) : a === "auto" ? h = r.width || t.columnWidth : h = parseInt(a) || t.columnWidth;
1107
1115
  const g = d !== "0px" ? `border-radius:${d};` : "", u = `<img align="${c}" border="0" src="${n}" alt="${i}" title="${i}" style="display:block;border:0;height:auto;width:100%;max-width:${h}px;${g}" width="${h}" />`, f = s.href ? `<a href="${s.href}" target="${s.target}" style="text-decoration:none;">${u}</a>` : u;
1108
1116
  return z(f, { padding: o, align: c });
1109
1117
  }
1110
1118
  }
1111
- }, Tt = {
1119
+ }, It = {
1112
1120
  name: "button",
1113
1121
  label: "Button",
1114
1122
  icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="7" width="20" height="10" rx="2"/><path d="M12 7v10"/><path d="m8 12 4-3 4 3"/></svg>',
@@ -1195,24 +1203,24 @@ const _t = {
1195
1203
  },
1196
1204
  renderer: {
1197
1205
  renderEditor(e) {
1198
- const t = a(e, "containerPadding", "10px"), o = a(e, "backgroundColor", "#3b82f6"), n = a(e, "textColor", "#ffffff"), i = a(e, "fontSize", "14px"), s = a(e, "fontWeight", "700"), r = a(e, "borderRadius", "4px"), l = a(e, "buttonPadding", "10px 20px"), d = a(e, "text", "Click Me"), c = a(e, "textAlign", "center"), h = a(e, "buttonWidth", "auto"), g = a(e, "borderWidth", "0px"), u = a(e, "borderColor", o), f = g !== "0px" ? `border:${g} solid ${u};` : "border:none;", y = h === "auto" ? "display:inline-block;" : `display:block;width:${h};`;
1206
+ const t = l(e, "containerPadding", "10px"), o = l(e, "backgroundColor", "#3b82f6"), n = l(e, "textColor", "#ffffff"), i = l(e, "fontSize", "14px"), s = l(e, "fontWeight", "700"), r = l(e, "borderRadius", "4px"), a = l(e, "buttonPadding", "10px 20px"), d = l(e, "text", "Click Me"), c = l(e, "textAlign", "center"), h = l(e, "buttonWidth", "auto"), g = l(e, "borderWidth", "0px"), u = l(e, "borderColor", o), f = g !== "0px" ? `border:${g} solid ${u};` : "border:none;", y = h === "auto" ? "display:inline-block;" : `display:block;width:${h};`;
1199
1207
  return p`
1200
1208
  <div style="padding:${t};text-align:${c};">
1201
- <a style="${y}background-color:${o};color:${n};font-size:${i};font-weight:${s};border-radius:${r};padding:${l};text-decoration:none;text-align:center;${f}cursor:pointer;font-family:arial,helvetica,sans-serif;">${d}</a>
1209
+ <a style="${y}background-color:${o};color:${n};font-size:${i};font-weight:${s};border-radius:${r};padding:${a};text-decoration:none;text-align:center;${f}cursor:pointer;font-family:arial,helvetica,sans-serif;">${d}</a>
1202
1210
  </div>
1203
1211
  `;
1204
1212
  },
1205
1213
  renderHtml(e) {
1206
- const t = a(e, "containerPadding", "10px"), o = a(e, "backgroundColor", "#3b82f6"), n = a(e, "textColor", "#ffffff"), i = a(e, "fontSize", "14px"), s = a(e, "fontWeight", "700"), r = a(e, "borderRadius", "4px"), l = a(e, "buttonPadding", "10px 20px"), d = a(e, "text", "Click Me"), c = a(e, "textAlign", "center"), h = a(e, "href", "#"), g = a(e, "target", "_blank"), u = a(e, "borderWidth", "0px"), f = a(e, "borderColor", o), y = u !== "0px" ? `border:${u} solid ${f};` : "border:none;", x = Ct(d, h, { bgColor: o, textColor: n, fontSize: i, fontWeight: s, borderRadius: r }), m = x ? `${x}
1214
+ const t = l(e, "containerPadding", "10px"), o = l(e, "backgroundColor", "#3b82f6"), n = l(e, "textColor", "#ffffff"), i = l(e, "fontSize", "14px"), s = l(e, "fontWeight", "700"), r = l(e, "borderRadius", "4px"), a = l(e, "buttonPadding", "10px 20px"), d = l(e, "text", "Click Me"), c = l(e, "textAlign", "center"), h = l(e, "href", "#"), g = l(e, "target", "_blank"), u = l(e, "borderWidth", "0px"), f = l(e, "borderColor", o), y = u !== "0px" ? `border:${u} solid ${f};` : "border:none;", x = _t(d, h, { bgColor: o, textColor: n, fontSize: i, fontWeight: s, borderRadius: r }), m = x ? `${x}
1207
1215
  <!--[if !mso]><!-->` : "<!--[if !mso]><!-->", v = `<div align="${c}">
1208
1216
  ${m}
1209
- <a href="${h}" target="${g}" style="display:inline-block;text-decoration:none;text-align:center;color:${n};background-color:${o};border-radius:${r};font-size:${i};font-weight:${s};padding:${l};font-family:arial,helvetica,sans-serif;${y}mso-border-alt:none;"><span style="line-height:120%;">${d}</span></a>
1217
+ <a href="${h}" target="${g}" style="display:inline-block;text-decoration:none;text-align:center;color:${n};background-color:${o};border-radius:${r};font-size:${i};font-weight:${s};padding:${a};font-family:arial,helvetica,sans-serif;${y}mso-border-alt:none;"><span style="line-height:120%;">${d}</span></a>
1210
1218
  <!--<![endif]-->
1211
1219
  </div>`;
1212
1220
  return z(v, { padding: t, align: c });
1213
1221
  }
1214
1222
  }
1215
- }, It = {
1223
+ }, Mt = {
1216
1224
  name: "divider",
1217
1225
  label: "Divider",
1218
1226
  icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="2" y1="12" x2="22" y2="12"/></svg>',
@@ -1259,53 +1267,53 @@ const _t = {
1259
1267
  },
1260
1268
  renderer: {
1261
1269
  renderEditor(e) {
1262
- const t = a(e, "containerPadding", "10px"), o = a(e, "width", "100%"), n = `${a(e, "borderTopWidth", "1px")} ${a(e, "borderTopStyle", "solid")} ${a(e, "borderTopColor", "#cccccc")}`;
1270
+ const t = l(e, "containerPadding", "10px"), o = l(e, "width", "100%"), n = `${l(e, "borderTopWidth", "1px")} ${l(e, "borderTopStyle", "solid")} ${l(e, "borderTopColor", "#cccccc")}`;
1263
1271
  return p`<div style="padding:${t};"><div style="border-top:${n};width:${o};margin:0 auto;"></div></div>`;
1264
1272
  },
1265
1273
  renderHtml(e) {
1266
- const t = a(e, "containerPadding", "10px"), o = a(e, "width", "100%"), n = `${a(e, "borderTopWidth", "1px")} ${a(e, "borderTopStyle", "solid")} ${a(e, "borderTopColor", "#cccccc")}`, i = `<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="${o}" style="border-collapse:collapse;border-top:${n};"><tbody><tr><td style="font-size:0;line-height:0;">&nbsp;</td></tr></tbody></table>`;
1274
+ const t = l(e, "containerPadding", "10px"), o = l(e, "width", "100%"), n = `${l(e, "borderTopWidth", "1px")} ${l(e, "borderTopStyle", "solid")} ${l(e, "borderTopColor", "#cccccc")}`, i = `<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="${o}" style="border-collapse:collapse;border-top:${n};"><tbody><tr><td style="font-size:0;line-height:0;">&nbsp;</td></tr></tbody></table>`;
1267
1275
  return z(i, { padding: t, align: "center" });
1268
1276
  }
1269
1277
  }
1270
- }, Mt = [
1271
- _t,
1278
+ }, Pt = [
1272
1279
  Dt,
1273
1280
  St,
1274
1281
  Rt,
1275
1282
  Tt,
1276
- It
1283
+ It,
1284
+ Mt
1277
1285
  ], st = [
1278
1286
  {
1279
1287
  meta: { name: "html", label: "HTML", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>', position: 6 },
1280
- loader: () => import("./html-tool-1B9Cos-6.js").then((e) => e.htmlTool)
1288
+ loader: () => import("./html-tool-D4ay2h-U.js").then((e) => e.htmlTool)
1281
1289
  },
1282
1290
  {
1283
1291
  meta: { name: "social", label: "Social", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/></svg>', position: 8 },
1284
- loader: () => import("./social-tool-Ba7QItoR.js").then((e) => e.socialTool)
1292
+ loader: () => import("./social-tool-B8Jg2yE-.js").then((e) => e.socialTool)
1285
1293
  },
1286
1294
  {
1287
1295
  meta: { name: "menu", label: "Menu", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="4" y1="6" x2="20" y2="6"/><line x1="4" y1="12" x2="20" y2="12"/><line x1="4" y1="18" x2="20" y2="18"/></svg>', position: 9 },
1288
- loader: () => import("./menu-tool-CZjaIKsU.js").then((e) => e.menuTool)
1296
+ loader: () => import("./menu-tool-KvGDbaYD.js").then((e) => e.menuTool)
1289
1297
  },
1290
1298
  {
1291
1299
  meta: { name: "video", label: "Video", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="5 3 19 12 5 21 5 3"/></svg>', position: 10 },
1292
- loader: () => import("./video-tool-OdNg0UMg.js").then((e) => e.videoTool)
1300
+ loader: () => import("./video-tool-CdGVmZxz.js").then((e) => e.videoTool)
1293
1301
  },
1294
1302
  {
1295
1303
  meta: { name: "timer", label: "Timer", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>', position: 11 },
1296
- loader: () => import("./timer-tool-p0KWo21p.js").then((e) => e.timerTool)
1304
+ loader: () => import("./timer-tool-Ck1ERDW-.js").then((e) => e.timerTool)
1297
1305
  },
1298
1306
  {
1299
1307
  meta: { name: "table", label: "Table", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18"/><path d="M3 15h18"/><path d="M9 3v18"/><path d="M15 3v18"/></svg>', position: 12 },
1300
- loader: () => import("./table-tool-swpmCeU4.js").then((e) => e.tableTool)
1308
+ loader: () => import("./table-tool-BzpD08dq.js").then((e) => e.tableTool)
1301
1309
  },
1302
1310
  {
1303
1311
  meta: { name: "form", label: "Form", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M7 7h10"/><path d="M7 12h10"/><path d="M7 17h6"/></svg>', position: 13 },
1304
- loader: () => import("./form-tool-DiE5BEft.js").then((e) => e.formTool)
1312
+ loader: () => import("./form-tool-CduLiZgt.js").then((e) => e.formTool)
1305
1313
  }
1306
1314
  ];
1307
- function Pt(e, t, o) {
1308
- const n = o.backgroundColor || "#e7e7e7", i = o.contentWidth || "600px", s = o.fontFamily?.value || "arial,helvetica,sans-serif", r = o.textColor || "#000000", l = o.preheaderText || "" || "&zwnj;", d = `<div style="display:none;font-size:1px;color:${n};line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">${l}${"&zwnj;&nbsp;".repeat(80)}</div>`;
1315
+ function Et(e, t, o) {
1316
+ const n = o.backgroundColor || "#e7e7e7", i = o.contentWidth || "600px", s = o.fontFamily?.value || "arial,helvetica,sans-serif", r = o.textColor || "#000000", a = o.preheaderText || "" || "&zwnj;", d = `<div style="display:none;font-size:1px;color:${n};line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">${a}${"&zwnj;&nbsp;".repeat(80)}</div>`;
1309
1317
  return `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1310
1318
  <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
1311
1319
  <head>
@@ -1355,16 +1363,16 @@ function Pt(e, t, o) {
1355
1363
  </body>
1356
1364
  </html>`;
1357
1365
  }
1358
- function Et(e, t, o) {
1359
- const n = parseInt(t.contentWidth || "600"), i = e.values.backgroundColor || "", s = e.values.columnsBackgroundColor || "", r = e.values.padding || "0px", l = e.cells.reduce((m, w) => m + w, 0), d = i ? `background-color:${i};` : "", c = e.values.backgroundImage;
1366
+ function zt(e, t, o) {
1367
+ const n = parseInt(t.contentWidth || "600"), i = e.values.backgroundColor || "", s = e.values.columnsBackgroundColor || "", r = e.values.padding || "0px", a = e.cells.reduce((m, w) => m + w, 0), d = i ? `background-color:${i};` : "", c = e.values.backgroundImage;
1360
1368
  let h = "";
1361
1369
  if (c?.url) {
1362
1370
  const m = c.repeat === !0 || c.repeat === "repeat" ? "repeat" : "no-repeat", w = c.cover === !0 ? "cover" : c.fullWidth === !0 ? "100% auto" : "auto", v = c.center !== !1 ? "center top" : "left top";
1363
1371
  h = `background-image:url('${c.url}');background-repeat:${m};background-position:${v};background-size:${w};`;
1364
1372
  }
1365
1373
  const g = e.columns.length > 1, u = e.columns.map((m, w) => {
1366
- const v = Math.round(e.cells[w] / l * n);
1367
- return { colHtml: zt(m, v, s, t, o), colWidthPx: v };
1374
+ const v = Math.round(e.cells[w] / a * n);
1375
+ return { colHtml: Lt(m, v, s, t, o), colWidthPx: v };
1368
1376
  });
1369
1377
  let f;
1370
1378
  if (g) {
@@ -1379,8 +1387,8 @@ function Et(e, t, o) {
1379
1387
  <div style="margin:0 auto;max-width:${n}px;${g ? "font-size:0;" : ""}text-align:center;">${f}</div>
1380
1388
  </div>`;
1381
1389
  }
1382
- function zt(e, t, o, n, i) {
1383
- const s = e.values.backgroundColor || o || "", r = e.values.padding || "0px", l = e.values.borderRadius || "0px", d = s ? `background-color:${s};` : "", c = e.contents.map((h) => {
1390
+ function Lt(e, t, o, n, i) {
1391
+ const s = e.values.backgroundColor || o || "", r = e.values.padding || "0px", a = e.values.borderRadius || "0px", d = s ? `background-color:${s};` : "", c = e.contents.map((h) => {
1384
1392
  const g = i.get(h.type);
1385
1393
  if (!g) return `<!-- unknown tool: ${h.type} -->`;
1386
1394
  const u = {
@@ -1395,14 +1403,14 @@ function zt(e, t, o, n, i) {
1395
1403
  }).join(`
1396
1404
  `);
1397
1405
  return `<div class="u_column" style="display:inline-block;vertical-align:top;width:${t}px;max-width:${t}px;font-size:14px;text-align:left;">
1398
- <div style="width:100%;${d}${l !== "0px" ? `border-radius:${l};` : ""}">
1406
+ <div style="width:100%;${d}${a !== "0px" ? `border-radius:${a};` : ""}">
1399
1407
  <div style="padding:${r};">
1400
1408
  ${c || "&nbsp;"}
1401
1409
  </div>
1402
1410
  </div>
1403
1411
  </div>`;
1404
1412
  }
1405
- function Lt(e) {
1413
+ function Vt(e) {
1406
1414
  return `
1407
1415
  @media only screen and (min-width: ${e + 20}px) {
1408
1416
  .u_row .u_column { display: inline-block !important; }
@@ -1451,7 +1459,7 @@ function Lt(e) {
1451
1459
  .u_hide_mobile { display: block !important; }
1452
1460
  }`;
1453
1461
  }
1454
- const Vt = [
1462
+ const At = [
1455
1463
  "box-sizing",
1456
1464
  "float",
1457
1465
  "overflow-wrap",
@@ -1467,20 +1475,20 @@ const Vt = [
1467
1475
  "display:\\s*flex",
1468
1476
  "display:\\s*grid",
1469
1477
  "gap"
1470
- ], At = new RegExp(
1471
- `(?:;\\s*|^\\s*)(${Vt.join("|")})\\s*:[^;]*;?`,
1478
+ ], Bt = new RegExp(
1479
+ `(?:;\\s*|^\\s*)(${At.join("|")})\\s*:[^;]*;?`,
1472
1480
  "gi"
1473
- ), Bt = /var\(--[^)]*\)/gi;
1474
- function Ot(e) {
1481
+ ), Ot = /var\(--[^)]*\)/gi;
1482
+ function Ht(e) {
1475
1483
  return e.replace(/style="([^"]*)"/gi, (t, o) => {
1476
1484
  let n = o;
1477
- return n = n.replace(At, ""), n = n.replace(Bt, "inherit"), n = n.replace(/;\s*;/g, ";").replace(/^\s*;\s*/, "").replace(/;\s*$/, "").trim(), n ? `style="${n}"` : "";
1485
+ return n = n.replace(Bt, ""), n = n.replace(Ot, "inherit"), n = n.replace(/;\s*;/g, ";").replace(/^\s*;\s*/, "").replace(/;\s*$/, "").trim(), n ? `style="${n}"` : "";
1478
1486
  });
1479
1487
  }
1480
- function Ht(e, t, o) {
1481
- const n = e.body.values, i = parseInt(n.contentWidth || "600"), s = e.body.rows.map((u) => Et(u, n, t)).join(`
1482
- `), r = Lt(i), l = Ot(s);
1483
- let d = Pt(l, r, n);
1488
+ function jt(e, t, o) {
1489
+ const n = e.body.values, i = parseInt(n.contentWidth || "600"), s = e.body.rows.map((u) => zt(u, n, t)).join(`
1490
+ `), r = Vt(i), a = Ht(s);
1491
+ let d = Et(a, r, n);
1484
1492
  if (o?.mergeTags)
1485
1493
  for (const [u, f] of Object.entries(o.mergeTags))
1486
1494
  d = d.replaceAll(`{{${u}}}`, f);
@@ -1521,10 +1529,10 @@ class T {
1521
1529
  }));
1522
1530
  }
1523
1531
  }
1524
- var jt = Object.defineProperty, Wt = Object.getOwnPropertyDescriptor, at = (e, t, o, n) => {
1525
- for (var i = n > 1 ? void 0 : n ? Wt(t, o) : t, s = e.length - 1, r; s >= 0; s--)
1532
+ var Wt = Object.defineProperty, Ut = Object.getOwnPropertyDescriptor, at = (e, t, o, n) => {
1533
+ for (var i = n > 1 ? void 0 : n ? Ut(t, o) : t, s = e.length - 1, r; s >= 0; s--)
1526
1534
  (r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
1527
- return n && i && jt(t, o, i), i;
1535
+ return n && i && Wt(t, o, i), i;
1528
1536
  };
1529
1537
  let V = class extends $ {
1530
1538
  constructor() {
@@ -1657,10 +1665,10 @@ at([
1657
1665
  V = at([
1658
1666
  C("me-inline-toolbar")
1659
1667
  ], V);
1660
- var Ut = Object.defineProperty, Ft = Object.getOwnPropertyDescriptor, O = (e, t, o, n) => {
1661
- for (var i = n > 1 ? void 0 : n ? Ft(t, o) : t, s = e.length - 1, r; s >= 0; s--)
1668
+ var Ft = Object.defineProperty, Nt = Object.getOwnPropertyDescriptor, O = (e, t, o, n) => {
1669
+ for (var i = n > 1 ? void 0 : n ? Nt(t, o) : t, s = e.length - 1, r; s >= 0; s--)
1662
1670
  (r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
1663
- return n && i && Ut(t, o, i), i;
1671
+ return n && i && Ft(t, o, i), i;
1664
1672
  };
1665
1673
  const rt = /* @__PURE__ */ new Set(["text", "heading", "paragraph"]);
1666
1674
  function lt(e) {
@@ -1749,7 +1757,7 @@ let D = class extends $ {
1749
1757
  const r = this.toolRegistry.get(this.content.type);
1750
1758
  if (!r && this.toolRegistry.has(this.content.type))
1751
1759
  return this.toolRegistry.ensureLoaded(this.content.type).then(() => this.requestUpdate()), p`<div style="padding:16px;text-align:center;color:#9ca3af;font-size:13px;">Loading ${this.content.type}...</div>`;
1752
- const l = n ? "Hidden on desktop" : i ? "Hidden on mobile" : "", d = rt.has(this.content.type);
1760
+ const a = n ? "Hidden on desktop" : i ? "Hidden on mobile" : "", d = rt.has(this.content.type);
1753
1761
  if (this.editing && d && r) {
1754
1762
  const h = this.content.values, g = lt(this.content.type), u = h[g] || "", f = this.getInlineStyles(h);
1755
1763
  return p`
@@ -1773,7 +1781,7 @@ let D = class extends $ {
1773
1781
  displayMode: "email"
1774
1782
  });
1775
1783
  return p`
1776
- ${s ? p`<div class="hidden-badge">${l}</div>` : ""}
1784
+ ${s ? p`<div class="hidden-badge">${a}</div>` : ""}
1777
1785
  <div class="action-bar">
1778
1786
  <button class="action-btn" @click=${this.handleDuplicate} title="Duplicate">&#9851;</button>
1779
1787
  <button class="action-btn" @click=${this.handleDelete} title="Delete">&#10005;</button>
@@ -1802,8 +1810,8 @@ let D = class extends $ {
1802
1810
  s && t.push(`font-size:${s}`);
1803
1811
  const r = o("fontWeight");
1804
1812
  r && t.push(`font-weight:${r}`);
1805
- const l = o("lineHeight", "140%");
1806
- t.push(`line-height:${l}`);
1813
+ const a = o("lineHeight", "140%");
1814
+ t.push(`line-height:${a}`);
1807
1815
  const d = o("textAlign");
1808
1816
  d && t.push(`text-align:${d}`);
1809
1817
  const c = o("letterSpacing");
@@ -1869,10 +1877,10 @@ O([
1869
1877
  D = O([
1870
1878
  C("me-content-renderer")
1871
1879
  ], D);
1872
- var Nt = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, H = (e, t, o, n) => {
1873
- for (var i = n > 1 ? void 0 : n ? qt(t, o) : t, s = e.length - 1, r; s >= 0; s--)
1880
+ var qt = Object.defineProperty, Gt = Object.getOwnPropertyDescriptor, H = (e, t, o, n) => {
1881
+ for (var i = n > 1 ? void 0 : n ? Gt(t, o) : t, s = e.length - 1, r; s >= 0; s--)
1874
1882
  (r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
1875
- return n && i && Nt(t, o, i), i;
1883
+ return n && i && qt(t, o, i), i;
1876
1884
  };
1877
1885
  let S = class extends $ {
1878
1886
  constructor() {
@@ -1948,10 +1956,10 @@ H([
1948
1956
  S = H([
1949
1957
  C("me-column-renderer")
1950
1958
  ], S);
1951
- var Gt = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, F = (e, t, o, n) => {
1952
- for (var i = n > 1 ? void 0 : n ? Kt(t, o) : t, s = e.length - 1, r; s >= 0; s--)
1959
+ var Kt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, F = (e, t, o, n) => {
1960
+ for (var i = n > 1 ? void 0 : n ? Yt(t, o) : t, s = e.length - 1, r; s >= 0; s--)
1953
1961
  (r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
1954
- return n && i && Gt(t, o, i), i;
1962
+ return n && i && Kt(t, o, i), i;
1955
1963
  };
1956
1964
  let R = class extends $ {
1957
1965
  constructor() {
@@ -1981,10 +1989,10 @@ let R = class extends $ {
1981
1989
  }
1982
1990
  render() {
1983
1991
  if (!this.store) return p``;
1984
- const { row: e, store: t, toolRegistry: o } = this, n = e.values.backgroundColor || "transparent", i = e.values.columnsBackgroundColor || "transparent", s = e.values.padding || "0px", r = e.cells.reduce((x, m) => x + m, 0), l = e.values.backgroundImage, d = typeof l == "object" && l?.url ? l.url : "";
1992
+ const { row: e, store: t, toolRegistry: o } = this, n = e.values.backgroundColor || "transparent", i = e.values.columnsBackgroundColor || "transparent", s = e.values.padding || "0px", r = e.cells.reduce((x, m) => x + m, 0), a = e.values.backgroundImage, d = typeof a == "object" && a?.url ? a.url : "";
1985
1993
  let c = "";
1986
1994
  if (d) {
1987
- const x = l.repeat === !0 || l.repeat === "repeat" ? "repeat" : "no-repeat", m = l.cover === !0 ? "cover" : l.fullWidth === !0 ? "100% auto" : "auto", w = l.center !== !1 ? "center" : "top left";
1995
+ const x = a.repeat === !0 || a.repeat === "repeat" ? "repeat" : "no-repeat", m = a.cover === !0 ? "cover" : a.fullWidth === !0 ? "100% auto" : "auto", w = a.center !== !1 ? "center" : "top left";
1988
1996
  c = `background-image:url('${d}');background-size:${m};background-position:${w};background-repeat:${x};`;
1989
1997
  }
1990
1998
  const h = t.viewMode, g = !!e.values.hideDesktop, u = !!e.values.hideMobile, f = h === "desktop" && g || h === "mobile" && u, y = g ? "Hidden on desktop" : u ? "Hidden on mobile" : "";
@@ -2100,10 +2108,10 @@ F([
2100
2108
  R = F([
2101
2109
  C("me-row-renderer")
2102
2110
  ], R);
2103
- var Yt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, J = (e, t, o, n) => {
2104
- for (var i = n > 1 ? void 0 : n ? Jt(t, o) : t, s = e.length - 1, r; s >= 0; s--)
2111
+ var Jt = Object.defineProperty, Xt = Object.getOwnPropertyDescriptor, J = (e, t, o, n) => {
2112
+ for (var i = n > 1 ? void 0 : n ? Xt(t, o) : t, s = e.length - 1, r; s >= 0; s--)
2105
2113
  (r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
2106
- return n && i && Yt(t, o, i), i;
2114
+ return n && i && Jt(t, o, i), i;
2107
2115
  };
2108
2116
  let M = class extends $ {
2109
2117
  constructor() {
@@ -2221,10 +2229,10 @@ J([
2221
2229
  M = J([
2222
2230
  C("me-editor-canvas")
2223
2231
  ], M);
2224
- var Xt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, dt = (e, t, o, n) => {
2225
- for (var i = n > 1 ? void 0 : n ? Qt(t, o) : t, s = e.length - 1, r; s >= 0; s--)
2232
+ var Qt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, dt = (e, t, o, n) => {
2233
+ for (var i = n > 1 ? void 0 : n ? Zt(t, o) : t, s = e.length - 1, r; s >= 0; s--)
2226
2234
  (r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
2227
- return n && i && Xt(t, o, i), i;
2235
+ return n && i && Qt(t, o, i), i;
2228
2236
  };
2229
2237
  const G = [
2230
2238
  // System / email-safe fonts
@@ -2374,10 +2382,10 @@ dt([
2374
2382
  A = dt([
2375
2383
  C("me-body-settings")
2376
2384
  ], A);
2377
- var Zt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, X = (e, t, o, n) => {
2378
- for (var i = n > 1 ? void 0 : n ? te(t, o) : t, s = e.length - 1, r; s >= 0; s--)
2385
+ var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, X = (e, t, o, n) => {
2386
+ for (var i = n > 1 ? void 0 : n ? ee(t, o) : t, s = e.length - 1, r; s >= 0; s--)
2379
2387
  (r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
2380
- return n && i && Zt(t, o, i), i;
2388
+ return n && i && te(t, o, i), i;
2381
2389
  };
2382
2390
  let P = class extends $ {
2383
2391
  constructor() {
@@ -2614,7 +2622,7 @@ X([
2614
2622
  P = X([
2615
2623
  C("me-editor-sidebar")
2616
2624
  ], P);
2617
- function ee(e, t, o) {
2625
+ function oe(e, t, o) {
2618
2626
  const n = e && /^#[0-9a-fA-F]{3,8}$/.test(e) ? e : "#000000";
2619
2627
  return p`
2620
2628
  <div class="prop-row">
@@ -2628,7 +2636,7 @@ function ee(e, t, o) {
2628
2636
  </div>
2629
2637
  `;
2630
2638
  }
2631
- function oe(e, t, o, n) {
2639
+ function ne(e, t, o, n) {
2632
2640
  const i = n?.options || [];
2633
2641
  return p`
2634
2642
  <div class="prop-row">
@@ -2639,7 +2647,7 @@ function oe(e, t, o, n) {
2639
2647
  </div>
2640
2648
  `;
2641
2649
  }
2642
- function ne(e, t, o) {
2650
+ function ie(e, t, o) {
2643
2651
  return p`
2644
2652
  <div class="prop-row">
2645
2653
  <label class="prop-label">${o}</label>
@@ -2654,24 +2662,24 @@ function ne(e, t, o) {
2654
2662
  </div>
2655
2663
  `;
2656
2664
  }
2657
- function ie(e) {
2665
+ function se(e) {
2658
2666
  const t = (e || "0px").split(/\s+/).map((r) => parseInt(r) || 0), o = t[0], n = t[1] ?? o, i = t[2] ?? o, s = t[3] ?? n;
2659
2667
  return [o, n, i, s];
2660
2668
  }
2661
- function se(e, t, o, n) {
2669
+ function re(e, t, o, n) {
2662
2670
  return e === t && t === o && o === n ? `${e}px` : e === o && t === n ? `${e}px ${t}px` : `${e}px ${t}px ${o}px ${n}px`;
2663
2671
  }
2664
- function re(e, t, o) {
2665
- const [n, i, s, r] = ie(e), l = (c, h, g, u) => t(se(c, h, g, u));
2672
+ function le(e, t, o) {
2673
+ const [n, i, s, r] = se(e), a = (c, h, g, u) => t(re(c, h, g, u));
2666
2674
  return p`
2667
2675
  <div class="prop-row">
2668
2676
  <label class="prop-label">${o}</label>
2669
2677
  <div style="display:grid;grid-template-columns:1fr 1fr;gap:4px;">
2670
2678
  ${[
2671
- { label: "T", val: n, change: (c) => l(c, i, s, r) },
2672
- { label: "R", val: i, change: (c) => l(n, c, s, r) },
2673
- { label: "B", val: s, change: (c) => l(n, i, c, r) },
2674
- { label: "L", val: r, change: (c) => l(n, i, s, c) }
2679
+ { label: "T", val: n, change: (c) => a(c, i, s, r) },
2680
+ { label: "R", val: i, change: (c) => a(n, c, s, r) },
2681
+ { label: "B", val: s, change: (c) => a(n, i, c, r) },
2682
+ { label: "L", val: r, change: (c) => a(n, i, s, c) }
2675
2683
  ].map((c) => p`
2676
2684
  <div style="display:flex;align-items:center;gap:4px;">
2677
2685
  <span style="font-size:10px;color:#9ca3af;width:12px;">${c.label}</span>
@@ -2684,7 +2692,7 @@ function re(e, t, o) {
2684
2692
  </div>
2685
2693
  `;
2686
2694
  }
2687
- function le(e, t, o) {
2695
+ function ae(e, t, o) {
2688
2696
  return p`
2689
2697
  <div class="prop-row">
2690
2698
  <div class="prop-toggle">
@@ -2695,7 +2703,7 @@ function le(e, t, o) {
2695
2703
  </div>
2696
2704
  `;
2697
2705
  }
2698
- function ae(e, t, o) {
2706
+ function de(e, t, o) {
2699
2707
  return p`
2700
2708
  <div class="prop-row">
2701
2709
  <label class="prop-label">${o}</label>
@@ -2704,7 +2712,7 @@ function ae(e, t, o) {
2704
2712
  </div>
2705
2713
  `;
2706
2714
  }
2707
- function de(e, t, o) {
2715
+ function ce(e, t, o) {
2708
2716
  return p`
2709
2717
  <div class="prop-row">
2710
2718
  <label class="prop-label">${o}</label>
@@ -2716,10 +2724,10 @@ function de(e, t, o) {
2716
2724
  </div>
2717
2725
  `;
2718
2726
  }
2719
- var ce = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, Q = (e, t, o, n) => {
2720
- for (var i = n > 1 ? void 0 : n ? pe(t, o) : t, s = e.length - 1, r; s >= 0; s--)
2727
+ var pe = Object.defineProperty, he = Object.getOwnPropertyDescriptor, Q = (e, t, o, n) => {
2728
+ for (var i = n > 1 ? void 0 : n ? he(t, o) : t, s = e.length - 1, r; s >= 0; s--)
2721
2729
  (r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
2722
- return n && i && ce(t, o, i), i;
2730
+ return n && i && pe(t, o, i), i;
2723
2731
  };
2724
2732
  let E = class extends $ {
2725
2733
  constructor() {
@@ -2770,20 +2778,20 @@ let E = class extends $ {
2770
2778
  const n = e.values[t] ?? o.defaultValue, i = this.onChange(e.id, t);
2771
2779
  switch (o.widget) {
2772
2780
  case "color_picker":
2773
- return ee(n, i, o.label);
2781
+ return oe(n, i, o.label);
2774
2782
  case "toggle":
2775
- return le(n, i, o.label);
2783
+ return ae(n, i, o.label);
2776
2784
  case "rich_text":
2777
- return de(n, i, o.label);
2785
+ return ce(n, i, o.label);
2778
2786
  case "dropdown":
2779
- return oe(n, i, o.label, o.widgetParams);
2787
+ return ne(n, i, o.label, o.widgetParams);
2780
2788
  case "alignment":
2781
- return ne(n, i, o.label);
2789
+ return ie(n, i, o.label);
2782
2790
  case "padding":
2783
- return re(n, i, o.label);
2791
+ return le(n, i, o.label);
2784
2792
  case "text":
2785
2793
  default:
2786
- return ae(n, i, o.label);
2794
+ return de(n, i, o.label);
2787
2795
  }
2788
2796
  }
2789
2797
  };
@@ -2830,14 +2838,14 @@ Q([
2830
2838
  E = Q([
2831
2839
  C("me-property-panel")
2832
2840
  ], E);
2833
- var he = Object.defineProperty, ue = Object.getOwnPropertyDescriptor, ct = (e, t, o, n) => {
2834
- for (var i = n > 1 ? void 0 : n ? ue(t, o) : t, s = e.length - 1, r; s >= 0; s--)
2841
+ var ue = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, ct = (e, t, o, n) => {
2842
+ for (var i = n > 1 ? void 0 : n ? ge(t, o) : t, s = e.length - 1, r; s >= 0; s--)
2835
2843
  (r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
2836
- return n && i && he(t, o, i), i;
2844
+ return n && i && ue(t, o, i), i;
2837
2845
  };
2838
2846
  let B = class extends $ {
2839
2847
  constructor() {
2840
- super(...arguments), this.options = {}, this.store = new wt(), this.toolRegistry = new vt(), this.dragManager = null, this.callbacks = /* @__PURE__ */ new Map(), this.unsubscribe = null, this._handleKeydown = (e) => {
2848
+ super(...arguments), this.options = {}, this.store = new vt(), this.toolRegistry = new $t(), this.dragManager = null, this.callbacks = /* @__PURE__ */ new Map(), this.unsubscribe = null, this._handleKeydown = (e) => {
2841
2849
  const t = e.metaKey || e.ctrlKey, n = e.composedPath().some((i) => {
2842
2850
  const s = i?.tagName;
2843
2851
  return s === "INPUT" || s === "TEXTAREA" || s === "SELECT";
@@ -2849,7 +2857,7 @@ let B = class extends $ {
2849
2857
  super.connectedCallback(), this.registerBuiltInTools(), this.applyOptions(), this.setAttribute("tabindex", "0"), this.addEventListener("keydown", this._handleKeydown);
2850
2858
  }
2851
2859
  firstUpdated() {
2852
- this.dragManager = new $t(this.store, this.toolRegistry, this.shadowRoot), this.dragManager.attach(), this.store.events.on("design:loaded", (e) => {
2860
+ this.dragManager = new kt(this.store, this.toolRegistry, this.shadowRoot), this.dragManager.attach(), this.store.events.on("design:loaded", (e) => {
2853
2861
  this.dispatchEvent(new CustomEvent("design:loaded", { detail: e, bubbles: !0, composed: !0 }));
2854
2862
  }), this.store.events.on("design:updated", (e) => {
2855
2863
  this.dispatchEvent(new CustomEvent("design:updated", { detail: e, bubbles: !0, composed: !0 }));
@@ -2871,8 +2879,8 @@ let B = class extends $ {
2871
2879
  const o = this.store.getDesign(), n = /* @__PURE__ */ new Set();
2872
2880
  for (const s of o.body.rows)
2873
2881
  for (const r of s.columns)
2874
- for (const l of r.contents)
2875
- n.add(l.type);
2882
+ for (const a of r.contents)
2883
+ n.add(a.type);
2876
2884
  const i = Array.from(n).filter((s) => !this.toolRegistry.isLoaded(s)).map((s) => this.toolRegistry.ensureLoaded(s));
2877
2885
  i.length > 0 ? Promise.all(i).then(() => this.doExport(o, e, t)) : this.doExport(o, e, t);
2878
2886
  }
@@ -2880,7 +2888,7 @@ let B = class extends $ {
2880
2888
  const n = /* @__PURE__ */ new Map();
2881
2889
  for (const i of this.toolRegistry.getAll())
2882
2890
  n.set(i.name, (s, r) => i.renderer.renderHtml(s, r));
2883
- t(Ht(e, n, o));
2891
+ t(jt(e, n, o));
2884
2892
  }
2885
2893
  async exportHtmlAsync(e) {
2886
2894
  return new Promise((t) => this.exportHtml(t, e));
@@ -2922,7 +2930,7 @@ let B = class extends $ {
2922
2930
  });
2923
2931
  }
2924
2932
  registerBuiltInTools() {
2925
- for (const e of Mt)
2933
+ for (const e of Pt)
2926
2934
  this.toolRegistry.register(e);
2927
2935
  for (const { meta: e, loader: t } of st)
2928
2936
  this.toolRegistry.registerLazy(e, t);
@@ -2980,14 +2988,14 @@ _("me-editor-sidebar", P);
2980
2988
  _("me-body-settings", A);
2981
2989
  _("me-property-panel", E);
2982
2990
  _("me-inline-toolbar", V);
2983
- const xe = customElements.get("mail-editor") !== void 0;
2991
+ const we = customElements.get("mail-editor") !== void 0;
2984
2992
  export {
2985
- xe as E,
2993
+ we as E,
2986
2994
  B as M,
2987
- vt as T,
2988
- wt as a,
2995
+ $t as T,
2996
+ vt as a,
2989
2997
  z as e,
2990
- me as j,
2991
- a as s
2998
+ ye as j,
2999
+ l as s
2992
3000
  };
2993
- //# sourceMappingURL=index-C_nXnIR5.js.map
3001
+ //# sourceMappingURL=index-BoKIXJKv.js.map