@templatical/editor 0.54.0 → 0.54.2

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 (133) hide show
  1. package/dist/{AiAltTextPopover-NMJqQKvD.js → AiAltTextPopover-BBKVJ6HA.js} +1 -1
  2. package/dist/{AiAltTextReview-Ci4zHwRc.js → AiAltTextReview-BuVbeQh-.js} +1 -1
  3. package/dist/{AiRewriteMenu-CIHUnPud.js → AiRewriteMenu-ZpYJfm-O.js} +4 -4
  4. package/dist/{BlockPreviewCanvas-B70RSavL.js → BlockPreviewCanvas-DtOo5y3U.js} +6 -6
  5. package/dist/{CloudPanels-VpSQiLLL.js → CloudPanels-DQRWMc59.js} +1 -1
  6. package/dist/{CountdownToolbar-CM4XNEuO.js → CountdownToolbar-DTpMEDyh.js} +4 -4
  7. package/dist/{IssuesPanel-1wGV0wiy.js → IssuesPanel-BZn7-p9e.js} +1 -1
  8. package/dist/{LanguageMenu-d2GlX67r.js → LanguageMenu-OOmQWVzO.js} +5 -5
  9. package/dist/{LogicTagInsertButton-DgTJ6Lvx.js → LogicTagInsertButton-XESwnJia.js} +8 -8
  10. package/dist/{MergeTagInput-B_51YcQO.js → MergeTagInput-CAsBRoSm.js} +1 -1
  11. package/dist/{MergeTagModeToggle-D3Q2z317.js → MergeTagModeToggle-bOf27Hg1.js} +1 -1
  12. package/dist/{MergeTagTextarea-DZz1L9DE.js → MergeTagTextarea-DH_6JFui.js} +2 -2
  13. package/dist/{ParagraphEditor-CI68PYDL.js → ParagraphEditor-XGUkV5Uw.js} +12 -11
  14. package/dist/{RestoreVersionDialog-DcuhpOIz.js → RestoreVersionDialog-C72kWccI.js} +1 -1
  15. package/dist/{RichTextEditorContent-Dstovi0m.js → RichTextEditorContent-BZN8KRvR.js} +2 -2
  16. package/dist/{SaveBlockDialog-vuwvoi-d.js → SaveBlockDialog-CKOnTMTU.js} +4 -4
  17. package/dist/{SavedBlocksBrowserModal-DUJm0dOv.js → SavedBlocksBrowserModal-BrlNxqDH.js} +4 -4
  18. package/dist/{SavedBlocksPanels-BiMXQ5lY.js → SavedBlocksPanels--lPR6gdh.js} +1 -1
  19. package/dist/{SavedBlocksPickBar-CAstZfG7.js → SavedBlocksPickBar-4ON4_KKl.js} +1 -1
  20. package/dist/{TemplateSettings-Baar78_s.js → TemplateSettings-BE0jZmRJ.js} +4 -4
  21. package/dist/{TestEmailModal-Bl_GHdrN.js → TestEmailModal-BKmNGrZN.js} +5 -5
  22. package/dist/{TestEmailPanel-CpTBF7B5.js → TestEmailPanel-DT1wllX3.js} +1 -1
  23. package/dist/{TitleEditor-DkbEDAZB.js → TitleEditor-HjVZuUTB.js} +8 -7
  24. package/dist/{Toolbar-bOZ_eq7X.js → Toolbar-BppchV2k.js} +617 -617
  25. package/dist/{TplModal-wk2gLa7_.js → TplModal-BFWOoK8l.js} +1 -1
  26. package/dist/{VersionHistoryPanels-Cq2rFKIX.js → VersionHistoryPanels-D4yNVLvq.js} +1 -1
  27. package/dist/{WrapperBlock-cWT_nZgQ.js → WrapperBlock-BUzQTZuu.js} +3 -3
  28. package/dist/{blockTypeIcons-BUyPZ7Su.js → blockTypeIcons-D91v9k0x.js} +1 -1
  29. package/dist/bundle-stats.json +6 -6
  30. package/dist/cdn/chunks/{AiAltTextPopover-Cnc_kUmb.js → AiAltTextPopover-CAI18sdv.js} +2 -2
  31. package/dist/cdn/chunks/{AiAltTextPopover-Cnc_kUmb.js.map → AiAltTextPopover-CAI18sdv.js.map} +1 -1
  32. package/dist/cdn/chunks/{AiAltTextReview-DPeSY-7r.js → AiAltTextReview-CWEyMOF-.js} +2 -2
  33. package/dist/cdn/chunks/{AiAltTextReview-DPeSY-7r.js.map → AiAltTextReview-CWEyMOF-.js.map} +1 -1
  34. package/dist/cdn/chunks/{AiRewriteMenu-C4btyN4W.js → AiRewriteMenu-BEepu1vo.js} +5 -5
  35. package/dist/cdn/chunks/{AiRewriteMenu-C4btyN4W.js.map → AiRewriteMenu-BEepu1vo.js.map} +1 -1
  36. package/dist/cdn/chunks/{BlockPreviewCanvas-CTKmBPsq.js → BlockPreviewCanvas-B6ndvof2.js} +5 -5
  37. package/dist/cdn/chunks/{BlockPreviewCanvas-CTKmBPsq.js.map → BlockPreviewCanvas-B6ndvof2.js.map} +1 -1
  38. package/dist/cdn/chunks/{CloudPanels-COU26R83.js → CloudPanels-BGwDb0jB.js} +2 -2
  39. package/dist/cdn/chunks/{CloudPanels-COU26R83.js.map → CloudPanels-BGwDb0jB.js.map} +1 -1
  40. package/dist/cdn/chunks/{CountdownToolbar-CNgsNL5-.js → CountdownToolbar-B-0FsTj-.js} +5 -5
  41. package/dist/cdn/chunks/{CountdownToolbar-CNgsNL5-.js.map → CountdownToolbar-B-0FsTj-.js.map} +1 -1
  42. package/dist/cdn/chunks/{IssuesPanel-Duic0mIs.js → IssuesPanel-LyjMBDok.js} +3 -3
  43. package/dist/cdn/chunks/{IssuesPanel-Duic0mIs.js.map → IssuesPanel-LyjMBDok.js.map} +1 -1
  44. package/dist/cdn/chunks/{LanguageMenu-B1Aue_lf.js → LanguageMenu-CGwMCOQ5.js} +4 -4
  45. package/dist/cdn/chunks/{LanguageMenu-B1Aue_lf.js.map → LanguageMenu-CGwMCOQ5.js.map} +1 -1
  46. package/dist/cdn/chunks/{LogicTagInsertButton-Bhvi0nWz.js → LogicTagInsertButton-PDKuo2J3.js} +4 -4
  47. package/dist/cdn/chunks/{LogicTagInsertButton-Bhvi0nWz.js.map → LogicTagInsertButton-PDKuo2J3.js.map} +1 -1
  48. package/dist/cdn/chunks/{MergeTagInput-CrhZm-AW.js → MergeTagInput-DoQHBJk2.js} +2 -2
  49. package/dist/cdn/chunks/{MergeTagInput-CrhZm-AW.js.map → MergeTagInput-DoQHBJk2.js.map} +1 -1
  50. package/dist/cdn/chunks/{MergeTagModeToggle-CWVtXLYa.js → MergeTagModeToggle-Ct5IG4VW.js} +2 -2
  51. package/dist/cdn/chunks/{MergeTagModeToggle-CWVtXLYa.js.map → MergeTagModeToggle-Ct5IG4VW.js.map} +1 -1
  52. package/dist/cdn/chunks/{MergeTagTextarea-hTIBwX0F.js → MergeTagTextarea-BMsnjphR.js} +3 -3
  53. package/dist/cdn/chunks/{MergeTagTextarea-hTIBwX0F.js.map → MergeTagTextarea-BMsnjphR.js.map} +1 -1
  54. package/dist/cdn/chunks/{ParagraphEditor-B2UU1Q5I.js → ParagraphEditor-CVW-kuHW.js} +114 -113
  55. package/dist/cdn/chunks/ParagraphEditor-CVW-kuHW.js.map +1 -0
  56. package/dist/cdn/chunks/{RestoreVersionDialog-C1Y5Ewo_.js → RestoreVersionDialog-7MFZz-Sb.js} +2 -2
  57. package/dist/cdn/chunks/{RestoreVersionDialog-C1Y5Ewo_.js.map → RestoreVersionDialog-7MFZz-Sb.js.map} +1 -1
  58. package/dist/cdn/chunks/{RichTextEditorContent-up4AqL7D.js → RichTextEditorContent-CiL-SkZg.js} +3 -3
  59. package/dist/cdn/chunks/{RichTextEditorContent-up4AqL7D.js.map → RichTextEditorContent-CiL-SkZg.js.map} +1 -1
  60. package/dist/cdn/chunks/{SaveBlockDialog-B9lwEP_T.js → SaveBlockDialog-CxdekCYy.js} +5 -5
  61. package/dist/cdn/chunks/{SaveBlockDialog-B9lwEP_T.js.map → SaveBlockDialog-CxdekCYy.js.map} +1 -1
  62. package/dist/cdn/chunks/{SavedBlocksBrowserModal-fAeHUyxb.js → SavedBlocksBrowserModal-D9CAa2U3.js} +4 -4
  63. package/dist/cdn/chunks/{SavedBlocksBrowserModal-fAeHUyxb.js.map → SavedBlocksBrowserModal-D9CAa2U3.js.map} +1 -1
  64. package/dist/cdn/chunks/{SavedBlocksPanels-DRDTLDyZ.js → SavedBlocksPanels-jfkYWtss.js} +2 -2
  65. package/dist/cdn/chunks/{SavedBlocksPanels-DRDTLDyZ.js.map → SavedBlocksPanels-jfkYWtss.js.map} +1 -1
  66. package/dist/cdn/chunks/{SavedBlocksPickBar-B6b5z-o3.js → SavedBlocksPickBar-yaCumC4j.js} +2 -2
  67. package/dist/cdn/chunks/{SavedBlocksPickBar-B6b5z-o3.js.map → SavedBlocksPickBar-yaCumC4j.js.map} +1 -1
  68. package/dist/cdn/chunks/{TemplateSettings-CWUpUKJb.js → TemplateSettings-SaV2UVh_.js} +5 -5
  69. package/dist/cdn/chunks/{TemplateSettings-CWUpUKJb.js.map → TemplateSettings-SaV2UVh_.js.map} +1 -1
  70. package/dist/cdn/chunks/{TestEmailModal-DQxnW5Q5.js → TestEmailModal-ByfhP_sm.js} +6 -6
  71. package/dist/cdn/chunks/{TestEmailModal-DQxnW5Q5.js.map → TestEmailModal-ByfhP_sm.js.map} +1 -1
  72. package/dist/cdn/chunks/{TestEmailPanel-BcO_-16H.js → TestEmailPanel-CfzpqpDs.js} +2 -2
  73. package/dist/cdn/chunks/{TestEmailPanel-BcO_-16H.js.map → TestEmailPanel-CfzpqpDs.js.map} +1 -1
  74. package/dist/cdn/chunks/{TitleEditor-pmycpmTd.js → TitleEditor-Ceb0YfWv.js} +8 -7
  75. package/dist/cdn/chunks/TitleEditor-Ceb0YfWv.js.map +1 -0
  76. package/dist/cdn/chunks/{Toolbar-BlWVQRcA.js → Toolbar-Cv6Rv1S-.js} +9 -9
  77. package/dist/cdn/chunks/{Toolbar-BlWVQRcA.js.map → Toolbar-Cv6Rv1S-.js.map} +1 -1
  78. package/dist/cdn/chunks/{TplModal-ClSSGX7a.js → TplModal-DGpGdwgf.js} +2 -2
  79. package/dist/cdn/chunks/{TplModal-ClSSGX7a.js.map → TplModal-DGpGdwgf.js.map} +1 -1
  80. package/dist/cdn/chunks/{VersionHistoryPanels-B8GPBKMq.js → VersionHistoryPanels-BJnHCMAH.js} +2 -2
  81. package/dist/cdn/chunks/{VersionHistoryPanels-B8GPBKMq.js.map → VersionHistoryPanels-BJnHCMAH.js.map} +1 -1
  82. package/dist/cdn/chunks/{WrapperBlock-BoUflYwY.js → WrapperBlock-C_uE5rPJ.js} +4 -4
  83. package/dist/cdn/chunks/{WrapperBlock-BoUflYwY.js.map → WrapperBlock-C_uE5rPJ.js.map} +1 -1
  84. package/dist/cdn/chunks/{composables-C1KU4ZHw.js → composables-BxikPuC1.js} +449 -443
  85. package/dist/cdn/chunks/composables-BxikPuC1.js.map +1 -0
  86. package/dist/cdn/chunks/{createCloudRuntime-C2Zs5F1O.js → createCloudRuntime-D2DUaudp.js} +3 -3
  87. package/dist/cdn/chunks/{createCloudRuntime-C2Zs5F1O.js.map → createCloudRuntime-D2DUaudp.js.map} +1 -1
  88. package/dist/cdn/chunks/{extensions-DcMKZpzh.js → extensions-DuDWpKo7.js} +4 -4
  89. package/dist/cdn/chunks/{extensions-DcMKZpzh.js.map → extensions-DuDWpKo7.js.map} +1 -1
  90. package/dist/cdn/chunks/{normalizeMergeTagMarkup-cC32Ox6A.js → normalizeMergeTagMarkup-Bn_hl4jd.js} +2 -2
  91. package/dist/cdn/chunks/{normalizeMergeTagMarkup-cC32Ox6A.js.map → normalizeMergeTagMarkup-Bn_hl4jd.js.map} +1 -1
  92. package/dist/cdn/chunks/{preRenderCustomBlocks-f7GEKdvw.js → preRenderCustomBlocks-C9oavydG.js} +2 -2
  93. package/dist/cdn/chunks/{preRenderCustomBlocks-f7GEKdvw.js.map → preRenderCustomBlocks-C9oavydG.js.map} +1 -1
  94. package/dist/cdn/chunks/{sanitizeHtml-WTfz9lZd.js → sanitizeHtml-DfXoetOm.js} +2 -2
  95. package/dist/cdn/chunks/{sanitizeHtml-WTfz9lZd.js.map → sanitizeHtml-DfXoetOm.js.map} +1 -1
  96. package/dist/cdn/chunks/{socialIcons-DeCYorUT.js → socialIcons-DPwkrn5v.js} +2 -2
  97. package/dist/cdn/chunks/{socialIcons-DeCYorUT.js.map → socialIcons-DPwkrn5v.js.map} +1 -1
  98. package/dist/cdn/chunks/{src-A_cKeTM_.js → src-712f3ofG.js} +2 -2
  99. package/dist/cdn/chunks/{src-A_cKeTM_.js.map → src-712f3ofG.js.map} +1 -1
  100. package/dist/cdn/chunks/{src-BWX_xVxO.js → src-B2tQbzf6.js} +152 -146
  101. package/dist/cdn/chunks/src-B2tQbzf6.js.map +1 -0
  102. package/dist/cdn/chunks/{src-BQUv2CYU.js → src-ZFw5fg_z.js} +40 -27
  103. package/dist/cdn/chunks/{src-BQUv2CYU.js.map → src-ZFw5fg_z.js.map} +1 -1
  104. package/dist/cdn/chunks/{useLocalizedDisplay-aGfnO90D.js → useLocalizedDisplay-DiNjT22M.js} +2 -2
  105. package/dist/cdn/chunks/{useLocalizedDisplay-aGfnO90D.js.map → useLocalizedDisplay-DiNjT22M.js.map} +1 -1
  106. package/dist/cdn/chunks/{useLogicTag-DtYe8HIq.js → useLogicTag-SvMW4g00.js} +2 -2
  107. package/dist/cdn/chunks/{useLogicTag-DtYe8HIq.js.map → useLogicTag-SvMW4g00.js.map} +1 -1
  108. package/dist/cdn/chunks/{useMergeTag-B8ULmsnp.js → useMergeTag-JLz3Pqcw.js} +2 -2
  109. package/dist/cdn/chunks/{useMergeTag-B8ULmsnp.js.map → useMergeTag-JLz3Pqcw.js.map} +1 -1
  110. package/dist/cdn/chunks/{withCurrentFont-MK8ga9q9.js → withCurrentFont-BcoPpkDS.js} +2 -2
  111. package/dist/cdn/chunks/{withCurrentFont-MK8ga9q9.js.map → withCurrentFont-BcoPpkDS.js.map} +1 -1
  112. package/dist/cdn/editor.css +1 -1
  113. package/dist/cdn/editor.js +18 -18
  114. package/dist/{composables-CMIrGXJ1.js → composables-BbPFRlBf.js} +908 -902
  115. package/dist/{createCloudRuntime-DGV5a5Af.js → createCloudRuntime-Dlrg88gS.js} +2 -2
  116. package/dist/{dist-Cdkm20M6.js → dist-C34cYI5S.js} +126 -113
  117. package/dist/{extensions-BJ184osp.js → extensions-xCiyqSg7.js} +16 -16
  118. package/dist/{normalizeMergeTagMarkup-CUCo7B5X.js → normalizeMergeTagMarkup-C7FGNURu.js} +22 -22
  119. package/dist/{preRenderCustomBlocks-Bs3N9no-.js → preRenderCustomBlocks-DvbRa3L3.js} +3 -3
  120. package/dist/{sanitizeHtml-2rjV0r-6.js → sanitizeHtml-D_ab7dD6.js} +5 -5
  121. package/dist/{socialIcons-TFiOkpoU.js → socialIcons-DhAolBjt.js} +342 -342
  122. package/dist/style.css +1 -1
  123. package/dist/templatical-editor.js +190 -190
  124. package/dist/useLocalizedDisplay-C9MBFUr4.js +31 -0
  125. package/dist/{useLogicTag-BXXXQQmi.js → useLogicTag-BmuakZBd.js} +1 -1
  126. package/dist/{useMergeTag-C9Okr87y.js → useMergeTag-DC4a8b_v.js} +3 -3
  127. package/dist/{withCurrentFont-DJiQqZzL.js → withCurrentFont-BSxJai99.js} +1 -1
  128. package/package.json +7 -7
  129. package/dist/cdn/chunks/ParagraphEditor-B2UU1Q5I.js.map +0 -1
  130. package/dist/cdn/chunks/TitleEditor-pmycpmTd.js.map +0 -1
  131. package/dist/cdn/chunks/composables-C1KU4ZHw.js.map +0 -1
  132. package/dist/cdn/chunks/src-BWX_xVxO.js.map +0 -1
  133. package/dist/useLocalizedDisplay-DNNwDRxL.js +0 -31
