@aswin.dev/editor 0.7.0 → 0.7.1

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