@templatical/editor 0.56.0 → 0.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/README.md +1 -1
  2. package/dist/{AiAltTextPopover-DdsvhE78.js → AiAltTextPopover-BjClNscQ.js} +6 -6
  3. package/dist/{AiAltTextReview-P6to1_0t.js → AiAltTextReview-DeMdVbtT.js} +7 -7
  4. package/dist/{AiChatPanel-BSlmzMRC.js → AiChatPanel-Cros4ZCM.js} +64 -67
  5. package/dist/AiPanels-D_CdHqFZ.js +26 -0
  6. package/dist/{AiRewriteMenu-DIISOR6U.js → AiRewriteMenu-BSzj1dKC.js} +53 -53
  7. package/dist/{BlockIssueBadge-Bmtc50BQ.js → BlockIssueBadge-i2cZy5PB.js} +6 -6
  8. package/dist/{BlockPreviewCanvas-BYIzNn-9.js → BlockPreviewCanvas-D-If_vd_.js} +58 -58
  9. package/dist/{CloudHeaderExtras-Cqhw-jMz.js → CloudHeaderExtras-CJsXi4Ku.js} +2 -2
  10. package/dist/{CloudPanels-w34W8_BP.js → CloudPanels-DPeK_siQ.js} +14 -14
  11. package/dist/{CollaborationNotices-HTbCebjV.js → CollaborationNotices-DkYX-ose.js} +9 -9
  12. package/dist/{CollaboratorBar-CLQjksX-.js → CollaboratorBar-xDweDvB6.js} +3 -3
  13. package/dist/CommentsPanel-t3w16YUl.js +23 -0
  14. package/dist/CommentsSidebar-B3M90RY_.js +516 -0
  15. package/dist/{CountdownBlock-BTXcCvjZ.js → CountdownBlock-BrR2uqM3.js} +7 -7
  16. package/dist/{CountdownToolbar-CP-pkntQ.js → CountdownToolbar-DBu2ZqC6.js} +32 -32
  17. package/dist/{IssuesPanel-CiiNBzH0.js → IssuesPanel-BnUut-p-.js} +89 -89
  18. package/dist/LanguageMenu-DfTxrbvp.js +403 -0
  19. package/dist/{LoadingTrack-BG8cg9xi.js → LoadingTrack-c4SeD16s.js} +1 -1
  20. package/dist/{LocaleNotices-CTCZ7BYv.js → LocaleNotices-D6zk-QCL.js} +11 -11
  21. package/dist/{LogicTagInsertButton-DEOPc4RC.js → LogicTagInsertButton-CJ1Jk6jv.js} +65 -65
  22. package/dist/{MediaEditModal-DJsPLTwP.js → MediaEditModal-BxbwZxnf.js} +10 -10
  23. package/dist/{MediaPanels-D2WD2aE2.js → MediaPanels-BiUxsTMM.js} +2 -2
  24. package/dist/{MergeTagInput-C9icdxw7.js → MergeTagInput-CV-z85s9.js} +13 -13
  25. package/dist/{MergeTagModeToggle-DXvb80OE.js → MergeTagModeToggle-CixgX5C_.js} +7 -7
  26. package/dist/{MergeTagTextarea-CrAcmT3A.js → MergeTagTextarea-B1zOC_Nr.js} +9 -9
  27. package/dist/{ParagraphEditor-BWBQ3jKz.js → ParagraphEditor-C9UhWvRB.js} +174 -174
  28. package/dist/{RestoreVersionDialog-CqAp16yQ.js → RestoreVersionDialog-Do7fZWpT.js} +13 -13
  29. package/dist/{RichTextEditorContent-xbBjVPVQ.js → RichTextEditorContent-wW_SMun2.js} +10 -10
  30. package/dist/{SaveBlockDialog-pebNJBTc.js → SaveBlockDialog-CCHIUfR-.js} +49 -49
  31. package/dist/{SavedBlocksBrowserModal-CvagMcv7.js → SavedBlocksBrowserModal-DtPHhfw9.js} +26 -26
  32. package/dist/{SavedBlocksPanels-B9AAVBDm.js → SavedBlocksPanels-CYIby5pR.js} +2 -2
  33. package/dist/{SavedBlocksPickBar-BIANWe3i.js → SavedBlocksPickBar-CCwBugqN.js} +10 -10
  34. package/dist/{TemplateSettings-ORq4PbCN.js → TemplateSettings-B8IVy5q9.js} +42 -42
  35. package/dist/{TestEmailModal-DRjCpcPl.js → TestEmailModal-CS5JoKRH.js} +22 -22
  36. package/dist/{TestEmailPanel-H0v8El__.js → TestEmailPanel-sOIZfKzc.js} +2 -2
  37. package/dist/{TitleEditor-CEGbJXeU.js → TitleEditor-ZlBcq9_P.js} +22 -22
  38. package/dist/{ToggleSwitch-R3wCCYE6.js → ToggleSwitch-BIPdFWUr.js} +1 -1
  39. package/dist/{Toolbar-XT-uGA9J.js → Toolbar-c4_rLLJT.js} +659 -659
  40. package/dist/{TplModal-7NQq5-VW.js → TplModal-DnFFEulp.js} +6 -6
  41. package/dist/{VersionHistoryMenu-C8BE3Pr-.js → VersionHistoryMenu-Cd2IaHgT.js} +19 -19
  42. package/dist/{VersionHistoryPanels-CuKuOSJG.js → VersionHistoryPanels-TdGaMaa_.js} +2 -2
  43. package/dist/{VersionPreviewBanner-BVFBkveR.js → VersionPreviewBanner-lkAf7tc8.js} +8 -8
  44. package/dist/{WrapperBlock-Bdw-072t.js → WrapperBlock-BiW4ye3w.js} +12 -12
  45. package/dist/{blockTypeIcons-CGplGmmr.js → blockTypeIcons-D1aYMC1M.js} +3 -3
  46. package/dist/bundle-stats.json +7 -7
  47. package/dist/cdn/chunks/{AiAltTextPopover-x999Gimz.js → AiAltTextPopover-CfGJNBOb.js} +6 -6
  48. package/dist/cdn/chunks/{AiAltTextPopover-x999Gimz.js.map → AiAltTextPopover-CfGJNBOb.js.map} +1 -1
  49. package/dist/cdn/chunks/{AiAltTextReview-DjnFz1wO.js → AiAltTextReview-PKe31R_g.js} +7 -7
  50. package/dist/cdn/chunks/{AiAltTextReview-DjnFz1wO.js.map → AiAltTextReview-PKe31R_g.js.map} +1 -1
  51. package/dist/cdn/chunks/{AiChatPanel-DKDu9cs7.js → AiChatPanel-DNCUpV8n.js} +112 -115
  52. package/dist/cdn/chunks/AiChatPanel-DNCUpV8n.js.map +1 -0
  53. package/dist/cdn/chunks/AiPanels-IV0VEkBL.js +27 -0
  54. package/dist/cdn/chunks/AiPanels-IV0VEkBL.js.map +1 -0
  55. package/dist/cdn/chunks/{AiRewriteMenu-s79rmHFy.js → AiRewriteMenu-ZDBwReuU.js} +61 -61
  56. package/dist/cdn/chunks/AiRewriteMenu-ZDBwReuU.js.map +1 -0
  57. package/dist/cdn/chunks/{BlockIssueBadge-Bnmq_M4G.js → BlockIssueBadge-DIlFDDwh.js} +6 -6
  58. package/dist/cdn/chunks/BlockIssueBadge-DIlFDDwh.js.map +1 -0
  59. package/dist/cdn/chunks/BlockPreviewCanvas-D7U6nQ7t.js +156 -0
  60. package/dist/cdn/chunks/BlockPreviewCanvas-D7U6nQ7t.js.map +1 -0
  61. package/dist/cdn/chunks/{CloudHeaderExtras-uUJYJFJ6.js → CloudHeaderExtras-CazfMn6A.js} +3 -3
  62. package/dist/cdn/chunks/{CloudHeaderExtras-uUJYJFJ6.js.map → CloudHeaderExtras-CazfMn6A.js.map} +1 -1
  63. package/dist/cdn/chunks/{CloudPanels-DQnlH_YJ.js → CloudPanels-EXXNMLbs.js} +5 -5
  64. package/dist/cdn/chunks/CloudPanels-EXXNMLbs.js.map +1 -0
  65. package/dist/cdn/chunks/{CollaborationNotices-CHqUGhOZ.js → CollaborationNotices-DGA8XRZJ.js} +10 -10
  66. package/dist/cdn/chunks/{CollaborationNotices-CHqUGhOZ.js.map → CollaborationNotices-DGA8XRZJ.js.map} +1 -1
  67. package/dist/cdn/chunks/{CollaboratorBar-C1ZI2xwa.js → CollaboratorBar-BWL1Shc1.js} +4 -4
  68. package/dist/cdn/chunks/{CollaboratorBar-C1ZI2xwa.js.map → CollaboratorBar-BWL1Shc1.js.map} +1 -1
  69. package/dist/cdn/chunks/CommentsPanel-4mrl4zMK.js +24 -0
  70. package/dist/cdn/chunks/CommentsPanel-4mrl4zMK.js.map +1 -0
  71. package/dist/cdn/chunks/CommentsSidebar-BJ87vc7i.js +486 -0
  72. package/dist/cdn/chunks/CommentsSidebar-BJ87vc7i.js.map +1 -0
  73. package/dist/cdn/chunks/{CountdownBlock-DyGsh92b.js → CountdownBlock-Do6oItNW.js} +8 -8
  74. package/dist/cdn/chunks/{CountdownBlock-DyGsh92b.js.map → CountdownBlock-Do6oItNW.js.map} +1 -1
  75. package/dist/cdn/chunks/{CountdownToolbar-Ddj2erNm.js → CountdownToolbar-BN2_zvRj.js} +52 -52
  76. package/dist/cdn/chunks/{CountdownToolbar-Ddj2erNm.js.map → CountdownToolbar-BN2_zvRj.js.map} +1 -1
  77. package/dist/cdn/chunks/{IssuesPanel-DnSnEh1X.js → IssuesPanel-BDwegn0s.js} +14 -14
  78. package/dist/cdn/chunks/IssuesPanel-BDwegn0s.js.map +1 -0
  79. package/dist/cdn/chunks/{LanguageMenu-C2I_yTL5.js → LanguageMenu-DXq9cXUd.js} +58 -58
  80. package/dist/cdn/chunks/LanguageMenu-DXq9cXUd.js.map +1 -0
  81. package/dist/cdn/chunks/{LoadingTrack-DUYcDHOV.js → LoadingTrack-o-89hApJ.js} +2 -2
  82. package/dist/cdn/chunks/{LoadingTrack-DUYcDHOV.js.map → LoadingTrack-o-89hApJ.js.map} +1 -1
  83. package/dist/cdn/chunks/{LocaleNotices-Dr9LRCAg.js → LocaleNotices-CUN5K5QJ.js} +11 -11
  84. package/dist/cdn/chunks/{LocaleNotices-Dr9LRCAg.js.map → LocaleNotices-CUN5K5QJ.js.map} +1 -1
  85. package/dist/cdn/chunks/{LogicTagInsertButton-BdzE9-l7.js → LogicTagInsertButton-BEArlbra.js} +12 -12
  86. package/dist/cdn/chunks/{LogicTagInsertButton-BdzE9-l7.js.map → LogicTagInsertButton-BEArlbra.js.map} +1 -1
  87. package/dist/cdn/chunks/{MediaEditModal-CMJFXu_o.js → MediaEditModal-BHTMNHx0.js} +10 -10
  88. package/dist/cdn/chunks/{MediaEditModal-CMJFXu_o.js.map → MediaEditModal-BHTMNHx0.js.map} +1 -1
  89. package/dist/cdn/chunks/{MediaPanels-C790ZXuY.js → MediaPanels-BlianNRh.js} +3 -3
  90. package/dist/cdn/chunks/{MediaPanels-C790ZXuY.js.map → MediaPanels-BlianNRh.js.map} +1 -1
  91. package/dist/cdn/chunks/{MergeTagInput-CmrX8Md6.js → MergeTagInput-B3SLXXzL.js} +14 -14
  92. package/dist/cdn/chunks/{MergeTagInput-CmrX8Md6.js.map → MergeTagInput-B3SLXXzL.js.map} +1 -1
  93. package/dist/cdn/chunks/{MergeTagModeToggle-D7maMGIM.js → MergeTagModeToggle-Dywp9ntA.js} +6 -6
  94. package/dist/cdn/chunks/{MergeTagModeToggle-D7maMGIM.js.map → MergeTagModeToggle-Dywp9ntA.js.map} +1 -1
  95. package/dist/cdn/chunks/{MergeTagTextarea-KOnd2teB.js → MergeTagTextarea-B9TM7FgM.js} +7 -7
  96. package/dist/cdn/chunks/{MergeTagTextarea-KOnd2teB.js.map → MergeTagTextarea-B9TM7FgM.js.map} +1 -1
  97. package/dist/cdn/chunks/{ParagraphEditor-I9lbKaPk.js → ParagraphEditor-CVGtTYta.js} +107 -107
  98. package/dist/cdn/chunks/{ParagraphEditor-I9lbKaPk.js.map → ParagraphEditor-CVGtTYta.js.map} +1 -1
  99. package/dist/cdn/chunks/{RestoreVersionDialog-DqbULAbc.js → RestoreVersionDialog-Dt_0qOOW.js} +13 -13
  100. package/dist/cdn/chunks/RestoreVersionDialog-Dt_0qOOW.js.map +1 -0
  101. package/dist/cdn/chunks/{RichTextEditorContent-_O22z0pn.js → RichTextEditorContent-BjN4mnzL.js} +9 -9
  102. package/dist/cdn/chunks/{RichTextEditorContent-_O22z0pn.js.map → RichTextEditorContent-BjN4mnzL.js.map} +1 -1
  103. package/dist/cdn/chunks/{SaveBlockDialog-CClRLXgF.js → SaveBlockDialog-D9eBjE99.js} +51 -51
  104. package/dist/cdn/chunks/{SaveBlockDialog-CClRLXgF.js.map → SaveBlockDialog-D9eBjE99.js.map} +1 -1
  105. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BIaxaxw9.js → SavedBlocksBrowserModal-ClsTpkdk.js} +24 -24
  106. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BIaxaxw9.js.map → SavedBlocksBrowserModal-ClsTpkdk.js.map} +1 -1
  107. package/dist/cdn/chunks/{SavedBlocksPanels-Dfu9N6YW.js → SavedBlocksPanels-CxlNHhUs.js} +3 -3
  108. package/dist/cdn/chunks/{SavedBlocksPanels-Dfu9N6YW.js.map → SavedBlocksPanels-CxlNHhUs.js.map} +1 -1
  109. package/dist/cdn/chunks/{SavedBlocksPickBar-DiMW_dbJ.js → SavedBlocksPickBar-C7_Z8phX.js} +12 -12
  110. package/dist/cdn/chunks/{SavedBlocksPickBar-DiMW_dbJ.js.map → SavedBlocksPickBar-C7_Z8phX.js.map} +1 -1
  111. package/dist/cdn/chunks/{TemplateSettings-JMUo0LIV.js → TemplateSettings-B6zDtjSs.js} +102 -102
  112. package/dist/cdn/chunks/{TemplateSettings-JMUo0LIV.js.map → TemplateSettings-B6zDtjSs.js.map} +1 -1
  113. package/dist/cdn/chunks/{TestEmailModal-D52VtwBZ.js → TestEmailModal-CJ_QYFua.js} +21 -21
  114. package/dist/cdn/chunks/{TestEmailModal-D52VtwBZ.js.map → TestEmailModal-CJ_QYFua.js.map} +1 -1
  115. package/dist/cdn/chunks/{TestEmailPanel-D9ezVDHd.js → TestEmailPanel-CsFrTq_a.js} +3 -3
  116. package/dist/cdn/chunks/{TestEmailPanel-D9ezVDHd.js.map → TestEmailPanel-CsFrTq_a.js.map} +1 -1
  117. package/dist/cdn/chunks/{TitleEditor-D04vvbUc.js → TitleEditor-CuKJptyw.js} +20 -20
  118. package/dist/cdn/chunks/{TitleEditor-D04vvbUc.js.map → TitleEditor-CuKJptyw.js.map} +1 -1
  119. package/dist/cdn/chunks/{ToggleSwitch-BSkySwA1.js → ToggleSwitch-C0w0srN_.js} +2 -2
  120. package/dist/cdn/chunks/{ToggleSwitch-BSkySwA1.js.map → ToggleSwitch-C0w0srN_.js.map} +1 -1
  121. package/dist/cdn/chunks/{Toolbar-C_Hfsher.js → Toolbar-TS2WwlPW.js} +542 -542
  122. package/dist/cdn/chunks/Toolbar-TS2WwlPW.js.map +1 -0
  123. package/dist/cdn/chunks/{TplModal-d6fEZGJ5.js → TplModal-CsadClrH.js} +7 -7
  124. package/dist/cdn/chunks/{TplModal-d6fEZGJ5.js.map → TplModal-CsadClrH.js.map} +1 -1
  125. package/dist/cdn/chunks/{VersionHistoryMenu-C8ucm43v.js → VersionHistoryMenu-BNPxnWiO.js} +16 -16
  126. package/dist/cdn/chunks/{VersionHistoryMenu-C8ucm43v.js.map → VersionHistoryMenu-BNPxnWiO.js.map} +1 -1
  127. package/dist/cdn/chunks/{VersionHistoryPanels-BAdzmhvH.js → VersionHistoryPanels-CieY91f0.js} +3 -3
  128. package/dist/cdn/chunks/{VersionHistoryPanels-BAdzmhvH.js.map → VersionHistoryPanels-CieY91f0.js.map} +1 -1
  129. package/dist/cdn/chunks/{VersionPreviewBanner-BWuovbFc.js → VersionPreviewBanner-BldFvgxJ.js} +9 -9
  130. package/dist/cdn/chunks/{VersionPreviewBanner-BWuovbFc.js.map → VersionPreviewBanner-BldFvgxJ.js.map} +1 -1
  131. package/dist/cdn/chunks/{WrapperBlock-TXDSDXUP.js → WrapperBlock-DtnRuKWE.js} +13 -13
  132. package/dist/cdn/chunks/{WrapperBlock-TXDSDXUP.js.map → WrapperBlock-DtnRuKWE.js.map} +1 -1
  133. package/dist/cdn/chunks/{blockTypeIcons-CzYA5DF9.js → blockTypeIcons-19xd5ZPi.js} +6 -6
  134. package/dist/cdn/chunks/{blockTypeIcons-CzYA5DF9.js.map → blockTypeIcons-19xd5ZPi.js.map} +1 -1
  135. package/dist/cdn/chunks/{composables-CsfQlmcf.js → composables-CUIiW9OD.js} +1190 -1170
  136. package/dist/cdn/chunks/composables-CUIiW9OD.js.map +1 -0
  137. package/dist/cdn/chunks/{createCloudRuntime-PpIFCDfj.js → createCloudRuntime-B7D04wKf.js} +161 -147
  138. package/dist/cdn/chunks/createCloudRuntime-B7D04wKf.js.map +1 -0
  139. package/dist/cdn/chunks/da-CYWJkrTg.js +97 -0
  140. package/dist/cdn/chunks/da-CYWJkrTg.js.map +1 -0
  141. package/dist/cdn/chunks/da-qQzj0QGy.js +950 -0
  142. package/dist/cdn/chunks/da-qQzj0QGy.js.map +1 -0
  143. package/dist/cdn/chunks/{dist-BzXULHvI.js → dist-BtWMy7UQ.js} +3 -3
  144. package/dist/cdn/chunks/{dist-BzXULHvI.js.map → dist-BtWMy7UQ.js.map} +1 -1
  145. package/dist/cdn/chunks/dist-zu1jwYIS.js +405 -0
  146. package/dist/cdn/chunks/{dist-DqGgijFI.js.map → dist-zu1jwYIS.js.map} +1 -1
  147. package/dist/cdn/chunks/{draggable-DepKdldn.js → draggable-IRVFEZ-b.js} +1535 -1500
  148. package/dist/cdn/chunks/draggable-IRVFEZ-b.js.map +1 -0
  149. package/dist/cdn/chunks/{editor-modal-B8UE9V8B.js → editor-modal-CarOiAYJ.js} +137 -136
  150. package/dist/cdn/chunks/{editor-modal-B8UE9V8B.js.map → editor-modal-CarOiAYJ.js.map} +1 -1
  151. package/dist/cdn/chunks/en-B4s_0ryk.js +1 -0
  152. package/dist/cdn/chunks/{extensions-BM6ZSnsQ.js → extensions-Cbvk9i08.js} +96 -96
  153. package/dist/cdn/chunks/{extensions-BM6ZSnsQ.js.map → extensions-Cbvk9i08.js.map} +1 -1
  154. package/dist/cdn/chunks/{icons-DHExFLlT.js → icons-Cl4oR2mf.js} +73 -73
  155. package/dist/cdn/chunks/icons-Cl4oR2mf.js.map +1 -0
  156. package/dist/cdn/chunks/keys-BQqbBUag.js +11 -0
  157. package/dist/cdn/chunks/keys-BQqbBUag.js.map +1 -0
  158. package/dist/cdn/chunks/{normalizeMergeTagMarkup-aWjkotui.js → normalizeMergeTagMarkup-BJ-MnCqF.js} +55 -55
  159. package/dist/cdn/chunks/{normalizeMergeTagMarkup-aWjkotui.js.map → normalizeMergeTagMarkup-BJ-MnCqF.js.map} +1 -1
  160. package/dist/cdn/chunks/{preRenderCustomBlocks-Dn6dFUwx.js → preRenderCustomBlocks-D2wISRHq.js} +2 -2
  161. package/dist/cdn/chunks/{preRenderCustomBlocks-Dn6dFUwx.js.map → preRenderCustomBlocks-D2wISRHq.js.map} +1 -1
  162. package/dist/cdn/chunks/sanitizeHtml-CB7fjHFs.js +72 -0
  163. package/dist/cdn/chunks/sanitizeHtml-CB7fjHFs.js.map +1 -0
  164. package/dist/cdn/chunks/{socialIcons-Qw9rHc8C.js → socialIcons-C_yggK1_.js} +575 -524
  165. package/dist/cdn/chunks/socialIcons-C_yggK1_.js.map +1 -0
  166. package/dist/cdn/chunks/{src-C9JWWxAk.js → src-Bp7bZcuD.js} +108 -95
  167. package/dist/cdn/chunks/src-Bp7bZcuD.js.map +1 -0
  168. package/dist/cdn/chunks/{src-mXG-Of9A.js → src-CdVAke9t.js} +721 -696
  169. package/dist/cdn/chunks/src-CdVAke9t.js.map +1 -0
  170. package/dist/cdn/chunks/{src-Bfj1jHnn.js → src-D-URHI0Z.js} +232 -228
  171. package/dist/cdn/chunks/src-D-URHI0Z.js.map +1 -0
  172. package/dist/cdn/chunks/{tiptap-Dipw_zOQ.js → tiptap-BPiZqxCt.js} +42 -33
  173. package/dist/cdn/chunks/tiptap-BPiZqxCt.js.map +1 -0
  174. package/dist/cdn/chunks/{useCloudI18n-Xsih9yRH.js → useCloudI18n-Dr4S2TRW.js} +3 -3
  175. package/dist/cdn/chunks/{useCloudI18n-Xsih9yRH.js.map → useCloudI18n-Dr4S2TRW.js.map} +1 -1
  176. package/dist/cdn/chunks/useEditorRoot-B_kf_k-g.js +9 -0
  177. package/dist/cdn/chunks/{useEditorRoot-Beau2Z_T.js.map → useEditorRoot-B_kf_k-g.js.map} +1 -1
  178. package/dist/cdn/chunks/{useI18n-D8s7HtTn.js → useI18n-CSf-ZpcM.js} +3 -3
  179. package/dist/cdn/chunks/{useI18n-D8s7HtTn.js.map → useI18n-CSf-ZpcM.js.map} +1 -1
  180. package/dist/cdn/chunks/useLocalizedDisplay-slFOCPrh.js +33 -0
  181. package/dist/cdn/chunks/{useLocalizedDisplay-Bgg4qpev.js.map → useLocalizedDisplay-slFOCPrh.js.map} +1 -1
  182. package/dist/cdn/chunks/{useLogicTag-DLvWzWsp.js → useLogicTag-lPjCGeGC.js} +5 -5
  183. package/dist/cdn/chunks/{useLogicTag-DLvWzWsp.js.map → useLogicTag-lPjCGeGC.js.map} +1 -1
  184. package/dist/cdn/chunks/{useMergeTag-B4FHCGGm.js → useMergeTag-BKNBwIry.js} +8 -8
  185. package/dist/cdn/chunks/{useMergeTag-B4FHCGGm.js.map → useMergeTag-BKNBwIry.js.map} +1 -1
  186. package/dist/cdn/chunks/{usePopoverPosition-esO6wjvU.js → usePopoverPosition-BJFFi8x6.js} +3 -3
  187. package/dist/cdn/chunks/{usePopoverPosition-esO6wjvU.js.map → usePopoverPosition-BJFFi8x6.js.map} +1 -1
  188. package/dist/cdn/chunks/{useScrollToBlock-CJuUu7Xj.js → useScrollToBlock-MI4PP5lk.js} +3 -3
  189. package/dist/cdn/chunks/{useScrollToBlock-CJuUu7Xj.js.map → useScrollToBlock-MI4PP5lk.js.map} +1 -1
  190. package/dist/cdn/chunks/{withCurrentFont-QqBilClC.js → withCurrentFont-CzTFFaJA.js} +2 -2
  191. package/dist/cdn/chunks/{withCurrentFont-QqBilClC.js.map → withCurrentFont-CzTFFaJA.js.map} +1 -1
  192. package/dist/cdn/editor.css +1 -1
  193. package/dist/cdn/editor.js +784 -762
  194. package/dist/cdn/editor.js.map +1 -1
  195. package/dist/{check-CcuCoJDh.js → check-C7ua4TAK.js} +1 -1
  196. package/dist/{chevron-down-BfYIbFbC.js → chevron-down-DftQrAkI.js} +1 -1
  197. package/dist/{chevron-right-DyjFqY35.js → chevron-right-B-DULGbg.js} +1 -1
  198. package/dist/{chevron-up-BHEIxuS-.js → chevron-up-CeYsyD8c.js} +1 -1
  199. package/dist/{circle-alert-Tq7kAh9S.js → circle-exclamation-point-DHjORV_I.js} +3 -3
  200. package/dist/{clock-Df0ZiXwQ.js → clock-CajOtLEZ.js} +1 -1
  201. package/dist/{composables-CRX6rncm.js → composables-DbjgUQlV.js} +1663 -1643
  202. package/dist/{createCloudRuntime-DplyIlsy.js → createCloudRuntime-Cnh2M6iT.js} +54 -40
  203. package/dist/{createLucideIcon-CfBdtoUw.js → createLucideIcon-D-mELTSY.js} +6 -6
  204. package/dist/da-CYWJkrTg.js +95 -0
  205. package/dist/da-qQzj0QGy.js +948 -0
  206. package/dist/{dist-CX7skkvG.js → dist-A328tG0Z.js} +2 -2
  207. package/dist/{dist-B8dY8drK.js → dist-B15BvV94.js} +2 -2
  208. package/dist/{dist-TAv500j6.js → dist-B3G4Yvpd.js} +3 -3
  209. package/dist/dist-B6ptxfPo.js +406 -0
  210. package/dist/{dist-ChOb5XHW.js → dist-BmV-2uBJ.js} +2 -2
  211. package/dist/{dist-fqSers8_.js → dist-BxKFi2h_.js} +199 -199
  212. package/dist/{dist-BMUUt3zJ.js → dist-CAvsz9cW.js} +680 -655
  213. package/dist/{dist-D_XrUEET.js → dist-CMBOqk9I.js} +7 -7
  214. package/dist/{dist-DZ3X-uB8.js → dist-CXTsTO5h.js} +2 -2
  215. package/dist/{dist-B9a7iVye.js → dist-D5BUcCjv.js} +2 -2
  216. package/dist/dist-D9cbSSSx.js +4 -0
  217. package/dist/{dist-54VCNoC0.js → dist-DAdrn64r.js} +2 -2
  218. package/dist/{dist-BWflWcpW.js → dist-DENg3ORe.js} +33 -24
  219. package/dist/{dist-C3hu_C3w.js → dist-DI_8rB1X.js} +2 -2
  220. package/dist/dist-ELLEk-lS.js +4 -0
  221. package/dist/{editor-modal-D9HT9bD6.js → editor-modal-CgsaLpwB.js} +110 -109
  222. package/dist/en-DBLcB-CW.js +1 -0
  223. package/dist/{extensions-Cm6K4SRX.js → extensions-7fb-XtNJ.js} +180 -180
  224. package/dist/{eye-B3psrAqd.js → eye-fe5sKF_K.js} +1 -1
  225. package/dist/{image-C3yuPDxx.js → image-CUC7SZiW.js} +1 -1
  226. package/dist/index.d.ts +6 -4
  227. package/dist/{info-DKja7A68.js → info-DDbLU4pT.js} +1 -1
  228. package/dist/keys-D9oKZN1h.js +9 -0
  229. package/dist/{link-DhzPI4Hn.js → link-C2icj0iH.js} +1 -1
  230. package/dist/{list-DVGn7Ik2.js → list-KYC_Jb5A.js} +1 -1
  231. package/dist/{loader-circle-DqKWsMHO.js → loader-circle-DmyagWpc.js} +1 -1
  232. package/dist/{message-circle-C4TonoBs.js → message-circle-ijyWn6UJ.js} +1 -1
  233. package/dist/{normalizeMergeTagMarkup-Da9JAgx7.js → normalizeMergeTagMarkup-GrXJfXsQ.js} +82 -82
  234. package/dist/{package-9OkiEO4S.js → package-CKYm_jQY.js} +1 -1
  235. package/dist/{pencil-M9vkOB7C.js → pencil-C2TRSR-Y.js} +1 -1
  236. package/dist/{plus-DxZiv9YC.js → plus-CotJVDxb.js} +1 -1
  237. package/dist/{preRenderCustomBlocks-CdqSp2P7.js → preRenderCustomBlocks-DuXtzD-F.js} +3 -3
  238. package/dist/{refresh-cw-UY8_sdFG.js → refresh-cw-CuCRV6D5.js} +1 -1
  239. package/dist/{rotate-ccw-BFTGCpHn.js → rotate-ccw-BlnQ3y6R.js} +1 -1
  240. package/dist/{runtime-dom.esm-bundler-DlHp8xgy.js → runtime-dom.esm-bundler-nN-jsqr1.js} +20 -20
  241. package/dist/{sanitizeHtml-wBibnBF4.js → sanitizeHtml-eV4_BpI6.js} +25 -14
  242. package/dist/{search-RuGJnMEn.js → search-Dxw6oFrZ.js} +1 -1
  243. package/dist/{send-DGB1ar02.js → send-C-blQBZ9.js} +1 -1
  244. package/dist/{smartphone-CVA29CU_.js → smartphone-rLz4X-Dd.js} +1 -1
  245. package/dist/{socialIcons-CJD6OsI7.js → socialIcons-brRkK9Om.js} +600 -549
  246. package/dist/{sparkles-IHfEwEcd.js → sparkles-JWQlUiSn.js} +1 -1
  247. package/dist/{square-_Cl44UU6.js → square-DshDy1Il.js} +1 -1
  248. package/dist/style.css +1 -1
  249. package/dist/templatical-editor.js +976 -954
  250. package/dist/{text-align-start-Dqk2Xt_Q.js → text-align-start-CyasaQtr.js} +13 -13
  251. package/dist/{trash-Cr7rD5Hh.js → trash-B1lZp2Tv.js} +1 -1
  252. package/dist/{triangle-alert-CKcpwtUj.js → triangle-exclamation-point-BhJvBEoT.js} +3 -3
  253. package/dist/{upload-DR9pqVON.js → upload-CNK8JX38.js} +1 -1
  254. package/dist/{useCloudI18n-BczJoFf4.js → useCloudI18n-HhCZYRV6.js} +2 -2
  255. package/dist/useEditorRoot-B0Njczhx.js +7 -0
  256. package/dist/{useI18n-zeWYtWSv.js → useI18n-CM9vKbYc.js} +2 -2
  257. package/dist/{cdn/chunks/useLocalizedDisplay-Bgg4qpev.js → useLocalizedDisplay-DoaT7nWk.js} +2 -4
  258. package/dist/{useLogicTag-DLkYos2Q.js → useLogicTag-cTC2KbWd.js} +4 -4
  259. package/dist/{useMergeTag-IoWOO679.js → useMergeTag-D2YDZ8vR.js} +8 -8
  260. package/dist/{usePopoverPosition-Br3zt_MQ.js → usePopoverPosition-CVRzzLkC.js} +2 -2
  261. package/dist/{useScrollToBlock-BfOzc1Z6.js → useScrollToBlock-vf_KD0FM.js} +3 -3
  262. package/dist/{vue.runtime.esm-bundler-BJXc_Mri.js → vue.runtime.esm-bundler-BE5V8ADU.js} +414 -362
  263. package/dist/{withCurrentFont-m_PHcOD0.js → withCurrentFont-DAmED4fN.js} +1 -1
  264. package/dist/{x-DZSFHafL.js → x-DbLX5Qdm.js} +1 -1
  265. package/package.json +23 -23
  266. package/dist/AiPanels-DAsnX-a3.js +0 -31
  267. package/dist/CommentsPanel-C5qG17Ki.js +0 -16
  268. package/dist/CommentsSidebar-C7CWcUYZ.js +0 -526
  269. package/dist/LanguageMenu-B981Av-6.js +0 -403
  270. package/dist/cdn/chunks/AiChatPanel-DKDu9cs7.js.map +0 -1
  271. package/dist/cdn/chunks/AiPanels-jMLVaiKx.js +0 -32
  272. package/dist/cdn/chunks/AiPanels-jMLVaiKx.js.map +0 -1
  273. package/dist/cdn/chunks/AiRewriteMenu-s79rmHFy.js.map +0 -1
  274. package/dist/cdn/chunks/BlockIssueBadge-Bnmq_M4G.js.map +0 -1
  275. package/dist/cdn/chunks/BlockPreviewCanvas-B3HkuENF.js +0 -156
  276. package/dist/cdn/chunks/BlockPreviewCanvas-B3HkuENF.js.map +0 -1
  277. package/dist/cdn/chunks/CloudPanels-DQnlH_YJ.js.map +0 -1
  278. package/dist/cdn/chunks/CommentsPanel-EtdTzTmq.js +0 -18
  279. package/dist/cdn/chunks/CommentsPanel-EtdTzTmq.js.map +0 -1
  280. package/dist/cdn/chunks/CommentsSidebar-Qmj049QX.js +0 -496
  281. package/dist/cdn/chunks/CommentsSidebar-Qmj049QX.js.map +0 -1
  282. package/dist/cdn/chunks/IssuesPanel-DnSnEh1X.js.map +0 -1
  283. package/dist/cdn/chunks/LanguageMenu-C2I_yTL5.js.map +0 -1
  284. package/dist/cdn/chunks/RestoreVersionDialog-DqbULAbc.js.map +0 -1
  285. package/dist/cdn/chunks/Toolbar-C_Hfsher.js.map +0 -1
  286. package/dist/cdn/chunks/composables-CsfQlmcf.js.map +0 -1
  287. package/dist/cdn/chunks/createCloudRuntime-PpIFCDfj.js.map +0 -1
  288. package/dist/cdn/chunks/dist-DqGgijFI.js +0 -405
  289. package/dist/cdn/chunks/draggable-DepKdldn.js.map +0 -1
  290. package/dist/cdn/chunks/en-CVxNoHww.js +0 -1
  291. package/dist/cdn/chunks/icons-DHExFLlT.js.map +0 -1
  292. package/dist/cdn/chunks/keys-BUmIvYy3.js +0 -11
  293. package/dist/cdn/chunks/keys-BUmIvYy3.js.map +0 -1
  294. package/dist/cdn/chunks/sanitizeHtml-DJI7vvET.js +0 -61
  295. package/dist/cdn/chunks/sanitizeHtml-DJI7vvET.js.map +0 -1
  296. package/dist/cdn/chunks/socialIcons-Qw9rHc8C.js.map +0 -1
  297. package/dist/cdn/chunks/src-Bfj1jHnn.js.map +0 -1
  298. package/dist/cdn/chunks/src-C9JWWxAk.js.map +0 -1
  299. package/dist/cdn/chunks/src-mXG-Of9A.js.map +0 -1
  300. package/dist/cdn/chunks/tiptap-Dipw_zOQ.js.map +0 -1
  301. package/dist/cdn/chunks/useEditorRoot-Beau2Z_T.js +0 -9
  302. package/dist/dist-0alKVRc_.js +0 -406
  303. package/dist/dist-6DU0me3E.js +0 -4
  304. package/dist/dist-CcOn7WCo.js +0 -4
  305. package/dist/en-De3uAutQ.js +0 -1
  306. package/dist/keys-w_VRjoMu.js +0 -9
  307. package/dist/useEditorRoot-BcXKhM_8.js +0 -7
  308. package/dist/useLocalizedDisplay-Cbhx208c.js +0 -31
