@aswin.dev/editor 0.7.1 → 0.7.3

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 (116) hide show
  1. package/LICENSE +56 -0
  2. package/dist/{AiChatSidebar-DWGPVtvC.js → AiChatSidebar-Dt5pvG5t.js} +37 -51
  3. package/dist/{AiFeatureMenu-duUFSfDf.js → AiFeatureMenu-BipxcGap.js} +1 -1
  4. package/dist/{CloudEditor-CFldoCOb.js → CloudEditor-CnUX0IOW.js} +283 -239
  5. package/dist/{CollaboratorBar-Bw-lbt61.js → CollaboratorBar-NaaZTjbs.js} +2 -2
  6. package/dist/{CommentsSidebar-BaD5F53-.js → CommentsSidebar-DE6ZsM4D.js} +9 -10
  7. package/dist/CountdownBlock-Ba3T-i2X.js +1536 -0
  8. package/dist/{CountdownToolbar-Dg4F8MTk.js → CountdownToolbar-CbhSp_uq.js} +1 -1
  9. package/dist/{DesignReferenceSidebar-BSH7uNP_.js → DesignReferenceSidebar-CZg97bbj.js} +1 -1
  10. package/dist/{ModuleBrowserModal-6phxZSKI.js → ModuleBrowserModal-D2EVdexc.js} +4 -4
  11. package/dist/{ModulePreviewCanvas-BW8L3eQX.js → ModulePreviewCanvas-P3N-nxkU.js} +52 -47
  12. package/dist/{NumberWithSuffix-BpUzQOJt.js → NumberWithSuffix-CihczoAd.js} +1 -1
  13. package/dist/{ParagraphEditor-DNSzAB-I.js → ParagraphEditor-BbRuKhWv.js} +7 -7
  14. package/dist/{SaveModuleDialog-zMQTpez7.js → SaveModuleDialog-DLZa3m3O.js} +2 -2
  15. package/dist/{SnapshotHistory-Do-A5rYU.js → SnapshotHistory-Csg1_jXi.js} +3 -3
  16. package/dist/{TestEmailModal-DGj_9V1u.js → TestEmailModal-m3okLbJz.js} +2 -2
  17. package/dist/{TitleEditor-C7IDnAoS.js → TitleEditor-CtJIS5ER.js} +2 -2
  18. package/dist/{TplModal-BAsVzcTb.js → TplModal-CQCrKeKP.js} +1 -1
  19. package/dist/{blockTypeIcons-C6LDKvmd.js → blockTypeIcons-Dah0pgt-.js} +50 -19
  20. package/dist/bundle-stats.json +8 -8
  21. package/dist/cdn/chunks/AccessibilityPanel-Bt_fD7QT.js +97 -0
  22. package/dist/cdn/chunks/AccessibilityPanel-Bt_fD7QT.js.map +1 -0
  23. package/dist/cdn/chunks/AiFeatureMenu-Bn-0rgfr.js +59 -0
  24. package/dist/cdn/chunks/AiFeatureMenu-Bn-0rgfr.js.map +1 -0
  25. package/dist/cdn/chunks/BlockA11yBadge-Cj18Iw0p.js +33 -0
  26. package/dist/cdn/chunks/BlockA11yBadge-Cj18Iw0p.js.map +1 -0
  27. package/dist/cdn/chunks/CloudEditor-56lVcdot.js +1220 -0
  28. package/dist/cdn/chunks/CloudEditor-56lVcdot.js.map +1 -0
  29. package/dist/cdn/chunks/CollaboratorBar-B7DCV3xp.js +51 -0
  30. package/dist/cdn/chunks/CollaboratorBar-B7DCV3xp.js.map +1 -0
  31. package/dist/cdn/chunks/CountdownToolbar-BtaD3d3-.js +212 -0
  32. package/dist/cdn/chunks/CountdownToolbar-BtaD3d3-.js.map +1 -0
  33. package/dist/cdn/chunks/ModuleBrowserModal-CiIY7ZGv.js +195 -0
  34. package/dist/cdn/chunks/ModuleBrowserModal-CiIY7ZGv.js.map +1 -0
  35. package/dist/cdn/chunks/ModulePreviewCanvas-M7_OGV2m.js +113 -0
  36. package/dist/cdn/chunks/ModulePreviewCanvas-M7_OGV2m.js.map +1 -0
  37. package/dist/cdn/chunks/NumberWithSuffix-DfVBnsgc.js +423 -0
  38. package/dist/cdn/chunks/NumberWithSuffix-DfVBnsgc.js.map +1 -0
  39. package/dist/cdn/chunks/ParagraphEditor-1XJOpiLX.js +544 -0
  40. package/dist/cdn/chunks/ParagraphEditor-1XJOpiLX.js.map +1 -0
  41. package/dist/cdn/chunks/RichTextEditorContent-C2q8sbp2.js +106 -0
  42. package/dist/cdn/chunks/RichTextEditorContent-C2q8sbp2.js.map +1 -0
  43. package/dist/cdn/chunks/SaveModuleDialog-BNxh1jPT.js +119 -0
  44. package/dist/cdn/chunks/SaveModuleDialog-BNxh1jPT.js.map +1 -0
  45. package/dist/cdn/chunks/TitleEditor-IF7VzLTk.js +171 -0
  46. package/dist/cdn/chunks/TitleEditor-IF7VzLTk.js.map +1 -0
  47. package/dist/cdn/chunks/blockTypeIcons-tPBKQ8WC.js +24 -0
  48. package/dist/cdn/chunks/blockTypeIcons-tPBKQ8WC.js.map +1 -0
  49. package/dist/cdn/chunks/de-B05yW8Gi.js +840 -0
  50. package/dist/cdn/chunks/de-B05yW8Gi.js.map +1 -0
  51. package/dist/cdn/chunks/de-BPHtelu7.js +209 -0
  52. package/dist/cdn/chunks/de-BPHtelu7.js.map +1 -0
  53. package/dist/cdn/chunks/de-BRDqJwJe.js +89 -0
  54. package/dist/cdn/chunks/de-BRDqJwJe.js.map +1 -0
  55. package/dist/cdn/chunks/draggable-C-1_gch3.js +11572 -0
  56. package/dist/cdn/chunks/draggable-C-1_gch3.js.map +1 -0
  57. package/dist/cdn/chunks/emojiData-DUHzsh4j.js +19 -0
  58. package/dist/cdn/chunks/emojiData-DUHzsh4j.js.map +1 -0
  59. package/dist/cdn/chunks/en-BII7695P.js +840 -0
  60. package/dist/cdn/chunks/en-BII7695P.js.map +1 -0
  61. package/dist/cdn/chunks/en-Cdj_Ikl1.js +89 -0
  62. package/dist/cdn/chunks/en-Cdj_Ikl1.js.map +1 -0
  63. package/dist/cdn/chunks/en-DejwuJhw.js +209 -0
  64. package/dist/cdn/chunks/en-DejwuJhw.js.map +1 -0
  65. package/dist/cdn/chunks/extensions-B0eT-yjf.js +598 -0
  66. package/dist/cdn/chunks/extensions-B0eT-yjf.js.map +1 -0
  67. package/dist/cdn/chunks/features-BrvE2Fzv.js +9677 -0
  68. package/dist/cdn/chunks/features-BrvE2Fzv.js.map +1 -0
  69. package/dist/cdn/chunks/icons-C7wtAD8p.js +1043 -0
  70. package/dist/cdn/chunks/icons-C7wtAD8p.js.map +1 -0
  71. package/dist/cdn/chunks/liquid.browser-CllF-us3.js +3279 -0
  72. package/dist/cdn/chunks/liquid.browser-CllF-us3.js.map +1 -0
  73. package/dist/cdn/chunks/media-library-Cl5XuaKy.js +6030 -0
  74. package/dist/cdn/chunks/media-library-Cl5XuaKy.js.map +1 -0
  75. package/dist/cdn/chunks/pusher-i7-OBujc.js +2508 -0
  76. package/dist/cdn/chunks/pusher-i7-OBujc.js.map +1 -0
  77. package/dist/cdn/chunks/quality-Va91a3N8.js +1456 -0
  78. package/dist/cdn/chunks/quality-Va91a3N8.js.map +1 -0
  79. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +32 -0
  80. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +1 -0
  81. package/dist/cdn/chunks/renderer-si0Zgxeb.js +642 -0
  82. package/dist/cdn/chunks/renderer-si0Zgxeb.js.map +1 -0
  83. package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +20 -0
  84. package/dist/cdn/chunks/src-BLyYIbdZ.js +497 -0
  85. package/dist/cdn/chunks/src-BLyYIbdZ.js.map +1 -0
  86. package/dist/cdn/chunks/styleConstants-DfcU8u_r.js +57 -0
  87. package/dist/cdn/chunks/styleConstants-DfcU8u_r.js.map +1 -0
  88. package/dist/cdn/chunks/styles-C6BQLT9F.js +5807 -0
  89. package/dist/cdn/chunks/styles-C6BQLT9F.js.map +1 -0
  90. package/dist/cdn/chunks/tiptap-D8whBv5F.js +14654 -0
  91. package/dist/cdn/chunks/tiptap-D8whBv5F.js.map +1 -0
  92. package/dist/cdn/editor.css +2 -0
  93. package/dist/cdn/editor.js +367 -0
  94. package/dist/cdn/editor.js.map +1 -0
  95. package/dist/{cloud-6ZmAvF0j.js → cloud-BoS0J0vs.js} +1 -1
  96. package/dist/{de-DWcgp-7T.js → de-C74F9xK3.js} +112 -3
  97. package/dist/dist-C2grMquk.js +1261 -0
  98. package/dist/{dist-CivF9P8b.js → dist-Djgi0A6k.js} +92 -77
  99. package/dist/{en-Cxd4fhNm.js → en-B24jVTeO.js} +112 -3
  100. package/dist/{extensions-D__hOlV1.js → extensions-DsmjHqBF.js} +14 -14
  101. package/dist/index.d.ts +21 -10
  102. package/dist/{pencil-BZJPNYWR.js → pencil-Bpimrzzw.js} +5 -2
  103. package/dist/style.css +1 -1
  104. package/dist/styles-BMFMtR9R.js +6341 -0
  105. package/dist/templatical-editor.js +197 -139
  106. package/dist/undo-2-m1EUDbUg.js +16 -0
  107. package/dist/{useEditorCore-wslttMH-.js → useEditorCore-CtNAo0uy.js} +2154 -2025
  108. package/dist/useMergeTag-2vTcVpNo.js +34 -0
  109. package/package.json +12 -12
  110. package/dist/CountdownBlock-DaYGxKqo.js +0 -92
  111. package/dist/check-DJrpDKO_.js +0 -7
  112. package/dist/dist-C04s_fLA.js +0 -563
  113. package/dist/styles-B4tjX5SP.js +0 -5224
  114. package/dist/useMergeTag-DX0XG5V9.js +0 -34
  115. /package/dist/{clock-ik2pRJKG.js → clock-Ba4p3rJM.js} +0 -0
  116. /package/dist/{readableTextColor-DVuzNX1y.js → readableTextColor-C_9OpzBw.js} +0 -0