@@ -1,9 +1,9 @@
1
- import { A as e, Ct as t, Dt as n, Et as r, O as i, Ot as a, Q as o, Rt as s, Tt as c, Yt as l, _n as u, _t as d, b as f, bn as p, bt as m, ct as h, fn as g, gn as _, gt as v, hn as y, ht as b, k as ee, nn as te, ot as x, pt as S, rt as C, sn as ne, vn as w, vt as re, wt as ie, x as ae, xt as T, y as oe, yn as se, yt as ce } from "./src-BQUv2CYU.js";
1
+ import { A as e, Ct as t, Dt as n, Et as r, O as i, Ot as a, Q as o, Rt as s, Tt as c, Yt as l, _n as u, _t as d, b as f, bn as p, bt as m, ct as h, fn as g, gn as _, gt as v, hn as y, ht as b, k as ee, nn as te, ot as x, pt as ne, rt as S, sn as re, vn as ie, vt as ae, wt as oe, x as se, xt as C, y as ce, yn as le, yt as ue } from "./src-ZFw5fg_z.js";
2
2
  // ../renderer/src/render-context.ts
3
- var E = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
3
+ var w = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
4
4
  name: "@templatical/renderer",
5
5
  description: "Render Templatical email templates to MJML",
6
- version: "0.54.0",
6
+ version: "0.54.2",
7
7
  bugs: "https://github.com/templatical/sdk/issues",