@@ -1,12 +1,12 @@
1
- import { $ as e, C as t, F as n, H as r, M as i, O as a, Q as o, X as s, Y as c, _ as l, at as u, b as d, ct as f, dt as p, et as m, lt as h, mt as g, ot as _, p as v, pt as y, q as b, rt as x, tt as S, u as C, x as w } from "./draggable-DepKdldn.js";
2
- import { $t as T, Ft as E, Gt as D, H as O, Ht as ee, I as k, It as te, Jt as A, Lt as j, Nt as ne, Pt as M, Qt as re, Rt as N, Ut as ie, Vt as P, W as F, Wt as I, Xt as ae, Yt as L, Zt as R, en as z, ft as oe, h as B, in as se, jt as V, m as ce, nn as H, p as le, rn as U, tn as W, un as ue, v as de, wt as G, xn as fe, y as pe, zt as me } from "./src-mXG-Of9A.js";
3
- import { at as he, s as K } from "./icons-DHExFLlT.js";
4
- import { B as ge, C as _e, W as ve, u as ye } from "./keys-BUmIvYy3.js";
5
- import { t as be } from "./useI18n-D8s7HtTn.js";
6
- import { r as xe } from "./dist-DqGgijFI.js";
7
- import { i as Se, r as q } from "./usePopoverPosition-esO6wjvU.js";
1
+ import { $ as e, C as t, F as n, H as r, M as i, O as a, Q as o, X as s, Y as c, _ as l, at as u, b as d, ct as f, dt as p, et as m, lt as h, mt as g, ot as _, p as v, pt as y, q as b, rt as x, tt as S, u as C, x as w } from "./draggable-IRVFEZ-b.js";
2
+ import { $t as T, Bt as E, Cn as D, Ft as O, Gt as k, H as ee, Ht as A, I as j, It as te, Kt as M, Lt as N, Nt as ne, Pt as P, Qt as F, Rt as re, Ut as I, W as L, Wt as ie, Xt as R, Yt as ae, Zt as oe, an as se, dn as z, en as B, ft as V, h as ce, in as H, jt as le, m as U, nn as W, p as ue, rn as G, tn as de, v as fe, wt as pe, y as me, zt as he } from "./src-CdVAke9t.js";
3
+ import { at as K, s as ge } from "./icons-Cl4oR2mf.js";
4
+ import { B as _e, C as ve, W as ye, u as be } from "./keys-BQqbBUag.js";
5
+ import { t as xe } from "./useI18n-CSf-ZpcM.js";
6
+ import { r as Se } from "./dist-zu1jwYIS.js";
7
+ import { i as q, r as Ce } from "./usePopoverPosition-BJFFi8x6.js";
8
8
  // ../core/src/localized-edit.ts