@@ -0,0 +1,642 @@
1
+ import { r as e } from "./rolldown-runtime-BNuo_Jkg.js";
2
+ import { $n as t, Gn as n, Jn as r, Kn as i, Qn as a, Xn as o, Yn as s, Zn as c, ar as l, er as u, ir as d, nr as f, qn as p, rr as m, tr as h } from "./features-BrvE2Fzv.js";
3
+ //#region ../renderer/src/render-context.ts
4
+ var g = {
5
+ arial: "Arial, sans-serif",
6
+ helvetica: "Helvetica, sans-serif",
7
+ georgia: "Georgia, serif",
8
+ "times new roman": "'Times New Roman', serif",
9
+ verdana: "Verdana, sans-serif",
10
+ "trebuchet ms": "'Trebuchet MS', sans-serif",
11
+ "courier new": "'Courier New', monospace",
12
+ tahoma: "Tahoma, sans-serif"
13
+ }, _ = class e {
14
+ constructor(e, t, n, r, i = /* @__PURE__ */ new Map()) {
15
+ this.containerWidth = e, this.customFonts = t, this.defaultFallbackFont = n, this.allowHtmlBlocks = r, this.customBlockHtml = i;
16
+ }
17
+ withContainerWidth(t) {
18
+ return new e(t, this.customFonts, this.defaultFallbackFont, this.allowHtmlBlocks, this.customBlockHtml);
19
+ }
20
+ resolveFontFamily(e) {
21
+ for (let t of this.customFonts) if (t.name.toLowerCase() === e.toLowerCase()) {
22
+ let e = t.fallback ?? this.defaultFallbackFont;
23
+ return `'${t.name}', ${e}`;
24
+ }
25
+ return g[e.toLowerCase()] || e;
26
+ }
27
+ }, v = {
28
+ "&": "&",
29
+ "<": "&lt;",
30
+ ">": "&gt;",
31
+ "\"": "&quot;",
32
+ "'": "&#039;"
33
+ }, y = /[&<>"']/g;
34
+ function b(e) {
35
+ return e === "" ? "" : e.replace(y, (e) => v[e] ?? e);
36
+ }
37
+ function x(e) {
38
+ return e === "" ? "" : e.replace(y, (e) => v[e] ?? e);
39
+ }
40
+ function S(e) {
41
+ return e === "" ? "" : x(e).replace(/[;{}\r\n]/g, "");
42
+ }
43
+ function C(e) {
44
+ if (e === "") return "";
45
+ let t = e.replace(/<span[^>]*\bdata-merge-tag="([^"]*)"[^>]*>.*?<\/span>/gs, "$1");
46
+ return t = t.replace(/<span[^>]*\bdata-logic-merge-tag="([^"]*)"[^>]*>.*?<\/span>/gs, "$1"), t;
47
+ }
48
+ //#endregion
49
+ //#region ../renderer/src/padding.ts
50
+ function w(e) {
51
+ return `${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;
52
+ }
53
+ function T(e) {
54
+ return w(e);
55
+ }
56
+ //#endregion
57
+ //#region ../renderer/src/utils.ts
58
+ function E(e, t) {
59
+ return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${e}"` : "";
60
+ }
61
+ //#endregion
62
+ //#region ../renderer/src/visibility.ts
63
+ function D(e) {
64
+ let t = e.visibility;
65
+ return t ? !t.desktop && !t.tablet && !t.mobile : !1;
66
+ }
67
+ function O(e) {
68
+ let t = k(e);
69
+ return t === "" ? "" : ` css-class="${t}"`;
70
+ }
71
+ function k(e) {
72
+ let t = e.visibility;
73
+ if (!t) return "";
74
+ let n = [];
75
+ return t.desktop || n.push("tpl-hide-desktop"), t.tablet || n.push("tpl-hide-tablet"), t.mobile || n.push("tpl-hide-mobile"), n.join(" ");
76
+ }
77
+ //#endregion
78
+ //#region ../renderer/src/renderers/title.ts
79
+ function ee(e, t) {
80
+ if (D(e)) return "";
81
+ let n = w(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = A(C(e.content)), a = l[e.level] ?? l[2], o = x(e.color), s = e.textAlign, c = j(e.fontFamily, t), u = O(e), d = `h${l[e.level] ? e.level : 2}`;
82
+ return `<mj-text
83
+ font-size="${a}px"
84
+ color="${o}"
85
+ align="${s}"
86
+ line-height="1.3"
87
+ padding="${n}"${r}${c}${u}
88
+ ><${d} style="margin:0;font-size:inherit;color:inherit;line-height:inherit">${i}</${d}></mj-text>`;
89
+ }
90
+ function A(e) {
91
+ let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
92
+ return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
93
+ }
94
+ function j(e, t) {
95
+ return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
96
+ }
97
+ //#endregion
98
+ //#region ../renderer/src/renderers/paragraph.ts
99
+ function te(e, t) {
100
+ if (D(e) || e.content.replace(/<\/?p[^>]*>/gi, "").trim() === "") return "";
101
+ let n = w(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = C(e.content);
102
+ return `<mj-text
103
+ line-height="1.5"
104
+ padding="${n}"${r}${O(e)}
105
+ >${i}</mj-text>`;
106
+ }
107
+ //#endregion
108
+ //#region ../renderer/src/renderers/image.ts
109
+ function ne(e, t) {
110
+ if (D(e) || e.src === "") return "";
111
+ let n = w(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = e.width === "full" ? t.containerWidth + "px" : e.width + "px", a = O(e), o = "";
112
+ return e.linkUrl && (o = ` href="${x(e.linkUrl)}"`, e.linkOpenInNewTab && (o += " target=\"_blank\" rel=\"noopener\"")), `<mj-image
113
+ src="${x(e.src)}"
114
+ alt="${e.decorative === !0 ? "" : x(e.alt)}"
115
+ width="${i}"
116
+ align="${e.align}"
117
+ padding="${n}"${r}${o}${a}
118
+ />`;
119
+ }
120
+ //#endregion
121
+ //#region ../renderer/src/renderers/input.ts
122
+ function M(e, t) {
123
+ return e ? `font-family:${S(t.resolveFontFamily(e))};` : "";
124
+ }
125
+ function re(e, t, n) {
126
+ if (e <= 0) return "border:none;";
127
+ let r = `${e}px`, i = S(t);
128
+ return n === "all" ? `border:${r} solid ${i};` : `border-style:solid;border-color:${i};border-top-width:${n === "top" ? r : "0"};border-right-width:${n === "right" ? r : "0"};border-bottom-width:${n === "bottom" ? r : "0"};border-left-width:${n === "left" ? r : "0"};`;
129
+ }
130
+ function ie(e) {
131
+ return b(C(e));
132
+ }
133
+ function ae(e, t) {
134
+ if (D(e)) return "";
135
+ let n = w(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = O(e), a = x(`tpl-in-${e.id}`), o = x(e.id), s = ie(e.label), c = C(e.placeholder), l = C(e.defaultValue ?? ""), u = T(e.labelMargin), d = w(e.labelPadding), f = [
136
+ "display:block;",
137
+ `margin:${u};`,
138
+ `padding:${d};`,
139
+ `font-size:${e.labelFontSize}px;`,
140
+ `font-weight:${e.labelFontWeight};`,
141
+ `color:${S(e.labelColor)};`,
142
+ `text-align:${e.labelTextAlign};`,
143
+ M(e.labelFontFamily, t)
144
+ ].filter(Boolean).join(""), p = T(e.inputMargin), m = w(e.inputPadding), h = e.inputWidth === "full" ? "100%" : `${e.inputWidth}px`, g = re(e.inputBorderWidth ?? 0, e.inputBorderColor ?? "#d1d5db", e.inputBorderSides ?? "all"), _ = [
145
+ "box-sizing:border-box;",
146
+ `width:${h};`,
147
+ `margin:${p};`,
148
+ `padding:${m};`,
149
+ `background-color:${S(e.inputBackgroundColor)};`,
150
+ `color:${S(e.inputTextColor)};`,
151
+ `font-size:${e.inputFontSize}px;`,
152
+ `border-radius:${e.inputBorderRadius}px;`,
153
+ g,
154
+ M(e.inputFontFamily, t),
155
+ "outline:none;"
156
+ ].join(""), v = x(e.inputType), y = e.required ? " required" : "", b = e.name.trim() === "" ? "" : ` name="${x(e.name.trim())}"`;
157
+ return `<mj-text
158
+ line-height="1.5"
159
+ padding="${n}"${r}${i}
160
+ >${`${`<style type="text/css">[data-tpl-input="${o}"]::placeholder{color:${S(e.inputPlaceholderColor)}!important;opacity:1;}</style>`}<label for="${a}" style="${f}">${s}</label><input id="${a}"${b} type="${v}" data-tpl-input="${o}" placeholder="${x(c)}" value="${x(l)}" style="${_}"${y} />`}</mj-text>`;
161
+ }
162
+ //#endregion
163
+ //#region ../renderer/src/renderers/button.ts
164
+ function oe(e, t) {
165
+ if (D(e)) return "";
166
+ let n = w(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = w(e.buttonPadding), a = P(e), o = a === "" ? "" : ` href="${a}"`, s = x(e.backgroundColor), c = x(e.textColor), l = e.fontSize, u = e.borderRadius, d = b(e.text), f = e.clickAction ?? "none";
167
+ return `<mj-button${o}${e.openInNewTab && f !== "next_step" && f !== "previous_step" ? " target=\"_blank\" rel=\"noopener\"" : ""}
168
+ background-color="${s}"
169
+ color="${c}"
170
+ font-size="${l}px"
171
+ font-weight="bold"
172
+ border-radius="${u}px"
173
+ inner-padding="${i}"
174
+ padding="${n}"${r}${F(e.fontFamily, t)}${se(e)}${N(e)}
175
+ >${d}</mj-button>`;
176
+ }
177
+ function se(e) {
178
+ let t = [], n = k(e);
179
+ n && t.push(...n.split(/\s+/).filter(Boolean));
180
+ let r = e.clickAction ?? "none";
181
+ return r === "next_step" ? t.push("tpl-btn-next-step") : r === "previous_step" && t.push("tpl-btn-prev-step"), t.length === 0 ? "" : ` css-class="${x(t.join(" "))}"`;
182
+ }
183
+ function N(e) {
184
+ let t = e.borderWidth ?? 0;
185
+ if (t <= 0) return "";
186
+ let n = x(`${t}px solid ${e.borderColor ?? "#000000"}`), r = x("none"), i = e.borderSides ?? "all";
187
+ return i === "all" ? ` border="${n}"` : ` border-top="${i === "top" ? n : r}" border-right="${i === "right" ? n : r}" border-bottom="${i === "bottom" ? n : r}" border-left="${i === "left" ? n : r}"`;
188
+ }
189
+ function P(e) {
190
+ let t = e.clickAction ?? "none";
191
+ if (t === "scroll_anchor") {
192
+ let t = e.clickActionAnchorId?.trim().replace(/^#/, "") ?? "";
193
+ return t === "" ? e.url === "" ? "" : x(e.url) : x(`#${t}`);
194
+ }
195
+ return t === "none" || t === "load_page" ? e.url === "" ? "" : x(e.url) : t === "next_step" || t === "previous_step" || t === "close_popup" ? x(e.url === "" ? "#" : e.url) : "";
196
+ }
197
+ function F(e, t) {
198
+ return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
199
+ }
200
+ //#endregion
201
+ //#region ../renderer/src/renderers/divider.ts
202
+ function I(e, t) {
203
+ if (D(e)) return "";
204
+ let n = w(e.styles.padding), r = e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : "", i = e.width === "full" ? "100%" : e.width + "px";
205
+ return `<mj-divider
206
+ border-width="${e.thickness}px"
207
+ border-style="${e.lineStyle}"
208
+ border-color="${x(e.color)}"
209
+ width="${i}"
210
+ padding="${n}"${r}${O(e)}
211
+ />`;
212
+ }
213
+ //#endregion
214
+ //#region ../renderer/src/renderers/spacer.ts
215
+ function L(e, t) {
216
+ return D(e) ? "" : `<mj-spacer height="${e.height}px" padding="0"${e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : ""}${O(e)} />`;
217
+ }
218
+ //#endregion
219
+ //#region ../renderer/src/renderers/html.ts
220
+ function R(e, t) {
221
+ if (D(e) || !t.allowHtmlBlocks) return "";
222
+ let n = e.content;
223
+ return n === "" ? "" : `<mj-text${O(e)}>
224
+ ${n}
225
+ </mj-text>`;
226
+ }
227
+ //#endregion
228
+ //#region ../renderer/src/social-icons.ts
229
+ var z = {
230
+ facebook: {
231
+ path: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z",
232
+ color: "#1877F2"
233
+ },
234
+ twitter: {
235
+ path: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z",
236
+ color: "#000000"
237
+ },
238
+ instagram: {
239
+ path: "M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z",
240
+ color: "#E4405F"
241
+ },
242
+ linkedin: {
243
+ path: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z",
244
+ color: "#0A66C2"
245
+ },
246
+ youtube: {
247
+ path: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z",
248
+ color: "#FF0000"
249
+ },
250
+ tiktok: {
251
+ path: "M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z",
252
+ color: "#000000"
253
+ },
254
+ pinterest: {
255
+ path: "M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.782c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738.098.119.112.224.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146C9.57 23.812 10.763 24 12 24c6.627 0 12-5.373 12-12 0-6.628-5.373-12-12-12z",
256
+ color: "#BD081C"
257
+ },
258
+ email: {
259
+ path: "M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z",
260
+ color: "#6B7280"
261
+ },
262
+ whatsapp: {
263
+ path: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z",
264
+ color: "#25D366"
265
+ },
266
+ telegram: {
267
+ path: "M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z",
268
+ color: "#26A5E4"
269
+ },
270
+ discord: {
271
+ path: "M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z",
272
+ color: "#5865F2"
273
+ },
274
+ snapchat: {
275
+ path: "M12.017 0C5.396 0 .029 5.367.029 11.987c0 5.079 3.158 9.417 7.618 11.162-.105-.949-.199-2.403.041-3.439.219-.937 1.406-5.957 1.406-5.957s-.359-.72-.359-1.781c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738a.36.36 0 01.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146 1.124.347 2.317.535 3.554.535 6.627 0 12.017-5.373 12.017-12.001C24.034 5.367 18.644 0 12.017 0z",
276
+ color: "#FFFC00"
277
+ },
278
+ reddit: {
279
+ path: "M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z",
280
+ color: "#FF4500"
281
+ },
282
+ github: {
283
+ path: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12",
284
+ color: "#181717"
285
+ },
286
+ dribbble: {
287
+ path: "M12 24C5.385 24 0 18.615 0 12S5.385 0 12 0s12 5.385 12 12-5.385 12-12 12zm10.12-10.358c-.35-.11-3.17-.953-6.384-.438 1.34 3.684 1.887 6.684 1.992 7.308 2.3-1.555 3.936-4.02 4.392-6.87zm-6.115 7.808c-.153-.9-.75-4.032-2.19-7.77l-.066.02c-5.79 2.015-7.86 6.025-8.04 6.4 1.73 1.358 3.92 2.166 6.29 2.166 1.42 0 2.77-.29 4-.814zm-11.62-2.58c.232-.4 3.045-5.055 8.332-6.765.135-.045.27-.084.405-.12-.26-.585-.54-1.167-.832-1.74C7.17 11.775 2.206 11.71 1.756 11.7l-.004.312c0 2.633.998 5.037 2.634 6.855zm-2.42-8.955c.46.008 4.683.026 9.477-1.248-1.698-3.018-3.53-5.558-3.8-5.928-2.868 1.35-5.01 3.99-5.676 7.17zM9.6 2.052c.282.38 2.145 2.914 3.822 6 3.645-1.365 5.19-3.44 5.373-3.702-1.81-1.61-4.19-2.586-6.795-2.586-.825 0-1.63.1-2.4.285zm10.335 3.483c-.218.29-1.935 2.493-5.724 4.04.24.49.47.985.68 1.486.08.18.15.36.22.53 3.41-.43 6.8.26 7.14.33-.02-2.42-.88-4.64-2.31-6.38z",
288
+ color: "#EA4C89"
289
+ },
290
+ behance: {
291
+ path: "M22 7h-7V5h7v2zm1.726 10c-.442 1.297-2.029 3-5.101 3-3.074 0-5.564-1.729-5.564-5.675 0-3.91 2.325-5.92 5.466-5.92 3.082 0 4.964 1.782 5.375 4.426.078.506.109 1.188.095 2.14H15.97c.13 3.211 3.483 3.312 4.588 2.029h3.168zm-7.686-4h4.965c-.105-1.547-1.136-2.219-2.477-2.219-1.466 0-2.277.768-2.488 2.219zm-9.574 6.988H0V5.021h6.953c5.476.081 5.58 5.444 2.72 6.906 3.461 1.26 3.577 8.061-3.207 8.061zM3 11h3.584c2.508 0 2.906-3-.312-3H3v3zm3.391 3H3v3.016h3.341c3.055 0 2.868-3.016.05-3.016z",
292
+ color: "#1769FF"
293
+ }
294
+ };
295
+ function B(e, t, n) {
296
+ let r = z[e], i = r?.path ?? "", a = r?.color ?? "#6B7280";
297
+ if (i === "") return "";
298
+ let o = t === "outlined" ? a : "#ffffff", s;
299
+ switch (t) {
300
+ case "circle":
301
+ s = `<circle cx="12" cy="12" r="12" fill="${a}"/>`;
302
+ break;
303
+ case "rounded":
304
+ s = `<rect width="24" height="24" rx="6" fill="${a}"/>`;
305
+ break;
306
+ case "square":
307
+ s = `<rect width="24" height="24" rx="0" fill="${a}"/>`;
308
+ break;
309
+ case "outlined":
310
+ s = `<rect width="22" height="22" x="1" y="1" rx="3" fill="transparent" stroke="${a}" stroke-width="2"/>`;
311
+ break;
312
+ default:
313
+ s = `<rect width="24" height="24" rx="3" fill="${a}"/>`;
314
+ break;
315
+ }
316
+ let c = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="${n}" height="${n}">` + s + `<g transform="translate(4.8, 4.8) scale(0.6)"><path d="${i}" fill="${o}"/></g></svg>`;
317
+ return "data:image/svg+xml;base64," + btoa(c);
318
+ }
319
+ //#endregion
320
+ //#region ../renderer/src/renderers/social.ts
321
+ function V(e, t) {
322
+ if (D(e)) return "";
323
+ let n = e.icons;
324
+ if (n.length === 0) return "";
325
+ let r = w(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : "", a = O(e), o = e.align, s = e.iconSize, c = e.iconStyle, l = e.spacing, u;
326
+ switch (s) {
327
+ case "small":
328
+ u = 24;
329
+ break;
330
+ case "large":
331
+ u = 48;
332
+ break;
333
+ default:
334
+ u = 32;
335
+ break;
336
+ }
337
+ let d;
338
+ switch (c) {
339
+ case "circle":
340
+ d = "50%";
341
+ break;
342
+ case "rounded":
343
+ d = "8px";
344
+ break;
345
+ case "square":
346
+ d = "0";
347
+ break;
348
+ default:
349
+ d = "4px";
350
+ break;
351
+ }
352
+ let f = n.length;
353
+ return `<mj-social
354
+ mode="horizontal"
355
+ align="${o}"
356
+ icon-padding="0"
357
+ padding="${r}"${i}${a}
358
+ >
359
+ ${n.map((e, t) => {
360
+ let n = e.platform, r = x(e.url), i = B(n, c, u), a = t === f - 1 ? 0 : l;
361
+ return `<mj-social-element src="${i}" href="${r}" icon-size="${u}px" padding="0 ${a}px 0 0" border-radius="${d}" background-color="transparent"></mj-social-element>`;
362
+ }).join("\n")}
363
+ </mj-social>`;
364
+ }
365
+ //#endregion
366
+ //#region ../renderer/src/renderers/menu.ts
367
+ function H(e, t) {
368
+ if (D(e) || e.items.length === 0) return "";
369
+ let n = w(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = O(e), a = G(e.fontFamily, t), o = e.textAlign;
370
+ return `<mj-text
371
+ font-size="${e.fontSize}px"
372
+ color="${x(e.color)}"
373
+ align="${o}"
374
+ line-height="1.5"
375
+ padding="${n}"${r}${a}${i}
376
+ >${U(e)}</mj-text>`;
377
+ }
378
+ function U(e) {
379
+ let t = e.items, n = b(e.separator), r = S(e.separatorColor), i = e.spacing, a = e.linkColor ?? e.color, o = [], s = t.length;
380
+ for (let e = 0; e < s; e++) o.push(W(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${i}px;">${n}</span>`);
381
+ return o.join("");
382
+ }
383
+ function W(e, t) {
384
+ let n = b(e.text), r = x(e.url), i = S(e.color ?? t), a = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", o = [`color: ${i}`, "text-decoration: none"];
385
+ return e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
386
+ }
387
+ function G(e, t) {
388
+ return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
389
+ }
390
+ //#endregion
391
+ //#region ../renderer/src/renderers/table.ts
392
+ function K(e, t) {
393
+ if (D(e) || e.rows.length === 0) return "";
394
+ let n = w(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = O(e), a = de(e.fontFamily, t);
395
+ return `<mj-text
396
+ font-size="${e.fontSize}px"
397
+ color="${x(e.color)}"
398
+ align="${e.textAlign}"
399
+ line-height="1.5"
400
+ padding="${n}"${r}${a}${i}
401
+ >${ce(e)}</mj-text>`;
402
+ }
403
+ function ce(e) {
404
+ let t = S(e.borderColor), n = e.borderWidth, r = "";
405
+ for (let i = 0; i < e.rows.length; i++) {
406
+ let a = e.rows[i];
407
+ r += le(a, e, e.hasHeaderRow && i === 0, t, n);
408
+ }
409
+ return `<table style="width: 100%; border-collapse: collapse;">${r}</table>`;
410
+ }
411
+ function le(e, t, n, r, i) {
412
+ let a = "";
413
+ for (let o of e.cells) a += ue(o, t, n, r, i);
414
+ return `<tr>${a}</tr>`;
415
+ }
416
+ function ue(e, t, n, r, i) {
417
+ let a = t.cellPadding, o = [`border: ${i}px solid ${r}`, `padding: ${a}px`];
418
+ n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${S(t.headerBackgroundColor)}`));
419
+ let s = o.join("; "), c = C(e.content), l = n ? "th" : "td";
420
+ return `<${l} style="${s}">${c}</${l}>`;
421
+ }
422
+ function de(e, t) {
423
+ return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
424
+ }
425
+ //#endregion
426
+ //#region ../renderer/src/renderers/custom.ts
427
+ function fe(e, t) {
428
+ if (D(e)) return "";
429
+ let n = t.customBlockHtml.get(e.id) ?? e.renderedHtml;
430
+ if (!n || n === "") return "";
431
+ let r = O(e);
432
+ return `<mj-text${E(e.styles?.backgroundColor, "container")}${r}>
433
+ ${n}
434
+ </mj-text>`;
435
+ }
436
+ //#endregion
437
+ //#region ../renderer/src/columns.ts
438
+ function q(e) {
439
+ switch (e) {
440
+ case "2": return ["50%", "50%"];
441
+ case "3": return [
442
+ "33.33%",
443
+ "33.33%",
444
+ "33.34%"
445
+ ];
446
+ case "1-2": return ["33.33%", "66.67%"];
447
+ case "2-1": return ["66.67%", "33.33%"];
448
+ default: return ["100%"];
449
+ }
450
+ }
451
+ function J(e, t) {
452
+ switch (e) {
453
+ case "2": return [t * .5, t * .5];
454
+ case "3": return [
455
+ t / 3,
456
+ t / 3,
457
+ t / 3
458
+ ];
459
+ case "1-2": return [t / 3, t * 2 / 3];
460
+ case "2-1": return [t * 2 / 3, t / 3];
461
+ default: return [t];
462
+ }
463
+ }
464
+ //#endregion
465
+ //#region ../renderer/src/renderers/section.ts
466
+ function pe(e, n, r) {
467
+ if (D(e)) return "";
468
+ let i = e.columns, a = q(i), o = J(i, n.containerWidth), s = w(e.styles.padding), c = E(e.styles.backgroundColor, "native"), l = O(e), u = e.children, d = [];
469
+ for (let e = 0; e < u.length; e++) {
470
+ let i = u[e], s = a[e] ?? "100%", c = Math.floor(o[e] ?? n.containerWidth), l = me(i, n.allowHtmlBlocks).filter((e) => !t(e)), f = n.withContainerWidth(c), p = l.map((e) => r(e, f)).filter((e) => e !== "").join("\n");
471
+ d.push(`<mj-column width="${s}">
472
+ ${p === "" ? "<mj-text>&nbsp;</mj-text>" : p}
473
+ </mj-column>`);
474
+ }
475
+ return `<mj-section${c} padding="${s}"${l}>
476
+ ${d.join("\n")}
477
+ </mj-section>`;
478
+ }
479
+ function me(e, t) {
480
+ return t ? e : e.filter((e) => e.type !== "html");
481
+ }
482
+ //#endregion
483
+ //#region ../renderer/src/renderers/video.ts
484
+ function he(e, t) {
485
+ if (t) return t;
486
+ if (!e) return null;
487
+ 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})/]) {
488
+ let n = e.match(t);
489
+ if (n) return `https://img.youtube.com/vi/${n[1]}/maxresdefault.jpg`;
490
+ }
491
+ let n = e.match(/vimeo\.com\/(?:video\/)?(\d+)/);
492
+ return n ? `https://vumbnail.com/${n[1]}.jpg` : null;
493
+ }
494
+ function ge(e, t) {
495
+ if (D(e)) return "";
496
+ let n = he(e.url, e.thumbnailUrl);
497
+ if (!n) return "";
498
+ let r = w(e.styles.padding), i = E(e.styles.backgroundColor, "container"), a = e.width === "full" ? t.containerWidth + "px" : e.width + "px", o = O(e);
499
+ return `<mj-image
500
+ src="${x(n)}"
501
+ alt="${x(e.alt)}"
502
+ width="${a}"
503
+ align="${e.align}"
504
+ padding="${r}"
505
+ href="${x(e.url)}"
506
+ target="_blank"
507
+ rel="noopener"${i}${o}
508
+ />`;
509
+ }
510
+ //#endregion
511
+ //#region ../renderer/src/renderers/index.ts
512
+ function Y(e, l) {
513
+ return t(e) ? pe(e, l, Y) : m(e) ? ee(e, l) : a(e) ? te(e, l) : s(e) ? ne(e, l) : o(e) ? ae(e, l) : n(e) ? oe(e, l) : p(e) ? I(e, l) : h(e) ? L(e, l) : r(e) ? R(e, l) : u(e) ? V(e, l) : c(e) ? H(e, l) : f(e) ? K(e, l) : d(e) ? ge(e, l) : i(e) ? fe(e, l) : "";
514
+ }
515
+ //#endregion
516
+ //#region ../renderer/src/index.ts
517
+ var _e = /* @__PURE__ */ e({
518
+ RenderContext: () => _,
519
+ SOCIAL_ICONS: () => z,
520
+ convertMergeTagsToValues: () => C,
521
+ escapeAttr: () => x,
522
+ escapeHtml: () => b,
523
+ generateSocialIconDataUri: () => B,
524
+ getCssClassAttr: () => O,
525
+ getCssClasses: () => k,
526
+ getWidthPercentages: () => q,
527
+ getWidthPixels: () => J,
528
+ isHiddenOnAll: () => D,
529
+ renderBlock: () => Y,
530
+ renderToMjml: () => ve,
531
+ toPaddingString: () => w
532
+ });
533
+ async function ve(e, t) {
534
+ let n = t?.customFonts ?? [], r = t?.defaultFallbackFont ?? "Arial, sans-serif", i = t?.allowHtmlBlocks ?? !0, a = await Q(e, t?.renderCustomBlock), o = new _(e.settings.width, n, r, i, a), s = o.resolveFontFamily(e.settings.fontFamily), c = e.settings.backgroundColor, l = (e.canvasPages?.length ?? 0) > 0, u = ye(e, o, i), d = Ce(n), f = Se(e.settings.preheaderText), p = x(e.settings.locale), m = `width="${o.containerWidth}px" background-color="${c}"` + (l ? " css-class=\"tpl-canvas-multi\"" : "");
535
+ return `<mjml lang="${p}">
536
+ <mj-head>${f}
537
+ <mj-attributes>
538
+ <mj-all font-family="${s}" />
539
+ <mj-text font-size="14px" />
540
+ <mj-section padding="0" />
541
+ <mj-column padding="0" />
542
+ <mj-image fluid-on-mobile="true" />
543
+ </mj-attributes>${d}
544
+ <mj-style>
545
+ a { color: inherit; text-decoration: none; }
546
+ @media only screen and (max-width: 480px) {
547
+ .tpl-hide-mobile { display: none !important; mso-hide: all !important; }
548
+ }
549
+ @media only screen and (min-width: 481px) and (max-width: 768px) {
550
+ .tpl-hide-tablet { display: none !important; mso-hide: all !important; }
551
+ }
552
+ @media only screen and (min-width: 769px) {
553
+ .tpl-hide-desktop { display: none !important; mso-hide: all !important; }
554
+ }${l ? Ee() : ""}
555
+ </mj-style>
556
+ </mj-head>
557
+ <mj-body ${m}>
558
+ ${u}${l ? `\n${De()}\n` : ""}
559
+ </mj-body>
560
+ </mjml>`;
561
+ }
562
+ function ye(e, t, n) {
563
+ let r = e.canvasPages;
564
+ if (r?.length) {
565
+ let e = [];
566
+ for (let i = 0; i < r.length; i++) {
567
+ let a = X(r[i].blocks ?? [], t, n);
568
+ if (a.trim() === "") continue;
569
+ let o = i === 0 ? `tpl-canvas-page tpl-canvas-page-idx-${i} tpl-canvas-page--current` : `tpl-canvas-page tpl-canvas-page-idx-${i}`;
570
+ e.push(`<mj-wrapper css-class="${x(o)}" padding="0">\n${a}\n</mj-wrapper>`);
571
+ }
572
+ return e.join("\n");
573
+ }
574
+ return X(e.blocks, t, n);
575
+ }
576
+ function X(e, t, n) {
577
+ return we(e, n).map((e) => be(e, t)).filter((e) => e !== "").join("\n");
578
+ }
579
+ function be(e, n) {
580
+ return t(e) ? Z(e, Y(e, n)) : Z(e, xe(Y(e, n)));
581
+ }
582
+ function Z(e, t) {
583
+ if (t === "") return "";
584
+ let n = e.displayCondition;
585
+ return n ? `<mj-raw>${n.before}</mj-raw>
586
+ ` + t + `
587
+ <mj-raw>${n.after}</mj-raw>` : t;
588
+ }
589
+ function xe(e) {
590
+ return e === "" ? "" : `<mj-section>
591
+ <mj-column>
592
+ ${e}
593
+ </mj-column>
594
+ </mj-section>`;
595
+ }
596
+ function Se(e) {
597
+ if (!e) return "";
598
+ let t = e.trim();
599
+ return t === "" ? "" : `\n <mj-preview>${b(t)}</mj-preview>`;
600
+ }
601
+ function Ce(e) {
602
+ return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${x(e.name)}" href="${x(e.url)}" />`).join("");
603
+ }
604
+ function we(e, t) {
605
+ return t ? e : e.filter((e) => e.type !== "html");
606
+ }
607
+ async function Q(e, t) {
608
+ let n = /* @__PURE__ */ new Map();
609
+ if (!t) return n;
610
+ let r = [];
611
+ if (Te(e, r), r.length === 0) return n;
612
+ let i = await Promise.all(r.map((e) => t(e)));
613
+ for (let e = 0; e < r.length; e++) n.set(r[e].id, i[e]);
614
+ return n;
615
+ }
616
+ function $(e, n) {
617
+ for (let r of e) {
618
+ if (i(r)) {
619
+ n.push(r);
620
+ continue;
621
+ }
622
+ if (t(r)) for (let e of r.children) $(e, n);
623
+ }
624
+ }
625
+ function Te(e, t) {
626
+ let n = e.canvasPages;
627
+ if (n?.length) {
628
+ for (let e of n) $(e.blocks ?? [], t);
629
+ return;
630
+ }
631
+ $(e.blocks, t);
632
+ }
633
+ function Ee() {
634
+ return "\n .tpl-canvas-multi .tpl-canvas-page { display: none !important; }\n .tpl-canvas-multi .tpl-canvas-page.tpl-canvas-page--current { display: block !important; }";
635
+ }
636
+ function De() {
637
+ return "<mj-raw>\n <script>\n (function () {\n var root = document.body;\n if (!root || !root.classList.contains(\"tpl-canvas-multi\")) return;\n root.addEventListener(\n \"click\",\n function (e) {\n var link = e.target.closest(\"a\");\n if (!link || !root.contains(link)) return;\n var isNext =\n link.classList.contains(\"tpl-btn-next-step\") ||\n !!link.closest(\"td.tpl-btn-next-step\");\n var isPrev =\n link.classList.contains(\"tpl-btn-prev-step\") ||\n !!link.closest(\"td.tpl-btn-prev-step\");\n if (!isNext && !isPrev) return;\n e.preventDefault();\n e.stopPropagation();\n var pages = Array.prototype.slice.call(\n root.querySelectorAll(\".tpl-canvas-page\"),\n );\n var cur = root.querySelector(\n \".tpl-canvas-page.tpl-canvas-page--current\",\n );\n var i = pages.indexOf(cur);\n if (i < 0) return;\n if (isNext) {\n if (i >= pages.length - 1) return;\n pages[i].classList.remove(\"tpl-canvas-page--current\");\n pages[i + 1].classList.add(\"tpl-canvas-page--current\");\n } else {\n if (i <= 0) return;\n pages[i].classList.remove(\"tpl-canvas-page--current\");\n pages[i - 1].classList.add(\"tpl-canvas-page--current\");\n }\n },\n true,\n );\n })();\n <\/script>\n </mj-raw>";
638
+ }
639
+ //#endregion
640
+ export { _e as t };
641
+
642
+ //# sourceMappingURL=renderer-si0Zgxeb.js.map