@aswin.dev/editor 0.6.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/dist/AccessibilityPanel-CvQGLdu6.js +108 -0
  2. package/dist/AiChatSidebar-B3SJIKG_.js +229 -0
  3. package/dist/AiFeatureMenu-BLLKoOos.js +63 -0
  4. package/dist/BlockA11yBadge-CXDLqkcJ.js +34 -0
  5. package/dist/CloudEditor-BCz1ZTYC.js +1172 -0
  6. package/dist/CollaboratorBar-DuPYW5iF.js +95 -0
  7. package/dist/CommentsSidebar-B1pvJdqF.js +441 -0
  8. package/dist/CountdownBlock-BNSj1jvJ.js +92 -0
  9. package/dist/CountdownToolbar-ClJr2GzL.js +210 -0
  10. package/dist/DesignReferenceSidebar-B8V_F2yF.js +276 -0
  11. package/dist/LoadingTrack-B0CWFHXQ.js +10 -0
  12. package/dist/ModuleBrowserModal-DrUFMTDx.js +206 -0
  13. package/dist/ModulePreviewCanvas-CHdOwV_4.js +106 -0
  14. package/dist/NumberWithSuffix-DkXUez9t.js +422 -0
  15. package/dist/ParagraphEditor-D75wl3BX.js +695 -0
  16. package/dist/RichTextEditorContent-DYkIauIk.js +137 -0
  17. package/dist/SaveModuleDialog-FZ9lxY7_.js +123 -0
  18. package/dist/SnapshotHistory-BR3eV120.js +127 -0
  19. package/dist/TemplateScoringPanel-4GTNHej5.js +256 -0
  20. package/dist/TestEmailModal--ue5w9fT.js +94 -0
  21. package/dist/TitleEditor-fStSADI-.js +172 -0
  22. package/dist/TplModal-BwSfxIHf.js +44 -0
  23. package/dist/_plugin-vue_export-helper-B0hnzhyu.js +8 -0
  24. package/dist/accessibility-e8JYu_zd.js +27 -0
  25. package/dist/blockTypeIcons-BcTrDjmH.js +126 -0
  26. package/dist/bundle-stats.json +10 -0
  27. package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js +97 -0
  28. package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js.map +1 -0
  29. package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js +59 -0
  30. package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js.map +1 -0
  31. package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js +33 -0
  32. package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js.map +1 -0
  33. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js +1143 -0
  34. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js.map +1 -0
  35. package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js +51 -0
  36. package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js.map +1 -0
  37. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js +93 -0
  38. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js.map +1 -0
  39. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +212 -0
  40. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js.map +1 -0
  41. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js +195 -0
  42. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js.map +1 -0
  43. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js +107 -0
  44. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js.map +1 -0
  45. package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js +423 -0
  46. package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js.map +1 -0
  47. package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js +544 -0
  48. package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js.map +1 -0
  49. package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js +106 -0
  50. package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js.map +1 -0
  51. package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js +119 -0
  52. package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js.map +1 -0
  53. package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js +171 -0
  54. package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js.map +1 -0
  55. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js +22 -0
  56. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js.map +1 -0
  57. package/dist/cdn/chunks/de-Ce-LbJ2J.js +89 -0
  58. package/dist/cdn/chunks/de-Ce-LbJ2J.js.map +1 -0
  59. package/dist/cdn/chunks/de-D8CnZxV9.js +523 -0
  60. package/dist/cdn/chunks/de-D8CnZxV9.js.map +1 -0
  61. package/dist/cdn/chunks/de-RQrZR56a.js +209 -0
  62. package/dist/cdn/chunks/de-RQrZR56a.js.map +1 -0
  63. package/dist/cdn/chunks/draggable-Bcb86AsV.js +11572 -0
  64. package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +1 -0
  65. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js +19 -0
  66. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js.map +1 -0
  67. package/dist/cdn/chunks/en-8FHaQv4V.js +523 -0
  68. package/dist/cdn/chunks/en-8FHaQv4V.js.map +1 -0
  69. package/dist/cdn/chunks/en-Bl1ecfRF.js +209 -0
  70. package/dist/cdn/chunks/en-Bl1ecfRF.js.map +1 -0
  71. package/dist/cdn/chunks/en-DiCWK5fG.js +89 -0
  72. package/dist/cdn/chunks/en-DiCWK5fG.js.map +1 -0
  73. package/dist/cdn/chunks/extensions-DIxF31tA.js +598 -0
  74. package/dist/cdn/chunks/extensions-DIxF31tA.js.map +1 -0
  75. package/dist/cdn/chunks/features-DEMb13KS.js +6814 -0
  76. package/dist/cdn/chunks/features-DEMb13KS.js.map +1 -0
  77. package/dist/cdn/chunks/icons-CsLTcirh.js +700 -0
  78. package/dist/cdn/chunks/icons-CsLTcirh.js.map +1 -0
  79. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js +3279 -0
  80. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js.map +1 -0
  81. package/dist/cdn/chunks/media-library-CVaNvhpM.js +6014 -0
  82. package/dist/cdn/chunks/media-library-CVaNvhpM.js.map +1 -0
  83. package/dist/cdn/chunks/pusher-CDbNlZBE.js +2508 -0
  84. package/dist/cdn/chunks/pusher-CDbNlZBE.js.map +1 -0
  85. package/dist/cdn/chunks/quality-BaBfc54_.js +1456 -0
  86. package/dist/cdn/chunks/quality-BaBfc54_.js.map +1 -0
  87. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +32 -0
  88. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +1 -0
  89. package/dist/cdn/chunks/renderer-CUxvx7ro.js +548 -0
  90. package/dist/cdn/chunks/renderer-CUxvx7ro.js.map +1 -0
  91. package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +20 -0
  92. package/dist/cdn/chunks/src-CRaqN-p8.js +497 -0
  93. package/dist/cdn/chunks/src-CRaqN-p8.js.map +1 -0
  94. package/dist/cdn/chunks/styleConstants-DP1VOca8.js +57 -0
  95. package/dist/cdn/chunks/styleConstants-DP1VOca8.js.map +1 -0
  96. package/dist/cdn/chunks/styles-BHJULjNR.js +2947 -0
  97. package/dist/cdn/chunks/styles-BHJULjNR.js.map +1 -0
  98. package/dist/cdn/chunks/tiptap-ZhwKyFp7.js +14654 -0
  99. package/dist/cdn/chunks/tiptap-ZhwKyFp7.js.map +1 -0
  100. package/dist/cdn/editor.css +2 -0
  101. package/dist/cdn/editor.js +250 -0
  102. package/dist/cdn/editor.js.map +1 -0
  103. package/dist/check-Da05j8yl.js +7 -0
  104. package/dist/chevron-down-R2uY34iD.js +7 -0
  105. package/dist/circle-alert-DZuGWPX-.js +25 -0
  106. package/dist/clock-CRp2sIub.js +12 -0
  107. package/dist/cloud-DEk_b4CR.js +1733 -0
  108. package/dist/createLucideIcon-C3pa2siy.js +43 -0
  109. package/dist/de-Brqvgr43.js +521 -0
  110. package/dist/de-DCaaCE5s.js +207 -0
  111. package/dist/dist-B1IR0bpH.js +326 -0
  112. package/dist/dist-BFawx6IS.js +519 -0
  113. package/dist/dist-BaQIYPsn.js +35 -0
  114. package/dist/dist-Cp0zXPAD.js +189 -0
  115. package/dist/dist-D6uC2xhi.js +5 -0
  116. package/dist/dist-D90y8dvT.js +2082 -0
  117. package/dist/dist-DDJIWTRY.js +776 -0
  118. package/dist/dist-DJmnUmW9.js +362 -0
  119. package/dist/dist-DjviJBCi.js +74 -0
  120. package/dist/dist-KoBJjK1G.js +61 -0
  121. package/dist/dist-aRzjfSRN.js +35 -0
  122. package/dist/dist-iLBdeBDR.js +10658 -0
  123. package/dist/dist-us-RpCWN.js +47 -0
  124. package/dist/dist-wzMIGj-D.js +5 -0
  125. package/dist/emojiData-PQyVa4bU.js +17 -0
  126. package/dist/en-DXCyK4-X.js +207 -0
  127. package/dist/en-WDVp87TE.js +521 -0
  128. package/dist/extensions-CUcl9Ok4.js +799 -0
  129. package/dist/formatRelativeTime-BOEf47hq.js +12 -0
  130. package/dist/image-up-MBZKKg9p.js +23 -0
  131. package/dist/index.d.ts +275 -0
  132. package/dist/info-CJEC7piy.js +19 -0
  133. package/dist/keys-ciNfSSGj.js +10 -0
  134. package/dist/liquid.browser-CdMv1BTn.js +3277 -0
  135. package/dist/loader-circle-DsY5Yg33.js +7 -0
  136. package/dist/message-circle-yElBbR2C.js +7 -0
  137. package/dist/readableTextColor-CY3SiRnt.js +30 -0
  138. package/dist/refresh-cw-CE_AGtn8.js +29 -0
  139. package/dist/rolldown-runtime-BZGGJVDF.js +20 -0
  140. package/dist/scan-line-D0vcUekt.js +25 -0
  141. package/dist/send-DH4oDQqC.js +10 -0
  142. package/dist/shield-check-CfJgs2Hd.js +10 -0
  143. package/dist/sparkles-CvRXGqFs.js +23 -0
  144. package/dist/style.css +2 -0
  145. package/dist/styleConstants-fWzlIIwN.js +55 -0
  146. package/dist/styles-DEXEkBvg.js +3176 -0
  147. package/dist/templatical-editor.js +249 -0
  148. package/dist/text-align-start-BT9VUDxK.js +43 -0
  149. package/dist/timeouts-BSGxjuUF.js +4 -0
  150. package/dist/trash-2-DbP2Y6t2.js +25 -0
  151. package/dist/triangle-alert-aOXceTSe.js +17 -0
  152. package/dist/useCloudI18n-BuIwR6OE.js +23 -0
  153. package/dist/useEditorCore-C6ost42Q.js +9342 -0
  154. package/dist/useI18n-lb2DHDiu.js +17 -0
  155. package/dist/useMergeTag-CBwKnnNB.js +34 -0
  156. package/dist/vue.runtime.esm-bundler-DpvJL-nX.js +5775 -0
  157. package/dist/x-u2oVmjN_.js +10 -0
  158. package/package.json +1 -1