9
- var J = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ce = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => J(e) && typeof e.id == "string"), we = /* @__PURE__ */ new Set([
9
+ var J = (e) => typeof e == "object" && !!e && !Array.isArray(e), Y = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => J(e) && typeof e.id == "string"), we = /* @__PURE__ */ new Set([
10
10
  "id",
11
11
  "type",
12
12
  "children",
@@ -18,37 +18,37 @@ function Te(e, t, n) {
18
18
  let r = /* @__PURE__ */ new Set();
19
19
  for (let i of n) {
20
20
  if (!ie(i)) continue;
21
- let n = i.split("."), a = n.pop(), o = n.join("."), s = R(e, i), c = t;
21
+ let n = i.split("."), a = n.pop(), o = n.join("."), s = F(e, i), c = t;
22
22
  for (let [t, i] of n.entries()) {
23
23
  let a = n.slice(0, t + 1).join(".");
24
- s !== void 0 && J(c) && R(c, i) === void 0 && J(R(e, a)) && (c[i] = {}, r.add(a)), c = R(c, i);
24
+ s !== void 0 && J(c) && F(c, i) === void 0 && J(F(e, a)) && (c[i] = {}, r.add(a)), c = F(c, i);
25
25
  }
26
26
  if (Array.isArray(c)) {
27
27
  let e = c.findIndex((e) => J(e) && e.id === a);
28
28
  if (e < 0) continue;
29
- s === void 0 ? c.splice(e, 1) : c[e] = U(s);
30
- } else J(c) && (s === void 0 ? delete c[a] : c[a] = U(s), o && Object.keys(c).length === 0 && R(e, o) === void 0 && Te(e, t, [o]));
29
+ s === void 0 ? c.splice(e, 1) : c[e] = H(s);
30
+ } else J(c) && (s === void 0 ? delete c[a] : c[a] = H(s), o && Object.keys(c).length === 0 && F(e, o) === void 0 && Te(e, t, [o]));
31
31
  }
32
32
  return r;
33
33
  }
34
- function Y(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
35
- if (J(e) && J(t) && !a.has(n)) for (let o of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) (n || !we.has(o)) && Y(e[o], t[o], n ? `${n}.${o}` : o, r, i, a);
36
- else if (i && Ce(e) && Ce(t)) for (let o of t) {
34
+ function X(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
35
+ if (J(e) && J(t) && !a.has(n)) for (let o of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) (n || !we.has(o)) && X(e[o], t[o], n ? `${n}.${o}` : o, r, i, a);
36
+ else if (i && Y(e) && Y(t)) for (let o of t) {
37
37
  if (o.id.includes(".")) continue;
38
38
  let t = e.find((e) => e.id === o.id);
39
- t && Y(t, o, `${n}.${o.id}`, r, i, a);
39
+ t && X(t, o, `${n}.${o.id}`, r, i, a);
40
40
  }
41
- else H(e, t) || r.set(n, t);
41
+ else G(e, t) || r.set(n, t);
42
42
  }
43
43
  function Ee(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
44
44
  let a = /* @__PURE__ */ new Map();
45
- Y(e, t, "", a, e.type !== "custom", i);
46
- let o = new Set(e.type === "custom" ? z(e, r) : []), s = {}, c = {};
47
- for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : D(e.type, t)) && typeof r == "string" && R(e, t) !== void 0) {
45
+ X(e, t, "", a, e.type !== "custom", i);
46
+ let o = new Set(e.type === "custom" ? de(e, r) : []), s = {}, c = {};
47
+ for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : M(e.type, t)) && typeof r == "string" && F(e, t) !== void 0) {
48
48
  let i = n?.text?.[t];
49
49
  s[t] = i && i.value === r ? i : {
50
50
  value: r,
51
- sourceHash: T(String(R(e, t) ?? ""))
51
+ sourceHash: B(String(F(e, t) ?? ""))
52
52
  };
53
53
  } else c[t] = r === void 0 ? null : r;
54
54
  let l = {};
@@ -58,7 +58,7 @@ function De(e, t, n) {
58
58
  let r = !1;
59
59
  function i(e, t, n, a) {
60
60
  let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) => J(e) && typeof e.id == "string");
61
- if (c(o) && c(s) && (JSON.stringify(o.map((e) => e.id)) !== JSON.stringify(s.map((e) => e.id)) && (r = !0, e[n] = s.map((e) => U(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
61
+ if (c(o) && c(s) && (JSON.stringify(o.map((e) => e.id)) !== JSON.stringify(s.map((e) => e.id)) && (r = !0, e[n] = s.map((e) => H(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
62
62
  let r = e[n].find((e) => e.id === t.id);
63
63
  r && i(r, t, a);
64
64
  }
@@ -66,7 +66,7 @@ function De(e, t, n) {
66
66
  let a = e, o = t;
67
67
  if (e.type === "menu" && i(a, o, "items"), e.type === "table" && i(a, o, "rows", "cells"), e.type === "social" && i(a, o, "icons"), e.type === "section" && t.type === "section") {
68
68
  let i = (e) => e.map((e) => e.map((e) => e.id));
69
- (e.columns !== t.columns || JSON.stringify(i(e.children)) !== JSON.stringify(i(t.children))) && (r = !0, e.columns = t.columns, e.children = t.children.map((e) => e.map((e) => U(n(e.id) ?? e))));
69
+ (e.columns !== t.columns || JSON.stringify(i(e.children)) !== JSON.stringify(i(t.children))) && (r = !0, e.columns = t.columns, e.children = t.children.map((e) => e.map((e) => H(n(e.id) ?? e))));
70
70
  }
71
71
  return r;
72
72
  }
@@ -75,39 +75,39 @@ function Oe(e, t, n) {
75
75
  let { locale: t, locales: n, l10n: r, ...i } = e;
76
76
  return i;
77
77
  }, i = /* @__PURE__ */ new Map();
78
- Y(r(e), r(t), "", i);
78
+ X(r(e), r(t), "", i);
79
79
  let a = {};
80
- for (let [t, r] of i) if (me.includes(t) && typeof r == "string" && R(e, t) !== void 0) {
80
+ for (let [t, r] of i) if (E.includes(t) && typeof r == "string" && F(e, t) !== void 0) {
81
81
  let i = n?.text?.[t];
82
82
  (a.text ??= {})[t] = i?.value === r ? i : {
83
83
  value: r,
84
- sourceHash: T(String(R(e, t) ?? ""))
84
+ sourceHash: B(String(F(e, t) ?? ""))
85
85
  };
86
86
  } else (a.set ??= {})[t] = r === void 0 ? null : r;
87
87
  return a;
88
88
  }
89
89
  function ke(e, t, n, r, i, a = []) {
90
- let o = U(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
90
+ let o = H(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
91
91
  ...Object.keys(t.text ?? {}),
92
92
  ...Object.keys(t.set ?? {}),
93
93
  ...Object.keys(n.text ?? {}),
94
94
  ...Object.keys(n.set ?? {})
95
- ])].filter((e) => !H(t.text?.[e], n.text?.[e]) || !H(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
95
+ ])].filter((e) => !G(t.text?.[e], n.text?.[e]) || !G(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
96
96
  for (let e of c) {
97
- let t = R(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && H(R(r, t), R(i, t)));
98
- if (H(t, R(r, e))) delete o.set[e];
99
- else if (n.length && J(R(r, e)) && J(t)) {
97
+ let t = F(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && G(F(r, t), F(i, t)));
98
+ if (G(t, F(r, e))) delete o.set[e];
99
+ else if (n.length && J(F(r, e)) && J(t)) {
100
100
  delete o.set[e];
101
101
  let i = (e, t, a) => {
102
102
  if (!n.some((t) => e === t || e.startsWith(`${t}.`))) {
103
103
  if (J(t) && J(a)) for (let n of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(a)])) i(`${e}.${n}`, t[n], a[n]);
104
- else if (J(r) && r.type !== "custom" && Ce(t) && Ce(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
105
- else J(r) && typeof r.type == "string" && I(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : U(a));
104
+ else if (J(r) && r.type !== "custom" && Y(t) && Y(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
105
+ else J(r) && typeof r.type == "string" && k(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : H(a));
106
106
  }
107
107
  };
108
- i(e, R(r, e), t);
109
- } else o.set[e] = t === void 0 ? null : U(t);
110
- for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) n.startsWith(`${e}.`) && (H(t === "text" ? o.text[n].value : o.set[n] ?? void 0, R(i, n)) || delete o[t][n]);
108
+ i(e, F(r, e), t);
109
+ } else o.set[e] = t === void 0 ? null : H(t);
110
+ for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) n.startsWith(`${e}.`) && (G(t === "text" ? o.text[n].value : o.set[n] ?? void 0, F(i, n)) || delete o[t][n]);
111
111
  }
112
112
  for (let e of s) if (!c.includes(e)) {
113
113
  for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) (n === e || n.startsWith(`${e}.`)) && delete o[t][n];
@@ -129,13 +129,13 @@ function je(e, t, n) {
129
129
  let r = t === "addBlock", i = t === "duplicateBlock", a = typeof n[0] == "string" ? n[0] : n[0].id, o = r ? n[0] : e.findBlock?.(a);
130
130
  if (!r && e.findBlock && !o) return !1;
131
131
  let s = r ? null : e.findBlockLocation?.(a);
132
- if (!r && e.findBlockLocation && !s || !r && e.isBlockLocked(a, !0) || s?.targetSectionId && e.isBlockLocked(s.targetSectionId, !0)) return !1;
132
+ if (!r && e.findBlockLocation && !s || !r && e.isBlockLocked(a, !0) || !r && o && N(o).some((t) => t !== a && e.isBlockLocked(t, !0)) || s?.targetSectionId && e.isBlockLocked(s.targetSectionId, !0)) return !1;
133
133
  if (r && e.content) {
134
134
  let t = {
135
135
  ...e.content(),
136
136
  blocks: [o]
137
137
  };
138
- ce(t), B(t);
138
+ U(t), ce(t);
139
139
  }
140
140
  if (t === "removeBlock") return !0;
141
141
  let c = i && n[1] === void 0 && n[2] === void 0, l = c ? s?.targetSectionId : n[t === "moveBlock" ? 2 : 1], u = (c ? s?.columnIndex : n[t === "moveBlock" ? 3 : 2]) ?? 0;
@@ -143,22 +143,22 @@ function je(e, t, n) {
143
143
  if (e.isBlockLocked(l, !0) || o?.type === "section") return !1;
144
144
  if (e.findBlock) {
145
145
  let t = e.findBlock(l);
146
- if (t?.type !== "section" || u < 0 || u >= N(t.columns)) return !1;
146
+ if (t?.type !== "section" || u < 0 || u >= he(t.columns)) return !1;
147
147
  }
148
148
  }
149
149
  return t !== "moveBlock" || s?.targetSectionId !== l || (s?.columnIndex ?? 0) !== u || s?.index !== n[1];
150
150
  }
151
- var X = /* @__PURE__ */ new WeakMap();
152
- function Me(e, t) {
153
- X.set(e, t);
154
- for (let n of Object.values(e)) typeof n == "function" && X.set(n, t);
155
- }
151
+ var Me = /* @__PURE__ */ new WeakMap();
156
152
  function Ne(e, t) {
157
- let n = X.get(e);
158
- n && X.set(t, n);
153
+ Me.set(e, t);
154
+ for (let n of Object.values(e)) typeof n == "function" && Me.set(n, t);
155
+ }
156
+ function Z(e, t) {
157
+ let n = Me.get(e);
158
+ n && Me.set(t, n);
159
159
  }
160
- function Z(e, t, n) {
161
- let r = Reflect.get(e, t), i = X.get(e) ?? (typeof r == "function" ? X.get(r) : void 0);
160
+ function Q(e, t, n) {
161
+ let r = Reflect.get(e, t), i = Me.get(e) ?? (typeof r == "function" ? Me.get(r) : void 0);
162
162
  if (i) return i(t, n);
163
163
  if (!Ae(t)) return !0;
164
164
  let a = Reflect.get(e, "isBlockLocked");
@@ -179,7 +179,7 @@ function Z(e, t, n) {
179
179
  function Pe(e) {
180
180
  return e instanceof Error ? e : Error(String(e), { cause: e });
181
181
  }
182
- function Q(e, t) {
182
+ function Fe(e, t) {
183
183
  try {
184
184
  t();
185
185
  } catch (t) {
@@ -187,9 +187,9 @@ function Q(e, t) {
187
187
  }
188
188
  }
189
189
  // ../core/src/editor.ts
190
- function Fe(t) {
191
- let n = t.content ?? oe(t.defaultFontFamily, t.templateDefaults);
192
- ce(n), B(n);
190
+ function Ie(t) {
191
+ let n = t.content ?? V(t.defaultFontFamily, t.templateDefaults);
192
+ U(n), ce(n);
193
193
  let r = e({
194
194
  template: null,
195
195
  content: n,
@@ -204,11 +204,11 @@ function Fe(t) {
204
204
  uiTheme: "auto"
205
205
  }), i = u(r, "activeLocale"), a = [];
206
206
  function o(e) {
207
- let t = P(r.content);
207
+ let t = A(r.content);
208
208
  if (e === t && (e = null), e !== null && !r.content.settings.locales?.includes(e)) throw new W(`This template has no "${e}" version.`, void 0, "unknown_locale");
209
209
  i.value = e;
210
210
  }
211
- h(() => i.value ?? P(r.content), (e) => Q(t.onError, () => t.onLocaleChange?.(e))), h(() => r.content.settings.locales?.includes(i.value ?? ""), () => {
211
+ h(() => i.value ?? A(r.content), (e) => Fe(t.onError, () => t.onLocaleChange?.(e))), h(() => r.content.settings.locales?.includes(i.value ?? ""), () => {
212
212
  i.value && !r.content.settings.locales?.includes(i.value) && o(null);
213
213
  });
214
214
  function s() {
@@ -218,16 +218,16 @@ function Fe(t) {
218
218
  a = e;
219
219
  }
220
220
  function l(e) {
221
- return j(r.content, e, a);
221
+ return re(r.content, e, a);
222
222
  }
223
223
  function d(e, n) {
224
224
  if (!s()) return null;
225
- if (e === "addLocale" && (!ee(n) || t.localization && !t.localization.locales.includes(n))) throw new W(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
226
- let i = U(r.content);
225
+ if (e === "addLocale" && (!I(n) || t.localization && !t.localization.locales.includes(n))) throw new W(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
226
+ let i = H(r.content);
227
227
  return te(i, [{
228
228
  op: e,
229
229
  locale: n
230
- }]), H(i, r.content) ? null : i;
230
+ }]), G(i, r.content) ? null : i;
231
231
  }
232
232
  function f(e, t) {
233
233
  let n = d(e, t);
@@ -248,17 +248,17 @@ function Fe(t) {
248
248
  }
249
249
  function v(e, t) {
250
250
  let [n, o] = t;
251
- if (!i.value || !s() || I(n)) return null;
252
- let c = N(r.content.blocks, n);
251
+ if (!i.value || !s() || P(n)) return null;
252
+ let c = M(r.content.blocks, n);
253
253
  if (!c) return null;
254
- let l = c.l10n?.[i.value], u = A(c, i.value, P(r.content)), d = Ee(c, u, l, a), f = e === "resetLocaleFields" && Array.isArray(o) ? Te(c, u, o) : void 0, p = e === "resetLocaleFields" ? ke(l, d, Ee(c, u, l, a, f), c, u, Array.isArray(o) ? o : []) : U(l ?? {});
254
+ let l = c.l10n?.[i.value], u = ae(c, i.value, A(r.content)), d = Ee(c, u, l, a), f = e === "resetLocaleFields" && Array.isArray(o) ? Te(c, u, o) : void 0, p = e === "resetLocaleFields" ? ke(l, d, Ee(c, u, l, a, f), c, u, Array.isArray(o) ? o : []) : H(l ?? {});
255
255
  if (e === "setBlockHidden") o ? p.hidden = !0 : delete p.hidden;
256
256
  else if (e === "resetLocaleFields") o || (delete p.text, delete p.set, delete p.hidden);
257
257
  else for (let e of o) {
258
258
  let t = p.text?.[e];
259
- t && (t.sourceHash = T(String(R(c, e) ?? "")));
259
+ t && (t.sourceHash = B(String(F(c, e) ?? "")));
260
260
  }
261
- return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, H(l ?? {}, p) ? null : {
261
+ return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, G(l ?? {}, p) ? null : {
262
262
  block: c,
263
263
  layer: p
264
264
  };
@@ -280,31 +280,28 @@ function Fe(t) {
280
280
  function k() {
281
281
  r.isDirty = !0, O++;
282
282
  }
283
- let ne = b({
283
+ let ee = b({
284
284
  get: () => r.content,
285
285
  set: (e) => {
286
286
  r.content = e, k();
287
287
  }
288
- }), M = b(() => r.selectedBlockId ? N(r.content.blocks, r.selectedBlockId) : null);
289
- function N(e, t) {
288
+ }), j = b(() => r.selectedBlockId ? M(r.content.blocks, r.selectedBlockId) : null);
289
+ function M(e, t) {
290
290
  for (let n of e) {
291
291
  if (n.id === t) return n;
292
292
  if (n.type === "section") for (let e of n.children) {
293
- let n = N(e, t);
293
+ let n = M(e, t);
294
294
  if (n) return n;
295
295
  }
296
296
  }
297
297
  return null;
298
298
  }
299
- function ie(e, t) {
300
- if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) ie(e, t);
301
- }
302
- function F(e, t, n = { blocks: e }) {
299
+ function ne(e, t, n = { blocks: e }) {
303
300
  for (let r = 0; r < e.length; r++) {
304
301
  let i = e[r];
305
302
  if (i.id === t) return n;
306
303
  if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
307
- let n = F(i.children[e], t, {
304
+ let n = ne(i.children[e], t, {
308
305
  blocks: i.children[e],
309
306
  sectionId: i.id,
310
307
  columnIndex: e
@@ -314,7 +311,7 @@ function Fe(t) {
314
311
  }
315
312
  return null;
316
313
  }
317
- function I(e, n = !1) {
314
+ function P(e, n = !1) {
318
315
  let r = i.value ?? t.lockLocale?.value ?? null;
319
316
  for (let [i, a] of t.lockedBlocks?.value ?? []) {
320
317
  let o = a;
@@ -324,8 +321,8 @@ function Fe(t) {
324
321
  }
325
322
  return !1;
326
323
  }
327
- function z(e) {
328
- let t = F(r.content.blocks, e);
324
+ function L(e) {
325
+ let t = ne(r.content.blocks, e);
329
326
  if (!t) return null;
330
327
  let n = t.blocks.findIndex((t) => t.id === e);
331
328
  return n === -1 ? null : {
@@ -334,52 +331,63 @@ function Fe(t) {
334
331
  index: n
335
332
  };
336
333
  }
337
- function se(e, t = !0) {
338
- ce(e), B(e), r.content = e, t && k();
334
+ function ie(e, t = !0) {
335
+ U(e), ce(e), r.content = e, t && k();
339
336
  }
340
- function V(e) {
341
- e && I(e) || (r.selectedBlockId = e);
337
+ function se(e) {
338
+ e && P(e) || (r.selectedBlockId = e);
342
339
  }
343
- function le(e) {
340
+ function z(e) {
344
341
  r.viewport = e;
345
342
  }
346
- function ue(e) {
343
+ function le(e) {
347
344
  r.darkMode = e;
348
345
  }
349
- function de(e) {
346
+ function ue(e) {
350
347
  r.uiTheme = e;
351
348
  }
352
- function G(e) {
349
+ function de(e) {
353
350
  r.previewMode = e, e && (r.selectedBlockId = null);
354
351
  }
355
352
  function fe(e, t) {
356
353
  if (!s()) return !1;
357
- let n = N(r.content.blocks, e);
354
+ let n = M(r.content.blocks, e);
358
355
  if (!n) return !1;
359
356
  if ("l10n" in t) throw new W("l10n is immutable in updateBlock.", void 0, "invalid_operation");
360
- let i = {
357
+ let a = {
361
358
  ...n,
362
359
  ...t
363
- };
364
- return !I(e, De(U(n), i, (e) => N(r.content.blocks, e)));
360
+ }, o = H(n), c = De(o, a, (e) => M(r.content.blocks, e)), l = "children" in t, u = c || l || a.type !== n.type;
361
+ if (l && a.type === "section" && Array.isArray(a.children)) {
362
+ let e = new Set(N(n).slice(1)), t = /* @__PURE__ */ new Set();
363
+ for (let n of a.children) for (let i of n) for (let n of N(i)) {
364
+ if (t.has(n) || P(n, !0) || M(r.content.blocks, n) !== null && !e.has(n)) return !1;
365
+ t.add(n);
366
+ }
367
+ if (i.value) {
368
+ let e = N(o);
369
+ if (new Set(e).size !== e.length) return !1;
370
+ }
371
+ }
372
+ return !P(e, u || "columns" in t) && (!u || !N(n).some((t) => t !== e && P(t, !0)));
365
373
  }
366
374
  function pe(e, n) {
367
375
  if (!fe(e, n)) return;
368
- let o = N(r.content.blocks, e);
376
+ let o = M(r.content.blocks, e);
369
377
  if (!o) return;
370
378
  let s = i.value;
371
379
  if (s) {
372
- let i = A(o, s, P(r.content)), c = {
380
+ let i = ae(o, s, A(r.content)), c = {
373
381
  ...i,
374
382
  ...n
375
- }, l = U(o), u = De(l, c, (e) => N(r.content.blocks, e));
376
- if (I(e, u)) return;
383
+ }, l = H(o), u = De(l, c, (e) => M(r.content.blocks, e));
384
+ if (P(e, u)) return;
377
385
  u && t.onStructureChange?.();
378
- let d = L(l);
386
+ let d = R(l);
379
387
  delete o.l10n, Object.assign(o, d), _(o, ke(o.l10n?.[s], Ee(o, i, o.l10n?.[s], a), Ee(o, c, o.l10n?.[s], a), o, c));
380
388
  } else {
381
- if (I(e, "children" in n || "columns" in n)) return;
382
- let t = L({
389
+ if (P(e, "children" in n || "columns" in n)) return;
390
+ let t = R({
383
391
  ...o,
384
392
  ...n
385
393
  });
@@ -389,18 +397,18 @@ function Fe(t) {
389
397
  }
390
398
  function me(e) {
391
399
  if ("locales" in e || "l10n" in e) throw new W("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
392
- if ("locale" in e && e.locale !== P(r.content) && r.content.settings.locales?.length) throw new W("The default locale can't change while language versions exist.", void 0, "invalid_operation");
400
+ if ("locale" in e && e.locale !== A(r.content) && r.content.settings.locales?.length) throw new W("The default locale can't change while language versions exist.", void 0, "invalid_operation");
393
401
  }
394
402
  function he(e) {
395
403
  if (!s()) return;
396
404
  me(e);
397
405
  let t = i.value;
398
- if (!t) r.content.settings = ae({
406
+ if (!t) r.content.settings = oe({
399
407
  ...r.content.settings,
400
408
  ...e
401
409
  });
402
410
  else {
403
- let n = r.content.settings, i = re(r.content, t).settings, a = {
411
+ let n = r.content.settings, i = T(r.content, t).settings, a = {
404
412
  ...i,
405
413
  locale: n.locale,
406
414
  ...e
@@ -415,9 +423,9 @@ function Fe(t) {
415
423
  let K = {
416
424
  canEdit: s,
417
425
  content: () => r.content,
418
- findBlock: (e) => N(r.content.blocks, e),
419
- findBlockLocation: z,
420
- isBlockLocked: I
426
+ findBlock: (e) => M(r.content.blocks, e),
427
+ findBlockLocation: L,
428
+ isBlockLocked: P
421
429
  };
422
430
  function ge(e, n, a = 0, o) {
423
431
  if (je(K, "addBlock", [
@@ -427,7 +435,7 @@ function Fe(t) {
427
435
  o
428
436
  ])) {
429
437
  if (n) {
430
- let t = N(r.content.blocks, n);
438
+ let t = M(r.content.blocks, n);
431
439
  if (t && t.type === "section") {
432
440
  t.children[a] = t.children[a] || [];
433
441
  let n = t.children[a];
@@ -439,16 +447,12 @@ function Fe(t) {
439
447
  }
440
448
  function _e(e) {
441
449
  if (!je(K, "removeBlock", [e])) return;
442
- let n = F(r.content.blocks, e);
450
+ let n = ne(r.content.blocks, e);
443
451
  if (n) {
444
452
  let a = n.blocks.findIndex((t) => t.id === e);
445
453
  if (a !== -1) {
446
454
  let [e] = n.blocks.splice(a, 1);
447
- if (r.selectedBlockId) {
448
- let t = /* @__PURE__ */ new Set();
449
- ie(e, t), t.has(r.selectedBlockId) && (r.selectedBlockId = null);
450
- }
451
- i.value && t.onStructureChange?.(), k();
455
+ r.selectedBlockId && new Set(N(e)).has(r.selectedBlockId) && (r.selectedBlockId = null), i.value && t.onStructureChange?.(), k();
452
456
  }
453
457
  }
454
458
  }
@@ -459,9 +463,9 @@ function Fe(t) {
459
463
  a,
460
464
  o
461
465
  ])) return;
462
- let s = F(r.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
466
+ let s = ne(r.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
463
467
  if (a) {
464
- let e = N(r.content.blocks, a);
468
+ let e = M(r.content.blocks, a);
465
469
  e.children[o] = e.children[o] || [], l = e.children[o];
466
470
  } else l = r.content.blocks;
467
471
  let [u] = s.blocks.splice(c, 1);
@@ -474,7 +478,7 @@ function Fe(t) {
474
478
  throw new W(`[Templatical] Templates: ${e} ${t}`);
475
479
  }
476
480
  function xe(e) {
477
- Q(t.onError, e);
481
+ Fe(t.onError, e);
478
482
  }
479
483
  function Se(e) {
480
484
  let { templates: n } = t;
@@ -486,7 +490,7 @@ function Fe(t) {
486
490
  name: e
487
491
  }, k());
488
492
  }
489
- async function J(e) {
493
+ async function Ce(e) {
490
494
  let n = Se("create()"), { create: i } = n;
491
495
  typeof i != "function" && be("create()", "is disabled by the provider — its `create` is `false`.");
492
496
  let a, o = ++D;
@@ -505,11 +509,11 @@ function Fe(t) {
505
509
  }
506
510
  return xe(() => n.onCreated?.(a)), a;
507
511
  }
508
- async function Ce(e, n) {
512
+ async function J(e, n) {
509
513
  let i = Se("load()"), a, o = ++D;
510
514
  r.isLoading = !0;
511
515
  try {
512
- if (a = await i.load(e), ce(a.content), B(a.content), n && !n()) return a;
516
+ if (a = await i.load(e), U(a.content), ce(a.content), n && !n()) return a;
513
517
  r.template = a, r.content = a.content, r.isDirty = !1, E.value++;
514
518
  } catch (e) {
515
519
  throw t.onError?.(e), e;
@@ -518,7 +522,7 @@ function Fe(t) {
518
522
  }
519
523
  return xe(() => i.onLoaded?.(a)), a;
520
524
  }
521
- async function we(e = "api") {
525
+ async function Y(e = "api") {
522
526
  let n = Se("save()"), { save: i } = n;
523
527
  typeof i != "function" && be("save()", "is disabled by the provider — its `save` is `false`.");
524
528
  let a = r.template;
@@ -545,14 +549,14 @@ function Fe(t) {
545
549
  }
546
550
  return xe(() => n.onSaved?.(s, { trigger: e })), s;
547
551
  }
548
- function Y() {
552
+ function we() {
549
553
  return r.template?.id !== void 0;
550
554
  }
551
555
  let X = {
552
556
  state: m(r),
553
557
  loadVersion: m(E),
554
- content: ne,
555
- selectedBlock: M,
558
+ content: ee,
559
+ selectedBlock: j,
556
560
  activeLocale: i,
557
561
  setActiveLocale: o,
558
562
  addLocale: p,
@@ -562,34 +566,34 @@ function Fe(t) {
562
566
  keepTranslations: w,
563
567
  setCustomBlockDefinitions: c,
564
568
  createSetDefaultLocaleOperation: l,
565
- isBlockLocked: I,
566
- setContent: se,
567
- selectBlock: V,
568
- setViewport: le,
569
- setDarkMode: ue,
570
- setUiTheme: de,
571
- setPreviewMode: G,
569
+ isBlockLocked: P,
570
+ setContent: ie,
571
+ selectBlock: se,
572
+ setViewport: z,
573
+ setDarkMode: le,
574
+ setUiTheme: ue,
575
+ setPreviewMode: de,
572
576
  updateBlock: pe,
573
577
  updateSettings: he,
574
578
  addBlock: ge,
575
579
  removeBlock: _e,
576
580
  moveBlock: ve,
577
581
  markDirty: ye,
578
- findBlockLocation: z,
582
+ findBlockLocation: L,
579
583
  setName: q,
580
- create: J,
581
- load: Ce,
582
- save: we,
583
- hasTemplate: Y
584
+ create: Ce,
585
+ load: J,
586
+ save: Y,
587
+ hasTemplate: we
584
588
  };
585
- return Me(X, (e, t) => Ae(e) ? je(K, e, t) : s() ? e === "updateBlock" ? fe(t[0], t[1]) : (e === "updateSettings" && me(t[0]), e === "addLocale" || e === "removeLocale" ? d(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? v(e, t) !== null : !0) : !1), X;
589
+ return Ne(X, (e, t) => Ae(e) ? je(K, e, t) : s() ? e === "updateBlock" ? fe(t[0], t[1]) : (e === "updateSettings" && me(t[0]), e === "addLocale" || e === "removeLocale" ? d(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? v(e, t) !== null : !0) : !1), X;
586
590
  }
587
591
  // ../core/src/history.ts
588
- var Ie = 50, Le = 300, Re = 1500;
589
- function ze(e) {
590
- let { content: t, setContent: n, maxSize: r = Ie } = e, i = S([]), a = S([]), o = S(!1), s = null, c = null, l = b(() => i.value.length > 0), u = b(() => a.value.length > 0);
592
+ var Le = 50, Re = 300, ze = 1500;
593
+ function Be(e) {
594
+ let { content: t, setContent: n, maxSize: r = Le } = e, i = S([]), a = S([]), o = S(!1), s = null, c = null, l = b(() => i.value.length > 0), u = b(() => a.value.length > 0);
591
595
  function d() {
592
- return U(t.value);
596
+ return H(t.value);
593
597
  }
594
598
  function f(e) {
595
599
  i.value.push(e), i.value.length > r && i.value.splice(0, i.value.length - r);
@@ -603,17 +607,17 @@ function ze(e) {
603
607
  function h(e) {
604
608
  c && c.blockId === e ? (clearTimeout(c.timeoutId), c.timeoutId = setTimeout(() => {
605
609
  c = null;
606
- }, Le)) : (p(), f(d()), a.value = [], c = {
610
+ }, Re)) : (p(), f(d()), a.value = [], c = {
607
611
  blockId: e,
608
612
  timeoutId: setTimeout(() => {
609
613
  c = null;
610
- }, Le)
614
+ }, Re)
611
615
  });
612
616
  }
613
617
  function g() {
614
618
  o.value = !0, s && clearTimeout(s), s = setTimeout(() => {
615
619
  o.value = !1, s = null;
616
- }, Re);
620
+ }, ze);
617
621
  }
618
622
  function _() {
619
623
  if (i.value.length === 0) return;
@@ -647,15 +651,15 @@ function ze(e) {
647
651
  };
648
652
  }
649
653
  // ../core/src/block-actions.ts
650
- function Be(e) {
654
+ function Ve(e) {
651
655
  let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
652
656
  function o(n, r, a) {
653
- let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = pe(n, o);
657
+ let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = me(n, o);
654
658
  return t(s, r, a), i(s.id), s;
655
659
  }
656
660
  function s(e, n, r) {
657
- let o = de(e);
658
- if (!Z(t, "duplicateBlock", [
661
+ let o = fe(e);
662
+ if (!Q(t, "duplicateBlock", [
659
663
  e,
660
664
  n,
661
665
  r
@@ -681,9 +685,9 @@ function Be(e) {
681
685
  };
682
686
  }
683
687
  // ../core/src/auto-save.ts
684
- var Ve = 2e3;
685
- function He(e) {
686
- let { content: t, isDirty: n, onChange: r, debounce: i = Ve, enabled: a = !0 } = e, o = null, s = !1;
688
+ var He = 2e3;
689
+ function Ue(e) {
690
+ let { content: t, isDirty: n, onChange: r, debounce: i = He, enabled: a = !0 } = e, o = null, s = !1;
687
691
  function c() {
688
692
  return typeof a == "function" ? a() : a;
689
693
  }
@@ -719,7 +723,7 @@ function He(e) {
719
723
  };
720
724
  }
721
725
  // ../core/src/condition-preview.ts
722
- function Ue(t) {
726
+ function We(t) {
723
727
  let n = e(/* @__PURE__ */ new Set()), r = b(() => n.size > 0);
724
728
  function i(e) {
725
729
  return n.has(e);
@@ -738,7 +742,7 @@ function Ue(t) {
738
742
  };
739
743
  }
740
744
  // ../core/src/data-source-fetch.ts
741
- function We(e) {
745
+ function Ge(e) {
742
746
  let t = S(!1), n = S(!1), r = b(() => !!e.definition.value?.dataSource), i = b(() => r.value && !e.block.value.dataSourceFetched);
743
747
  async function a() {
744
748
  let r = e.definition.value;
@@ -769,7 +773,7 @@ function We(e) {
769
773
  };
770
774
  }
771
775
  // ../core/src/history-interceptor.ts
772
- function Ge(e, t) {
776
+ function Ke(e, t) {
773
777
  e.activeLocale && h(e.activeLocale, () => t.flushDebounce?.());
774
778
  for (let n of [
775
779
  "addLocale",
@@ -780,70 +784,75 @@ function Ge(e, t) {
780
784
  ]) {
781
785
  let r = e[n];
782
786
  r && (Object.assign(e, { [n]: (...i) => {
783
- Z(e, n, i) && (["addLocale", "removeLocale"].includes(n) || !e.isBlockLocked(i[0])) && (t.record(), r(...i));
784
- } }), Ne(r, e[n]));
787
+ Q(e, n, i) && (["addLocale", "removeLocale"].includes(n) || !e.isBlockLocked(i[0])) && (t.record(), r(...i));
788
+ } }), Z(r, e[n]));
785
789
  }
786
790
  let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
787
791
  e.addBlock = (r, i, a, o) => {
788
- Z(e, "addBlock", [
792
+ Q(e, "addBlock", [
789
793
  r,
790
794
  i,
791
795
  a,
792
796
  o
793
797
  ]) && (t.record(), n(r, i, a, o));
794
798
  }, e.removeBlock = (n) => {
795
- Z(e, "removeBlock", [n]) && (t.record(), r(n));
799
+ Q(e, "removeBlock", [n]) && (t.record(), r(n));
796
800
  }, e.moveBlock = (n, r, a, o) => {
797
- Z(e, "moveBlock", [
801
+ Q(e, "moveBlock", [
798
802
  n,
799
803
  r,
800
804
  a,
801
805
  o
802
806
  ]) && (t.record(), i(n, r, a, o));
803
- }, Ne(n, e.addBlock), Ne(r, e.removeBlock), Ne(i, e.moveBlock), e.updateBlock = (n, r) => {
804
- Z(e, "updateBlock", [n, r]) && (e.isBlockLocked(n) || (t.recordDebounced(n), a(n, r)));
807
+ }, Z(n, e.addBlock), Z(r, e.removeBlock), Z(i, e.moveBlock), e.updateBlock = (n, r) => {
808
+ Q(e, "updateBlock", [n, r]) && (e.isBlockLocked(n) || (t.recordDebounced(n), a(n, r)));
805
809
  }, e.updateSettings = (n) => {
806
- Z(e, "updateSettings", [n]) && (t.record(), o(n));
807
- }, Ne(a, e.updateBlock), Ne(o, e.updateSettings);
810
+ Q(e, "updateSettings", [n]) && (t.record(), o(n));
811
+ }, Z(a, e.updateBlock), Z(o, e.updateSettings);
808
812
  }
809
813
  // ../core/src/diff-content.ts
810
- var Ke = "root", qe = /* @__PURE__ */ new Set([
814
+ var qe = "root", Je = /* @__PURE__ */ new Set([
811
815
  "id",
812
816
  "type",
813
817
  "children",
814
818
  "l10n"
815
- ]), Je = /* @__PURE__ */ new Set([
819
+ ]), Ye = /* @__PURE__ */ new Set([
816
820
  "id",
817
821
  "type",
818
822
  "children",
819
823
  "columns",
820
824
  "l10n"
821
- ]), Ye = /* @__PURE__ */ new Set(), Xe = /* @__PURE__ */ new Set(["locales", "l10n"]);
822
- function Ze(e) {
823
- return e === null ? Ke : JSON.stringify([e.sectionId, e.column]);
824
- }
825
+ ]), Xe = /* @__PURE__ */ new Set(), Ze = /* @__PURE__ */ new Set(["locales", "l10n"]);
825
826
  function Qe(e) {
827
+ return e === null ? qe : "wrapperId" in e ? JSON.stringify(["wrapper", e.wrapperId]) : JSON.stringify([
828
+ "section",
829
+ e.sectionId,
830
+ e.column
831
+ ]);
832
+ }
833
+ function $e(e) {
826
834
  let t = e.children;
827
835
  return e.type === "section" && Array.isArray(t) ? t : [];
828
836
  }
829
- function $e(e) {
837
+ function et(e) {
830
838
  let t = /* @__PURE__ */ new Map(), n = (e, r) => {
831
839
  e.forEach((e, i) => {
832
840
  t.has(e.id) || t.set(e.id, {
833
841
  block: e,
834
- key: Ze(r),
842
+ parent: r,
843
+ key: Qe(r),
835
844
  index: i
836
- }), Qe(e).forEach((t, r) => {
845
+ }), $e(e).forEach((t, r) => {
837
846
  Array.isArray(t) && n(t, {
838
847
  sectionId: e.id,
839
848
  column: r
840
849
  });
841
- });
850
+ }), e.type === "wrapper" && Array.isArray(e.children) && n(e.children, { wrapperId: e.id });
842
851
  });
843
852
  };
844
853
  return n(e, null), t;
845
854
  }
846
- function et(e) {
855
+ function tt(e) {
847
856
  let t = [], n = Array(e.length).fill(-1);
848
857
  e.forEach((r, i) => {
849
858
  let a = 0, o = t.length;
@@ -857,17 +866,17 @@ function et(e) {
857
866
  for (; i !== -1;) r.add(i), i = n[i];
858
867
  return r;
859
868
  }
860
- function tt(e, t, n) {
869
+ function nt(e, t, n) {
861
870
  let r = {}, i = [];
862
- for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || H(e[i], t[i]) || (r[i] = U(t[i]));
871
+ for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || G(e[i], t[i]) || (r[i] = H(t[i]));
863
872
  for (let r of Object.keys(e)) n.has(r) || e[r] === void 0 || t[r] === void 0 && i.push(r);
864
873
  return {
865
874
  set: r,
866
875
  unset: i
867
876
  };
868
877
  }
869
- function nt(e = {}, t = {}) {
870
- let n = tt(e.text ?? {}, t.text ?? {}, Ye), r = tt(e.set ?? {}, t.set ?? {}, Ye), i = [.../* @__PURE__ */ new Set([...n.unset, ...r.unset])];
878
+ function rt(e = {}, t = {}) {
879
+ let n = nt(e.text ?? {}, t.text ?? {}, Xe), r = nt(e.set ?? {}, t.set ?? {}, Xe), i = [.../* @__PURE__ */ new Set([...n.unset, ...r.unset])];
871
880
  return {
872
881
  ...Object.keys(n.set).length > 0 ? { text: n.set } : {},
873
882
  ...Object.keys(r.set).length > 0 ? { set: r.set } : {},
@@ -875,107 +884,142 @@ function nt(e = {}, t = {}) {
875
884
  ...e.hidden === t.hidden ? {} : { hidden: t.hidden === !0 }
876
885
  };
877
886
  }
878
- function rt(e, t) {
887
+ function it(e, t) {
879
888
  if (e.settings.locale !== t.settings.locale && (e.settings.locales?.length || t.settings.locales?.length)) return [{
880
889
  op: "setContent",
881
- content: U(t)
890
+ content: H(t)
882
891
  }];
883
- let n = $e(e.blocks), r = $e(t.blocks), i = [], a = (e) => {
892
+ let n = et(e.blocks), r = et(t.blocks), i = [], a = new Set(t.settings.locales ?? []), o = new Set(e.settings.locales ?? []), s = (e) => {
884
893
  let t = r.get(e), i = n.get(e);
885
894
  return t !== void 0 && i !== void 0 && t.block.type !== i.block.type;
886
- }, o = (e) => r.has(e.id) && !a(e.id), s = (e) => Qe(e).some((e) => Array.isArray(e) && e.some((e) => o(e) || !a(e.id) && s(e))), c = /* @__PURE__ */ new Set(), l = [], u = (e, t) => {
895
+ }, c = (e) => r.has(e.id) && !s(e.id), l = (e) => e.type === "wrapper" && Array.isArray(e.children) ? [e.children] : $e(e), u = (e) => l(e).some((e) => e.some((e) => c(e) || !s(e.id) && u(e))), d = /* @__PURE__ */ new Set(), f = [], p = (e, t) => {
887
896
  let n = "kept";
888
- t === "dropped" ? (c.add(e.id), n = "dropped") : a(e.id) ? (i.push({
897
+ t === "dropped" ? (d.add(e.id), n = "dropped") : s(e.id) ? (i.push({
889
898
  op: "deleteBlock",
890
899
  blockId: e.id
891
- }), c.add(e.id), n = "dropped") : r.has(e.id) || (t === "deferred" ? n = "deferred" : s(e) ? (l.push(e.id), n = "deferred") : (i.push({
900
+ }), d.add(e.id), n = "dropped") : r.has(e.id) || (t === "deferred" ? n = "deferred" : u(e) ? (f.push(e.id), n = "deferred") : (i.push({
892
901
  op: "deleteBlock",
893
902
  blockId: e.id
894
- }), c.add(e.id), n = "dropped"));
895
- for (let t of Qe(e)) if (Array.isArray(t)) for (let e of t) u(e, n);
903
+ }), d.add(e.id), n = "dropped"));
904
+ for (let t of l(e)) if (Array.isArray(t)) for (let e of t) p(e, n);
896
905
  };
897
- for (let t of e.blocks) u(t, "kept");
898
- let d = (e) => n.has(e) && !c.has(e), f = (e) => {
899
- let t = U(e);
900
- return t.type === "section" && (t.children = Qe(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => U(e)) : e)), t;
901
- }, p = (e, t, r) => {
902
- let a = Ze(e), o = [], s = [];
906
+ for (let t of e.blocks) p(t, "kept");
907
+ let m = (e) => n.has(e) && !d.has(e), h = (e) => {
908
+ let t = H(e);
909
+ return t.type === "section" ? t.children = $e(e).map((e) => Array.isArray(e) ? e.filter((e) => !m(e.id)).map(h) : e) : t.type === "wrapper" && e.type === "wrapper" && (t.children = e.children.filter((e) => !m(e.id)).map(h)), t;
910
+ }, g = (e, t, r) => {
911
+ let a = Qe(e), o = [], s = [];
903
912
  t.forEach((e, t) => {
904
913
  let r = n.get(e.id);
905
- d(e.id) && r !== void 0 && r.key === a && (o.push(r.index), s.push(t));
914
+ m(e.id) && r !== void 0 && r.key === a && (o.push(r.index), s.push(t));
906
915
  });
907
- let c = new Set([...et(o)].map((e) => s[e]));
916
+ let c = new Set([...tt(o)].map((e) => s[e]));
908
917
  t.forEach((n, a) => {
909
918
  if (c.has(a) || r(n)) return;
910
919
  let o = a > 0 ? t[a - 1].id : null;
911
- i.push(d(n.id) ? {
920
+ i.push(m(n.id) ? {
912
921
  op: "moveBlock",
913
922
  blockId: n.id,
914
923
  parent: e,
915
924
  after: o
916
925
  } : {
917
926
  op: "addBlock",
918
- block: f(n),
927
+ block: h(n),
919
928
  parent: e,
920
929
  after: o
921
930
  });
922
931
  });
923
932
  };
924
- p(null, t.blocks, () => !1);
925
- let m = t.blocks.filter((e) => e.type === "section"), h = /* @__PURE__ */ new Set(), g = (e) => {
926
- for (let t of m) {
927
- if (!d(t.id)) continue;
928
- let r = Qe(n.get(t.id).block).length, a = Qe(t).length;
933
+ g(null, t.blocks, () => !1);
934
+ let _ = [...r.values()].map(({ block: e }) => e).filter((e) => e.type === "section"), v = /* @__PURE__ */ new Set(), y = (e) => {
935
+ for (let t of _) {
936
+ if (!m(t.id)) continue;
937
+ let r = $e(n.get(t.id).block).length, a = $e(t).length;
929
938
  (e ? a > r : a < r) && (i.push({
930
939
  op: "updateBlock",
931
940
  blockId: t.id,
932
941
  set: { columns: t.columns }
933
- }), h.add(t.id));
942
+ }), v.add(t.id));
934
943
  }
935
944
  };
936
- g(!0);
937
- for (let e of m) {
938
- let t = !d(e.id);
939
- Qe(e).forEach((n, r) => {
940
- Array.isArray(n) && p({
945
+ y(!0);
946
+ for (let { block: e } of r.values()) {
947
+ if (e.type !== "wrapper") continue;
948
+ let t = !m(e.id);
949
+ g({ wrapperId: e.id }, e.children, (e) => t && !m(e.id));
950
+ }
951
+ for (let e of _) {
952
+ let t = !m(e.id);
953
+ $e(e).forEach((n, r) => {
954
+ Array.isArray(n) && g({
941
955
  sectionId: e.id,
942
956
  column: r
943
- }, n, (e) => t && !d(e.id));
957
+ }, n, (e) => t && !m(e.id));
944
958
  });
945
959
  }
946
- g(!1);
947
- for (let e of l) i.push({
960
+ y(!1);
961
+ for (let e of f) i.push({
948
962
  op: "deleteBlock",
949
963
  blockId: e
950
964
  });
965
+ let b = (e) => e.type === "slot" || l(e).some((e) => e.some(b)), x = (e) => {
966
+ let t = [], n = e;
967
+ for (; n !== null;) {
968
+ let e = "wrapperId" in n ? n.wrapperId : n.sectionId;
969
+ "wrapperId" in n && t.push(e), n = r.get(e)?.parent ?? null;
970
+ }
971
+ return t;
972
+ }, S = new Set(i.flatMap((e) => {
973
+ if (e.op !== "addBlock" && e.op !== "moveBlock" || e.parent === null) return [];
974
+ let t = e.op === "addBlock" ? e.block : n.get(e.blockId)?.block;
975
+ return t && b(t) ? x(e.parent) : [];
976
+ })), C = /* @__PURE__ */ new Set(), w = [];
977
+ for (let [e, t] of n) {
978
+ let n = r.get(e);
979
+ if (S.has(e) && n && c(t.block)) for (let [r, i] of Object.entries(t.block.l10n ?? {})) i.hidden === !0 && n.block.l10n?.[r]?.hidden !== !0 && o.has(r) && (w.push({
980
+ op: "updateBlockLocale",
981
+ blockId: e,
982
+ locale: r,
983
+ hidden: !1
984
+ }), C.add(JSON.stringify([e, r])));
985
+ }
986
+ let T = /* @__PURE__ */ new Set(), E = [];
987
+ for (let [e, t] of n) {
988
+ let n = r.get(e);
989
+ n && c(t.block) && t.block.type === "section" && t.block.wrapper !== void 0 && n.block.wrapper === void 0 && n.parent !== null && "wrapperId" in n.parent && (T.add(e), E.push({
990
+ op: "updateBlock",
991
+ blockId: e,
992
+ unset: ["wrapper"]
993
+ }));
994
+ }
995
+ i.unshift(...w, ...E);
951
996
  for (let [e, t] of r) {
952
- if (!d(e)) continue;
953
- let { set: r, unset: a } = tt(n.get(e).block, t.block, h.has(e) ? Je : qe);
954
- (Object.keys(r).length !== 0 || a.length !== 0) && i.push({
997
+ if (!m(e)) continue;
998
+ let r = nt(n.get(e).block, t.block, v.has(e) ? Ye : Je), { set: a } = r, o = T.has(e) ? r.unset.filter((e) => e !== "wrapper") : r.unset;
999
+ (Object.keys(a).length !== 0 || o.length !== 0) && i.push({
955
1000
  op: "updateBlock",
956
1001
  blockId: e,
957
- ...Object.keys(r).length > 0 ? { set: r } : {},
958
- ...a.length > 0 ? { unset: a } : {}
1002
+ ...Object.keys(a).length > 0 ? { set: a } : {},
1003
+ ...o.length > 0 ? { unset: o } : {}
959
1004
  });
960
1005
  }
961
- let _ = tt(e.settings, t.settings, Xe);
962
- (Object.keys(_.set).length > 0 || _.unset.length > 0) && i.push({
1006
+ let D = nt(e.settings, t.settings, Ze);
1007
+ (Object.keys(D.set).length > 0 || D.unset.length > 0) && i.push({
963
1008
  op: "updateSettings",
964
- ...Object.keys(_.set).length > 0 ? { set: _.set } : {},
965
- ..._.unset.length > 0 ? { unset: _.unset } : {}
1009
+ ...Object.keys(D.set).length > 0 ? { set: D.set } : {},
1010
+ ...D.unset.length > 0 ? { unset: D.unset } : {}
966
1011
  });
967
- let v = new Set(e.settings.locales ?? []), y = new Set(t.settings.locales ?? []);
968
- for (let e of y) v.has(e) || i.push({
1012
+ for (let e of a) o.has(e) || i.push({
969
1013
  op: "addLocale",
970
1014
  locale: e
971
1015
  });
972
1016
  for (let [e, t] of r) {
973
- if (!d(e)) continue;
974
- let r = n.get(e).block.l10n ?? {}, a = t.block.l10n ?? {};
975
- for (let t of /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(a)])) {
976
- if (!y.has(t)) continue;
977
- let n = nt(r[t], a[t]);
978
- Object.keys(n).length > 0 && i.push({
1017
+ if (!m(e)) continue;
1018
+ let r = n.get(e).block.l10n ?? {}, o = t.block.l10n ?? {};
1019
+ for (let t of /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(o)])) {
1020
+ if (!a.has(t)) continue;
1021
+ let n = rt(r[t], o[t]);
1022
+ C.has(JSON.stringify([e, t])) && delete n.hidden, Object.keys(n).length > 0 && i.push({
979
1023
  op: "updateBlockLocale",
980
1024
  blockId: e,
981
1025
  locale: t,
@@ -983,17 +1027,17 @@ function rt(e, t) {
983
1027
  });
984
1028
  }
985
1029
  }
986
- let b = e.settings.l10n ?? {}, x = t.settings.l10n ?? {};
987
- for (let e of /* @__PURE__ */ new Set([...Object.keys(b), ...Object.keys(x)])) {
988
- if (!y.has(e)) continue;
989
- let t = nt(b[e], x[e]);
1030
+ let O = e.settings.l10n ?? {}, k = t.settings.l10n ?? {};
1031
+ for (let e of /* @__PURE__ */ new Set([...Object.keys(O), ...Object.keys(k)])) {
1032
+ if (!a.has(e)) continue;
1033
+ let t = rt(O[e], k[e]);
990
1034
  Object.keys(t).length > 0 && i.push({
991
1035
  op: "updateSettingsLocale",
992
1036
  locale: e,
993
1037
  ...t
994
1038
  });
995
1039
  }
996
- for (let e of v) y.has(e) || i.push({
1040
+ for (let e of o) a.has(e) || i.push({
997
1041
  op: "removeLocale",
998
1042
  locale: e
999
1043
  });
@@ -1002,23 +1046,30 @@ function rt(e, t) {
1002
1046
  // ../core/src/localized-operations.ts
1003
1047
  function $(e) {
1004
1048
  let t = /* @__PURE__ */ new Map(), n = (e) => {
1005
- t.set(e.id, e), e.type === "section" && e.children.flat().forEach(n);
1049
+ t.set(e.id, e), e.type === "section" ? e.children.flat().forEach(n) : e.type === "wrapper" && e.children.forEach(n);
1006
1050
  };
1007
1051
  return e.forEach(n), t;
1008
1052
  }
1009
- function it(e, t) {
1053
+ function at(e, t) {
1010
1054
  if (t === null) return e.blocks;
1011
- let n = $(e.blocks).get(t.sectionId);
1012
- return n.type === "section" ? n.children[t.column] : [];
1055
+ if ("sectionId" in t) {
1056
+ let n = $(e.blocks).get(t.sectionId);
1057
+ return n?.type === "section" ? n.children[t.column] : [];
1058
+ }
1059
+ let n = $(e.blocks).get(t.wrapperId);
1060
+ return n?.type === "wrapper" ? n.children : [];
1013
1061
  }
1014
- function at(e, t) {
1062
+ function ot(e, t) {
1015
1063
  let n = (e, r) => {
1016
1064
  let i = e.findIndex((e) => e.id === t);
1017
1065
  if (i >= 0) return {
1018
1066
  parent: r,
1019
1067
  after: e[i - 1]?.id ?? null
1020
1068
  };
1021
- for (let t of e) if (t.type === "section") for (let [e, r] of t.children.entries()) {
1069
+ for (let t of e) if (t.type === "wrapper") {
1070
+ let e = n(t.children, { wrapperId: t.id });
1071
+ if (e) return e;
1072
+ } else if (t.type === "section") for (let [e, r] of t.children.entries()) {
1022
1073
  let i = n(r, {
1023
1074
  sectionId: t.id,
1024
1075
  column: e
@@ -1028,52 +1079,52 @@ function at(e, t) {
1028
1079
  };
1029
1080
  return n(e.blocks, null);
1030
1081
  }
1031
- function ot(e, t, n, r, i) {
1082
+ function st(e, t, n, r, i) {
1032
1083
  if (r !== null) return r;
1033
- let a = it(t, n).find((e) => e.id !== i), o = it(e, n).filter((e) => e.id !== i);
1084
+ let a = at(t, n).find((e) => e.id !== i), o = at(e, n).filter((e) => e.id !== i);
1034
1085
  return o[(a ? o.findIndex((e) => e.id === a.id) : o.length) - 1]?.id ?? null;
1035
1086
  }
1036
- function st(e, t, n) {
1087
+ function ct(e, t, n) {
1037
1088
  Object.keys(n).length ? (e.l10n ??= {})[t] = n : e.l10n && (delete e.l10n[t], Object.keys(e.l10n).length || delete e.l10n);
1038
1089
  }
1039
- function ct(e) {
1040
- let t = U(e);
1041
- return delete t.l10n, t.type === "section" && (t.children = t.children.map((e) => e.map(ct))), t;
1090
+ function lt(e) {
1091
+ let t = H(e);
1092
+ return delete t.l10n, t.type === "section" ? t.children = t.children.map((e) => e.map(lt)) : t.type === "wrapper" && (t.children = t.children.map(lt)), t;
1042
1093
  }
1043
- function lt(e, t, n, r) {
1044
- let i = re(e, t), a = U(e), o = U(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
1094
+ function ut(e, t, n, r) {
1095
+ let i = T(e, t), a = H(e), o = H(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
1045
1096
  for (let [i, a] of $(n)) c.set(i, {
1046
- initial: A(a, t, P(e)),
1097
+ initial: ae(a, t, A(e)),
1047
1098
  added: r,
1048
1099
  changed: !1
1049
1100
  });
1050
1101
  };
1051
1102
  l(i.blocks, !1);
1052
1103
  let u = [], d = (e, t, n) => {
1053
- if (t.some((e) => e?.op === "setDefaultLocale")) throw new M("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
1054
- if (t.some((e) => e?.op === "setContent")) throw new M("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
1104
+ if (t.some((e) => e?.op === "setDefaultLocale")) throw new P("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
1105
+ if (t.some((e) => e?.op === "setContent")) throw new P("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
1055
1106
  try {
1056
- return E(e, t);
1107
+ return O(e, t);
1057
1108
  } catch (e) {
1058
- throw e instanceof M ? new M(e.code, n, e.message, e.blockId) : e;
1109
+ throw e instanceof P ? new P(e.code, n, e.message, e.blockId) : e;
1059
1110
  }
1060
1111
  }, f = (e, t) => {
1061
1112
  a = d(a, e, t), u.push(...e);
1062
1113
  }, p = (e, n) => {
1063
1114
  let o = c.get(e);
1064
1115
  if (!o?.changed) return;
1065
- let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = U(a), d = it(u, at(u, e).parent), p = U(s);
1066
- if (o.added) p = ct(l), p.type === "section" && s.type === "section" && (p.children = s.children, p.columns = s.columns);
1116
+ let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = H(a), d = at(u, ot(u, e).parent), p = H(s);
1117
+ if (o.added) p = lt(l), p.type === "section" && s.type === "section" ? (p.children = s.children, p.columns = s.columns) : p.type === "wrapper" && s.type === "wrapper" && (p.children = s.children);
1067
1118
  else {
1068
1119
  De(p, p.type === "section" ? {
1069
1120
  ...l,
1070
1121
  children: p.children,
1071
1122
  columns: p.columns
1072
- } : l, (e) => $(a.blocks).get(e) ?? null), p = L(p);
1123
+ } : l, (e) => $(a.blocks).get(e) ?? null), p = R(p);
1073
1124
  let e = p.l10n?.[t];
1074
- st(p, t, ke(e, Ee(p, o.initial, e, r), Ee(p, l, e, r), p, l));
1125
+ ct(p, t, ke(e, Ee(p, o.initial, e, r), Ee(p, l, e, r), p, l));
1075
1126
  }
1076
- d[d.findIndex((t) => t.id === e)] = p, f(rt(a, u), n), o.changed = !1;
1127
+ d[d.findIndex((t) => t.id === e)] = p, f(it(a, u), n), o.changed = !1;
1077
1128
  }, m = (e, t, n) => {
1078
1129
  let r = $(a.blocks).get(e.blockId), i = $(t.blocks).get(e.blockId);
1079
1130
  if (r.type !== "section" || i.type !== "section" || r.columns === i.columns) return;
@@ -1092,7 +1143,7 @@ function lt(e, t, n, r) {
1092
1143
  op: "updateBlock",
1093
1144
  blockId: e.blockId,
1094
1145
  set: { columns: i.columns },
1095
- ...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, R(u, e) ?? null])) } : {}
1146
+ ...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, F(u, e) ?? null])) } : {}
1096
1147
  }], n);
1097
1148
  };
1098
1149
  n.forEach((e, t) => {
@@ -1100,19 +1151,19 @@ function lt(e, t, n, r) {
1100
1151
  let n = d(i, [e], t);
1101
1152
  switch (e.op) {
1102
1153
  case "addBlock": {
1103
- let n = ct(e.block);
1154
+ let n = lt(e.block);
1104
1155
  f([{
1105
1156
  ...e,
1106
1157
  block: n,
1107
- after: ot(a, i, e.parent, e.after)
1158
+ after: st(a, i, e.parent, e.after)
1108
1159
  }], t), l([n], !0);
1109
1160
  break;
1110
1161
  }
1111
1162
  case "moveBlock":
1112
1163
  f([{
1113
1164
  ...e,
1114
- after: ot(a, i, e.parent, e.after, e.blockId),
1115
- ...e.expect ? { expect: at(a, e.blockId) } : {}
1165
+ after: st(a, i, e.parent, e.after, e.blockId),
1166
+ ...e.expect ? { expect: ot(a, e.blockId) } : {}
1116
1167
  }], t);
1117
1168
  break;
1118
1169
  case "deleteBlock": {
@@ -1137,18 +1188,18 @@ function lt(e, t, n, r) {
1137
1188
  });
1138
1189
  for (let e of c.keys()) p(e, n.length - 1);
1139
1190
  if (s) {
1140
- let e = U(a), r = e.settings.l10n?.[t];
1141
- st(e.settings, t, ke(r, Oe(e.settings, o, r), Oe(e.settings, i.settings, r), e.settings, i.settings)), f(rt(a, e), n.length - 1);
1191
+ let e = H(a), r = e.settings.l10n?.[t];
1192
+ ct(e.settings, t, ke(r, Oe(e.settings, o, r), Oe(e.settings, i.settings, r), e.settings, i.settings)), f(it(a, e), n.length - 1);
1142
1193
  }
1143
1194
  return u;
1144
1195
  }
1145
- var ut = 1e3, dt = 1e4, ft = [
1196
+ var dt = 1e3, ft = 1e4, pt = [
1146
1197
  1e3,
1147
1198
  2e3,
1148
1199
  5e3,
1149
1200
  1e4,
1150
1201
  3e4
1151
- ], pt = 50, mt = 100, ht = /* @__PURE__ */ new Set([
1202
+ ], mt = 50, ht = 100, gt = /* @__PURE__ */ new Set([
1152
1203
  "block_exists",
1153
1204
  "block_missing",
1154
1205
  "anchor_missing",
@@ -1159,49 +1210,49 @@ var ut = 1e3, dt = 1e4, ft = [
1159
1210
  "lock_lost",
1160
1211
  "content_too_large"
1161
1212
  ]);
1162
- function gt(e, t) {
1213
+ function _t(e, t) {
1163
1214
  return e.ops.some((e) => e.op === "setContent") ? e.view = t : delete e.view, e;
1164
1215
  }
1165
- function _t(e) {
1216
+ function vt(e) {
1166
1217
  let t = e?.code;
1167
- return typeof t == "string" && ht.has(t) ? t : null;
1218
+ return typeof t == "string" && gt.has(t) ? t : null;
1168
1219
  }
1169
- function vt(e) {
1220
+ function yt(e) {
1170
1221
  let t = e?.holder;
1171
1222
  return typeof t == "object" && t && typeof t.sessionId == "string" ? t : void 0;
1172
1223
  }
1173
- function yt(e) {
1224
+ function bt(e) {
1174
1225
  let t = e?.statusCode;
1175
1226
  return typeof t != "number" || t >= 500 || t === 408 || t === 429;
1176
1227
  }
1177
- function bt(e, t) {
1228
+ function xt(e, t) {
1178
1229
  return e.some((e) => {
1179
1230
  if (e.id === t) return !0;
1180
1231
  let n = e.children;
1181
- return e.type === "section" && Array.isArray(n) && n.some((e) => Array.isArray(e) && bt(e, t));
1232
+ return e.type === "wrapper" && Array.isArray(n) && xt(n, t) || e.type === "section" && Array.isArray(n) && n.some((e) => Array.isArray(e) && xt(e, t));
1182
1233
  });
1183
1234
  }
1184
- function xt(e) {
1235
+ function St(e) {
1185
1236
  if (e.length === 1 && e[0].op === "updateSettings") return !0;
1186
1237
  let t = e[0];
1187
1238
  return t.op === "updateBlock" && e.every((e) => e.op === "updateBlock" && e.blockId === t.blockId) || t.op === "updateBlockLocale" && e.every((e) => e.op === "updateBlockLocale" && e.blockId === t.blockId && e.locale === t.locale);
1188
1239
  }
1189
- function St(e) {
1240
+ function Ct(e) {
1190
1241
  return e.map((e) => {
1191
1242
  if (!("expect" in e)) return e;
1192
1243
  let { expect: t, ...n } = e;
1193
1244
  return n;
1194
1245
  });
1195
1246
  }
1196
- function Ct(e) {
1197
- let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), r = e.maxUndo ?? pt, i = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", a = x([]), s = x(/* @__PURE__ */ new Map()), l = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = S(null), p = S(null), m = S(0), g = S(0), _ = null, v = null, y = !1, C = !1, w = !1, T = !1, D = null, O = 0, ee = !1, k = [], A = null, j = null, re = Promise.resolve(), N = null, ie = b(() => (v?.undo.length ?? 0) > 0), P = b(() => (v?.redo.length ?? 0) > 0);
1198
- function F(t) {
1247
+ function wt(e) {
1248
+ let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), r = e.maxUndo ?? mt, i = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", a = x([]), s = x(/* @__PURE__ */ new Map()), l = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = S(null), p = S(null), m = S(0), g = S(0), _ = null, v = null, y = !1, C = !1, w = !1, T = !1, E = null, D = 0, k = !1, ee = [], A = null, j = null, M = Promise.resolve(), N = null, F = b(() => (v?.undo.length ?? 0) > 0), re = b(() => (v?.redo.length ?? 0) > 0);
1249
+ function I(t) {
1199
1250
  e.onError?.(t instanceof Error ? t : Error(String(t)));
1200
1251
  }
1201
- function I(t, n = v) {
1202
- n !== v || ee || e.onNotice?.(t);
1252
+ function L(t, n = v) {
1253
+ n !== v || k || e.onNotice?.(t);
1203
1254
  }
1204
- function ae() {
1255
+ function ie() {
1205
1256
  return {
1206
1257
  locks: [...s.value.values()].map((e) => ({
1207
1258
  blockId: e.blockId,
@@ -1211,102 +1262,102 @@ function Ct(e) {
1211
1262
  session: n
1212
1263
  };
1213
1264
  }
1214
- function L() {
1265
+ function R() {
1215
1266
  g.value++;
1216
1267
  }
1217
- function R(e, t) {
1268
+ function ae(e, t) {
1218
1269
  e.push(t), e.length > r && e.splice(0, e.length - r);
1219
1270
  }
1220
- function z(e) {
1271
+ function oe(e) {
1221
1272
  if (!_ || y) return;
1222
1273
  C = !0;
1223
1274
  try {
1224
- let t = _.content.value, n = rt(t, e);
1275
+ let t = _.content.value, n = it(t, e);
1225
1276
  if (n.length > 0) try {
1226
1277
  te(t, n);
1227
1278
  } catch {
1228
- _.setContent(U(e), !1);
1279
+ _.setContent(H(e), !1);
1229
1280
  }
1230
- H(_.content.value, e) || _.setContent(U(e), !1);
1281
+ G(_.content.value, e) || _.setContent(H(e), !1);
1231
1282
  } finally {
1232
1283
  C = !1;
1233
1284
  }
1234
1285
  let t = _.state.selectedBlockId;
1235
- t && !bt(e.blocks, t) && _.selectBlock(null);
1286
+ t && !xt(e.blocks, t) && _.selectBlock(null);
1236
1287
  }
1237
- function oe() {
1288
+ function se() {
1238
1289
  C || T || (T = !0, queueMicrotask(() => {
1239
- T = !1, se(!1);
1290
+ T = !1, B(!1);
1240
1291
  }));
1241
1292
  }
1242
- function B() {
1243
- D &&= (clearTimeout(D), null);
1293
+ function z() {
1294
+ E &&= (clearTimeout(E), null);
1244
1295
  }
1245
- function se(e, t = !1) {
1296
+ function B(e, t = !1) {
1246
1297
  let n = v;
1247
1298
  if (!_ || !n || y || C || _.state.isLoading && !t || _.state.template?.id !== n.templateId) return;
1248
- let r = rt(n.view, _.content.value);
1249
- if (r.length === 0) B();
1299
+ let r = it(n.view, _.content.value);
1300
+ if (r.length === 0) z();
1250
1301
  else {
1251
- if (!e && xt(r)) {
1302
+ if (!e && St(r)) {
1252
1303
  let e = Date.now();
1253
- if (D === null && (O = e), e - O < 1e3) {
1254
- D && clearTimeout(D), D = setTimeout(() => {
1255
- D = null, se(!0);
1304
+ if (E === null && (D = e), e - D < 1e3) {
1305
+ E && clearTimeout(E), E = setTimeout(() => {
1306
+ E = null, B(!0);
1256
1307
  }, 300);
1257
1308
  return;
1258
1309
  }
1259
1310
  }
1260
- B(), ce(n, r);
1311
+ z(), ce(n, r);
1261
1312
  }
1262
1313
  }
1263
1314
  function V() {
1264
- se(!0);
1315
+ B(!0);
1265
1316
  }
1266
1317
  function ce(e, t) {
1267
1318
  let n = t, r;
1268
1319
  try {
1269
- r = E(e.view, n, ae());
1320
+ r = O(e.view, n, ie());
1270
1321
  } catch (n) {
1271
- if (!(n instanceof M)) throw n;
1272
- z(e.view);
1273
- let r = n.blockId === void 0 ? void 0 : Ae(n.blockId).find((e) => {
1322
+ if (!(n instanceof P)) throw n;
1323
+ oe(e.view);
1324
+ let r = n.blockId === void 0 ? void 0 : ke(n.blockId).find((e) => {
1274
1325
  let r = t[n.opIndex];
1275
1326
  return r.op !== "updateBlockLocale" || e.locale == null || e.locale === r.locale;
1276
1327
  })?.holder;
1277
- I({
1328
+ L({
1278
1329
  type: "editRefused",
1279
1330
  code: n.code,
1280
1331
  ...r ? { holder: r } : {}
1281
- }), n.code === "invalid_operation" && F(n);
1332
+ }), n.code === "invalid_operation" && I(n);
1282
1333
  return;
1283
1334
  }
1284
1335
  let i = _.content.value;
1285
- if (!H(r, i)) {
1286
- F(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
1336
+ if (!G(r, i)) {
1337
+ I(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
1287
1338
  op: "setContent",
1288
- content: U(i)
1339
+ content: H(i)
1289
1340
  }];
1290
1341
  try {
1291
- r = E(e.view, n, ae());
1342
+ r = O(e.view, n, ie());
1292
1343
  } catch (t) {
1293
- if (!(t instanceof M)) throw t;
1294
- z(e.view), I({
1344
+ if (!(t instanceof P)) throw t;
1345
+ oe(e.view), L({
1295
1346
  type: "editRefused",
1296
1347
  code: t.code
1297
1348
  });
1298
1349
  return;
1299
1350
  }
1300
1351
  }
1301
- let a = gt({ ops: ne(e.view, n) }, r);
1302
- R(e.undo, a), e.redo = [], L();
1352
+ let a = _t({ ops: ne(e.view, n) }, r);
1353
+ ae(e.undo, a), e.redo = [], R();
1303
1354
  let o = e.view;
1304
1355
  e.view = r, le(e, n, "edit", a, o);
1305
1356
  }
1306
1357
  function le(e, t, n, r, i) {
1307
1358
  let a = { dropped: !1 }, o = 0, s = i;
1308
1359
  do {
1309
- let i = t.slice(o, o + mt);
1360
+ let i = t.slice(o, o + ht);
1310
1361
  if (e.pending.push({
1311
1362
  batchId: crypto.randomUUID(),
1312
1363
  ops: i,
@@ -1316,42 +1367,42 @@ function Ct(e) {
1316
1367
  sent: !1,
1317
1368
  revision: null,
1318
1369
  ...s && i.some((e) => e.op === "setContent") ? { base: s } : {}
1319
- }), o += mt, s && t.slice(o).some((e) => e.op === "setContent")) try {
1320
- s = E(s, i);
1370
+ }), o += ht, s && t.slice(o).some((e) => e.op === "setContent")) try {
1371
+ s = O(s, i);
1321
1372
  } catch {
1322
1373
  s = null;
1323
1374
  }
1324
1375
  } while (o < t.length);
1325
- W(e);
1376
+ U(e);
1326
1377
  }
1327
- function W(e) {
1378
+ function U(e) {
1328
1379
  if (e.inFlight || w) return;
1329
1380
  let t = e.pending.find((e) => !e.sent);
1330
- t ? (t.sent = !0, e.inFlight = t, ue(e, t, 0)) : he(e);
1381
+ t ? (t.sent = !0, e.inFlight = t, W(e, t, 0)) : he(e);
1331
1382
  }
1332
- function ue(e, n, r) {
1383
+ function W(e, n, r) {
1333
1384
  t.submit(e.templateId, {
1334
1385
  batchId: n.batchId,
1335
1386
  baseRevision: n.baseRevision ??= e.revision,
1336
1387
  ops: n.ops,
1337
1388
  ...n.origin === "ai" ? { origin: "ai" } : {}
1338
1389
  }).then(({ revision: t }) => {
1339
- e.inFlight = null, de(e, n, t), W(e);
1390
+ e.inFlight = null, ue(e, n, t), U(e);
1340
1391
  }, (t) => {
1341
- if (_t(t) !== null) e.inFlight = null, me(e, n, t), W(e);
1342
- else if (yt(t)) {
1392
+ if (vt(t) !== null) e.inFlight = null, me(e, n, t), U(e);
1393
+ else if (bt(t)) {
1343
1394
  K(e, t);
1344
- let i = ft[Math.min(r, ft.length - 1)];
1395
+ let i = pt[Math.min(r, pt.length - 1)];
1345
1396
  setTimeout(() => {
1346
- ee || ue(e, n, r + 1);
1397
+ k || W(e, n, r + 1);
1347
1398
  }, i);
1348
- } else e.inFlight = null, F(t), me(e, n, t), W(e);
1399
+ } else e.inFlight = null, I(t), me(e, n, t), U(e);
1349
1400
  });
1350
1401
  }
1351
- function de(e, t, n) {
1352
- t.revision === null && (t.revision = n, n <= e.revision ? (G(e, t), ye(e)) : (e.own.set(n, t), ve(e)));
1402
+ function ue(e, t, n) {
1403
+ t.revision === null && (t.revision = n, n <= e.revision ? (de(e, t), ye(e)) : (e.own.set(n, t), ve(e)));
1353
1404
  }
1354
- function G(e, t) {
1405
+ function de(e, t) {
1355
1406
  e.pending = e.pending.filter((e) => e !== t), he(e);
1356
1407
  }
1357
1408
  function fe(e, t) {
@@ -1360,7 +1411,7 @@ function Ct(e) {
1360
1411
  let e = n.indexOf(t.entry);
1361
1412
  e !== -1 && n.splice(e, 1);
1362
1413
  }
1363
- L();
1414
+ R();
1364
1415
  }
1365
1416
  }
1366
1417
  function pe(e, t) {
@@ -1368,16 +1419,16 @@ function Ct(e) {
1368
1419
  return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && fe(e, t), he(e), n;
1369
1420
  }
1370
1421
  function me(e, t, n) {
1371
- if (G(e, t), pe(e, t)) {
1372
- let r = _t(n) ?? "invalid_operation";
1422
+ if (de(e, t), pe(e, t)) {
1423
+ let r = vt(n) ?? "invalid_operation";
1373
1424
  if (t.origin === "edit" || t.origin === "ai") {
1374
- let t = vt(n);
1375
- I({
1425
+ let t = yt(n);
1426
+ L({
1376
1427
  type: "editRefused",
1377
1428
  code: r,
1378
1429
  ...t ? { holder: t } : {}
1379
1430
  }, e);
1380
- } else I({
1431
+ } else L({
1381
1432
  type: "undoSkipped",
1382
1433
  code: r
1383
1434
  }, e);
@@ -1394,16 +1445,16 @@ function Ct(e) {
1394
1445
  function ge(e, t) {
1395
1446
  if (t.revision <= e.revision) return;
1396
1447
  let n = e.pending.find((e) => e.batchId === t.batchId);
1397
- n ? de(e, n, t.revision) : (e.remote.set(t.revision, t), ve(e));
1448
+ n ? ue(e, n, t.revision) : (e.remote.set(t.revision, t), ve(e));
1398
1449
  }
1399
1450
  function _e(t, n) {
1400
1451
  let r = n.ops;
1401
1452
  if (e.normalizeRemoteOperations) try {
1402
1453
  r = e.normalizeRemoteOperations(n.ops, t.confirmed);
1403
1454
  } catch (e) {
1404
- F(e);
1455
+ I(e);
1405
1456
  }
1406
- return St(r);
1457
+ return Ct(r);
1407
1458
  }
1408
1459
  function ve(t) {
1409
1460
  let n = [], r = !1;
@@ -1411,16 +1462,16 @@ function Ct(e) {
1411
1462
  let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
1412
1463
  if (!i && !a) break;
1413
1464
  try {
1414
- t.confirmed = E(t.confirmed, i ? _e(t, i) : a.ops);
1465
+ t.confirmed = O(t.confirmed, i ? _e(t, i) : a.ops);
1415
1466
  } catch {
1416
1467
  if (t.recovering) {
1417
- t.remote.clear(), t.own.clear(), F(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
1468
+ t.remote.clear(), t.own.clear(), I(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
1418
1469
  return;
1419
1470
  }
1420
- J(t);
1471
+ Ce(t);
1421
1472
  return;
1422
1473
  }
1423
- t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), G(t, a));
1474
+ t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), de(t, a));
1424
1475
  }
1425
1476
  if (t === v && (m.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? xe(t) : Se(t), (n.length !== 0 || r) && (ye(t), t === v)) for (let t of n) try {
1426
1477
  e.onRemoteChange?.({
@@ -1429,7 +1480,7 @@ function Ct(e) {
1429
1480
  locale: t.ops.find((e) => e.op !== "setDefaultLocale" && "locale" in e)?.locale ?? null
1430
1481
  });
1431
1482
  } catch (e) {
1432
- F(e);
1483
+ I(e);
1433
1484
  }
1434
1485
  }
1435
1486
  function ye(e) {
@@ -1440,21 +1491,21 @@ function Ct(e) {
1440
1491
  } finally {
1441
1492
  t && (w = !1);
1442
1493
  }
1443
- t && W(e);
1494
+ t && U(e);
1444
1495
  }
1445
1496
  function be(e) {
1446
1497
  e === v && V();
1447
1498
  let t = e.confirmed;
1448
1499
  for (let n = 0; n < e.pending.length; n++) {
1449
1500
  let r = e.pending[n], i;
1450
- if (r.base && !H(r.base, t)) i = "precondition_failed";
1501
+ if (r.base && !G(r.base, t)) i = "precondition_failed";
1451
1502
  else try {
1452
- t = E(t, r.ops);
1503
+ t = O(t, r.ops);
1453
1504
  continue;
1454
1505
  } catch (e) {
1455
- i = e instanceof M ? e.code : "invalid_operation";
1506
+ i = e instanceof P ? e.code : "invalid_operation";
1456
1507
  }
1457
- r.sent || (pe(e, r) && I(r.origin === "edit" || r.origin === "ai" ? {
1508
+ r.sent || (pe(e, r) && L(r.origin === "edit" || r.origin === "ai" ? {
1458
1509
  type: "editRefused",
1459
1510
  code: i
1460
1511
  } : {
@@ -1462,12 +1513,12 @@ function Ct(e) {
1462
1513
  code: i
1463
1514
  }, e), t = e.confirmed, n = -1);
1464
1515
  }
1465
- e.view = t, he(e), e === v && z(t);
1516
+ e.view = t, he(e), e === v && oe(t);
1466
1517
  }
1467
1518
  function xe(e) {
1468
1519
  e.gapTimer ||= setTimeout(() => {
1469
1520
  e.gapTimer = null, e === v && q();
1470
- }, ut);
1521
+ }, dt);
1471
1522
  }
1472
1523
  function Se(e) {
1473
1524
  e.gapTimer &&= (clearTimeout(e.gapTimer), null);
@@ -1479,33 +1530,33 @@ function Ct(e) {
1479
1530
  let n = await t.operationsAfter(e.templateId, e.revision);
1480
1531
  if (e.retired) return;
1481
1532
  if ("resync" in n) {
1482
- await J(e);
1533
+ await Ce(e);
1483
1534
  return;
1484
1535
  }
1485
1536
  for (let t of n.batches) ge(e, t);
1486
1537
  } catch (e) {
1487
- F(e);
1538
+ I(e);
1488
1539
  } finally {
1489
1540
  e.catchingUp = null;
1490
1541
  }
1491
1542
  })(), e.catchingUp) : Promise.resolve();
1492
1543
  }
1493
- async function J(t) {
1544
+ async function Ce(t) {
1494
1545
  t.recovering = !0;
1495
1546
  try {
1496
1547
  let n = await e.loadTemplate(t.templateId);
1497
1548
  if (t.retired) return;
1498
1549
  let r = n.revision ?? t.revision;
1499
- t.confirmed = U(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
1500
- for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), G(t, n));
1550
+ t.confirmed = H(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
1551
+ for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), de(t, n));
1501
1552
  t === v && (m.value = r), ye(t), ve(t);
1502
1553
  } catch (e) {
1503
- F(e);
1554
+ I(e);
1504
1555
  } finally {
1505
1556
  t.recovering = !1;
1506
1557
  }
1507
1558
  }
1508
- function Ce(t) {
1559
+ function J(t) {
1509
1560
  let n = () => t === v && !t.retired;
1510
1561
  return {
1511
1562
  onBatch: (e) => {
@@ -1519,13 +1570,13 @@ function Ct(e) {
1519
1570
  actor: i
1520
1571
  });
1521
1572
  } catch (e) {
1522
- F(e);
1573
+ I(e);
1523
1574
  }
1524
1575
  q();
1525
1576
  }
1526
1577
  },
1527
1578
  onLock: (e) => {
1528
- n() && X(e);
1579
+ n() && je(e);
1529
1580
  },
1530
1581
  onUnlock: (e, t, r) => {
1531
1582
  n() && Me(e, t, r);
@@ -1534,23 +1585,23 @@ function Ct(e) {
1534
1585
  n() && Z(e);
1535
1586
  },
1536
1587
  onConnectionChange: (e) => {
1537
- n() && Ee(t, e);
1588
+ n() && X(t, e);
1538
1589
  }
1539
1590
  };
1540
1591
  }
1541
- function we(e, r) {
1592
+ function Y(e, r) {
1542
1593
  let i = d;
1543
- t.join(e.templateId, { sessionId: n }, Ce(e)).then((t) => {
1544
- e.retired || e !== v ? r || t.leave() : (e.leave = t.leave, Ne(t.locks, !r, i), Z(t.members), t.members.length > 0 && (p.value = "connected"), t.revision > e.revision && q(), r && Q());
1545
- }, (e) => F(e));
1594
+ t.join(e.templateId, { sessionId: n }, J(e)).then((t) => {
1595
+ e.retired || e !== v ? r || t.leave() : (e.leave = t.leave, Ne(t.locks, !r, i), Z(t.members), t.members.length > 0 && (p.value = "connected"), t.revision > e.revision && q(), r && Pe());
1596
+ }, (e) => I(e));
1546
1597
  }
1547
- function Te(e) {
1548
- let t = U(e.content), n = {
1598
+ function we(e) {
1599
+ let t = H(e.content), n = {
1549
1600
  templateId: e.id,
1550
1601
  confirmed: t,
1551
1602
  revision: e.revision ?? 0,
1552
1603
  pending: [],
1553
- view: U(t),
1604
+ view: H(t),
1554
1605
  remote: /* @__PURE__ */ new Map(),
1555
1606
  own: /* @__PURE__ */ new Map(),
1556
1607
  inFlight: null,
@@ -1563,49 +1614,49 @@ function Ct(e) {
1563
1614
  redo: [],
1564
1615
  waiters: []
1565
1616
  };
1566
- v = n, m.value = n.revision, L(), we(n, !1), _?.state.selectedBlockId && ze(_.state.selectedBlockId), oe();
1617
+ v = n, m.value = n.revision, R(), Y(n, !1), _?.state.selectedBlockId && ze(_.state.selectedBlockId), se();
1567
1618
  }
1568
- function Y(e) {
1619
+ function Te(e) {
1569
1620
  e.retired = !0, Se(e), e.leave?.(), e.leave = null, K(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
1570
1621
  }
1571
- function Ee(e, t) {
1622
+ function X(e, t) {
1572
1623
  let n = p.value;
1573
- p.value = t, t === "connected" && n !== null && n !== "connected" && we(e, !0);
1624
+ p.value = t, t === "connected" && n !== null && n !== "connected" && Y(e, !0);
1574
1625
  }
1575
- function De(e) {
1576
- v && v.templateId === e?.id || (v &&= (B(), Y(v), null), a.value = [], s.value = /* @__PURE__ */ new Map(), p.value = null, A = null, Q(), L(), e && Te(e));
1626
+ function Ee(e) {
1627
+ v && v.templateId === e?.id || (v &&= (z(), Te(v), null), a.value = [], s.value = /* @__PURE__ */ new Map(), p.value = null, A = null, Pe(), R(), e && we(e));
1577
1628
  }
1578
- function Oe(e, t) {
1629
+ function De(e, t) {
1579
1630
  return `${e}\u0000${t ?? ""}`;
1580
1631
  }
1581
- function ke(e, t, n) {
1632
+ function Oe(e, t, n) {
1582
1633
  return e.blockId === t && (n == null || e.locale == null || e.locale === n);
1583
1634
  }
1584
- function Ae(e) {
1635
+ function ke(e) {
1585
1636
  return [...s.value.values()].filter((t) => t.blockId === e);
1586
1637
  }
1587
- function je(e) {
1638
+ function Ae(e) {
1588
1639
  e !== f.value && (V(), f.value = e, ze(_?.state.selectedBlockId ?? null));
1589
1640
  }
1590
- function X(e, t = !1) {
1641
+ function je(e, t = !1) {
1591
1642
  if (e.holder.sessionId === n) return;
1592
1643
  t ? l.add(e) : u.set(e, ++d);
1593
1644
  let r = new Map([...s.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
1594
- r.set(Oe(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), I({
1645
+ r.set(De(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), L({
1595
1646
  type: "selectionRefused",
1596
1647
  blockId: e.blockId,
1597
1648
  holder: e.holder
1598
1649
  }));
1599
1650
  }
1600
1651
  function Me(e, t, n) {
1601
- let r = Oe(e, n), i = new Map([...s.value].filter(([n, i]) => i.holder.sessionId !== t || n !== r && !(i.blockId === e && l.has(i))));
1652
+ let r = De(e, n), i = new Map([...s.value].filter(([n, i]) => i.holder.sessionId !== t || n !== r && !(i.blockId === e && l.has(i))));
1602
1653
  i.size !== s.value.size && (s.value = i);
1603
1654
  }
1604
1655
  function Ne(e, t, r) {
1605
1656
  let i = new Map([...s.value].filter(([, e]) => !l.has(e) && (t || (u.get(e) ?? 0) > r))), a = [...i.values()];
1606
- for (let t of e) if (t.holder.sessionId !== n && !a.some((e) => e.holder.sessionId === t.holder.sessionId || ke(e, t.blockId, t.locale))) {
1657
+ for (let t of e) if (t.holder.sessionId !== n && !a.some((e) => e.holder.sessionId === t.holder.sessionId || Oe(e, t.blockId, t.locale))) {
1607
1658
  for (let [e, n] of i) n.holder.sessionId === t.holder.sessionId && i.delete(e);
1608
- i.set(Oe(t.blockId, t.locale), t);
1659
+ i.set(De(t.blockId, t.locale), t);
1609
1660
  }
1610
1661
  s.value = i;
1611
1662
  }
@@ -1615,11 +1666,11 @@ function Ct(e) {
1615
1666
  let r = new Map([...s.value].filter(([, e]) => !n.has(e.holder.sessionId)));
1616
1667
  r.size !== s.value.size && (s.value = r);
1617
1668
  }
1618
- function Pe(e) {
1619
- re = re.then(e).catch(F);
1669
+ function Q(e) {
1670
+ M = M.then(e).catch(I);
1620
1671
  }
1621
- function Q() {
1622
- i && Pe(async () => {
1672
+ function Pe() {
1673
+ i && Q(async () => {
1623
1674
  if (j && (A === null || j.templateId !== A.templateId || j.locale !== A.locale)) {
1624
1675
  let e = j;
1625
1676
  j = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale);
@@ -1639,38 +1690,38 @@ function Ct(e) {
1639
1690
  });
1640
1691
  }
1641
1692
  function Fe(e, t) {
1642
- let n = new Map([...s.value].filter(([, n]) => !ke(n, e, t)));
1693
+ let n = new Map([...s.value].filter(([, n]) => !Oe(n, e, t)));
1643
1694
  n.size !== s.value.size && (s.value = n);
1644
1695
  }
1645
1696
  function Ie(e, t) {
1646
- let n = _t(t);
1697
+ let n = vt(t);
1647
1698
  if (n === "lock_held" || n === "block_missing") {
1648
1699
  A = null;
1649
- let n = vt(t);
1650
- n ? X({
1700
+ let n = yt(t);
1701
+ n ? je({
1651
1702
  blockId: e,
1652
1703
  holder: n,
1653
1704
  expiresAt: ""
1654
1705
  }, !0) : _?.state.selectedBlockId === e && _.selectBlock(null);
1655
- } else F(t), setTimeout(() => {
1656
- A?.blockId === e && Q();
1657
- }, ft[0]);
1706
+ } else I(t), setTimeout(() => {
1707
+ A?.blockId === e && Pe();
1708
+ }, pt[0]);
1658
1709
  }
1659
1710
  function Le() {
1660
1711
  N ||= setInterval(() => {
1661
- Pe(async () => {
1712
+ Q(async () => {
1662
1713
  let e = j;
1663
1714
  if (e) try {
1664
1715
  await t.renewLock(e.templateId, e.blockId, e.locale);
1665
1716
  } catch (e) {
1666
- if (_t(e) === "lock_lost") {
1667
- j = null, Re(), Q();
1717
+ if (vt(e) === "lock_lost") {
1718
+ j = null, Re(), Pe();
1668
1719
  return;
1669
1720
  }
1670
- F(e);
1721
+ I(e);
1671
1722
  }
1672
1723
  });
1673
- }, dt);
1724
+ }, ft);
1674
1725
  }
1675
1726
  function Re() {
1676
1727
  N &&= (clearInterval(N), null);
@@ -1680,7 +1731,7 @@ function Ct(e) {
1680
1731
  templateId: v.templateId,
1681
1732
  blockId: e,
1682
1733
  locale: f.value
1683
- } : null, Q());
1734
+ } : null, Pe());
1684
1735
  }
1685
1736
  function Be() {
1686
1737
  V(), j && i && (t.releaseLock(j.templateId, j.blockId, j.locale).catch(() => {}), j = null, Re()), v?.leave?.(), v && (v.leave = null);
@@ -1691,8 +1742,8 @@ function Ct(e) {
1691
1742
  V();
1692
1743
  let n = (e === "undo" ? t.undo : t.redo).pop();
1693
1744
  if (!n) return;
1694
- if (L(), n.view && !H(n.view, t.view)) {
1695
- I({
1745
+ if (R(), n.view && !G(n.view, t.view)) {
1746
+ L({
1696
1747
  type: "undoSkipped",
1697
1748
  code: "precondition_failed"
1698
1749
  });
@@ -1700,30 +1751,30 @@ function Ct(e) {
1700
1751
  }
1701
1752
  let r;
1702
1753
  try {
1703
- r = E(t.view, n.ops, ae());
1754
+ r = O(t.view, n.ops, ie());
1704
1755
  } catch (e) {
1705
- if (!(e instanceof M)) throw e;
1706
- I({
1756
+ if (!(e instanceof P)) throw e;
1757
+ L({
1707
1758
  type: "undoSkipped",
1708
1759
  code: e.code
1709
1760
  });
1710
1761
  return;
1711
1762
  }
1712
- let i = gt({ ops: ne(t.view, n.ops) }, r);
1713
- R(e === "undo" ? t.redo : t.undo, i);
1763
+ let i = _t({ ops: ne(t.view, n.ops) }, r);
1764
+ ae(e === "undo" ? t.redo : t.undo, i);
1714
1765
  let a = t.view;
1715
- t.view = r, z(r), _?.markDirty(), le(t, n.ops, e, i, a);
1766
+ t.view = r, oe(r), _?.markDirty(), le(t, n.ops, e, i, a);
1716
1767
  }
1717
1768
  function He(e, t) {
1718
1769
  let n = v;
1719
1770
  if (!_ || !n || y) return {
1720
1771
  applied: !1,
1721
- error: new M("invalid_operation", 0, "No template is open for editing.")
1772
+ error: new P("invalid_operation", 0, "No template is open for editing.")
1722
1773
  };
1723
1774
  if (t.origin === void 0) try {
1724
- E(_.content.value, e, ae());
1775
+ O(_.content.value, e, ie());
1725
1776
  } catch (e) {
1726
- if (e instanceof M) return {
1777
+ if (e instanceof P) return {
1727
1778
  applied: !1,
1728
1779
  error: e
1729
1780
  };
@@ -1732,9 +1783,9 @@ function Ct(e) {
1732
1783
  V();
1733
1784
  let r, i;
1734
1785
  try {
1735
- r = E(n.view, e, ae()), i = ne(n.view, e);
1786
+ r = O(n.view, e, ie()), i = ne(n.view, e);
1736
1787
  } catch (e) {
1737
- if (e instanceof M) return {
1788
+ if (e instanceof P) return {
1738
1789
  applied: !1,
1739
1790
  error: e
1740
1791
  };
@@ -1742,15 +1793,15 @@ function Ct(e) {
1742
1793
  }
1743
1794
  let a = n.undo.at(-1), o;
1744
1795
  if (t.origin === "ai" && t.turn !== void 0 && a && a.turn === t.turn) {
1745
- let e = a.view !== void 0 && !H(a.view, n.view);
1746
- a.ops = [...i, ...a.ops], o = e ? a : gt(a, r);
1747
- } else o = gt({
1796
+ let e = a.view !== void 0 && !G(a.view, n.view);
1797
+ a.ops = [...i, ...a.ops], o = e ? a : _t(a, r);
1798
+ } else o = _t({
1748
1799
  ops: i,
1749
1800
  ...t.origin === "ai" && t.turn !== void 0 ? { turn: t.turn } : {}
1750
- }, r), R(n.undo, o);
1751
- n.redo = [], L();
1801
+ }, r), ae(n.undo, o);
1802
+ n.redo = [], R();
1752
1803
  let s = n.view;
1753
- return n.view = r, z(r), _.markDirty(), le(n, e, t.origin ?? "edit", o, s), {
1804
+ return n.view = r, oe(r), _.markDirty(), le(n, e, t.origin ?? "edit", o, s), {
1754
1805
  applied: !0,
1755
1806
  inverse: i
1756
1807
  };
@@ -1761,7 +1812,7 @@ function Ct(e) {
1761
1812
  if (t.moveBlock && t.findBlockLocation) {
1762
1813
  let n = t.moveBlock, r = (...r) => {
1763
1814
  let i = v, a = i && !y && !C && !e.state.isLoading && e.state.template?.id === i.templateId;
1764
- if (a && se(!0), n(...r), !a || H(i.view, e.content.value)) return;
1815
+ if (a && B(!0), n(...r), !a || G(i.view, e.content.value)) return;
1765
1816
  let o = t.findBlockLocation(r[0]);
1766
1817
  if (!o) return;
1767
1818
  let s = o.targetSectionId ? {
@@ -1775,11 +1826,11 @@ function Ct(e) {
1775
1826
  after: (s && c?.type === "section" ? c.children[s.column] : e.content.value.blocks)[o.index - 1]?.id ?? null
1776
1827
  }]);
1777
1828
  };
1778
- t.moveBlock = r, k.push(() => {
1829
+ t.moveBlock = r, ee.push(() => {
1779
1830
  t.moveBlock === r && (t.moveBlock = n);
1780
1831
  });
1781
1832
  }
1782
- k.push(h(() => e.state.template, (e) => De(e), { immediate: !0 }), h(() => e.content.value, oe, { deep: !0 }), h(() => e.state.selectedBlockId, ze), h(() => e.state.isLoading, (e) => e ? se(!0, !0) : oe())), typeof window < "u" && (window.addEventListener("pagehide", Be), window.addEventListener("blur", V)), c() && o(qe);
1833
+ ee.push(h(() => e.state.template, (e) => Ee(e), { immediate: !0 }), h(() => e.content.value, se, { deep: !0 }), h(() => e.state.selectedBlockId, ze), h(() => e.state.isLoading, (e) => e ? B(!0, !0) : se())), typeof window < "u" && (window.addEventListener("pagehide", Be), window.addEventListener("blur", V)), c() && o(qe);
1783
1834
  }
1784
1835
  function We() {
1785
1836
  V();
@@ -1793,44 +1844,44 @@ function Ct(e) {
1793
1844
  V(), y = !0;
1794
1845
  }
1795
1846
  function Ke() {
1796
- y = !1, v && z(v.view);
1847
+ y = !1, v && oe(v.view);
1797
1848
  }
1798
1849
  function qe() {
1799
- if (!ee) {
1850
+ if (!k) {
1800
1851
  V();
1801
- for (let e of k.splice(0)) e();
1802
- B(), Be(), ee = !0, v && Y(v), v = null, Re(), typeof window < "u" && (window.removeEventListener("pagehide", Be), window.removeEventListener("blur", V));
1852
+ for (let e of ee.splice(0)) e();
1853
+ z(), Be(), k = !0, v && Te(v), v = null, Re(), typeof window < "u" && (window.removeEventListener("pagehide", Be), window.removeEventListener("blur", V));
1803
1854
  }
1804
1855
  }
1805
1856
  return {
1806
1857
  sessionId: n,
1807
1858
  members: a,
1808
1859
  locks: s,
1809
- locksOf: Ae,
1860
+ locksOf: ke,
1810
1861
  lockLocale: f,
1811
- setLockLocale: je,
1862
+ setLockLocale: Ae,
1812
1863
  connection: p,
1813
1864
  revision: m,
1814
- canUndo: ie,
1815
- canRedo: P,
1865
+ canUndo: F,
1866
+ canRedo: re,
1816
1867
  attach: Ue,
1817
1868
  undo: () => Ve("undo"),
1818
1869
  redo: () => Ve("redo"),
1819
1870
  clearHistory: () => {
1820
- v && (v.undo = [], v.redo = [], L());
1871
+ v && (v.undo = [], v.redo = [], R());
1821
1872
  },
1822
1873
  flush: V,
1823
1874
  settle: We,
1824
1875
  suspend: Ge,
1825
1876
  resume: Ke,
1826
1877
  catchUp: q,
1827
- hasConfirmedBlock: (e) => v ? bt(v.confirmed.blocks, e) : !1,
1878
+ hasConfirmedBlock: (e) => v ? xt(v.confirmed.blocks, e) : !1,
1828
1879
  applyOperations: He,
1829
1880
  destroy: qe
1830
1881
  };
1831
1882
  }
1832
1883
  // ../core/src/saved-blocks.ts
1833
- function wt(e) {
1884
+ function Tt(e) {
1834
1885
  let { provider: t } = e, n = S([]), r = S(!1), i = v(() => {
1835
1886
  let e = /* @__PURE__ */ new Set();
1836
1887
  for (let t of n.value) {
@@ -1849,7 +1900,7 @@ function wt(e) {
1849
1900
  throw new W(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1850
1901
  }
1851
1902
  function d(t) {
1852
- Q(e.onError, t);
1903
+ Fe(e.onError, t);
1853
1904
  }
1854
1905
  async function f(i) {
1855
1906
  r.value = !0;
@@ -1917,9 +1968,9 @@ function wt(e) {
1917
1968
  };
1918
1969
  }
1919
1970
  // ../core/src/saved-blocks-local.ts
1920
- var Tt = "templatical:saved-blocks";
1921
- function Et(e = {}) {
1922
- let t = e.key ?? Tt;
1971
+ var Et = "templatical:saved-blocks";
1972
+ function Dt(e = {}) {
1973
+ let t = e.key ?? Et;
1923
1974
  function n() {
1924
1975
  if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageSavedBlocksProvider requires a browser environment with localStorage. Supply your own SavedBlocksProvider for server-side or non-browser use.");
1925
1976
  return localStorage;
@@ -1944,7 +1995,7 @@ function Et(e = {}) {
1944
1995
  },
1945
1996
  async create(e) {
1946
1997
  let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
1947
- id: k(),
1998
+ id: j(),
1948
1999
  name: e.name,
1949
2000
  content: e.content,
1950
2001
  ...e.category ? { category: e.category } : {},
@@ -1971,9 +2022,9 @@ function Et(e = {}) {
1971
2022
  };
1972
2023
  }
1973
2024
  // ../core/src/media-local.ts
1974
- var Dt = "templatical:media", Ot = 50;
1975
- function kt(e = {}) {
1976
- let t = e.key ?? Dt;
2025
+ var Ot = "templatical:media", kt = 50;
2026
+ function At(e = {}) {
2027
+ let t = e.key ?? Ot;
1977
2028
  function n() {
1978
2029
  if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageMediaProvider requires a browser environment with localStorage. Supply your own MediaProvider for server-side or non-browser use.");
1979
2030
  return localStorage;
@@ -2006,12 +2057,12 @@ function kt(e = {}) {
2006
2057
  let t = r(), n = e?.search?.trim().toLowerCase(), i = n ? t.filter((e) => {
2007
2058
  let t = e.filename?.toLowerCase() ?? "", r = e.alt?.toLowerCase() ?? "";
2008
2059
  return t.includes(n) || r.includes(n);
2009
- }) : t, a = e?.cursor ? Number.parseInt(e.cursor, 10) : 0, o = Number.isFinite(a) && a > 0 ? a : 0, s = i.slice(o, o + Ot), c = { items: s }, l = o + s.length;
2060
+ }) : t, a = e?.cursor ? Number.parseInt(e.cursor, 10) : 0, o = Number.isFinite(a) && a > 0 ? a : 0, s = i.slice(o, o + kt), c = { items: s }, l = o + s.length;
2010
2061
  return l < i.length && (c.nextCursor = String(l)), c;
2011
2062
  },
2012
2063
  async create(e) {
2013
2064
  let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
2014
- id: k(),
2065
+ id: j(),
2015
2066
  url: t,
2016
2067
  filename: e.filename || e.file.name,
2017
2068
  createdAt: n,
@@ -2047,7 +2098,7 @@ function kt(e = {}) {
2047
2098
  };
2048
2099
  }
2049
2100
  // ../core/src/version-history.ts
2050
- function At(e) {
2101
+ function jt(e) {
2051
2102
  let { provider: t, getTemplateId: n } = e, r = S([]), i = S(!1), a = S(void 0), o = S(!1), s = /* @__PURE__ */ new Map(), c = v(() => typeof t.create == "function"), l = v(() => typeof t.restore == "function");
2052
2103
  function u(e) {
2053
2104
  let t = n();
@@ -2058,7 +2109,7 @@ function At(e) {
2058
2109
  throw new W(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2059
2110
  }
2060
2111
  function f(t) {
2061
- Q(e.onError, t);
2112
+ Fe(e.onError, t);
2062
2113
  }
2063
2114
  async function p(n) {
2064
2115
  let o = u("list");
@@ -2126,7 +2177,7 @@ function At(e) {
2126
2177
  };
2127
2178
  }
2128
2179
  // ../core/src/comments.ts
2129
- function jt(e) {
2180
+ function Mt(e) {
2130
2181
  let { provider: t, getTemplateId: n, getUser: r } = e, i = S([]), a = S(!1), o = S(!1), s = v(() => typeof t.create == "function"), c = v(() => typeof t.update == "function"), l = v(() => typeof t.delete == "function"), u = v(() => typeof t.setResolved == "function"), d = v(() => i.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), f = v(() => i.value.filter((e) => !e.resolvedAt).length), p = v(() => {
2131
2182
  let e = /* @__PURE__ */ new Map();
2132
2183
  for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
@@ -2161,7 +2212,7 @@ function jt(e) {
2161
2212
  throw e.onError?.(n), n;
2162
2213
  }
2163
2214
  function x(t) {
2164
- Q(e.onError, t);
2215
+ Fe(e.onError, t);
2165
2216
  }
2166
2217
  function C(e, t, n) {
2167
2218
  return [
@@ -2225,7 +2276,7 @@ function jt(e) {
2225
2276
  o.value = !1;
2226
2277
  }
2227
2278
  }
2228
- async function ee(e, n) {
2279
+ async function k(e, n) {
2229
2280
  let { update: r } = t;
2230
2281
  typeof r != "function" && g("update");
2231
2282
  let i = m("update");
@@ -2239,7 +2290,7 @@ function jt(e) {
2239
2290
  o.value = !1;
2240
2291
  }
2241
2292
  }
2242
- async function k(e) {
2293
+ async function ee(e) {
2243
2294
  let { delete: n } = t;
2244
2295
  typeof n != "function" && g("delete");
2245
2296
  let r = m("delete");
@@ -2254,7 +2305,7 @@ function jt(e) {
2254
2305
  o.value = !1;
2255
2306
  }
2256
2307
  }
2257
- async function te(e, n) {
2308
+ async function A(e, n) {
2258
2309
  let { setResolved: r } = t;
2259
2310
  typeof r != "function" && g("setResolved");
2260
2311
  let i = m("setResolved");
@@ -2268,13 +2319,13 @@ function jt(e) {
2268
2319
  o.value = !1;
2269
2320
  }
2270
2321
  }
2271
- function A(e) {
2322
+ function j(e) {
2272
2323
  T(e) && x(() => t.onCreated?.(e, { origin: "remote" }));
2273
2324
  }
2274
- function j(e) {
2325
+ function te(e) {
2275
2326
  T(e) && x(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
2276
2327
  }
2277
- function ne(e, n) {
2328
+ function M(e, n) {
2278
2329
  let r = E(e, n);
2279
2330
  r && x(() => t.onDeleted?.(r, { origin: "remote" }));
2280
2331
  }
@@ -2291,17 +2342,17 @@ function jt(e) {
2291
2342
  commentCountByBlock: p,
2292
2343
  load: D,
2293
2344
  create: O,
2294
- update: ee,
2295
- remove: k,
2296
- setResolved: te,
2345
+ update: k,
2346
+ remove: ee,
2347
+ setResolved: A,
2297
2348
  find: _,
2298
2349
  isOwn: y,
2299
- applyRemoteCreate: A,
2300
- applyRemoteUpdate: j,
2301
- applyRemoteDelete: ne
2350
+ applyRemoteCreate: j,
2351
+ applyRemoteUpdate: te,
2352
+ applyRemoteDelete: M
2302
2353
  };
2303
2354
  }
2304
- function Mt(e) {
2355
+ function Nt(e) {
2305
2356
  let { comments: t, provider: n, getTemplateId: i } = e, { subscribe: a } = n;
2306
2357
  if (typeof a != "function") return;
2307
2358
  let s = null;
@@ -2323,9 +2374,9 @@ function Mt(e) {
2323
2374
  }, { immediate: !0 }), o(c);
2324
2375
  }
2325
2376
  // src/constants/timeouts.ts
2326
- var Nt = 1e4;
2377
+ var Pt = 1e4;
2327
2378
  // src/composables/useImageUrlResolver.ts
2328
- function Pt(t) {
2379
+ function Ft(t) {
2329
2380
  let n = e(/* @__PURE__ */ new Map()), r = /* @__PURE__ */ new Set();
2330
2381
  function i(e) {
2331
2382
  return n.get(e);
@@ -2354,8 +2405,8 @@ function Pt(t) {
2354
2405
  lookup: o
2355
2406
  };
2356
2407
  }
2357
- function Ft(e) {
2358
- let t = a(_e, null), n = v(e);
2408
+ function It(e) {
2409
+ let t = a(ve, null), n = v(e);
2359
2410
  if (!t) return n;
2360
2411
  let i;
2361
2412
  function s() {
@@ -2376,37 +2427,37 @@ function Ft(e) {
2376
2427
  return typeof r == "string" && r.length > 0 ? r : e;
2377
2428
  });
2378
2429
  }
2379
- function It(e, t) {
2430
+ function Lt(e, t) {
2380
2431
  if (!e || !t) return t;
2381
2432
  let n = e.get(t);
2382
2433
  return typeof n == "string" && n.length > 0 ? n : t;
2383
2434
  }
2384
- function Lt(e, t) {
2385
- return typeof e?.url == "string" && F(e.url, t);
2386
- }
2387
2435
  function Rt(e, t) {
2436
+ return typeof e?.url == "string" && L(e.url, t);
2437
+ }
2438
+ function zt(e, t) {
2388
2439
  let n = e?.url;
2389
- if (typeof n == "string" && n.trim() !== "") return F(n, t) ? void 0 : n;
2440
+ if (typeof n == "string" && n.trim() !== "") return L(n, t) ? void 0 : n;
2390
2441
  }
2391
- function zt(e) {
2392
- let t = a(ge, O.liquid), n = Ft(() => Rt(e(), t));
2393
- return v(() => Lt(e(), t) ? null : n.value);
2442
+ function Bt(e) {
2443
+ let t = a(_e, ee.liquid), n = It(() => zt(e(), t));
2444
+ return v(() => Rt(e(), t) ? null : n.value);
2394
2445
  }
2395
- function Bt(e, t, n) {
2396
- return Lt(t, n) ? null : It(e, Rt(t, n));
2446
+ function Vt(e, t, n) {
2447
+ return Rt(t, n) ? null : Lt(e, zt(t, n));
2397
2448
  }
2398
2449
  // src/utils/blockTypeLabels.ts
2399
- function Vt(e, t) {
2450
+ function Ht(e, t) {
2400
2451
  return t.blocks[e] ?? e;
2401
2452
  }
2402
- function Ht(e, t, n = []) {
2403
- if (e.type !== "custom") return Vt(e.type, t);
2453
+ function Ut(e, t, n = []) {
2454
+ if (e.type !== "custom") return Ht(e.type, t);
2404
2455
  let { customType: r } = e;
2405
2456
  return n.find((e) => e.type === r)?.name ?? r;
2406
2457
  }
2407
2458
  // src/utils/resolveFieldColors.ts
2408
- function Ut(e, t) {
2409
- let n = Se({ presets: e.presets }, q), r = n.presets.length === 0;
2459
+ function Wt(e, t) {
2460
+ let n = q({ presets: e.presets }, Ce), r = n.presets.length === 0;
2410
2461
  return {
2411
2462
  presets: r ? t.presets : n.presets,
2412
2463
  allowCustom: t.allowCustom === !1 ? !1 : e.allowCustom ?? t.allowCustom,
@@ -2417,19 +2468,19 @@ function Ut(e, t) {
2417
2468
  };
2418
2469
  }
2419
2470
  // src/utils/imageNaturalSize.ts
2420
- function Wt(e) {
2471
+ function Gt(e) {
2421
2472
  return typeof e == "number" && Number.isFinite(e) && e > 0;
2422
2473
  }
2423
- function Gt(e, t) {
2424
- return Wt(e) && Wt(t) ? {
2474
+ function Kt(e, t) {
2475
+ return Gt(e) && Gt(t) ? {
2425
2476
  width: e,
2426
2477
  height: t
2427
2478
  } : null;
2428
2479
  }
2429
- function Kt(e) {
2430
- return Gt(e.naturalWidth, e.naturalHeight);
2431
- }
2432
2480
  function qt(e) {
2481
+ return Kt(e.naturalWidth, e.naturalHeight);
2482
+ }
2483
+ function Jt(e) {
2433
2484
  return e ? {
2434
2485
  naturalWidth: e.width,
2435
2486
  naturalHeight: e.height
@@ -2438,35 +2489,35 @@ function qt(e) {
2438
2489
  naturalHeight: void 0
2439
2490
  };
2440
2491
  }
2441
- function Jt(e, t) {
2492
+ function Yt(e, t) {
2442
2493
  if (typeof Image > "u") return t(null), () => {};
2443
2494
  let n = new Image(), r = () => {
2444
2495
  n.onload = null, n.onerror = null;
2445
2496
  };
2446
2497
  return n.onload = () => {
2447
- r(), t(Gt(n.naturalWidth, n.naturalHeight));
2498
+ r(), t(Kt(n.naturalWidth, n.naturalHeight));
2448
2499
  }, n.onerror = () => {
2449
2500
  r(), t(null);
2450
2501
  }, n.src = e, r;
2451
2502
  }
2452
- function Yt(e) {
2503
+ function Xt(e) {
2453
2504
  return new Promise((t) => {
2454
2505
  let n = setTimeout(() => {
2455
2506
  r(), t(null);
2456
- }, Nt), r = Jt(e, (e) => {
2507
+ }, Pt), r = Yt(e, (e) => {
2457
2508
  clearTimeout(n), t(e);
2458
2509
  });
2459
2510
  });
2460
2511
  }
2461
2512
  // src/components/MediaDropOverlay.vue
2462
- var Xt = /* @__PURE__ */ t({
2513
+ var Zt = /* @__PURE__ */ t({
2463
2514
  __name: "MediaDropOverlay",
2464
2515
  props: {
2465
2516
  uploading: { type: Boolean },
2466
2517
  size: { default: "field" }
2467
2518
  },
2468
2519
  setup(e) {
2469
- let t = e, { t: r } = be(), i = {
2520
+ let t = e, { t: r } = xe(), i = {
2470
2521
  field: {
2471
2522
  gap: "tpl:gap-1.5",
2472
2523
  icon: 18,
@@ -2481,39 +2532,39 @@ var Xt = /* @__PURE__ */ t({
2481
2532
  return (t, i) => (n(), l("div", {
2482
2533
  class: p(["tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]", a.value.gap]),
2483
2534
  style: y({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${a.value.veil}, transparent)` })
2484
- }, [e.uploading ? (n(), l(C, { key: 0 }, [w(f(he), {
2535
+ }, [e.uploading ? (n(), l(C, { key: 0 }, [w(f(K), {
2485
2536
  class: "tpl-spinner",
2486
2537
  size: a.value.icon,
2487
2538
  "stroke-width": 2
2488
- }, null, 8, ["size"]), d(" " + g(f(r).image.uploading), 1)], 64)) : (n(), l(C, { key: 1 }, [w(f(K), {
2539
+ }, null, 8, ["size"]), d(" " + g(f(r).image.uploading), 1)], 64)) : (n(), l(C, { key: 1 }, [w(f(ge), {
2489
2540
  size: a.value.icon,
2490
2541
  "stroke-width": 1.5
2491
2542
  }, null, 8, ["size"]), d(" " + g(f(r).image.dropToUpload), 1)], 64))], 6));
2492
2543
  }
2493
2544
  });
2494
2545
  // src/composables/useAliveFlag.ts
2495
- function Zt() {
2546
+ function Qt() {
2496
2547
  let e = { alive: !0 };
2497
2548
  return i(() => {
2498
2549
  e.alive = !1;
2499
2550
  }), e;
2500
2551
  }
2501
2552
  // src/composables/useImageDrop.ts
2502
- var Qt = "image/";
2503
- function $t(e) {
2504
- let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || _(r), { isOverDropZone: a } = xe(t, {
2553
+ var $t = "image/";
2554
+ function en(e) {
2555
+ let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || _(r), { isOverDropZone: a } = Se(t, {
2505
2556
  preventDefaultForUnhandled: !0,
2506
2557
  onDrop: (e) => {
2507
2558
  if (!i()) return;
2508
- let t = (e ?? []).filter((e) => e.type.startsWith(Qt));
2559
+ let t = (e ?? []).filter((e) => e.type.startsWith($t));
2509
2560
  t.length > 0 && n([t[0]]);
2510
2561
  }
2511
2562
  });
2512
2563
  return { isOver: v(() => i() && a.value) };
2513
2564
  }
2514
2565
  // src/composables/useMediaDropField.ts
2515
- function en(e) {
2516
- let { target: t, blocked: n, apply: r } = e, i = a(ve, null), o = a(ye, null), s = Zt();
2566
+ function tn(e) {
2567
+ let { target: t, blocked: n, apply: r } = e, i = a(ye, null), o = a(be, null), s = Qt();
2517
2568
  async function c() {
2518
2569
  let e = await i?.({ accept: ["images"] });
2519
2570
  s.alive && e && r(e);
@@ -2534,7 +2585,7 @@ function en(e) {
2534
2585
  }
2535
2586
  }
2536
2587
  }
2537
- let { isOver: f } = $t({
2588
+ let { isOver: f } = en({
2538
2589
  target: t,
2539
2590
  enabled: u,
2540
2591
  onFiles: d
@@ -2547,10 +2598,10 @@ function en(e) {
2547
2598
  openMediaBrowser: c
2548
2599
  };
2549
2600
  }
2550
- function tn(e, t = "desktop") {
2601
+ function nn(e, t = "desktop") {
2551
2602
  return t === "mobile" ? 375 : e?.width ?? 600;
2552
2603
  }
2553
- var nn = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", rn = {
2604
+ var rn = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", an = {
2554
2605
  1: [100],
2555
2606
  2: [50, 50],
2556
2607
  3: [
@@ -2574,60 +2625,60 @@ var nn = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", rn = {
2574
2625
  25
2575
2626
  ]
2576
2627
  };
2577
- function an(e, t) {
2578
- let n = (e) => Math.trunc(e ?? 0), r = (e) => fe(e) === null ? 0 : Math.trunc(e.width);
2579
- return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
2580
- }
2581
2628
  function on(e, t) {
2582
- return Math.floor(e) - an(t);
2629
+ let n = (e) => Math.trunc(e ?? 0), r = (e) => D(e) === null ? 0 : Math.trunc(e.width);
2630
+ return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
2583
2631
  }
2584
2632
  function sn(e, t) {
2633
+ return Math.floor(e) - on(t);
2634
+ }
2635
+ function cn(e, t) {
2585
2636
  let n = "border" in e ? e.border : void 0;
2586
- return Math.floor(t) - an(e.styles.padding, n);
2637
+ return Math.floor(t) - on(e.styles.padding, n);
2587
2638
  }
2588
- function* cn(e, t) {
2589
- for (let n of e) V(n) ? yield* cn(n.children, on(t, n.styles.padding)) : yield {
2639
+ function* ln(e, t) {
2640
+ for (let n of e) le(n) ? yield* ln(n.children, sn(t, n.styles.padding)) : yield {
2590
2641
  block: n,
2591
- bandWidth: G(n) && n.wrapper ? on(t, n.wrapper.padding) : t
2642
+ bandWidth: pe(n) && n.wrapper ? sn(t, n.wrapper.padding) : t
2592
2643
  };
2593
2644
  }
2594
- function ln(e, t, n = P(e)) {
2645
+ function un(e, t, n = A(e)) {
2595
2646
  if (!t) return e;
2596
2647
  try {
2597
- return le(re(t, n, { missing: "default" }), e);
2648
+ return ue(T(t, n, { missing: "default" }), e);
2598
2649
  } catch {
2599
2650
  return e;
2600
2651
  }
2601
2652
  }
2602
- function un(e, t, n, r) {
2603
- let i = ln(e, n, r);
2604
- for (let { block: e, bandWidth: n } of cn(i.blocks, i.settings.width)) if (G(e)) {
2605
- let r = ue(e)?.applied ? void 0 : e.border, i = Math.floor(n) - an(e.styles.padding, r), a = rn[e.columns] ?? [100];
2653
+ function dn(e, t, n, r) {
2654
+ let i = un(e, n, r);
2655
+ for (let { block: e, bandWidth: n } of ln(i.blocks, i.settings.width)) if (pe(e)) {
2656
+ let r = z(e)?.applied ? void 0 : e.border, i = Math.floor(n) - on(e.styles.padding, r), a = an[e.columns] ?? [100];
2606
2657
  for (let n = 0; n < e.children.length; n++) {
2607
2658
  let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
2608
- if (o) return sn(o, r);
2659
+ if (o) return cn(o, r);
2609
2660
  }
2610
- } else if (e.id === t) return sn(e, n);
2661
+ } else if (e.id === t) return cn(e, n);
2611
2662
  return null;
2612
2663
  }
2613
- function dn(e, t, n, r) {
2614
- let i = ln(e, n, r);
2615
- for (let { block: e, bandWidth: n } of cn(i.blocks, i.settings.width)) if (e.id === t) return Math.floor(n);
2664
+ function fn(e, t, n, r) {
2665
+ let i = un(e, n, r);
2666
+ for (let { block: e, bandWidth: n } of ln(i.blocks, i.settings.width)) if (e.id === t) return Math.floor(n);
2616
2667
  return null;
2617
2668
  }
2618
- function fn(e) {
2619
- let t = G(e) ? ue(e) : null;
2669
+ function pn(e) {
2670
+ let t = pe(e) ? z(e) : null;
2620
2671
  return !!t?.applied && t.height === "image";
2621
2672
  }
2622
- function pn(e, t, n, r) {
2623
- if (fn(e)) return (t ? dn(t, e.id, n, r) : null) ?? tn(t?.settings);
2673
+ function mn(e, t, n, r) {
2674
+ if (pn(e)) return (t ? fn(t, e.id, n, r) : null) ?? nn(t?.settings);
2624
2675
  }
2625
2676
  // src/constants/socialIcons.ts
2626
- var mn = se, hn = {
2677
+ var hn = se, gn = {
2627
2678
  small: 24,
2628
2679
  medium: 32,
2629
2680
  large: 48
2630
- }, gn = [
2681
+ }, _n = [
2631
2682
  "facebook",
2632
2683
  "twitter",
2633
2684
  "instagram",
@@ -2647,6 +2698,6 @@ var mn = se, hn = {
2647
2698
  "dribbble",
2648
2699
  "behance"
2649
2700
  ];
2650
- export { Et as A, ze as B, Bt as C, jt as D, Mt as E, We as F, Ue as I, Ve as L, Ct as M, lt as N, At as O, Ge as P, He as R, Rt as S, Ft as T, Fe as V, Gt as _, fn as a, Vt as b, nn as c, Zt as d, Xt as f, Kt as g, qt as h, un as i, wt as j, kt as k, tn as l, Yt as m, mn as n, pn as o, Jt as p, gn as r, dn as s, hn as t, en as u, Ut as v, zt as w, Pt as x, Ht as y, Be as z };
2701
+ export { Dt as A, Be as B, Vt as C, Mt as D, Nt as E, Ge as F, We as I, He as L, wt as M, ut as N, jt as O, Ke as P, Ue as R, zt as S, It as T, Ie as V, Kt as _, pn as a, Ht as b, rn as c, Qt as d, Zt as f, qt as g, Jt as h, dn as i, Tt as j, At as k, nn as l, Xt as m, hn as n, mn as o, Yt as p, _n as r, fn as s, gn as t, tn as u, Wt as v, Bt as w, Ft as x, Ut as y, Ve as z };
2651
2702
 
2652
- //# sourceMappingURL=socialIcons-Qw9rHc8C.js.map
2703
+ //# sourceMappingURL=socialIcons-C_yggK1_.js.map