@templatical/editor 0.56.0 → 0.56.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 (171) hide show
  1. package/dist/{AiAltTextPopover-DdsvhE78.js → AiAltTextPopover-CpZ7UeAZ.js} +3 -3
  2. package/dist/{AiAltTextReview-P6to1_0t.js → AiAltTextReview-LYxvn7Qe.js} +4 -4
  3. package/dist/{AiChatPanel-BSlmzMRC.js → AiChatPanel-Cy05P-iO.js} +53 -53
  4. package/dist/{AiPanels-DAsnX-a3.js → AiPanels-CwKmXzyr.js} +1 -1
  5. package/dist/{AiRewriteMenu-DIISOR6U.js → AiRewriteMenu-DgqJHnza.js} +8 -8
  6. package/dist/{BlockIssueBadge-Bmtc50BQ.js → BlockIssueBadge-CxHJmuOh.js} +3 -3
  7. package/dist/{BlockPreviewCanvas-BYIzNn-9.js → BlockPreviewCanvas-DEmNZkEG.js} +44 -44
  8. package/dist/{CloudPanels-w34W8_BP.js → CloudPanels-Bmlf05Il.js} +11 -11
  9. package/dist/{CollaborationNotices-HTbCebjV.js → CollaborationNotices-C27GCMvK.js} +7 -7
  10. package/dist/{CommentsPanel-C5qG17Ki.js → CommentsPanel-B5NqPMmY.js} +1 -1
  11. package/dist/{CommentsSidebar-C7CWcUYZ.js → CommentsSidebar-BDrcrDxS.js} +42 -42
  12. package/dist/{CountdownBlock-BTXcCvjZ.js → CountdownBlock-D8dqjm3F.js} +6 -6
  13. package/dist/{CountdownToolbar-CP-pkntQ.js → CountdownToolbar-IjpCOjCd.js} +30 -30
  14. package/dist/{IssuesPanel-CiiNBzH0.js → IssuesPanel-uwuzeMSW.js} +87 -87
  15. package/dist/LanguageMenu-C-eQ0lFy.js +403 -0
  16. package/dist/{LocaleNotices-CTCZ7BYv.js → LocaleNotices-CDK_9D7P.js} +8 -8
  17. package/dist/{LogicTagInsertButton-DEOPc4RC.js → LogicTagInsertButton-BSolF7Fd.js} +3 -3
  18. package/dist/{MediaEditModal-DJsPLTwP.js → MediaEditModal-C8yc9dxt.js} +7 -7
  19. package/dist/{MediaPanels-D2WD2aE2.js → MediaPanels-FI4I8asn.js} +1 -1
  20. package/dist/{MergeTagInput-C9icdxw7.js → MergeTagInput-B1nl2ZMT.js} +12 -12
  21. package/dist/{MergeTagTextarea-CrAcmT3A.js → MergeTagTextarea-DJlf3VbS.js} +1 -1
  22. package/dist/{ParagraphEditor-BWBQ3jKz.js → ParagraphEditor-Dqco128s.js} +156 -156
  23. package/dist/{RestoreVersionDialog-CqAp16yQ.js → RestoreVersionDialog-hqLCuGV5.js} +12 -12
  24. package/dist/{RichTextEditorContent-xbBjVPVQ.js → RichTextEditorContent-xIEF0Y3Z.js} +2 -2
  25. package/dist/{SaveBlockDialog-pebNJBTc.js → SaveBlockDialog-CQlCP_XC.js} +46 -46
  26. package/dist/{SavedBlocksBrowserModal-CvagMcv7.js → SavedBlocksBrowserModal-BXA32Fx6.js} +23 -23
  27. package/dist/{SavedBlocksPanels-B9AAVBDm.js → SavedBlocksPanels-BKUzbamj.js} +1 -1
  28. package/dist/{SavedBlocksPickBar-BIANWe3i.js → SavedBlocksPickBar-BlvF-4UF.js} +9 -9
  29. package/dist/{TemplateSettings-ORq4PbCN.js → TemplateSettings-CYFtR8zv.js} +41 -41
  30. package/dist/{TestEmailModal-DRjCpcPl.js → TestEmailModal-BbaL17HO.js} +20 -20
  31. package/dist/{TestEmailPanel-H0v8El__.js → TestEmailPanel-DhB1CSpg.js} +1 -1
  32. package/dist/{TitleEditor-CEGbJXeU.js → TitleEditor-3BRl8u5l.js} +21 -21
  33. package/dist/{Toolbar-XT-uGA9J.js → Toolbar-pzNIakGM.js} +656 -656
  34. package/dist/{TplModal-7NQq5-VW.js → TplModal-WNuWhHZm.js} +4 -4
  35. package/dist/{VersionHistoryMenu-C8BE3Pr-.js → VersionHistoryMenu--T-Qp_mH.js} +15 -15
  36. package/dist/{VersionHistoryPanels-CuKuOSJG.js → VersionHistoryPanels-BPubvYIE.js} +1 -1
  37. package/dist/{VersionPreviewBanner-BVFBkveR.js → VersionPreviewBanner-ClL3Wkln.js} +7 -7
  38. package/dist/{WrapperBlock-Bdw-072t.js → WrapperBlock-CjfCPceb.js} +11 -11
  39. package/dist/{blockTypeIcons-CGplGmmr.js → blockTypeIcons-12OMwVyN.js} +1 -1
  40. package/dist/bundle-stats.json +6 -6
  41. package/dist/cdn/chunks/{AiAltTextPopover-x999Gimz.js → AiAltTextPopover-PFjTrl0y.js} +4 -4
  42. package/dist/cdn/chunks/{AiAltTextPopover-x999Gimz.js.map → AiAltTextPopover-PFjTrl0y.js.map} +1 -1
  43. package/dist/cdn/chunks/{AiAltTextReview-DjnFz1wO.js → AiAltTextReview-BMjzvApH.js} +5 -5
  44. package/dist/cdn/chunks/{AiAltTextReview-DjnFz1wO.js.map → AiAltTextReview-BMjzvApH.js.map} +1 -1
  45. package/dist/cdn/chunks/{AiChatPanel-DKDu9cs7.js → AiChatPanel-C2gpq4kP.js} +107 -107
  46. package/dist/cdn/chunks/{AiChatPanel-DKDu9cs7.js.map → AiChatPanel-C2gpq4kP.js.map} +1 -1
  47. package/dist/cdn/chunks/{AiPanels-jMLVaiKx.js → AiPanels-Cx3PE2mE.js} +2 -2
  48. package/dist/cdn/chunks/{AiPanels-jMLVaiKx.js.map → AiPanels-Cx3PE2mE.js.map} +1 -1
  49. package/dist/cdn/chunks/{AiRewriteMenu-s79rmHFy.js → AiRewriteMenu-CnkyjPEu.js} +11 -11
  50. package/dist/cdn/chunks/{AiRewriteMenu-s79rmHFy.js.map → AiRewriteMenu-CnkyjPEu.js.map} +1 -1
  51. package/dist/cdn/chunks/{BlockIssueBadge-Bnmq_M4G.js → BlockIssueBadge-DncZ-HDf.js} +4 -4
  52. package/dist/cdn/chunks/{BlockIssueBadge-Bnmq_M4G.js.map → BlockIssueBadge-DncZ-HDf.js.map} +1 -1
  53. package/dist/cdn/chunks/BlockPreviewCanvas-CCSEzL46.js +156 -0
  54. package/dist/cdn/chunks/{BlockPreviewCanvas-B3HkuENF.js.map → BlockPreviewCanvas-CCSEzL46.js.map} +1 -1
  55. package/dist/cdn/chunks/{CloudPanels-DQnlH_YJ.js → CloudPanels-CRztnw4M.js} +2 -2
  56. package/dist/cdn/chunks/{CloudPanels-DQnlH_YJ.js.map → CloudPanels-CRztnw4M.js.map} +1 -1
  57. package/dist/cdn/chunks/{CollaborationNotices-CHqUGhOZ.js → CollaborationNotices-IuLYT2x7.js} +8 -8
  58. package/dist/cdn/chunks/{CollaborationNotices-CHqUGhOZ.js.map → CollaborationNotices-IuLYT2x7.js.map} +1 -1
  59. package/dist/cdn/chunks/{CommentsPanel-EtdTzTmq.js → CommentsPanel-lgjJNrrY.js} +2 -2
  60. package/dist/cdn/chunks/{CommentsPanel-EtdTzTmq.js.map → CommentsPanel-lgjJNrrY.js.map} +1 -1
  61. package/dist/cdn/chunks/{CommentsSidebar-Qmj049QX.js → CommentsSidebar-DTold7iy.js} +214 -214
  62. package/dist/cdn/chunks/{CommentsSidebar-Qmj049QX.js.map → CommentsSidebar-DTold7iy.js.map} +1 -1
  63. package/dist/cdn/chunks/{CountdownBlock-DyGsh92b.js → CountdownBlock-8aPSExrv.js} +7 -7
  64. package/dist/cdn/chunks/{CountdownBlock-DyGsh92b.js.map → CountdownBlock-8aPSExrv.js.map} +1 -1
  65. package/dist/cdn/chunks/{CountdownToolbar-Ddj2erNm.js → CountdownToolbar-CnWQEW5g.js} +50 -50
  66. package/dist/cdn/chunks/{CountdownToolbar-Ddj2erNm.js.map → CountdownToolbar-CnWQEW5g.js.map} +1 -1
  67. package/dist/cdn/chunks/{IssuesPanel-DnSnEh1X.js → IssuesPanel-CrplCzo8.js} +11 -11
  68. package/dist/cdn/chunks/{IssuesPanel-DnSnEh1X.js.map → IssuesPanel-CrplCzo8.js.map} +1 -1
  69. package/dist/cdn/chunks/{LanguageMenu-C2I_yTL5.js → LanguageMenu-B6MNInCL.js} +110 -110
  70. package/dist/cdn/chunks/{LanguageMenu-C2I_yTL5.js.map → LanguageMenu-B6MNInCL.js.map} +1 -1
  71. package/dist/cdn/chunks/{LocaleNotices-Dr9LRCAg.js → LocaleNotices-TxeAl8Iq.js} +9 -9
  72. package/dist/cdn/chunks/{LocaleNotices-Dr9LRCAg.js.map → LocaleNotices-TxeAl8Iq.js.map} +1 -1
  73. package/dist/cdn/chunks/{LogicTagInsertButton-BdzE9-l7.js → LogicTagInsertButton-DvSVx2DB.js} +4 -4
  74. package/dist/cdn/chunks/{LogicTagInsertButton-BdzE9-l7.js.map → LogicTagInsertButton-DvSVx2DB.js.map} +1 -1
  75. package/dist/cdn/chunks/{MediaEditModal-CMJFXu_o.js → MediaEditModal-tGK6htBl.js} +8 -8
  76. package/dist/cdn/chunks/{MediaEditModal-CMJFXu_o.js.map → MediaEditModal-tGK6htBl.js.map} +1 -1
  77. package/dist/cdn/chunks/{MediaPanels-C790ZXuY.js → MediaPanels-BVrQYz2C.js} +2 -2
  78. package/dist/cdn/chunks/{MediaPanels-C790ZXuY.js.map → MediaPanels-BVrQYz2C.js.map} +1 -1
  79. package/dist/cdn/chunks/{MergeTagInput-CmrX8Md6.js → MergeTagInput-DeuNH3re.js} +13 -13
  80. package/dist/cdn/chunks/{MergeTagInput-CmrX8Md6.js.map → MergeTagInput-DeuNH3re.js.map} +1 -1
  81. package/dist/cdn/chunks/{MergeTagTextarea-KOnd2teB.js → MergeTagTextarea-B2xxIU3e.js} +2 -2
  82. package/dist/cdn/chunks/{MergeTagTextarea-KOnd2teB.js.map → MergeTagTextarea-B2xxIU3e.js.map} +1 -1
  83. package/dist/cdn/chunks/{ParagraphEditor-I9lbKaPk.js → ParagraphEditor-Bx_Hlw8d.js} +106 -106
  84. package/dist/cdn/chunks/{ParagraphEditor-I9lbKaPk.js.map → ParagraphEditor-Bx_Hlw8d.js.map} +1 -1
  85. package/dist/cdn/chunks/{RestoreVersionDialog-DqbULAbc.js → RestoreVersionDialog-CPrrWTsT.js} +12 -12
  86. package/dist/cdn/chunks/{RestoreVersionDialog-DqbULAbc.js.map → RestoreVersionDialog-CPrrWTsT.js.map} +1 -1
  87. package/dist/cdn/chunks/{RichTextEditorContent-_O22z0pn.js → RichTextEditorContent-Dze4C9VI.js} +3 -3
  88. package/dist/cdn/chunks/{RichTextEditorContent-_O22z0pn.js.map → RichTextEditorContent-Dze4C9VI.js.map} +1 -1
  89. package/dist/cdn/chunks/{SaveBlockDialog-CClRLXgF.js → SaveBlockDialog-CXVwnfsy.js} +51 -51
  90. package/dist/cdn/chunks/{SaveBlockDialog-CClRLXgF.js.map → SaveBlockDialog-CXVwnfsy.js.map} +1 -1
  91. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BIaxaxw9.js → SavedBlocksBrowserModal-BDTmenOE.js} +23 -23
  92. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BIaxaxw9.js.map → SavedBlocksBrowserModal-BDTmenOE.js.map} +1 -1
  93. package/dist/cdn/chunks/{SavedBlocksPanels-Dfu9N6YW.js → SavedBlocksPanels-B41Rk_v1.js} +2 -2
  94. package/dist/cdn/chunks/{SavedBlocksPanels-Dfu9N6YW.js.map → SavedBlocksPanels-B41Rk_v1.js.map} +1 -1
  95. package/dist/cdn/chunks/{SavedBlocksPickBar-DiMW_dbJ.js → SavedBlocksPickBar-B97z_rFH.js} +11 -11
  96. package/dist/cdn/chunks/{SavedBlocksPickBar-DiMW_dbJ.js.map → SavedBlocksPickBar-B97z_rFH.js.map} +1 -1
  97. package/dist/cdn/chunks/{TemplateSettings-JMUo0LIV.js → TemplateSettings-YwwRbxPc.js} +102 -102
  98. package/dist/cdn/chunks/{TemplateSettings-JMUo0LIV.js.map → TemplateSettings-YwwRbxPc.js.map} +1 -1
  99. package/dist/cdn/chunks/{TestEmailModal-D52VtwBZ.js → TestEmailModal-BiFP2Cbx.js} +20 -20
  100. package/dist/cdn/chunks/{TestEmailModal-D52VtwBZ.js.map → TestEmailModal-BiFP2Cbx.js.map} +1 -1
  101. package/dist/cdn/chunks/{TestEmailPanel-D9ezVDHd.js → TestEmailPanel-BrivPMk2.js} +2 -2
  102. package/dist/cdn/chunks/{TestEmailPanel-D9ezVDHd.js.map → TestEmailPanel-BrivPMk2.js.map} +1 -1
  103. package/dist/cdn/chunks/{TitleEditor-D04vvbUc.js → TitleEditor-CzPkkL2s.js} +19 -19
  104. package/dist/cdn/chunks/{TitleEditor-D04vvbUc.js.map → TitleEditor-CzPkkL2s.js.map} +1 -1
  105. package/dist/cdn/chunks/{Toolbar-C_Hfsher.js → Toolbar-VH07SzX7.js} +550 -550
  106. package/dist/cdn/chunks/{Toolbar-C_Hfsher.js.map → Toolbar-VH07SzX7.js.map} +1 -1
  107. package/dist/cdn/chunks/{TplModal-d6fEZGJ5.js → TplModal-DMe6J811.js} +6 -6
  108. package/dist/cdn/chunks/{TplModal-d6fEZGJ5.js.map → TplModal-DMe6J811.js.map} +1 -1
  109. package/dist/cdn/chunks/{VersionHistoryMenu-C8ucm43v.js → VersionHistoryMenu-DkwbKhBl.js} +15 -15
  110. package/dist/cdn/chunks/{VersionHistoryMenu-C8ucm43v.js.map → VersionHistoryMenu-DkwbKhBl.js.map} +1 -1
  111. package/dist/cdn/chunks/{VersionHistoryPanels-BAdzmhvH.js → VersionHistoryPanels-CgxhMRAl.js} +2 -2
  112. package/dist/cdn/chunks/{VersionHistoryPanels-BAdzmhvH.js.map → VersionHistoryPanels-CgxhMRAl.js.map} +1 -1
  113. package/dist/cdn/chunks/{VersionPreviewBanner-BWuovbFc.js → VersionPreviewBanner-WVBDBrwQ.js} +8 -8
  114. package/dist/cdn/chunks/{VersionPreviewBanner-BWuovbFc.js.map → VersionPreviewBanner-WVBDBrwQ.js.map} +1 -1
  115. package/dist/cdn/chunks/{WrapperBlock-TXDSDXUP.js → WrapperBlock-CCCIcqe2.js} +12 -12
  116. package/dist/cdn/chunks/{WrapperBlock-TXDSDXUP.js.map → WrapperBlock-CCCIcqe2.js.map} +1 -1
  117. package/dist/cdn/chunks/{composables-CsfQlmcf.js → composables-D3lsO7Io.js} +925 -925
  118. package/dist/cdn/chunks/composables-D3lsO7Io.js.map +1 -0
  119. package/dist/cdn/chunks/{createCloudRuntime-PpIFCDfj.js → createCloudRuntime-CE79GB1H.js} +15 -15
  120. package/dist/cdn/chunks/{createCloudRuntime-PpIFCDfj.js.map → createCloudRuntime-CE79GB1H.js.map} +1 -1
  121. package/dist/cdn/chunks/dist-Cf1pSluo.js +405 -0
  122. package/dist/cdn/chunks/{dist-DqGgijFI.js.map → dist-Cf1pSluo.js.map} +1 -1
  123. package/dist/cdn/chunks/{editor-modal-B8UE9V8B.js → editor-modal-CN69NlOK.js} +170 -170
  124. package/dist/cdn/chunks/{editor-modal-B8UE9V8B.js.map → editor-modal-CN69NlOK.js.map} +1 -1
  125. package/dist/cdn/chunks/en-Bcz4gS9U.js +1 -0
  126. package/dist/cdn/chunks/{extensions-BM6ZSnsQ.js → extensions-8dlM-fU4.js} +96 -96
  127. package/dist/cdn/chunks/{extensions-BM6ZSnsQ.js.map → extensions-8dlM-fU4.js.map} +1 -1
  128. package/dist/cdn/chunks/{sanitizeHtml-DJI7vvET.js → sanitizeHtml-B3njfkSy.js} +11 -11
  129. package/dist/cdn/chunks/{sanitizeHtml-DJI7vvET.js.map → sanitizeHtml-B3njfkSy.js.map} +1 -1
  130. package/dist/cdn/chunks/{socialIcons-Qw9rHc8C.js → socialIcons-BFgc3qqJ.js} +2 -2
  131. package/dist/cdn/chunks/{socialIcons-Qw9rHc8C.js.map → socialIcons-BFgc3qqJ.js.map} +1 -1
  132. package/dist/cdn/chunks/{src-Bfj1jHnn.js → src-GgKlXNxy.js} +2 -2
  133. package/dist/cdn/chunks/{src-Bfj1jHnn.js.map → src-GgKlXNxy.js.map} +1 -1
  134. package/dist/cdn/chunks/{tiptap-Dipw_zOQ.js → tiptap-C940SvId.js} +3 -3
  135. package/dist/cdn/chunks/{tiptap-Dipw_zOQ.js.map → tiptap-C940SvId.js.map} +1 -1
  136. package/dist/cdn/chunks/{useLogicTag-DLvWzWsp.js → useLogicTag-B0PDeDxl.js} +4 -4
  137. package/dist/cdn/chunks/{useLogicTag-DLvWzWsp.js.map → useLogicTag-B0PDeDxl.js.map} +1 -1
  138. package/dist/cdn/chunks/{useMergeTag-B4FHCGGm.js → useMergeTag-BSU75bKk.js} +7 -7
  139. package/dist/cdn/chunks/{useMergeTag-B4FHCGGm.js.map → useMergeTag-BSU75bKk.js.map} +1 -1
  140. package/dist/cdn/editor.js +325 -325
  141. package/dist/cdn/editor.js.map +1 -1
  142. package/dist/{composables-CRX6rncm.js → composables-DreAt_0A.js} +1031 -1031
  143. package/dist/{createCloudRuntime-DplyIlsy.js → createCloudRuntime-CL4tUlDC.js} +14 -14
  144. package/dist/{dist-ChOb5XHW.js → dist-0GWMyHtM.js} +1 -1
  145. package/dist/{dist-6DU0me3E.js → dist-B_0FPmoy.js} +1 -1
  146. package/dist/{dist-B8dY8drK.js → dist-BjzK1g4Z.js} +1 -1
  147. package/dist/{dist-54VCNoC0.js → dist-BsumKKh9.js} +1 -1
  148. package/dist/{dist-BWflWcpW.js → dist-C3avsUq9.js} +2 -2
  149. package/dist/{dist-fqSers8_.js → dist-CCLRTtJP.js} +197 -197
  150. package/dist/dist-CiYotUR8.js +406 -0
  151. package/dist/{dist-C3hu_C3w.js → dist-Cr1CLCmx.js} +1 -1
  152. package/dist/{dist-D_XrUEET.js → dist-CsknfjrZ.js} +3 -3
  153. package/dist/{dist-TAv500j6.js → dist-DDytHU_6.js} +1 -1
  154. package/dist/{dist-CcOn7WCo.js → dist-DKV9m4Uu.js} +1 -1
  155. package/dist/{dist-B9a7iVye.js → dist-Dq9VnANT.js} +1 -1
  156. package/dist/{dist-DZ3X-uB8.js → dist-ZrT0vAB6.js} +1 -1
  157. package/dist/{editor-modal-D9HT9bD6.js → editor-modal-BD32TXws.js} +106 -106
  158. package/dist/en-Dgs_-NBw.js +1 -0
  159. package/dist/{extensions-Cm6K4SRX.js → extensions-DKxHlSd7.js} +179 -179
  160. package/dist/{socialIcons-CJD6OsI7.js → socialIcons-oo4uL16Y.js} +1 -1
  161. package/dist/templatical-editor.js +526 -526
  162. package/dist/{useLogicTag-DLkYos2Q.js → useLogicTag-B4Zpk3eo.js} +3 -3
  163. package/dist/{useMergeTag-IoWOO679.js → useMergeTag-B5qlq8px.js} +7 -7
  164. package/package.json +7 -7
  165. package/dist/LanguageMenu-B981Av-6.js +0 -403
  166. package/dist/cdn/chunks/BlockPreviewCanvas-B3HkuENF.js +0 -156
  167. package/dist/cdn/chunks/composables-CsfQlmcf.js.map +0 -1
  168. package/dist/cdn/chunks/dist-DqGgijFI.js +0 -405
  169. package/dist/cdn/chunks/en-CVxNoHww.js +0 -1
  170. package/dist/dist-0alKVRc_.js +0 -406
  171. package/dist/en-De3uAutQ.js +0 -1