@@ -0,0 +1,1143 @@
1
+ import { $ as e, B as t, F as n, H as r, M as i, N as a, P as o, S as s, U as c, X as l, _ as u, at as d, b as f, c as p, ct as m, d as h, g, h as _, j as v, lt as y, m as b, n as x, p as S, st as C, tt as w, u as T, v as E, x as D, y as O } from "./draggable-Bcb86AsV.js";
2
+ import { $ as k, Bt as A, C as j, D as M, Fn as N, Ft as P, Ht as F, Lt as ee, Nt as I, Ot as L, S as te, Sn as R, Tt as z, Vt as B, Xt as V, Y as ne, Yt as H, Zt as U, _ as W, _n as G, at as K, b as re, c as ie, ct as q, d as J, dt as Y, f as X, g as ae, gt as Z, h as oe, ht as se, jt as ce, k as le, l as ue, ln as Q, m as de, p as fe, tn as pe, tt as me, u as he, v as ge, wt as _e, x as ve, y as ye } from "./features-DEMb13KS.js";
3
+ import { C as be, S as xe } from "./icons-CsLTcirh.js";
4
+ import { a as Se, c as Ce, i as we, n as Te, o as Ee, r as De, s as Oe, t as ke } from "./styles-BHJULjNR.js";
5
+ import { d as $ } from "./styleConstants-DP1VOca8.js";
6
+ //#region src/cloud/composables/useSnapshotPreview.ts
7
+ function Ae(t) {
8
+ let { authManager: n, editor: r, history: i, conditionPreview: a, autoSave: o, onError: s } = t, c = w(null), u = e(null), d = e(null), f = !1;
9
+ l(() => {
10
+ f = !0;
11
+ });
12
+ let p = S(() => u.value !== null), m = S(() => c.value?.snapshots.value ?? []), h = S(() => c.value?.isLoading.value ?? !1), g = S(() => c.value?.isRestoring.value ?? !1);
13
+ function _() {
14
+ r.state.template?.id && !c.value && (c.value = fe({
15
+ authManager: n,
16
+ templateId: r.state.template.id,
17
+ onRestore: v,
18
+ onError: s
19
+ }), c.value.loadSnapshots());
20
+ }
21
+ function v(e) {
22
+ r.setContent(e.content, !1), i.clear(), a.reset();
23
+ }
24
+ async function y(e) {
25
+ if (!f) {
26
+ if (u.value) {
27
+ u.value = e, r.setContent(e.content, !1);
28
+ return;
29
+ }
30
+ r.state.isDirty && r.hasTemplate() && (await r.createSnapshot(), f) || (d.value = structuredClone(r.content.value), o?.pause(), u.value = e, r.setContent(e.content, !1));
31
+ }
32
+ }
33
+ async function b() {
34
+ if (!(!u.value || !c.value)) try {
35
+ if (await c.value.restoreSnapshot(u.value.id), f || (await c.value.loadSnapshots(), f)) return;
36
+ } finally {
37
+ f || (u.value = null, d.value = null, o?.resume());
38
+ }
39
+ }
40
+ function x() {
41
+ !u.value || !d.value || (r.setContent(d.value, !1), u.value = null, d.value = null, o?.resume());
42
+ }
43
+ async function C() {
44
+ f || c.value && await c.value.loadSnapshots();
45
+ }
46
+ return {
47
+ snapshotHistoryInstance: c,
48
+ previewingSnapshot: u,
49
+ contentBeforePreview: d,
50
+ isPreviewingSnapshot: p,
51
+ snapshotHistorySnapshots: m,
52
+ snapshotHistoryIsLoading: h,
53
+ snapshotHistoryIsRestoring: g,
54
+ initSnapshotHistory: _,
55
+ handleRestore: v,
56
+ handleSnapshotNavigate: y,
57
+ confirmRestoreSnapshot: b,
58
+ cancelPreview: x,
59
+ loadSnapshotHistory: C
60
+ };
61
+ }
62
+ //#endregion
63
+ //#region src/cloud/composables/useCloudPanelState.ts
64
+ function je() {
65
+ let t = e(null), n = S({
66
+ get: () => t.value === "ai-chat",
67
+ set: (e) => t.value = e ? "ai-chat" : null
68
+ }), r = S({
69
+ get: () => t.value === "scoring",
70
+ set: (e) => t.value = e ? "scoring" : null
71
+ }), i = S({
72
+ get: () => t.value === "design-reference",
73
+ set: (e) => t.value = e ? "design-reference" : null
74
+ }), a = S({
75
+ get: () => t.value === "comments",
76
+ set: (e) => t.value = e ? "comments" : null
77
+ }), o = e(!1), s = e(!1), c = e(void 0), l = e(!1), u = e(null), d = S(() => t.value !== null), f = S(() => {
78
+ let e = t.value;
79
+ return e === "ai-chat" || e === "design-reference" || e === "scoring" ? e : null;
80
+ }), p = S(() => l.value || t.value === "ai-chat" || t.value === "design-reference" || t.value === "scoring");
81
+ function m() {
82
+ l.value = !l.value;
83
+ }
84
+ function h(e) {
85
+ l.value = !1, t.value = t.value === e ? null : e;
86
+ }
87
+ return pe(u, () => {
88
+ l.value = !1;
89
+ }), {
90
+ activePanel: t,
91
+ aiChatOpen: n,
92
+ scoringPanelOpen: r,
93
+ designReferenceOpen: i,
94
+ commentsOpen: a,
95
+ testEmailModalOpen: o,
96
+ mediaLibraryOpen: s,
97
+ mediaLibraryAccept: c,
98
+ aiMenuOpen: l,
99
+ aiMenuRef: u,
100
+ rightPanelOpen: d,
101
+ activeAiFeature: f,
102
+ aiButtonActive: p,
103
+ toggleAiMenu: m,
104
+ handleAiFeatureSelect: h
105
+ };
106
+ }
107
+ //#endregion
108
+ //#region src/cloud/composables/useCollabUndoWarning.ts
109
+ function Me(t) {
110
+ let { isCollaborationEnabled: n, getCollaboratorCount: r, canUndo: i } = t, a = e(!1), o = e(!1), { start: s } = Q(() => {
111
+ o.value = !1;
112
+ }, N, { immediate: !1 });
113
+ function c() {
114
+ a.value || !n.value || r() === 0 || !i.value || (a.value = !0, o.value = !0, s());
115
+ }
116
+ return {
117
+ collabUndoWarningVisible: o,
118
+ showCollabUndoWarning: c
119
+ };
120
+ }
121
+ //#endregion
122
+ //#region src/cloud/composables/useCloudFeatureFlags.ts
123
+ function Ne(t) {
124
+ let { planConfigInstance: n, aiConfig: r, editor: i } = t, a = S(() => n.hasFeature("ai_generation") && r.hasAnyMenuFeature.value), o = S(() => n.hasFeature("test_email")), s = S(() => !!i.state.template?.id), c = S(() => n.hasFeature("white_label")), l = S(() => n.config.value?.limits.max_templates ?? null), u = S(() => n.config.value?.template_count ?? 0), d = e(!1), f = e("idle"), p = e(""), { start: m } = Q(() => {
125
+ f.value = "idle";
126
+ }, 3e3, { immediate: !1 });
127
+ return {
128
+ canUseAiGeneration: a,
129
+ canSendTestEmail: o,
130
+ hasTemplateSaved: s,
131
+ isWhiteLabeled: c,
132
+ templateLimit: l,
133
+ templateCount: u,
134
+ isSaveExporting: d,
135
+ saveStatus: f,
136
+ saveErrorMessage: p,
137
+ startSaveStatusClear: m
138
+ };
139
+ }
140
+ //#endregion
141
+ //#region src/cloud/composables/useCloudMediaLibrary.ts
142
+ function Pe(e) {
143
+ let { onRequestMedia: t, mediaLibraryOpen: n, mediaLibraryAccept: r } = e, i = null;
144
+ async function a() {
145
+ if (t) {
146
+ let e = await t({ accept: ["images"] });
147
+ return e ? {
148
+ url: e.url,
149
+ alt: e.alt_text || void 0
150
+ } : null;
151
+ }
152
+ return i &&= (i(null), null), r.value = ["images"], n.value = !0, new Promise((e) => {
153
+ i = (t) => {
154
+ e(t);
155
+ };
156
+ });
157
+ }
158
+ function o(e) {
159
+ n.value = !1, i?.({
160
+ url: e.url,
161
+ alt: e.alt_text || void 0
162
+ }), i = null;
163
+ }
164
+ function s() {
165
+ n.value = !1, i?.(null), i = null;
166
+ }
167
+ return l(() => {
168
+ i &&= (i(null), null);
169
+ }), {
170
+ handleRequestMedia: a,
171
+ handleMediaSelect: o,
172
+ handleMediaLibraryClose: s
173
+ };
174
+ }
175
+ //#endregion
176
+ //#region src/cloud/composables/useCloudInitialization.ts
177
+ function Fe(n) {
178
+ let { config: r, translations: i, fontsManager: a, emit: s, getCommentsSidebar: c } = n, l = e(!0), u = e(!1), d = e(null), f = !1, p = { value: null }, m = null, h = null, g = new M({
179
+ ...r.auth,
180
+ onError: r.onError
181
+ }), _ = he({
182
+ authManager: g,
183
+ onError: r.onError
184
+ }), v = e(/* @__PURE__ */ new Map()), y = te({
185
+ authManager: g,
186
+ defaultFontFamily: r.fonts?.defaultFont,
187
+ templateDefaults: r.templateDefaults,
188
+ onError: r.onError,
189
+ lockedBlocks: v
190
+ }), b = oe({
191
+ authManager: g,
192
+ onError: r.onError
193
+ });
194
+ r.mcp?.enabled && ie({
195
+ editor: y,
196
+ channel: b.channel,
197
+ onOperation: r.mcp.onOperation
198
+ });
199
+ let x = null;
200
+ r.collaboration?.enabled && (x = W({
201
+ authManager: g,
202
+ editor: y,
203
+ channel: b.channel,
204
+ onError: r.onError,
205
+ onCollaboratorJoined: r.collaboration.onCollaboratorJoined,
206
+ onCollaboratorLeft: r.collaboration.onCollaboratorLeft,
207
+ onBlockLocked: r.collaboration.onBlockLocked,
208
+ onBlockUnlocked: r.collaboration.onBlockUnlocked
209
+ }), t(() => x.lockedBlocks.value, (e) => {
210
+ v.value = e;
211
+ }, { immediate: !0 }), ae(y, x));
212
+ let C = S(() => !!r.collaboration?.enabled && _.hasFeature("collaboration")), w = le({
213
+ editor: y,
214
+ config: {
215
+ uiTheme: r.uiTheme,
216
+ theme: void 0,
217
+ blockDefaults: r.blockDefaults,
218
+ customBlocks: [],
219
+ mergeTags: r.mergeTags,
220
+ displayConditions: r.displayConditions,
221
+ onRequestMedia: null,
222
+ accessibility: Ce(r),
223
+ onSave: () => {
224
+ p.value?.().catch((e) => {
225
+ r.onError?.(e);
226
+ });
227
+ }
228
+ },
229
+ translations: i,
230
+ fontsManager: a,
231
+ historyOptions: x ? { isRemoteOperation: () => x._isProcessingRemoteOperation() } : void 0,
232
+ autoSaveOptions: {
233
+ onChange: async () => {
234
+ y.hasTemplate() && (await y.createSnapshot(), m?.snapshotHistoryInstance.value?.loadSnapshots());
235
+ },
236
+ debounce: r.autoSaveDebounce ?? 5e3,
237
+ enabled: () => r.autoSave !== !1 && _.hasFeature("auto_save")
238
+ },
239
+ themeExtraStyles: () => ({ "--tpl-drop-text": `"${i.canvas.dropHere}"` }),
240
+ keyboardOptions: { onBeforeUndo: () => h?.showCollabUndoWarning() }
241
+ }), T = Me({
242
+ isCollaborationEnabled: C,
243
+ getCollaboratorCount: () => x?.collaborators.value.length ?? 0,
244
+ canUndo: w.history.canUndo
245
+ });
246
+ h = T;
247
+ let E = Ae({
248
+ authManager: g,
249
+ editor: y,
250
+ history: w.history,
251
+ conditionPreview: w.conditionPreview,
252
+ autoSave: w.autoSave,
253
+ onError: r.onError
254
+ });
255
+ m = E;
256
+ let D = je(), O = ve(r.ai), k = Ne({
257
+ planConfigInstance: _,
258
+ aiConfig: O,
259
+ editor: y
260
+ }), j = Pe({
261
+ onRequestMedia: r.onRequestMedia,
262
+ mediaLibraryOpen: D.mediaLibraryOpen,
263
+ mediaLibraryAccept: D.mediaLibraryAccept
264
+ });
265
+ ne({
266
+ onBlockMove: y.moveBlock,
267
+ onBlockAdd: y.addBlock
268
+ });
269
+ let N = J({
270
+ authManager: g,
271
+ getFontsConfig: () => r.fonts,
272
+ canUseCustomFonts: () => _.hasFeature("custom_fonts")
273
+ }), I = X({
274
+ authManager: g,
275
+ getTemplateId: () => y.state.template?.id ?? null,
276
+ save: () => y.save(),
277
+ exportHtml: (e) => N.exportHtml(e),
278
+ onError: r.onError,
279
+ isAuthReady: u,
280
+ onBeforeTestEmail: r.onBeforeTestEmail
281
+ }), L = ye({
282
+ authManager: g,
283
+ getTemplateId: () => y.state.template?.id ?? null,
284
+ getSocketId: () => b.getSocketId(),
285
+ onComment: r.onComment,
286
+ onError: r.onError,
287
+ isAuthReady: u,
288
+ hasCommentingFeature: () => r.commenting !== !1 && _.hasFeature("commenting")
289
+ });
290
+ ge({
291
+ comments: L,
292
+ channel: b.channel
293
+ });
294
+ let R = de({
295
+ authManager: g,
296
+ onError: r.onError
297
+ }), z = e(!1), B = e(null), G = e(!1), K = re({
298
+ authManager: g,
299
+ getTemplateId: () => y.state.template?.id ?? null
300
+ });
301
+ function q(e) {
302
+ D.commentsOpen.value = !0, queueMicrotask(() => {
303
+ c()?.filterByBlock(e);
304
+ });
305
+ }
306
+ o(H, j.handleRequestMedia), o(ee, g), o(P, O), o(F, L), o(V, R), o(U, K), o(A, {
307
+ plan: _,
308
+ ai: O,
309
+ comments: {
310
+ getBlockCount: (e) => L.commentCountByBlock.value.get(e) ?? 0,
311
+ openForBlock: q
312
+ },
313
+ savedModules: {
314
+ openSaveDialog: (e) => {
315
+ B.value = e ?? null, z.value = !0;
316
+ },
317
+ openBrowser: () => {
318
+ G.value = !0;
319
+ },
320
+ moduleCount: S(() => R.modules.value.length)
321
+ }
322
+ });
323
+ function Y(e) {
324
+ _.hasFeature("theme_customization") && (w.themeOverrides.value = e);
325
+ }
326
+ function Z(e) {
327
+ y.setUiTheme(e);
328
+ }
329
+ async function se() {
330
+ l.value = !0, d.value = null;
331
+ try {
332
+ if (await g.initialize(), f) return;
333
+ u.value = !0;
334
+ let e = await ue({ authManager: g });
335
+ if (f) return;
336
+ if (!e.api.ok) throw Error("Health check failed: API is not reachable");
337
+ if (!e.auth.ok) throw Error(`Health check failed: authentication error${e.auth.error ? ` - ${e.auth.error}` : ""}`);
338
+ if (e.websocket.ok || ce.warn("WebSocket health check failed:", e.websocket.error ?? "unknown error", "-- real-time features will be disabled."), await _.fetchConfig(), f) return;
339
+ a.setCustomFontsEnabled(_.hasFeature("custom_fonts")), r.customBlocks?.length && _.hasFeature("custom_blocks") && w.registerCustomBlocks(r.customBlocks), r.theme && _.hasFeature("theme_customization") && (w.themeOverrides.value = r.theme), r.modules !== !1 && _.hasFeature("saved_modules") && R.loadModules(), s("ready");
340
+ } catch (e) {
341
+ if (f) return;
342
+ let t = e instanceof Error ? e : Error("Initialization failed", { cause: e });
343
+ d.value = t, r.onError?.(t);
344
+ } finally {
345
+ f || (l.value = !1);
346
+ }
347
+ }
348
+ function Q() {
349
+ f = !0, a.cleanupFontLinks(), b.disconnect(), w.destroy(), r.onUnmount?.();
350
+ }
351
+ return {
352
+ isInitializing: l,
353
+ isAuthReady: u,
354
+ initError: d,
355
+ isDestroyed: () => f,
356
+ authManager: g,
357
+ planConfigInstance: _,
358
+ websocket: b,
359
+ collaboration: x,
360
+ isCollaborationEnabled: C,
361
+ editor: y,
362
+ core: w,
363
+ aiConfig: O,
364
+ featureFlags: k,
365
+ mediaLib: j,
366
+ exporter: N,
367
+ testEmail: I,
368
+ commentsInstance: L,
369
+ savedModulesHeadless: R,
370
+ scoringInstance: K,
371
+ panelState: D,
372
+ snapshotPreview: E,
373
+ collabWarning: T,
374
+ showSaveModuleDialog: z,
375
+ showModuleBrowserModal: G,
376
+ saveModulePreSelectedBlockId: B,
377
+ onSaveHook: p,
378
+ initialize: se,
379
+ destroy: Q,
380
+ setThemeOverrides: Y,
381
+ setUiTheme: Z,
382
+ openCommentsForBlock: q
383
+ };
384
+ }
385
+ //#endregion
386
+ //#region src/utils/preRenderCustomBlocks.ts
387
+ async function Ie(e, t) {
388
+ let n = async (e) => {
389
+ if (R(e)) {
390
+ let n = e;
391
+ try {
392
+ n.renderedHtml = await t.renderCustomBlock(n);
393
+ } catch {
394
+ n.renderedHtml = `<!-- Custom block render error: ${n.customType} -->`;
395
+ }
396
+ }
397
+ if (e.type === "section" && "children" in e) {
398
+ let t = e;
399
+ for (let e of t.children) for (let t of e) await n(t);
400
+ }
401
+ };
402
+ for (let t of e.blocks) await n(t);
403
+ }
404
+ //#endregion
405
+ //#region src/cloud/composables/useCloudLifecycle.ts
406
+ function Le(e) {
407
+ let { config: t, editor: n, websocket: r, planConfigInstance: i, snapshotPreview: a, core: o, exporter: s, featureFlags: c, isDestroyed: l } = e;
408
+ function u() {
409
+ return j(i.config.value.websocket);
410
+ }
411
+ async function d(e) {
412
+ let i = await n.create(e);
413
+ return l() ? i : (t.onCreate?.(i), a.initSnapshotHistory(), r.connect(i.id, u()), i);
414
+ }
415
+ async function f(e) {
416
+ let i = await n.load(e);
417
+ return l() ? i : (t.onLoad?.(i), a.initSnapshotHistory(), r.connect(i.id, u()), i);
418
+ }
419
+ async function p() {
420
+ c.isSaveExporting.value = !0, c.saveStatus.value = "idle";
421
+ try {
422
+ if (await Ie(n.content.value, o.registry), l()) throw Error("Component unmounted during save");
423
+ let e = await n.save();
424
+ if (l()) throw Error("Component unmounted during save");
425
+ a.initSnapshotHistory(), a.snapshotHistoryInstance.value?.loadSnapshots();
426
+ let r = await s.exportHtml(e.id);
427
+ if (l()) throw Error("Component unmounted during save");
428
+ let i = {
429
+ templateId: e.id,
430
+ html: r.html,
431
+ mjml: r.mjml,
432
+ content: e.content
433
+ };
434
+ return t.onSave?.(i), c.saveStatus.value = "saved", c.startSaveStatusClear(), i;
435
+ } catch (e) {
436
+ throw l() || (c.saveStatus.value = "error", c.saveErrorMessage.value = e instanceof Error ? e.message : "Save failed"), e;
437
+ } finally {
438
+ l() || (c.isSaveExporting.value = !1);
439
+ }
440
+ }
441
+ return {
442
+ createTemplate: d,
443
+ loadTemplate: f,
444
+ saveTemplate: p
445
+ };
446
+ }
447
+ //#endregion
448
+ //#region src/cloud/composables/useCloudSaveGate.ts
449
+ function Re(t) {
450
+ let n = e(!1), r = null, i = S(() => t.planConfig.value?.accessibility?.blockOnError === !0), a = S(() => i.value ? t.issues.value.filter((e) => e.severity === "error") : []), o = S(() => a.value.length > 0);
451
+ async function s(e) {
452
+ return o.value ? (r = e, n.value = !0, !1) : (await e(), !0);
453
+ }
454
+ async function c() {
455
+ let e = r;
456
+ r = null, n.value = !1, e && await e();
457
+ }
458
+ function l() {
459
+ r = null, n.value = !1;
460
+ }
461
+ return {
462
+ shouldBlock: o,
463
+ blockingIssues: a,
464
+ modalOpen: n,
465
+ tryRunSave: s,
466
+ confirmAndSave: c,
467
+ cancel: l
468
+ };
469
+ }
470
+ //#endregion
471
+ //#region src/cloud/components/CloudSaveGateModal.vue?vue&type=script&setup=true&lang.ts
472
+ var ze = ["aria-label"], Be = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl:max-w-md tpl:flex-col tpl:gap-4 tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-5 tpl:shadow-[var(--tpl-shadow-md)]" }, Ve = { class: "tpl:flex tpl:items-center tpl:gap-2" }, He = { class: "tpl:m-0 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Ue = { class: "tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, We = { class: "tpl:m-0 tpl:flex tpl:max-h-64 tpl:list-none tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-2" }, Ge = { class: "tpl:text-xs tpl:text-[var(--tpl-text)]" }, Ke = { class: "tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, qe = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Je = /* @__PURE__ */ s({
473
+ __name: "CloudSaveGateModal",
474
+ props: {
475
+ open: { type: Boolean },
476
+ issues: {}
477
+ },
478
+ emits: ["cancel", "confirm"],
479
+ setup(e, { emit: t }) {
480
+ let i = t, { t: o } = k();
481
+ return (t, s) => (a(), _(x, {
482
+ "enter-active-class": "tpl:transition-opacity tpl:duration-150",
483
+ "leave-active-class": "tpl:transition-opacity tpl:duration-150",
484
+ "enter-from-class": "tpl:opacity-0",
485
+ "leave-to-class": "tpl:opacity-0"
486
+ }, {
487
+ default: r(() => [e.open ? (a(), u("div", {
488
+ key: 0,
489
+ role: "dialog",
490
+ "aria-modal": "true",
491
+ "aria-label": d(o).saveGate.title,
492
+ class: "tpl:fixed tpl:inset-0 tpl:z-50 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/40 tpl:p-6",
493
+ onClick: s[2] ||= T((e) => i("cancel"), ["self"])
494
+ }, [b("div", Be, [
495
+ b("header", Ve, [f(d(K), {
496
+ size: 18,
497
+ "stroke-width": 2,
498
+ class: "tpl:text-[var(--tpl-warning)]"
499
+ }), b("h2", He, y(d(o).saveGate.title), 1)]),
500
+ b("p", Ue, y(d(o).saveGate.body), 1),
501
+ b("ul", We, [(a(!0), u(h, null, n(e.issues, (e) => (a(), u("li", {
502
+ key: `${e.ruleId}-${e.blockId ?? "template"}`,
503
+ class: "tpl:flex tpl:flex-col tpl:gap-0.5 tpl:rounded tpl:px-2 tpl:py-1.5"
504
+ }, [b("span", Ge, y(e.message), 1), b("span", Ke, y(e.ruleId), 1)]))), 128))]),
505
+ b("footer", qe, [b("button", {
506
+ type: "button",
507
+ class: "tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]",
508
+ onClick: s[0] ||= (e) => i("cancel")
509
+ }, y(d(o).saveGate.cancel), 1), b("button", {
510
+ type: "button",
511
+ class: "tpl:rounded-md tpl:bg-[var(--tpl-danger)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white",
512
+ onClick: s[1] ||= (e) => i("confirm")
513
+ }, y(d(o).saveGate.confirm), 1)])
514
+ ])], 8, ze)) : g("", !0)]),
515
+ _: 1
516
+ }));
517
+ }
518
+ }), Ye = {
519
+ class: "tpl-header tpl:absolute tpl:top-0 tpl:right-0 tpl:left-0 tpl:z-50 tpl:grid tpl:h-14 tpl:grid-cols-[1fr_auto_1fr] tpl:items-center tpl:px-4",
520
+ style: {
521
+ "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)",
522
+ "backdrop-filter": "blur(12px)",
523
+ "-webkit-backdrop-filter": "blur(12px)",
524
+ "box-shadow": "var(--tpl-shadow-md)",
525
+ "border-bottom": "1px solid var(--tpl-border)"
526
+ }
527
+ }, Xe = { class: "tpl-header-left tpl:flex tpl:min-w-[200px] tpl:items-center tpl:gap-3" }, Ze = {
528
+ key: 0,
529
+ class: "tpl:text-xs tpl:opacity-60 tpl:text-[var(--tpl-text-muted)]"
530
+ }, Qe = { class: "tpl-header-center tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, $e = { class: "tpl-header-right tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, et = ["data-tooltip"], tt = {
531
+ key: 1,
532
+ "aria-live": "polite",
533
+ class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-success)]"
534
+ }, nt = {
535
+ key: 2,
536
+ "aria-live": "polite",
537
+ class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
538
+ }, rt = ["aria-label", "aria-expanded"], it = {
539
+ key: 0,
540
+ class: "tpl:inline-flex tpl:size-4.5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[10px] tpl:font-semibold tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]"
541
+ }, at = ["aria-expanded"], ot = {
542
+ key: 0,
543
+ class: "tpl:absolute tpl:right-0 tpl:top-full tpl:z-50 tpl:mt-1 tpl:origin-top-right"
544
+ }, st = ["disabled"], ct = ["disabled"], lt = /* @__PURE__ */ s({
545
+ __name: "CloudHeader",
546
+ props: {
547
+ editor: {},
548
+ core: {},
549
+ featureFlags: {},
550
+ panelState: {},
551
+ snapshotPreview: {},
552
+ commentsInstance: {},
553
+ testEmail: {},
554
+ websocket: {},
555
+ collaboration: {},
556
+ isCollaborationEnabled: { type: Boolean },
557
+ isSaveDisabled: { type: Boolean },
558
+ isSaving: { type: Boolean }
559
+ },
560
+ emits: ["save"],
561
+ setup(e) {
562
+ let t = D(() => import("./CollaboratorBar--nO7TX6b.js")), n = D(() => import("./features-DEMb13KS.js").then((e) => e.r)), i = D(() => import("./AiFeatureMenu-qEdB2fZJ.js")), { t: o, format: s } = k();
563
+ return (c, l) => (a(), u("header", Ye, [
564
+ b("div", Xe, [e.featureFlags.templateLimit.value === null ? g("", !0) : (a(), u("span", Ze, y(d(s)(d(o).header.templatesUsed, {
565
+ used: e.featureFlags.templateCount.value,
566
+ max: e.featureFlags.templateLimit.value
567
+ })), 1))]),
568
+ b("div", Qe, [
569
+ f(we, {
570
+ viewport: e.editor.state.viewport,
571
+ onChange: e.editor.setViewport
572
+ }, null, 8, ["viewport", "onChange"]),
573
+ f(Te, {
574
+ "dark-mode": e.editor.state.darkMode,
575
+ onChange: e.editor.setDarkMode
576
+ }, null, 8, ["dark-mode", "onChange"]),
577
+ f(De, {
578
+ "preview-mode": e.editor.state.previewMode,
579
+ onChange: e.editor.setPreviewMode
580
+ }, null, 8, ["preview-mode", "onChange"]),
581
+ e.collaboration && e.isCollaborationEnabled ? (a(), _(d(t), {
582
+ key: 0,
583
+ collaborators: e.collaboration.collaborators.value,
584
+ "is-connected": e.websocket.isConnected.value
585
+ }, null, 8, ["collaborators", "is-connected"])) : g("", !0),
586
+ e.snapshotPreview.snapshotHistoryInstance.value ? (a(), _(d(n), {
587
+ key: 1,
588
+ snapshots: e.snapshotPreview.snapshotHistorySnapshots.value,
589
+ "is-loading": e.snapshotPreview.snapshotHistoryIsLoading.value,
590
+ "is-restoring": e.snapshotPreview.snapshotHistoryIsRestoring.value,
591
+ onLoad: e.snapshotPreview.loadSnapshotHistory,
592
+ onNavigate: e.snapshotPreview.handleSnapshotNavigate
593
+ }, null, 8, [
594
+ "snapshots",
595
+ "is-loading",
596
+ "is-restoring",
597
+ "onLoad",
598
+ "onNavigate"
599
+ ])) : g("", !0)
600
+ ]),
601
+ b("div", $e, [
602
+ e.featureFlags.saveStatus.value === "error" ? (a(), u("div", {
603
+ key: 0,
604
+ "aria-live": "assertive",
605
+ class: "tpl-tooltip tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]",
606
+ "data-tooltip": e.featureFlags.saveErrorMessage.value
607
+ }, [f(d(z), {
608
+ size: 12,
609
+ "stroke-width": 2.5
610
+ }), O(" " + y(d(o).header.saveFailed), 1)], 8, et)) : e.featureFlags.saveStatus.value === "saved" ? (a(), u("div", tt, [f(d(L), {
611
+ size: 12,
612
+ "stroke-width": 2.5
613
+ }), O(" " + y(d(o).header.saved), 1)])) : e.editor.state.isDirty ? (a(), u("div", nt, [l[4] ||= b("span", { class: "tpl-pulse tpl:size-1.5 tpl:rounded-full tpl:bg-[var(--tpl-primary)]" }, null, -1), O(" " + y(d(o).header.unsaved), 1)])) : g("", !0),
614
+ e.commentsInstance.isEnabled.value && e.featureFlags.hasTemplateSaved.value ? (a(), u("button", {
615
+ key: 3,
616
+ "aria-label": e.commentsInstance.unresolvedCount.value > 0 ? `${d(o).comments.button} (${e.commentsInstance.unresolvedCount.value})` : d(o).comments.button,
617
+ "aria-expanded": e.panelState.commentsOpen.value,
618
+ class: C(d($)),
619
+ style: m({
620
+ backgroundColor: e.panelState.commentsOpen.value ? "var(--tpl-primary)" : "transparent",
621
+ color: e.panelState.commentsOpen.value ? "var(--tpl-bg)" : "var(--tpl-primary)",
622
+ borderColor: "var(--tpl-primary)"
623
+ }),
624
+ onClick: l[0] ||= (t) => e.panelState.commentsOpen.value = !e.panelState.commentsOpen.value
625
+ }, [
626
+ f(d(se), {
627
+ size: 16,
628
+ "stroke-width": 2
629
+ }),
630
+ O(" " + y(d(o).comments.button) + " ", 1),
631
+ e.commentsInstance.unresolvedCount.value > 0 && !e.panelState.commentsOpen.value ? (a(), u("span", it, y(e.commentsInstance.unresolvedCount.value), 1)) : g("", !0)
632
+ ], 14, rt)) : g("", !0),
633
+ e.featureFlags.canUseAiGeneration.value && e.featureFlags.hasTemplateSaved.value ? (a(), u("div", {
634
+ key: 4,
635
+ ref: (t) => e.panelState.aiMenuRef.value = t,
636
+ class: "tpl:relative"
637
+ }, [b("button", {
638
+ "aria-expanded": e.panelState.aiMenuOpen.value,
639
+ class: C(["tpl-ai-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:whitespace-nowrap tpl:transition-all tpl:duration-200", e.panelState.aiButtonActive.value ? "tpl-ai-btn--active" : "tpl-ai-btn--idle"]),
640
+ onClick: l[1] ||= T((...t) => e.panelState.toggleAiMenu && e.panelState.toggleAiMenu(...t), ["stop"])
641
+ }, [f(d(q), {
642
+ size: 16,
643
+ "stroke-width": 2,
644
+ class: "tpl-ai-btn-icon"
645
+ }), O(" " + y(d(o).aiChat.button), 1)], 10, at), f(x, {
646
+ "enter-active-class": "tpl:transition-all tpl:duration-150 tpl:ease-out",
647
+ "enter-from-class": "tpl:scale-95 tpl:opacity-0",
648
+ "enter-to-class": "tpl:scale-100 tpl:opacity-100",
649
+ "leave-active-class": "tpl:transition-all tpl:duration-100 tpl:ease-in",
650
+ "leave-from-class": "tpl:scale-100 tpl:opacity-100",
651
+ "leave-to-class": "tpl:scale-95 tpl:opacity-0"
652
+ }, {
653
+ default: r(() => [e.panelState.aiMenuOpen.value ? (a(), u("div", ot, [f(d(i), {
654
+ "active-feature": e.panelState.activeAiFeature.value,
655
+ onSelect: e.panelState.handleAiFeatureSelect
656
+ }, null, 8, ["active-feature", "onSelect"])])) : g("", !0)]),
657
+ _: 1
658
+ })], 512)) : g("", !0),
659
+ e.testEmail.isEnabled.value && e.featureFlags.canSendTestEmail.value ? (a(), u("button", {
660
+ key: 5,
661
+ class: C(d($)),
662
+ style: {
663
+ "background-color": "transparent",
664
+ color: "var(--tpl-primary)",
665
+ "border-color": "var(--tpl-primary)"
666
+ },
667
+ disabled: e.testEmail.isSending.value || !e.featureFlags.hasTemplateSaved.value,
668
+ onClick: l[2] ||= (t) => e.panelState.testEmailModalOpen.value = !0
669
+ }, [e.testEmail.isSending.value ? (a(), _(d(Z), {
670
+ key: 1,
671
+ class: "tpl-spinner",
672
+ size: 16,
673
+ "stroke-width": 2
674
+ })) : (a(), _(d(Y), {
675
+ key: 0,
676
+ size: 16,
677
+ "stroke-width": 2
678
+ })), O(" " + y(d(o).testEmail.button), 1)], 10, st)) : g("", !0),
679
+ b("button", {
680
+ class: C(d($)),
681
+ style: {
682
+ "background-color": "transparent",
683
+ color: "var(--tpl-primary)",
684
+ "border-color": "var(--tpl-primary)"
685
+ },
686
+ disabled: e.isSaveDisabled,
687
+ onClick: l[3] ||= (e) => c.$emit("save")
688
+ }, [e.isSaving ? (a(), _(d(Z), {
689
+ key: 1,
690
+ class: "tpl-spinner",
691
+ size: 16,
692
+ "stroke-width": 2
693
+ })) : (a(), _(d(xe), {
694
+ key: 0,
695
+ size: 16,
696
+ "stroke-width": 2
697
+ })), O(" " + y(e.isSaving ? d(o).header.saving : d(o).header.save), 1)], 10, ct)
698
+ ])
699
+ ]));
700
+ }
701
+ }), ut = /* @__PURE__ */ s({
702
+ __name: "CloudPanels",
703
+ props: {
704
+ config: {},
705
+ editor: {},
706
+ core: {},
707
+ panelState: {},
708
+ planConfigInstance: {},
709
+ testEmail: {},
710
+ mediaLib: {},
711
+ savedModulesHeadless: {},
712
+ showSaveModuleDialog: { type: Boolean },
713
+ saveModulePreSelectedBlockId: {},
714
+ showModuleBrowserModal: { type: Boolean }
715
+ },
716
+ emits: [
717
+ "update:showSaveModuleDialog",
718
+ "update:saveModulePreSelectedBlockId",
719
+ "update:showModuleBrowserModal",
720
+ "send-test-email",
721
+ "module-insert"
722
+ ],
723
+ setup(t, { expose: n, emit: r }) {
724
+ let i = D(() => import("./features-DEMb13KS.js").then((e) => e.s)), o = D(() => import("./features-DEMb13KS.js").then((e) => e.o)), s = D(() => import("./features-DEMb13KS.js").then((e) => e.a)), c = D(() => import("./features-DEMb13KS.js").then((e) => e.n)), l = D(() => import("./features-DEMb13KS.js").then((e) => e.t)), p = D(() => import("./SaveModuleDialog-B0TnO_o9.js")), m = D(() => import("./ModuleBrowserModal-DxoPp81s.js")), v = D(async () => (await import("./src-CRaqN-p8.js")).MediaLibraryModal), y = r;
725
+ function b(e, t, n) {
726
+ t.history.record(), n.setContent(e), t.conditionPreview.reset();
727
+ }
728
+ function x(e, t) {
729
+ y("module-insert", e, t);
730
+ }
731
+ let S = e(null);
732
+ function C(e) {
733
+ S.value?.filterByBlock(e);
734
+ }
735
+ return n({ filterCommentsByBlock: C }), (e, n) => (a(), u(h, null, [
736
+ f(d(i), {
737
+ visible: t.panelState.aiChatOpen.value,
738
+ "on-apply": (e) => b(e, t.core, t.editor),
739
+ onClose: n[0] ||= (e) => t.panelState.aiChatOpen.value = !1
740
+ }, null, 8, ["visible", "on-apply"]),
741
+ f(d(c), {
742
+ visible: t.panelState.scoringPanelOpen.value,
743
+ onClose: n[1] ||= (e) => t.panelState.scoringPanelOpen.value = !1
744
+ }, null, 8, ["visible"]),
745
+ f(d(s), {
746
+ visible: t.panelState.designReferenceOpen.value,
747
+ "has-existing-blocks": t.editor.content.value.blocks.length > 0,
748
+ onClose: n[2] ||= (e) => t.panelState.designReferenceOpen.value = !1,
749
+ onApply: n[3] ||= (e) => b(e, t.core, t.editor)
750
+ }, null, 8, ["visible", "has-existing-blocks"]),
751
+ f(d(o), {
752
+ ref_key: "commentsSidebar",
753
+ ref: S,
754
+ visible: t.panelState.commentsOpen.value,
755
+ onClose: n[4] ||= (e) => t.panelState.commentsOpen.value = !1
756
+ }, null, 8, ["visible"]),
757
+ f(d(l), {
758
+ visible: t.panelState.testEmailModalOpen.value,
759
+ "allowed-emails": t.testEmail.allowedEmails.value,
760
+ "is-sending": t.testEmail.isSending.value,
761
+ error: t.testEmail.error.value,
762
+ onSend: n[5] ||= (e) => y("send-test-email", e),
763
+ onClose: n[6] ||= (e) => t.panelState.testEmailModalOpen.value = !1
764
+ }, null, 8, [
765
+ "visible",
766
+ "allowed-emails",
767
+ "is-sending",
768
+ "error"
769
+ ]),
770
+ t.planConfigInstance.hasFeature("saved_modules") && t.config.modules !== !1 ? (a(), _(d(p), {
771
+ key: 0,
772
+ visible: t.showSaveModuleDialog,
773
+ "pre-selected-block-id": t.saveModulePreSelectedBlockId,
774
+ onClose: n[7] ||= (e) => {
775
+ y("update:showSaveModuleDialog", !1), y("update:saveModulePreSelectedBlockId", null);
776
+ },
777
+ onSaved: n[8] ||= (e) => t.savedModulesHeadless.loadModules()
778
+ }, null, 8, ["visible", "pre-selected-block-id"])) : g("", !0),
779
+ t.planConfigInstance.hasFeature("saved_modules") && t.config.modules !== !1 ? (a(), _(d(m), {
780
+ key: 1,
781
+ visible: t.showModuleBrowserModal,
782
+ onClose: n[9] ||= (e) => y("update:showModuleBrowserModal", !1),
783
+ onInsert: x
784
+ }, null, 8, ["visible"])) : g("", !0),
785
+ f(d(v), {
786
+ visible: t.panelState.mediaLibraryOpen.value,
787
+ accept: t.panelState.mediaLibraryAccept.value,
788
+ onSelect: t.mediaLib.handleMediaSelect,
789
+ onClose: t.mediaLib.handleMediaLibraryClose
790
+ }, null, 8, [
791
+ "visible",
792
+ "accept",
793
+ "onSelect",
794
+ "onClose"
795
+ ])
796
+ ], 64));
797
+ }
798
+ }), dt = {
799
+ key: 0,
800
+ class: "tpl-loading tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:bg-[var(--tpl-bg)]"
801
+ }, ft = { class: "tpl:flex tpl:flex-1 tpl:overflow-hidden" }, pt = { class: "tpl:flex tpl:w-12 tpl:shrink-0 tpl:flex-col tpl:items-center tpl:gap-4 tpl:py-5 tpl:border-r tpl:border-[var(--tpl-border)]" }, mt = /* @__PURE__ */ s({
802
+ __name: "CloudLoadingOverlay",
803
+ props: { visible: { type: Boolean } },
804
+ setup(e) {
805
+ return (t, r) => e.visible ? (a(), u("div", dt, [r[1] ||= E("<div class=\"tpl:flex tpl:h-14 tpl:shrink-0 tpl:items-center tpl:justify-between tpl:px-4 tpl:border-b tpl:border-[var(--tpl-border)]\"><div class=\"tpl-shimmer tpl:h-5 tpl:w-28 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl:flex tpl:gap-3\"><div class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"></div></div></div>", 1), b("div", ft, [b("div", pt, [(a(), u(h, null, n(5, (e) => b("div", {
806
+ key: e,
807
+ class: "tpl-shimmer tpl:size-7 tpl:rounded-[var(--tpl-radius-sm)]"
808
+ })), 64))]), r[0] ||= E("<div class=\"tpl:flex tpl:flex-1 tpl:items-start tpl:justify-center tpl:overflow-auto tpl:p-8 tpl:bg-[var(--tpl-canvas-bg)]\"><div class=\"tpl:w-full tpl:max-w-[600px] tpl:rounded-[var(--tpl-radius)] tpl:p-6 tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow-sm)]\"><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:h-3 tpl:w-3/4 tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-5/6 tpl:rounded\"></div></div><div class=\"tpl:py-4\"><div class=\"tpl-shimmer tpl:h-44 tpl:w-full tpl:rounded-[var(--tpl-radius-sm)]\"></div></div><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-2/3 tpl:rounded\"></div></div><div class=\"tpl:flex tpl:justify-center tpl:py-4\"><div class=\"tpl-shimmer tpl:h-10 tpl:w-36 tpl:rounded-[var(--tpl-radius-sm)]\"></div></div><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/2 tpl:rounded\"></div><div class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/3 tpl:rounded\"></div></div></div></div><div class=\"tpl:flex tpl:w-[320px] tpl:shrink-0 tpl:flex-col tpl:gap-4 tpl:p-4 tpl:border-l tpl:border-[var(--tpl-border)]\"><div class=\"tpl-shimmer tpl:h-8 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div><div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div></div>", 2)])])) : g("", !0);
809
+ }
810
+ }), ht = {
811
+ key: 0,
812
+ role: "alert",
813
+ class: "tpl-error tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-6 tpl:px-8 tpl:bg-[var(--tpl-bg)]"
814
+ }, gt = { class: "tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[var(--tpl-danger-light)]" }, _t = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:text-center" }, vt = { class: "tpl:text-lg tpl:font-semibold tpl:text-[var(--tpl-text)]" }, yt = { class: "tpl:max-w-md tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, bt = /* @__PURE__ */ s({
815
+ __name: "CloudErrorOverlay",
816
+ props: {
817
+ error: {},
818
+ visible: { type: Boolean }
819
+ },
820
+ emits: ["retry"],
821
+ setup(e, { emit: t }) {
822
+ let n = t, { t: r } = k();
823
+ function i(e) {
824
+ return "isUnauthorized" in e && e.isUnauthorized ? r.error.authFailed : "isNotFound" in e && e.isNotFound ? r.error.templateNotFound : r.error.defaultMessage;
825
+ }
826
+ function o(e) {
827
+ return "isNotFound" in e && !!e.isNotFound;
828
+ }
829
+ return (t, s) => e.visible && e.error ? (a(), u("div", ht, [
830
+ b("div", gt, [f(d(z), {
831
+ size: 32,
832
+ "stroke-width": 1.5,
833
+ class: "tpl:text-[var(--tpl-danger)]"
834
+ })]),
835
+ b("div", _t, [b("h2", vt, y(d(r).error.title), 1), b("p", yt, y(i(e.error)), 1)]),
836
+ o(e.error) ? g("", !0) : (a(), u("button", {
837
+ key: 0,
838
+ class: "tpl-btn tpl-btn-primary tpl:inline-flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
839
+ onClick: s[0] ||= (e) => n("retry")
840
+ }, y(d(r).error.retry), 1))
841
+ ])) : g("", !0);
842
+ }
843
+ }), xt = {
844
+ key: 0,
845
+ class: "tpl-preview-banner tpl:absolute tpl:top-14 tpl:right-0 tpl:left-0 tpl:z-40 tpl:flex tpl:items-center tpl:justify-center tpl:gap-4 tpl:px-4 tpl:py-3 tpl:bg-[var(--tpl-primary-light)] tpl:border-b tpl:border-[var(--tpl-primary)]"
846
+ }, St = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:text-[var(--tpl-text)]" }, Ct = { class: "tpl:flex tpl:items-center tpl:gap-2" }, wt = /* @__PURE__ */ s({
847
+ __name: "SnapshotPreviewBanner",
848
+ props: { visible: { type: Boolean } },
849
+ emits: ["cancel", "confirm"],
850
+ setup(e, { emit: t }) {
851
+ let n = t, { t: r } = k();
852
+ return (t, i) => e.visible ? (a(), u("div", xt, [b("div", St, [f(d(_e), {
853
+ size: 18,
854
+ "stroke-width": 2,
855
+ class: "tpl:text-[var(--tpl-primary)]"
856
+ }), b("span", null, y(d(r).snapshotPreview.message), 1)]), b("div", Ct, [b("button", {
857
+ class: "tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:text-[var(--tpl-text-muted)] tpl:border tpl:border-[var(--tpl-border)]",
858
+ style: { "background-color": "transparent" },
859
+ onClick: i[0] ||= (e) => n("cancel")
860
+ }, y(d(r).snapshotPreview.cancel), 1), b("button", {
861
+ class: "tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
862
+ onClick: i[1] ||= (e) => n("confirm")
863
+ }, y(d(r).snapshotPreview.restore), 1)])])) : g("", !0);
864
+ }
865
+ }), Tt = {
866
+ key: 0,
867
+ role: "status",
868
+ "aria-live": "polite",
869
+ class: "tpl:absolute tpl:top-16 tpl:left-1/2 tpl:z-toast tpl:-translate-x-1/2 tpl:rounded-[var(--tpl-radius)] tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:shadow-lg",
870
+ style: {
871
+ "background-color": "var(--tpl-warning-light)",
872
+ color: "var(--tpl-text)",
873
+ border: "1px solid var(--tpl-warning)"
874
+ }
875
+ }, Et = /* @__PURE__ */ s({
876
+ __name: "CollabUndoToast",
877
+ props: { visible: { type: Boolean } },
878
+ setup(e) {
879
+ let { t } = I();
880
+ return (n, r) => e.visible ? (a(), u("div", Tt, y(d(t).history.collabWarning), 1)) : g("", !0);
881
+ }
882
+ }), Dt = ["data-tpl-theme"], Ot = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, kt = { class: "tpl-main tpl:flex tpl:justify-center tpl:p-8" }, At = ["aria-label"], jt = /* @__PURE__ */ me(/* @__PURE__ */ s({
883
+ __name: "CloudEditor",
884
+ props: {
885
+ config: {},
886
+ translations: {},
887
+ cloudTranslations: {},
888
+ fontsManager: {}
889
+ },
890
+ emits: ["ready"],
891
+ setup(t, { expose: n, emit: s }) {
892
+ let l = t;
893
+ o(B, l.cloudTranslations);
894
+ let h = s, S = e(null), w = Fe({
895
+ config: l.config,
896
+ translations: l.translations,
897
+ fontsManager: l.fontsManager,
898
+ emit: h,
899
+ getCommentsSidebar: () => S.value ? { filterByBlock: S.value.filterCommentsByBlock } : null
900
+ }), { isInitializing: T, isAuthReady: E, initError: D, planConfigInstance: k, websocket: A, collaboration: j, isCollaborationEnabled: M, editor: N, core: P, featureFlags: F, mediaLib: ee, exporter: I, testEmail: L, commentsInstance: te, savedModulesHeadless: R, panelState: z, snapshotPreview: V, collabWarning: ne, showSaveModuleDialog: H, showModuleBrowserModal: U, saveModulePreSelectedBlockId: W, setThemeOverrides: K, setUiTheme: re } = w;
901
+ async function ie(e) {
902
+ try {
903
+ await L.sendTestEmail(e), z.testEmailModalOpen.value = !1;
904
+ } catch {}
905
+ }
906
+ function q(e, t) {
907
+ for (let n = 0; n < e.content.length; n++) {
908
+ let r = G(e.content[n]), i = t === void 0 ? void 0 : t + n;
909
+ N.addBlock(r, void 0, void 0, i);
910
+ }
911
+ U.value = !1;
912
+ }
913
+ let J = Le({
914
+ config: l.config,
915
+ editor: N,
916
+ websocket: A,
917
+ planConfigInstance: k,
918
+ snapshotPreview: V,
919
+ core: P,
920
+ exporter: I,
921
+ featureFlags: F,
922
+ isDestroyed: w.isDestroyed
923
+ }), Y = Re({
924
+ issues: P.accessibilityLint ? P.accessibilityLint.issues : e([]),
925
+ planConfig: k.config
926
+ });
927
+ async function X() {
928
+ await Y.tryRunSave(() => J.saveTemplate().catch((e) => l.config.onError?.(e)));
929
+ }
930
+ return w.onSaveHook.value = X, v(() => {
931
+ w.initialize();
932
+ }), i(() => {
933
+ w.destroy();
934
+ }), n({
935
+ getContent: () => N.content.value,
936
+ setContent: (e) => N.setContent(e),
937
+ setTheme: re,
938
+ setThemeOverrides: K,
939
+ create: J.createTemplate,
940
+ load: J.loadTemplate,
941
+ save: J.saveTemplate,
942
+ sendTestEmail: L.sendTestEmail
943
+ }), (e, n) => (a(), u("div", {
944
+ class: C(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": d(N).state.darkMode }]),
945
+ "data-tpl-theme": d(P).resolvedTheme.value,
946
+ style: m(d(P).themeStyles.value)
947
+ }, [
948
+ f(x, {
949
+ "enter-active-class": "tpl:transition-opacity tpl:duration-200",
950
+ "enter-from-class": "tpl:opacity-100",
951
+ "enter-to-class": "tpl:opacity-100",
952
+ "leave-active-class": "tpl:transition-opacity tpl:duration-300",
953
+ "leave-from-class": "tpl:opacity-100",
954
+ "leave-to-class": "tpl:opacity-0"
955
+ }, {
956
+ default: r(() => [f(mt, { visible: d(T) || d(N).state.isLoading }, null, 8, ["visible"])]),
957
+ _: 1
958
+ }),
959
+ f(x, {
960
+ "enter-active-class": "tpl:transition-opacity tpl:duration-200",
961
+ "enter-from-class": "tpl:opacity-0",
962
+ "enter-to-class": "tpl:opacity-100",
963
+ "leave-active-class": "tpl:transition-opacity tpl:duration-300",
964
+ "leave-from-class": "tpl:opacity-100",
965
+ "leave-to-class": "tpl:opacity-0"
966
+ }, {
967
+ default: r(() => [f(bt, {
968
+ error: d(D),
969
+ visible: !!d(D) && !d(T),
970
+ onRetry: d(w).initialize
971
+ }, null, 8, [
972
+ "error",
973
+ "visible",
974
+ "onRetry"
975
+ ])]),
976
+ _: 1
977
+ }),
978
+ f(lt, {
979
+ editor: d(N),
980
+ core: d(P),
981
+ "feature-flags": d(F),
982
+ "panel-state": d(z),
983
+ "snapshot-preview": d(V),
984
+ "comments-instance": d(te),
985
+ "test-email": d(L),
986
+ websocket: d(A),
987
+ collaboration: d(j),
988
+ "is-collaboration-enabled": d(M),
989
+ "is-saving": d(N).state.isSaving || d(F).isSaveExporting.value,
990
+ "is-save-disabled": d(N).state.isSaving || d(F).isSaveExporting.value || !d(N).state.isDirty,
991
+ onSave: X
992
+ }, null, 8, [
993
+ "editor",
994
+ "core",
995
+ "feature-flags",
996
+ "panel-state",
997
+ "snapshot-preview",
998
+ "comments-instance",
999
+ "test-email",
1000
+ "websocket",
1001
+ "collaboration",
1002
+ "is-collaboration-enabled",
1003
+ "is-saving",
1004
+ "is-save-disabled"
1005
+ ]),
1006
+ f(Je, {
1007
+ open: d(Y).modalOpen.value,
1008
+ issues: d(Y).blockingIssues.value,
1009
+ onCancel: d(Y).cancel,
1010
+ onConfirm: d(Y).confirmAndSave
1011
+ }, null, 8, [
1012
+ "open",
1013
+ "issues",
1014
+ "onCancel",
1015
+ "onConfirm"
1016
+ ]),
1017
+ f(wt, {
1018
+ visible: d(V).isPreviewingSnapshot.value,
1019
+ onCancel: d(V).cancelPreview,
1020
+ onConfirm: d(V).confirmRestoreSnapshot
1021
+ }, null, 8, [
1022
+ "visible",
1023
+ "onCancel",
1024
+ "onConfirm"
1025
+ ]),
1026
+ f(x, {
1027
+ "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
1028
+ "enter-from-class": "tpl:translate-y-[-8px] tpl:opacity-0",
1029
+ "enter-to-class": "tpl:translate-y-0 tpl:opacity-100",
1030
+ "leave-active-class": "tpl:transition-all tpl:duration-300 tpl:ease-in",
1031
+ "leave-from-class": "tpl:translate-y-0 tpl:opacity-100",
1032
+ "leave-to-class": "tpl:translate-y-[-8px] tpl:opacity-0"
1033
+ }, {
1034
+ default: r(() => [f(Et, { visible: d(ne).collabUndoWarningVisible.value }, null, 8, ["visible"])]),
1035
+ _: 1
1036
+ }),
1037
+ c(f(Ee, null, null, 512), [[p, !d(N).state.previewMode]]),
1038
+ b("div", {
1039
+ class: C(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [d(N).state.previewMode ? "tpl:left-0 tpl:right-0" : d(z).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]", d(V).isPreviewingSnapshot.value ? "tpl:top-[104px]" : "tpl:top-14"]]),
1040
+ style: {
1041
+ transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
1042
+ "background-color": "var(--tpl-canvas-bg)"
1043
+ }
1044
+ }, [b("div", Ot, [f(x, { name: "tpl-restore-btn" }, {
1045
+ default: r(() => [d(P).conditionPreview.hasHiddenBlocks.value ? (a(), u("button", {
1046
+ key: 0,
1047
+ class: "tpl:absolute tpl:left-1/2 tpl:top-2 tpl:-translate-x-1/2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-full tpl:border tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:whitespace-nowrap tpl:shadow-md tpl:hover:opacity-80",
1048
+ style: {
1049
+ "background-color": "var(--tpl-warning-light)",
1050
+ color: "var(--tpl-warning)",
1051
+ "border-color": "var(--tpl-warning)",
1052
+ "backdrop-filter": "blur(8px)"
1053
+ },
1054
+ onClick: n[0] ||= (e) => d(P).conditionPreview.reset()
1055
+ }, [f(d(be), {
1056
+ size: 13,
1057
+ "stroke-width": 2
1058
+ }), O(" " + y(d(P).t.blockSettings.restoreHiddenBlocks), 1)])) : g("", !0)]),
1059
+ _: 1
1060
+ })]), b("main", kt, [f(Oe, {
1061
+ viewport: d(N).state.viewport,
1062
+ content: d(N).content.value,
1063
+ "selected-block-id": d(N).state.selectedBlockId,
1064
+ "dark-mode": d(N).state.darkMode,
1065
+ "preview-mode": d(N).state.previewMode,
1066
+ "locked-blocks": d(j)?.lockedBlocks.value ?? void 0,
1067
+ onSelectBlock: d(N).selectBlock,
1068
+ onOpenAiChat: n[1] ||= (e) => d(z).aiChatOpen.value = !0,
1069
+ onOpenDesignReference: n[2] ||= (e) => d(z).designReferenceOpen.value = !0
1070
+ }, null, 8, [
1071
+ "viewport",
1072
+ "content",
1073
+ "selected-block-id",
1074
+ "dark-mode",
1075
+ "preview-mode",
1076
+ "locked-blocks",
1077
+ "onSelectBlock"
1078
+ ])])], 2),
1079
+ t.config.branding !== !1 && !d(F).isWhiteLabeled.value ? (a(), _(ke, {
1080
+ key: 0,
1081
+ "position-class": [d(N).state.previewMode ? "tpl:left-0 tpl:right-0" : d(z).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]"]
1082
+ }, null, 8, ["position-class"])) : g("", !0),
1083
+ b("div", {
1084
+ class: "tpl-sr-only",
1085
+ role: "status",
1086
+ "aria-live": "polite",
1087
+ "aria-atomic": "true",
1088
+ "aria-label": d(P).t.landmarks.reorderAnnouncements
1089
+ }, y(d(P).keyboardReorder.announcement.value), 9, At),
1090
+ c(f(Se, {
1091
+ "selected-block": d(N).selectedBlock.value,
1092
+ settings: d(N).content.value.settings,
1093
+ "shifted-left": d(z).rightPanelOpen.value,
1094
+ onUpdateBlock: n[3] ||= (e) => d(N).updateBlock(d(N).selectedBlock.value.id, e),
1095
+ onDeleteBlock: n[4] ||= (e) => d(P).blockActions.deleteBlock(d(N).selectedBlock.value.id),
1096
+ onDuplicateBlock: n[5] ||= (e) => d(P).blockActions.duplicateBlock(d(N).selectedBlock.value),
1097
+ onUpdateSettings: d(N).updateSettings
1098
+ }, null, 8, [
1099
+ "selected-block",
1100
+ "settings",
1101
+ "shifted-left",
1102
+ "onUpdateSettings"
1103
+ ]), [[p, !d(N).state.previewMode]]),
1104
+ !d(T) && d(E) ? (a(), _(ut, {
1105
+ key: 1,
1106
+ ref_key: "cloudPanelsRef",
1107
+ ref: S,
1108
+ config: l.config,
1109
+ editor: d(N),
1110
+ core: d(P),
1111
+ "panel-state": d(z),
1112
+ "plan-config-instance": d(k),
1113
+ "test-email": d(L),
1114
+ "media-lib": d(ee),
1115
+ "saved-modules-headless": d(R),
1116
+ "show-save-module-dialog": d(H),
1117
+ "save-module-pre-selected-block-id": d(W),
1118
+ "show-module-browser-modal": d(U),
1119
+ "onUpdate:showSaveModuleDialog": n[6] ||= (e) => H.value = e,
1120
+ "onUpdate:saveModulePreSelectedBlockId": n[7] ||= (e) => W.value = e,
1121
+ "onUpdate:showModuleBrowserModal": n[8] ||= (e) => U.value = e,
1122
+ onSendTestEmail: ie,
1123
+ onModuleInsert: q
1124
+ }, null, 8, [
1125
+ "config",
1126
+ "editor",
1127
+ "core",
1128
+ "panel-state",
1129
+ "plan-config-instance",
1130
+ "test-email",
1131
+ "media-lib",
1132
+ "saved-modules-headless",
1133
+ "show-save-module-dialog",
1134
+ "save-module-pre-selected-block-id",
1135
+ "show-module-browser-modal"
1136
+ ])) : g("", !0)
1137
+ ], 14, Dt));
1138
+ }
1139
+ }), [["__scopeId", "data-v-b332971f"]]);
1140
+ //#endregion
1141
+ export { jt as default };
1142
+
1143
+ //# sourceMappingURL=CloudEditor-D2GsEC_n.js.map