8
8
  dependencies: { "@templatical/types": "workspace:*" },
9
9
  devDependencies: {
@@ -45,7 +45,7 @@ var E = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
45
45
  },
46
46
  type: "module",
47
47
  types: "./dist/index.d.ts"
48
- }.version}/assets/social`, D = class e {
48
+ }.version}/assets/social`, de = class e {
49
49
  containerWidth;
50
50
  customFonts;
51
51
  defaultFallbackFont;
@@ -55,76 +55,74 @@ var E = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
55
55
  blockRenderers;
56
56
  contentDirection;
57
57
  contentWidth;
58
- constructor(e, t, n, r, i = /* @__PURE__ */ new Map(), a = E, o = {}, s = "ltr", c) {
58
+ constructor(e, t, n, r, i = /* @__PURE__ */ new Map(), a = w, o = {}, s = "ltr", c) {
59
59
  this.containerWidth = e, this.customFonts = t, this.defaultFallbackFont = n, this.allowHtmlBlocks = r, this.customBlockHtml = i, this.socialIconsBaseUrl = a, this.blockRenderers = o, this.contentDirection = s, this.contentWidth = c ?? e;
60
60
  }
61
61
  withContainerWidth(t, n = t) {
62
62
  return new e(t, this.customFonts, this.defaultFallbackFont, this.allowHtmlBlocks, this.customBlockHtml, this.socialIconsBaseUrl, this.blockRenderers, this.contentDirection, n);
63
63
  }
64
64
  resolveFontFamily(e) {
65
- return oe(e, {
65
+ return ce(e, {
66
66
  customFonts: this.customFonts,
67
67
  defaultFallback: this.defaultFallbackFont
68
68
  });
69
69
  }
70
- };
71
- // ../renderer/src/visibility.ts
70
+ }, T = {
71
+ "&": "&",
72
+ "<": "&lt;",
73
+ ">": "&gt;",
74
+ "\"": "&quot;",
75
+ "'": "&#039;"
76
+ }, E = /[&<>"']/g;
77
+ function D(e) {
78
+ return e === "" ? "" : e.replace(E, (e) => T[e] ?? e);
79
+ }
72
80
  function O(e) {
81
+ return e === "" ? "" : e.replace(E, (e) => T[e] ?? e);
82
+ }
83
+ function k(e) {
84
+ return e === "" ? "" : O(e.replace(/[;{}\r\n]/g, ""));
85
+ }
86
+ var fe = /[&<>"]/g;
87
+ function A(e) {
88
+ return e.replace(fe, (e) => T[e] ?? e);
89
+ }
90
+ // ../renderer/src/visibility.ts
91
+ function j(e) {
73
92
  let t = e.visibility;
74
93
  return t ? !t.desktop && !t.mobile : !1;
75
94
  }
76
- function k(e, t = []) {
77
- let n = [le(e), ...t].filter((e) => e !== "").join(" ");
78
- return n === "" ? "" : ` css-class="${n}"`;
95
+ function M(e, t = []) {
96
+ let n = [N(e), ...t].filter((e) => e !== "").join(" ");
97
+ return n === "" ? "" : ` css-class="${O(n)}"`;
79
98
  }
80
- function le(e) {
99
+ function N(e) {
81
100
  let t = e.visibility;
82
101
  if (!t) return "";
83
102
  let n = [];
84
103
  return t.desktop || n.push("tpl-hide-desktop"), t.mobile || n.push("tpl-hide-mobile"), n.join(" ");
85
104
  }
86
105
  // ../renderer/src/unrenderable.ts
87
- var ue = "templatical:unrenderable-block";
88
- function de(e) {
89
- return e.replace(/[<>]/g, "").replace(/-{2,}/g, "-");
90
- }
91
- function A(e) {
92
- return console.warn(`[Templatical] No renderer for block type "${e.type}" (id: ${e.id}). A placeholder comment was emitted in its place. Pass a \`blockRenderers\` entry for this type to render it.`), `<mj-raw><!-- ${ue} type="${de(e.type)}" id="${de(e.id)}" --></mj-raw>`;
93
- }
94
- // ../renderer/src/escape.ts
95
- var j = {
96
- "&": "&amp;",
97
- "<": "&lt;",
98
- ">": "&gt;",
99
- "\"": "&quot;",
100
- "'": "&#039;"
101
- }, M = /[&<>"']/g;
102
- function N(e) {
103
- return e === "" ? "" : e.replace(M, (e) => j[e] ?? e);
104
- }
105
- function P(e) {
106
- return e === "" ? "" : e.replace(M, (e) => j[e] ?? e);
107
- }
106
+ var P = "templatical:unrenderable-block";
108
107
  function F(e) {
109
- return e === "" ? "" : P(e).replace(/[;{}\r\n]/g, "");
108
+ return e.replace(/[<>]/g, "").replace(/-{2,}/g, "-");
110
109
  }
111
- var fe = /[&<>"]/g;
112
110
  function I(e) {
113
- return e.replace(fe, (e) => j[e] ?? e);
111
+ return console.warn(`[Templatical] No renderer for block type "${e.type}" (id: ${e.id}). A placeholder comment was emitted in its place. Pass a \`blockRenderers\` entry for this type to render it.`), `<mj-raw><!-- ${P} type="${F(e.type)}" id="${F(e.id)}" --></mj-raw>`;
114
112
  }
115
113
  // ../renderer/src/padding.ts
116
114
  function L(e) {
117
- return `${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;
115
+ return O(`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`);
118
116
  }
119
117
  // ../renderer/src/utils.ts
120
118
  function R(e, t) {
121
- return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${e}"` : "";
119
+ return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${k(e)}"` : "";
122
120
  }
123
121
  function pe(e) {
124
122
  return typeof e != "number" || !Number.isFinite(e) || e <= 0 ? "" : ` height="${e}px"`;
125
123
  }
126
124
  function z(e, t) {
127
- let n = (e) => Math.trunc(e ?? 0), r = (e) => w(e) === null ? 0 : Math.trunc(e.width);
125
+ let n = (e) => Math.trunc(e ?? 0), r = (e) => ie(e) === null ? 0 : Math.trunc(e.width);
128
126
  return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
129
127
  }
130
128
  function B(e, t) {
@@ -132,15 +130,15 @@ function B(e, t) {
132
130
  return e.width === "full" || e.width >= n ? " fluid-on-mobile=\"true\"" : "";
133
131
  }
134
132
  function V(e) {
135
- return Object.entries(se(e)).map(([e, t]) => ` ${e}="${F(t)}"`).join("");
133
+ return Object.entries(le(e)).map(([e, t]) => ` ${e}="${k(t)}"`).join("");
136
134
  }
137
135
  function H(e) {
138
136
  let t = p(e);
139
- return t === null ? "" : ` border-radius="${t}"`;
137
+ return t === null ? "" : ` border-radius="${k(t)}"`;
140
138
  }
141
139
  function U(e) {
142
140
  let t = g(e);
143
- return t === null ? "" : ` background-url="${P(t.url)}" background-size="${t.size}" background-position="${t.position}" background-repeat="${t.repeat}"`;
141
+ return t === null ? "" : ` background-url="${O(t.url)}" background-size="${k(t.size)}" background-position="${k(t.position)}" background-repeat="${k(t.repeat)}"`;
144
142
  }
145
143
  // ../renderer/src/rich-text.ts
146
144
  var W = "tpl-rich-text";
@@ -163,7 +161,7 @@ function K(e) {
163
161
  }
164
162
  function he(e) {
165
163
  let t = [_.paragraphGap], n = (e) => {
166
- if (e.type === "paragraph" && t.push(K(e.paragraphSpacing)), T(e)) for (let t of e.children) for (let e of t) n(e);
164
+ if (e.type === "paragraph" && t.push(K(e.paragraphSpacing)), C(e)) for (let t of e.children) for (let e of t) n(e);
167
165
  else if (a(e)) for (let t of e.children) n(t);
168
166
  };
169
167
  for (let t of e) n(t);
@@ -229,8 +227,8 @@ function J(e) {
229
227
  }
230
228
  // ../renderer/src/renderers/title.ts
231
229
  function xe(e, t) {
232
- if (O(e)) return "";
233
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = Se(J(f(C(e.content)))), a = y[e.level] ?? y[2], o = e.color ? `\n color="${P(e.color)}"` : "", s = e.textAlign, c = Ce(e.fontFamily, t), l = k(e, [W, G(K(void 0))]), d = `h${y[e.level] ? e.level : 2}`;
230
+ if (j(e)) return "";
231
+ let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = Se(J(f(S(e.content)))), a = y[e.level] ?? y[2], o = e.color ? `\n color="${O(e.color)}"` : "", s = O(e.textAlign), c = Ce(e.fontFamily, t), l = M(e, [W, G(K(void 0))]), d = `h${y[e.level] ? e.level : 2}`;
234
232
  return `<mj-text
235
233
  font-size="${a}px"${o}
236
234
  align="${s}"
@@ -239,16 +237,22 @@ function xe(e, t) {
239
237
  ><${d} style="margin:0;font-size:inherit;color:inherit;line-height:inherit;font-weight:700">${i}</${d}></mj-text>`;
240
238
  }
241
239
  function Se(e) {
242
- let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
243
- return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
240
+ let t = /^\s*<p\b/.exec(e);
241
+ if (!t) return e;
242
+ let n = x(e, t[0].length);
243
+ if (n === -1) return e;
244
+ let r = /<\/p>\s*$/.exec(e);
245
+ if (!r || r.index <= n) return e;
246
+ let i = e.slice(n + 1, r.index);
247
+ return /<\/p>\s*<p\b/i.test(i) ? e : i;
244
248
  }
245
249
  function Ce(e, t) {
246
- return e ? ` font-family="${I(t.resolveFontFamily(e))}"` : "";
250
+ return e ? ` font-family="${A(t.resolveFontFamily(e))}"` : "";
247
251
  }
248
252
  // ../renderer/src/renderers/paragraph.ts
249
253
  function we(e, t) {
250
- if (O(e) || ae(e.content)) return "";
251
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = J(f(C(e.content))), a = k(e, [W, G(K(e.paragraphSpacing))]);
254
+ if (j(e) || se(e.content)) return "";
255
+ let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = J(f(S(e.content))), a = M(e, [W, G(K(e.paragraphSpacing))]);
252
256
  return `<mj-text
253
257
  line-height="1.5"${t.contentDirection === "rtl" ? "\n align=\"right\"" : ""}
254
258
  padding="${n}"${r}${a}
@@ -256,78 +260,80 @@ function we(e, t) {
256
260
  }
257
261
  // ../renderer/src/renderers/image.ts
258
262
  function Te(e, t) {
259
- if (O(e) || e.src === "") return "";
260
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = e.width === "full" ? t.containerWidth + "px" : e.width + "px", a = pe(e.height), o = B(e, t), s = k(e), c = H(e.borderRadius), l = V(e.border), u = "";
261
- e.linkUrl && (u = ` href="${P(e.linkUrl)}"`, e.linkOpenInNewTab && (u += " target=\"_blank\" rel=\"noopener\""));
262
- let d = P(e.src), f = e.decorative === !0;
263
+ if (j(e) || e.src === "") return "";
264
+ let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = O(e.width === "full" ? t.containerWidth + "px" : e.width + "px"), a = pe(e.height), o = B(e, t), s = M(e), c = H(e.borderRadius), l = V(e.border), u = "";
265
+ e.linkUrl && (u = ` href="${O(e.linkUrl)}"`, e.linkOpenInNewTab && (u += " target=\"_blank\" rel=\"noopener\""));
266
+ let d = O(e.src), f = e.decorative === !0;
263
267
  return `<mj-image
264
268
  src="${d}"
265
- alt="${f ? "" : P(e.alt)}"
269
+ alt="${f ? "" : O(e.alt)}"
266
270
  width="${i}"${a}${o}
267
- align="${e.align}"
271
+ align="${O(e.align)}"
268
272
  padding="${n}"${r}${l}${c}${u}${s}${f ? " role=\"presentation\"" : ""}
269
273
  />`;
270
274
  }
271
275
  // ../renderer/src/renderers/button.ts
272
276
  var Y = "tpl-button-full";
273
277
  function Ee(e, t) {
274
- if (O(e)) return "";
275
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = L(e.buttonPadding), a = e.url === "" ? "" : P(e.url), o = a === "" ? "" : ` href="${a}"`, s = De(e.backgroundColor), c = P(e.textColor), l = e.fontSize, u = ke(e.borderRadius), d = N(e.text), f = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", p = Oe(e.fontFamily, t), m = Ae(e.width), h = k(e, e.width === "full" ? [Y] : []);
278
+ if (j(e)) return "";
279
+ let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = L(e.buttonPadding), a = e.url === "" ? "" : O(e.url), o = a === "" ? "" : ` href="${a}"`, s = De(e.backgroundColor), c = O(e.textColor), l = e.fontSize, u = O(ke(e.borderRadius)), d = D(e.text), f = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", p = Oe(e.fontFamily, t), m = Ae(e.width), h = M(e, e.width === "full" ? [Y] : []), g = V(e.border), _ = O(e.align ?? "center");
276
280
  return `<mj-button${o}${f}
277
281
  background-color="${s}"
278
282
  color="${c}"
279
- font-size="${l}px"
283
+ font-size="${O(String(l))}px"
280
284
  font-weight="bold"
281
- border-radius="${u}"${V(e.border)}
285
+ border-radius="${u}"${g}
282
286
  inner-padding="${i}"
283
- align="${e.align ?? "center"}"
287
+ align="${_}"
284
288
  padding="${n}"${r}${p}${m}${h}
285
289
  >${d}</mj-button>`;
286
290
  }
287
291
  function De(e) {
288
- return e.trim() === "" ? "transparent" : P(e);
292
+ return e.trim() === "" ? "transparent" : O(e);
289
293
  }
290
294
  function Oe(e, t) {
291
- return e ? ` font-family="${I(t.resolveFontFamily(e))}"` : "";
295
+ return e ? ` font-family="${A(t.resolveFontFamily(e))}"` : "";
292
296
  }
293
297
  function ke(e) {
294
298
  return typeof e == "number" ? `${e}px` : p(e) ?? "0px";
295
299
  }
296
300
  function Ae(e) {
297
- return e === void 0 ? "" : ` width="${e === "full" ? "100%" : `${e}px`}"`;
301
+ return e === void 0 ? "" : ` width="${O(e === "full" ? "100%" : `${e}px`)}"`;
298
302
  }
299
303
  // ../renderer/src/renderers/divider.ts
300
304
  function je(e, t) {
301
- if (O(e)) return "";
302
- let n = L(e.styles.padding), r = e.styles.backgroundColor ? ` container-background-color="${P(e.styles.backgroundColor)}"` : "", i = e.width === "full" ? "100%" : typeof e.width == "number" ? `${e.width}px` : e.width;
305
+ if (j(e)) return "";
306
+ let n = L(e.styles.padding), r = e.styles.backgroundColor ? ` container-background-color="${O(e.styles.backgroundColor)}"` : "", i = e.width === "full" ? "100%" : typeof e.width == "number" ? `${e.width}px` : e.width, a = e.thickness, o = O(e.lineStyle), s = O(e.color), c = M(e);
303
307
  return `<mj-divider
304
- border-width="${e.thickness}px"
305
- border-style="${e.lineStyle}"
306
- border-color="${P(e.color)}"
307
- width="${i}"
308
- padding="${n}"${r}${k(e)}
308
+ border-width="${O(String(a))}px"
309
+ border-style="${o}"
310
+ border-color="${s}"
311
+ width="${O(i)}"
312
+ padding="${n}"${r}${c}
309
313
  />`;
310
314
  }
311
315
  // ../renderer/src/renderers/spacer.ts
312
316
  function Me(e, t) {
313
- return O(e) ? "" : `<mj-spacer height="${e.height}px" padding="0"${e.styles.backgroundColor ? ` container-background-color="${P(e.styles.backgroundColor)}"` : ""}${k(e)} />`;
317
+ if (j(e)) return "";
318
+ let n = e.height, r = e.styles.backgroundColor ? ` container-background-color="${O(e.styles.backgroundColor)}"` : "", i = M(e);
319
+ return `<mj-spacer height="${O(String(n))}px" padding="0"${r}${i} />`;
314
320
  }
315
321
  // ../renderer/src/renderers/html.ts
316
322
  function Ne(e, t) {
317
- if (O(e) || !t.allowHtmlBlocks) return "";
323
+ if (j(e) || !t.allowHtmlBlocks) return "";
318
324
  let n = e.content;
319
325
  if (n === "") return "";
320
- let r = k(e);
326
+ let r = M(e);
321
327
  return `<mj-text padding="${L(e.styles.padding)}"${R(e.styles.backgroundColor, "container")}${r}>
322
328
  ${n}
323
329
  </mj-text>`;
324
330
  }
325
331
  // ../renderer/src/renderers/social.ts
326
332
  function Pe(e, t) {
327
- if (O(e)) return "";
333
+ if (j(e)) return "";
328
334
  let n = e.icons;
329
335
  if (n.length === 0) return "";
330
- let r = L(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${P(e.styles.backgroundColor)}"` : "", a = k(e), o = e.align, s = e.iconSize, c = e.iconStyle, l = te(c, e.iconTone), u = e.spacing, d;
336
+ let r = L(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${O(e.styles.backgroundColor)}"` : "", a = M(e), o = O(e.align), s = e.iconSize, c = e.iconStyle, l = O(te(c, e.iconTone)), u = e.spacing, d;
331
337
  switch (s) {
332
338
  case "small":
333
339
  d = 24;
@@ -358,47 +364,47 @@ function Pe(e, t) {
358
364
  padding="${r}"${i}${a}
359
365
  >
360
366
  ${n.map((e, n) => {
361
- let r = e.platform, i = P(e.url), a = `${t.socialIconsBaseUrl}/${l}/${r}.png`, o = n === p - 1 ? 0 : u;
362
- return `<mj-social-element src="${a}" href="${i}" icon-size="${d}px" padding="0 ${o}px 0 0" border-radius="${f}" background-color="transparent"></mj-social-element>`;
367
+ let r = O(e.platform), i = O(e.url), a = `${t.socialIconsBaseUrl}/${l}/${r}.png`, o = n === p - 1 ? 0 : u;
368
+ return `<mj-social-element src="${a}" href="${i}" icon-size="${d}px" padding="0 ${O(String(o))}px 0 0" border-radius="${f}" background-color="transparent"></mj-social-element>`;
363
369
  }).join("\n")}
364
370
  </mj-social>`;
365
371
  }
366
372
  // ../renderer/src/renderers/menu.ts
367
373
  function Fe(e, t) {
368
- if (O(e) || e.items.length === 0) return "";
369
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = k(e), a = Re(e.fontFamily, t), o = e.textAlign;
374
+ if (j(e) || e.items.length === 0) return "";
375
+ let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = M(e), a = Re(e.fontFamily, t), o = O(e.textAlign), s = e.fontSize, c = e.color ? `\n color="${O(e.color)}"` : "", l = Ie(e);
370
376
  return `<mj-text
371
- font-size="${e.fontSize}px"${e.color ? `\n color="${P(e.color)}"` : ""}
377
+ font-size="${O(String(s))}px"${c}
372
378
  align="${o}"
373
379
  line-height="1.5"
374
380
  padding="${n}"${r}${a}${i}
375
- >${Ie(e)}</mj-text>`;
381
+ >${l}</mj-text>`;
376
382
  }
377
383
  function Ie(e) {
378
- let t = e.items, n = N(e.separator), r = F(e.separatorColor), i = e.spacing, a = e.linkColor ?? e.color, o = [], s = t.length;
379
- for (let e = 0; e < s; e++) o.push(Le(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${i}px;">${n}</span>`);
384
+ let t = e.items, n = D(e.separator), r = k(e.separatorColor), i = e.spacing, a = e.linkColor ?? e.color, o = [], s = t.length;
385
+ for (let e = 0; e < s; e++) o.push(Le(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${k(String(i))}px;">${n}</span>`);
380
386
  return o.join("");
381
387
  }
382
388
  function Le(e, t) {
383
- let n = N(e.text), r = P(e.url), i = e.color ?? t, a = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", o = ["text-decoration: none"];
384
- return i && o.unshift(`color: ${F(i)}`), e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
389
+ let n = D(e.text), r = O(e.url), i = e.color ?? t, a = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", o = ["text-decoration: none"];
390
+ return i && o.unshift(`color: ${k(i)}`), e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
385
391
  }
386
392
  function Re(e, t) {
387
- return e ? ` font-family="${I(t.resolveFontFamily(e))}"` : "";
393
+ return e ? ` font-family="${A(t.resolveFontFamily(e))}"` : "";
388
394
  }
389
395
  // ../renderer/src/renderers/table.ts
390
396
  function ze(e, t) {
391
- if (O(e) || e.rows.length === 0) return "";
392
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = k(e), a = Ue(e.fontFamily, t);
397
+ if (j(e) || e.rows.length === 0) return "";
398
+ let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = M(e), a = Ue(e.fontFamily, t), o = e.fontSize, s = e.color ? `\n color="${O(e.color)}"` : "", c = O(e.textAlign), l = Be(e);
393
399
  return `<mj-text
394
- font-size="${e.fontSize}px"${e.color ? `\n color="${P(e.color)}"` : ""}
395
- align="${e.textAlign}"
400
+ font-size="${O(String(o))}px"${s}
401
+ align="${c}"
396
402
  line-height="1.5"
397
403
  padding="${n}"${r}${a}${i}
398
- >${Be(e)}</mj-text>`;
404
+ >${l}</mj-text>`;
399
405
  }
400
406
  function Be(e) {
401
- let t = F(e.borderColor), n = e.borderWidth, r = "";
407
+ let t = k(e.borderColor), n = e.borderWidth, r = "";
402
408
  for (let i = 0; i < e.rows.length; i++) {
403
409
  let a = e.rows[i];
404
410
  r += Ve(a, e, e.hasHeaderRow && i === 0, t, n);
@@ -411,26 +417,26 @@ function Ve(e, t, n, r, i) {
411
417
  return `<tr>${a}</tr>`;
412
418
  }
413
419
  function He(e, t, n, r, i) {
414
- let a = t.cellPadding, o = [`border: ${i}px solid ${r}`, `padding: ${a}px`];
415
- n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${F(t.headerBackgroundColor)}`));
416
- let s = o.join("; "), c = N(C(e.content)), l = n ? "th" : "td";
420
+ let a = t.cellPadding, o = [`border: ${k(String(i))}px solid ${r}`, `padding: ${k(String(a))}px`];
421
+ n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${k(t.headerBackgroundColor)}`));
422
+ let s = o.join("; "), c = D(S(e.content)), l = n ? "th" : "td";
417
423
  return `<${l} style="${s}">${c}</${l}>`;
418
424
  }
419
425
  function Ue(e, t) {
420
- return e ? ` font-family="${I(t.resolveFontFamily(e))}"` : "";
426
+ return e ? ` font-family="${A(t.resolveFontFamily(e))}"` : "";
421
427
  }
422
428
  // ../renderer/src/renderers/custom.ts
423
429
  function We(e, t) {
424
- if (O(e)) return "";
430
+ if (j(e)) return "";
425
431
  let n = t.customBlockHtml.get(e.id) ?? e.renderedHtml;
426
432
  if (!n || n === "") return "";
427
- let r = k(e);
433
+ let r = M(e);
428
434
  return `<mj-text padding="${L(e.styles.padding)}"${R(e.styles.backgroundColor, "container")}${r}>
429
435
  ${n}
430
436
  </mj-text>`;
431
437
  }
432
438
  // ../renderer/src/columns.ts
433
- function Ge(e) {
439
+ function X(e) {
434
440
  switch (e) {
435
441
  case "2": return ["50%", "50%"];
436
442
  case "3": return [
@@ -443,7 +449,7 @@ function Ge(e) {
443
449
  default: return ["100%"];
444
450
  }
445
451
  }
446
- function Ke(e, t) {
452
+ function Ge(e, t) {
447
453
  switch (e) {
448
454
  case "2": return [t * .5, t * .5];
449
455
  case "3": return [
@@ -457,7 +463,7 @@ function Ke(e, t) {
457
463
  }
458
464
  }
459
465
  // ../renderer/src/hero-geometry.ts
460
- function qe(e, t, n) {
466
+ function Ke(e, t, n) {
461
467
  let r = Math.max(1, Math.round(t)), i = e.aspectRatio === null ? null : Math.max(1, Math.round(r * e.aspectRatio)), a = Math.max(e.height === "image" ? i ?? r : e.height, Math.trunc(n.top) + Math.trunc(n.bottom));
462
468
  return {
463
469
  mode: "fixed-height",
@@ -467,7 +473,7 @@ function qe(e, t, n) {
467
473
  };
468
474
  }
469
475
  // ../renderer/src/display-condition.ts
470
- function X(e, t) {
476
+ function Z(e, t) {
471
477
  if (t === "") return "";
472
478
  let n = e.displayCondition;
473
479
  return n ? `<mj-raw>${n.before}</mj-raw>
@@ -475,13 +481,13 @@ function X(e, t) {
475
481
  <mj-raw>${n.after}</mj-raw>` : t;
476
482
  }
477
483
  // ../renderer/src/renderers/section.ts
478
- function Je(e, t, n) {
479
- if (O(e)) return "";
480
- let r = ne(e);
481
- if (r?.applied) return Ye(e, r, t, n);
482
- let i = e.columns, a = Ge(i), o = Ke(i, t.containerWidth), s = Math.floor(t.contentWidth) - z(e.styles.padding, e.border), c = a.map((e) => Math.floor(s * parseFloat(e) / 100)), l = L(e.styles.padding), u = R(e.styles.backgroundColor, "native"), d = U(e.backgroundImage), f = k(e), p = H(e.borderRadius), m = V(e.border), h = t.contentDirection === "rtl" ? " direction=\"rtl\"" : "", g = e.children, _ = [];
484
+ function qe(e, t, n) {
485
+ if (j(e)) return "";
486
+ let r = re(e);
487
+ if (r?.applied) return Je(e, r, t, n);
488
+ let i = e.columns, a = X(i), o = Ge(i, t.containerWidth), s = Math.floor(t.contentWidth) - z(e.styles.padding, e.border), c = a.map((e) => Math.floor(s * parseFloat(e) / 100)), l = L(e.styles.padding), u = R(e.styles.backgroundColor, "native"), d = U(e.backgroundImage), f = M(e), p = H(e.borderRadius), m = V(e.border), h = t.contentDirection === "rtl" ? " direction=\"rtl\"" : "", g = e.children, _ = [];
483
489
  for (let e = 0; e < g.length; e++) {
484
- let r = g[e], i = a[e] ?? "100%", l = Math.floor(o[e] ?? t.containerWidth), u = Xe(r, t.allowHtmlBlocks).filter((e) => !T(e)), d = t.withContainerWidth(l, c[e] ?? s), f = u.map((e) => X(e, n(e, d))).filter((e) => e !== "").join("\n");
490
+ let r = g[e], i = a[e] ?? "100%", l = Math.floor(o[e] ?? t.containerWidth), u = Ye(r, t.allowHtmlBlocks).filter((e) => !C(e)), d = t.withContainerWidth(l, c[e] ?? s), f = u.map((e) => Z(e, n(e, d))).filter((e) => e !== "").join("\n");
485
491
  _.push(`<mj-column width="${i}"${h}>
486
492
  ${f === "" ? "<mj-text>&nbsp;</mj-text>" : f}
487
493
  </mj-column>`);
@@ -493,17 +499,17 @@ ${v}
493
499
  </mj-group>` : v}
494
500
  </mj-section>`;
495
501
  }
496
- function Ye(e, t, n, r) {
497
- let i = Math.floor(n.contentWidth), a = qe(t, i, e.styles.padding), o = R(e.styles.backgroundColor, "native") || " background-color=\"transparent\"", s = L(e.styles.padding), c = H(e.borderRadius), l = k(e), u = n.withContainerWidth(i, i - z(e.styles.padding)), d = Xe(e.children[0] ?? [], n.allowHtmlBlocks).filter((e) => !T(e)).map((e) => X(e, r(e, u))).filter((e) => e !== "").join("\n");
498
- return `<mj-hero mode="${a.mode}" height="${a.height}px" background-url="${P(t.image.url)}" background-width="${a.backgroundWidth}px" background-height="${a.backgroundHeight}px" background-position="${t.image.position}"${o} padding="${s}" vertical-align="${t.verticalAlign}"${c}${l}>
502
+ function Je(e, t, n, r) {
503
+ let i = Math.floor(n.contentWidth), a = Ke(t, i, e.styles.padding), o = R(e.styles.backgroundColor, "native") || " background-color=\"transparent\"", s = L(e.styles.padding), c = H(e.borderRadius), l = M(e), u = n.withContainerWidth(i, i - z(e.styles.padding)), d = Ye(e.children[0] ?? [], n.allowHtmlBlocks).filter((e) => !C(e)).map((e) => Z(e, r(e, u))).filter((e) => e !== "").join("\n");
504
+ return `<mj-hero mode="${a.mode}" height="${a.height}px" background-url="${O(t.image.url)}" background-width="${a.backgroundWidth}px" background-height="${a.backgroundHeight}px" background-position="${O(t.image.position)}"${o} padding="${s}" vertical-align="${O(t.verticalAlign)}"${c}${l}>
499
505
  ${d}
500
506
  </mj-hero>`;
501
507
  }
502
- function Xe(e, t) {
508
+ function Ye(e, t) {
503
509
  return t ? e : e.filter((e) => e.type !== "html");
504
510
  }
505
511
  // ../renderer/src/renderers/video.ts
506
- function Ze(e, t) {
512
+ function Xe(e, t) {
507
513
  if (t) return t;
508
514
  if (!e) return null;
509
515
  for (let t of [/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/, /youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/]) {
@@ -513,47 +519,47 @@ function Ze(e, t) {
513
519
  let n = e.match(/vimeo\.com\/(?:video\/)?(\d+)/);
514
520
  return n ? `https://vumbnail.com/${n[1]}.jpg` : null;
515
521
  }
516
- function Qe(e, t) {
517
- if (O(e)) return "";
518
- let n = Ze(e.url, e.thumbnailUrl);
522
+ function Ze(e, t) {
523
+ if (j(e)) return "";
524
+ let n = Xe(e.url, e.thumbnailUrl);
519
525
  if (!n) return "";
520
- let r = L(e.styles.padding), i = R(e.styles.backgroundColor, "container"), a = e.width === "full" ? t.containerWidth + "px" : e.width + "px", o = pe(e.height), s = B(e, t), c = k(e);
526
+ let r = L(e.styles.padding), i = R(e.styles.backgroundColor, "container"), a = O(e.width === "full" ? t.containerWidth + "px" : e.width + "px"), o = pe(e.height), s = B(e, t), c = M(e);
521
527
  return `<mj-image
522
- src="${P(n)}"
523
- alt="${P(e.alt)}"
528
+ src="${O(n)}"
529
+ alt="${O(e.alt)}"
524
530
  width="${a}"${o}${s}
525
- align="${e.align}"
531
+ align="${O(e.align)}"
526
532
  padding="${r}"
527
- href="${P(e.url)}"
533
+ href="${O(e.url)}"
528
534
  target="_blank"
529
535
  rel="noopener"${i}${c}
530
536
  />`;
531
537
  }
532
538
  // ../renderer/src/renderers/index.ts
533
- function Z(e, i) {
539
+ function Q(e, i) {
534
540
  let a = i.blockRenderers[e.type];
535
- return a ? a(e, i) : T(e) ? Je(e, i, Z) : r(e) ? xe(e, i) : m(e) ? we(e, i) : re(e) ? Te(e, i) : S(e) ? Ee(e, i) : v(e) ? je(e, i) : ie(e) ? Me(e, i) : d(e) ? Ne(e, i) : t(e) ? Pe(e, i) : ce(e) ? Fe(e, i) : c(e) ? ze(e, i) : n(e) ? Qe(e, i) : b(e) ? We(e, i) : O(e) ? "" : A(e);
541
+ return a ? a(e, i) : C(e) ? qe(e, i, Q) : r(e) ? xe(e, i) : m(e) ? we(e, i) : ae(e) ? Te(e, i) : ne(e) ? Ee(e, i) : v(e) ? je(e, i) : oe(e) ? Me(e, i) : d(e) ? Ne(e, i) : t(e) ? Pe(e, i) : ue(e) ? Fe(e, i) : c(e) ? ze(e, i) : n(e) ? Ze(e, i) : b(e) ? We(e, i) : j(e) ? "" : I(e);
536
542
  }
537
543
  // ../renderer/src/index.ts
538
- var $e = `.${Y} a { display: block !important; }`;
539
- async function et(t, n) {
544
+ var Qe = `.${Y} a { display: block !important; }`;
545
+ async function $e(t, n) {
540
546
  if (n?.customBlocks !== void 0 && n.renderCustomBlock !== void 0) throw TypeError("[Templatical] customBlocks cannot be combined with renderCustomBlock");
541
547
  if (n?.customBlocks !== void 0 && n.getCustomBlockStylesheet !== void 0) throw TypeError("[Templatical] customBlocks cannot be combined with getCustomBlockStylesheet");
542
- let r = n?.locale ?? s(t), a = l(t, r), o = n?.layout ? i(l(n.layout, r, { missing: "default" }), a) : (ee(a), e(a), a), c = n?.customFonts ?? [], u = n?.defaultFallbackFont ?? "Arial, sans-serif", d = n?.allowHtmlBlocks ?? !0, f = it(n?.socialIconsBaseUrl ?? E), p = n?.customBlocks === void 0 ? await ct(o, n?.renderCustomBlock) : await lt(o, n.customBlocks), m = ut(o, n?.getCustomBlockStylesheet, n?.customBlocks === void 0 ? void 0 : new Map(n.customBlocks.map((e) => [e.type, e]))), g = h(o.settings), _ = new D(o.settings.width, c, u, d, p, f, n?.blockRenderers ?? {}, g), v = st(o.blocks, d), y = _.resolveFontFamily(o.settings.fontFamily), b = o.settings.backgroundColor, te = o.settings.textColor ? ` color="${P(o.settings.textColor)}"` : "", x = o.settings.linkColor ? F(o.settings.linkColor) : "inherit", S = o.settings.linkUnderline ? "underline" : "none", C = v.map((e) => Q(e, _)).filter((e) => e !== "").join("\n"), ne = ot(c), w = at(o.settings.preheaderText);
543
- return `<mjml lang="${P(o.settings.locale)}" dir="${P(g)}">
544
- <mj-head>${w}
548
+ let r = n?.locale ?? s(t), a = l(t, r), o = n?.layout ? i(l(n.layout, r, { missing: "default" }), a) : (ee(a), e(a), a), c = n?.customFonts ?? [], u = n?.defaultFallbackFont ?? "Arial, sans-serif", d = n?.allowHtmlBlocks ?? !0, f = it(n?.socialIconsBaseUrl ?? w), p = n?.customBlocks === void 0 ? await ct(o, n?.renderCustomBlock) : await lt(o, n.customBlocks), m = ut(o, n?.getCustomBlockStylesheet, n?.customBlocks === void 0 ? void 0 : new Map(n.customBlocks.map((e) => [e.type, e]))), g = h(o.settings), _ = new de(o.settings.width, c, u, d, p, f, n?.blockRenderers ?? {}, g), v = st(o.blocks, d), y = _.resolveFontFamily(o.settings.fontFamily), b = /[<>]/.test(o.settings.backgroundColor) ? "transparent" : o.settings.backgroundColor, te = o.settings.textColor ? ` color="${O(o.settings.textColor)}"` : "", x = o.settings.linkColor ? k(o.settings.linkColor) : "inherit", ne = o.settings.linkUnderline ? "underline" : "none", S = v.map((e) => et(e, _)).filter((e) => e !== "").join("\n"), re = ot(c), ie = at(o.settings.preheaderText);
549
+ return `<mjml lang="${O(o.settings.locale)}" dir="${O(g)}">
550
+ <mj-head>${ie}
545
551
  <mj-attributes>
546
- <mj-all font-family="${I(y)}" />
552
+ <mj-all font-family="${A(y)}" />
547
553
  <mj-text font-size="14px"${te} />
548
554
  <mj-section padding="0" />
549
555
  <mj-column padding="0" />
550
- </mj-attributes>${ne}
556
+ </mj-attributes>${re}
551
557
  <mj-style inline="inline">
552
558
  ${me(he(v), g)}
553
- ${$e}
559
+ ${Qe}
554
560
  </mj-style>
555
561
  <mj-style>
556
- a { color: ${x}; text-decoration: ${S}; }
562
+ a { color: ${x}; text-decoration: ${ne}; }
557
563
  @media only screen and (max-width: 480px) {
558
564
  .tpl-hide-mobile { display: none !important; mso-hide: all !important; }
559
565
  }
@@ -562,26 +568,26 @@ async function et(t, n) {
562
568
  }
563
569
  </mj-style>${dt(m)}
564
570
  </mj-head>
565
- <mj-body width="${_.containerWidth}px" background-color="${b}">
566
- ${C}
571
+ <mj-body width="${O(String(_.containerWidth))}px" background-color="${k(b)}">
572
+ ${S}
567
573
  </mj-body>
568
574
  </mjml>`;
569
575
  }
570
- function Q(e, t) {
576
+ function et(e, t) {
571
577
  if (a(e)) {
572
578
  let n = tt(t, e.styles.padding);
573
- return X(e, nt(st(e.children, t.allowHtmlBlocks).map((e) => Q(e, n)).filter((e) => e !== "").join("\n"), {
579
+ return Z(e, nt(st(e.children, t.allowHtmlBlocks).map((e) => et(e, n)).filter((e) => e !== "").join("\n"), {
574
580
  backgroundColor: e.styles.backgroundColor,
575
581
  padding: e.styles.padding,
576
582
  borderRadius: e.borderRadius,
577
583
  backgroundImage: e.backgroundImage
578
584
  }, t.contentDirection));
579
585
  }
580
- if (T(e)) {
581
- let n = Z(e, e.wrapper ? tt(t, e.wrapper.padding) : t);
582
- return X(e, e.wrapper && n !== "" ? nt(n, e.wrapper, t.contentDirection) : n);
586
+ if (C(e)) {
587
+ let n = Q(e, e.wrapper ? tt(t, e.wrapper.padding) : t);
588
+ return Z(e, e.wrapper && n !== "" ? nt(n, e.wrapper, t.contentDirection) : n);
583
589
  }
584
- return X(e, rt(Z(e, t), t.contentDirection));
590
+ return Z(e, rt(Q(e, t), t.contentDirection));
585
591
  }
586
592
  function tt(e, t) {
587
593
  return e.withContainerWidth(e.containerWidth, Math.floor(e.contentWidth) - z(t));
@@ -606,10 +612,10 @@ function it(e) {
606
612
  function at(e) {
607
613
  if (!e) return "";
608
614
  let t = e.trim();
609
- return t === "" ? "" : `\n <mj-preview>${N(t)}</mj-preview>`;
615
+ return t === "" ? "" : `\n <mj-preview>${D(t)}</mj-preview>`;
610
616
  }
611
617
  function ot(e) {
612
- return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${P(e.name)}" href="${P(e.url)}" />`).join("");
618
+ return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${O(e.name)}" href="${O(e.url)}" />`).join("");
613
619
  }
614
620
  function st(e, t) {
615
621
  return t ? e : e.filter((e) => e.type !== "html");
@@ -644,7 +650,7 @@ async function lt(e, t) {
644
650
  }
645
651
  function $(e, t) {
646
652
  for (let n of e) if (b(n)) t.push(n);
647
- else if (T(n)) for (let e of n.children) $(e, t);
653
+ else if (C(n)) for (let e of n.children) $(e, t);
648
654
  else a(n) && $(n.children, t);
649
655
  }
650
656
  function ut(e, t, n) {
@@ -666,6 +672,6 @@ function ut(e, t, n) {
666
672
  function dt(e) {
667
673
  return e.length === 0 ? "" : e.map((e) => `\n <mj-style>\n${e}\n </mj-style>`).join("");
668
674
  }
669
- export { Y as BUTTON_FULL_WIDTH_CSS_CLASS, E as DEFAULT_SOCIAL_ICONS_BASE_URL, W as RICH_TEXT_CSS_CLASS, D as RenderContext, ue as UNRENDERABLE_MARKER_PREFIX, C as convertMergeTagsToValues, P as escapeAttr, N as escapeHtml, B as fluidOnMobileAttr, k as getCssClassAttr, le as getCssClasses, Ge as getWidthPercentages, Ke as getWidthPixels, O as isHiddenOnAll, Z as renderBlock, et as renderToMjml, A as renderUnrenderableBlock, K as resolveParagraphGap, G as richTextGapClass, L as toPaddingString };
675
+ export { Y as BUTTON_FULL_WIDTH_CSS_CLASS, w as DEFAULT_SOCIAL_ICONS_BASE_URL, W as RICH_TEXT_CSS_CLASS, de as RenderContext, P as UNRENDERABLE_MARKER_PREFIX, S as convertMergeTagsToValues, O as escapeAttr, D as escapeHtml, B as fluidOnMobileAttr, M as getCssClassAttr, N as getCssClasses, X as getWidthPercentages, Ge as getWidthPixels, j as isHiddenOnAll, Q as renderBlock, $e as renderToMjml, I as renderUnrenderableBlock, K as resolveParagraphGap, G as richTextGapClass, L as toPaddingString };
670
676
 
671
- //# sourceMappingURL=src-BWX_xVxO.js.map
677
+ //# sourceMappingURL=src-B2tQbzf6.js.map