@@ -1,29 +1,29 @@
1
1
  import { A as e, B as t, C as n, E as r, F as i, G as a, H as o, I as s, K as c, L as l, M as u, N as d, O as f, P as p, Q as m, R as h, S as g, V as _, Y as v, _ as y, b, c as x, ct as S, dt as C, g as w, h as T, it as E, j as D, k as O, l as k, m as A, mt as j, n as M, nt as N, o as ee, p as P, pt as F, r as I, rt as L, s as te, t as R, tt as z, u as B, v as V, x as H, y as U } from "./chunks/draggable-DepKdldn.js";
2
- import { B as W, Bt as ne, D as G, F as K, G as q, H as J, Ht as re, It as ie, Kt as ae, Mt as oe, Nt as se, Pt as ce, Qt as le, S as ue, Tt as de, U as Y, V as X, Vt as Z, Z as fe, _ as pe, dt as me, ft as he, g as ge, h as _e, jt as ve, k as ye, m as be, nn as xe, p as Se, rn as Ce, tn as Q, v as we, y as Te, z as Ee } from "./chunks/src-mXG-Of9A.js";
3
- import { A as De, D as Oe, E as ke, M as Ae, N as je, O as Me, V as Ne, _ as Pe, b as Fe, c as Ie, j as Le, k as Re, l as ze } from "./chunks/socialIcons-Qw9rHc8C.js";
2
+ import { A as ne, D as W, E as G, M as K, N as q, O as J, V as re, _ as ie, b as ae, c as oe, j as se, k as Y, l as ce } from "./chunks/socialIcons-BFgc3qqJ.js";
3
+ import { B as le, Bt as ue, D as de, F as fe, G as X, H as pe, Ht as me, It as he, Kt as ge, Mt as _e, Nt as ve, Pt as ye, Qt as be, S as xe, Tt as Se, U as Ce, V as we, Vt as Z, Z as Te, _ as Ee, dt as De, ft as Oe, g as ke, h as Ae, jt as je, k as Me, m as Ne, nn as Pe, p as Fe, rn as Ie, tn as Q, v as Le, y as Re, z as ze } from "./chunks/src-mXG-Of9A.js";
4
4
  import { t as Be } from "./chunks/_plugin-vue_export-helper-Djzt4Yr7.js";
5
5
  import { $ as Ve, A as He, Bt as Ue, D as We, Dt as Ge, E as Ke, F as qe, It as Je, M as Ye, Ot as Xe, P as Ze, Q as Qe, Vt as $e, Y as et, at as tt, ct as nt, ft as rt, j as it, mt as at, nt as ot, q as st, t as ct, vt as lt, x as ut } from "./chunks/icons-DHExFLlT.js";
6
- import { $ as dt, B as ft, E as pt, I as mt, J as ht, K as gt, M as _t, O as vt, Q as yt, R as bt, X as xt, a as St, at as Ct, b as wt, c as Tt, d as Et, et as Dt, g as Ot, h as kt, it as At, k as jt, l as Mt, m as Nt, n as Pt, ot as Ft, rt as It, st as Lt, t as Rt, tt as zt, v as Bt, z as Vt } from "./chunks/keys-BUmIvYy3.js";
7
6
  import { t as $ } from "./chunks/useI18n-D8s7HtTn.js";
8
- import { n as Ht, t as Ut } from "./chunks/useLocalizedDisplay-Bgg4qpev.js";
7
+ import { n as dt, t as ft } from "./chunks/useLocalizedDisplay-Bgg4qpev.js";
8
+ import { $ as pt, B as mt, E as ht, I as gt, J as _t, K as vt, M as yt, O as bt, Q as xt, R as St, X as Ct, a as wt, at as Tt, b as Et, c as Dt, d as Ot, et as kt, g as At, h as jt, it as Mt, k as Nt, l as Pt, m as Ft, n as It, ot as Lt, rt as Rt, st as zt, t as Bt, tt as Vt, v as Ht, z as Ut } from "./chunks/keys-BUmIvYy3.js";
9
9
  import { t as Wt } from "./chunks/plural-CyxrJXL1.js";
10
10
  import { t as Gt } from "./chunks/languageName-DEEOhDWI.js";
11
11
  import { C as Kt, T as qt, b as Jt, h as Yt, m as Xt, w as Zt, x as Qt } from "./chunks/styleConstants-CgiNKdnc.js";
12
- import { _ as $t, d as en, g as tn } from "./chunks/dist-BzXULHvI.js";
13
- import { a as nn } from "./chunks/dist-DqGgijFI.js";
14
- import { A as rn, B as an, E as on, F as sn, L as cn, M as ln, N as un, O as dn, P as fn, _ as pn, a as mn, b as hn, c as gn, d as _n, f as vn, g as yn, h as bn, i as xn, j as Sn, k as Cn, l as wn, m as Tn, n as En, o as Dn, p as On, r as kn, s as An, t as jn, u as Mn, v as Nn, x as Pn, y as Fn } from "./chunks/composables-CsfQlmcf.js";
15
- import { t as In } from "./chunks/logger-CqQTfJGx.js";
16
- import { t as Ln } from "./chunks/templateSettingsFields-cjlP-jdw.js";
17
- import { t as Rn } from "./chunks/sanitizeHtml-DJI7vvET.js";
18
- import { t as zn } from "./chunks/TplModal-d6fEZGJ5.js";
19
- import { a as Bn, i as Vn, n as Hn, o as Un, t as Wn } from "./chunks/normalizeMergeTagMarkup-aWjkotui.js";
20
- import { t as Gn } from "./chunks/aiErrors-C3QEMB0x.js";
21
- import { t as Kn } from "./chunks/formatAbsoluteDateTime-Ck2_zXra.js";
22
- import { n as qn, t as Jn } from "./chunks/aiImageContext-BQ5mQ6B5.js";
23
- import { i as Yn, n as Xn, r as Zn, t as Qn } from "./chunks/useScrollToBlock-CJuUu7Xj.js";
24
- import { t as $n } from "./chunks/WrapperBlock-TXDSDXUP.js";
25
- import { t as er } from "./chunks/blockTypeIcons-CzYA5DF9.js";
26
- import { n as tr, t as nr } from "./chunks/MergeTagModeToggle-D7maMGIM.js";
12
+ import { t as $t } from "./chunks/TplModal-DMe6J811.js";
13
+ import { t as en } from "./chunks/sanitizeHtml-B3njfkSy.js";
14
+ import { A as tn, B as nn, E as rn, F as an, L as on, M as sn, N as cn, O as ln, P as un, _ as dn, a as fn, b as pn, c as mn, d as hn, f as gn, g as _n, h as vn, i as yn, j as bn, k as xn, l as Sn, m as Cn, n as wn, o as Tn, p as En, r as Dn, s as On, t as kn, u as An, v as jn, x as Mn, y as Nn } from "./chunks/composables-D3lsO7Io.js";
15
+ import { a as Pn, i as Fn, n as In, o as Ln, t as Rn } from "./chunks/normalizeMergeTagMarkup-aWjkotui.js";
16
+ import { t as zn } from "./chunks/aiErrors-C3QEMB0x.js";
17
+ import { n as Bn, t as Vn } from "./chunks/aiImageContext-BQ5mQ6B5.js";
18
+ import { i as Hn, n as Un, r as Wn, t as Gn } from "./chunks/useScrollToBlock-CJuUu7Xj.js";
19
+ import { a as Kn } from "./chunks/dist-Cf1pSluo.js";
20
+ import { t as qn } from "./chunks/logger-CqQTfJGx.js";
21
+ import { t as Jn } from "./chunks/WrapperBlock-CCCIcqe2.js";
22
+ import { t as Yn } from "./chunks/blockTypeIcons-CzYA5DF9.js";
23
+ import { t as Xn } from "./chunks/templateSettingsFields-cjlP-jdw.js";
24
+ import { n as Zn, t as Qn } from "./chunks/MergeTagModeToggle-D7maMGIM.js";
25
+ import { _ as $n, d as er, g as tr } from "./chunks/dist-BzXULHvI.js";
26
+ import { t as nr } from "./chunks/formatAbsoluteDateTime-Ck2_zXra.js";
27
27
  import { t as rr } from "./chunks/formatRelativeTime-BTD8Ktt-.js";
28
28
  import { t as ir } from "./chunks/preRenderCustomBlocks-Dn6dFUwx.js";
29
29
  // src/utils/resolveTemplateDefaults.ts
@@ -71,7 +71,7 @@ var ur = /*#__PURE__*/ Be(sr, [["render", lr]]), dr = {
71
71
  change: {}
72
72
  },
73
73
  setup(e) {
74
- let t = e, { t: n, format: r } = $(), s = f(At, void 0) ?? "en", c = f(kt, []), l = P(() => Z(t.editor.content.value)), u = P(() => t.editor.activeLocale?.value ?? l.value), d = P(() => t.locales.includes(u.value)), p = f(Rt, null) ?? Ut(t.editor, c), m = P(() => d.value ? !p.value?.missing.length && !p.value?.stale.length ? n.localization.complete : r(n.localization.gapTooltip, {
74
+ let t = e, { t: n, format: r } = $(), s = f(Mt, void 0) ?? "en", c = f(jt, []), l = P(() => Z(t.editor.content.value)), u = P(() => t.editor.activeLocale?.value ?? l.value), d = P(() => t.locales.includes(u.value)), p = f(Bt, null) ?? ft(t.editor, c), m = P(() => d.value ? !p.value?.missing.length && !p.value?.stale.length ? n.localization.complete : r(n.localization.gapTooltip, {
75
75
  missing: p.value.missing.length,
76
76
  stale: p.value.stale.length
77
77
  }) : r(n.localization.languageReadOnly, { language: Gt(u.value) })), h = P(() => {
@@ -160,7 +160,7 @@ var ur = /*#__PURE__*/ Be(sr, [["render", lr]]), dr = {
160
160
  size: 14,
161
161
  "aria-hidden": "true"
162
162
  })], 10, Sr)])) : w("", !0),
