@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
@@ -45,25 +45,25 @@ var s = {
45
45
  2: 28,
46
46
  3: 22,
47
47
  4: 18
48
- }, c = 1.3, l = {
48
+ }, c = 1.3, l = 1.2, u = {
49
49
  paragraphGap: 8,
50
50
  listMarginY: 8,
51
51
  listPaddingLeft: 24,
52
52
  listItemMarginY: 4
53
- }, u = [
53
+ }, d = [
54
54
  "cover",
55
55
  "contain",
56
56
  "auto"
57
- ], d = [
57
+ ], f = [
58
58
  "left",
59
59
  "center",
60
60
  "right"
61
- ], f = [
61
+ ], p = [
62
62
  "top",
63
63
  "center",
64
64
  "bottom"
65
65
  ];
66
- function p(e) {
66
+ function ee(e) {
67
67
  return {
68
68
  url: e,
69
69
  size: "cover",
@@ -74,7 +74,7 @@ function p(e) {
74
74
  repeat: !1
75
75
  };
76
76
  }
77
- function m(e) {
77
+ function te(e) {
78
78
  let t = "";
79
79
  for (let n of e) {
80
80
  let e = n.charCodeAt(0);
@@ -82,36 +82,36 @@ function m(e) {
82
82
  }
83
83
  return t;
84
84
  }
85
- function ee(e) {
85
+ function ne(e) {
86
86
  let t = typeof e?.url == "string" ? e.url.trim() : "";
87
87
  if (!e || !t) return null;
88
- let n = u.includes(e.size) ? e.size : "cover", r = e.position, i = r && d.includes(r.x) ? r.x : "center", a = r && f.includes(r.y) ? r.y : "center";
88
+ let n = d.includes(e.size) ? e.size : "cover", r = e.position, i = r && f.includes(r.x) ? r.x : "center", a = r && p.includes(r.y) ? r.y : "center";
89
89
  return {
90
- url: m(t),
90
+ url: te(t),
91
91
  size: n,
92
92
  position: `${i} ${a}`,
93
93
  repeat: e.repeat ? "repeat" : "no-repeat"
94
94
  };
95
95
  }
96
96
  // ../types/src/hero.ts
97
- var te = [
97
+ var re = [
98
98
  "top",
99
99
  "middle",
100
100
  "bottom"
101
101
  ];
102
- function ne(e) {
102
+ function ie(e) {
103
103
  let t = e.hero;
104
104
  if (!t || typeof t != "object") return null;
105
105
  if (e.columns !== "1") return {
106
106
  applied: !1,
107
107
  reason: "columns"
108
108
  };
109
- let n = ee(e.backgroundImage);
109
+ let n = ne(e.backgroundImage);
110
110
  if (n === null) return {
111
111
  applied: !1,
112
112
  reason: "image"
113
113
  };
114
- let r = ie(e.backgroundImage), i = re(t.height) ? Math.round(t.height) : "image";
114
+ let r = oe(e.backgroundImage), i = ae(t.height) ? Math.round(t.height) : "image";
115
115
  return i === "image" && r === null ? {
116
116
  applied: !1,
117
117
  reason: "size"
@@ -119,19 +119,19 @@ function ne(e) {
119
119
  applied: !0,
120
120
  image: n,
121
121
  height: i,
122
- verticalAlign: te.includes(t.verticalAlign) ? t.verticalAlign : "middle",
122
+ verticalAlign: re.includes(t.verticalAlign) ? t.verticalAlign : "middle",
123
123
  aspectRatio: r
124
124
  };
125
125
  }
126
- function re(e) {
126
+ function ae(e) {
127
127
  return typeof e == "number" && Number.isFinite(e) && e >= 1;
128
128
  }
129
- function ie(e) {
129
+ function oe(e) {
130
130
  let t = e?.naturalWidth, n = e?.naturalHeight;
131
131
  return typeof t != "number" || typeof n != "number" || !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 || n <= 0 ? null : n / t;
132
132
  }
133
133
  // ../types/src/social.ts
134
- var ae = {
134
+ var se = {
135
135
  facebook: {
136
136
  color: "#1877F2",
137
137
  path: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"
@@ -204,36 +204,36 @@ var ae = {
204
204
  color: "#1769FF",
205
205
  path: "M22 7h-7V5h7v2zm1.726 10c-.442 1.297-2.029 3-5.101 3-3.074 0-5.564-1.729-5.564-5.675 0-3.91 2.325-5.92 5.466-5.92 3.082 0 4.964 1.782 5.375 4.426.078.506.109 1.188.095 2.14H15.97c.13 3.211 3.483 3.312 4.588 2.029h3.168zm-7.686-4h4.965c-.105-1.547-1.136-2.219-2.477-2.219-1.466 0-2.277.768-2.488 2.219zm-9.574 6.988H0V5.021h6.953c5.476.081 5.58 5.444 2.72 6.906 3.461 1.26 3.577 8.061-3.207 8.061zM3 11h3.584c2.508 0 2.906-3-.312-3H3v3zm3.391 3H3v3.016h3.341c3.055 0 2.868-3.016.05-3.016z"
206
206
  }
207
- }, oe = {
207
+ }, ce = {
208
208
  dark: "#1f1f1f",
209
209
  light: "#ffffff"
210
210
  };
211
- function se(e) {
211
+ function le(e) {
212
212
  return e === "dark" || e === "light" ? e : void 0;
213
213
  }
214
- function ce(e, t) {
215
- let n = se(t);
214
+ function ue(e, t) {
215
+ let n = le(t);
216
216
  return {
217
- fill: n ? oe[n] : ae[e].color,
218
- onFill: n === "light" ? oe.dark : "#ffffff"
217
+ fill: n ? ce[n] : se[e].color,
218
+ onFill: n === "light" ? ce.dark : "#ffffff"
219
219
  };
220
220
  }
221
- function le(e, t) {
222
- let n = se(t);
221
+ function de(e, t) {
222
+ let n = le(t);
223
223
  return n ? `${e}-${n}` : e;
224
224
  }
225
- function ue(e, t) {
226
- if (se(t) === "dark" && (e === "plain" || e === "outlined")) return {
227
- color: oe.light,
225
+ function fe(e, t) {
226
+ if (le(t) === "dark" && (e === "plain" || e === "outlined")) return {
227
+ color: ce.light,
228
228
  opacity: .6,
229
229
  width: 1.4
230
230
  };
231
231
  }
232
- function de(e) {
232
+ function pe(e) {
233
233
  return e === "plain" ? .84 : .6;
234
234
  }
235
235
  // ../types/src/element-ids.ts
236
- function fe(e) {
236
+ function me(e) {
237
237
  let t = [], n = (e, n) => {
238
238
  typeof e == "string" && /[./]/.test(e) && t.push({
239
239
  path: n,
@@ -252,7 +252,7 @@ function fe(e) {
252
252
  return r(e.blocks, "blocks"), t;
253
253
  }
254
254
  // ../types/src/clone.ts
255
- function h(e) {
255
+ function m(e) {
256
256
  let t = [];
257
257
  return JSON.parse(JSON.stringify(e, function(e, n) {
258
258
  if (typeof n != "object" || !n) return n;
@@ -261,22 +261,22 @@ function h(e) {
261
261
  }));
262
262
  }
263
263
  // ../types/src/deep-equal.ts
264
- function pe(e) {
264
+ function he(e) {
265
265
  return typeof e == "object" && !!e && !Array.isArray(e);
266
266
  }
267
- function g(e, t) {
267
+ function h(e, t) {
268
268
  if (e === t) return !0;
269
- if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => g(e, t[n]));
270
- if (pe(e)) {
271
- if (!pe(t)) return !1;
269
+ if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => h(e, t[n]));
270
+ if (he(e)) {
271
+ if (!he(t)) return !1;
272
272
  let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
273
- for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !g(e[r], t[r])) return !1;
273
+ for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !h(e[r], t[r])) return !1;
274
274
  return !0;
275
275
  }
276
276
  return !1;
277
277
  }
278
278
  // ../types/src/config.ts
279
- var me = class extends Error {
279
+ var ge = class extends Error {
280
280
  statusCode;
281
281
  code;
282
282
  constructor(e, t, n, r) {
@@ -291,7 +291,7 @@ var me = class extends Error {
291
291
  get isServerError() {
292
292
  return this.statusCode !== void 0 && this.statusCode >= 500;
293
293
  }
294
- }, he = {
294
+ }, _e = {
295
295
  title: ["content"],
296
296
  paragraph: ["content"],
297
297
  html: ["content"],
@@ -308,58 +308,58 @@ var me = class extends Error {
308
308
  "expiredMessage"
309
309
  ],
310
310
  custom: ["fieldValues.*"]
311
- }, _ = ["preheaderText"];
312
- function ge(e) {
311
+ }, g = ["preheaderText"];
312
+ function ve(e) {
313
313
  return typeof e == "string" && /^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/.test(e);
314
314
  }
315
- function v(e) {
315
+ function _(e) {
316
316
  return typeof e == "object" && !!e && !Array.isArray(e);
317
317
  }
318
- var _e = /* @__PURE__ */ new Set([
318
+ var ye = /* @__PURE__ */ new Set([
319
319
  "__proto__",
320
320
  "constructor",
321
321
  "prototype"
322
322
  ]);
323
- function y(e) {
324
- return e.split(".").every((e) => e !== "" && !_e.has(e));
323
+ function v(e) {
324
+ return e.split(".").every((e) => e !== "" && !ye.has(e));
325
325
  }
326
- function ve(e, t) {
327
- if (!_e.has(t)) return Array.isArray(e) ? e.find((e) => v(e) && e.id === t) : v(e) && Object.hasOwn(e, t) ? e[t] : void 0;
326
+ function be(e, t) {
327
+ if (!ye.has(t)) return Array.isArray(e) ? e.find((e) => _(e) && e.id === t) : _(e) && Object.hasOwn(e, t) ? e[t] : void 0;
328
328
  }
329
- function b(e, t) {
330
- return t.split(".").reduce(ve, e);
329
+ function y(e, t) {
330
+ return t.split(".").reduce(be, e);
331
331
  }
332
- function ye(e) {
333
- let t = h(e);
332
+ function xe(e) {
333
+ let t = m(e);
334
334
  for (let [n, r] of Object.entries(t.l10n ?? {})) {
335
335
  for (let t of ["text", "set"]) {
336
336
  for (let n of Object.keys(r[t] ?? {})) {
337
- let i = n.includes(".") ? b(e, n.slice(0, n.lastIndexOf("."))) : e;
338
- y(n) && (t !== "text" && v(i) || b(e, n) !== void 0) || delete r[t][n];
337
+ let i = n.includes(".") ? y(e, n.slice(0, n.lastIndexOf("."))) : e;
338
+ v(n) && (t !== "text" && _(i) || y(e, n) !== void 0) || delete r[t][n];
339
339
  }
340
340
  r[t] && !Object.keys(r[t]).length && delete r[t];
341
341
  }
342
342
  Object.keys(r).length || delete t.l10n[n];
343
343
  }
344
- return t.l10n && !Object.keys(t.l10n).length && delete t.l10n, g(t, e) ? e : t;
344
+ return t.l10n && !Object.keys(t.l10n).length && delete t.l10n, h(t, e) ? e : t;
345
345
  }
346
- function be(e) {
347
- let t = ye(e);
346
+ function Se(e) {
347
+ let t = xe(e);
348
348
  if (t.type === "wrapper") {
349
- let e = t.children.map(be);
349
+ let e = t.children.map(Se);
350
350
  return e.some((e, n) => e !== t.children[n]) ? {
351
351
  ...t,
352
352
  children: e
353
353
  } : t;
354
354
  }
355
355
  if (t.type !== "section") return t;
356
- let n = t.children.map((e) => e.map(be));
356
+ let n = t.children.map((e) => e.map(Se));
357
357
  return n.some((e, n) => e.some((e, r) => e !== t.children[n][r])) ? {
358
358
  ...t,
359
359
  children: n
360
360
  } : t;
361
361
  }
362
- function xe(e, t, n) {
362
+ function Ce(e, t, n) {
363
363
  if (e.type === "custom") return !1;
364
364
  if (e.type === "section") return t === "columns";
365
365
  let r = e.type === "menu" ? "items" : e.type === "social" ? "icons" : e.type === "table" ? "rows" : null;
@@ -372,44 +372,44 @@ function xe(e, t, n) {
372
372
  let o = a.split(".").length;
373
373
  if (i[o] === "id") return !0;
374
374
  if (i.length !== o) return !1;
375
- let s = b(e, a);
376
- if (!v(s) || !v(n) || s.id !== n.id) return !0;
375
+ let s = y(e, a);
376
+ if (!_(s) || !_(n) || s.id !== n.id) return !0;
377
377
  if (e.type === "table" && o === 2) {
378
- let e = (e) => Array.isArray(e) ? e.map((e) => v(e) ? e.id : void 0) : null;
379
- return !g(e(s.cells), e(n.cells));
378
+ let e = (e) => Array.isArray(e) ? e.map((e) => _(e) ? e.id : void 0) : null;
379
+ return !h(e(s.cells), e(n.cells));
380
380
  }
381
381
  return !1;
382
382
  }
383
- function Se(e) {
384
- return ye(e);
383
+ function we(e) {
384
+ return xe(e);
385
385
  }
386
- function x(e, t, n) {
387
- if (!y(t)) return !1;
388
- let r = t.split("."), i = r.pop(), a = r.reduce(ve, e);
386
+ function b(e, t, n) {
387
+ if (!v(t)) return !1;
388
+ let r = t.split("."), i = r.pop(), a = r.reduce(be, e);
389
389
  if (Array.isArray(a)) {
390
- let e = a.findIndex((e) => v(e) && e.id === i);
391
- return e < 0 ? !1 : (a[e] = h(n), !0);
390
+ let e = a.findIndex((e) => _(e) && e.id === i);
391
+ return e < 0 ? !1 : (a[e] = m(n), !0);
392
392
  }
393
- return v(a) ? (n === null ? delete a[i] : a[i] = h(n), !0) : !1;
393
+ return _(a) ? (n === null ? delete a[i] : a[i] = m(n), !0) : !1;
394
394
  }
395
- function Ce(e, t) {
395
+ function Te(e, t) {
396
396
  let [n, ...r] = t.split(".");
397
397
  if (n === void 0) return [""];
398
398
  let i = [];
399
399
  if (n === "*") {
400
400
  let t = Array.isArray(e) ? e : [];
401
- for (let e of t) if (v(e) && typeof e.id == "string") for (let t of r.length ? Ce(e, r.join(".")) : [""]) i.push(t ? `${e.id}.${t}` : e.id);
401
+ for (let e of t) if (_(e) && typeof e.id == "string") for (let t of r.length ? Te(e, r.join(".")) : [""]) i.push(t ? `${e.id}.${t}` : e.id);
402
402
  return i;
403
403
  }
404
- let a = v(e) ? e[n] : void 0;
404
+ let a = _(e) ? e[n] : void 0;
405
405
  if (r.length === 0) return a === void 0 ? [] : [n];
406
- for (let e of Ce(a, r.join("."))) i.push(`${n}.${e}`);
406
+ for (let e of Te(a, r.join("."))) i.push(`${n}.${e}`);
407
407
  return i;
408
408
  }
409
- function S(e, t = []) {
409
+ function x(e, t = []) {
410
410
  if (e.type === "custom") {
411
411
  let n = t.find((t) => t.type === e.customType), r = new Set((n?.fields ?? []).filter((e) => e.type === "text" || e.type === "textarea").map((e) => e.key)), i = e.fieldValues;
412
- return v(i) ? Object.keys(i).filter((e) => r.has(e)).map((e) => `fieldValues.${e}`) : [];
412
+ return _(i) ? Object.keys(i).filter((e) => r.has(e)).map((e) => `fieldValues.${e}`) : [];
413
413
  }
414
414
  let n = (e) => !e.id.includes("."), r = e.type === "menu" ? {
415
415
  ...e,
@@ -421,118 +421,127 @@ function S(e, t = []) {
421
421
  cells: e.cells.filter(n)
422
422
  }))
423
423
  } : e;
424
- return (he[e.type] ?? []).flatMap((e) => Ce(r, e));
424
+ return (_e[e.type] ?? []).flatMap((e) => Te(r, e));
425
425
  }
426
- function we(e, t) {
427
- return (he[e] ?? []).some((e) => {
426
+ function Ee(e, t) {
427
+ return (_e[e] ?? []).some((e) => {
428
428
  let n = e.split("."), r = t.split(".");
429
429
  return n.length === r.length && n.every((e, t) => e === "*" || e === r[t]);
430
430
  });
431
431
  }
432
- function C(e) {
432
+ function S(e) {
433
433
  let t = 2166136261;
434
434
  for (let n of new TextEncoder().encode(e)) t ^= n, t = Math.imul(t, 16777619) >>> 0;
435
435
  return t.toString(16).padStart(8, "0");
436
436
  }
437
- function Te(e) {
437
+ function De(e) {
438
438
  let { l10n: t, ...n } = e;
439
439
  return n;
440
440
  }
441
- function w(e = {}) {
441
+ function C(e = {}) {
442
442
  return Object.entries(e).sort(([e], [t]) => e.split(".").length - t.split(".").length);
443
443
  }
444
- function Ee(e, t, n) {
445
- let r = e, i = h(Te(r));
446
- if (t === n) return i;
447
- let a = r.l10n?.[t];
448
- if (!a) return i;
449
- for (let [e, t] of w(a.set)) x(i, e, t);
450
- for (let [t, n] of Object.entries(a.text ?? {})) b(e, t) !== void 0 && x(i, t, n.value);
451
- return e.type === "custom" && (Object.keys(a.text ?? {}).length > 0 || Object.keys(a.set ?? {}).length > 0) && delete i.renderedHtml, i;
444
+ function Oe(e, t, n) {
445
+ return ke(e, m(De(e)), t, n);
446
+ }
447
+ function ke(e, t, n, r) {
448
+ let i = e;
449
+ if (n === r) return t;
450
+ let a = i.l10n?.[n];
451
+ if (!a) return t;
452
+ for (let [e, n] of C(a.set)) b(t, e, n);
453
+ for (let [n, r] of Object.entries(a.text ?? {})) y(e, n) !== void 0 && b(t, n, r.value);
454
+ return e.type === "custom" && (Object.keys(a.text ?? {}).length > 0 || Object.keys(a.set ?? {}).length > 0) && delete t.renderedHtml, t;
455
+ }
456
+ function Ae(e, t, n) {
457
+ let r = e;
458
+ if (r.type !== "section" && r.type !== "wrapper" || !Array.isArray(r.children)) return Oe(e, t, n);
459
+ let { children: i, ...a } = De(r), o = m(a);
460
+ return o.children = i, ke(e, o, t, n);
452
461
  }
453
- function De(e, t) {
462
+ function je(e, t) {
454
463
  return e.l10n?.[t]?.hidden === !0;
455
464
  }
456
- function Oe(e) {
465
+ function Me(e) {
457
466
  let { locales: t, l10n: n, ...r } = e;
458
467
  return r;
459
468
  }
460
- function T(e) {
469
+ function w(e) {
461
470
  return e.settings?.locale ?? "en";
462
471
  }
463
- function ke(e, t, n) {
464
- let r = T(e);
472
+ function Ne(e, t, n) {
473
+ let r = w(e);
465
474
  if (t !== r && !(e.settings?.locales ?? []).includes(t)) {
466
475
  if (n?.missing === "default") t = r;
467
- else throw new me(`This template has no "${t}" version.`, void 0, "unknown_locale");
476
+ else throw new ge(`This template has no "${t}" version.`, void 0, "unknown_locale");
468
477
  }
469
478
  let i = (e) => e.flatMap((e) => {
470
- if (t !== r && De(e, t)) return [];
471
- let n = Ee(e, t, r);
472
- return n.type === "section" && Array.isArray(n.children) ? n.children = n.children.map((e) => i(e)) : n.type === "wrapper" && Array.isArray(n.children) && (n.children = i(n.children)), [n];
473
- }), a = h(Oe(e.settings)), o = e.settings?.l10n?.[t];
479
+ if (t !== r && je(e, t)) return [];
480
+ let n = e.l10n?.[t], a = [...Object.keys(n?.set ?? {}), ...Object.keys(n?.text ?? {})].some((e) => e.startsWith("children.")) ? Oe(e, t, r) : Ae(e, t, r);
481
+ return a.type === "section" && Array.isArray(a.children) ? a.children = a.children.map((e) => i(e)) : a.type === "wrapper" && Array.isArray(a.children) && (a.children = i(a.children)), [a];
482
+ }), a = m(Me(e.settings)), o = e.settings?.l10n?.[t];
474
483
  if (t !== r && o) {
475
- for (let [e, t] of w(o.set)) x(a, e, t);
476
- for (let [t, n] of Object.entries(o.text ?? {})) b(e.settings, t) !== void 0 && x(a, t, n.value);
484
+ for (let [e, t] of C(o.set)) b(a, e, t);
485
+ for (let [t, n] of Object.entries(o.text ?? {})) y(e.settings, t) !== void 0 && b(a, t, n.value);
477
486
  }
478
487
  return a.locale = t, {
479
488
  blocks: i(e.blocks),
480
489
  settings: a
481
490
  };
482
491
  }
483
- function Ae(e, t, n = []) {
492
+ function Pe(e, t, n = []) {
484
493
  let r = {
485
494
  translated: [],
486
495
  missing: [],
487
496
  stale: []
488
497
  }, i = (e, t, n, i) => {
489
498
  for (let a of n) {
490
- let n = b(t, a);
499
+ let n = y(t, a);
491
500
  if (typeof n != "string") continue;
492
501
  let o = i?.[a];
493
- (o || n !== "") && (o ? o.sourceHash === C(n) ? r.translated.push(`${e}/${a}`) : r.stale.push(`${e}/${a}`) : r.missing.push(`${e}/${a}`));
502
+ (o || n !== "") && (o ? o.sourceHash === S(n) ? r.translated.push(`${e}/${a}`) : r.stale.push(`${e}/${a}`) : r.missing.push(`${e}/${a}`));
494
503
  }
495
504
  }, a = (e) => {
496
505
  for (let r of e) {
497
- if (De(r, t)) continue;
506
+ if (je(r, t)) continue;
498
507
  let e = r.l10n?.[t];
499
- i(r.id, r, S(r, n), e?.text);
508
+ i(r.id, r, x(r, n), e?.text);
500
509
  let o = r.children;
501
510
  if (r.type === "section" && Array.isArray(o)) for (let e of o) a(e);
502
511
  else r.type === "wrapper" && Array.isArray(o) && a(o);
503
512
  }
504
513
  };
505
- return a(e.blocks), i("settings", e.settings, [..._], e.settings?.l10n?.[t]?.text), r;
514
+ return a(e.blocks), i("settings", e.settings, [...g], e.settings?.l10n?.[t]?.text), r;
506
515
  }
507
- function je(e, t) {
508
- if (t === T(e) || !e.settings.locales?.includes(t)) return [];
516
+ function Fe(e, t) {
517
+ if (t === w(e) || !e.settings.locales?.includes(t)) return [];
509
518
  let n = [], r = (e) => {
510
- for (let i of e) De(i, t) && n.push(i.id), i.type === "section" ? i.children.forEach(r) : i.type === "wrapper" && r(i.children);
519
+ for (let i of e) je(i, t) && n.push(i.id), i.type === "section" ? i.children.forEach(r) : i.type === "wrapper" && r(i.children);
511
520
  };
512
521
  return r(e.blocks), n;
513
522
  }
514
- function Me(e, t, n = []) {
515
- if (t === T(e) || !e.settings.locales?.includes(t)) return [];
523
+ function Ie(e, t, n = []) {
524
+ if (t === w(e) || !e.settings.locales?.includes(t)) return [];
516
525
  let r = [], i = (e, n, i) => {
517
- r.push(...Ne(n, t, i).map((t) => `${e}/${t}`));
526
+ r.push(...Le(n, t, i).map((t) => `${e}/${t}`));
518
527
  }, a = (e) => {
519
- for (let t of e) i(t.id, t, S(t, n)), t.type === "section" ? t.children.forEach(a) : t.type === "wrapper" && a(t.children);
528
+ for (let t of e) i(t.id, t, x(t, n)), t.type === "section" ? t.children.forEach(a) : t.type === "wrapper" && a(t.children);
520
529
  };
521
- return a(e.blocks), i("settings", e.settings, _), r;
530
+ return a(e.blocks), i("settings", e.settings, g), r;
522
531
  }
523
- function Ne(e, t, n) {
532
+ function Le(e, t, n) {
524
533
  let r = e.l10n?.[t];
525
534
  return n.filter((t) => {
526
- let n = b(e, t);
527
- return typeof n != "string" || n === "" || r?.text?.[t] ? !1 : !Object.keys(r?.set ?? {}).some((n) => (t === n || t.startsWith(`${n}.`)) && (!n.includes(".") || b(e, n.slice(0, n.lastIndexOf("."))) !== void 0));
535
+ let n = y(e, t);
536
+ return typeof n != "string" || n === "" || r?.text?.[t] ? !1 : !Object.keys(r?.set ?? {}).some((n) => (t === n || t.startsWith(`${n}.`)) && (!n.includes(".") || y(e, n.slice(0, n.lastIndexOf("."))) !== void 0));
528
537
  });
529
538
  }
530
- function Pe(e, t, n = {}) {
531
- let r = T(e), i = (e, n, i) => {
532
- let a = Ne(e, t, i), o = h(e.l10n ?? {}), s = o[t] ?? {}, c = h(e);
539
+ function Re(e, t, n = {}) {
540
+ let r = w(e), i = (e, n, i) => {
541
+ let a = Le(e, t, i), o = m(e.l10n ?? {}), s = o[t] ?? {}, c = m(e);
533
542
  delete c.l10n;
534
- for (let [e, t] of w(s.set)) x(c, e, t);
535
- for (let [t, n] of Object.entries(s.text ?? {})) b(e, t) !== void 0 && x(c, t, n.value);
543
+ for (let [e, t] of C(s.set)) b(c, e, t);
544
+ for (let [t, n] of Object.entries(s.text ?? {})) y(e, t) !== void 0 && b(c, t, n.value);
536
545
  delete o[t];
537
546
  let l = {}, u = /* @__PURE__ */ new Set([
538
547
  ...Object.keys(s.set ?? {}),
@@ -540,22 +549,22 @@ function Pe(e, t, n = {}) {
540
549
  ...a
541
550
  ]);
542
551
  for (let t of u) {
543
- let r = b(e, t), i = b(c, t);
544
- g(r, i) ? (s.text?.[t] || a.includes(t)) && n(t) && typeof r == "string" && r !== "" && ((l.text ??= {})[t] = {
552
+ let r = y(e, t), i = y(c, t);
553
+ h(r, i) ? (s.text?.[t] || a.includes(t)) && n(t) && typeof r == "string" && r !== "" && ((l.text ??= {})[t] = {
545
554
  value: r,
546
- sourceHash: C(r)
555
+ sourceHash: S(r)
547
556
  }) : n(t) && typeof r == "string" && typeof i == "string" ? (l.text ??= {})[t] = {
548
557
  value: r,
549
- sourceHash: C(i)
550
- } : (l.set ??= {})[t] = r === void 0 ? null : h(r);
558
+ sourceHash: S(i)
559
+ } : (l.set ??= {})[t] = r === void 0 ? null : m(r);
551
560
  }
552
561
  let d = (e, t) => {
553
562
  let n = /* @__PURE__ */ new Set();
554
563
  for (let t of Object.keys(e.set ?? {})) {
555
564
  let e = t.split(".");
556
565
  for (; e.length > 1;) {
557
- let t = b(c, e.slice(0, -1).join("."));
558
- if (v(t) || Array.isArray(t) && b(c, e.join(".")) !== void 0) break;
566
+ let t = y(c, e.slice(0, -1).join("."));
567
+ if (_(t) || Array.isArray(t) && y(c, e.join(".")) !== void 0) break;
559
568
  e.pop();
560
569
  }
561
570
  let r = e.join(".");
@@ -563,41 +572,42 @@ function Pe(e, t, n = {}) {
563
572
  }
564
573
  for (let r of n) {
565
574
  for (let t of ["text", "set"]) for (let n of Object.keys(e[t] ?? {})) (n === r || n.startsWith(`${r}.`)) && delete e[t][n];
566
- let n = b(t, r);
567
- (e.set ??= {})[r] = n === void 0 ? null : h(n);
575
+ let n = y(t, r);
576
+ (e.set ??= {})[r] = n === void 0 ? null : m(n);
568
577
  }
569
578
  e.text && !Object.keys(e.text).length && delete e.text;
570
579
  };
571
580
  for (let t of Object.values(o)) {
572
- let n = h(e);
573
- for (let [e, r] of w(t.set)) x(n, e, r);
574
- for (let [r, i] of Object.entries(t.text ?? {})) b(e, r) !== void 0 && x(n, r, i.value);
581
+ let n = m(e);
582
+ for (let [e, r] of C(t.set)) b(n, e, r);
583
+ for (let [r, i] of Object.entries(t.text ?? {})) y(e, r) !== void 0 && b(n, r, i.value);
575
584
  for (let [n, r] of Object.entries(t.text ?? {})) {
576
- let i = b(c, n);
585
+ let i = y(c, n);
577
586
  if (typeof i != "string") (t.set ??= {})[n] = r.value, delete t.text[n];
578
587
  else {
579
- let t = b(e, n);
580
- typeof t == "string" && r.sourceHash === C(t) && (r.sourceHash = C(i));
588
+ let t = y(e, n);
589
+ typeof t == "string" && r.sourceHash === S(t) && (r.sourceHash = S(i));
581
590
  }
582
591
  }
583
592
  d(t, n);
584
593
  }
585
594
  return Object.keys(l).length && (d(l, e), o[r] = l), Object.keys(o).length && (c.l10n = o), c;
586
595
  }, a = (e) => e.map((e) => {
587
- let t = e.type === "custom" ? [.../* @__PURE__ */ new Set([...Object.hasOwn(n, e.id) ? n[e.id] : [], ...Object.values(e.l10n ?? {}).flatMap((e) => Object.keys(e.text ?? {}))])] : S(e), r = i(e, (n) => e.type === "custom" ? t.includes(n) : we(e.type, n), t);
588
- return e.type === "custom" && r.type === "custom" && !g(e.fieldValues, r.fieldValues) && delete r.renderedHtml, r.type === "section" ? r.children = r.children.map(a) : r.type === "wrapper" && (r.children = a(r.children)), r;
589
- }), o = i(e.settings, (e) => _.includes(e), _);
596
+ let t = e.type === "custom" ? [.../* @__PURE__ */ new Set([...Object.hasOwn(n, e.id) ? n[e.id] : [], ...Object.values(e.l10n ?? {}).flatMap((e) => Object.keys(e.text ?? {}))])] : x(e), r = i(e, (n) => e.type === "custom" ? t.includes(n) : Ee(e.type, n), t);
597
+ return e.type === "custom" && r.type === "custom" && !h(e.fieldValues, r.fieldValues) && delete r.renderedHtml, r.type === "section" ? r.children = r.children.map(a) : r.type === "wrapper" && (r.children = a(r.children)), r;
598
+ }), o = i(e.settings, (e) => g.includes(e), g);
590
599
  return o.locale = t, o.locales = e.settings.locales.map((e) => e === t ? r : e), {
591
600
  blocks: a(e.blocks),
592
601
  settings: o
593
602
  };
594
603
  }
595
604
  // ../types/src/operations.ts
596
- function Fe(e, t, n = []) {
597
- let r = Object.fromEntries(P(e.blocks).flatMap((e) => {
605
+ var ze = "Sections with a wrapper cannot be placed inside wrappers.";
606
+ function Be(e, t, n = []) {
607
+ let r = Object.fromEntries(F(e.blocks).flatMap((e) => {
598
608
  if (e.type !== "custom") return [];
599
- let t = S(e, n).filter((t) => typeof b(e, t) == "string");
600
- return t.length && Ve.has(e.id) && O("invalid_operation", 0, He), t.length ? [[e.id, t]] : [];
609
+ let t = x(e, n).filter((t) => typeof y(e, t) == "string");
610
+ return t.length && Ke.has(e.id) && D("invalid_operation", 0, qe), t.length ? [[e.id, t]] : [];
601
611
  }));
602
612
  return {
603
613
  op: "setDefaultLocale",
@@ -605,7 +615,7 @@ function Fe(e, t, n = []) {
605
615
  ...Object.keys(r).length ? { customTextFields: r } : {}
606
616
  };
607
617
  }
608
- var E = class extends Error {
618
+ var T = class extends Error {
609
619
  code;
610
620
  opIndex;
611
621
  blockId;
@@ -613,173 +623,174 @@ var E = class extends Error {
613
623
  super(n), this.name = "OperationError", this.code = e, this.opIndex = t, r !== void 0 && (this.blockId = r);
614
624
  }
615
625
  };
616
- function Ie(e) {
626
+ function Ve(e) {
617
627
  return e === "1" ? 1 : e === "3" || e === "1-2-1" ? 3 : e === "4" ? 4 : 2;
618
628
  }
619
- function Le(e, t, n = {}) {
620
- let r = h(e);
621
- return D(r, t, n), r;
629
+ function He(e, t, n = {}) {
630
+ let r = m(e);
631
+ return E(r, t, n), r;
622
632
  }
623
- function D(e, t, n = {}) {
633
+ function E(e, t, n = {}) {
624
634
  let r = {
625
635
  locks: n.locks ?? [],
626
636
  session: n.session ?? null
627
637
  };
628
- t.forEach((t, n) => st(e, t, n, r));
638
+ t.forEach((t, n) => dt(e, t, n, r));
629
639
  }
630
- var Re = /* @__PURE__ */ new Set([
640
+ var Ue = /* @__PURE__ */ new Set([
631
641
  "id",
632
642
  "type",
633
643
  "children",
634
644
  "l10n"
635
- ]), ze = /* @__PURE__ */ new Set(["locales", "l10n"]), Be = /* @__PURE__ */ new Set([
645
+ ]), We = /* @__PURE__ */ new Set(["locales", "l10n"]), Ge = /* @__PURE__ */ new Set([
636
646
  "locale",
637
647
  "locales",
638
648
  "l10n"
639
- ]), Ve = /* @__PURE__ */ new Set([
649
+ ]), Ke = /* @__PURE__ */ new Set([
640
650
  "__proto__",
641
651
  "constructor",
642
652
  "prototype"
643
- ]), He = "customTextFields must map existing custom block ids to lists of string fieldValues paths.";
644
- function O(e, t, n, r) {
645
- throw new E(e, t, n, r);
653
+ ]), qe = "customTextFields must map existing custom block ids to lists of string fieldValues paths.";
654
+ function D(e, t, n, r) {
655
+ throw new T(e, t, n, r);
646
656
  }
647
- function k(e) {
657
+ function O(e) {
648
658
  return typeof e == "object" && !!e && !Array.isArray(e);
649
659
  }
650
- function A(e) {
660
+ function k(e) {
651
661
  return e.type === "section";
652
662
  }
653
- function Ue(e) {
663
+ function Je(e) {
654
664
  return Array.isArray(e.blocks) ? e.blocks : [];
655
665
  }
656
- function We(e) {
666
+ function Ye(e) {
657
667
  let t = e.children;
658
668
  return Array.isArray(t) ? t.map((e) => Array.isArray(e) ? e : []) : [];
659
669
  }
660
- function j(e, t) {
661
- let n = Ue(e);
662
- for (let e = 0; e < n.length; e++) {
663
- let r = n[e];
664
- if (!k(r)) continue;
665
- if (r.id === t) return {
670
+ function* Xe(e, t) {
671
+ for (let n = 0; n < e.length; n++) {
672
+ let r = e[n];
673
+ if (O(r) && (yield {
666
674
  block: r,
667
- list: n,
668
- index: e,
669
- parent: null
670
- };
671
- if (!A(r) || typeof r.id != "string") continue;
672
- let i = r.children;
673
- if (Array.isArray(i)) for (let e = 0; e < i.length; e++) {
674
- let n = i[e];
675
- if (Array.isArray(n)) for (let i = 0; i < n.length; i++) {
676
- let a = n[i];
677
- if (k(a) && a.id === t) return {
678
- block: a,
679
- list: n,
680
- index: i,
681
- parent: {
682
- sectionId: r.id,
683
- column: e
684
- }
685
- };
686
- }
675
+ list: e,
676
+ index: n,
677
+ parent: t
678
+ }, typeof r.id == "string")) {
679
+ if (k(r)) for (let [e, t] of Ye(r).entries()) yield* Xe(t, {
680
+ sectionId: r.id,
681
+ column: e
682
+ });
683
+ else r.type === "wrapper" && Array.isArray(r.children) && (yield* Xe(r.children, { wrapperId: r.id }));
687
684
  }
688
685
  }
686
+ }
687
+ function A(e, t) {
688
+ for (let n of Xe(Je(e), null)) if (n.block.id === t) return n;
689
689
  return null;
690
690
  }
691
- function Ge(e) {
691
+ function j(e) {
692
+ if (!O(e)) return [];
692
693
  let t = typeof e.id == "string" ? [e.id] : [];
693
- if (A(e)) for (let n of We(e)) t.push(...Ke(n));
694
+ if (k(e)) for (let n of Ye(e)) for (let e of Ze(n)) t.push(e);
695
+ else if (e.type === "wrapper" && Array.isArray(e.children)) for (let n of Ze(e.children)) t.push(n);
694
696
  return t;
695
697
  }
696
- function Ke(e) {
697
- return e.flatMap((e) => k(e) ? Ge(e) : []);
698
+ function Ze(e) {
699
+ return e.flatMap(j);
698
700
  }
699
- function qe(e, t) {
700
- return typeof e.blockId != "string" || e.blockId === "" ? O("invalid_operation", t, "blockId must be a block id.") : e.blockId;
701
+ function M(e, t) {
702
+ return typeof e.blockId != "string" || e.blockId === "" ? D("invalid_operation", t, "blockId must be a block id.") : e.blockId;
701
703
  }
702
- function Je(e, t) {
704
+ function Qe(e, t) {
703
705
  let n = e.parent;
704
- return n === null ? null : k(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
706
+ return n === null ? null : O(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
705
707
  sectionId: n.sectionId,
706
708
  column: n.column
707
- } : O("invalid_operation", t, "parent must be null or { \"sectionId\", \"column\" }.");
709
+ } : O(n) && typeof n.wrapperId == "string" && n.wrapperId !== "" && !Object.hasOwn(n, "sectionId") && !Object.hasOwn(n, "column") ? { wrapperId: n.wrapperId } : D("invalid_operation", t, "parent must be null, { \"sectionId\", \"column\" }, or { \"wrapperId\" }.");
708
710
  }
709
- function Ye(e, t) {
711
+ function $e(e, t) {
710
712
  let n = e.after;
711
- return n === null ? null : typeof n == "string" && n !== "" ? n : O("invalid_operation", t, "after must be null or a block id.");
713
+ return n === null ? null : typeof n == "string" && n !== "" ? n : D("invalid_operation", t, "after must be null or a block id.");
712
714
  }
713
- function M(e, t) {
715
+ function N(e, t) {
714
716
  let n = e.expect;
715
- return n == null ? null : k(n) ? n : O("invalid_operation", t, "expect must be an object.");
717
+ return n == null ? null : O(n) ? n : D("invalid_operation", t, "expect must be an object.");
716
718
  }
717
- function Xe(e, t, n) {
719
+ function et(e, t, n) {
718
720
  let r = e.set ?? null, i = e.unset ?? [];
719
- (r === null || k(r)) && Array.isArray(i) && i.every((e) => typeof e == "string") || O("invalid_operation", t, "set must be an object and unset a list of keys.");
721
+ (r === null || O(r)) && Array.isArray(i) && i.every((e) => typeof e == "string") || D("invalid_operation", t, "set must be an object and unset a list of keys.");
720
722
  let a = r === null ? {} : r, o = Object.keys(a).filter((e) => a[e] !== void 0);
721
- o.length === 0 && i.length === 0 && O("invalid_operation", t, "Set or unset at least one key.");
722
- for (let e of [...o, ...i]) n.has(e) && O("invalid_operation", t, `"${e}" can't be set or unset.`);
723
+ o.length === 0 && i.length === 0 && D("invalid_operation", t, "Set or unset at least one key.");
724
+ for (let e of [...o, ...i]) n.has(e) && D("invalid_operation", t, `"${e}" can't be set or unset.`);
723
725
  let s = i.find((e) => o.includes(e));
724
- return s !== void 0 && O("invalid_operation", t, `"${s}" is both set and unset.`), {
726
+ return s !== void 0 && D("invalid_operation", t, `"${s}" is both set and unset.`), {
725
727
  set: Object.fromEntries(o.map((e) => [e, a[e]])),
726
728
  unset: i
727
729
  };
728
730
  }
729
- function Ze(e, t, n) {
730
- if (k(e) && typeof e.id == "string" && e.id !== "" && typeof e.type == "string" || O("invalid_operation", t, "A block needs a non-empty string id and a string type."), !A(e)) return;
731
- n && O("invalid_operation", t, "Sections can only be placed at the top level.");
731
+ function tt(e, t, n) {
732
+ if (O(e) && typeof e.id == "string" && e.id !== "" && typeof e.type == "string" || D("invalid_operation", t, "A block needs a non-empty string id and a string type."), e.type === "wrapper") {
733
+ n !== "root" && D("invalid_operation", t, n === "column" ? "Wrappers can only be placed at the top level." : "Wrappers cannot be placed inside wrappers."), Array.isArray(e.children) || D("invalid_operation", t, "A wrapper needs children: a list of blocks.");
734
+ for (let n of e.children) tt(n, t, "wrapper");
735
+ return;
736
+ }
737
+ if (!k(e)) return;
738
+ n === "column" && D("invalid_operation", t, "Sections can only be placed at the top level."), n === "wrapper" && e.wrapper && D("invalid_operation", t, ze);
732
739
  let r = e.children;
733
- Array.isArray(r) && r.every((e) => Array.isArray(e)) || O("invalid_operation", t, "A section needs children: a list of columns, each a list of blocks.");
734
- for (let e of r) for (let n of e) Ze(n, t, !0);
740
+ Array.isArray(r) && r.every((e) => Array.isArray(e)) || D("invalid_operation", t, "A section needs children: a list of columns, each a list of blocks.");
741
+ for (let e of r) for (let n of e) tt(n, t, "column");
735
742
  }
736
- function N(e, t) {
743
+ function P(e, t) {
737
744
  return e.session === null || t.sessionId !== e.session;
738
745
  }
739
- function Qe(e, t, n) {
740
- let r = e.locks.find((n) => t.includes(n.blockId) && N(e, n));
741
- r && O("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
746
+ function nt(e, t, n) {
747
+ let r = e.locks.find((n) => t.includes(n.blockId) && P(e, n));
748
+ r && D("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
742
749
  }
743
- function $e(e, t, n, r) {
744
- e.locks.find((r) => N(e, r) && r.blockId === t && ((r.locale ?? null) === null || r.locale === n)) && O("lock_held", r, `Block "${t}" is being edited in another session.`, t);
750
+ function rt(e, t, n, r) {
751
+ e.locks.find((r) => P(e, r) && r.blockId === t && ((r.locale ?? null) === null || r.locale === n)) && D("lock_held", r, `Block "${t}" is being edited in another session.`, t);
745
752
  }
746
- function et(e, t, n, r) {
747
- for (let [i, a] of Object.entries(t)) a !== void 0 && (g(Object.hasOwn(e, i) && e[i] !== void 0 ? e[i] : null, a) || O("precondition_failed", n, r === void 0 ? `Setting "${i}" has changed since.` : `"${i}" of block "${r}" has changed since.`, r));
753
+ function it(e, t, n, r) {
754
+ for (let [i, a] of Object.entries(t)) a !== void 0 && (h(Object.hasOwn(e, i) && e[i] !== void 0 ? e[i] : null, a) || D("precondition_failed", n, r === void 0 ? `Setting "${i}" has changed since.` : `"${i}" of block "${r}" has changed since.`, r));
748
755
  }
749
- function tt(e, t, n) {
756
+ function at(e, t, n) {
750
757
  if (t === null) return Array.isArray(e.blocks) || (e.blocks = []), e.blocks;
751
- let r = j(e, t.sectionId);
752
- if (!r) return O("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
753
- if (!A(r.block)) return O("invalid_operation", n, `Block "${t.sectionId}" isn't a section.`);
758
+ if ("wrapperId" in t) {
759
+ let r = A(e, t.wrapperId);
760
+ return r ? r.block.type === "wrapper" ? Array.isArray(r.block.children) ? r.block.children : D("invalid_operation", n, `Wrapper "${t.wrapperId}" has no children list.`) : D("invalid_operation", n, `Block "${t.wrapperId}" isn't a wrapper.`) : D("block_missing", n, `No wrapper with id "${t.wrapperId}".`, t.wrapperId);
761
+ }
762
+ let r = A(e, t.sectionId);
763
+ if (!r) return D("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
764
+ if (!k(r.block)) return D("invalid_operation", n, `Block "${t.sectionId}" isn't a section.`);
754
765
  let i = r.block.children;
755
- return !Array.isArray(i) || t.column < 0 || t.column >= i.length ? O("invalid_operation", n, `Section "${t.sectionId}" has no column ${t.column}.`) : (Array.isArray(i[t.column]) || (i[t.column] = []), i[t.column]);
766
+ return !Array.isArray(i) || t.column < 0 || t.column >= i.length ? D("invalid_operation", n, `Section "${t.sectionId}" has no column ${t.column}.`) : (Array.isArray(i[t.column]) || (i[t.column] = []), i[t.column]);
756
767
  }
757
- function nt(e, t, n) {
768
+ function ot(e, t, n) {
758
769
  if (t === null) return 0;
759
- let r = e.findIndex((e) => k(e) && e.id === t);
760
- return r === -1 ? O("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
770
+ let r = e.findIndex((e) => O(e) && e.id === t);
771
+ return r === -1 ? D("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
761
772
  }
762
- function rt(e, t, n, r) {
763
- let i = Ie(t), a = Array.isArray(e.children) ? e.children : [];
773
+ function st(e, t, n, r) {
774
+ let i = Ve(t), a = Array.isArray(e.children) ? e.children : [];
764
775
  for (let e = i; e < a.length; e++) {
765
776
  let t = a[e];
766
- Array.isArray(t) && t.length > 0 && O("invalid_operation", n, `Column ${e} of section "${r}" still holds blocks, so the layout can't drop it.`);
777
+ Array.isArray(t) && t.length > 0 && D("invalid_operation", n, `Column ${e} of section "${r}" still holds blocks, so the layout can't drop it.`);
767
778
  }
768
779
  let o = a.slice(0, i);
769
780
  for (; o.length < i;) o.push([]);
770
781
  e.children = o;
771
782
  }
772
- function it(e, t, n) {
783
+ function ct(e, t, n) {
773
784
  for (let [n, r] of Object.entries(t)) n === "__proto__" ? Object.defineProperty(e, n, {
774
- value: h(r),
785
+ value: m(r),
775
786
  writable: !0,
776
787
  enumerable: !0,
777
788
  configurable: !0
778
- }) : e[n] = h(r);
789
+ }) : e[n] = m(r);
779
790
  for (let t of n) delete e[t];
780
791
  }
781
- function at(e) {
782
- return fe(e).map((t) => {
792
+ function lt(e) {
793
+ return me(e).map((t) => {
783
794
  let n = t.path.replace(/\.(items|icons|rows)\[.*$/, "").replace(/\[(\d+)\]/g, ".$1").split(".").reduce((e, t) => e[t], e);
784
795
  return {
785
796
  id: t.id,
@@ -787,114 +798,114 @@ function at(e) {
787
798
  };
788
799
  });
789
800
  }
790
- function ot(e, t, n) {
791
- let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ? at(n).map(r) : []), a = at(e).find((e) => !i.has(r(e)));
792
- a && O("invalid_operation", t, `Element id "${a.id}" must not contain "." or "/".`, a.blockId);
801
+ function ut(e, t, n) {
802
+ let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ? lt(n).map(r) : []), a = lt(e).find((e) => !i.has(r(e)));
803
+ a && D("invalid_operation", t, `Element id "${a.id}" must not contain "." or "/".`, a.blockId);
793
804
  }
794
- function st(e, t, n, r) {
805
+ function dt(e, t, n, r) {
795
806
  let i = t;
796
- switch (k(i) && typeof i.op == "string" || O("invalid_operation", n, "Each operation must be an object with an \"op\"."), i.op) {
797
- case "addBlock": return ct(e, i, n);
798
- case "moveBlock": return lt(e, i, n, r);
799
- case "deleteBlock": return ut(e, i, n, r);
800
- case "updateBlock": return dt(e, i, n, r);
801
- case "updateSettings": return ft(e, i, n);
802
- case "setContent": return Dt(e, i, n, r);
803
- case "setDefaultLocale": return Ot(e, i, n, r);
804
- case "addLocale": return ht(e, i, n);
805
- case "removeLocale": return _t(e, i, n);
806
- case "updateBlockLocale": return Tt(e, i, n, r);
807
- case "updateSettingsLocale": return Et(e, i, n);
808
- default: O("invalid_operation", n, `Unknown operation "${i.op}".`);
807
+ switch (O(i) && typeof i.op == "string" || D("invalid_operation", n, "Each operation must be an object with an \"op\"."), i.op) {
808
+ case "addBlock": return ft(e, i, n);
809
+ case "moveBlock": return pt(e, i, n, r);
810
+ case "deleteBlock": return mt(e, i, n, r);
811
+ case "updateBlock": return ht(e, i, n, r);
812
+ case "updateSettings": return gt(e, i, n);
813
+ case "setContent": return jt(e, i, n, r);
814
+ case "setDefaultLocale": return Mt(e, i, n, r);
815
+ case "addLocale": return yt(e, i, n);
816
+ case "removeLocale": return xt(e, i, n);
817
+ case "updateBlockLocale": return kt(e, i, n, r);
818
+ case "updateSettingsLocale": return At(e, i, n);
819
+ default: D("invalid_operation", n, `Unknown operation "${i.op}".`);
809
820
  }
810
821
  }
811
- function ct(e, t, n) {
812
- let r = Je(t, n), i = Ye(t, n), a = t.block;
813
- Ze(a, n, r !== null), ot({
822
+ function ft(e, t, n) {
823
+ let r = Qe(t, n), i = $e(t, n), a = t.block;
824
+ tt(a, n, r === null ? "root" : "wrapperId" in r ? "wrapper" : "column"), ut({
814
825
  blocks: [a],
815
826
  settings: e.settings
816
827
  }, n);
817
- let o = new Set(Ke(Ue(e))), s = /* @__PURE__ */ new Set();
818
- for (let e of Ge(a)) (o.has(e) || s.has(e)) && O("block_exists", n, `A block with id "${e}" already exists.`, e), s.add(e);
819
- let c = tt(e, r, n), l = nt(c, i, n);
820
- wt(e, a, r, n, !0), c.splice(l, 0, h(a));
821
- }
822
- function lt(e, t, n, r) {
823
- let i = qe(t, n), a = Je(t, n), o = Ye(t, n), s = M(t, n), c = j(e, i);
824
- if (!c) return O("block_missing", n, `No block with id "${i}".`, i);
825
- if (Qe(r, Ge(c.block), n), s) {
826
- let e = c.index > 0 ? c.list[c.index - 1] : null, t = k(e) ? e.id ?? null : null;
827
- g(c.parent, s.parent ?? null) && g(t, s.after ?? null) || O("precondition_failed", n, `Block "${i}" has moved since.`, i);
828
+ let o = new Set(Ze(Je(e))), s = /* @__PURE__ */ new Set();
829
+ for (let e of j(a)) (o.has(e) || s.has(e)) && D("block_exists", n, `A block with id "${e}" already exists.`, e), s.add(e);
830
+ let c = at(e, r, n), l = ot(c, i, n);
831
+ Ot(e, a, r, n, !0), c.splice(l, 0, m(a));
832
+ }
833
+ function pt(e, t, n, r) {
834
+ let i = M(t, n), a = Qe(t, n), o = $e(t, n), s = N(t, n), c = s && s.parent !== void 0 ? Qe({ parent: s.parent }, n) : null, l = A(e, i);
835
+ if (!l) return D("block_missing", n, `No block with id "${i}".`, i);
836
+ if (nt(r, j(l.block), n), s) {
837
+ let e = l.index > 0 ? l.list[l.index - 1] : null, t = O(e) ? e.id ?? null : null;
838
+ h(l.parent, c) && h(t, s.after ?? null) || D("precondition_failed", n, `Block "${i}" has moved since.`, i);
828
839
  }
829
- A(c.block) && a !== null && O("invalid_operation", n, "Sections can only be placed at the top level."), o === i && O("invalid_operation", n, "A block can't be placed after itself.");
830
- let l = tt(e, a, n);
831
- nt(l.filter((e) => e !== c.block), o, n), wt(e, c.block, a, n, !1), c.list.splice(c.index, 1), l.splice(nt(l, o, n), 0, c.block);
832
- }
833
- function ut(e, t, n, r) {
834
- let i = qe(t, n), a = M(t, n), o = j(e, i);
835
- if (!o) return O("block_missing", n, `No block with id "${i}".`, i);
836
- Qe(r, Ge(o.block), n), a && !g(o.block, a.block ?? null) && O("precondition_failed", n, `Block "${i}" has changed since.`, i), o.list.splice(o.index, 1);
837
- }
838
- function dt(e, t, n, r) {
839
- let i = qe(t, n), { set: a, unset: o } = Xe(t, n, Re), s = M(t, n), c = j(e, i);
840
- if (!c) return O("block_missing", n, `No block with id "${i}".`, i);
841
- let l = c.block, u = A(l);
842
- u && o.includes("columns") && O("invalid_operation", n, "A section's columns can't be unset; set another layout instead."), Qe(r, [i], n), s && et(l, s, n, i);
840
+ a !== null && ("wrapperId" in a ? a.wrapperId : a.sectionId) === i && D("invalid_operation", n, "A block cannot be moved into itself or its descendants."), a !== null && j(l.block).includes("wrapperId" in a ? a.wrapperId : a.sectionId) && D("invalid_operation", n, "A block cannot be moved into itself or its descendants."), k(l.block) && a !== null && "sectionId" in a && D("invalid_operation", n, "Sections can only be placed at the top level."), k(l.block) && l.block.wrapper && a !== null && "wrapperId" in a && D("invalid_operation", n, ze), l.block.type === "wrapper" && a !== null && D("invalid_operation", n, "wrapperId" in a ? "Wrappers cannot be placed inside wrappers." : "Wrappers can only be placed at the top level."), o === i && D("invalid_operation", n, "A block can't be placed after itself.");
841
+ let u = at(e, a, n);
842
+ ot(u.filter((e) => e !== l.block), o, n), Ot(e, l.block, a, n, !1), l.list.splice(l.index, 1), u.splice(ot(u, o, n), 0, l.block);
843
+ }
844
+ function mt(e, t, n, r) {
845
+ let i = M(t, n), a = N(t, n), o = A(e, i);
846
+ if (!o) return D("block_missing", n, `No block with id "${i}".`, i);
847
+ nt(r, j(o.block), n), a && !h(o.block, a.block ?? null) && D("precondition_failed", n, `Block "${i}" has changed since.`, i), o.list.splice(o.index, 1);
848
+ }
849
+ function ht(e, t, n, r) {
850
+ let i = M(t, n), { set: a, unset: o } = et(t, n, Ue), s = N(t, n), c = A(e, i);
851
+ if (!c) return D("block_missing", n, `No block with id "${i}".`, i);
852
+ let l = c.block, u = k(l);
853
+ u && o.includes("columns") && D("invalid_operation", n, "A section's columns can't be unset; set another layout instead."), nt(r, [i], n), s && it(l, s, n, i), u && c.parent !== null && "wrapperId" in c.parent && a.wrapper && D("invalid_operation", n, ze);
843
854
  let d = { ...l };
844
- it(d, a, o), ot({
855
+ ct(d, a, o), ut({
845
856
  blocks: [d],
846
857
  settings: e.settings
847
858
  }, n, {
848
859
  blocks: [l],
849
860
  settings: e.settings
850
- }), u && Object.hasOwn(a, "columns") && rt(l, a.columns, n, i), it(l, a, o);
851
- let f = be(l);
852
- g(l.l10n, f.l10n) || (f.l10n ? l.l10n = f.l10n : delete l.l10n), u && f.type === "section" && !g(l.children, f.children) && (l.children = f.children);
861
+ }), u && Object.hasOwn(a, "columns") && st(l, a.columns, n, i), ct(l, a, o);
862
+ let f = Se(l);
863
+ h(l.l10n, f.l10n) || (f.l10n ? l.l10n = f.l10n : delete l.l10n), (u || l.type === "wrapper") && !h(l.children, f.children) && (l.children = f.children);
853
864
  }
854
- function ft(e, t, n) {
855
- let { set: r, unset: i } = Xe(t, n, ze), a = M(t, n);
856
- e.settings?.locales?.length && (Object.hasOwn(r, "locale") || i.includes("locale")) && O("invalid_operation", n, "The default locale can't change while language versions exist."), k(e.settings) || (e.settings = {});
865
+ function gt(e, t, n) {
866
+ let { set: r, unset: i } = et(t, n, We), a = N(t, n);
867
+ e.settings?.locales?.length && (Object.hasOwn(r, "locale") || i.includes("locale")) && D("invalid_operation", n, "The default locale can't change while language versions exist."), O(e.settings) || (e.settings = {});
857
868
  let o = e.settings;
858
- a && et(o, a, n), it(o, r, i);
859
- let s = Se(e.settings);
860
- g(o.l10n, s.l10n) || (s.l10n ? o.l10n = s.l10n : delete o.l10n);
869
+ a && it(o, a, n), ct(o, r, i);
870
+ let s = we(e.settings);
871
+ h(o.l10n, s.l10n) || (s.l10n ? o.l10n = s.l10n : delete o.l10n);
861
872
  }
862
- function pt(e, t) {
873
+ function _t(e, t) {
863
874
  let n = e.locale;
864
- return ge(n) && n !== "__proto__" && n !== "constructor" && n !== "prototype" || O("invalid_operation", t, "locale must be a language tag."), n;
875
+ return ve(n) && n !== "__proto__" && n !== "constructor" && n !== "prototype" || D("invalid_operation", t, "locale must be a language tag."), n;
865
876
  }
866
- function mt(e, t, n) {
867
- let r = pt(t, n);
868
- return e.settings.locales?.includes(r) || O("invalid_operation", n, `Locale "${r}" isn't in settings.locales.`), r;
877
+ function vt(e, t, n) {
878
+ let r = _t(t, n);
879
+ return e.settings.locales?.includes(r) || D("invalid_operation", n, `Locale "${r}" isn't in settings.locales.`), r;
869
880
  }
870
- function ht(e, t, n) {
871
- let r = pt(t, n), i = e.settings.locales ?? [], a = r.toLowerCase(), o = t.position === void 0 ? i.length : t.position;
872
- (T(e).toLowerCase() === a || i.some((e) => e.toLowerCase() === a) || typeof o != "number" || !Number.isInteger(o) || o < 0 || o > i.length) && O("invalid_operation", n, "The locale already exists or its insertion position is invalid."), e.settings.locales || (e.settings.locales = []), e.settings.locales.splice(o, 0, r);
881
+ function yt(e, t, n) {
882
+ let r = _t(t, n), i = e.settings.locales ?? [], a = r.toLowerCase(), o = t.position === void 0 ? i.length : t.position;
883
+ (w(e).toLowerCase() === a || i.some((e) => e.toLowerCase() === a) || typeof o != "number" || !Number.isInteger(o) || o < 0 || o > i.length) && D("invalid_operation", n, "The locale already exists or its insertion position is invalid."), e.settings.locales || (e.settings.locales = []), e.settings.locales.splice(o, 0, r);
873
884
  }
874
- function P(e) {
875
- return e.flatMap((e) => k(e) ? [e, ...A(e) ? We(e).flatMap(P) : e.type === "wrapper" && Array.isArray(e.children) ? P(e.children) : []] : []);
885
+ function F(e) {
886
+ return e.flatMap((e) => O(e) ? [e, ...k(e) ? Ye(e).flatMap(F) : e.type === "wrapper" && Array.isArray(e.children) ? F(e.children) : []] : []);
876
887
  }
877
- function gt(e, t) {
888
+ function bt(e, t) {
878
889
  let n = e.l10n;
879
- return k(n) && k(n[t]) ? n[t] : {};
880
- }
881
- function _t(e, t, n) {
882
- let r = mt(e, t, n), i = M(t, n);
883
- i && (!k(i.blocks) || i.settings !== void 0 && !k(i.settings)) && O("invalid_operation", n, "expect needs a blocks object and an optional settings layer.");
884
- let a = e.settings, o = P(Ue(e)), s = Object.fromEntries(o.flatMap((e) => k(e.l10n) && Object.hasOwn(e.l10n, r) ? [[String(e.id), e.l10n[r]]] : []));
885
- !i || g(s, i.blocks) && g(k(a.l10n) ? a.l10n[r] : void 0, i.settings) || O("precondition_failed", n, `Locale "${r}" has changed since.`);
886
- for (let e of [...o, a]) k(e.l10n) && (delete e.l10n[r], Object.keys(e.l10n).length === 0 && delete e.l10n);
890
+ return O(n) && O(n[t]) ? n[t] : {};
891
+ }
892
+ function xt(e, t, n) {
893
+ let r = vt(e, t, n), i = N(t, n);
894
+ i && (!O(i.blocks) || i.settings !== void 0 && !O(i.settings)) && D("invalid_operation", n, "expect needs a blocks object and an optional settings layer.");
895
+ let a = e.settings, o = F(Je(e)), s = Object.fromEntries(o.flatMap((e) => O(e.l10n) && Object.hasOwn(e.l10n, r) ? [[String(e.id), e.l10n[r]]] : []));
896
+ !i || h(s, i.blocks) && h(O(a.l10n) ? a.l10n[r] : void 0, i.settings) || D("precondition_failed", n, `Locale "${r}" has changed since.`);
897
+ for (let e of [...o, a]) O(e.l10n) && (delete e.l10n[r], Object.keys(e.l10n).length === 0 && delete e.l10n);
887
898
  e.settings.locales.splice(e.settings.locales.indexOf(r), 1), e.settings.locales.length === 0 && delete e.settings.locales;
888
899
  }
889
- function vt(e, t, n) {
890
- (e.text === void 0 || ((e) => k(e) && Object.values(e).every((e) => k(e) && typeof e.value == "string" && typeof e.sourceHash == "string"))(e.text)) && (e.set === void 0 || k(e.set) && !Object.values(e.set).some((e) => e === void 0)) && (e.unset === void 0 || Array.isArray(e.unset) && e.unset.every((e) => typeof e == "string" && e !== "" && y(e))) && (e.hidden === void 0 || !n && typeof e.hidden == "boolean") && [
900
+ function St(e, t, n) {
901
+ (e.text === void 0 || ((e) => O(e) && Object.values(e).every((e) => O(e) && typeof e.value == "string" && typeof e.sourceHash == "string"))(e.text)) && (e.set === void 0 || O(e.set) && !Object.values(e.set).some((e) => e === void 0)) && (e.unset === void 0 || Array.isArray(e.unset) && e.unset.every((e) => typeof e == "string" && e !== "" && v(e))) && (e.hidden === void 0 || !n && typeof e.hidden == "boolean") && [
891
902
  "text",
892
903
  "set",
893
904
  "unset",
894
905
  ...n ? [] : ["hidden"]
895
- ].some((t) => e[t] !== void 0) || O("invalid_operation", t, "A locale update needs text, set, unset or a block's boolean hidden.");
896
- let r = M(e, t);
897
- return r && (r.text !== void 0 && !k(r.text) || r.set !== void 0 && !k(r.set) || r.hidden !== void 0 && (n || typeof r.hidden != "boolean")) && O("invalid_operation", t, "The locale layer expect is malformed."), {
906
+ ].some((t) => e[t] !== void 0) || D("invalid_operation", t, "A locale update needs text, set, unset or a block's boolean hidden.");
907
+ let r = N(e, t);
908
+ return r && (r.text !== void 0 && !O(r.text) || r.set !== void 0 && !O(r.set) || r.hidden !== void 0 && (n || typeof r.hidden != "boolean")) && D("invalid_operation", t, "The locale layer expect is malformed."), {
898
909
  text: e.text ?? {},
899
910
  set: e.set ?? {},
900
911
  unset: e.unset ?? [],
@@ -902,83 +913,88 @@ function vt(e, t, n) {
902
913
  expect: r
903
914
  };
904
915
  }
905
- function yt(e, t, n, r) {
906
- for (let i of Object.keys(t.text)) y(i) && (r ? _.includes(i) : we(String(e.type), i)) && b(e, i) !== void 0 || O("invalid_operation", n, `Text path "${i}" isn't translatable or doesn't resolve.`);
916
+ function Ct(e, t, n, r) {
917
+ for (let i of Object.keys(t.text)) v(i) && (r ? g.includes(i) : Ee(String(e.type), i)) && y(e, i) !== void 0 || D("invalid_operation", n, `Text path "${i}" isn't translatable or doesn't resolve.`);
907
918
  for (let i of Object.keys(t.set)) {
908
- let a = i.split("."), o = r ? Be : Re, s = a.length === 1 ? e : b(e, a.slice(0, -1).join("."));
909
- (!y(i) || o.has(a[0]) || !r && xe(e, i, t.set[i]) || b(e, i) === void 0 && !k(s)) && O("invalid_operation", n, `Override path "${i}" is immutable or doesn't resolve.`);
919
+ let a = i.split("."), o = r ? Ge : Ue, s = a.length === 1 ? e : y(e, a.slice(0, -1).join("."));
920
+ (!v(i) || o.has(a[0]) || !r && Ce(e, i, t.set[i]) || y(e, i) === void 0 && !O(s)) && D("invalid_operation", n, `Override path "${i}" is immutable or doesn't resolve.`);
910
921
  }
911
922
  }
912
- function bt(e, t, n, r) {
923
+ function wt(e, t, n, r) {
913
924
  if (t) {
914
- for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {})) g(e[i]?.[a] ?? null, o) || O("precondition_failed", n, `Locale path "${a}" has changed since.`, r);
915
- t.hidden !== void 0 && !g(e.hidden === !0, t.hidden) && O("precondition_failed", n, "The locale's hidden state has changed since.", r);
925
+ for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {})) h(e[i]?.[a] ?? null, o) || D("precondition_failed", n, `Locale path "${a}" has changed since.`, r);
926
+ t.hidden !== void 0 && !h(e.hidden === !0, t.hidden) && D("precondition_failed", n, "The locale's hidden state has changed since.", r);
916
927
  }
917
928
  }
918
- function xt(e, t, n) {
919
- k(e.l10n) || (e.l10n = {});
929
+ function Tt(e, t, n) {
930
+ O(e.l10n) || (e.l10n = {});
920
931
  let r = e.l10n;
921
- k(r[t]) || (r[t] = {});
932
+ O(r[t]) || (r[t] = {});
922
933
  let i = r[t];
923
934
  for (let e of n.unset) i.text && delete i.text[e], i.set && delete i.set[e];
924
- for (let [e, t] of Object.entries(n.text)) i.text ||= {}, i.text[e] = h(t), i.set && delete i.set[e];
925
- for (let [e, t] of Object.entries(n.set)) i.set ||= {}, i.set[e] = h(t), i.text && delete i.text[e];
935
+ for (let [e, t] of Object.entries(n.text)) i.text ||= {}, i.text[e] = m(t), i.set && delete i.set[e];
936
+ for (let [e, t] of Object.entries(n.set)) i.set ||= {}, i.set[e] = m(t), i.text && delete i.text[e];
926
937
  n.hidden === !0 ? i.hidden = !0 : n.hidden === !1 && delete i.hidden, i.text && Object.keys(i.text).length === 0 && delete i.text, i.set && Object.keys(i.set).length === 0 && delete i.set, Object.keys(i).length === 0 && delete r[t], Object.keys(r).length === 0 && delete e.l10n;
927
938
  }
928
- function F(e) {
929
- return k(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(F) : F(e)) : !1;
939
+ function I(e) {
940
+ return O(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(I) : I(e)) : !1;
930
941
  }
931
- function St(e) {
932
- return k(e) && k(e.l10n) && Object.values(e.l10n).some((e) => k(e) && e.hidden === !0);
942
+ function Et(e) {
943
+ return O(e) && O(e.l10n) && Object.values(e.l10n).some((e) => O(e) && e.hidden === !0);
933
944
  }
934
- function Ct(e) {
935
- return !k(e) || !F(e) ? !1 : St(e) ? !0 : Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(Ct) : Ct(e));
945
+ function Dt(e) {
946
+ return !O(e) || !I(e) ? !1 : Et(e) ? !0 : Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(Dt) : Dt(e));
936
947
  }
937
- function wt(e, t, n, r, i) {
938
- if (!F(t)) return;
939
- let a = n === null ? null : j(e, n.sectionId);
940
- (a !== null && St(a.block) || i && Ct(t)) && O("invalid_operation", r, "A layout's slot block can't be placed inside a block that a language hides.", k(t) && typeof t.id == "string" ? t.id : void 0);
948
+ function Ot(e, t, n, r, i) {
949
+ if (!I(t)) return;
950
+ let a = n, o = !1;
951
+ for (; a !== null;) {
952
+ let t = A(e, "wrapperId" in a ? a.wrapperId : a.sectionId);
953
+ if (!t) break;
954
+ Et(t.block) && (o = !0), a = t.parent;
955
+ }
956
+ (o || i && Dt(t)) && D("invalid_operation", r, "A layout's slot block can't be placed inside a block that a language hides.", O(t) && typeof t.id == "string" ? t.id : void 0);
941
957
  }
942
- function Tt(e, t, n, r) {
943
- let i = mt(e, t, n), a = qe(t, n), o = vt(t, n, !1), s = P(Ue(e)).find((e) => e.id === a);
944
- s || O("block_missing", n, `No block with id "${a}".`, a), yt(s, o, n, !1), $e(r, a, i, n), bt(gt(s, i), o.expect, n, a), o.hidden === !0 && F(s) && O("invalid_operation", n, "A layout's slot block, and any block that contains it, can't be hidden.", a), xt(s, i, o);
958
+ function kt(e, t, n, r) {
959
+ let i = vt(e, t, n), a = M(t, n), o = St(t, n, !1), s = F(Je(e)).find((e) => e.id === a);
960
+ s || D("block_missing", n, `No block with id "${a}".`, a), Ct(s, o, n, !1), rt(r, a, i, n), wt(bt(s, i), o.expect, n, a), o.hidden === !0 && I(s) && D("invalid_operation", n, "A layout's slot block, and any block that contains it, can't be hidden.", a), Tt(s, i, o);
945
961
  }
946
- function Et(e, t, n) {
947
- let r = mt(e, t, n), i = vt(t, n, !0), a = e.settings;
948
- yt(a, i, n, !0), bt(gt(a, r), i.expect, n), xt(a, r, i);
962
+ function At(e, t, n) {
963
+ let r = vt(e, t, n), i = St(t, n, !0), a = e.settings;
964
+ Ct(a, i, n, !0), wt(bt(a, r), i.expect, n), Tt(a, r, i);
949
965
  }
950
- function Dt(e, t, n, r) {
966
+ function jt(e, t, n, r) {
951
967
  let i = t.content;
952
- if (!k(i) || !Array.isArray(i.blocks) || !k(i.settings)) return O("invalid_operation", n, "setContent needs content with a blocks array and a settings object.");
953
- ot(i, n, e);
954
- let a = r.locks.find((e) => N(r, e));
955
- a && O("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = h(i.blocks), e.settings = h(i.settings);
956
- }
957
- function Ot(e, t, n, r) {
958
- let i = pt(t, n);
959
- e.settings.locales?.includes(i) || O("invalid_operation", n, `"${i}" is not a language version of this template.`);
960
- let a = je(e, i);
961
- a.length && O("invalid_operation", n, a.length === 1 ? `1 block is hidden in "${i}". Show it before making it the default.` : `${a.length} blocks are hidden in "${i}". Show them before making it the default.`, a[0]);
962
- let o = r.locks.find((e) => N(r, e));
963
- o && O("locked_by_others", n, "Other sessions hold locks on this template.", o.blockId);
968
+ if (!O(i) || !Array.isArray(i.blocks) || !O(i.settings)) return D("invalid_operation", n, "setContent needs content with a blocks array and a settings object.");
969
+ ut(i, n, e);
970
+ let a = r.locks.find((e) => P(r, e));
971
+ a && D("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = m(i.blocks), e.settings = m(i.settings);
972
+ }
973
+ function Mt(e, t, n, r) {
974
+ let i = _t(t, n);
975
+ e.settings.locales?.includes(i) || D("invalid_operation", n, `"${i}" is not a language version of this template.`);
976
+ let a = Fe(e, i);
977
+ a.length && D("invalid_operation", n, a.length === 1 ? `1 block is hidden in "${i}". Show it before making it the default.` : `${a.length} blocks are hidden in "${i}". Show them before making it the default.`, a[0]);
978
+ let o = r.locks.find((e) => P(r, e));
979
+ o && D("locked_by_others", n, "Other sessions hold locks on this template.", o.blockId);
964
980
  let s = t.customTextFields;
965
981
  if (s !== void 0) {
966
- let t = P(e.blocks);
967
- (!k(s) || Object.getOwnPropertyNames(s).some((e) => {
968
- if (Ve.has(e)) return !0;
982
+ let t = F(e.blocks);
983
+ (!O(s) || Object.getOwnPropertyNames(s).some((e) => {
984
+ if (Ke.has(e)) return !0;
969
985
  let n = s[e], r = t.find((t) => t.id === e);
970
- return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !y(e) || !we("custom", e) || typeof b(r, e) != "string");
971
- })) && O("invalid_operation", n, He);
986
+ return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !v(e) || !Ee("custom", e) || typeof y(r, e) != "string");
987
+ })) && D("invalid_operation", n, qe);
972
988
  }
973
- let c = Pe(e, i, t.customTextFields);
989
+ let c = Re(e, i, t.customTextFields);
974
990
  e.blocks = c.blocks, e.settings = c.settings;
975
991
  }
976
992
  // ../types/src/invert-operations.ts
977
- function kt(e) {
993
+ function Nt(e) {
978
994
  let t = e.children;
979
995
  return e.type === "section" && Array.isArray(t) ? t : [];
980
996
  }
981
- function At(e, t, n = null) {
997
+ function Pt(e, t, n = null) {
982
998
  for (let r = 0; r < e.length; r++) {
983
999
  let i = e[r];
984
1000
  if (i.id === t) return {
@@ -986,30 +1002,34 @@ function At(e, t, n = null) {
986
1002
  parent: n,
987
1003
  after: r > 0 ? e[r - 1].id : null
988
1004
  };
989
- let a = kt(i);
1005
+ let a = Nt(i);
990
1006
  for (let e = 0; e < a.length; e++) {
991
1007
  if (!Array.isArray(a[e])) continue;
992
- let n = At(a[e], t, {
1008
+ let n = Pt(a[e], t, {
993
1009
  sectionId: i.id,
994
1010
  column: e
995
1011
  });
996
1012
  if (n) return n;
997
1013
  }
1014
+ if (i.type === "wrapper" && Array.isArray(i.children)) {
1015
+ let e = Pt(i.children, t, { wrapperId: i.id });
1016
+ if (e) return e;
1017
+ }
998
1018
  }
999
1019
  return null;
1000
1020
  }
1001
- function jt(e, t, n) {
1002
- let r = At(e.blocks, t);
1003
- if (!r) throw new E("block_missing", n, `No block with id "${t}".`, t);
1021
+ function Ft(e, t, n) {
1022
+ let r = Pt(e.blocks, t);
1023
+ if (!r) throw new T("block_missing", n, `No block with id "${t}".`, t);
1004
1024
  return r;
1005
1025
  }
1006
- function Mt(e, t, n) {
1026
+ function It(e, t, n) {
1007
1027
  let r = {}, i = [], a = {}, o = [.../* @__PURE__ */ new Set([...Object.keys(t ?? {}), ...n ?? []])];
1008
1028
  for (let n of o) {
1009
1029
  let o = e[n];
1010
- o === void 0 ? i.push(n) : r[n] = h(o);
1030
+ o === void 0 ? i.push(n) : r[n] = m(o);
1011
1031
  let s = t && n in t ? t[n] : void 0;
1012
- a[n] = s === void 0 ? null : h(s);
1032
+ a[n] = s === void 0 ? null : m(s);
1013
1033
  }
1014
1034
  return {
1015
1035
  set: r,
@@ -1017,13 +1037,13 @@ function Mt(e, t, n) {
1017
1037
  expect: a
1018
1038
  };
1019
1039
  }
1020
- function I(e, t) {
1040
+ function L(e, t) {
1021
1041
  return e.l10n?.[t] ?? {};
1022
1042
  }
1023
- function L(e, t, n, r) {
1043
+ function R(e, t, n, r) {
1024
1044
  let i = {}, a = {}, o = {};
1025
1045
  n.length && (o.text = {}, o.set = {});
1026
- for (let r of n) e.text?.[r] !== void 0 && (i[r] = h(e.text[r])), e.set && Object.hasOwn(e.set, r) && (a[r] = h(e.set[r])), o.text[r] = h(t.text?.[r] ?? null), o.set[r] = h(t.set?.[r] ?? null);
1046
+ for (let r of n) e.text?.[r] !== void 0 && (i[r] = m(e.text[r])), e.set && Object.hasOwn(e.set, r) && (a[r] = m(e.set[r])), o.text[r] = m(t.text?.[r] ?? null), o.set[r] = m(t.set?.[r] ?? null);
1027
1047
  return r && (o.hidden = t.hidden === !0), {
1028
1048
  unset: n,
1029
1049
  ...Object.keys(i).length ? { text: i } : {},
@@ -1032,21 +1052,21 @@ function L(e, t, n, r) {
1032
1052
  expect: o
1033
1053
  };
1034
1054
  }
1035
- function Nt(e) {
1036
- let { unset: t, ...n } = L(e, {}, [.../* @__PURE__ */ new Set([...Object.keys(e.text ?? {}), ...Object.keys(e.set ?? {})])], e.hidden === !0);
1055
+ function Lt(e) {
1056
+ let { unset: t, ...n } = R(e, {}, [.../* @__PURE__ */ new Set([...Object.keys(e.text ?? {}), ...Object.keys(e.set ?? {})])], e.hidden === !0);
1037
1057
  return n;
1038
1058
  }
1039
- function R(e) {
1040
- return e.flatMap((e) => [e, ...e.type === "wrapper" ? R(e.children) : kt(e).flatMap(R)]);
1059
+ function z(e) {
1060
+ return e.flatMap((e) => [e, ...e.type === "wrapper" ? z(e.children) : Nt(e).flatMap(z)]);
1041
1061
  }
1042
- function Pt(e, t) {
1043
- let n = h(e);
1044
- D(n, [t]);
1062
+ function Rt(e, t) {
1063
+ let n = m(e);
1064
+ E(n, [t]);
1045
1065
  let r = [], i = (e, t, n) => {
1046
1066
  for (let [i, a] of Object.entries(e.l10n ?? {})) {
1047
1067
  let e = t.l10n?.[i] ?? {}, o = [.../* @__PURE__ */ new Set([...Object.keys(a.text ?? {}).filter((t) => !Object.hasOwn(e.text ?? {}, t)), ...Object.keys(a.set ?? {}).filter((t) => !Object.hasOwn(e.set ?? {}, t))])];
1048
1068
  if (!o.length) continue;
1049
- let s = L(a, e, o, !1);
1069
+ let s = R(a, e, o, !1);
1050
1070
  r.push(n === void 0 ? {
1051
1071
  op: "updateSettingsLocale",
1052
1072
  locale: i,
@@ -1061,32 +1081,32 @@ function Pt(e, t) {
1061
1081
  };
1062
1082
  if (t.op === "updateSettings") i(e.settings, n.settings);
1063
1083
  else {
1064
- let t = new Map(R(n.blocks).map((e) => [e.id, e]));
1065
- for (let n of R(e.blocks)) {
1084
+ let t = new Map(z(n.blocks).map((e) => [e.id, e]));
1085
+ for (let n of z(e.blocks)) {
1066
1086
  let e = t.get(n.id);
1067
1087
  e && i(n, e, n.id);
1068
1088
  }
1069
1089
  }
1070
1090
  return r;
1071
1091
  }
1072
- function Ft(e, t, n) {
1092
+ function zt(e, t, n) {
1073
1093
  switch (t.op) {
1074
1094
  case "addBlock": return {
1075
1095
  op: "deleteBlock",
1076
1096
  blockId: t.block.id,
1077
- expect: { block: h(t.block) }
1097
+ expect: { block: m(t.block) }
1078
1098
  };
1079
1099
  case "deleteBlock": {
1080
- let r = jt(e, t.blockId, n);
1100
+ let r = Ft(e, t.blockId, n);
1081
1101
  return {
1082
1102
  op: "addBlock",
1083
- block: h(r.block),
1103
+ block: m(r.block),
1084
1104
  parent: r.parent,
1085
1105
  after: r.after
1086
1106
  };
1087
1107
  }
1088
1108
  case "moveBlock": {
1089
- let r = jt(e, t.blockId, n);
1109
+ let r = Ft(e, t.blockId, n);
1090
1110
  return {
1091
1111
  op: "moveBlock",
1092
1112
  blockId: t.blockId,
@@ -1099,23 +1119,23 @@ function Ft(e, t, n) {
1099
1119
  };
1100
1120
  }
1101
1121
  case "updateBlock": {
1102
- let r = jt(e, t.blockId, n).block, { set: i, unset: a, expect: o } = Mt(r, t.set, t.unset);
1122
+ let r = Ft(e, t.blockId, n).block, { set: i, unset: a, expect: o } = It(r, t.set, t.unset);
1103
1123
  return [{
1104
1124
  op: "updateBlock",
1105
1125
  blockId: t.blockId,
1106
1126
  ...Object.keys(i).length > 0 ? { set: i } : {},
1107
1127
  ...a.length > 0 ? { unset: a } : {},
1108
1128
  expect: o
1109
- }, ...Pt(e, t)];
1129
+ }, ...Rt(e, t)];
1110
1130
  }
1111
1131
  case "updateSettings": {
1112
- let { set: n, unset: r, expect: i } = Mt(e.settings, t.set, t.unset);
1132
+ let { set: n, unset: r, expect: i } = It(e.settings, t.set, t.unset);
1113
1133
  return [{
1114
1134
  op: "updateSettings",
1115
1135
  ...Object.keys(n).length > 0 ? { set: n } : {},
1116
1136
  ...r.length > 0 ? { unset: r } : {},
1117
1137
  expect: i
1118
- }, ...Pt(e, t)];
1138
+ }, ...Rt(e, t)];
1119
1139
  }
1120
1140
  case "addLocale": return {
1121
1141
  op: "removeLocale",
@@ -1128,18 +1148,18 @@ function Ft(e, t, n) {
1128
1148
  locale: t.locale,
1129
1149
  position: e.settings.locales?.indexOf(t.locale)
1130
1150
  }];
1131
- for (let r of R(e.blocks)) {
1151
+ for (let r of z(e.blocks)) {
1132
1152
  let e = r.l10n?.[t.locale];
1133
1153
  e && n.push({
1134
1154
  op: "updateBlockLocale",
1135
1155
  blockId: r.id,
1136
1156
  locale: t.locale,
1137
- ...Nt(e)
1157
+ ...Lt(e)
1138
1158
  });
1139
1159
  }
1140
1160
  let r = e.settings.l10n?.[t.locale];
1141
1161
  if (r) {
1142
- let { hidden: e, ...i } = Nt(r);
1162
+ let { hidden: e, ...i } = Lt(r);
1143
1163
  n.push({
1144
1164
  op: "updateSettingsLocale",
1145
1165
  locale: t.locale,
@@ -1150,23 +1170,23 @@ function Ft(e, t, n) {
1150
1170
  }
1151
1171
  case "updateBlockLocale":
1152
1172
  case "updateSettingsLocale": {
1153
- let n = h(e);
1154
- D(n, [t]);
1173
+ let n = m(e);
1174
+ E(n, [t]);
1155
1175
  let r = [.../* @__PURE__ */ new Set([
1156
1176
  ...Object.keys(t.text ?? {}),
1157
1177
  ...Object.keys(t.set ?? {}),
1158
1178
  ...t.unset ?? []
1159
1179
  ])];
1160
1180
  if (t.op === "updateBlockLocale") {
1161
- let i = R(e.blocks).find((e) => e.id === t.blockId), a = R(n.blocks).find((e) => e.id === t.blockId);
1181
+ let i = z(e.blocks).find((e) => e.id === t.blockId), a = z(n.blocks).find((e) => e.id === t.blockId);
1162
1182
  return {
1163
1183
  op: "updateBlockLocale",
1164
1184
  blockId: t.blockId,
1165
1185
  locale: t.locale,
1166
- ...L(I(i, t.locale), I(a, t.locale), r, t.hidden !== void 0)
1186
+ ...R(L(i, t.locale), L(a, t.locale), r, t.hidden !== void 0)
1167
1187
  };
1168
1188
  }
1169
- let { hidden: i, ...a } = L(I(e.settings, t.locale), I(n.settings, t.locale), r, !1);
1189
+ let { hidden: i, ...a } = R(L(e.settings, t.locale), L(n.settings, t.locale), r, !1);
1170
1190
  return {
1171
1191
  op: "updateSettingsLocale",
1172
1192
  locale: t.locale,
@@ -1177,95 +1197,95 @@ function Ft(e, t, n) {
1177
1197
  case "setContent": return {
1178
1198
  op: "setContent",
1179
1199
  content: {
1180
- blocks: h(e.blocks),
1181
- settings: h(e.settings)
1200
+ blocks: m(e.blocks),
1201
+ settings: m(e.settings)
1182
1202
  }
1183
1203
  };
1184
1204
  }
1185
1205
  }
1186
- function It(e, t) {
1187
- let n = h(e), r = [];
1206
+ function Bt(e, t) {
1207
+ let n = m(e), r = [];
1188
1208
  return t.forEach((e, t) => {
1189
1209
  try {
1190
- let i = Ft(n, e, t);
1191
- r.push(...Array.isArray(i) ? [...i].reverse() : [i]), D(n, [e]);
1210
+ let i = zt(n, e, t);
1211
+ r.push(...Array.isArray(i) ? [...i].reverse() : [i]), E(n, [e]);
1192
1212
  } catch (e) {
1193
- throw e instanceof E ? new E(e.code, t, e.message, e.blockId) : e;
1213
+ throw e instanceof T ? new T(e.code, t, e.message, e.blockId) : e;
1194
1214
  }
1195
1215
  }), r.reverse();
1196
1216
  }
1197
1217
  // ../types/src/collaboration.ts
1198
- function Lt(e) {
1218
+ function Vt(e) {
1199
1219
  return e === "invalid_operation" ? 422 : e === "content_too_large" ? 413 : 409;
1200
1220
  }
1201
- var Rt = class extends me {
1221
+ var Ht = class extends ge {
1202
1222
  opIndex;
1203
1223
  holder;
1204
1224
  holders;
1205
1225
  constructor(e, t) {
1206
- super(e, t.status ?? Lt(t.code), t.code), this.name = "CollaborationConflict", t.opIndex !== void 0 && (this.opIndex = t.opIndex), t.holder !== void 0 && (this.holder = t.holder), t.holders !== void 0 && (this.holders = t.holders);
1226
+ super(e, t.status ?? Vt(t.code), t.code), this.name = "CollaborationConflict", t.opIndex !== void 0 && (this.opIndex = t.opIndex), t.holder !== void 0 && (this.holder = t.holder), t.holders !== void 0 && (this.holders = t.holders);
1207
1227
  }
1208
1228
  };
1209
1229
  // ../types/src/guards.ts
1210
- function zt(e) {
1230
+ function Ut(e) {
1211
1231
  return e.type === "section";
1212
1232
  }
1213
- function Bt(e) {
1233
+ function Wt(e) {
1214
1234
  return e.type === "title";
1215
1235
  }
1216
- function Vt(e) {
1236
+ function Gt(e) {
1217
1237
  return e.type === "paragraph";
1218
1238
  }
1219
- function Ht(e) {
1239
+ function Kt(e) {
1220
1240
  return e.type === "image";
1221
1241
  }
1222
- function Ut(e) {
1242
+ function qt(e) {
1223
1243
  return e.type === "button";
1224
1244
  }
1225
- function Wt(e) {
1245
+ function Jt(e) {
1226
1246
  return e.type === "divider";
1227
1247
  }
1228
- function Gt(e) {
1248
+ function Yt(e) {
1229
1249
  return e.type === "video";
1230
1250
  }
1231
- function Kt(e) {
1251
+ function Xt(e) {
1232
1252
  return e.type === "social";
1233
1253
  }
1234
- function qt(e) {
1254
+ function Zt(e) {
1235
1255
  return e.type === "spacer";
1236
1256
  }
1237
- function Jt(e) {
1257
+ function Qt(e) {
1238
1258
  return e.type === "html";
1239
1259
  }
1240
- function Yt(e) {
1260
+ function $t(e) {
1241
1261
  return e.type === "menu";
1242
1262
  }
1243
- function Xt(e) {
1263
+ function en(e) {
1244
1264
  return e.type === "table";
1245
1265
  }
1246
- function Zt(e) {
1266
+ function tn(e) {
1247
1267
  return e.type === "countdown";
1248
1268
  }
1249
- function Qt(e) {
1269
+ function nn(e) {
1250
1270
  return e.type === "custom";
1251
1271
  }
1252
- function z(e) {
1272
+ function B(e) {
1253
1273
  return e.type === "slot";
1254
1274
  }
1255
- function B(e) {
1275
+ function V(e) {
1256
1276
  return e.type === "wrapper";
1257
1277
  }
1258
1278
  // ../types/src/defaults.ts
1259
- var $t = {
1279
+ var rn = {
1260
1280
  content: "<p>Enter your title</p>",
1261
1281
  level: 2,
1262
1282
  textAlign: "left"
1263
- }, en = { content: "<p>Enter your text here</p>" }, tn = {
1283
+ }, an = { content: "<p>Enter your text here</p>" }, on = {
1264
1284
  src: "",
1265
1285
  alt: "",
1266
1286
  width: "full",
1267
1287
  align: "center"
1268
- }, nn = {
1288
+ }, sn = {
1269
1289
  text: "Click Here",
1270
1290
  url: "",
1271
1291
  backgroundColor: "#333333",
@@ -1279,36 +1299,36 @@ var $t = {
1279
1299
  left: 24
1280
1300
  },
1281
1301
  align: "center"
1282
- }, rn = {
1302
+ }, cn = {
1283
1303
  lineStyle: "solid",
1284
1304
  color: "#e0e0e0",
1285
1305
  thickness: 1,
1286
1306
  width: "full"
1287
- }, an = { columns: "1" }, on = {
1307
+ }, ln = { columns: "1" }, un = {
1288
1308
  url: "",
1289
1309
  thumbnailUrl: "",
1290
1310
  alt: "Video",
1291
1311
  width: "full",
1292
1312
  align: "center"
1293
- }, sn = {
1313
+ }, dn = {
1294
1314
  iconStyle: "solid",
1295
1315
  iconSize: "medium",
1296
1316
  spacing: 10,
1297
1317
  align: "center"
1298
- }, cn = { height: 24 }, ln = { content: "" }, un = {
1318
+ }, fn = { height: 24 }, pn = { content: "" }, mn = {
1299
1319
  fontSize: 15,
1300
1320
  textAlign: "center",
1301
1321
  separator: "|",
1302
1322
  separatorColor: "#e0e0e0",
1303
1323
  spacing: 10
1304
- }, dn = {
1324
+ }, hn = {
1305
1325
  hasHeaderRow: !0,
1306
1326
  borderColor: "#e0e0e0",
1307
1327
  borderWidth: 1,
1308
1328
  cellPadding: 8,
1309
1329
  fontSize: 15,
1310
1330
  textAlign: "left"
1311
- }, fn = {
1331
+ }, gn = {
1312
1332
  targetDate: "",
1313
1333
  timezone: "UTC",
1314
1334
  showDays: !0,
@@ -1328,21 +1348,21 @@ var $t = {
1328
1348
  expiredMessage: "This offer has expired",
1329
1349
  expiredImageUrl: "",
1330
1350
  hideOnExpiry: !1
1331
- }, pn = {
1332
- title: $t,
1333
- paragraph: en,
1334
- image: tn,
1335
- button: nn,
1336
- divider: rn,
1337
- section: an,
1338
- video: on,
1339
- social: sn,
1340
- spacer: cn,
1341
- html: ln,
1342
- menu: un,
1343
- table: dn,
1344
- countdown: fn
1345
- }, mn = {
1351
+ }, _n = {
1352
+ title: rn,
1353
+ paragraph: an,
1354
+ image: on,
1355
+ button: sn,
1356
+ divider: cn,
1357
+ section: ln,
1358
+ video: un,
1359
+ social: dn,
1360
+ spacer: fn,
1361
+ html: pn,
1362
+ menu: mn,
1363
+ table: hn,
1364
+ countdown: gn
1365
+ }, vn = {
1346
1366
  width: 600,
1347
1367
  backgroundColor: "#ffffff",
1348
1368
  textColor: "#1a1a1a",
@@ -1350,30 +1370,30 @@ var $t = {
1350
1370
  fontFamily: "Arial",
1351
1371
  locale: "en"
1352
1372
  };
1353
- function hn(e) {
1373
+ function yn(e) {
1354
1374
  return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
1355
1375
  }
1356
- function gn(e, t) {
1376
+ function bn(e, t) {
1357
1377
  let n = { ...e };
1358
1378
  for (let r of Object.keys(t)) {
1359
1379
  let i = e[r], a = t[r];
1360
- a !== void 0 && (n[r] = hn(i) && hn(a) ? gn(i, a) : a);
1380
+ a !== void 0 && (n[r] = yn(i) && yn(a) ? bn(i, a) : a);
1361
1381
  }
1362
1382
  return n;
1363
1383
  }
1364
1384
  // ../types/src/template.ts
1365
- function _n(e = "Arial", t) {
1385
+ function xn(e = "Arial", t) {
1366
1386
  return {
1367
1387
  blocks: [],
1368
1388
  settings: {
1369
- ...mn,
1389
+ ...vn,
1370
1390
  fontFamily: e,
1371
1391
  ...t
1372
1392
  }
1373
1393
  };
1374
1394
  }
1375
1395
  // ../types/src/direction.ts
1376
- var vn = [
1396
+ var Sn = [
1377
1397
  "ar",
1378
1398
  "he",
1379
1399
  "iw",
@@ -1387,16 +1407,16 @@ var vn = [
1387
1407
  "ckb",
1388
1408
  "ks"
1389
1409
  ];
1390
- function yn(e) {
1410
+ function Cn(e) {
1391
1411
  let t = e?.trim().replace(/_/g, "-").split("-")[0]?.toLowerCase();
1392
- return !!t && vn.includes(t);
1412
+ return !!t && Sn.includes(t);
1393
1413
  }
1394
- function bn(e) {
1395
- return e.direction === "ltr" || e.direction === "rtl" ? e.direction : yn(e.locale) ? "rtl" : "ltr";
1414
+ function wn(e) {
1415
+ return e.direction === "ltr" || e.direction === "rtl" ? e.direction : Cn(e.locale) ? "rtl" : "ltr";
1396
1416
  }
1397
1417
  // ../types/src/translation.ts
1398
- var xn = 2e4, Sn = /* @__PURE__ */ new Set(["\"", "'"]);
1399
- function V(e, t) {
1418
+ var Tn = 2e4, En = /* @__PURE__ */ new Set(["\"", "'"]);
1419
+ function Dn(e, t) {
1400
1420
  let n = null, r = "tag";
1401
1421
  for (let i = t; i < e.length; i++) {
1402
1422
  let t = e[i];
@@ -1404,7 +1424,7 @@ function V(e, t) {
1404
1424
  else {
1405
1425
  if (r === "beforeValue") {
1406
1426
  if (H(t)) continue;
1407
- if (Sn.has(t)) {
1427
+ if (En.has(t)) {
1408
1428
  n = t, r = "tag";
1409
1429
  continue;
1410
1430
  }
@@ -1419,12 +1439,12 @@ function V(e, t) {
1419
1439
  }
1420
1440
  return -1;
1421
1441
  }
1422
- function Cn(e, t) {
1442
+ function On(e, t) {
1423
1443
  let n = null;
1424
1444
  for (let r = t; r < e.length; r++) {
1425
1445
  let t = e[r];
1426
1446
  if (n !== null) t === n && (n = null);
1427
- else if (Sn.has(t)) n = t;
1447
+ else if (En.has(t)) n = t;
1428
1448
  else if (t === ">") return {
1429
1449
  end: r,
1430
1450
  nextSpan: -1
@@ -1439,13 +1459,13 @@ function Cn(e, t) {
1439
1459
  nextSpan: -1
1440
1460
  };
1441
1461
  }
1442
- function wn(e) {
1462
+ function kn(e) {
1443
1463
  return e !== " " && e !== " " && e !== "\n" && e !== "\r" && e !== "\f" && e !== "=" && e !== ">" && e !== "/";
1444
1464
  }
1445
1465
  function H(e) {
1446
1466
  return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
1447
1467
  }
1448
- var Tn = {
1468
+ var An = {
1449
1469
  AMP: "&",
1450
1470
  COPY: "©",
1451
1471
  GT: ">",
@@ -1712,16 +1732,16 @@ function U(e) {
1712
1732
  let n = t[1] === "x" || t[1] === "X" ? Number.parseInt(t.slice(2), 16) : Number.parseInt(t.slice(1), 10);
1713
1733
  return !Number.isFinite(n) || n < 1 || n > 1114111 || n >= 55296 && n <= 57343 ? e : String.fromCodePoint(n);
1714
1734
  }
1715
- return Object.hasOwn(Tn, t) ? Tn[t] : e;
1735
+ return Object.hasOwn(An, t) ? An[t] : e;
1716
1736
  }) : e;
1717
1737
  }
1718
- function En(e, t) {
1738
+ function jn(e, t) {
1719
1739
  let n = t.toLowerCase(), r = 0;
1720
1740
  for (; r < e.length;) {
1721
1741
  for (; r < e.length && (H(e[r]) || e[r] === "/");) r++;
1722
1742
  if (r >= e.length) break;
1723
1743
  let t = r;
1724
- for (; r < e.length && wn(e[r]);) r++;
1744
+ for (; r < e.length && kn(e[r]);) r++;
1725
1745
  let i = e.substring(t, r).toLowerCase();
1726
1746
  if (i === "") {
1727
1747
  r++;
@@ -1731,7 +1751,7 @@ function En(e, t) {
1731
1751
  if (e[r] !== "=") continue;
1732
1752
  for (r++; r < e.length && H(e[r]);) r++;
1733
1753
  let a = e[r];
1734
- if (Sn.has(a)) {
1754
+ if (En.has(a)) {
1735
1755
  let t = r + 1, o = e.indexOf(a, t);
1736
1756
  if (o === -1) return null;
1737
1757
  if (i === n) return U(e.substring(t, o));
@@ -1745,15 +1765,15 @@ function En(e, t) {
1745
1765
  return null;
1746
1766
  }
1747
1767
  // ../types/src/merge-tag-html.ts
1748
- function Dn(e) {
1749
- return An(e, (e) => e, !1);
1768
+ function Mn(e) {
1769
+ return Fn(e, (e) => e, !1);
1750
1770
  }
1751
- function On(e, t) {
1752
- return An(e, t, !0);
1771
+ function Nn(e, t) {
1772
+ return Fn(e, t, !0);
1753
1773
  }
1754
- function kn(e) {
1774
+ function Pn(e) {
1755
1775
  let t = [];
1756
- return An(e, (n, r, i) => {
1776
+ return Fn(e, (n, r, i) => {
1757
1777
  let a = e.slice(r, i);
1758
1778
  return t.push({
1759
1779
  start: r,
@@ -1762,7 +1782,7 @@ function kn(e) {
1762
1782
  }), a;
1763
1783
  }, !0), t;
1764
1784
  }
1765
- function An(e, t, n) {
1785
+ function Fn(e, t, n) {
1766
1786
  let r = "", i = 0;
1767
1787
  for (; i < e.length;) {
1768
1788
  let a = e.indexOf("<span", i);
@@ -1775,7 +1795,7 @@ function An(e, t, n) {
1775
1795
  r += e.substring(i, a + 5), i = a + 5;
1776
1796
  continue;
1777
1797
  }
1778
- let { end: s, nextSpan: c } = Cn(e, a + 5);
1798
+ let { end: s, nextSpan: c } = On(e, a + 5);
1779
1799
  if (c !== -1) {
1780
1800
  r += e.substring(i, c), i = c;
1781
1801
  continue;
@@ -1784,12 +1804,12 @@ function An(e, t, n) {
1784
1804
  r += e.substring(i);
1785
1805
  break;
1786
1806
  }
1787
- let l = e.substring(a + 5, s), u = Mn(l, "data-merge-tag") ?? Mn(l, "data-logic-merge-tag");
1807
+ let l = e.substring(a + 5, s), u = Ln(l, "data-merge-tag") ?? Ln(l, "data-logic-merge-tag");
1788
1808
  if (u === null) {
1789
1809
  r += e.substring(i, s + 1), i = s + 1;
1790
1810
  continue;
1791
1811
  }
1792
- let d = jn(e, s + 1, n);
1812
+ let d = In(e, s + 1, n);
1793
1813
  if (d === -1) {
1794
1814
  r += e.substring(i);
1795
1815
  break;
@@ -1798,7 +1818,7 @@ function An(e, t, n) {
1798
1818
  }
1799
1819
  return r;
1800
1820
  }
1801
- function jn(e, t, n) {
1821
+ function In(e, t, n) {
1802
1822
  if (!n) {
1803
1823
  let n = e.indexOf("</span>", t);
1804
1824
  return n === -1 ? -1 : n + 7;
@@ -1807,7 +1827,7 @@ function jn(e, t, n) {
1807
1827
  for (; i < e.length;) {
1808
1828
  let t = e.indexOf("<", i);
1809
1829
  if (t === -1) return -1;
1810
- let n = V(e, t + 1);
1830
+ let n = Dn(e, t + 1);
1811
1831
  if (n === -1) return -1;
1812
1832
  let a = e.startsWith("</span", t), o = e.startsWith("<span", t), s = e[t + (a ? 6 : 5)];
1813
1833
  if ((o || a) && (s === ">" || s === "/" || /\s/.test(s)) && (r += a ? -1 : 1, r === 0)) return n + 1;
@@ -1815,8 +1835,8 @@ function jn(e, t, n) {
1815
1835
  }
1816
1836
  return -1;
1817
1837
  }
1818
- function Mn(e, t) {
1819
- return En(e, t);
1838
+ function Ln(e, t) {
1839
+ return jn(e, t);
1820
1840
  }
1821
1841
  // ../types/src/merge-tags.ts
1822
1842
  var W = {
@@ -1851,7 +1871,7 @@ function G(e) {
1851
1871
  return (e.value === n.value || e.value.source === n.value.source && e.value.flags.replace(/[gy]/g, "") === n.value.flags.replace(/[gy]/g, "")) && (e.logic === n.logic || e.logic.source === n.logic.source && e.logic.flags.replace(/[gy]/g, "") === n.logic.flags.replace(/[gy]/g, ""));
1852
1872
  });
1853
1873
  }
1854
- function Nn(e, t, n) {
1874
+ function Rn(e, t, n) {
1855
1875
  for (let r = n; r < e.length; r++) {
1856
1876
  let n = e.charCodeAt(r);
1857
1877
  if (n === 10 || n === 13 || n === 8232 || n === 8233) return {
@@ -1893,7 +1913,7 @@ function K(e, t, n, r = 0, i = Infinity) {
1893
1913
  let r = u?.lastIndex ?? t + s.length, i = a === "mailchimp" && n === "value" ? {
1894
1914
  close: e.startsWith(c, r) ? r : -1,
1895
1915
  lineBreak: -1
1896
- } : Nn(e, c, Math.max(r, t + s.length + +(n === "value")));
1916
+ } : Rn(e, c, Math.max(r, t + s.length + +(n === "value")));
1897
1917
  if (i.lineBreak >= 0) {
1898
1918
  let r = i.lineBreak, o = n === "logic" && (a === "liquid" || a === "ampscript") ? e.lastIndexOf(s, r) : -1;
1899
1919
  p = o > t ? o : r + 1;
@@ -1915,7 +1935,7 @@ function K(e, t, n, r = 0, i = Infinity) {
1915
1935
  }
1916
1936
  return f;
1917
1937
  }
1918
- function Pn(e, t) {
1938
+ function zn(e, t) {
1919
1939
  let n = G(t);
1920
1940
  if (!n) {
1921
1941
  let n = RegExp(`(${t.value.source}|${t.logic.source})`, "g");
@@ -1943,7 +1963,7 @@ function Pn(e, t) {
1943
1963
  o = t + 2;
1944
1964
  continue;
1945
1965
  }
1946
- let c = Nn(e, "|*", a.lastIndex);
1966
+ let c = Rn(e, "|*", a.lastIndex);
1947
1967
  if (c.lineBreak >= 0) {
1948
1968
  o = c.lineBreak + 1;
1949
1969
  continue;
@@ -1965,71 +1985,71 @@ function Pn(e, t) {
1965
1985
  }
1966
1986
  return r;
1967
1987
  }
1968
- function Fn(e) {
1988
+ function Bn(e) {
1969
1989
  return typeof e == "string" && e.trim() !== "" ? e : null;
1970
1990
  }
1971
- function In(e) {
1991
+ function Vn(e) {
1972
1992
  return Object.values(W).find((t) => t.value.source === e.value.source) ?? null;
1973
1993
  }
1974
- function Ln(e) {
1975
- return Fn(e.opener) ?? In(e)?.opener ?? null;
1994
+ function Hn(e) {
1995
+ return Bn(e.opener) ?? Vn(e)?.opener ?? null;
1976
1996
  }
1977
- function Rn(e) {
1978
- return Fn(e.closer) ?? In(e)?.closer ?? null;
1997
+ function Un(e) {
1998
+ return Bn(e.closer) ?? Vn(e)?.closer ?? null;
1979
1999
  }
1980
- function zn(e) {
2000
+ function Wn(e) {
1981
2001
  return e ? typeof e == "string" ? W[e] ?? W.liquid : e : W.liquid;
1982
2002
  }
1983
- function Bn(e) {
2003
+ function Gn(e) {
1984
2004
  let t = e.source, n = e.flags.replace("g", "");
1985
2005
  return RegExp(`^${t}$`, n);
1986
2006
  }
1987
- function Vn(e, t) {
2007
+ function Kn(e, t) {
1988
2008
  let n = e?.trim() || "";
1989
- return !Bn(t.logic).test(n) && Bn(t.value).test(n);
2009
+ return !Gn(t.logic).test(n) && Gn(t.value).test(n);
1990
2010
  }
1991
- function Hn(e, t) {
2011
+ function qn(e, t) {
1992
2012
  let n = t.find((t) => t.value === e);
1993
2013
  return n ? n.label : e;
1994
2014
  }
1995
- function Un(e, t) {
1996
- return $n(e, "data-merge-tag", (e) => Hn(e, t));
2015
+ function Jn(e, t) {
2016
+ return ir(e, "data-merge-tag", (e) => qn(e, t));
1997
2017
  }
1998
- function Wn(e, t) {
2018
+ function Yn(e, t) {
1999
2019
  return t.find((t) => t.value === e)?.sample;
2000
2020
  }
2001
- function Gn(e, t) {
2002
- return $n(e, "data-merge-tag", (e) => Jn(Wn(e, t) ?? Hn(e, t)), { unwrap: (e) => Wn(e, t) !== void 0 });
2021
+ function Xn(e, t) {
2022
+ return ir(e, "data-merge-tag", (e) => $n(Yn(e, t) ?? qn(e, t)), { unwrap: (e) => Yn(e, t) !== void 0 });
2003
2023
  }
2004
- function Kn(e) {
2024
+ function Zn(e) {
2005
2025
  return e.some((e) => e.sample !== void 0);
2006
2026
  }
2007
- function qn(e, t) {
2027
+ function Qn(e, t) {
2008
2028
  if (!e) return e;
2009
2029
  let n = e;
2010
2030
  for (let e of t) e.sample !== void 0 && (n = n.split(e.value).join(e.sample));
2011
2031
  return n;
2012
2032
  }
2013
- function Jn(e) {
2033
+ function $n(e) {
2014
2034
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
2015
2035
  }
2016
- function Yn(e, t) {
2036
+ function er(e, t) {
2017
2037
  if (!e) return !1;
2018
2038
  if (G(t)) return K(e, t, "value", 0, 1).length > 0 || K(e, t, "logic", 0, 1).length > 0;
2019
2039
  let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
2020
2040
  return n.test(e) || r.test(e);
2021
2041
  }
2022
- function Xn(e, t) {
2023
- return Bn(t.logic).test(e?.trim() || "");
2042
+ function tr(e, t) {
2043
+ return Gn(t.logic).test(e?.trim() || "");
2024
2044
  }
2025
- function Zn(e, t) {
2045
+ function nr(e, t) {
2026
2046
  let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
2027
2047
  return r && r[1] ? r[1].toUpperCase() : e;
2028
2048
  }
2029
- function Qn(e, t) {
2030
- return $n(e, "data-logic-merge-tag", (e) => Zn(e, t));
2049
+ function rr(e, t) {
2050
+ return ir(e, "data-logic-merge-tag", (e) => nr(e, t));
2031
2051
  }
2032
- function $n(e, t, n, r) {
2052
+ function ir(e, t, n, r) {
2033
2053
  let i = "", a = 0;
2034
2054
  for (; a < e.length;) {
2035
2055
  let o = e.indexOf("<span", a);
@@ -2042,7 +2062,7 @@ function $n(e, t, n, r) {
2042
2062
  i += e.substring(a, o + 5), a = o + 5;
2043
2063
  continue;
2044
2064
  }
2045
- let { end: c, nextSpan: l } = Cn(e, o + 5);
2065
+ let { end: c, nextSpan: l } = On(e, o + 5);
2046
2066
  if (l !== -1) {
2047
2067
  i += e.substring(a, l), a = l;
2048
2068
  continue;
@@ -2051,7 +2071,7 @@ function $n(e, t, n, r) {
2051
2071
  i += e.substring(a);
2052
2072
  break;
2053
2073
  }
2054
- let u = En(e.substring(o + 5, c), t);
2074
+ let u = jn(e.substring(o + 5, c), t);
2055
2075
  if (u === null) {
2056
2076
  i += e.substring(a, c + 1), a = c + 1;
2057
2077
  continue;
@@ -2067,14 +2087,14 @@ function $n(e, t, n, r) {
2067
2087
  return i;
2068
2088
  }
2069
2089
  // ../types/src/locale-strings.ts
2070
- var er = {
2090
+ var ar = {
2071
2091
  title: ["content"],
2072
2092
  paragraph: ["content"]
2073
2093
  };
2074
- function tr(e) {
2094
+ function or(e) {
2075
2095
  let t = [], n = /<[a-z][\w:-]*\b/gi;
2076
2096
  for (; n.exec(e);) {
2077
- let r = V(e, n.lastIndex);
2097
+ let r = Dn(e, n.lastIndex);
2078
2098
  if (r < 0) break;
2079
2099
  let i = n.lastIndex, a = e.slice(i, r), o = /[^\s"'<>/=]+\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/g;
2080
2100
  for (let e; e = o.exec(a);) {
@@ -2088,39 +2108,43 @@ function tr(e) {
2088
2108
  }
2089
2109
  return t;
2090
2110
  }
2091
- function nr(e, t, n) {
2092
- let r = n === "html" ? kn(e) : [], i = n === "html" ? tr(e) : [], a = r.map((e) => ({
2111
+ function sr(e, t, n) {
2112
+ let r = n === "html" ? Pn(e) : [], i = n === "html" ? or(e) : [], a = r.map((e) => ({
2093
2113
  ...e,
2094
2114
  attribute: !1
2095
2115
  })), o = 0, s = G(t) !== void 0, c = (n, r) => {
2096
- let c = e.slice(n, r), l = ["logic", "value"], u = s ? l.map((e) => K(c, t, e, 0, 1)[0]) : null, d = s ? null : [t.logic, t.value].map((e) => new RegExp(e.source, e.flags.replace(/[gy]/g, "") + "g")), f = 0;
2116
+ let c = e.slice(n, r), l = ["logic", "value"], u = s ? l.map((e) => K(c, t, e, 0, 1)[0]) : [void 0, void 0], d = s ? null : [t.logic, t.value].map((e) => new RegExp(e.source, e.flags.replace(/[gy]/g, "") + "g")), f = 0;
2097
2117
  for (; f < c.length;) {
2098
- let e = s ? u.flatMap((e) => e ? [e] : []) : d.flatMap((e) => {
2099
- e.lastIndex = f;
2100
- let t = e.exec(c);
2101
- for (; t && t[0].length === 0;) e.lastIndex = t.index + 1, t = e.exec(c);
2102
- return t ? [{
2103
- index: t.index,
2104
- value: t[0]
2105
- }] : [];
2118
+ let e = s ? u.flatMap((e) => e ? [e] : []) : d.flatMap((e, t) => {
2119
+ let n = u[t];
2120
+ if (n === void 0 || n !== null && n.index < f) {
2121
+ e.lastIndex = f;
2122
+ let n = e.exec(c);
2123
+ for (; n && n[0].length === 0;) e.lastIndex = n.index + 1, n = e.exec(c);
2124
+ u[t] = n ? {
2125
+ index: n.index,
2126
+ value: n[0]
2127
+ } : null;
2128
+ }
2129
+ return u[t] ? [u[t]] : [];
2106
2130
  });
2107
2131
  e.sort((e, t) => e.index - t.index || e.value.length - t.value.length);
2108
2132
  let r = e[0];
2109
2133
  if (!r) break;
2110
- let p = n + r.index, m = p + r.value.length;
2134
+ let p = n + r.index, ee = p + r.value.length;
2111
2135
  for (; i[o]?.end <= p;) o++;
2112
2136
  if (a.push({
2113
2137
  start: p,
2114
- end: m,
2138
+ end: ee,
2115
2139
  markup: r.value,
2116
- attribute: i[o] !== void 0 && p >= i[o].start && m <= i[o].end
2140
+ attribute: i[o] !== void 0 && p >= i[o].start && ee <= i[o].end
2117
2141
  }), f = r.index + r.value.length, s) for (let e = 0; e < l.length; e++) u[e] && u[e].index < f && (u[e] = K(c, t, l[e], f, 1)[0]);
2118
2142
  }
2119
2143
  }, l = 0;
2120
2144
  for (let e of r) c(l, e.start), l = e.end;
2121
2145
  return c(l, e.length), a.sort((e, t) => e.start - t.start);
2122
2146
  }
2123
- function rr(e) {
2147
+ function cr(e) {
2124
2148
  if (!e.includes("&")) return { text: e };
2125
2149
  let t = "", n = [0], r = 0, i = (i) => {
2126
2150
  for (t += e.slice(r, i); r < i;) n.push(++r);
@@ -2137,17 +2161,17 @@ function rr(e) {
2137
2161
  offsets: n
2138
2162
  };
2139
2163
  }
2140
- var q = /* @__PURE__ */ new Map(), ir = 32;
2141
- function ar(e) {
2164
+ var q = /* @__PURE__ */ new Map(), lr = 32;
2165
+ function ur(e) {
2142
2166
  let t = JSON.stringify(e), n = q.get(t);
2143
2167
  if (n === void 0) {
2144
2168
  let r = e.map((e) => e.trim()).filter(Boolean).sort((e, t) => t.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
2145
- n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null, q.size >= ir && q.delete(q.keys().next().value), q.set(t, n);
2169
+ n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null, q.size >= lr && q.delete(q.keys().next().value), q.set(t, n);
2146
2170
  }
2147
2171
  return n;
2148
2172
  }
2149
- function or(e, t, n) {
2150
- let r = n.length ? ar(n) : null;
2173
+ function dr(e, t, n) {
2174
+ let r = n.length ? ur(n) : null;
2151
2175
  if (!r) return [];
2152
2176
  let i = [];
2153
2177
  if (t === "text") i.push({
@@ -2156,7 +2180,7 @@ function or(e, t, n) {
2156
2180
  attribute: !1
2157
2181
  });
2158
2182
  else {
2159
- i.push(...tr(e).map((e) => ({
2183
+ i.push(...or(e).map((e) => ({
2160
2184
  ...e,
2161
2185
  attribute: !0
2162
2186
  })));
@@ -2167,7 +2191,7 @@ function or(e, t, n) {
2167
2191
  end: r.index,
2168
2192
  attribute: !1
2169
2193
  });
2170
- let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) : V(e, t.lastIndex);
2194
+ let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) : Dn(e, t.lastIndex);
2171
2195
  if (a < 0) return [];
2172
2196
  n = a + (r[0] === "<!--" ? 3 : 1), t.lastIndex = n;
2173
2197
  }
@@ -2180,7 +2204,7 @@ function or(e, t, n) {
2180
2204
  let a = [];
2181
2205
  for (let n of i) {
2182
2206
  r.lastIndex = 0;
2183
- let i = e.slice(n.start, n.end), o = t === "html" ? rr(i) : {
2207
+ let i = e.slice(n.start, n.end), o = t === "html" ? cr(i) : {
2184
2208
  text: i,
2185
2209
  offsets: void 0
2186
2210
  };
@@ -2199,51 +2223,51 @@ function or(e, t, n) {
2199
2223
  }
2200
2224
  return a;
2201
2225
  }
2202
- function sr(e, t, n, r) {
2203
- let i = nr(e, t, n), a = or(e, n, r?.doNotTranslate ?? []).filter((e) => !i.some((t) => e.start < t.end && e.end > t.start));
2226
+ function fr(e, t, n, r) {
2227
+ let i = sr(e, t, n), a = dr(e, n, r?.doNotTranslate ?? []).filter((e) => !i.some((t) => e.start < t.end && e.end > t.start));
2204
2228
  return [...i, ...a].sort((e, t) => e.start - t.start);
2205
2229
  }
2206
- function cr(e, t, n) {
2230
+ function pr(e, t, n) {
2207
2231
  let r = "", i = 0;
2208
2232
  return t.forEach((t, a) => {
2209
2233
  r += e.slice(i, t.start), r += t.attribute ? `__x${n[a]}__` : `<x id="${n[a]}"/>`, i = t.end;
2210
2234
  }), r + e.slice(i);
2211
2235
  }
2212
- function lr(e, t, n, r) {
2213
- let i = sr(e, t, n, r);
2236
+ function mr(e, t, n, r) {
2237
+ let i = fr(e, t, n, r);
2214
2238
  return {
2215
- text: cr(e, i, i.map((e, t) => t + 1)),
2239
+ text: pr(e, i, i.map((e, t) => t + 1)),
2216
2240
  tokens: i.map((e) => e.markup)
2217
2241
  };
2218
2242
  }
2219
- function ur(e, t) {
2243
+ function hr(e, t) {
2220
2244
  let n = /* @__PURE__ */ new Set(), r = !0, i = e.replace(/<x id="(\d+)"\s*\/>|<x id="(\d+)"><\/x>|__x(\d+)__/g, (e, i, a, o) => {
2221
2245
  let s = Number(i ?? a ?? o);
2222
2246
  return (s < 1 || s > t.length || n.has(s)) && (r = !1), n.add(s), t[s - 1] ?? "";
2223
2247
  });
2224
2248
  return r && n.size === t.length ? i : null;
2225
2249
  }
2226
- function dr(e, t, n, r, i) {
2227
- let a = sr(e, n, r, i), o = /* @__PURE__ */ new Set(), s = (e) => {
2250
+ function gr(e, t, n, r, i) {
2251
+ let a = fr(e, n, r, i), o = /* @__PURE__ */ new Set(), s = (e) => {
2228
2252
  let n = t.findIndex((t, n) => !o.has(n) && e(t));
2229
2253
  return n >= 0 && o.add(n), n;
2230
2254
  }, c = a.map((e) => s((t) => t === e.markup));
2231
2255
  return a.forEach((e, t) => {
2232
2256
  c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) => U(t) === e.term));
2233
- }), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null : cr(e, a.filter((e, t) => c[t] >= 0), c.filter((e) => e >= 0).map((e) => e + 1));
2257
+ }), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null : pr(e, a.filter((e, t) => c[t] >= 0), c.filter((e) => e >= 0).map((e) => e + 1));
2234
2258
  }
2235
- function fr(e, t, n = []) {
2259
+ function _r(e, t, n = []) {
2236
2260
  let r = /* @__PURE__ */ new Map();
2237
- if (t === T(e) || !e.settings.locales?.includes(t)) return r;
2261
+ if (t === w(e) || !e.settings.locales?.includes(t)) return r;
2238
2262
  let i = (e, n, i, a) => {
2239
2263
  let o = n.l10n?.[t];
2240
2264
  for (let t of i) {
2241
- let i = b(n, t);
2265
+ let i = y(n, t);
2242
2266
  typeof i != "string" || i === "" || Object.keys(o?.set ?? {}).some((e) => e === t || t.startsWith(`${e}.`)) || r.set(`${e.kind === "block" ? e.blockId : "settings"}/${t}`, {
2243
2267
  target: e,
2244
2268
  path: t,
2245
2269
  source: i,
2246
- format: a && er[a]?.includes(t) ? "html" : "text",
2270
+ format: a && ar[a]?.includes(t) ? "html" : "text",
2247
2271
  text: o?.text?.[t]
2248
2272
  });
2249
2273
  }
@@ -2252,22 +2276,22 @@ function fr(e, t, n = []) {
2252
2276
  if (r.type !== "html" && i({
2253
2277
  kind: "block",
2254
2278
  blockId: r.id
2255
- }, r, S(r, n), r.type), r.type === "section") for (let e of r.children) a(e);
2279
+ }, r, x(r, n), r.type), r.type === "section") for (let e of r.children) a(e);
2256
2280
  else r.type === "wrapper" && a(r.children);
2257
2281
  }
2258
2282
  };
2259
- return a(e.blocks), i({ kind: "settings" }, e.settings, _), r;
2283
+ return a(e.blocks), i({ kind: "settings" }, e.settings, g), r;
2260
2284
  }
2261
- function pr(e, t, n) {
2262
- let r = n.only === "all" ? null : Ae(e, t, n.definitions), i = r && /* @__PURE__ */ new Set([...r.missing, ...r.stale]), a = [], o = {};
2263
- for (let [r, s] of fr(e, t, n.definitions)) {
2285
+ function vr(e, t, n) {
2286
+ let r = n.only === "all" ? null : Pe(e, t, n.definitions), i = r && /* @__PURE__ */ new Set([...r.missing, ...r.stale]), a = [], o = {};
2287
+ for (let [r, s] of _r(e, t, n.definitions)) {
2264
2288
  if (i && !i.has(r) || n.blockId !== void 0 && (s.target.kind !== "block" || s.target.blockId !== n.blockId)) continue;
2265
- let e = lr(s.source, n.syntax, s.format, n), t = s.text ? dr(s.text.value, e.tokens, n.syntax, s.format, n) : void 0;
2289
+ let e = mr(s.source, n.syntax, s.format, n), t = s.text ? gr(s.text.value, e.tokens, n.syntax, s.format, n) : void 0;
2266
2290
  a.push({
2267
2291
  id: r,
2268
2292
  format: s.format,
2269
2293
  source: e.text,
2270
- sourceHash: C(s.source),
2294
+ sourceHash: S(s.source),
2271
2295
  ...t == null ? {} : { text: t }
2272
2296
  }), o[r] = e.tokens;
2273
2297
  }
@@ -2276,8 +2300,8 @@ function pr(e, t, n) {
2276
2300
  tokens: o
2277
2301
  };
2278
2302
  }
2279
- function mr(e, t, n, r) {
2280
- let i = fr(e, t, r.definitions), a = /* @__PURE__ */ new Map(), o = (e) => {
2303
+ function yr(e, t, n, r) {
2304
+ let i = _r(e, t, r.definitions), a = /* @__PURE__ */ new Map(), o = (e) => {
2281
2305
  for (let t of e) if (a.set(t.id, t), t.type === "section") for (let e of t.children) o(e);
2282
2306
  else t.type === "wrapper" && o(t.children);
2283
2307
  };
@@ -2289,12 +2313,12 @@ function mr(e, t, n, r) {
2289
2313
  let n = t.id.lastIndexOf("/"), r = t.id.slice(0, n), i = r === "settings" ? [a.get(r), e.settings] : [a.get(r)];
2290
2314
  l.push({
2291
2315
  id: t.id,
2292
- reason: n < 0 || !i.some((e) => e && b(e, t.id.slice(n + 1)) !== void 0) ? "unknown_field" : "not_translatable"
2316
+ reason: n < 0 || !i.some((e) => e && y(e, t.id.slice(n + 1)) !== void 0) ? "unknown_field" : "not_translatable"
2293
2317
  });
2294
2318
  continue;
2295
2319
  }
2296
- let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ? ur(t.text, o) : null;
2297
- if (!o || u === null || dr(u, o, r.syntax, n.format, r) === null) {
2320
+ let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ? hr(t.text, o) : null;
2321
+ if (!o || u === null || gr(u, o, r.syntax, n.format, r) === null) {
2298
2322
  l.push({
2299
2323
  id: t.id,
2300
2324
  reason: "tags_changed"
@@ -2324,7 +2348,7 @@ function mr(e, t, n, r) {
2324
2348
  };
2325
2349
  }
2326
2350
  // ../types/src/custom-block-liquid.ts
2327
- function hr(e) {
2351
+ function br(e) {
2328
2352
  return new e.Liquid({
2329
2353
  strictVariables: !1,
2330
2354
  strictFilters: !1,
@@ -2334,16 +2358,16 @@ function hr(e) {
2334
2358
  }
2335
2359
  // ../types/src/factory.ts
2336
2360
  function J(e, t) {
2337
- let n = h(e);
2338
- return !t || Object.keys(t).length === 0 ? n : gn(n, t);
2361
+ let n = m(e);
2362
+ return !t || Object.keys(t).length === 0 ? n : bn(n, t);
2339
2363
  }
2340
2364
  function Y(e) {
2341
- return e === void 0 ? void 0 : h(e);
2365
+ return e === void 0 ? void 0 : m(e);
2342
2366
  }
2343
2367
  function X() {
2344
2368
  return crypto.randomUUID();
2345
2369
  }
2346
- function gr(e = 0) {
2370
+ function xr(e = 0) {
2347
2371
  return {
2348
2372
  top: e,
2349
2373
  right: e,
@@ -2352,100 +2376,100 @@ function gr(e = 0) {
2352
2376
  };
2353
2377
  }
2354
2378
  function Z(e = 10) {
2355
- return { padding: gr(e) };
2379
+ return { padding: xr(e) };
2356
2380
  }
2357
- function _r(e = {}) {
2381
+ function Sr(e = {}) {
2358
2382
  return J({
2359
2383
  id: X(),
2360
2384
  type: "title",
2361
- ...$t,
2385
+ ...rn,
2362
2386
  styles: Z()
2363
2387
  }, e);
2364
2388
  }
2365
- function vr(e = {}) {
2389
+ function Cr(e = {}) {
2366
2390
  return J({
2367
2391
  id: X(),
2368
2392
  type: "paragraph",
2369
- ...en,
2393
+ ...an,
2370
2394
  styles: Z()
2371
2395
  }, e);
2372
2396
  }
2373
- function yr(e = {}) {
2397
+ function wr(e = {}) {
2374
2398
  return J({
2375
2399
  id: X(),
2376
2400
  type: "image",
2377
- ...tn,
2401
+ ...on,
2378
2402
  styles: Z()
2379
2403
  }, e);
2380
2404
  }
2381
- function br(e = {}) {
2405
+ function Tr(e = {}) {
2382
2406
  return J({
2383
2407
  id: X(),
2384
2408
  type: "button",
2385
- ...nn,
2409
+ ...sn,
2386
2410
  styles: Z()
2387
2411
  }, e);
2388
2412
  }
2389
- function xr(e = {}) {
2413
+ function Er(e = {}) {
2390
2414
  return J({
2391
2415
  id: X(),
2392
2416
  type: "divider",
2393
- ...rn,
2417
+ ...cn,
2394
2418
  styles: Z(20)
2395
2419
  }, e);
2396
2420
  }
2397
- function Sr(e = {}) {
2421
+ function Dr(e = {}) {
2398
2422
  return J({
2399
2423
  id: X(),
2400
2424
  type: "section",
2401
- ...an,
2425
+ ...ln,
2402
2426
  children: [[]],
2403
2427
  styles: Z(20)
2404
2428
  }, e);
2405
2429
  }
2406
- function Cr(e = {}) {
2430
+ function Or(e = {}) {
2407
2431
  return J({
2408
2432
  id: X(),
2409
2433
  type: "video",
2410
- ...on,
2434
+ ...un,
2411
2435
  styles: Z()
2412
2436
  }, e);
2413
2437
  }
2414
- function wr(e = {}) {
2438
+ function kr(e = {}) {
2415
2439
  return J({
2416
2440
  id: X(),
2417
2441
  type: "social",
2418
2442
  icons: [],
2419
- ...sn,
2443
+ ...dn,
2420
2444
  styles: Z()
2421
2445
  }, e);
2422
2446
  }
2423
- function Tr(e = {}) {
2447
+ function Ar(e = {}) {
2424
2448
  return J({
2425
2449
  id: X(),
2426
2450
  type: "spacer",
2427
- ...cn,
2451
+ ...fn,
2428
2452
  styles: Z(0)
2429
2453
  }, e);
2430
2454
  }
2431
- function Er(e = {}) {
2455
+ function jr(e = {}) {
2432
2456
  return J({
2433
2457
  id: X(),
2434
2458
  type: "html",
2435
- ...ln,
2459
+ ...pn,
2436
2460
  styles: Z()
2437
2461
  }, e);
2438
2462
  }
2439
- function Dr(e = {}) {
2463
+ function Mr(e = {}) {
2440
2464
  return J({
2441
2465
  id: X(),
2442
2466
  type: "menu",
2443
2467
  items: [],
2444
- ...un,
2468
+ ...mn,
2445
2469
  styles: Z()
2446
2470
  }, e);
2447
2471
  }
2448
- function Or(e, t) {
2472
+ function Nr(e, t) {
2449
2473
  return Array.from({ length: t }, () => ({
2450
2474
  id: X(),
2451
2475
  cells: Array.from({ length: e }, () => ({
@@ -2454,29 +2478,29 @@ function Or(e, t) {
2454
2478
  }))
2455
2479
  }));
2456
2480
  }
2457
- function kr(e = {}) {
2481
+ function Pr(e = {}) {
2458
2482
  return J({
2459
2483
  id: X(),
2460
2484
  type: "table",
2461
- rows: Or(3, 3),
2462
- ...dn,
2485
+ rows: Nr(3, 3),
2486
+ ...hn,
2463
2487
  styles: Z()
2464
2488
  }, e);
2465
2489
  }
2466
- function Ar(e = {}) {
2490
+ function Fr(e = {}) {
2467
2491
  return J({
2468
2492
  id: X(),
2469
2493
  type: "countdown",
2470
- ...fn,
2494
+ ...gn,
2471
2495
  styles: Z()
2472
2496
  }, e);
2473
2497
  }
2474
- function jr(e) {
2498
+ function Ir(e) {
2475
2499
  return e.type === "repeatable" ? e.default ?? [] : e.type === "boolean" ? e.default ?? !1 : e.type === "number" ? e.default ?? 0 : e.default ?? "";
2476
2500
  }
2477
- function Mr(e) {
2501
+ function Lr(e) {
2478
2502
  let t = {};
2479
- for (let n of e.fields) t[n.key] = Y(jr(n));
2503
+ for (let n of e.fields) t[n.key] = Y(Ir(n));
2480
2504
  let n = J(Z(), Y(e.defaultStyles));
2481
2505
  return {
2482
2506
  id: X(),
@@ -2487,14 +2511,14 @@ function Mr(e) {
2487
2511
  ...e.dataSource ? { dataSourceFetched: !1 } : {}
2488
2512
  };
2489
2513
  }
2490
- function Nr() {
2514
+ function Rr() {
2491
2515
  return {
2492
2516
  id: X(),
2493
2517
  type: "slot",
2494
2518
  styles: Z(0)
2495
2519
  };
2496
2520
  }
2497
- function Pr(e = {}) {
2521
+ function zr(e = {}) {
2498
2522
  return J({
2499
2523
  id: X(),
2500
2524
  type: "wrapper",
@@ -2502,27 +2526,27 @@ function Pr(e = {}) {
2502
2526
  styles: Z(0)
2503
2527
  }, e);
2504
2528
  }
2505
- function Fr(e, t) {
2529
+ function Br(e, t) {
2506
2530
  switch (e) {
2507
- case "section": return Sr(Y(t?.section));
2508
- case "title": return _r(Y(t?.title));
2509
- case "paragraph": return vr(Y(t?.paragraph));
2510
- case "image": return yr(Y(t?.image));
2511
- case "button": return br(Y(t?.button));
2512
- case "divider": return xr(Y(t?.divider));
2513
- case "video": return Cr(Y(t?.video));
2514
- case "social": return wr(Y(t?.social));
2515
- case "spacer": return Tr(Y(t?.spacer));
2516
- case "html": return Er(Y(t?.html));
2517
- case "menu": return Dr(Y(t?.menu));
2518
- case "table": return kr(Y(t?.table));
2519
- case "countdown": return Ar(Y(t?.countdown));
2531
+ case "section": return Dr(Y(t?.section));
2532
+ case "title": return Sr(Y(t?.title));
2533
+ case "paragraph": return Cr(Y(t?.paragraph));
2534
+ case "image": return wr(Y(t?.image));
2535
+ case "button": return Tr(Y(t?.button));
2536
+ case "divider": return Er(Y(t?.divider));
2537
+ case "video": return Or(Y(t?.video));
2538
+ case "social": return kr(Y(t?.social));
2539
+ case "spacer": return Ar(Y(t?.spacer));
2540
+ case "html": return jr(Y(t?.html));
2541
+ case "menu": return Mr(Y(t?.menu));
2542
+ case "table": return Pr(Y(t?.table));
2543
+ case "countdown": return Fr(Y(t?.countdown));
2520
2544
  case "slot": throw Error("[Templatical] slot cannot be inserted into content. Use createSlotBlock() to build a layout.");
2521
2545
  case "wrapper": throw Error("[Templatical] wrapper cannot be inserted into content. Use createWrapperBlock() to build a layout.");
2522
2546
  default: throw Error(`Unknown block type: ${e}`);
2523
2547
  }
2524
2548
  }
2525
- function Ir(e, t) {
2549
+ function Vr(e, t) {
2526
2550
  let n = e.l10n;
2527
2551
  if (!n || t.size === 0) return;
2528
2552
  let r = (n) => {
@@ -2552,86 +2576,87 @@ function Q(e) {
2552
2576
  }
2553
2577
  if (t.type === "menu") for (let e of t.items) r(e, "items");
2554
2578
  if (t.type === "social") for (let e of t.icons) r(e, "icons");
2555
- return t.type === "section" && (t.children = t.children.map((e) => e.map((e) => Q(e)))), t.type === "wrapper" && (t.children = t.children.map((e) => Q(e))), Ir(t, n), t;
2579
+ return t.type === "section" && (t.children = t.children.map((e) => e.map((e) => Q(e)))), t.type === "wrapper" && (t.children = t.children.map((e) => Q(e))), Vr(t, n), t;
2556
2580
  }
2557
2581
  // ../types/src/layout.ts
2558
- var Lr = "[Templatical] layout: must contain exactly one slot block", Rr = "[Templatical] layout: slot must be a top-level or wrapper child, not nested in a section", zr = "[Templatical] layout: a wrapper cannot contain a wrapper", Br = "[Templatical] layout: a wrapper around the slot cannot contain blocks that emit mj-wrapper (section.wrapper)", Vr = "[Templatical] slot is not a valid content block", Hr = "[Templatical] wrapper is not a valid content block";
2559
- function $(e, t, n = null, r = !1) {
2560
- for (let i of e) if (t(i, n, r), zt(i)) for (let e of i.children) $(e, t, i, !0);
2561
- else B(i) && $(i.children, t, i, r);
2582
+ var Hr = "[Templatical] layout: must contain exactly one slot block", Ur = "[Templatical] layout: slot must be a top-level or wrapper child, not nested in a section", Wr = "[Templatical] layout: a wrapper cannot contain a wrapper", Gr = "[Templatical] layout: a wrapper around the slot cannot contain blocks that emit mj-wrapper (section.wrapper)", Kr = "[Templatical] slot is not a valid content block", qr = "[Templatical] layout: a wrapper cannot contain a section with its own wrapper (section.wrapper)", Jr = "[Templatical] wrapper is not a valid content block";
2583
+ function $(e, t, n = null, r = !1, i = !1) {
2584
+ for (let a of e) if (t(a, n, r, i), Ut(a)) for (let e of a.children) $(e, t, a, !0, i);
2585
+ else V(a) && $(a.children, t, a, r, !0);
2562
2586
  }
2563
- function Ur(e) {
2587
+ function Yr(e) {
2564
2588
  let t = 0;
2565
- if ($(e.blocks, (e, n, r) => {
2566
- if (z(e) && (t += 1, r)) throw Error(Rr);
2567
- if (B(e)) {
2568
- if (r) throw Error(Rr);
2569
- if (e.children.some(B)) throw Error(zr);
2589
+ if ($(e.blocks, (e, n, r, i) => {
2590
+ if (i && Ut(e) && e.wrapper) throw Error(qr);
2591
+ if (B(e) && (t += 1, r)) throw Error(Ur);
2592
+ if (V(e)) {
2593
+ if (r) throw Error(Ur);
2594
+ if (e.children.some(V)) throw Error(Wr);
2570
2595
  }
2571
- }), t !== 1) throw Error(Lr);
2596
+ }), t !== 1) throw Error(Hr);
2572
2597
  }
2573
- function Wr(e) {
2598
+ function Xr(e) {
2574
2599
  $(e.blocks, (e) => {
2575
- if (z(e)) throw Error(Vr);
2600
+ if (B(e)) throw Error(Kr);
2576
2601
  });
2577
2602
  }
2578
- function Gr(e) {
2603
+ function Zr(e) {
2579
2604
  $(e.blocks, (e) => {
2580
- if (B(e)) throw Error(Hr);
2605
+ if (V(e)) throw Error(Jr);
2581
2606
  });
2582
2607
  }
2583
- function Kr(e) {
2608
+ function Qr(e) {
2584
2609
  let t = !1;
2585
2610
  return $(e.blocks, (e, n) => {
2586
- z(e) && n !== null && B(n) && (t = !0);
2611
+ B(e) && n !== null && V(n) && (t = !0);
2587
2612
  }), t;
2588
2613
  }
2589
- function qr(e) {
2590
- if (z(e)) return e;
2591
- if (B(e)) {
2614
+ function $r(e) {
2615
+ if (B(e)) return e;
2616
+ if (V(e)) {
2592
2617
  let t = Q({
2593
2618
  ...e,
2594
2619
  children: []
2595
2620
  });
2596
- return t.children = e.children.map(qr), t;
2621
+ return t.children = e.children.map($r), t;
2597
2622
  }
2598
2623
  return Q(e);
2599
2624
  }
2600
- function Jr(e) {
2625
+ function ei(e) {
2601
2626
  for (let t = 0; t < e.length; t++) {
2602
2627
  let n = e[t];
2603
- if (z(n)) return {
2628
+ if (B(n)) return {
2604
2629
  parent: e,
2605
2630
  index: t
2606
2631
  };
2607
- if (B(n)) {
2608
- let e = Jr(n.children);
2632
+ if (V(n)) {
2633
+ let e = ei(n.children);
2609
2634
  if (e) return e;
2610
2635
  }
2611
2636
  }
2612
2637
  return null;
2613
2638
  }
2614
- function Yr(e) {
2615
- for (let t of e) if (zt(t)) {
2639
+ function ti(e) {
2640
+ for (let t of e) if (Ut(t)) {
2616
2641
  if (t.wrapper) return !0;
2617
- for (let e of t.children) if (Yr(e)) return !0;
2642
+ for (let e of t.children) if (ti(e)) return !0;
2618
2643
  }
2619
2644
  return !1;
2620
2645
  }
2621
- function Xr(e, t) {
2622
- if (Ur(e), Wr(t), Gr(t), Kr(e) && Yr(t.blocks)) throw Error(Br);
2623
- let n = e.blocks.map(qr), r = Jr(n);
2624
- if (!r) throw Error(Lr);
2625
- return r.parent.splice(r.index, 1, ...h(t.blocks)), {
2646
+ function ni(e, t) {
2647
+ if (Yr(e), Xr(t), Zr(t), Qr(e) && ti(t.blocks)) throw Error(Gr);
2648
+ let n = e.blocks.map($r), r = ei(n);
2649
+ if (!r) throw Error(Hr);
2650
+ return r.parent.splice(r.index, 1, ...m(t.blocks)), {
2626
2651
  blocks: n,
2627
2652
  settings: {
2628
- ...h(t.settings),
2653
+ ...m(t.settings),
2629
2654
  backgroundColor: e.settings.backgroundColor
2630
2655
  }
2631
2656
  };
2632
2657
  }
2633
2658
  // ../types/src/url-policy.ts
2634
- var Zr = Object.freeze([
2659
+ var ri = Object.freeze([
2635
2660
  "http",
2636
2661
  "https",
2637
2662
  "mailto",
@@ -2641,44 +2666,44 @@ var Zr = Object.freeze([
2641
2666
  "sms",
2642
2667
  "xmpp",
2643
2668
  "cid"
2644
- ]), Qr = Object.freeze([
2669
+ ]), ii = Object.freeze([
2645
2670
  "javascript",
2646
2671
  "data",
2647
2672
  "vbscript"
2648
2673
  ]);
2649
- function $r(e) {
2674
+ function ai(e) {
2650
2675
  return e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
2651
2676
  }
2652
- function ei(e) {
2653
- let t = /^([a-z][a-z0-9+.-]*):/i.exec($r(e));
2677
+ function oi(e) {
2678
+ let t = /^([a-z][a-z0-9+.-]*):/i.exec(ai(e));
2654
2679
  return t ? t[1].toLowerCase() : null;
2655
2680
  }
2656
- var ti = /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i, ni = Object.freeze([
2681
+ var si = /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i, ci = Object.freeze([
2657
2682
  "href",
2658
2683
  "xlink:href",
2659
2684
  "background",
2660
2685
  "poster",
2661
2686
  "src"
2662
- ]), ri = Object.freeze([
2687
+ ]), li = Object.freeze([
2663
2688
  "srcdoc",
2664
2689
  "ping",
2665
2690
  "formaction",
2666
2691
  "action"
2667
2692
  ]);
2668
- function ii(e, t) {
2669
- let n = $r(e), r = ei(n);
2670
- return r === null || Zr.some((e) => e === r) ? !0 : t.toLowerCase() === "src" && ti.test(n);
2693
+ function ui(e, t) {
2694
+ let n = ai(e), r = oi(n);
2695
+ return r === null || ri.some((e) => e === r) ? !0 : t.toLowerCase() === "src" && si.test(n);
2671
2696
  }
2672
2697
  // ../types/src/rich-text.ts
2673
- var ai = /<\/?p\b[^<>]*>/gi, oi = /<p\b([^<>]*)>\s*<\/p>/gi;
2674
- function si(e) {
2675
- return e.replace(ai, "").trim() === "";
2698
+ var di = /<\/?p\b[^<>]*>/gi, fi = /<p\b([^<>]*)>\s*<\/p>/gi;
2699
+ function pi(e) {
2700
+ return e.replace(di, "").trim() === "";
2676
2701
  }
2677
- function ci(e) {
2678
- return si(e) ? e : e.replace(oi, "<p$1>&nbsp;</p>");
2702
+ function mi(e) {
2703
+ return pi(e) ? e : e.replace(fi, "<p$1>&nbsp;</p>");
2679
2704
  }
2680
2705
  // ../types/src/fonts.ts
2681
- var li = {
2706
+ var hi = {
2682
2707
  arial: "Arial, sans-serif",
2683
2708
  helvetica: "Helvetica, sans-serif",
2684
2709
  georgia: "Georgia, serif",
@@ -2687,13 +2712,13 @@ var li = {
2687
2712
  "trebuchet ms": "'Trebuchet MS', sans-serif",
2688
2713
  "courier new": "'Courier New', monospace",
2689
2714
  tahoma: "Tahoma, sans-serif"
2690
- }, ui = /* @__PURE__ */ new Set([
2715
+ }, gi = /* @__PURE__ */ new Set([
2691
2716
  "inherit",
2692
2717
  "initial",
2693
2718
  "unset",
2694
2719
  "revert",
2695
2720
  "revert-layer"
2696
- ]), di = /* @__PURE__ */ new Set([
2721
+ ]), _i = /* @__PURE__ */ new Set([
2697
2722
  "serif",
2698
2723
  "sans-serif",
2699
2724
  "monospace",
@@ -2708,14 +2733,14 @@ var li = {
2708
2733
  "math",
2709
2734
  "fangsong"
2710
2735
  ]);
2711
- function fi(e) {
2736
+ function vi(e) {
2712
2737
  return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
2713
2738
  }
2714
- function pi(e) {
2739
+ function yi(e) {
2715
2740
  if (typeof e != "string") return [];
2716
2741
  let t = e.replace(/!\s*important\s*$/i, ""), n = [], r = 0;
2717
2742
  for (;;) {
2718
- for (; r < t.length && fi(t[r]);) r++;
2743
+ for (; r < t.length && vi(t[r]);) r++;
2719
2744
  if (r >= t.length) return [];
2720
2745
  let e = t[r];
2721
2746
  if (e === "\"" || e === "'") {
@@ -2732,7 +2757,7 @@ function pi(e) {
2732
2757
  }
2733
2758
  }
2734
2759
  if (!o) return [];
2735
- for (; a < t.length && fi(t[a]);) a++;
2760
+ for (; a < t.length && vi(t[a]);) a++;
2736
2761
  if (a < t.length && t[a] !== ",") return [];
2737
2762
  n.push({
2738
2763
  name: i,
@@ -2740,7 +2765,7 @@ function pi(e) {
2740
2765
  }), r = a;
2741
2766
  } else {
2742
2767
  let e = t.indexOf(",", r), i = e === -1 ? t.length : e, a = t.slice(r, i).trim().split(/\s+/).join(" ");
2743
- if (a === "" || a.includes("\"") || a.includes("'") || ui.has(a.toLowerCase())) return [];
2768
+ if (a === "" || a.includes("\"") || a.includes("'") || gi.has(a.toLowerCase())) return [];
2744
2769
  n.push({
2745
2770
  name: a,
2746
2771
  quoted: !1
@@ -2750,27 +2775,27 @@ function pi(e) {
2750
2775
  r++;
2751
2776
  }
2752
2777
  }
2753
- function mi(e) {
2778
+ function bi(e) {
2754
2779
  return `'${e.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
2755
2780
  }
2756
- function hi(e) {
2757
- return !e.quoted && di.has(e.name.toLowerCase());
2781
+ function xi(e) {
2782
+ return !e.quoted && _i.has(e.name.toLowerCase());
2758
2783
  }
2759
- function gi(e) {
2760
- return pi(e)[0]?.name ?? "";
2784
+ function Si(e) {
2785
+ return yi(e)[0]?.name ?? "";
2761
2786
  }
2762
- function _i(e, t) {
2763
- let n = (e) => `${mi(e.name)}, ${e.fallback ?? t.defaultFallback}`, r = typeof e == "string" ? e.trim().toLowerCase() : "", i = t.customFonts.find((e) => e.name.toLowerCase() === r);
2787
+ function Ci(e, t) {
2788
+ let n = (e) => `${bi(e.name)}, ${e.fallback ?? t.defaultFallback}`, r = typeof e == "string" ? e.trim().toLowerCase() : "", i = t.customFonts.find((e) => e.name.toLowerCase() === r);
2764
2789
  if (i) return n(i);
2765
- let a = pi(e);
2790
+ let a = yi(e);
2766
2791
  if (a.length !== 1) return e;
2767
2792
  let [o] = a, s = o.name.toLowerCase(), c = t.customFonts.find((e) => e.name.toLowerCase() === s);
2768
- return c ? n(c) : li[s] || (hi(o) ? e : `${mi(o.name)}, ${t.defaultFallback}`);
2793
+ return c ? n(c) : hi[s] || (xi(o) ? e : `${bi(o.name)}, ${t.defaultFallback}`);
2769
2794
  }
2770
2795
  // ../types/src/preview-resolution.ts
2771
- function vi(e) {
2796
+ function wi(e) {
2772
2797
  return typeof e != "object" || !e ? !1 : Array.isArray(e.blocks);
2773
2798
  }
2774
- export { Qn as $, C as $t, wr as A, Gt as At, pr as B, Me as Bt, xr as C, o as Cn, Vt as Ct, vr as D, qt as Dt, Dr as E, Kt as Et, Pr as F, Le as Ft, Zn as G, we as Gt, W as H, ge as Ht, X as I, D as It, Rn as J, Ee as Jt, Hn as K, Ae as Kt, hr as L, Fe as Lt, kr as M, Rt as Mt, _r as N, It as Nt, Sr as O, Xt as Ot, Cr as P, E as Pt, Vn as Q, ke as Qt, er as R, Ie as Rt, Mr as S, r as Sn, Yt as St, yr as T, z as Tt, G as U, y as Ut, ur as V, T as Vt, Yn as W, xe as Wt, Kn as X, Se as Xt, Ln as Y, be as Yt, Xn as Z, b as Zt, Ur as _, e as _n, Zt as _t, ci as a, le as an, qn as at, br as b, c as bn, Jt as bt, ri as c, ue as cn, U as ct, ei as d, d as dn, bn as dt, S as en, Un as et, ii as f, f as fn, _n as ft, Kr as g, i as gn, Ut as gt, Gr as h, ee as hn, gn as ht, _i as i, ae as in, Gn as it, Tr as j, B as jt, Nr as k, Bt as kt, ni as l, ie as ln, V as lt, Wr as m, m as mn, mn as mt, gi as n, g as nn, Pn as nt, si as o, ce as on, Dn as ot, Xr as p, p as pn, pn as pt, Wn as q, je as qt, pi as r, h as rn, K as rt, Qr as s, de as sn, On as st, vi as t, me as tn, zn as tt, Zr as u, ne as un, xn as ut, Q as v, s as vn, Qt as vt, Er as w, t as wn, zt as wt, Ar as x, n as xn, Ht as xt, Fr as y, l as yn, Wt as yt, mr as z, _ as zt };
2799
+ export { rr as $, Ne as $t, kr as A, Yt as At, vr as B, g as Bt, Er as C, n as Cn, Gt as Ct, Cr as D, Zt as Dt, Mr as E, t as En, Xt as Et, zr as F, He as Ft, nr as G, Ce as Gt, W as H, w as Ht, X as I, E as It, Un as J, Fe as Jt, qn as K, Ee as Kt, br as L, j as Lt, Pr as M, Ht as Mt, Sr as N, Bt as Nt, Dr as O, en as Ot, Or as P, T as Pt, Kn as Q, y as Qt, ar as R, Be as Rt, Lr as S, c as Sn, $t as St, wr as T, o as Tn, B as Tt, G as U, ve as Ut, hr as V, Ie as Vt, er as W, v as Wt, Zn as X, Se as Xt, Hn as Y, Oe as Yt, tr as Z, we as Zt, Yr as _, i as _n, tn as _t, mi as a, se as an, Qn as at, Tr as b, s as bn, Qt as bt, li as c, pe as cn, U as ct, oi as d, ie as dn, wn as dt, S as en, Jn as et, ui as f, f as fn, xn as ft, Qr as g, ne as gn, qt as gt, Zr as h, te as hn, bn as ht, Ci as i, m as in, Xn as it, Ar as j, V as jt, Rr as k, Wt as kt, ci as l, fe as ln, Dn as lt, Xr as m, ee as mn, vn as mt, Si as n, ge as nn, zn as nt, pi as o, de as on, Mn as ot, ni as p, p as pn, _n as pt, Yn as q, Pe as qt, yi as r, h as rn, K as rt, ii as s, ue as sn, Nn as st, wi as t, x as tn, Wn as tt, ri as u, oe as un, Tn as ut, Q as v, e as vn, nn as vt, jr as w, r as wn, Ut as wt, Fr as x, u as xn, Kt as xt, Br as y, l as yn, Jt as yt, yr as z, Ve as zt };
2775
2800
 
2776
- //# sourceMappingURL=src-mXG-Of9A.js.map
2801
+ //# sourceMappingURL=src-CdVAke9t.js.map