163
- H(zn, {
163
+ H($t, {
164
164
  visible: v.value !== null,
165
165
  onClose: O
166
166
  }, {
@@ -196,9 +196,9 @@ function Ar(e) {
196
196
  return { setDefaultLocale(n) {
197
197
  let r;
198
198
  try {
199
- r = [t.createSetDefaultLocaleOperation(n)], e.collaboration || se(t.content.value, r);
199
+ r = [t.createSetDefaultLocaleOperation(n)], e.collaboration || ve(t.content.value, r);
200
200
  } catch (e) {
201
- if (e instanceof ce) return {
201
+ if (e instanceof ye) return {
202
202
  applied: !1,
203
203
  error: e
204
204
  };
@@ -207,7 +207,7 @@ function Ar(e) {
207
207
  if (e.collaboration) {
208
208
  let t = e.collaboration.core.applyOperations(r, {});
209
209
  if (!t.applied) return t;
210
- } else e.history().record(), ie(t.content.value, r), t.markDirty();
210
+ } else e.history().record(), he(t.content.value, r), t.markDirty();
211
211
  return t.setActiveLocale(n), { applied: !0 };
212
212
  } };
213
213
  }
@@ -233,7 +233,7 @@ function Nr(e, t) {
233
233
  return [...Mr(e)].every((e) => n.has(e));
234
234
  }
235
235
  function Pr(e) {
236
- let t = `tpl-translation-${crypto.randomUUID()}-`, n = [], r = e.replace(/<x id="\d+"\s*\/>|<x id="\d+"><\/x>|__x\d+__/g, (e) => `${t}${n.push(e)}-end`), i = Rn(r);
236
+ let t = `tpl-translation-${crypto.randomUUID()}-`, n = [], r = e.replace(/<x id="\d+"\s*\/>|<x id="\d+"><\/x>|__x\d+__/g, (e) => `${t}${n.push(e)}-end`), i = en(r);
237
237
  return n.forEach((e, n) => {
238
238
  i = i.replaceAll(`${t}${n + 1}-end`, e);
239
239
  }), i;
@@ -258,7 +258,7 @@ function Ir(e) {
258
258
  gaps: 0,
259
259
  all: 0
260
260
  };
261
- let n = t.activeLocale.value, r = e.definitions(), i = e.coverage?.() ?? ae(t.content.value, n, r), a = /* @__PURE__ */ new Set([...i.missing, ...i.stale]), { strings: o } = W(t.content.value, n, {
261
+ let n = t.activeLocale.value, r = e.definitions(), i = e.coverage?.() ?? ge(t.content.value, n, r), a = /* @__PURE__ */ new Set([...i.missing, ...i.stale]), { strings: o } = le(t.content.value, n, {
262
262
  definitions: r,
263
263
  syntax: e.syntax(),
264
264
  doNotTranslate: e.localization?.doNotTranslate,
@@ -289,7 +289,7 @@ function Ir(e) {
289
289
  if (!s.value) throw new Q("Translation isn't available in this language.", 403, "feature_unavailable");
290
290
  let o = e.collaboration?.core;
291
291
  o?.flush();
292
- let c = t.activeLocale.value, l = t.state.template?.id ?? null, u = Z(t.content.value), d = Ce(E([...e.definitions()])), f = e.syntax(), p = e.localization?.doNotTranslate?.slice(), m = W(t.content.value, c, {
292
+ let c = t.activeLocale.value, l = t.state.template?.id ?? null, u = Z(t.content.value), d = Ie(E([...e.definitions()])), f = e.syntax(), p = e.localization?.doNotTranslate?.slice(), m = le(t.content.value, c, {
293
293
  ...a,
294
294
  definitions: d,
295
295
  syntax: f,
@@ -348,8 +348,8 @@ function Ir(e) {
348
348
  h.missing.push(e.id);
349
349
  continue;
350
350
  }
351
- let n = m.tokens[e.id], r = X(t.text, n);
352
- r === null || e.format === "html" && !Nr(r, X(e.source, n)) ? h.tagsChanged.push(e.id) : _.push({
351
+ let n = m.tokens[e.id], r = we(t.text, n);
352
+ r === null || e.format === "html" && !Nr(r, we(e.source, n)) ? h.tagsChanged.push(e.id) : _.push({
353
353
  id: e.id,
354
354
  text: e.format === "html" ? Pr(t.text) : t.text,
355
355
  sourceHash: e.sourceHash
@@ -369,7 +369,7 @@ function Ir(e) {
369
369
  try {
370
370
  if (!g.discarded) {
371
371
  o?.flush();
372
- let n = Ee(t.content.value, c, _, {
372
+ let n = ze(t.content.value, c, _, {
373
373
  definitions: d,
374
374
  syntax: f,
375
375
  doNotTranslate: p,
@@ -392,7 +392,7 @@ function Ir(e) {
392
392
  let t = o.locksOf(e.blockId).some((e) => e.holder.sessionId !== o.sessionId && (e.locale == null || e.locale === c));
393
393
  return t && h.skippedLocked.push(...Object.keys(e.text ?? {}).map((t) => `${e.blockId}/${t}`)), !t;
394
394
  });
395
- s.length && (se(E(t.content.value), s), e.history().record(), ie(t.content.value, s), t.markDirty(), o?.flush(), h.translated = s.reduce((e, t) => e + (t.op === "updateBlockLocale" || t.op === "updateSettingsLocale" ? Object.keys(t.text ?? {}).length : 0), 0)), t.activeLocale.value === c && (r.value = h);
395
+ s.length && (ve(E(t.content.value), s), e.history().record(), he(t.content.value, s), t.markDirty(), o?.flush(), h.translated = s.reduce((e, t) => e + (t.op === "updateBlockLocale" || t.op === "updateSettingsLocale" ? Object.keys(t.text ?? {}).length : 0), 0)), t.activeLocale.value === c && (r.value = h);
396
396
  }
397
397
  } finally {
398
398
  i = null, n.value = null;
@@ -509,10 +509,10 @@ function Vr(e) {
509
509
  id: u.noticeId
510
510
  }], i(u.noticeId)) : (u.noticeId = a(p), c = u), n.templateUpdated || f(n.blockIds);
511
511
  }
512
- let h = Ae({
512
+ let h = K({
513
513
  provider: e.provider,
514
514
  loadTemplate: e.loadTemplate,
515
- normalizeRemoteOperations: (t, n) => Vn(t, n, e.mergeTags),
515
+ normalizeRemoteOperations: (t, n) => Fn(t, n, e.mergeTags),
516
516
  onRemoteChange: (t) => {
517
517
  try {
518
518
  p(t.actor, Br(t.ops));
@@ -583,13 +583,13 @@ function Vr(e) {
583
583
  }
584
584
  // src/composables/useCommentsFeature.ts
585
585
  function Hr(e) {
586
- let { provider: t, editor: n } = e, r = Oe({
586
+ let { provider: t, editor: n } = e, r = W({
587
587
  provider: t,
588
588
  getTemplateId: () => n.state.template?.id ?? null,
589
589
  getUser: () => e.user ?? null,
590
590
  onError: e.onError
591
591
  });
592
- ke({
592
+ G({
593
593
  comments: r,
594
594
  provider: t,
595
595
  getTemplateId: () => n.state.template?.id ?? null
@@ -637,7 +637,7 @@ function Hr(e) {
637
637
  // src/composables/useAiFeature.ts
638
638
  var Ur = 3e3, Wr = 1e3;
639
639
  function Gr(e) {
640
- return Ce(E(e));
640
+ return Ie(E(e));
641
641
  }
642
642
  var Kr = (e) => e instanceof Error && e.name === "AbortError";
643
643
  function qr(e) {
@@ -661,7 +661,7 @@ function Xr(e) {
661
661
  function Zr(e) {
662
662
  let { provider: t, editor: n, collaboration: r } = e, i = t.conversation ?? null, a = crypto.randomUUID(), s = z(null), c = /* @__PURE__ */ new Map(), l = !1, u = 0, d = !1, f = 0, p = null, m = v();
663
663
  function h(e) {
664
- let t = W(e);
664
+ let t = ne(e);
665
665
  return {
666
666
  id: e,
667
667
  memory: t,
@@ -723,12 +723,12 @@ function Zr(e) {
723
723
  a(e);
724
724
  return;
725
725
  } finally {
726
- t.active = null, t.busy.value = !1, --f === 0 && ke(), B(t);
726
+ t.active = null, t.busy.value = !1, --f === 0 && Oe(), B(t);
727
727
  }
728
728
  i(e);
729
729
  }
730
730
  };
731
- t.queue.push(o), f++ === 0 && ke(), B(t);
731
+ t.queue.push(o), f++ === 0 && Oe(), B(t);
732
732
  }) : Promise.resolve().then(r);
733
733
  }
734
734
  function B(e) {
@@ -758,7 +758,7 @@ function Zr(e) {
758
758
  i.committingReload = !1;
759
759
  }
760
760
  }
761
- function W(e) {
761
+ function ne(e) {
762
762
  let t = c.get(e);
763
763
  return t || (t = {
764
764
  generation: 0,
@@ -768,7 +768,7 @@ function Zr(e) {
768
768
  recoveries: /* @__PURE__ */ new Map()
769
769
  }, c.set(e, t)), t;
770
770
  }
771
- function ne(e, t, n) {
771
+ function W(e, t, n) {
772
772
  let r = setTimeout(() => {
773
773
  e.timers.delete(r), t();
774
774
  }, n);
@@ -785,17 +785,17 @@ function Zr(e) {
785
785
  }
786
786
  let n = ++e.highlightSequence, i = new Map(e.highlights.value);
787
787
  for (let e of t) i.set(e, n);
788
- e.highlights.value = i, ne(e, () => {
788
+ e.highlights.value = i, W(e, () => {
789
789
  let r = new Map(e.highlights.value);
790
790
  for (let e of t) r.get(e) === n && r.delete(e);
791
791
  e.highlights.value = r;
792
792
  }, Rr);
793
793
  }
794
- async function q(e) {
795
- r && await Promise.race([r.core.settle().catch(() => {}), new Promise((t) => ne(e, t, Ur))]);
794
+ async function J(e) {
795
+ r && await Promise.race([r.core.settle().catch(() => {}), new Promise((t) => W(e, t, Ur))]);
796
796
  }
797
- function J(t) {
798
- let i = E(n.content.value), o = n.activeLocale?.value ?? null, s = le(i, o ?? Z(i));
797
+ function re(t) {
798
+ let i = E(n.content.value), o = n.activeLocale?.value ?? null, s = be(i, o ?? Z(i));
799
799
  if (o === null && i.settings.locale === void 0 && delete s.settings.locale, new TextEncoder().encode(JSON.stringify(s)).length > 2e5) throw new Q("This template is too large for AI.", 413, "content_too_large");
800
800
  return {
801
801
  templateId: t,
@@ -806,7 +806,7 @@ function Zr(e) {
806
806
  mergeTags: e.mergeTags()
807
807
  };
808
808
  }
809
- function re() {
809
+ function ie() {
810
810
  let e = n.state.selectedBlockId;
811
811
  return e ? r ? r.core.hasConfirmedBlock(e) ? e : null : Yr(n.content.value.blocks, e) ? e : null : null;
812
812
  }
@@ -819,7 +819,7 @@ function Zr(e) {
819
819
  try {
820
820
  o = e.normalize(t, E(n.content.value));
821
821
  } catch (e) {
822
- if (e instanceof ce) return Xr(e);
822
+ if (e instanceof ye) return Xr(e);
823
823
  throw e;
824
824
  }
825
825
  if (o.length === 0) return {
@@ -839,14 +839,14 @@ function Zr(e) {
839
839
  }
840
840
  let c;
841
841
  try {
842
- c = se(E(n.content.value), o);
842
+ c = ve(E(n.content.value), o);
843
843
  } catch (e) {
844
- if (e instanceof ce) return Xr(e);
844
+ if (e instanceof ye) return Xr(e);
845
845
  throw e;
846
846
  }
847
847
  a.lastRecordedTurn !== i && (e.history().record(), a.lastRecordedTurn = i), d = !0;
848
848
  try {
849
- ie(n.content.value, Ce(o)), n.markDirty();
849
+ he(n.content.value, Ie(o)), n.markDirty();
850
850
  } finally {
851
851
  d = !1;
852
852
  }
@@ -856,15 +856,15 @@ function Zr(e) {
856
856
  inverse: c
857
857
  };
858
858
  }
859
- function ue(t, r, i, a) {
859
+ function oe(t, r, i, a) {
860
860
  let o = t;
861
861
  try {
862
862
  if (a !== null) {
863
- if (e.localization && !e.localization.locales.includes(a)) throw new ce("invalid_operation", 0, `Locale "${a}" is not enabled.`);
864
- o = je(E(n.content.value), a, t, e.customBlockDefinitions?.());
863
+ if (e.localization && !e.localization.locales.includes(a)) throw new ye("invalid_operation", 0, `Locale "${a}" is not enabled.`);
864
+ o = q(E(n.content.value), a, t, e.customBlockDefinitions?.());
865
865
  }
866
866
  } catch (e) {
867
- if (e instanceof ce) return Xr(e);
867
+ if (e instanceof ye) return Xr(e);
868
868
  throw e;
869
869
  }
870
870
  let s = ae(o, r, i);
@@ -875,10 +875,10 @@ function Zr(e) {
875
875
  "updateBlock"
876
876
  ].includes(e.op)) && e.onStructureChange?.(), s;
877
877
  }
878
- function de(e, t) {
878
+ function se(e, t) {
879
879
  if (!r || !T(t)) return;
880
880
  let n = r.core;
881
- n.revision.value >= e || (n.connection.value === "connected" ? ne(t, () => {
881
+ n.revision.value >= e || (n.connection.value === "connected" ? W(t, () => {
882
882
  T(t) && n.revision.value < e && n.catchUp();
883
883
  }, Wr) : n.catchUp());
884
884
  }
@@ -892,13 +892,13 @@ function Zr(e) {
892
892
  };
893
893
  return {
894
894
  ...i,
895
- ...X(i, r)
895
+ ...ce(i, r)
896
896
  };
897
897
  });
898
898
  for (let e of r.recoveries.values()) e.item.id === t && (e.item = r.items.find((e) => e.id === (n.id ?? t)) ?? e.item);
899
899
  e.messages.value = r.items;
900
900
  }
901
- function X(e, t) {
901
+ function ce(e, t) {
902
902
  let n = e.role === "assistant" && e.operationCount > 0;
903
903
  if (t.storedIds.has(e.id)) return {
904
904
  canUndo: n && !e.undone && typeof i?.undo == "function",
@@ -910,15 +910,15 @@ function Zr(e) {
910
910
  canRedo: n && e.undone && !r?.serverApplied && (r?.redo?.length ?? 0) > 0
911
911
  };
912
912
  }
913
- let fe = () => ({
913
+ let le = () => ({
914
914
  messageId: null,
915
915
  operationCount: 0,
916
916
  text: "",
917
917
  failed: !0
918
918
  });
919
- function pe(t, a, o, s = []) {
919
+ function ue(t, a, o, s = []) {
920
920
  let c = b, l = n.activeLocale?.value ?? null, u = w();
921
- return !u || u.active?.kind === "turn" || u.queue.some((e) => e.kind === "turn") ? Promise.resolve(fe()) : R("turn", u, async (d) => {
921
+ return !u || u.active?.kind === "turn" || u.queue.some((e) => e.kind === "turn") ? Promise.resolve(le()) : R("turn", u, async (d) => {
922
922
  let { controller: f } = d, p = u.memory, m = crypto.randomUUID(), h = crypto.randomUUID(), g = crypto.randomUUID(), _ = 0, v = "", y = !1, b = null, x = {
923
923
  inverse: [],
924
924
  redo: null,
@@ -936,7 +936,7 @@ function Zr(e) {
936
936
  try {
937
937
  let n;
938
938
  do
939
- n = _, !r && e.reload && await U(t, !0, d.authorVersion), i && await _e(t, !0, !0);
939
+ n = _, !r && e.reload && await U(t, !0, d.authorVersion), i && await pe(t, !0, !0);
940
940
  while (T(u) && n !== _);
941
941
  } catch (e) {
942
942
  T(u) && G(e);
@@ -952,18 +952,18 @@ function Zr(e) {
952
952
  },
953
953
  onOperations: async (e) => {
954
954
  V(d), S(c);
955
- let t = r ? Gr(n.content.value) : null, i = ue(e, m, u, l);
956
- return i.applied && i.inverse.length > 0 && (x.inverse = [...i.inverse, ...x.inverse], r && (x.view = x.view === void 0 || x.view !== null && xe(x.view, t) ? Gr(n.content.value) : null), _ += e.length, D({ operationCount: _ })), i;
955
+ let t = r ? Gr(n.content.value) : null, i = oe(e, m, u, l);
956
+ return i.applied && i.inverse.length > 0 && (x.inverse = [...i.inverse, ...x.inverse], r && (x.view = x.view === void 0 || x.view !== null && Pe(x.view, t) ? Gr(n.content.value) : null), _ += e.length, D({ operationCount: _ })), i;
957
957
  },
958
958
  onApplied: (t) => {
959
959
  if (!T(u)) throw new DOMException("The template changed.", "AbortError");
960
- if (!r && !e.reload) throw b ??= new Q(Gn, 502, "ai_provider_error"), b;
961
- x.serverApplied = !0, x.batchIds.add(t.batchId), _ += t.operationCount, D({ operationCount: _ }), de(t.revision, u), w && (O(), k());
960
+ if (!r && !e.reload) throw b ??= new Q(zn, 502, "ai_provider_error"), b;
961
+ x.serverApplied = !0, x.batchIds.add(t.batchId), _ += t.operationCount, D({ operationCount: _ }), se(t.revision, u), w && (O(), k());
962
962
  }
963
963
  };
964
964
  try {
965
965
  try {
966
- await _e(d), V(d), S(c), u.failure.value = null, u.failedPrompt.value = null, u.failedAttachments.value = [];
966
+ await pe(d), V(d), S(c), u.failure.value = null, u.failedPrompt.value = null, u.failedAttachments.value = [];
967
967
  let e = (/* @__PURE__ */ new Date()).toISOString();
968
968
  p.records.set(g, x), p.items = [
969
969
  ...p.items,
@@ -998,8 +998,8 @@ function Zr(e) {
998
998
  createdAt: e,
999
999
  status: "streaming"
1000
1000
  }
1001
- ], u.messages.value = p.items, await H(q(u), d.controller.signal), V(d), S(c);
1002
- let n = await H(o(J(u.id), A, f.signal), f.signal);
1001
+ ], u.messages.value = p.items, await H(J(u), d.controller.signal), V(d), S(c);
1002
+ let n = await H(o(re(u.id), A, f.signal), f.signal);
1003
1003
  if (V(d), b) throw b;
1004
1004
  if (n.text !== "" && (v = n.text), n.messageId !== null && i) {
1005
1005
  let e = g;
@@ -1043,7 +1043,7 @@ function Zr(e) {
1043
1043
  if (n = _, x.serverApplied && !r && e.reload && T(u) && await U(d, !0).catch((e) => {
1044
1044
  T(u) && G(e);
1045
1045
  }), i && p.recoveries.has(m) && T(u)) {
1046
- await _e(d, !0, !0);
1046
+ await pe(d, !0, !0);
1047
1047
  let e = p.recoveries.get(m);
1048
1048
  e && (C.messageId = e.item.id, C.text = e.item.text);
1049
1049
  }
@@ -1052,9 +1052,9 @@ function Zr(e) {
1052
1052
  } finally {
1053
1053
  w = !0, u.messages.value = p.items;
1054
1054
  }
1055
- }, fe);
1055
+ }, le);
1056
1056
  }
1057
- function me(t, o) {
1057
+ function de(t, o) {
1058
1058
  let s = w();
1059
1059
  return !s || s.busy.value ? Promise.resolve() : R("replay", s, async (c) => {
1060
1060
  let l = s.memory, u = l.items.find((e) => e.id === t);
@@ -1068,7 +1068,7 @@ function Zr(e) {
1068
1068
  if (!T(s)) return;
1069
1069
  if ("operations" in n) {
1070
1070
  if (c.controller.signal.aborted) return;
1071
- let e = ue(n.operations, `${o}:${t}:${crypto.randomUUID()}`, s, u.locale ?? null);
1071
+ let e = oe(n.operations, `${o}:${t}:${crypto.randomUUID()}`, s, u.locale ?? null);
1072
1072
  e.applied && Y(s, t, {
1073
1073
  undone: o === "undo",
1074
1074
  failure: void 0
@@ -1088,7 +1088,7 @@ function Zr(e) {
1088
1088
  } });
1089
1089
  }
1090
1090
  if (!T(s)) return;
1091
- if (!e.applied) throw new oe(e.message, {
1091
+ if (!e.applied) throw new _e(e.message, {
1092
1092
  code: e.code,
1093
1093
  opIndex: e.opIndex
1094
1094
  });
@@ -1097,18 +1097,18 @@ function Zr(e) {
1097
1097
  if (Y(s, t, {
1098
1098
  undone: o === "undo",
1099
1099
  failure: void 0
1100
- }), r) de(n.applied.revision, s);
1100
+ }), r) se(n.applied.revision, s);
1101
1101
  else if (e.reload) await U(c, !0);
1102
- else throw new Q(Gn, 502, "ai_provider_error");
1102
+ else throw new Q(zn, 502, "ai_provider_error");
1103
1103
  return;
1104
1104
  }
1105
1105
  {
1106
1106
  if (u.undone !== (o === "redo")) return;
1107
1107
  let e = o === "undo" ? f?.inverse : f?.redo;
1108
1108
  if (!f || f.serverApplied || !e || e.length === 0) return;
1109
- if (r && e.some((e) => e.op === "setContent") && (!f.view || !xe(f.view, E(n.content.value)))) throw new oe(`The template changed since this message's changes, so ${o === "undo" ? "undoing" : "redoing"} them would overwrite that.`, { code: "precondition_failed" });
1109
+ if (r && e.some((e) => e.op === "setContent") && (!f.view || !Pe(f.view, E(n.content.value)))) throw new _e(`The template changed since this message's changes, so ${o === "undo" ? "undoing" : "redoing"} them would overwrite that.`, { code: "precondition_failed" });
1110
1110
  let i = ae(e, `${o}:${t}:${crypto.randomUUID()}`, s);
1111
- if (!i.applied) throw new oe(i.message, {
1111
+ if (!i.applied) throw new _e(i.message, {
1112
1112
  code: i.code,
1113
1113
  opIndex: i.opIndex
1114
1114
  });
@@ -1127,7 +1127,7 @@ function Zr(e) {
1127
1127
  }
1128
1128
  }, () => {});
1129
1129
  }
1130
- function he(e, t) {
1130
+ function fe(e, t) {
1131
1131
  let n = {
1132
1132
  id: e.id,
1133
1133
  role: e.role,
@@ -1144,13 +1144,13 @@ function Zr(e) {
1144
1144
  };
1145
1145
  return {
1146
1146
  ...n,
1147
- ...X(n, t)
1147
+ ...ce(n, t)
1148
1148
  };
1149
1149
  }
1150
- function ge(e, t) {
1150
+ function X(e, t) {
1151
1151
  for (let n of e) t.storedIds.add(n.id);
1152
1152
  let n = new Map(t.items.map((e) => [e.id, e])), r = e.map((e) => {
1153
- let r = he(e, t), i = n.get(r.id);
1153
+ let r = fe(e, t), i = n.get(r.id);
1154
1154
  return i?.status === "failed" ? {
1155
1155
  ...r,
1156
1156
  status: i.status,
@@ -1162,19 +1162,19 @@ function Zr(e) {
1162
1162
  if (s) {
1163
1163
  t.records.delete(i.id), t.records.set(s.id, a);
1164
1164
  let e = {
1165
- ...he(s, t),
1165
+ ...fe(s, t),
1166
1166
  status: i.status,
1167
1167
  failure: i.failure
1168
1168
  };
1169
1169
  n.item = e, r = r.map((t) => t.id === s.id ? e : t);
1170
1170
  } else n.user && !r.some((e) => e.id === n.user.id) && r.push(n.user), r.push({
1171
1171
  ...i,
1172
- ...X(i, t)
1172
+ ...ce(i, t)
1173
1173
  });
1174
1174
  }
1175
1175
  return r;
1176
1176
  }
1177
- async function _e(e, t = !1, n = !1, r = e.scope.historyGeneration) {
1177
+ async function pe(e, t = !1, n = !1, r = e.scope.historyGeneration) {
1178
1178
  let { scope: a } = e;
1179
1179
  if (!T(a) || r !== a.historyGeneration || !n && e.controller.signal.aborted || !t && a.loaded) return;
1180
1180
  let o = a.memory;
@@ -1183,7 +1183,7 @@ function Zr(e) {
1183
1183
  a.isLoadingHistory.value = !0, a.loaded = !1;
1184
1184
  try {
1185
1185
  await H(i.list(a.id).then((t) => {
1186
- !l && o.generation === a.generation && r === a.historyGeneration && (n || T(a) && !e.controller.signal.aborted) && (o.items = ge(t, o), a.messages.value = o.items, a.loaded = !0, a.failure.value?.context === "history" && (a.failure.value = null));
1186
+ !l && o.generation === a.generation && r === a.historyGeneration && (n || T(a) && !e.controller.signal.aborted) && (o.items = X(t, o), a.messages.value = o.items, a.loaded = !0, a.failure.value?.context === "history" && (a.failure.value = null));
1187
1187
  }), n ? a.lifetime.signal : e.controller.signal);
1188
1188
  } catch (e) {
1189
1189
  if (!T(a) || r !== a.historyGeneration || Kr(e)) return;
@@ -1196,7 +1196,7 @@ function Zr(e) {
1196
1196
  }
1197
1197
  }
1198
1198
  }
1199
- function ve(e = w()) {
1199
+ function me(e = w()) {
1200
1200
  if (!e || !T(e)) return Promise.resolve();
1201
1201
  if (e.pendingHistory?.generation === e.historyGeneration) return e.pendingHistory.promise;
1202
1202
  if (e.loaded) return Promise.resolve();
@@ -1204,11 +1204,11 @@ function Zr(e) {
1204
1204
  generation: t,
1205
1205
  promise: Promise.resolve()
1206
1206
  };
1207
- return n.promise = R("history", e, (e) => _e(e, !1, !1, t), () => {}).finally(() => {
1207
+ return n.promise = R("history", e, (e) => pe(e, !1, !1, t), () => {}).finally(() => {
1208
1208
  e.pendingHistory === n && (e.pendingHistory = null);
1209
1209
  }), e.pendingHistory = n, n.promise;
1210
1210
  }
1211
- function ye() {
1211
+ function ge() {
1212
1212
  let e = w();
1213
1213
  return !e || i && typeof i.clear != "function" || e.active && e.active.kind !== "history" && e.active.kind !== "read" || e.queue.some((e) => e.kind !== "history" && e.kind !== "read") ? Promise.resolve() : (te(e), e.active?.controller.abort(), R("clear", e, async () => {
1214
1214
  try {
@@ -1223,33 +1223,33 @@ function Zr(e) {
1223
1223
  }
1224
1224
  }, () => {}));
1225
1225
  }
1226
- function be(e) {
1227
- T(e) && ve(e);
1226
+ function xe(e) {
1227
+ T(e) && me(e);
1228
1228
  }
1229
1229
  function Se(t) {
1230
1230
  let n = w();
1231
- n && T(n) && (s.value !== t && n.busy.value && De(), s.value = t, e.commentsOpen && (e.commentsOpen.value = !1), t === "chat" && be(n));
1231
+ n && T(n) && (s.value !== t && n.busy.value && Ee(), s.value = t, e.commentsOpen && (e.commentsOpen.value = !1), t === "chat" && xe(n));
1232
1232
  }
1233
- function we(e) {
1233
+ function Ce(e) {
1234
1234
  e.length !== 0 && C("chatAttachments") && (I.value = [...e], Se("chat"));
1235
1235
  }
1236
- function Te(e) {
1236
+ function we(e) {
1237
1237
  e.active?.controller.abort();
1238
1238
  for (let t of e.queue) t.kind !== "reconcile" && t.controller.abort();
1239
1239
  }
1240
- function Ee(e) {
1241
- e.lifetime.abort(), Te(e), e.busy.value = !1, e.isLoadingHistory.value = !1;
1240
+ function Te(e) {
1241
+ e.lifetime.abort(), we(e), e.busy.value = !1, e.isLoadingHistory.value = !1;
1242
1242
  for (let t of e.timers) clearTimeout(t);
1243
1243
  e.timers.clear();
1244
1244
  }
1245
- function De() {
1245
+ function Ee() {
1246
1246
  let e = w();
1247
- e && Te(e);
1247
+ e && we(e);
1248
1248
  }
1249
- function Oe() {
1250
- De(), s.value = null;
1249
+ function De() {
1250
+ Ee(), s.value = null;
1251
1251
  }
1252
- function ke() {
1252
+ function Oe() {
1253
1253
  if (l) return;
1254
1254
  p?.();
1255
1255
  let e = f === 0, t = () => o(n.content, () => {
@@ -1261,28 +1261,28 @@ function Zr(e) {
1261
1261
  });
1262
1262
  p = m?.active ? m.run(t) : t();
1263
1263
  }
1264
- ke();
1265
- let Ae = [() => p?.(), o(() => n.state.isDirty, (e, t) => {
1264
+ Oe();
1265
+ let ke = [() => p?.(), o(() => n.state.isDirty, (e, t) => {
1266
1266
  t === !0 && e === !1 && n.state.isSaving && (N.value = !1);
1267
1267
  }, { flush: "sync" })];
1268
- e.commentsOpen && Ae.push(o(e.commentsOpen, (e) => {
1269
- e && Oe();
1270
- })), Ae.push(o(() => n.loadVersion?.value ?? g.value, () => {
1268
+ e.commentsOpen && ke.push(o(e.commentsOpen, (e) => {
1269
+ e && De();
1270
+ })), ke.push(o(() => n.loadVersion?.value ?? g.value, () => {
1271
1271
  if (l) return;
1272
1272
  let e = _.value;
1273
1273
  if (e?.committingReload && T(e)) {
1274
1274
  e.committingReload = !1;
1275
1275
  return;
1276
1276
  }
1277
- e && Ee(e);
1277
+ e && Te(e);
1278
1278
  let t = g.value, n = t === null ? null : h(t);
1279
- _.value = n, n && s.value === "chat" && be(n);
1279
+ _.value = n, n && s.value === "chat" && xe(n);
1280
1280
  }, { flush: "sync" }));
1281
- async function Me(i, o) {
1281
+ async function Ae(i, o) {
1282
1282
  let s = b, c = w(), l = t.altText, u = new AbortController(), d = () => u.abort(o?.reason), f = () => u.abort();
1283
1283
  try {
1284
1284
  if (o?.throwIfAborted(), !c || typeof l != "function") throw new Q("This AI feature isn't available.", 403, "feature_unavailable");
1285
- let t = E(n.content.value), p = n.activeLocale?.value ?? null, m = le(t, p ?? Z(t)), h = Jn(m, i);
1285
+ let t = E(n.content.value), p = n.activeLocale?.value ?? null, m = be(t, p ?? Z(t)), h = Vn(m, i);
1286
1286
  if (!h) throw new Q("The image is no longer available.", 409, "block_missing");
1287
1287
  o?.addEventListener("abort", d, { once: !0 }), c.lifetime.signal.addEventListener("abort", f, { once: !0 });
1288
1288
  let { url: g, ..._ } = h, v = await H(l({
@@ -1302,13 +1302,13 @@ function Zr(e) {
1302
1302
  o?.removeEventListener("abort", d), c?.lifetime.signal.removeEventListener("abort", f);
1303
1303
  }
1304
1304
  }
1305
- function Ne(e) {
1305
+ function je(e) {
1306
1306
  let t = b, r = w();
1307
1307
  if (!r || e.length === 0) return Promise.resolve();
1308
- let i = n.activeLocale?.value ?? null, a = E(n.content.value), o = le(a, i ?? Z(a)), s = e.map(({ blockId: e, alt: t, decorative: n, expect: r }) => ({
1308
+ let i = n.activeLocale?.value ?? null, a = E(n.content.value), o = be(a, i ?? Z(a)), s = e.map(({ blockId: e, alt: t, decorative: n, expect: r }) => ({
1309
1309
  op: "updateBlock",
1310
1310
  blockId: e,
1311
- expect: { ...r ?? qn(o, e) ?? {
1311
+ expect: { ...r ?? Bn(o, e) ?? {
1312
1312
  src: null,
1313
1313
  alt: null,
1314
1314
  decorative: null
@@ -1324,8 +1324,8 @@ function Zr(e) {
1324
1324
  let n = crypto.randomUUID();
1325
1325
  for (let t = 0; t < s.length; t += 100) {
1326
1326
  V(e);
1327
- let a = ue(s.slice(t, t + 100), n, r, i);
1328
- if (!a.applied) throw new oe(a.message, {
1327
+ let a = oe(s.slice(t, t + 100), n, r, i);
1328
+ if (!a.applied) throw new _e(a.message, {
1329
1329
  code: a.code,
1330
1330
  opIndex: a.opIndex
1331
1331
  });
@@ -1339,12 +1339,12 @@ function Zr(e) {
1339
1339
  capability: {
1340
1340
  isFeatureEnabled: (e) => y.value && C(e),
1341
1341
  open: Se,
1342
- startImport: we,
1342
+ startImport: Ce,
1343
1343
  highlightOf: (e) => _.value?.highlights.value.get(e) ?? null
1344
1344
  },
1345
1345
  panel: s,
1346
1346
  open: Se,
1347
- close: Oe,
1347
+ close: De,
1348
1348
  has: C,
1349
1349
  templateId: g,
1350
1350
  sessionIdentity: P(() => _.value),
@@ -1365,14 +1365,14 @@ function Zr(e) {
1365
1365
  failedPrompt: ee,
1366
1366
  failedAttachments: F,
1367
1367
  importQueue: I,
1368
- startImport: we,
1368
+ startImport: Ce,
1369
1369
  isTemplateEmpty: k,
1370
1370
  send: (e, n = []) => {
1371
1371
  let r = t.chat;
1372
- return typeof r == "function" ? pe("chat", e, (t, i, a) => r({
1372
+ return typeof r == "function" ? ue("chat", e, (t, i, a) => r({
1373
1373
  ...t,
1374
1374
  message: e,
1375
- selectedBlockId: re(),
1375
+ selectedBlockId: ie(),
1376
1376
  attachments: n.map((e) => ({
1377
1377
  file: e,
1378
1378
  name: e.name,
@@ -1387,7 +1387,7 @@ function Zr(e) {
1387
1387
  },
1388
1388
  fix: (e) => {
1389
1389
  let n = t.fixFinding;
1390
- return typeof n == "function" ? pe("fix", `Fix: ${e.message}`, (t, r, i) => n({
1390
+ return typeof n == "function" ? ue("fix", `Fix: ${e.message}`, (t, r, i) => n({
1391
1391
  ...t,
1392
1392
  finding: e
1393
1393
  }, r, i)) : Promise.resolve({
@@ -1397,10 +1397,10 @@ function Zr(e) {
1397
1397
  failed: !0
1398
1398
  });
1399
1399
  },
1400
- stop: De,
1401
- newChat: ye,
1402
- undoMessage: (e) => me(e, "undo"),
1403
- redoMessage: (e) => me(e, "redo"),
1400
+ stop: Ee,
1401
+ newChat: ge,
1402
+ undoMessage: (e) => de(e, "undo"),
1403
+ redoMessage: (e) => de(e, "redo"),
1404
1404
  rewrite: (e, n, r) => {
1405
1405
  let i = b, a = w(), o = t.rewrite;
1406
1406
  return !a || typeof o != "function" ? Promise.reject(/* @__PURE__ */ Error("Rewrite isn't available.")) : R("read", a, async (t) => {
@@ -1409,7 +1409,7 @@ function Zr(e) {
1409
1409
  try {
1410
1410
  r.throwIfAborted(), V(t), S(i);
1411
1411
  let s = await H(o({
1412
- ...J(a.id),
1412
+ ...re(a.id),
1413
1413
  ...e
1414
1414
  }, { onText: (e) => {
1415
1415
  V(t), S(i), n(e);
@@ -1424,15 +1424,15 @@ function Zr(e) {
1424
1424
  throw new DOMException("Rewrite stopped.", "AbortError");
1425
1425
  });
1426
1426
  },
1427
- draftAltText: Me,
1428
- applyAltTexts: Ne,
1427
+ draftAltText: Ae,
1428
+ applyAltTexts: je,
1429
1429
  destroy: () => {
1430
1430
  if (l) return;
1431
1431
  l = !0;
1432
1432
  let e = _.value;
1433
- e && Ee(e), _.value = null, x();
1434
- for (let e of Ae) e();
1435
- Ae.length = 0;
1433
+ e && Te(e), _.value = null, x();
1434
+ for (let e of ke) e();
1435
+ ke.length = 0;
1436
1436
  }
1437
1437
  };
1438
1438
  }
@@ -1449,7 +1449,7 @@ function $r(e, t) {
1449
1449
  return n.length > t ? n.slice(0, t).join("") : e;
1450
1450
  }
1451
1451
  function ei(e) {
1452
- return Y(e) ?? "custom";
1452
+ return Ce(e) ?? "custom";
1453
1453
  }
1454
1454
  function ti(e, t) {
1455
1455
  let n = [];
@@ -1529,7 +1529,7 @@ function ii(e) {
1529
1529
  };
1530
1530
  }
1531
1531
  function ai(e) {
1532
- let t = Pe(e.width, e.height);
1532
+ let t = ie(e.width, e.height);
1533
1533
  return {
1534
1534
  url: e.url,
1535
1535
  alt: e.alt,
@@ -1541,7 +1541,7 @@ function ai(e) {
1541
1541
  }
1542
1542
  // src/composables/useSavedBlocksFeature.ts
1543
1543
  function oi(e) {
1544
- let { provider: t, editor: n } = e, r = Le({
1544
+ let { provider: t, editor: n } = e, r = se({
1545
1545
  provider: t,
1546
1546
  onError: e.onError
1547
1547
  }), i = z(!1), a = z(!1), c = z(!1), l = z(/* @__PURE__ */ new Set()), u = P(() => c.value), d = P(() => l.value.size);
@@ -1576,7 +1576,7 @@ function oi(e) {
1576
1576
  }
1577
1577
  function b(e, t) {
1578
1578
  for (let r = 0; r < e.content.length; r++) {
1579
- let i = we(e.content[r]), a = t === void 0 ? void 0 : t + r;
1579
+ let i = Le(e.content[r]), a = t === void 0 ? void 0 : t + r;
1580
1580
  n.addBlock(i, void 0, void 0, a);
1581
1581
  }
1582
1582
  a.value = !1;
@@ -1585,7 +1585,7 @@ function oi(e) {
1585
1585
  r.load().catch(() => {});
1586
1586
  }
1587
1587
  let S = P(() => r.savedBlocks.value.length), C = P(() => e.isAvailable?.() ?? !0);
1588
- return s(xt, r), {
1588
+ return s(Ct, r), {
1589
1589
  headless: r,
1590
1590
  isPicking: u,
1591
1591
  pickedIds: l,
@@ -1623,7 +1623,7 @@ function oi(e) {
1623
1623
  // src/composables/useTemplatesFeature.ts
1624
1624
  var si = 3e3;
1625
1625
  function ci(e) {
1626
- let { provider: t, editor: n } = e, r = z("idle"), i = z(""), { start: a, stop: o } = $t(() => {
1626
+ let { provider: t, editor: n } = e, r = z("idle"), i = z(""), { start: a, stop: o } = $n(() => {
1627
1627
  r.value = "idle";
1628
1628
  }, si, { immediate: !1 }), s = P(() => typeof t.create == "function"), c = P(() => typeof t.save == "function"), l = P(() => e.isAvailable?.() ?? !0), u = P(() => n.state.template?.name), d = P(() => {
1629
1629
  let e = n.state.template;
@@ -1689,7 +1689,7 @@ function ci(e) {
1689
1689
  let t = e.trim();
1690
1690
  t && t !== n.state.template?.name && (n.setName(t), S("rename"));
1691
1691
  }
1692
- return e.guardUnsavedChanges !== !1 && nn(window, "beforeunload", (e) => {
1692
+ return e.guardUnsavedChanges !== !1 && Kn(window, "beforeunload", (e) => {
1693
1693
  n.state.isDirty && (e.preventDefault(), e.returnValue = "");
1694
1694
  }), {
1695
1695
  save: g,
@@ -1725,7 +1725,7 @@ function ci(e) {
1725
1725
  // src/utils/toMjml.ts
1726
1726
  async function li() {
1727
1727
  try {
1728
- return await import("./chunks/src-Bfj1jHnn.js");
1728
+ return await import("./chunks/src-GgKlXNxy.js");
1729
1729
  } catch {
1730
1730
  return null;
1731
1731
  }
@@ -1774,7 +1774,7 @@ function pi(e) {
1774
1774
  return await e.renderMjml();
1775
1775
  } catch (t) {
1776
1776
  if ((e.usesLocalRenderer?.() ?? !0) && await li() === null) {
1777
- s || (s = !0, In.warn("testEmail.includeMjml is set but @templatical/renderer is not installed — sending the template as JSON only. Install it to receive `payload.mjml`."));
1777
+ s || (s = !0, qn.warn("testEmail.includeMjml is set but @templatical/renderer is not installed — sending the template as JSON only. Install it to receive `payload.mjml`."));
1778
1778
  return;
1779
1779
  }
1780
1780
  throw t;
@@ -1831,7 +1831,7 @@ function pi(e) {
1831
1831
  }
1832
1832
  // src/composables/useVersionHistoryFeature.ts
1833
1833
  function mi(e) {
1834
- let { provider: t, editor: n, history: r, conditionPreview: i, autoSave: a } = e, o = e.collaboration ?? null, s = Me({
1834
+ let { provider: t, editor: n, history: r, conditionPreview: i, autoSave: a } = e, o = e.collaboration ?? null, s = J({
1835
1835
  provider: t,
1836
1836
  getTemplateId: () => n.state.template?.id ?? null,
1837
1837
  onError: e.onError
@@ -1857,7 +1857,7 @@ function mi(e) {
1857
1857
  return;
1858
1858
  }
1859
1859
  let t = await s.resolveContent(e);
1860
- f || (l.value = Ce(n.content.value), a?.pause(), o?.suspend(), c.value = e, n.setContent(t, !1));
1860
+ f || (l.value = Ie(n.content.value), a?.pause(), o?.suspend(), c.value = e, n.setContent(t, !1));
1861
1861
  }
1862
1862
  async function E() {
1863
1863
  c.value && (n.state.isDirty ? u.value = !0 : await A());
@@ -2020,25 +2020,25 @@ var yi = ["aria-label"], bi = ["lang", "dir"], xi = {
2020
2020
  emits: ["select-block"],
2021
2021
  setup(n, { emit: r }) {
2022
2022
  let o = {
2023
- section: An,
2024
- title: Mn,
2025
- paragraph: On,
2026
- image: bn,
2027
- button: hn,
2028
- divider: pn,
2029
- spacer: mn,
2030
- html: yn,
2031
- social: Dn,
2032
- menu: Tn,
2033
- table: xn,
2034
- video: kn,
2035
- custom: Nn,
2036
- wrapper: $n
2037
- }, u = n, d = r, { t: p } = $(), m = Lt(Bt, "Canvas"), { displayBlock: h, settings: g } = Ht({
2023
+ section: On,
2024
+ title: An,
2025
+ paragraph: En,
2026
+ image: vn,
2027
+ button: pn,
2028
+ divider: dn,
2029
+ spacer: fn,
2030
+ html: _n,
2031
+ social: Tn,
2032
+ menu: Cn,
2033
+ table: yn,
2034
+ video: Dn,
2035
+ custom: jn,
2036
+ wrapper: Jn
2037
+ }, u = n, d = r, { t: p } = $(), m = zt(Ht, "Canvas"), { displayBlock: h, settings: g } = dt({
2038
2038
  content: P(() => u.content),
2039
2039
  activeLocale: P(() => u.previewMode ? null : m.activeLocale?.value ?? null)
2040
- }), _ = Lt(wt, "Canvas"), v = f(Nt, null), x = f(Mt, null), E = f(Et, {}), D = f(bt, null), O = f(ht, null);
2041
- s(Ft, P(() => u.previewMode && (D?.value ?? !1) && !O?.isConfigured));
2040
+ }), _ = zt(Et, "Canvas"), v = f(Ft, null), x = f(Pt, null), E = f(Ot, {}), D = f(St, null), O = f(_t, null);
2041
+ s(Lt, P(() => u.previewMode && (D?.value ?? !1) && !O?.isConfigured));
2042
2042
  let k = P(() => E.ai?.isFeatureEnabled("chat") ?? !1), M = P(() => k.value && (E.ai?.isFeatureEnabled("chatAttachments") ?? !1)), N = z(null);
2043
2043
  function ee() {
2044
2044
  N.value?.click();
@@ -2047,38 +2047,38 @@ var yi = ["aria-label"], bi = ["lang", "dir"], xi = {
2047
2047
  let t = e.target, n = Array.from(t.files ?? []);
2048
2048
  t.value = "", n.length && E.ai?.startImport(n);
2049
2049
  }
2050
- let L = f(St, null), V = P({
2050
+ let L = f(wt, null), V = P({
2051
2051
  get: () => u.content.blocks,
2052
- set: (e) => vn(m, e)
2053
- }), U = P(() => ze(g.value, u.viewport)), W = P(() => U.value + 192), ne = P(() => on(g.value, _.resolveFontFamily)), G = P(() => g.value?.locale?.trim() || void 0), K = P(() => me(g.value)), q = P(() => V.value.length === 0 && !u.previewMode), J = z(0), re = P(() => q.value && J.value > 0);
2052
+ set: (e) => gn(m, e)
2053
+ }), U = P(() => ce(g.value, u.viewport)), ne = P(() => U.value + 192), W = P(() => rn(g.value, _.resolveFontFamily)), G = P(() => g.value?.locale?.trim() || void 0), K = P(() => De(g.value)), q = P(() => V.value.length === 0 && !u.previewMode), J = z(0), re = P(() => q.value && J.value > 0);
2054
2054
  function ie() {
2055
2055
  q.value && (J.value += 1);
2056
2056
  }
2057
2057
  function ae() {
2058
2058
  q.value && (J.value = Math.max(0, J.value - 1));
2059
2059
  }
2060
- function oe() {
2060
+ function se() {
2061
2061
  J.value = 0;
2062
2062
  }
2063
- function se(e) {
2063
+ function Y(e) {
2064
2064
  u.previewMode || E.savedBlocks?.isPicking.value || e.target === e.currentTarget && d("select-block", null);
2065
2065
  }
2066
- function ce(e) {
2067
- return dn(e, x, o);
2068
- }
2069
2066
  function le(e) {
2070
- return E.collaboration?.lockOf(e) != null;
2067
+ return ln(e, x, o);
2071
2068
  }
2072
2069
  function ue(e) {
2073
- if (u.previewMode || le(e)) return;
2070
+ return E.collaboration?.lockOf(e) != null;
2071
+ }
2072
+ function de(e) {
2073
+ if (u.previewMode || ue(e)) return;
2074
2074
  let t = E.savedBlocks;
2075
2075
  t?.isPicking.value ? t.togglePick(e) : d("select-block", e);
2076
2076
  }
2077
- function de(e) {
2077
+ function fe(e) {
2078
2078
  return E.savedBlocks?.isPicked(e) ?? !1;
2079
2079
  }
2080
- let Y = P(() => E.savedBlocks?.isPicking.value === !0);
2081
- function X(e, t) {
2080
+ let X = P(() => E.savedBlocks?.isPicking.value === !0);
2081
+ function pe(e, t) {
2082
2082
  e.type === "custom" && m.updateBlock(e.id, {
2083
2083
  fieldValues: t.fieldValues,
2084
2084
  dataSourceFetched: t.dataSourceFetched
@@ -2087,11 +2087,11 @@ var yi = ["aria-label"], bi = ["lang", "dir"], xi = {
2087
2087
  return (r, o) => (i(), y("div", {
2088
2088
  class: "tpl-canvas-stage tpl:relative tpl:mx-auto tpl:flex tpl:justify-center tpl:rounded-lg",
2089
2089
  style: F({
2090
- width: `${W.value}px`,
2090
+ width: `${ne.value}px`,
2091
2091
  maxWidth: "calc(100% - 4 * var(--tpl-base-size))",
2092
2092
  minWidth: "min-content",
2093
2093
  boxShadow: n.darkMode ? "none" : "var(--tpl-shadow-xl)",
2094
- transition: S(Ie)
2094
+ transition: S(oe)
2095
2095
  })
2096
2096
  }, [A("div", {
2097
2097
  class: "tpl-canvas-bg tpl:absolute tpl:inset-0 tpl:rounded-lg tpl:pointer-events-none",
@@ -2107,8 +2107,8 @@ var yi = ["aria-label"], bi = ["lang", "dir"], xi = {
2107
2107
  class: "tpl-canvas-wrapper tpl:relative",
2108
2108
  style: F({
2109
2109
  width: `${U.value}px`,
2110
- [S(Pn)]: `${U.value}px`,
2111
- transition: S(Ie)
2110
+ [S(Mn)]: `${U.value}px`,
2111
+ transition: S(oe)
2112
2112
  })
2113
2113
  }, [A("div", {
2114
2114
  class: C(["tpl-canvas tpl:relative tpl:rounded-lg", {
@@ -2117,8 +2117,8 @@ var yi = ["aria-label"], bi = ["lang", "dir"], xi = {
2117
2117
  }]),
2118
2118
  lang: G.value,
2119
2119
  dir: K.value,
2120
- style: F(ne.value),
2121
- onClick: se
2120
+ style: F(W.value),
2121
+ onClick: Y
2122
2122
  }, [S(O)?.isInitialResolve.value ? (i(), y("div", xi, [A("span", Si, j(S(p).previewResolution.resolving), 1), (i(), y(B, null, l(3, (e) => A("div", {
2123
2123
  key: e,
2124
2124
  "aria-hidden": "true",
@@ -2142,10 +2142,10 @@ var yi = ["aria-label"], bi = ["lang", "dir"], xi = {
2142
2142
  q.value && re.value ? "tpl-canvas-empty--drag-over tpl:border-[var(--tpl-primary-hover)] tpl:bg-[var(--tpl-primary-light)]" : "",
2143
2143
  q.value && !re.value ? "tpl:border-[var(--tpl-primary)]" : ""
2144
2144
  ]),
2145
- onUpdate: o[2] ||= (e) => S(vn)(S(m), V.value, void 0, 0, e),
2145
+ onUpdate: o[2] ||= (e) => S(gn)(S(m), V.value, void 0, 0, e),
2146
2146
  onDragenter: ie,
2147
2147
  onDragleave: ae,
2148
- onDrop: oe
2148
+ onDrop: se
2149
2149
  }, {
2150
2150
  default: a(() => [q.value ? (i(), y("div", wi, [
2151
2151
  A("div", Ti, [H(S(Ke), {
@@ -2193,23 +2193,23 @@ var yi = ["aria-label"], bi = ["lang", "dir"], xi = {
2193
2193
  ])) : w("", !0), (i(!0), y(B, null, l(V.value, (r) => c((i(), y("div", {
2194
2194
  key: r.id,
2195
2195
  class: "tpl-block-item"
2196
- }, [A("div", Ai, [r.type === "wrapper" ? (i(), T(t(ce(r)), {
2196
+ }, [A("div", Ai, [r.type === "wrapper" ? (i(), T(t(le(r)), {
2197
2197
  key: 0,
2198
2198
  block: r,
2199
2199
  viewport: n.viewport
2200
- }, null, 8, ["block", "viewport"])) : (i(), T(_n, {
2200
+ }, null, 8, ["block", "viewport"])) : (i(), T(hn, {
2201
2201
  key: 1,
2202
2202
  block: r,
2203
2203
  "display-block": S(h)(r),
2204
- "is-selected": !n.previewMode && !Y.value && n.selectedBlockId === r.id && !le(r.id),
2205
- picked: de(r.id),
2204
+ "is-selected": !n.previewMode && !X.value && n.selectedBlockId === r.id && !ue(r.id),
2205
+ picked: fe(r.id),
2206
2206
  viewport: n.viewport,
2207
2207
  "preview-mode": n.previewMode,
2208
- onSelect: (e) => ue(r.id)
2208
+ onSelect: (e) => de(r.id)
2209
2209
  }, {
2210
- default: a(() => [(i(), T(t(ce(r)), e({ block: S(h)(r) }, { ref_for: !0 }, r.type === "section" ? { sourceBlock: r } : {}, {
2210
+ default: a(() => [(i(), T(t(le(r)), e({ block: S(h)(r) }, { ref_for: !0 }, r.type === "section" ? { sourceBlock: r } : {}, {
2211
2211
  viewport: n.viewport,
2212
- onFetchData: (e) => X(r, e),
2212
+ onFetchData: (e) => pe(r, e),
2213
2213
  onUpdate: (e) => S(m).updateBlock(r.id, e)
2214
2214
  }), null, 16, [
2215
2215
  "block",
@@ -2237,7 +2237,7 @@ var yi = ["aria-label"], bi = ["lang", "dir"], xi = {
2237
2237
  }), [["__scopeId", "data-v-c72f1327"]]), Mi = n({
2238
2238
  name: "CustomBlockStylesheets",
2239
2239
  setup() {
2240
- let e = f(Ot, null);
2240
+ let e = f(At, null);
2241
2241
  return () => e ? e.value.map((e, t) => r("style", {
2242
2242
  key: t,
2243
2243
  "data-tpl-custom-block-stylesheet": "",
@@ -2281,7 +2281,7 @@ var Pi = ["aria-label"], Fi = {
2281
2281
  }, Vi = 4, Hi = /* @__PURE__ */ n({
2282
2282
  __name: "Sidebar",
2283
2283
  setup(e) {
2284
- let { t: n, format: r } = $(), s = f(kt, []), c = f(gt, void 0), u = f(Tt, void 0), d = f(Bt, null), p = Qn(), h = f(Et, {}), g = P(() => h.savedBlocks?.isAvailable.value === !0), _ = z(!1), v = z(!1), b = z(null), x = !1, C = 0;
2284
+ let { t: n, format: r } = $(), s = f(jt, []), c = f(vt, void 0), u = f(Dt, void 0), d = f(Ht, null), p = Gn(), h = f(Ot, {}), g = P(() => h.savedBlocks?.isAvailable.value === !0), _ = z(!1), v = z(!1), b = z(null), x = !1, C = 0;
2285
2285
  m(() => {
2286
2286
  window.clearTimeout(C);
2287
2287
  });
@@ -2322,7 +2322,7 @@ var Pi = ["aria-label"], Fi = {
2322
2322
  }
2323
2323
  let L = [
2324
2324
  "section",
2325
- gn,
2325
+ mn,
2326
2326
  "image",
2327
2327
  "title",
2328
2328
  "paragraph",
@@ -2337,27 +2337,27 @@ var Pi = ["aria-label"], Fi = {
2337
2337
  ], te = P(() => {
2338
2338
  let e = L.map((e) => ({
2339
2339
  type: e,
2340
- label: Fe(e, n)
2340
+ label: ae(e, n)
2341
2341
  }));
2342
2342
  return h.plan && e.splice(-1, 0, {
2343
2343
  type: "countdown",
2344
- label: Fe("countdown", n)
2344
+ label: ae("countdown", n)
2345
2345
  }), e;
2346
2346
  }), V = P(() => s.map((e) => ({
2347
2347
  type: `custom:${e.type}`,
2348
2348
  label: e.name,
2349
2349
  isCustom: !0,
2350
2350
  icon: e.icon
2351
- }))), U = P(() => [...te.value, ...V.value]), W = P(() => Ni(U.value, c)), ne = P(() => W.value.items), G = /* @__PURE__ */ new Set();
2352
- o(() => W.value.unknown, (e) => {
2353
- for (let t of e) G.has(t) || (G.add(t), In.warn(`config.paletteBlocks: "${t}" is not a built-in or registered custom block (use the "custom:" prefix for custom blocks) — skipping it in the palette.`));
2351
+ }))), U = P(() => [...te.value, ...V.value]), ne = P(() => Ni(U.value, c)), W = P(() => ne.value.items), G = /* @__PURE__ */ new Set();
2352
+ o(() => ne.value.unknown, (e) => {
2353
+ for (let t of e) G.has(t) || (G.add(t), qn.warn(`config.paletteBlocks: "${t}" is not a built-in or registered custom block (use the "custom:" prefix for custom blocks) — skipping it in the palette.`));
2354
2354
  }, { immediate: !0 });
2355
2355
  function K(e) {
2356
2356
  if (e.isCustom) {
2357
2357
  let t = e.type.replace("custom:", ""), n = s.find((e) => e.type === t);
2358
- if (n) return ue(n);
2358
+ if (n) return xe(n);
2359
2359
  }
2360
- return e.type === "hero" ? wn(u?.value, n.blockDefaults.paragraph) : Te(e.type, u?.value);
2360
+ return e.type === "hero" ? Sn(u?.value, n.blockDefaults.paragraph) : Re(e.type, u?.value);
2361
2361
  }
2362
2362
  function q(e) {
2363
2363
  if (!d) return;
@@ -2397,7 +2397,7 @@ var Pi = ["aria-label"], Fi = {
2397
2397
  "stroke-width": 1.5,
2398
2398
  class: "tpl:shrink-0"
2399
2399
  }), _.value ? (i(), y("span", Li, j(S(n).savedBlocks.title), 1)) : w("", !0)], 12, Ii)])) : w("", !0), H(S(R), {
2400
- "model-value": ne.value,
2400
+ "model-value": W.value,
2401
2401
  group: {
2402
2402
  name: "blocks",
2403
2403
  pull: "clone",
@@ -2414,7 +2414,7 @@ var Pi = ["aria-label"], Fi = {
2414
2414
  onUnchoose: k,
2415
2415
  onEnd: I
2416
2416
  }, {
2417
- default: a(() => [(i(!0), y(B, null, l(ne.value, (e) => (i(), y("button", {
2417
+ default: a(() => [(i(!0), y(B, null, l(W.value, (e) => (i(), y("button", {
2418
2418
  key: e.type,
2419
2419
  type: "button",
2420
2420
  "data-palette-type": e.type,
@@ -2423,11 +2423,11 @@ var Pi = ["aria-label"], Fi = {
2423
2423
  style: F({ justifyContent: _.value ? "flex-start" : "center" }),
2424
2424
  onClick: (t) => J(e),
2425
2425
  onKeydown: (t) => re(t, e)
2426
- }, [A("div", zi, [S(er)[e.type] ? (i(), T(t(S(er)[e.type]), {
2426
+ }, [A("div", zi, [S(Yn)[e.type] ? (i(), T(t(S(Yn)[e.type]), {
2427
2427
  key: 0,
2428
2428
  size: 20,
2429
2429
  "stroke-width": 1.5
2430
- })) : e.isCustom ? (i(), T(Fn, {
2430
+ })) : e.isCustom ? (i(), T(Nn, {
2431
2431
  key: 1,
2432
2432
  icon: e.icon,
2433
2433
  size: 20
@@ -2491,7 +2491,7 @@ var Pi = ["aria-label"], Fi = {
2491
2491
  "update-settings"
2492
2492
  ], ["update:tab"]),
2493
2493
  setup(e, { emit: t }) {
2494
- let n = g(() => import("./chunks/Toolbar-C_Hfsher.js").then((e) => e.t)), r = g(() => import("./chunks/TemplateSettings-JMUo0LIV.js")), a = g(() => import("./chunks/IssuesPanel-DnSnEh1X.js")), s = e, c = t, { t: l } = $(), u = _(e, "tab"), d = f(dt, null), p = P(() => d !== null && !d.unavailable.value), m = P(() => d?.issues.value.length ?? 0), h = f(Dt, new Set(Ln)), v = P(() => h.size > 0);
2494
+ let n = g(() => import("./chunks/Toolbar-VH07SzX7.js").then((e) => e.t)), r = g(() => import("./chunks/TemplateSettings-YwwRbxPc.js")), a = g(() => import("./chunks/IssuesPanel-CrplCzo8.js")), s = e, c = t, { t: l } = $(), u = _(e, "tab"), d = f(pt, null), p = P(() => d !== null && !d.unavailable.value), m = P(() => d?.issues.value.length ?? 0), h = f(kt, new Set(Xn)), v = P(() => h.size > 0);
2495
2495
  function b(e) {
2496
2496
  return u.value === e ? "tpl:flex-1 tpl:text-[var(--tpl-primary)]" : "tpl:shrink-0 tpl:text-[var(--tpl-text-muted)] tpl:hover:text-[var(--tpl-text)]";
2497
2497
  }
@@ -2870,8 +2870,8 @@ var ga = [
2870
2870
  kind: {}
2871
2871
  },
2872
2872
  setup(e) {
2873
- let t = e, { t: n, format: r } = $(), a = f(At, void 0), o = z(0);
2874
- tn(() => {
2873
+ let t = e, { t: n, format: r } = $(), a = f(Mt, void 0), o = z(0);
2874
+ tr(() => {
2875
2875
  o.value += 1;
2876
2876
  }, 6e4);
2877
2877
  let s = P(() => {
@@ -2879,7 +2879,7 @@ var ga = [
2879
2879
  if (e === null) return "";
2880
2880
  let i = e === n.time.justNow;
2881
2881
  return t.kind === "updatedAt" ? i ? n.header.updatedJustNow : r(n.header.updatedAt, { time: e }) : i ? n.header.createdJustNow : r(n.header.createdAt, { time: e });
2882
- }), c = P(() => Kn(t.iso, a));
2882
+ }), c = P(() => nr(t.iso, a));
2883
2883
  return (e, t) => s.value ? (i(), y("span", {
2884
2884
  key: 0,
2885
2885
  "data-testid": "template-timestamp",
@@ -2982,7 +2982,7 @@ var ga = [
2982
2982
  ai: {}
2983
2983
  },
2984
2984
  setup(e) {
2985
- let t = g(() => import("./chunks/VersionHistoryMenu-C8ucm43v.js")), n = g(() => import("./chunks/LanguageMenu-C2I_yTL5.js")), r = g(() => import("./chunks/CollaboratorBar-C1ZI2xwa.js")), a = L(null), o = L(null), { compact: s, fullWidth: c } = ha(a, o);
2985
+ let t = g(() => import("./chunks/VersionHistoryMenu-DkwbKhBl.js")), n = g(() => import("./chunks/LanguageMenu-B6MNInCL.js")), r = g(() => import("./chunks/CollaboratorBar-C1ZI2xwa.js")), a = L(null), o = L(null), { compact: s, fullWidth: c } = ha(a, o);
2986
2986
  return (l, u) => (i(), y("div", {
2987
2987
  ref_key: "containerElement",
2988
2988
  ref: a,
@@ -3040,7 +3040,7 @@ var ga = [
3040
3040
  h(l.$slots, "left-extras")
3041
3041
  ]),
3042
3042
  A("div", Pa, [
3043
- H(tr, {
3043
+ H(Zn, {
3044
3044
  viewport: e.editor.state.viewport,
3045
3045
  onChange: e.editor.setViewport
3046
3046
  }, null, 8, ["viewport", "onChange"]),
@@ -3175,11 +3175,11 @@ var ga = [
3175
3175
  }, co = "tpl-merge-tag-picker-list", lo = /* @__PURE__ */ n({
3176
3176
  __name: "MergeTagPickerModal",
3177
3177
  setup(e) {
3178
- let t = Lt(mt, "MergeTagPickerModal"), { t: n, format: r } = $(), s = f(zt, null), u = f(Ct, null), d = f(Vt, !0), p = P(() => t.current.value !== null), m = P(() => p.value ? n.mergeTag.picker.changeTitle : n.mergeTag.picker.title);
3178
+ let t = zt(gt, "MergeTagPickerModal"), { t: n, format: r } = $(), s = f(Vt, null), u = f(Tt, null), d = f(Ut, !0), p = P(() => t.current.value !== null), m = P(() => p.value ? n.mergeTag.picker.changeTitle : n.mergeTag.picker.title);
3179
3179
  function h(e) {
3180
3180
  return d ? e.description ? `${e.value} — ${e.description}` : e.value : e.description || void 0;
3181
3181
  }
3182
- let g = z(""), _ = en(g, 200), v = z(null), b = P(() => _.value.trim().length > 0), E = z(0), O = P(() => t.tags.value.some((e) => !!e.group)), M = z(/* @__PURE__ */ new Set());
3182
+ let g = z(""), _ = er(g, 200), v = z(null), b = P(() => _.value.trim().length > 0), E = z(0), O = P(() => t.tags.value.some((e) => !!e.group)), M = z(/* @__PURE__ */ new Set());
3183
3183
  function N(e) {
3184
3184
  return M.value.has(e);
3185
3185
  }
@@ -3229,21 +3229,21 @@ var ga = [
3229
3229
  }
3230
3230
  return a;
3231
3231
  }), V = P(() => R.value.flatMap((e) => e.kind === "tag" ? [e.tag] : [])), U = !1;
3232
- function W(e) {
3232
+ function ne(e) {
3233
3233
  let n = t.current.value;
3234
3234
  if (!n) return !1;
3235
3235
  let r = e.findIndex((e) => e.value === n.value);
3236
3236
  return r !== -1 && (E.value = r, !0);
3237
3237
  }
3238
- function ne(e) {
3238
+ function W(e) {
3239
3239
  U = !1, E.value = e;
3240
3240
  }
3241
3241
  o(() => t.isOpen.value, (e) => {
3242
- e ? (g.value = "", E.value = 0, M.value = /* @__PURE__ */ new Set(), U = !W(V.value), D(() => {
3242
+ e ? (g.value = "", E.value = 0, M.value = /* @__PURE__ */ new Set(), U = !ne(V.value), D(() => {
3243
3243
  v.value?.focus();
3244
3244
  })) : U = !1;
3245
3245
  }), o(V, (e) => {
3246
- U && W(e) ? U = !1 : E.value >= e.length && (E.value = Math.max(0, e.length - 1));
3246
+ U && ne(e) ? U = !1 : E.value >= e.length && (E.value = Math.max(0, e.length - 1));
3247
3247
  });
3248
3248
  function G(e) {
3249
3249
  t.resolve(e);
@@ -3298,14 +3298,14 @@ var ga = [
3298
3298
  t && G(t);
3299
3299
  }
3300
3300
  }
3301
- function ce() {
3301
+ function Y() {
3302
3302
  if (V.value.length !== 0) return `${co}-opt-${E.value}`;
3303
3303
  }
3304
- function le(e) {
3304
+ function ce(e) {
3305
3305
  return `${co}-opt-${e}`;
3306
3306
  }
3307
- let ue = P(() => t.tags.value.length === 0), de = P(() => !ue.value && L.value.length === 0), Y = P(() => O.value && te.value.length > 1 && !b.value);
3308
- return (e, o) => (i(), T(zn, {
3307
+ let le = P(() => t.tags.value.length === 0), ue = P(() => !le.value && L.value.length === 0), de = P(() => O.value && te.value.length > 1 && !b.value);
3308
+ return (e, o) => (i(), T($t, {
3309
3309
  visible: S(t).isOpen.value,
3310
3310
  onClose: K,
3311
3311
  onKeydown: se
@@ -3346,11 +3346,11 @@ var ga = [
3346
3346
  placeholder: S(n).mergeTag.picker.searchPlaceholder,
3347
3347
  "aria-label": S(n).mergeTag.picker.searchAriaLabel,
3348
3348
  "aria-controls": co,
3349
- "aria-activedescendant": ce(),
3349
+ "aria-activedescendant": Y(),
3350
3350
  "data-testid": "merge-tag-picker-search",
3351
3351
  onKeydown: o[1] ||= x(k(() => {}, ["prevent"]), ["enter"])
3352
3352
  }, null, 40, Ya), [[ee, g.value]])]),
3353
- Y.value ? (i(), y("div", Xa, [(i(!0), y(B, null, l(te.value, (e) => (i(), y("button", {
3353
+ de.value ? (i(), y("div", Xa, [(i(!0), y(B, null, l(te.value, (e) => (i(), y("button", {
3354
3354
  key: e,
3355
3355
  type: "button",
3356
3356
  class: "tpl:flex tpl:flex-shrink-0 tpl:cursor-pointer tpl:items-center tpl:rounded-full tpl:border tpl:border-[var(--tpl-border)] tpl:bg-transparent tpl:px-2.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
@@ -3366,7 +3366,7 @@ var ga = [
3366
3366
  role: "listbox",
3367
3367
  "aria-label": m.value,
3368
3368
  "data-testid": "merge-tag-picker-list"
3369
- }, [ue.value ? (i(), y("div", $a, j(S(n).mergeTag.picker.empty), 1)) : de.value ? (i(), y("div", eo, j(S(n).mergeTag.picker.noResults), 1)) : (i(!0), y(B, { key: 2 }, l(R.value, (e, a) => (i(), y(B, { key: a }, [e.kind === "header" ? (i(), y("button", {
3369
+ }, [le.value ? (i(), y("div", $a, j(S(n).mergeTag.picker.empty), 1)) : ue.value ? (i(), y("div", eo, j(S(n).mergeTag.picker.noResults), 1)) : (i(!0), y(B, { key: 2 }, l(R.value, (e, a) => (i(), y(B, { key: a }, [e.kind === "header" ? (i(), y("button", {
3370
3370
  key: 0,
3371
3371
  ref_for: !0,
3372
3372
  ref: (t) => ie(e.group, t),
@@ -3388,7 +3388,7 @@ var ga = [
3388
3388
  A("span", no, " (" + j(S(r)(S(n).mergeTag.picker.groupCount, { count: e.count })) + ") ", 1)
3389
3389
  ], 8, to)) : (i(), y("button", {
3390
3390
  key: 1,
3391
- id: le(e.index),
3391
+ id: ce(e.index),
3392
3392
  type: "button",
3393
3393
  role: "option",
3394
3394
  "aria-selected": e.index === E.value,
@@ -3399,7 +3399,7 @@ var ga = [
3399
3399
  title: h(e.tag),
3400
3400
  class: C(["tpl:flex tpl:w-full tpl:cursor-pointer tpl:flex-col tpl:items-start tpl:gap-0.5 tpl:border-none tpl:px-3 tpl:py-1.5 tpl:text-left tpl:transition-colors", e.index === E.value ? "tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:bg-transparent tpl:text-[var(--tpl-text)] tpl:hover:bg-[var(--tpl-bg-hover)]"]),
3401
3401
  "data-testid": "merge-tag-picker-item",
3402
- onMousemove: (t) => ne(e.index),
3402
+ onMousemove: (t) => W(e.index),
3403
3403
  onClick: (t) => G(e.tag)
3404
3404
  }, [
3405
3405
  A("span", io, j(e.tag.label), 1),
@@ -3418,7 +3418,7 @@ var ga = [
3418
3418
  syntax: {}
3419
3419
  },
3420
3420
  setup(e) {
3421
- let t = e, n = P(() => fe(t.value, t.syntax)), r = P(() => q(t.value, t.syntax));
3421
+ let t = e, n = P(() => Te(t.value, t.syntax)), r = P(() => X(t.value, t.syntax));
3422
3422
  return (e, t) => n.value ? (i(), y("span", {
3423
3423
  key: 0,
3424
3424
  class: "tpl:inline-flex tpl:flex-shrink-0 tpl:items-center tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:leading-none tpl:font-bold tpl:tracking-wide tpl:uppercase",
@@ -3463,7 +3463,7 @@ var ga = [
3463
3463
  }, Ao = "tpl-logic-picker-list", jo = /* @__PURE__ */ n({
3464
3464
  __name: "LogicTagPickerModal",
3465
3465
  setup(e) {
3466
- let t = Lt(_t, "LogicTagPickerModal"), { t: n } = $(), r = f(ft, J.liquid), s = f(zt, null), u = f(Ct, null), d = z(""), p = en(d, 200), m = z(null), h = P(() => p.value.trim().length > 0), g = z(0);
3466
+ let t = zt(yt, "LogicTagPickerModal"), { t: n } = $(), r = f(mt, pe.liquid), s = f(Vt, null), u = f(Tt, null), d = z(""), p = er(d, 200), m = z(null), h = P(() => p.value.trim().length > 0), g = z(0);
3467
3467
  function _(e) {
3468
3468
  let t = p.value.trim().toLowerCase();
3469
3469
  return !t || e.filter(Boolean).join(" ").toLowerCase().includes(t);
@@ -3531,14 +3531,14 @@ var ga = [
3531
3531
  function U() {
3532
3532
  t.resolve(null);
3533
3533
  }
3534
- function W(e) {
3534
+ function ne(e) {
3535
3535
  I.value.length !== 0 && (g.value = Math.max(0, Math.min(I.value.length - 1, g.value + e)), D(() => {
3536
3536
  R.value?.querySelector(`[data-logic-index="${g.value}"]`)?.scrollIntoView({ block: "nearest" });
3537
3537
  }));
3538
3538
  }
3539
- function ne(e) {
3540
- if (e.key === "ArrowDown") e.preventDefault(), W(1);
3541
- else if (e.key === "ArrowUp") e.preventDefault(), W(-1);
3539
+ function W(e) {
3540
+ if (e.key === "ArrowDown") e.preventDefault(), ne(1);
3541
+ else if (e.key === "ArrowUp") e.preventDefault(), ne(-1);
3542
3542
  else if (e.key === "Enter") {
3543
3543
  e.preventDefault();
3544
3544
  let t = I.value[g.value];
@@ -3551,10 +3551,10 @@ var ga = [
3551
3551
  function K() {
3552
3552
  return I.value.length === 0 ? void 0 : `${Ao}-opt-${g.value}`;
3553
3553
  }
3554
- return (e, o) => (i(), T(zn, {
3554
+ return (e, o) => (i(), T($t, {
3555
3555
  visible: S(t).isOpen.value,
3556
3556
  onClose: U,
3557
- onKeydown: ne
3557
+ onKeydown: W
3558
3558
  }, {
3559
3559
  default: a(() => [A("div", {
3560
3560
  role: "dialog",
@@ -3663,7 +3663,7 @@ var ga = [
3663
3663
  },
3664
3664
  setup(e, { expose: t }) {
3665
3665
  let n = e;
3666
- s(yt, {
3666
+ s(xt, {
3667
3667
  renderHtml: () => n.renderHtml?.() ?? Promise.reject(/* @__PURE__ */ Error("HTML rendering is unavailable")),
3668
3668
  canRenderHtml: () => n.canRenderHtml?.() ?? !1,
3669
3669
  cloud: !!n.cloud,
@@ -3676,8 +3676,8 @@ var ga = [
3676
3676
  get syntax() {
3677
3677
  return X.mergeTagSyntax;
3678
3678
  }
3679
- }, l = n.config.templates ? Un(n.config.templates, r) : void 0;
3680
- n.config.collaboration && !l && In.warn("config.collaboration needs config.templates: collaboration runs on a loaded template, and only a templates provider loads one. Collaboration is off.");
3679
+ }, l = n.config.templates ? Ln(n.config.templates, r) : void 0;
3680
+ n.config.collaboration && !l && qn.warn("config.collaboration needs config.templates: collaboration runs on a loaded template, and only a templates provider loads one. Collaboration is off.");
3681
3681
  let u = n.config.collaboration && l ? Vr({
3682
3682
  provider: n.config.collaboration,
3683
3683
  loadTemplate: (e) => l.load(e),
@@ -3689,11 +3689,11 @@ var ga = [
3689
3689
  let e = h.state.template;
3690
3690
  return e ? {
3691
3691
  ...E(e),
3692
- content: Ce(E(h.content.value))
3692
+ content: Ie(E(h.content.value))
3693
3693
  } : null;
3694
3694
  }) : l, m = z(0);
3695
- s(vt, n.config.localization);
3696
- let h = Ne({
3695
+ s(bt, n.config.localization);
3696
+ let h = re({
3697
3697
  localization: n.config.localization ?? { locales: [] },
3698
3698
  onLocaleChange: n.config.onLocaleChange,
3699
3699
  onStructureChange: () => {
@@ -3707,8 +3707,8 @@ var ga = [
3707
3707
  lockedBlocks: u?.locks,
3708
3708
  lockLocale: u?.core.lockLocale,
3709
3709
  lockSessionId: u?.core.sessionId
3710
- }), _ = Ht(h);
3711
- s(jt, _.content), h.setCustomBlockDefinitions(n.config.customBlocks ?? []), u && o(h.activeLocale, (e) => u.core.setLockLocale(e), { flush: "sync" }), u?.attach(h);
3710
+ }), _ = dt(h);
3711
+ s(Nt, _.content), h.setCustomBlockDefinitions(n.config.customBlocks ?? []), u && o(h.activeLocale, (e) => u.core.setLockLocale(e), { flush: "sync" }), u?.attach(h);
3712
3712
  let v = n.cloud ? n.cloud.attach({ editor: h }) : null, x = f ? ci({
3713
3713
  provider: f,
3714
3714
  editor: h,
@@ -3721,19 +3721,19 @@ var ga = [
3721
3721
  editor: h,
3722
3722
  onError: n.config.onError,
3723
3723
  isAvailable: n.cloud ? () => n.cloud.isSavedBlocksAvailable() : void 0
3724
- }) : null, N = g(() => import("./chunks/SavedBlocksPanels-Dfu9N6YW.js")), ee = n.config.media || n.config.onRequestMedia ? ii({
3724
+ }) : null, N = g(() => import("./chunks/SavedBlocksPanels-B41Rk_v1.js")), ee = n.config.media || n.config.onRequestMedia ? ii({
3725
3725
  provider: n.config.media,
3726
3726
  onRequestMedia: n.config.onRequestMedia,
3727
3727
  getTemplateId: () => h.state.template?.id,
3728
3728
  onError: n.config.onError
3729
- }) : null, I = g(() => import("./chunks/MediaPanels-C790ZXuY.js")), L = n.config.testEmail ? pi({
3729
+ }) : null, I = g(() => import("./chunks/MediaPanels-BVrQYz2C.js")), L = n.config.testEmail ? pi({
3730
3730
  provider: n.config.testEmail,
3731
3731
  getContent: () => h.content.value,
3732
3732
  renderMjml: n.renderMjml,
3733
3733
  usesLocalRenderer: n.usesLocalRenderer,
3734
3734
  onError: n.config.onError,
3735
3735
  isAvailable: n.cloud ? () => n.cloud.isTestEmailAvailable() : void 0
3736
- }) : null, R = g(() => import("./chunks/TestEmailPanel-D9ezVDHd.js")), B = n.config.comments ? Hr({
3736
+ }) : null, R = g(() => import("./chunks/TestEmailPanel-BrivPMk2.js")), B = n.config.comments ? Hr({
3737
3737
  provider: n.config.comments,
3738
3738
  editor: h,
3739
3739
  user: n.config.user,
@@ -3741,7 +3741,7 @@ var ga = [
3741
3741
  onError: n.config.onError,
3742
3742
  isAvailable: n.cloud ? () => n.cloud.isCommentsAvailable() : void 0,
3743
3743
  isBlockSaved: n.cloud ? (e) => n.cloud.isBlockSaved(e) : void 0
3744
- }) : null, U = g(() => import("./chunks/CommentsPanel-EtdTzTmq.js")), W = g(() => import("./chunks/AiPanels-jMLVaiKx.js")), G = n.config.ai ? Zr({
3744
+ }) : null, U = g(() => import("./chunks/CommentsPanel-lgjJNrrY.js")), ne = g(() => import("./chunks/AiPanels-Cx3PE2mE.js")), W = n.config.ai ? Zr({
3745
3745
  provider: n.config.ai,
3746
3746
  editor: h,
3747
3747
  localization: n.config.localization ?? { locales: [] },
@@ -3752,16 +3752,16 @@ var ga = [
3752
3752
  collaboration: u,
3753
3753
  history: () => X.history,
3754
3754
  reload: x ? (e, t) => x.load(e, t) : null,
3755
- altMaxLength: () => Yn(cn(n.config)),
3755
+ altMaxLength: () => Hn(on(n.config)),
3756
3756
  mergeTags: () => ti(X.mergeTags.value, X.mergeTagSyntax),
3757
- normalize: (e, t) => Vn(e, t, r),
3757
+ normalize: (e, t) => Fn(e, t, r),
3758
3758
  commentsOpen: B?.isOpen ?? null,
3759
3759
  onError: n.config.onError
3760
3760
  }) : null;
3761
- G && s(Pt, G);
3762
- let K = Ut(h, n.config.customBlocks ?? []);
3763
- s(Rt, K);
3764
- let q = n.config.translation ? Ir({
3761
+ W && s(It, W);
3762
+ let G = ft(h, n.config.customBlocks ?? []);
3763
+ s(Bt, G);
3764
+ let K = n.config.translation ? Ir({
3765
3765
  provider: n.config.translation,
3766
3766
  editor: h,
3767
3767
  localization: n.config.localization,
@@ -3769,43 +3769,43 @@ var ga = [
3769
3769
  history: () => X.history,
3770
3770
  definitions: () => n.config.customBlocks ?? [],
3771
3771
  syntax: () => X.mergeTagSyntax,
3772
- coverage: () => K.value
3772
+ coverage: () => G.value
3773
3773
  }) : null;
3774
- q && s(It, q);
3775
- let J = z(null);
3774
+ K && s(Rt, K);
3775
+ let q = z(null);
3776
3776
  o([() => h.state.template?.id ?? null, h.loadVersion], () => {
3777
- J.value = null;
3777
+ q.value = null;
3778
3778
  }, { flush: "sync" }), o(() => Z(h.content.value), (e) => {
3779
- J.value && J.value.language !== e && (J.value = null);
3779
+ q.value && q.value.language !== e && (q.value = null);
3780
3780
  }, { flush: "sync" });
3781
- let re = Ar({
3781
+ let J = Ar({
3782
3782
  editor: h,
3783
3783
  history: () => X.history,
3784
3784
  collaboration: u
3785
3785
  });
3786
- s(pt, { setDefaultLocale(e) {
3786
+ s(ht, { setDefaultLocale(e) {
3787
3787
  let t = {
3788
3788
  language: e,
3789
3789
  old: Z(h.content.value),
3790
- count: ne(h.content.value, e, n.config.customBlocks).length
3791
- }, r = re.setDefaultLocale(e);
3792
- return r.applied && (J.value = t), r;
3790
+ count: ue(h.content.value, e, n.config.customBlocks).length
3791
+ }, r = J.setDefaultLocale(e);
3792
+ return r.applied && (q.value = t), r;
3793
3793
  } });
3794
- let ie = g(() => import("./chunks/LocaleNotices-Dr9LRCAg.js")), ae = g(() => import("./chunks/CollaborationNotices-CHqUGhOZ.js")), oe = g(() => import("./chunks/CloudPanels-DQnlH_YJ.js")), se = g(() => import("./chunks/CloudHeaderExtras-uUJYJFJ6.js")), ce = g(() => import("./chunks/VersionHistoryPanels-BAdzmhvH.js")), le = hi(n.config.templates?.autoSave, !1), ue = le && x !== null;
3795
- le && x !== null && !x.canSave.value && In.warn("config.templates.autoSave is on but this provider's save is false — there is nothing to persist to. Give it a real save function, or use `onChange` to persist the content yourself."), n.config.changeDebounce !== void 0 && x !== null && n.config.templates?.autoSave === void 0 && !n.config.onChange && In.warn("config.changeDebounce is set but nothing will use it — config.templates.autoSave is unset and there is no onChange either, so the timer has no consumer. Set config.templates.autoSave, or add onChange, so the debounce takes effect.");
3796
- let de = n.config.onChange || ue ? {
3794
+ let ie = g(() => import("./chunks/LocaleNotices-TxeAl8Iq.js")), ae = g(() => import("./chunks/CollaborationNotices-IuLYT2x7.js")), oe = g(() => import("./chunks/CloudPanels-CRztnw4M.js")), se = g(() => import("./chunks/CloudHeaderExtras-uUJYJFJ6.js")), Y = g(() => import("./chunks/VersionHistoryPanels-CgxhMRAl.js")), ce = hi(n.config.templates?.autoSave, !1), le = ce && x !== null;
3795
+ ce && x !== null && !x.canSave.value && qn.warn("config.templates.autoSave is on but this provider's save is false — there is nothing to persist to. Give it a real save function, or use `onChange` to persist the content yourself."), n.config.changeDebounce !== void 0 && x !== null && n.config.templates?.autoSave === void 0 && !n.config.onChange && qn.warn("config.changeDebounce is set but nothing will use it — config.templates.autoSave is unset and there is no onChange either, so the timer has no consumer. Set config.templates.autoSave, or add onChange, so the debounce takes effect.");
3796
+ let de = n.config.onChange || le ? {
3797
3797
  onChange: () => {
3798
- n.config.onChange?.(JSON.parse(JSON.stringify(h.state.content))), ue && x.requestAutoSave();
3798
+ n.config.onChange?.(JSON.parse(JSON.stringify(h.state.content))), le && x.requestAutoSave();
3799
3799
  },
3800
3800
  ...n.config.changeDebounce === void 0 ? {} : { debounce: n.config.changeDebounce }
3801
- } : null, Y = {
3801
+ } : null, fe = {
3802
3802
  ...O ? { savedBlocks: O.capability } : {},
3803
3803
  ...x ? { templates: x.capability } : {},
3804
3804
  ...L ? { testEmail: L.capability } : {},
3805
3805
  ...B ? { comments: B.capability } : {},
3806
3806
  ...u ? { collaboration: u.capability } : {},
3807
- ...G ? { ai: G.capability } : {}
3808
- }, X = En({
3807
+ ...W ? { ai: W.capability } : {}
3808
+ }, X = wn({
3809
3809
  editor: h,
3810
3810
  containerEl: D,
3811
3811
  config: {
@@ -3827,25 +3827,25 @@ var ga = [
3827
3827
  canDropMedia: ee?.canDrop ?? null,
3828
3828
  resolvePreview: n.config.resolvePreview,
3829
3829
  resolveImageUrl: n.config.resolveImageUrl,
3830
- lint: cn(n.config),
3830
+ lint: on(n.config),
3831
3831
  locale: n.config.locale
3832
3832
  },
3833
3833
  translations: n.translations,
3834
3834
  fontsManager: n.fontsManager,
3835
3835
  autoSaveOptions: de,
3836
- capabilities: Y,
3836
+ capabilities: fe,
3837
3837
  editorRoot: n.shadowRoot,
3838
3838
  history: u?.history
3839
- }), fe = z("content");
3839
+ }), pe = z("content");
3840
3840
  o(() => h.state.template?.id, () => {
3841
- h.selectedBlock.value && (fe.value = "content");
3841
+ h.selectedBlock.value && (pe.value = "content");
3842
3842
  });
3843
- let pe = n.cloud && v ? n.cloud.ready({
3843
+ let me = n.cloud && v ? n.cloud.ready({
3844
3844
  core: X,
3845
- capabilities: Y
3846
- }) : null, me = n.config.versionHistory ? mi({
3845
+ capabilities: fe
3846
+ }) : null, he = n.config.versionHistory ? mi({
3847
3847
  provider: n.config.versionHistory,
3848
- editor: Bn(h, r),
3848
+ editor: Pn(h, r),
3849
3849
  history: X.history,
3850
3850
  conditionPreview: X.conditionPreview,
3851
3851
  autoSave: X.autoSave,
@@ -3861,36 +3861,36 @@ var ga = [
3861
3861
  } : null,
3862
3862
  onError: n.config.onError
3863
3863
  }) : null;
3864
- me && (Y.versionHistory = me.capability);
3865
- let he = P(() => B?.isOpen.value === !0 || G !== null && G.panel.value !== null || v?.panelState.rightPanelOpen.value === !0), ge = P(() => h.state.previewMode ? "tpl:left-0 tpl:right-0" : he.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]"), _e = z(null), ve = z(0), ye = P(() => ({ top: `calc(3.5 * var(--tpl-base-size) + ${ve.value}px)` })), be;
3864
+ he && (fe.versionHistory = he.capability);
3865
+ let ge = P(() => B?.isOpen.value === !0 || W !== null && W.panel.value !== null || v?.panelState.rightPanelOpen.value === !0), _e = P(() => h.state.previewMode ? "tpl:left-0 tpl:right-0" : ge.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]"), ve = z(null), ye = z(0), be = P(() => ({ top: `calc(3.5 * var(--tpl-base-size) + ${ye.value}px)` })), xe;
3866
3866
  d(() => {
3867
- ve.value = _e.value?.offsetHeight ?? 0, _e.value && typeof ResizeObserver < "u" && (be = new ResizeObserver(([e]) => {
3868
- e && (ve.value = e.borderBoxSize?.[0]?.blockSize ?? e.contentRect.height);
3869
- }), be.observe(_e.value));
3870
- }), p(() => be?.disconnect());
3871
- let { showNotice: xe } = jn(() => n.config.smallScreenNotice);
3867
+ ye.value = ve.value?.offsetHeight ?? 0, ve.value && typeof ResizeObserver < "u" && (xe = new ResizeObserver(([e]) => {
3868
+ e && (ye.value = e.borderBoxSize?.[0]?.blockSize ?? e.contentRect.height);
3869
+ }), xe.observe(ve.value));
3870
+ }), p(() => xe?.disconnect());
3871
+ let { showNotice: Se } = kn(() => n.config.smallScreenNotice);
3872
3872
  d(async () => {
3873
3873
  await n.fontsManager.loadCustomFonts();
3874
3874
  }), p(() => {
3875
- n.fontsManager.cleanupFontLinks(), G?.destroy(), n.cloud?.destroy(), X.destroy();
3875
+ n.fontsManager.cleanupFontLinks(), W?.destroy(), n.cloud?.destroy(), X.destroy();
3876
3876
  });
3877
- let Se = x ?? h, Q = Qn(X.editorRoot);
3877
+ let Ce = x ?? h, we = Gn(X.editorRoot);
3878
3878
  return t({
3879
3879
  getLocale: () => h.activeLocale.value ?? Z(h.content.value),
3880
3880
  setLocale: (e) => h.setActiveLocale(e),
3881
3881
  getContent: () => h.content.value,
3882
3882
  setContent: (e) => h.setContent(e),
3883
3883
  insertBlock: (e) => {
3884
- if (h.state.previewMode) return In.warn("insertBlock() does nothing in preview mode."), null;
3885
- let t = we(e);
3886
- return _i(h, t) ? (Q(t.id), t.id) : null;
3884
+ if (h.state.previewMode) return qn.warn("insertBlock() does nothing in preview mode."), null;
3885
+ let t = Le(e);
3886
+ return _i(h, t) ? (we(t.id), t.id) : null;
3887
3887
  },
3888
3888
  setTheme: (e) => h.setUiTheme(e),
3889
3889
  setMergeTags: X.setMergeTags,
3890
3890
  isDirty: () => h.state.isDirty,
3891
- create: Se.create,
3892
- load: Se.load,
3893
- save: Se.save,
3891
+ create: Ce.create,
3892
+ load: Ce.load,
3893
+ save: Ce.save,
3894
3894
  renderCustomBlock: X.registry.renderCustomBlock,
3895
3895
  getCustomBlockStylesheet: (e) => X.registry.getDefinition(e)?.stylesheet
3896
3896
  }), (t, r) => (i(), y("div", {
@@ -3911,10 +3911,10 @@ var ga = [
3911
3911
  templates: S(x),
3912
3912
  "show-template-name": e.config.templates?.nameField !== !1,
3913
3913
  "test-email": S(L),
3914
- "version-history": S(me),
3914
+ "version-history": S(he),
3915
3915
  comments: S(B),
3916
3916
  collaboration: S(u),
3917
- ai: S(G)
3917
+ ai: S(W)
3918
3918
  }, V({ _: 2 }, [S(v) ? {
3919
3919
  name: "left-extras",
3920
3920
  fn: a(() => [H(S(se), {
@@ -3941,12 +3941,12 @@ var ga = [
3941
3941
  "collaboration",
3942
3942
  "ai"
3943
3943
  ]),
3944
- c(H(Hi, { style: F(ye.value) }, null, 8, ["style"]), [[te, !S(h).state.previewMode]]),
3944
+ c(H(Hi, { style: F(be.value) }, null, 8, ["style"]), [[te, !S(h).state.previewMode]]),
3945
3945
  A("div", {
3946
- class: C(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto tpl:bg-[var(--tpl-canvas-bg)]", ge.value]),
3947
- style: F([{ transition: "left var(--tpl-transition),\n right var(--tpl-transition)" }, ye.value])
3946
+ class: C(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto tpl:bg-[var(--tpl-canvas-bg)]", _e.value]),
3947
+ style: F([{ transition: "left var(--tpl-transition),\n right var(--tpl-transition)" }, be.value])
3948
3948
  }, [A("div", Po, [A("div", Fo, [H(M, { name: "tpl-preview-pill" }, {
3949
- default: a(() => [S(h).state.previewMode && !S(X).previewResolution.supersedesSamples.value ? (i(), y("div", Io, [H(nr, {
3949
+ default: a(() => [S(h).state.previewMode && !S(X).previewResolution.supersedesSamples.value ? (i(), y("div", Io, [H(Qn, {
3950
3950
  "sample-mode": S(X).mergeTagSampleMode.value,
3951
3951
  onChange: r[0] ||= (e) => S(X).mergeTagSampleMode.value = e
3952
3952
  }, null, 8, ["sample-mode"])])) : w("", !0)]),
@@ -3980,7 +3980,7 @@ var ga = [
3980
3980
  ])])], 6),
3981
3981
  e.config.branding === !1 ? w("", !0) : (i(), T(fa, {
3982
3982
  key: 0,
3983
- "position-class": [ge.value]
3983
+ "position-class": [_e.value]
3984
3984
  }, null, 8, ["position-class"])),
3985
3985
  A("div", {
3986
3986
  class: "tpl-sr-only",
@@ -3990,12 +3990,12 @@ var ga = [
3990
3990
  "aria-label": S(X).t.landmarks.reorderAnnouncements
3991
3991
  }, j(S(X).keyboardReorder.announcement.value), 9, Ro),
3992
3992
  c(H(aa, {
3993
- tab: fe.value,
3994
- "onUpdate:tab": r[2] ||= (e) => fe.value = e,
3995
- style: F([ye.value, { "transition-property": "right" }]),
3993
+ tab: pe.value,
3994
+ "onUpdate:tab": r[2] ||= (e) => pe.value = e,
3995
+ style: F([be.value, { "transition-property": "right" }]),
3996
3996
  "selected-block": S(h).selectedBlock.value ? S(_).displayBlock(S(h).selectedBlock.value) : null,
3997
3997
  settings: S(_).settings.value,
3998
- "shifted-left": he.value,
3998
+ "shifted-left": ge.value,
3999
3999
  onUpdateBlock: r[3] ||= (e) => S(h).updateBlock(S(h).state.selectedBlockId, e),
4000
4000
  onDeleteBlock: r[4] ||= () => {
4001
4001
  S(h).state.selectedBlockId && S(X).blockActions.deleteBlock(S(h).state.selectedBlockId);
@@ -4013,16 +4013,16 @@ var ga = [
4013
4013
  ]), [[te, !S(h).state.previewMode]]),
4014
4014
  A("div", {
4015
4015
  ref_key: "topChrome",
4016
- ref: _e,
4016
+ ref: ve,
4017
4017
  class: "tpl-top-chrome tpl:absolute tpl:top-14 tpl:right-0 tpl:left-0 tpl:z-40"
4018
- }, [S(me)?.isAvailable.value ? (i(), T(S(ce), {
4018
+ }, [S(he)?.isAvailable.value ? (i(), T(S(Y), {
4019
4019
  key: 0,
4020
- feature: S(me)
4020
+ feature: S(he)
4021
4021
  }, null, 8, ["feature"])) : w("", !0), e.config.localization ? (i(), T(kr, {
4022
4022
  key: 1,
4023
4023
  editor: S(h),
4024
4024
  locales: e.config.localization.locales,
4025
- feature: S(q),
4025
+ feature: S(K),
4026
4026
  change: m.value
4027
4027
  }, null, 8, [
4028
4028
  "editor",
@@ -4063,28 +4063,28 @@ var ga = [
4063
4063
  key: 3,
4064
4064
  feature: S(B)
4065
4065
  }, null, 8, ["feature"])) : w("", !0),
4066
- S(G) ? (i(), T(S(W), {
4066
+ S(W) ? (i(), T(S(ne), {
4067
4067
  key: 4,
4068
- feature: S(G)
4068
+ feature: S(W)
4069
4069
  }, null, 8, ["feature"])) : w("", !0),
4070
- S(u) || J.value ? (i(), T(ur, { key: 5 }, {
4070
+ S(u) || q.value ? (i(), T(ur, { key: 5 }, {
4071
4071
  default: a(() => [S(u) ? (i(), T(S(ae), {
4072
4072
  key: 0,
4073
4073
  feature: S(u)
4074
- }, null, 8, ["feature"])) : w("", !0), J.value ? (i(), T(S(ie), {
4074
+ }, null, 8, ["feature"])) : w("", !0), q.value ? (i(), T(S(ie), {
4075
4075
  key: 1,
4076
- notice: J.value,
4077
- onDismiss: r[7] ||= (e) => J.value = null
4076
+ notice: q.value,
4077
+ onDismiss: r[7] ||= (e) => q.value = null
4078
4078
  }, null, 8, ["notice"])) : w("", !0)]),
4079
4079
  _: 1
4080
4080
  })) : w("", !0),
4081
- e.cloud && S(v) && S(pe) ? (i(), T(S(oe), {
4081
+ e.cloud && S(v) && S(me) ? (i(), T(S(oe), {
4082
4082
  key: 6,
4083
4083
  editor: S(h),
4084
4084
  core: S(X),
4085
4085
  runtime: e.cloud,
4086
4086
  cloud: S(v),
4087
- ready: S(pe)
4087
+ ready: S(me)
4088
4088
  }, null, 8, [
4089
4089
  "editor",
4090
4090
  "core",
@@ -4092,7 +4092,7 @@ var ga = [
4092
4092
  "cloud",
4093
4093
  "ready"
4094
4094
  ])) : w("", !0),
4095
- S(xe) ? (i(), T(ua, { key: 7 })) : w("", !0)
4095
+ S(Se) ? (i(), T(ua, { key: 7 })) : w("", !0)
4096
4096
  ], 46, Mo));
4097
4097
  }
4098
4098
  }), [["__scopeId", "data-v-e3760a37"]]), Bo = /@import\s*(?:url\(\s*(?:"[^"]*"|'[^']*'|[^)]*)\s*\)|"[^"]*"|'[^']*')[^;]*;/g;
@@ -4107,8 +4107,8 @@ function Ho(e) {
4107
4107
  };
4108
4108
  }
4109
4109
  async function Uo(e, t) {
4110
- let n = Ce(e.getContent()), r = t?.locale ?? Z(n), i = t?.locale !== void 0 || n.settings?.locales?.length ? le(n, r) : n, a = e.getLayout?.(), o = a ? Se(le(a, r, { missing: "default" }), i) : i;
4111
- return a || (be(o), _e(o)), await ir(o, {
4110
+ let n = Ie(e.getContent()), r = t?.locale ?? Z(n), i = t?.locale !== void 0 || n.settings?.locales?.length ? be(n, r) : n, a = e.getLayout?.(), o = a ? Fe(be(a, r, { missing: "default" }), i) : i;
4111
+ return a || (Ne(o), Ae(o)), await ir(o, {
4112
4112
  renderCustomBlock: e.renderCustomBlock,
4113
4113
  getCustomBlockStylesheet: e.getCustomBlockStylesheet
4114
4114
  }), {
@@ -4183,19 +4183,19 @@ function ts(e, t) {
4183
4183
  n && (t && n.app !== t || (n.cleanup(), n.app.unmount(), Xo.delete(e), Zo === e && (Zo = null)));
4184
4184
  }
4185
4185
  function ns(e) {
4186
- e.layout && (e.layout = Hn(e.layout, e.mergeTags), pe(e.layout)), e.content && (e.content = Hn(e.content, e.mergeTags), be(e.content), _e(e.content));
4186
+ e.layout && (e.layout = In(e.layout, e.mergeTags), Ee(e.layout)), e.content && (e.content = In(e.content, e.mergeTags), Ne(e.content), Ae(e.content));
4187
4187
  }
4188
4188
  async function rs(e) {
4189
4189
  let t = { ...e };
4190
4190
  if (t.translation !== void 0 && (t.translation === null || typeof t.translation != "object" || typeof t.translation.translate != "function")) throw new Q("translation must be an object with a translate function.");
4191
- for (let e of t.localization?.locales ?? []) if (!re(e)) throw new Q(`Invalid localization locale "${e}".`);
4191
+ for (let e of t.localization?.locales ?? []) if (!me(e)) throw new Q(`Invalid localization locale "${e}".`);
4192
4192
  let n = t.localization?.doNotTranslate;
4193
4193
  if (n !== void 0 && (!Array.isArray(n) || n.length > 500 || n.some((e) => typeof e != "string" || e.trim().length < 1 || e.trim().length > 100))) throw new Q("localization.doNotTranslate must be an array of at most 500 terms, each 1–100 characters.");
4194
4194
  return ns(t), is(t, es(t.container));
4195
4195
  }
4196
4196
  async function is(e, { container: t, token: n }, i) {
4197
- e.locale !== void 0 && !un(e.locale) && In.warn(`config.locale: "${e.locale}" has no translations — falling back to English. Supported: ${Sn().sort().join(", ")}.`);
4198
- let a = await sn(e.locale ?? "en"), o = an(e.fonts);
4197
+ e.locale !== void 0 && !cn(e.locale) && qn.warn(`config.locale: "${e.locale}" has no translations — falling back to English. Supported: ${bn().sort().join(", ")}.`);
4198
+ let a = await an(e.locale ?? "en"), o = nn(e.fonts);
4199
4199
  if ($o.get(t) !== n) return as({
4200
4200
  config: e,
4201
4201
  editorRef: z(null),
@@ -4233,7 +4233,7 @@ async function is(e, { container: t, token: n }, i) {
4233
4233
  function as({ config: e, editorRef: t, fontsManager: n, unmount: r }) {
4234
4234
  let i = {
4235
4235
  getContent() {
4236
- return Ce(t.value ? t.value.getContent() : e.content ?? he(e.fonts?.defaultFont, or(e)));
4236
+ return Ie(t.value ? t.value.getContent() : e.content ?? Oe(e.fonts?.defaultFont, or(e)));
4237
4237
  },
4238
4238
  getLocale() {
4239
4239
  return t.value?.getLocale() ?? Z(i.getContent());
@@ -4244,12 +4244,12 @@ function as({ config: e, editorRef: t, fontsManager: n, unmount: r }) {
4244
4244
  t.value?.setLocale(n);
4245
4245
  },
4246
4246
  setContent(n) {
4247
- let r = Hn(n, e.mergeTags);
4247
+ let r = In(n, e.mergeTags);
4248
4248
  t.value && t.value.setContent(r), e.content = r;
4249
4249
  },
4250
4250
  insertBlock(n) {
4251
4251
  let r = { blocks: [n] };
4252
- return be(r), _e(r), t.value ? t.value.insertBlock(Wn(n, e.mergeTags)) : null;
4252
+ return Ne(r), Ae(r), t.value ? t.value.insertBlock(Rn(n, e.mergeTags)) : null;
4253
4253
  },
4254
4254
  setTheme(e) {
4255
4255
  t.value && t.value.setTheme(e);
@@ -4264,7 +4264,7 @@ function as({ config: e, editorRef: t, fontsManager: n, unmount: r }) {
4264
4264
  create(n) {
4265
4265
  return t.value ? t.value.create(n?.content ? {
4266
4266
  ...n,
4267
- content: Hn(n.content, e.mergeTags)
4267
+ content: In(n.content, e.mergeTags)
4268
4268
  } : n) : Promise.reject(/* @__PURE__ */ Error("[Templatical] Editor not ready"));
4269
4269
  },
4270
4270
  load(e) {
@@ -4314,7 +4314,7 @@ async function os(e) {
4314
4314
  mergeTags: e.mergeTags
4315
4315
  };
4316
4316
  ns(t);
4317
- let n = es(e.container), [{ bootstrapCloud: r }, i] = await Promise.all([import("./chunks/createCloudRuntime-PpIFCDfj.js"), fn(e.locale ?? "en")]), { runtime: a, providers: o, user: s } = await r({
4317
+ let n = es(e.container), [{ bootstrapCloud: r }, i] = await Promise.all([import("./chunks/createCloudRuntime-CE79GB1H.js"), un(e.locale ?? "en")]), { runtime: a, providers: o, user: s } = await r({
4318
4318
  config: e,
4319
4319
  cloudTranslations: i
4320
4320
  });
@@ -4365,6 +4365,6 @@ async function os(e) {
4365
4365
  function ss() {
4366
4366
  Zo && ts(Zo);
4367
4367
  }
4368
- export { Xn as AI_ALT_TEXT_RULES, Zn as AI_FIXABLE_RULES, Se as applyLayout, he as createDefaultTemplateContent, Re as createLocalStorageMediaProvider, De as createLocalStorageSavedBlocksProvider, G as createParagraphBlock, ye as createSlotBlock, K as createWrapperBlock, Cn as getBaseLocale, rn as getSupportedCloudLocales, Sn as getSupportedLocales, rs as init, os as initCloud, ln as isCloudLocaleSupported, un as isLocaleSupported, de as isSlot, ve as isWrapper, ge as layoutWrapsSlot, ss as unmount, pe as validateLayout };
4368
+ export { Un as AI_ALT_TEXT_RULES, Wn as AI_FIXABLE_RULES, Fe as applyLayout, Oe as createDefaultTemplateContent, Y as createLocalStorageMediaProvider, ne as createLocalStorageSavedBlocksProvider, de as createParagraphBlock, Me as createSlotBlock, fe as createWrapperBlock, xn as getBaseLocale, tn as getSupportedCloudLocales, bn as getSupportedLocales, rs as init, os as initCloud, sn as isCloudLocaleSupported, cn as isLocaleSupported, Se as isSlot, je as isWrapper, ke as layoutWrapsSlot, ss as unmount, Ee as validateLayout };
4369
4369
 
4370
4370
  //# sourceMappingURL=editor.js.map