@templatical/editor 0.59.1 → 0.59.2

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 (191) hide show
  1. package/dist/{AiAltTextPopover-CwyKz_9U.js → AiAltTextPopover-BhWHOOKX.js} +3 -3
  2. package/dist/{AiAltTextReview-DNFnR1PN.js → AiAltTextReview-CmW7pLmo.js} +3 -3
  3. package/dist/{AiChatPanel-DWWVvJIP.js → AiChatPanel-CV0mCtad.js} +2 -2
  4. package/dist/{AiPanels-CESbBB63.js → AiPanels-C8M7q_vM.js} +1 -1
  5. package/dist/{AiRewriteMenu-DH6j1jOA.js → AiRewriteMenu-DC2ZLH5L.js} +7 -7
  6. package/dist/{BlockIssueBadge-3k568_Od.js → BlockIssueBadge-B8sl9BM1.js} +2 -2
  7. package/dist/{BlockPreviewCanvas-BLJxLwTT.js → BlockPreviewCanvas-yhOQAQhJ.js} +22 -18
  8. package/dist/{CloudHeaderExtras-xrHubAHL.js → CloudHeaderExtras-DC_oNrxz.js} +1 -1
  9. package/dist/{CloudPanels-qW-MObRD.js → CloudPanels-CD0lsL0R.js} +2 -2
  10. package/dist/{CollaborationNotices-D9GQ477K.js → CollaborationNotices-DrMrP73M.js} +1 -1
  11. package/dist/{CollaboratorBar-DsRjAaqd.js → CollaboratorBar-TsK872uC.js} +1 -1
  12. package/dist/{CommentsPanel-lb-IFzjl.js → CommentsPanel-BX8JVrXU.js} +1 -1
  13. package/dist/{CommentsSidebar-CVVTCWBH.js → CommentsSidebar-BUlseNwL.js} +2 -2
  14. package/dist/{CountdownBlock-CSEq79Nc.js → CountdownBlock-AYPypmcX.js} +2 -2
  15. package/dist/{CountdownToolbar-BV9yQi9k.js → CountdownToolbar-dx3FVRjh.js} +5 -5
  16. package/dist/{IssuesPanel-pxcWAQJM.js → IssuesPanel-BwnvXxBC.js} +5 -5
  17. package/dist/{LanguageMenu-D_xbvq3D.js → LanguageMenu-Cf5bKocE.js} +5 -5
  18. package/dist/{LocaleNotices-j4aMFfmc.js → LocaleNotices-CGEp0pQ8.js} +2 -2
  19. package/dist/{LogicTagInsertButton-BDIsyl3C.js → LogicTagInsertButton-BdDe-vrZ.js} +8 -8
  20. package/dist/{MergeTagInput-De1yWoc2.js → MergeTagInput-CTTi-eB0.js} +1 -1
  21. package/dist/{MergeTagModeToggle-CL96pI1E.js → MergeTagModeToggle-Bd0svGQm.js} +3 -3
  22. package/dist/{MergeTagTextarea-DDyV8U44.js → MergeTagTextarea-DiahMV-3.js} +4 -4
  23. package/dist/{ParagraphEditor-DpOsnnai.js → ParagraphEditor-Db1cmj8Y.js} +11 -11
  24. package/dist/{RestoreVersionDialog-JQEkVIh5.js → RestoreVersionDialog-DA1Z0q9Z.js} +2 -2
  25. package/dist/{RichTextEditorContent-C2Yj1-ZA.js → RichTextEditorContent-CyO6e4ZG.js} +6 -6
  26. package/dist/{SaveBlockDialog-BPf6tDhg.js → SaveBlockDialog-D7SaFxa_.js} +6 -6
  27. package/dist/{SavedBlocksBrowserModal-DnDCfwSv.js → SavedBlocksBrowserModal-B5r3LWWG.js} +6 -6
  28. package/dist/{SavedBlocksPanels-D5YaVCem.js → SavedBlocksPanels-BH2f7jm-.js} +1 -1
  29. package/dist/{SavedBlocksPickBar-OQ7ey3MD.js → SavedBlocksPickBar-B24TScw0.js} +2 -2
  30. package/dist/{TemplateSettings-CBCaybvd.js → TemplateSettings-CuN9Vkl_.js} +8 -8
  31. package/dist/{TestEmailModal-BDp85wIp.js → TestEmailModal-C4DAaohi.js} +11 -9
  32. package/dist/{TestEmailPanel-DkJx0Ptk.js → TestEmailPanel-DoMcVJSE.js} +1 -1
  33. package/dist/{TitleEditor-wzknZqu_.js → TitleEditor-b5Pr_m9j.js} +8 -8
  34. package/dist/{Toolbar-FIYSw3Us.js → Toolbar-BOf7Y862.js} +14 -14
  35. package/dist/{TplModal-C57J-uF0.js → TplModal-DAcXzBJh.js} +4 -4
  36. package/dist/{VersionHistoryMenu-6jMve6By.js → VersionHistoryMenu-TbIGteNi.js} +2 -2
  37. package/dist/{VersionHistoryPanels-BZ0GT52h.js → VersionHistoryPanels-Ia6ipOqG.js} +1 -1
  38. package/dist/{VersionPreviewBanner-Bq8z1SUc.js → VersionPreviewBanner-CRfu6quf.js} +1 -1
  39. package/dist/{WrapperBlock-C4XrJkx5.js → WrapperBlock-BZenrXM6.js} +4 -4
  40. package/dist/{blockTypeIcons-VX_8UQ21.js → blockTypeIcons-DdYZy8yG.js} +1 -1
  41. package/dist/bundle-stats.json +6 -6
  42. package/dist/cdn/chunks/{AiAltTextPopover-Dj-VLU88.js → AiAltTextPopover-CcX_OMUU.js} +4 -4
  43. package/dist/cdn/chunks/{AiAltTextPopover-Dj-VLU88.js.map → AiAltTextPopover-CcX_OMUU.js.map} +1 -1
  44. package/dist/cdn/chunks/{AiAltTextReview-tVkJPOk6.js → AiAltTextReview-Dmm3h0jd.js} +4 -4
  45. package/dist/cdn/chunks/{AiAltTextReview-tVkJPOk6.js.map → AiAltTextReview-Dmm3h0jd.js.map} +1 -1
  46. package/dist/cdn/chunks/{AiChatPanel-CYPvHQGQ.js → AiChatPanel-DV23DJ-2.js} +3 -3
  47. package/dist/cdn/chunks/{AiChatPanel-CYPvHQGQ.js.map → AiChatPanel-DV23DJ-2.js.map} +1 -1
  48. package/dist/cdn/chunks/{AiPanels-ChTLCmMS.js → AiPanels-CxhOpMAp.js} +2 -2
  49. package/dist/cdn/chunks/{AiPanels-ChTLCmMS.js.map → AiPanels-CxhOpMAp.js.map} +1 -1
  50. package/dist/cdn/chunks/{AiRewriteMenu-B23ozFnP.js → AiRewriteMenu-87-O514r.js} +8 -8
  51. package/dist/cdn/chunks/{AiRewriteMenu-B23ozFnP.js.map → AiRewriteMenu-87-O514r.js.map} +1 -1
  52. package/dist/cdn/chunks/{BlockIssueBadge-BKO4Mr8f.js → BlockIssueBadge-Dp06vQd3.js} +3 -3
  53. package/dist/cdn/chunks/{BlockIssueBadge-BKO4Mr8f.js.map → BlockIssueBadge-Dp06vQd3.js.map} +1 -1
  54. package/dist/cdn/chunks/{BlockPreviewCanvas-CaRneMZ8.js → BlockPreviewCanvas-DQGzUvZ5.js} +23 -19
  55. package/dist/cdn/chunks/BlockPreviewCanvas-DQGzUvZ5.js.map +1 -0
  56. package/dist/cdn/chunks/{CloudHeaderExtras-O_K3jmgO.js → CloudHeaderExtras-Cd-ePldd.js} +2 -2
  57. package/dist/cdn/chunks/{CloudHeaderExtras-O_K3jmgO.js.map → CloudHeaderExtras-Cd-ePldd.js.map} +1 -1
  58. package/dist/cdn/chunks/{CloudPanels-xAEirqNC.js → CloudPanels-D8fchoYt.js} +3 -3
  59. package/dist/cdn/chunks/{CloudPanels-xAEirqNC.js.map → CloudPanels-D8fchoYt.js.map} +1 -1
  60. package/dist/cdn/chunks/{CollaborationNotices-CwAoa-73.js → CollaborationNotices-DNEs3g9B.js} +2 -2
  61. package/dist/cdn/chunks/{CollaborationNotices-CwAoa-73.js.map → CollaborationNotices-DNEs3g9B.js.map} +1 -1
  62. package/dist/cdn/chunks/{CollaboratorBar-DdQQwtwd.js → CollaboratorBar-CN6XAlbn.js} +2 -2
  63. package/dist/cdn/chunks/{CollaboratorBar-DdQQwtwd.js.map → CollaboratorBar-CN6XAlbn.js.map} +1 -1
  64. package/dist/cdn/chunks/{CommentsPanel-C8AKtxiG.js → CommentsPanel-CxZ1kFcK.js} +2 -2
  65. package/dist/cdn/chunks/{CommentsPanel-C8AKtxiG.js.map → CommentsPanel-CxZ1kFcK.js.map} +1 -1
  66. package/dist/cdn/chunks/{CommentsSidebar-FxY0RHSq.js → CommentsSidebar-DCr2mV8b.js} +3 -3
  67. package/dist/cdn/chunks/{CommentsSidebar-FxY0RHSq.js.map → CommentsSidebar-DCr2mV8b.js.map} +1 -1
  68. package/dist/cdn/chunks/{CountdownBlock-DGgnPUlu.js → CountdownBlock--hlKE2aj.js} +3 -3
  69. package/dist/cdn/chunks/{CountdownBlock-DGgnPUlu.js.map → CountdownBlock--hlKE2aj.js.map} +1 -1
  70. package/dist/cdn/chunks/{CountdownToolbar-9PtYUgCW.js → CountdownToolbar-CUTbVPPV.js} +6 -6
  71. package/dist/cdn/chunks/{CountdownToolbar-9PtYUgCW.js.map → CountdownToolbar-CUTbVPPV.js.map} +1 -1
  72. package/dist/cdn/chunks/{IssuesPanel-Co-ffgWa.js → IssuesPanel-BhcSzwuL.js} +7 -7
  73. package/dist/cdn/chunks/{IssuesPanel-Co-ffgWa.js.map → IssuesPanel-BhcSzwuL.js.map} +1 -1
  74. package/dist/cdn/chunks/{LanguageMenu-Cl0ajnXZ.js → LanguageMenu-6wGhkyFT.js} +99 -99
  75. package/dist/cdn/chunks/{LanguageMenu-Cl0ajnXZ.js.map → LanguageMenu-6wGhkyFT.js.map} +1 -1
  76. package/dist/cdn/chunks/{LocaleNotices-BVDJ7kyj.js → LocaleNotices-Br92Xueo.js} +3 -3
  77. package/dist/cdn/chunks/{LocaleNotices-BVDJ7kyj.js.map → LocaleNotices-Br92Xueo.js.map} +1 -1
  78. package/dist/cdn/chunks/{LogicTagInsertButton-DPYA8LJW.js → LogicTagInsertButton-r2EVUtDU.js} +9 -9
  79. package/dist/cdn/chunks/{LogicTagInsertButton-DPYA8LJW.js.map → LogicTagInsertButton-r2EVUtDU.js.map} +1 -1
  80. package/dist/cdn/chunks/{MergeTagInput-Cxfjq3tx.js → MergeTagInput-Dh3N6CEV.js} +2 -2
  81. package/dist/cdn/chunks/{MergeTagInput-Cxfjq3tx.js.map → MergeTagInput-Dh3N6CEV.js.map} +1 -1
  82. package/dist/cdn/chunks/{MergeTagModeToggle-BmNGV3yc.js → MergeTagModeToggle-D6u3hMrI.js} +4 -4
  83. package/dist/cdn/chunks/{MergeTagModeToggle-BmNGV3yc.js.map → MergeTagModeToggle-D6u3hMrI.js.map} +1 -1
  84. package/dist/cdn/chunks/{MergeTagTextarea-DmwrPAss.js → MergeTagTextarea-BpVtpiNL.js} +8 -8
  85. package/dist/cdn/chunks/{MergeTagTextarea-DmwrPAss.js.map → MergeTagTextarea-BpVtpiNL.js.map} +1 -1
  86. package/dist/cdn/chunks/{ParagraphEditor-BoGELRr-.js → ParagraphEditor-DGJmPAC1.js} +12 -12
  87. package/dist/cdn/chunks/{ParagraphEditor-BoGELRr-.js.map → ParagraphEditor-DGJmPAC1.js.map} +1 -1
  88. package/dist/cdn/chunks/{RestoreVersionDialog-CaKiSq-9.js → RestoreVersionDialog-D5qeCa0F.js} +3 -3
  89. package/dist/cdn/chunks/{RestoreVersionDialog-CaKiSq-9.js.map → RestoreVersionDialog-D5qeCa0F.js.map} +1 -1
  90. package/dist/cdn/chunks/{RichTextEditorContent-Dq4TROOg.js → RichTextEditorContent-DyGiXKKI.js} +7 -7
  91. package/dist/cdn/chunks/{RichTextEditorContent-Dq4TROOg.js.map → RichTextEditorContent-DyGiXKKI.js.map} +1 -1
  92. package/dist/cdn/chunks/{SaveBlockDialog-BAR0G4UO.js → SaveBlockDialog-B0TJYxd8.js} +7 -7
  93. package/dist/cdn/chunks/{SaveBlockDialog-BAR0G4UO.js.map → SaveBlockDialog-B0TJYxd8.js.map} +1 -1
  94. package/dist/cdn/chunks/{SavedBlocksBrowserModal-C-KYaLkQ.js → SavedBlocksBrowserModal-D8Ly7LrA.js} +6 -6
  95. package/dist/cdn/chunks/{SavedBlocksBrowserModal-C-KYaLkQ.js.map → SavedBlocksBrowserModal-D8Ly7LrA.js.map} +1 -1
  96. package/dist/cdn/chunks/{SavedBlocksPanels-C3OF0EeB.js → SavedBlocksPanels-Co1cbWR8.js} +2 -2
  97. package/dist/cdn/chunks/{SavedBlocksPanels-C3OF0EeB.js.map → SavedBlocksPanels-Co1cbWR8.js.map} +1 -1
  98. package/dist/cdn/chunks/{SavedBlocksPickBar-BnyPXw5W.js → SavedBlocksPickBar-DNtVbpm-.js} +3 -3
  99. package/dist/cdn/chunks/{SavedBlocksPickBar-BnyPXw5W.js.map → SavedBlocksPickBar-DNtVbpm-.js.map} +1 -1
  100. package/dist/cdn/chunks/{TemplateSettings-uoiUkd2l.js → TemplateSettings-BRc878ZF.js} +9 -9
  101. package/dist/cdn/chunks/{TemplateSettings-uoiUkd2l.js.map → TemplateSettings-BRc878ZF.js.map} +1 -1
  102. package/dist/cdn/chunks/{TestEmailModal-B9d3ZsH7.js → TestEmailModal-CIui7VfS.js} +12 -10
  103. package/dist/cdn/chunks/TestEmailModal-CIui7VfS.js.map +1 -0
  104. package/dist/cdn/chunks/{TestEmailPanel--fPi6QjN.js → TestEmailPanel-vKvruW_r.js} +2 -2
  105. package/dist/cdn/chunks/{TestEmailPanel--fPi6QjN.js.map → TestEmailPanel-vKvruW_r.js.map} +1 -1
  106. package/dist/cdn/chunks/{TitleEditor-Cn4fnSpa.js → TitleEditor-BI-9Nnj3.js} +8 -8
  107. package/dist/cdn/chunks/{TitleEditor-Cn4fnSpa.js.map → TitleEditor-BI-9Nnj3.js.map} +1 -1
  108. package/dist/cdn/chunks/{Toolbar-BzAuH2G4.js → Toolbar-CYnnArxv.js} +418 -418
  109. package/dist/cdn/chunks/{Toolbar-BzAuH2G4.js.map → Toolbar-CYnnArxv.js.map} +1 -1
  110. package/dist/cdn/chunks/{TplModal-jMfK19PC.js → TplModal-B3nZeGWK.js} +5 -5
  111. package/dist/cdn/chunks/{TplModal-jMfK19PC.js.map → TplModal-B3nZeGWK.js.map} +1 -1
  112. package/dist/cdn/chunks/{VersionHistoryMenu-DDqYMqC2.js → VersionHistoryMenu-CMGfAKuV.js} +3 -3
  113. package/dist/cdn/chunks/{VersionHistoryMenu-DDqYMqC2.js.map → VersionHistoryMenu-CMGfAKuV.js.map} +1 -1
  114. package/dist/cdn/chunks/{VersionHistoryPanels-DJpySkvq.js → VersionHistoryPanels-Bb2ouQg7.js} +2 -2
  115. package/dist/cdn/chunks/{VersionHistoryPanels-DJpySkvq.js.map → VersionHistoryPanels-Bb2ouQg7.js.map} +1 -1
  116. package/dist/cdn/chunks/{VersionPreviewBanner-CYT5QUoc.js → VersionPreviewBanner-573UP-g4.js} +2 -2
  117. package/dist/cdn/chunks/{VersionPreviewBanner-CYT5QUoc.js.map → VersionPreviewBanner-573UP-g4.js.map} +1 -1
  118. package/dist/cdn/chunks/{WrapperBlock-Bi9XgDmX.js → WrapperBlock-DVu632LD.js} +5 -5
  119. package/dist/cdn/chunks/{WrapperBlock-Bi9XgDmX.js.map → WrapperBlock-DVu632LD.js.map} +1 -1
  120. package/dist/cdn/chunks/{composables-Cp6gZ7qV.js → composables-DY3anqHO.js} +572 -571
  121. package/dist/cdn/chunks/composables-DY3anqHO.js.map +1 -0
  122. package/dist/cdn/chunks/{createCloudRuntime-D8zeR9D2.js → createCloudRuntime-B5numxlW.js} +4 -4
  123. package/dist/cdn/chunks/{createCloudRuntime-D8zeR9D2.js.map → createCloudRuntime-B5numxlW.js.map} +1 -1
  124. package/dist/cdn/chunks/{extensions-BYJPv1sA.js → extensions-BWVlr8Ga.js} +5 -5
  125. package/dist/cdn/chunks/{extensions-BYJPv1sA.js.map → extensions-BWVlr8Ga.js.map} +1 -1
  126. package/dist/cdn/chunks/keys-ywH4jHJ2.js +11 -0
  127. package/dist/cdn/chunks/keys-ywH4jHJ2.js.map +1 -0
  128. package/dist/cdn/chunks/{normalizeMergeTagMarkup-nDyYIXvL.js → normalizeMergeTagMarkup-Dw3rFvyd.js} +40 -40
  129. package/dist/cdn/chunks/{normalizeMergeTagMarkup-nDyYIXvL.js.map → normalizeMergeTagMarkup-Dw3rFvyd.js.map} +1 -1
  130. package/dist/cdn/chunks/{preRenderCustomBlocks-CxwYcAQe.js → preRenderCustomBlocks-BGtb8Xbp.js} +4 -4
  131. package/dist/cdn/chunks/{preRenderCustomBlocks-CxwYcAQe.js.map → preRenderCustomBlocks-BGtb8Xbp.js.map} +1 -1
  132. package/dist/cdn/chunks/{sanitizeHtml-5T_KaDcp.js → sanitizeHtml-CLRY8s2s.js} +2 -2
  133. package/dist/cdn/chunks/{sanitizeHtml-5T_KaDcp.js.map → sanitizeHtml-CLRY8s2s.js.map} +1 -1
  134. package/dist/cdn/chunks/{socialIcons-bvQ57o1m.js → socialIcons-kYhdXJ9P.js} +255 -255
  135. package/dist/cdn/chunks/{socialIcons-bvQ57o1m.js.map → socialIcons-kYhdXJ9P.js.map} +1 -1
  136. package/dist/cdn/chunks/{src-aFRxbwqP.js → src-B7X7x_ST.js} +154 -154
  137. package/dist/cdn/chunks/{src-aFRxbwqP.js.map → src-B7X7x_ST.js.map} +1 -1
  138. package/dist/cdn/chunks/{src-BRyzUujm.js → src-BmzzkUf7.js} +539 -539
  139. package/dist/cdn/chunks/{src-BRyzUujm.js.map → src-BmzzkUf7.js.map} +1 -1
  140. package/dist/cdn/chunks/{src-CVHGPKSW.js → src-DY2kMjoD.js} +593 -589
  141. package/dist/cdn/chunks/src-DY2kMjoD.js.map +1 -0
  142. package/dist/cdn/chunks/{useCloudI18n-CWgySYuJ.js → useCloudI18n-BTV9uu3c.js} +2 -2
  143. package/dist/cdn/chunks/{useCloudI18n-CWgySYuJ.js.map → useCloudI18n-BTV9uu3c.js.map} +1 -1
  144. package/dist/cdn/chunks/{useEditorRoot-BA4vV7sK.js → useEditorRoot-D0Lp2x4_.js} +2 -2
  145. package/dist/cdn/chunks/{useEditorRoot-BA4vV7sK.js.map → useEditorRoot-D0Lp2x4_.js.map} +1 -1
  146. package/dist/cdn/chunks/{useI18n-JsIdvX-i.js → useI18n-DPg6rPbu.js} +2 -2
  147. package/dist/cdn/chunks/{useI18n-JsIdvX-i.js.map → useI18n-DPg6rPbu.js.map} +1 -1
  148. package/dist/cdn/chunks/useLocalizedDisplay-B5wMJLru.js +33 -0
  149. package/dist/cdn/chunks/{useLocalizedDisplay-7iwZ1UhB.js.map → useLocalizedDisplay-B5wMJLru.js.map} +1 -1
  150. package/dist/cdn/chunks/{useLogicTag-C10Wef7d.js → useLogicTag-0wkSxy3z.js} +3 -3
  151. package/dist/cdn/chunks/{useLogicTag-C10Wef7d.js.map → useLogicTag-0wkSxy3z.js.map} +1 -1
  152. package/dist/cdn/chunks/{useMergeTag-Dd26TcvH.js → useMergeTag-y3bX8M_6.js} +3 -3
  153. package/dist/cdn/chunks/{useMergeTag-Dd26TcvH.js.map → useMergeTag-y3bX8M_6.js.map} +1 -1
  154. package/dist/cdn/chunks/{usePopoverPosition-DWRQRT2P.js → usePopoverPosition-CBp9uwjV.js} +2 -2
  155. package/dist/cdn/chunks/{usePopoverPosition-DWRQRT2P.js.map → usePopoverPosition-CBp9uwjV.js.map} +1 -1
  156. package/dist/cdn/chunks/{useScrollToBlock-CArjwH-u.js → useScrollToBlock-32EnuMwu.js} +2 -2
  157. package/dist/cdn/chunks/{useScrollToBlock-CArjwH-u.js.map → useScrollToBlock-32EnuMwu.js.map} +1 -1
  158. package/dist/cdn/chunks/{withCurrentFont-BaeBoPQZ.js → withCurrentFont-B42BKo9N.js} +2 -2
  159. package/dist/cdn/chunks/{withCurrentFont-BaeBoPQZ.js.map → withCurrentFont-B42BKo9N.js.map} +1 -1
  160. package/dist/cdn/editor.css +1 -1
  161. package/dist/cdn/editor.js +600 -600
  162. package/dist/cdn/editor.js.map +1 -1
  163. package/dist/{composables-jTnTSqdm.js → composables-CFTH0Nqb.js} +865 -864
  164. package/dist/{createCloudRuntime-DiUnYjKr.js → createCloudRuntime-BvWlm_38.js} +3 -3
  165. package/dist/{dist-BTjObRcv.js → dist-CMo4K5So.js} +277 -273
  166. package/dist/{extensions-CAuXwpbI.js → extensions-BPVackEE.js} +4 -4
  167. package/dist/keys-B4DimcgX.js +9 -0
  168. package/dist/{normalizeMergeTagMarkup-fgoVMKAc.js → normalizeMergeTagMarkup-PQqrbfmt.js} +1 -1
  169. package/dist/{preRenderCustomBlocks-CgPtlLGL.js → preRenderCustomBlocks-Dg5GBNi2.js} +1 -1
  170. package/dist/{sanitizeHtml-D2wueiEe.js → sanitizeHtml-DVdfdxOz.js} +1 -1
  171. package/dist/{socialIcons-RKdTgJip.js → socialIcons-DBHv_ntg.js} +4 -4
  172. package/dist/style.css +1 -1
  173. package/dist/templatical-editor.js +563 -563
  174. package/dist/{useCloudI18n-nMZ9f_4b.js → useCloudI18n-BnuOL1YS.js} +1 -1
  175. package/dist/{useEditorRoot-DpssP9rX.js → useEditorRoot-DWfC2CVC.js} +1 -1
  176. package/dist/{useI18n-C2p-qHeb.js → useI18n-Cx9W7OWb.js} +1 -1
  177. package/dist/{useLocalizedDisplay-9RqT2y_Y.js → useLocalizedDisplay-CbFM0cCV.js} +1 -1
  178. package/dist/{useLogicTag-59fmujI7.js → useLogicTag-CVOj0VUv.js} +2 -2
  179. package/dist/{useMergeTag-M1vauWet.js → useMergeTag-Bams_kam.js} +2 -2
  180. package/dist/{usePopoverPosition-L9MOHBM-.js → usePopoverPosition-DF0ZYH7g.js} +1 -1
  181. package/dist/{useScrollToBlock-BMF0Dt5l.js → useScrollToBlock-CwUQ_nKz.js} +1 -1
  182. package/dist/{withCurrentFont-BXZ7g-K6.js → withCurrentFont-y0O5kOLW.js} +1 -1
  183. package/package.json +7 -7
  184. package/dist/cdn/chunks/BlockPreviewCanvas-CaRneMZ8.js.map +0 -1
  185. package/dist/cdn/chunks/TestEmailModal-B9d3ZsH7.js.map +0 -1
  186. package/dist/cdn/chunks/composables-Cp6gZ7qV.js.map +0 -1
  187. package/dist/cdn/chunks/keys-DNv3xXxI.js +0 -11
  188. package/dist/cdn/chunks/keys-DNv3xXxI.js.map +0 -1
  189. package/dist/cdn/chunks/src-CVHGPKSW.js.map +0 -1
  190. package/dist/cdn/chunks/useLocalizedDisplay-7iwZ1UhB.js +0 -33
  191. package/dist/keys-BeQy64On.js +0 -9
@@ -343,23 +343,23 @@ function xe(e) {
343
343
  }
344
344
  return t.l10n && !Object.keys(t.l10n).length && delete t.l10n, h(t, e) ? e : t;
345
345
  }
346
- function b(e) {
346
+ function Se(e) {
347
347
  let t = xe(e);
348
348
  if (t.type === "wrapper") {
349
- let e = t.children.map(b);
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(b));
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 Se(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;
@@ -380,10 +380,10 @@ function Se(e, t, n) {
380
380
  }
381
381
  return !1;
382
382
  }
383
- function Ce(e) {
383
+ function we(e) {
384
384
  return xe(e);
385
385
  }
386
- function x(e, t, n) {
386
+ function b(e, t, n) {
387
387
  if (!v(t)) return !1;
388
388
  let r = t.split("."), i = r.pop(), a = r.reduce(be, e);
389
389
  if (Array.isArray(a)) {
@@ -392,21 +392,21 @@ function x(e, t, n) {
392
392
  }
393
393
  return _(a) ? (n === null ? delete a[i] : a[i] = m(n), !0) : !1;
394
394
  }
395
- function we(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 (_(e) && typeof e.id == "string") for (let t of r.length ? we(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
404
  let a = _(e) ? e[n] : void 0;
405
405
  if (r.length === 0) return a === void 0 ? [] : [n];
406
- for (let e of we(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
412
  return _(i) ? Object.keys(i).filter((e) => r.has(e)).map((e) => `fieldValues.${e}`) : [];
@@ -421,75 +421,75 @@ function S(e, t = []) {
421
421
  cells: e.cells.filter(n)
422
422
  }))
423
423
  } : e;
424
- return (_e[e.type] ?? []).flatMap((e) => we(r, e));
424
+ return (_e[e.type] ?? []).flatMap((e) => Te(r, e));
425
425
  }
426
- function Te(e, t) {
426
+ function Ee(e, t) {
427
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 Ee(e) {
437
+ function De(e) {
438
438
  let { l10n: t, ...n } = e;
439
439
  return n;
440
440
  }
441
- function De(e = {}) {
441
+ function Oe(e = {}) {
442
442
  return Object.entries(e).sort(([e], [t]) => e.split(".").length - t.split(".").length);
443
443
  }
444
- function Oe(e, t, n) {
445
- return ke(e, m(Ee(e)), t, n);
444
+ function ke(e, t, n) {
445
+ return Ae(e, m(De(e)), t, n);
446
446
  }
447
- function ke(e, t, n, r) {
447
+ function Ae(e, t, n, r) {
448
448
  let i = e;
449
449
  if (n === r) return t;
450
450
  let a = i.l10n?.[n];
451
451
  if (!a) return t;
452
- for (let [e, n] of De(a.set)) x(t, e, n);
453
- for (let [n, r] of Object.entries(a.text ?? {})) y(e, n) !== void 0 && x(t, n, r.value);
452
+ for (let [e, n] of Oe(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
454
  return e.type === "custom" && (Object.keys(a.text ?? {}).length > 0 || Object.keys(a.set ?? {}).length > 0) && delete t.renderedHtml, t;
455
455
  }
456
- function Ae(e, t, n) {
456
+ function je(e, t, n) {
457
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 } = Ee(r), o = m(a);
460
- return o.children = i, ke(e, o, t, n);
458
+ if (r.type !== "section" && r.type !== "wrapper" || !Array.isArray(r.children)) return ke(e, t, n);
459
+ let { children: i, ...a } = De(r), o = m(a);
460
+ return o.children = i, Ae(e, o, t, n);
461
461
  }
462
- function je(e, t) {
462
+ function Me(e, t) {
463
463
  return e.l10n?.[t]?.hidden === !0;
464
464
  }
465
- function Me(e) {
465
+ function Ne(e) {
466
466
  let { locales: t, l10n: n, ...r } = e;
467
467
  return r;
468
468
  }
469
- function w(e) {
469
+ function C(e) {
470
470
  return e.settings?.locale ?? "en";
471
471
  }
472
- function Ne(e, t, n) {
473
- let r = w(e);
472
+ function Pe(e, t, n) {
473
+ let r = C(e);
474
474
  if (t !== r && !(e.settings?.locales ?? []).includes(t)) {
475
475
  if (n?.missing === "default") t = r;
476
476
  else throw new ge(`This template has no "${t}" version.`, void 0, "unknown_locale");
477
477
  }
478
478
  let i = (e) => e.flatMap((e) => {
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);
479
+ if (t !== r && Me(e, t)) return [];
480
+ let n = e.l10n?.[t], a = [...Object.keys(n?.set ?? {}), ...Object.keys(n?.text ?? {})].some((e) => e.startsWith("children.")) ? ke(e, t, r) : je(e, t, r);
481
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];
482
+ }), a = m(Ne(e.settings)), o = e.settings?.l10n?.[t];
483
483
  if (t !== r && o) {
484
- for (let [e, t] of De(o.set)) x(a, e, t);
485
- for (let [t, n] of Object.entries(o.text ?? {})) y(e.settings, t) !== void 0 && x(a, t, n.value);
484
+ for (let [e, t] of Oe(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);
486
486
  }
487
487
  return a.locale = t, {
488
488
  blocks: i(e.blocks),
489
489
  settings: a
490
490
  };
491
491
  }
492
- function Pe(e, t, n = []) {
492
+ function Fe(e, t, n = []) {
493
493
  let r = {
494
494
  translated: [],
495
495
  missing: [],
@@ -499,13 +499,13 @@ function Pe(e, t, n = []) {
499
499
  let n = y(t, a);
500
500
  if (typeof n != "string") continue;
501
501
  let o = i?.[a];
502
- (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}`));
503
503
  }
504
504
  }, a = (e) => {
505
505
  for (let r of e) {
506
- if (je(r, t)) continue;
506
+ if (Me(r, t)) continue;
507
507
  let e = r.l10n?.[t];
508
- i(r.id, r, S(r, n), e?.text);
508
+ i(r.id, r, x(r, n), e?.text);
509
509
  let o = r.children;
510
510
  if (r.type === "section" && Array.isArray(o)) for (let e of o) a(e);
511
511
  else r.type === "wrapper" && Array.isArray(o) && a(o);
@@ -513,35 +513,35 @@ function Pe(e, t, n = []) {
513
513
  };
514
514
  return a(e.blocks), i("settings", e.settings, [...g], e.settings?.l10n?.[t]?.text), r;
515
515
  }
516
- function Fe(e, t) {
517
- if (t === w(e) || !e.settings.locales?.includes(t)) return [];
516
+ function Ie(e, t) {
517
+ if (t === C(e) || !e.settings.locales?.includes(t)) return [];
518
518
  let n = [], r = (e) => {
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);
519
+ for (let i of e) Me(i, t) && n.push(i.id), i.type === "section" ? i.children.forEach(r) : i.type === "wrapper" && r(i.children);
520
520
  };
521
521
  return r(e.blocks), n;
522
522
  }
523
- function Ie(e, t, n = []) {
524
- if (t === w(e) || !e.settings.locales?.includes(t)) return [];
523
+ function Le(e, t, n = []) {
524
+ if (t === C(e) || !e.settings.locales?.includes(t)) return [];
525
525
  let r = [], i = (e, n, i) => {
526
- r.push(...Le(n, t, i).map((t) => `${e}/${t}`));
526
+ r.push(...Re(n, t, i).map((t) => `${e}/${t}`));
527
527
  }, a = (e) => {
528
- 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);
529
529
  };
530
530
  return a(e.blocks), i("settings", e.settings, g), r;
531
531
  }
532
- function Le(e, t, n) {
532
+ function Re(e, t, n) {
533
533
  let r = e.l10n?.[t];
534
534
  return n.filter((t) => {
535
535
  let n = y(e, t);
536
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));
537
537
  });
538
538
  }
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);
539
+ function ze(e, t, n = {}) {
540
+ let r = C(e), i = (e, n, i) => {
541
+ let a = Re(e, t, i), o = m(e.l10n ?? {}), s = o[t] ?? {}, c = m(e);
542
542
  delete c.l10n;
543
- for (let [e, t] of De(s.set)) x(c, e, t);
544
- for (let [t, n] of Object.entries(s.text ?? {})) y(e, t) !== void 0 && x(c, t, n.value);
543
+ for (let [e, t] of Oe(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);
545
545
  delete o[t];
546
546
  let l = {}, u = /* @__PURE__ */ new Set([
547
547
  ...Object.keys(s.set ?? {}),
@@ -552,10 +552,10 @@ function Re(e, t, n = {}) {
552
552
  let r = y(e, t), i = y(c, t);
553
553
  h(r, i) ? (s.text?.[t] || a.includes(t)) && n(t) && typeof r == "string" && r !== "" && ((l.text ??= {})[t] = {
554
554
  value: r,
555
- sourceHash: C(r)
555
+ sourceHash: S(r)
556
556
  }) : n(t) && typeof r == "string" && typeof i == "string" ? (l.text ??= {})[t] = {
557
557
  value: r,
558
- sourceHash: C(i)
558
+ sourceHash: S(i)
559
559
  } : (l.set ??= {})[t] = r === void 0 ? null : m(r);
560
560
  }
561
561
  let d = (e, t) => {
@@ -579,21 +579,21 @@ function Re(e, t, n = {}) {
579
579
  };
580
580
  for (let t of Object.values(o)) {
581
581
  let n = m(e);
582
- for (let [e, r] of De(t.set)) x(n, e, r);
583
- for (let [r, i] of Object.entries(t.text ?? {})) y(e, r) !== void 0 && x(n, r, i.value);
582
+ for (let [e, r] of Oe(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);
584
584
  for (let [n, r] of Object.entries(t.text ?? {})) {
585
585
  let i = y(c, n);
586
586
  if (typeof i != "string") (t.set ??= {})[n] = r.value, delete t.text[n];
587
587
  else {
588
588
  let t = y(e, n);
589
- typeof t == "string" && r.sourceHash === C(t) && (r.sourceHash = C(i));
589
+ typeof t == "string" && r.sourceHash === S(t) && (r.sourceHash = S(i));
590
590
  }
591
591
  }
592
592
  d(t, n);
593
593
  }
594
594
  return Object.keys(l).length && (d(l, e), o[r] = l), Object.keys(o).length && (c.l10n = o), c;
595
595
  }, a = (e) => e.map((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 ?? {}))])] : S(e), r = i(e, (n) => e.type === "custom" ? t.includes(n) : Te(e.type, n), t);
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
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
598
  }), o = i(e.settings, (e) => g.includes(e), g);
599
599
  return o.locale = t, o.locales = e.settings.locales.map((e) => e === t ? r : e), {
@@ -602,12 +602,12 @@ function Re(e, t, n = {}) {
602
602
  };
603
603
  }
604
604
  // ../types/src/operations.ts
605
- var ze = "Sections with a wrapper cannot be placed inside wrappers.";
606
- function Be(e, t, n = []) {
607
- let r = Object.fromEntries(I(e.blocks).flatMap((e) => {
605
+ var Be = "Sections with a wrapper cannot be placed inside wrappers.";
606
+ function Ve(e, t, n = []) {
607
+ let r = Object.fromEntries(F(e.blocks).flatMap((e) => {
608
608
  if (e.type !== "custom") return [];
609
- let t = S(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]] : [];
609
+ let t = x(e, n).filter((t) => typeof y(e, t) == "string");
610
+ return t.length && qe.has(e.id) && E("invalid_operation", 0, Je), t.length ? [[e.id, t]] : [];
611
611
  }));
612
612
  return {
613
613
  op: "setDefaultLocale",
@@ -615,7 +615,7 @@ function Be(e, t, n = []) {
615
615
  ...Object.keys(r).length ? { customTextFields: r } : {}
616
616
  };
617
617
  }
618
- var T = class extends Error {
618
+ var w = class extends Error {
619
619
  code;
620
620
  opIndex;
621
621
  blockId;
@@ -623,164 +623,164 @@ var T = class extends Error {
623
623
  super(n), this.name = "OperationError", this.code = e, this.opIndex = t, r !== void 0 && (this.blockId = r);
624
624
  }
625
625
  };
626
- function Ve(e) {
626
+ function He(e) {
627
627
  return e === "1" ? 1 : e === "3" || e === "1-2-1" ? 3 : e === "4" ? 4 : 2;
628
628
  }
629
- function He(e, t, n = {}) {
629
+ function Ue(e, t, n = {}) {
630
630
  let r = m(e);
631
- return E(r, t, n), r;
631
+ return T(r, t, n), r;
632
632
  }
633
- function E(e, t, n = {}) {
633
+ function T(e, t, n = {}) {
634
634
  let r = {
635
635
  locks: n.locks ?? [],
636
636
  session: n.session ?? null
637
637
  };
638
- t.forEach((t, n) => ut(e, t, n, r));
638
+ t.forEach((t, n) => dt(e, t, n, r));
639
639
  }
640
- var Ue = /* @__PURE__ */ new Set([
640
+ var We = /* @__PURE__ */ new Set([
641
641
  "id",
642
642
  "type",
643
643
  "children",
644
644
  "l10n"
645
- ]), We = /* @__PURE__ */ new Set(["locales", "l10n"]), Ge = /* @__PURE__ */ new Set([
645
+ ]), Ge = /* @__PURE__ */ new Set(["locales", "l10n"]), Ke = /* @__PURE__ */ new Set([
646
646
  "locale",
647
647
  "locales",
648
648
  "l10n"
649
- ]), Ke = /* @__PURE__ */ new Set([
649
+ ]), qe = /* @__PURE__ */ new Set([
650
650
  "__proto__",
651
651
  "constructor",
652
652
  "prototype"
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);
653
+ ]), Je = "customTextFields must map existing custom block ids to lists of string fieldValues paths.";
654
+ function E(e, t, n, r) {
655
+ throw new w(e, t, n, r);
656
656
  }
657
- function O(e) {
657
+ function D(e) {
658
658
  return typeof e == "object" && !!e && !Array.isArray(e);
659
659
  }
660
- function k(e) {
660
+ function O(e) {
661
661
  return e.type === "section";
662
662
  }
663
- function A(e) {
663
+ function k(e) {
664
664
  return Array.isArray(e.blocks) ? e.blocks : [];
665
665
  }
666
- function Je(e) {
666
+ function Ye(e) {
667
667
  let t = e.children;
668
668
  return Array.isArray(t) ? t.map((e) => Array.isArray(e) ? e : []) : [];
669
669
  }
670
- function* Ye(e, t) {
670
+ function* Xe(e, t) {
671
671
  for (let n = 0; n < e.length; n++) {
672
672
  let r = e[n];
673
- if (O(r) && (yield {
673
+ if (D(r) && (yield {
674
674
  block: r,
675
675
  list: e,
676
676
  index: n,
677
677
  parent: t
678
678
  }, typeof r.id == "string")) {
679
- if (k(r)) for (let [e, t] of Je(r).entries()) yield* Ye(t, {
679
+ if (O(r)) for (let [e, t] of Ye(r).entries()) yield* Xe(t, {
680
680
  sectionId: r.id,
681
681
  column: e
682
682
  });
683
- else r.type === "wrapper" && Array.isArray(r.children) && (yield* Ye(r.children, { wrapperId: r.id }));
683
+ else r.type === "wrapper" && Array.isArray(r.children) && (yield* Xe(r.children, { wrapperId: r.id }));
684
684
  }
685
685
  }
686
686
  }
687
- function j(e, t) {
688
- for (let n of Ye(A(e), null)) if (n.block.id === t) return n;
687
+ function A(e, t) {
688
+ for (let n of Xe(k(e), null)) if (n.block.id === t) return n;
689
689
  return null;
690
690
  }
691
- function M(e) {
692
- if (!O(e)) return [];
691
+ function j(e) {
692
+ if (!D(e)) return [];
693
693
  let t = typeof e.id == "string" ? [e.id] : [];
694
- if (k(e)) for (let n of Je(e)) for (let e of Xe(n)) t.push(e);
695
- else if (e.type === "wrapper" && Array.isArray(e.children)) for (let n of Xe(e.children)) t.push(n);
694
+ if (O(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);
696
696
  return t;
697
697
  }
698
- function Xe(e) {
699
- return e.flatMap(M);
698
+ function Ze(e) {
699
+ return e.flatMap(j);
700
700
  }
701
- function N(e, t) {
702
- return typeof e.blockId != "string" || e.blockId === "" ? D("invalid_operation", t, "blockId must be a block id.") : e.blockId;
701
+ function M(e, t) {
702
+ return typeof e.blockId != "string" || e.blockId === "" ? E("invalid_operation", t, "blockId must be a block id.") : e.blockId;
703
703
  }
704
- function Ze(e, t) {
704
+ function Qe(e, t) {
705
705
  let n = e.parent;
706
- return n === null ? null : O(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
706
+ return n === null ? null : D(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
707
707
  sectionId: n.sectionId,
708
708
  column: n.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\" }.");
709
+ } : D(n) && typeof n.wrapperId == "string" && n.wrapperId !== "" && !Object.hasOwn(n, "sectionId") && !Object.hasOwn(n, "column") ? { wrapperId: n.wrapperId } : E("invalid_operation", t, "parent must be null, { \"sectionId\", \"column\" }, or { \"wrapperId\" }.");
710
710
  }
711
- function Qe(e, t) {
711
+ function $e(e, t) {
712
712
  let n = e.after;
713
- return n === null ? null : typeof n == "string" && n !== "" ? n : D("invalid_operation", t, "after must be null or a block id.");
713
+ return n === null ? null : typeof n == "string" && n !== "" ? n : E("invalid_operation", t, "after must be null or a block id.");
714
714
  }
715
- function P(e, t) {
715
+ function N(e, t) {
716
716
  let n = e.expect;
717
- return n == null ? null : O(n) ? n : D("invalid_operation", t, "expect must be an object.");
717
+ return n == null ? null : D(n) ? n : E("invalid_operation", t, "expect must be an object.");
718
718
  }
719
- function $e(e, t, n) {
719
+ function et(e, t, n) {
720
720
  let r = e.set ?? null, i = e.unset ?? [];
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.");
721
+ (r === null || D(r)) && Array.isArray(i) && i.every((e) => typeof e == "string") || E("invalid_operation", t, "set must be an object and unset a list of keys.");
722
722
  let a = r === null ? {} : r, o = Object.keys(a).filter((e) => a[e] !== void 0);
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
+ o.length === 0 && i.length === 0 && E("invalid_operation", t, "Set or unset at least one key.");
724
+ for (let e of [...o, ...i]) n.has(e) && E("invalid_operation", t, `"${e}" can't be set or unset.`);
725
725
  let s = i.find((e) => o.includes(e));
726
- return s !== void 0 && D("invalid_operation", t, `"${s}" is both set and unset.`), {
726
+ return s !== void 0 && E("invalid_operation", t, `"${s}" is both set and unset.`), {
727
727
  set: Object.fromEntries(o.map((e) => [e, a[e]])),
728
728
  unset: i
729
729
  };
730
730
  }
731
- function et(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) et(n, t, "wrapper");
731
+ function tt(e, t, n) {
732
+ if (D(e) && typeof e.id == "string" && e.id !== "" && typeof e.type == "string" || E("invalid_operation", t, "A block needs a non-empty string id and a string type."), e.type === "wrapper") {
733
+ n !== "root" && E("invalid_operation", t, n === "column" ? "Wrappers can only be placed at the top level." : "Wrappers cannot be placed inside wrappers."), Array.isArray(e.children) || E("invalid_operation", t, "A wrapper needs children: a list of blocks.");
734
+ for (let n of e.children) tt(n, t, "wrapper");
735
735
  return;
736
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);
737
+ if (!O(e)) return;
738
+ n === "column" && E("invalid_operation", t, "Sections can only be placed at the top level."), n === "wrapper" && e.wrapper && E("invalid_operation", t, Be);
739
739
  let r = e.children;
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) et(n, t, "column");
740
+ Array.isArray(r) && r.every((e) => Array.isArray(e)) || E("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");
742
742
  }
743
- function F(e, t) {
743
+ function P(e, t) {
744
744
  return e.session === null || t.sessionId !== e.session;
745
745
  }
746
- function tt(e, t, n) {
747
- let r = e.locks.find((n) => t.includes(n.blockId) && F(e, n));
748
- r && D("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
749
- }
750
- function nt(e, t, n, r) {
751
- e.locks.find((r) => F(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);
746
+ function nt(e, t, n) {
747
+ let r = e.locks.find((n) => t.includes(n.blockId) && P(e, n));
748
+ r && E("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
752
749
  }
753
750
  function rt(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));
751
+ e.locks.find((r) => P(e, r) && r.blockId === t && ((r.locale ?? null) === null || r.locale === n)) && E("lock_held", r, `Block "${t}" is being edited in another session.`, t);
752
+ }
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) || E("precondition_failed", n, r === void 0 ? `Setting "${i}" has changed since.` : `"${i}" of block "${r}" has changed since.`, r));
755
755
  }
756
- function it(e, t, n) {
756
+ function at(e, t, n) {
757
757
  if (t === null) return Array.isArray(e.blocks) || (e.blocks = []), e.blocks;
758
758
  if ("wrapperId" in t) {
759
- let r = j(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);
759
+ let r = A(e, t.wrapperId);
760
+ return r ? r.block.type === "wrapper" ? Array.isArray(r.block.children) ? r.block.children : E("invalid_operation", n, `Wrapper "${t.wrapperId}" has no children list.`) : E("invalid_operation", n, `Block "${t.wrapperId}" isn't a wrapper.`) : E("block_missing", n, `No wrapper with id "${t.wrapperId}".`, t.wrapperId);
761
761
  }
762
- let r = j(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.`);
762
+ let r = A(e, t.sectionId);
763
+ if (!r) return E("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
764
+ if (!O(r.block)) return E("invalid_operation", n, `Block "${t.sectionId}" isn't a section.`);
765
765
  let i = r.block.children;
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]);
766
+ return !Array.isArray(i) || t.column < 0 || t.column >= i.length ? E("invalid_operation", n, `Section "${t.sectionId}" has no column ${t.column}.`) : (Array.isArray(i[t.column]) || (i[t.column] = []), i[t.column]);
767
767
  }
768
- function at(e, t, n) {
768
+ function ot(e, t, n) {
769
769
  if (t === null) return 0;
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;
770
+ let r = e.findIndex((e) => D(e) && e.id === t);
771
+ return r === -1 ? E("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
772
772
  }
773
- function ot(e, t, n, r) {
774
- let i = Ve(t), a = Array.isArray(e.children) ? e.children : [];
773
+ function st(e, t, n, r) {
774
+ let i = He(t), a = Array.isArray(e.children) ? e.children : [];
775
775
  for (let e = i; e < a.length; e++) {
776
776
  let t = a[e];
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.`);
777
+ Array.isArray(t) && t.length > 0 && E("invalid_operation", n, `Column ${e} of section "${r}" still holds blocks, so the layout can't drop it.`);
778
778
  }
779
779
  let o = a.slice(0, i);
780
780
  for (; o.length < i;) o.push([]);
781
781
  e.children = o;
782
782
  }
783
- function st(e, t, n) {
783
+ function ct(e, t, n) {
784
784
  for (let [n, r] of Object.entries(t)) n === "__proto__" ? Object.defineProperty(e, n, {
785
785
  value: m(r),
786
786
  writable: !0,
@@ -789,7 +789,7 @@ function st(e, t, n) {
789
789
  }) : e[n] = m(r);
790
790
  for (let t of n) delete e[t];
791
791
  }
792
- function ct(e) {
792
+ function lt(e) {
793
793
  return me(e).map((t) => {
794
794
  let n = t.path.replace(/\.(items|icons|rows)\[.*$/, "").replace(/\[(\d+)\]/g, ".$1").split(".").reduce((e, t) => e[t], e);
795
795
  return {
@@ -798,114 +798,114 @@ function ct(e) {
798
798
  };
799
799
  });
800
800
  }
801
- function lt(e, t, n) {
802
- let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ? ct(n).map(r) : []), a = ct(e).find((e) => !i.has(r(e)));
803
- a && D("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 && E("invalid_operation", t, `Element id "${a.id}" must not contain "." or "/".`, a.blockId);
804
804
  }
805
- function ut(e, t, n, r) {
805
+ function dt(e, t, n, r) {
806
806
  let i = t;
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 dt(e, i, n);
809
- case "moveBlock": return ft(e, i, n, r);
810
- case "deleteBlock": return pt(e, i, n, r);
811
- case "updateBlock": return mt(e, i, n, r);
812
- case "updateSettings": return ht(e, i, n);
813
- case "setContent": return At(e, i, n, r);
814
- case "setDefaultLocale": return jt(e, i, n, r);
815
- case "addLocale": return vt(e, i, n);
816
- case "removeLocale": return bt(e, i, n);
817
- case "updateBlockLocale": return Ot(e, i, n, r);
818
- case "updateSettingsLocale": return kt(e, i, n);
819
- default: D("invalid_operation", n, `Unknown operation "${i.op}".`);
807
+ switch (D(i) && typeof i.op == "string" || E("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: E("invalid_operation", n, `Unknown operation "${i.op}".`);
820
820
  }
821
821
  }
822
- function dt(e, t, n) {
823
- let r = Ze(t, n), i = Qe(t, n), a = t.block;
824
- et(a, n, r === null ? "root" : "wrapperId" in r ? "wrapper" : "column"), lt({
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({
825
825
  blocks: [a],
826
826
  settings: e.settings
827
827
  }, n);
828
- let o = new Set(Xe(A(e))), s = /* @__PURE__ */ new Set();
829
- for (let e of M(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 = it(e, r, n), l = at(c, i, n);
831
- Dt(e, a, r, n, !0), c.splice(l, 0, m(a));
832
- }
833
- function ft(e, t, n, r) {
834
- let i = N(t, n), a = Ze(t, n), o = Qe(t, n), s = P(t, n), c = s && s.parent !== void 0 ? Ze({ parent: s.parent }, n) : null, l = j(e, i);
835
- if (!l) return D("block_missing", n, `No block with id "${i}".`, i);
836
- if (tt(r, M(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);
839
- }
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 && M(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 = it(e, a, n);
842
- at(u.filter((e) => e !== l.block), o, n), Dt(e, l.block, a, n, !1), l.list.splice(l.index, 1), u.splice(at(u, o, n), 0, l.block);
828
+ let o = new Set(Ze(k(e))), s = /* @__PURE__ */ new Set();
829
+ for (let e of j(a)) (o.has(e) || s.has(e)) && E("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));
843
832
  }
844
833
  function pt(e, t, n, r) {
845
- let i = N(t, n), a = P(t, n), o = j(e, i);
846
- if (!o) return D("block_missing", n, `No block with id "${i}".`, i);
847
- tt(r, M(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);
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 E("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 = D(e) ? e.id ?? null : null;
838
+ h(l.parent, c) && h(t, s.after ?? null) || E("precondition_failed", n, `Block "${i}" has moved since.`, i);
839
+ }
840
+ a !== null && ("wrapperId" in a ? a.wrapperId : a.sectionId) === i && E("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) && E("invalid_operation", n, "A block cannot be moved into itself or its descendants."), O(l.block) && a !== null && "sectionId" in a && E("invalid_operation", n, "Sections can only be placed at the top level."), O(l.block) && l.block.wrapper && a !== null && "wrapperId" in a && E("invalid_operation", n, Be), l.block.type === "wrapper" && a !== null && E("invalid_operation", n, "wrapperId" in a ? "Wrappers cannot be placed inside wrappers." : "Wrappers can only be placed at the top level."), o === i && E("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);
848
843
  }
849
844
  function mt(e, t, n, r) {
850
- let i = N(t, n), { set: a, unset: o } = $e(t, n, Ue), s = P(t, n), c = j(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."), tt(r, [i], n), s && rt(l, s, n, i), u && c.parent !== null && "wrapperId" in c.parent && a.wrapper && D("invalid_operation", n, ze);
845
+ let i = M(t, n), a = N(t, n), o = A(e, i);
846
+ if (!o) return E("block_missing", n, `No block with id "${i}".`, i);
847
+ nt(r, j(o.block), n), a && !h(o.block, a.block ?? null) && E("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, We), s = N(t, n), c = A(e, i);
851
+ if (!c) return E("block_missing", n, `No block with id "${i}".`, i);
852
+ let l = c.block, u = O(l);
853
+ u && o.includes("columns") && E("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 && E("invalid_operation", n, Be);
854
854
  let d = { ...l };
855
- st(d, a, o), lt({
855
+ ct(d, a, o), ut({
856
856
  blocks: [d],
857
857
  settings: e.settings
858
858
  }, n, {
859
859
  blocks: [l],
860
860
  settings: e.settings
861
- }), u && Object.hasOwn(a, "columns") && ot(l, a.columns, n, i), st(l, a, o);
862
- let f = b(l);
861
+ }), u && Object.hasOwn(a, "columns") && st(l, a.columns, n, i), ct(l, a, o);
862
+ let f = Se(l);
863
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);
864
864
  }
865
- function ht(e, t, n) {
866
- let { set: r, unset: i } = $e(t, n, We), a = P(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 = {});
865
+ function gt(e, t, n) {
866
+ let { set: r, unset: i } = et(t, n, Ge), a = N(t, n);
867
+ e.settings?.locales?.length && (Object.hasOwn(r, "locale") || i.includes("locale")) && E("invalid_operation", n, "The default locale can't change while language versions exist."), D(e.settings) || (e.settings = {});
868
868
  let o = e.settings;
869
- a && rt(o, a, n), st(o, r, i);
870
- let s = Ce(e.settings);
869
+ a && it(o, a, n), ct(o, r, i);
870
+ let s = we(e.settings);
871
871
  h(o.l10n, s.l10n) || (s.l10n ? o.l10n = s.l10n : delete o.l10n);
872
872
  }
873
- function gt(e, t) {
873
+ function _t(e, t) {
874
874
  let n = e.locale;
875
- return ve(n) && n !== "__proto__" && n !== "constructor" && n !== "prototype" || D("invalid_operation", t, "locale must be a language tag."), n;
876
- }
877
- function _t(e, t, n) {
878
- let r = gt(t, n);
879
- return e.settings.locales?.includes(r) || D("invalid_operation", n, `Locale "${r}" isn't in settings.locales.`), r;
875
+ return ve(n) && n !== "__proto__" && n !== "constructor" && n !== "prototype" || E("invalid_operation", t, "locale must be a language tag."), n;
880
876
  }
881
877
  function vt(e, t, n) {
882
- let r = gt(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);
878
+ let r = _t(t, n);
879
+ return e.settings.locales?.includes(r) || E("invalid_operation", n, `Locale "${r}" isn't in settings.locales.`), r;
884
880
  }
885
- function I(e) {
886
- return e.flatMap((e) => O(e) ? [e, ...k(e) ? Je(e).flatMap(I) : e.type === "wrapper" && Array.isArray(e.children) ? I(e.children) : []] : []);
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
+ (C(e).toLowerCase() === a || i.some((e) => e.toLowerCase() === a) || typeof o != "number" || !Number.isInteger(o) || o < 0 || o > i.length) && E("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);
887
884
  }
888
- function yt(e, t) {
885
+ function F(e) {
886
+ return e.flatMap((e) => D(e) ? [e, ...O(e) ? Ye(e).flatMap(F) : e.type === "wrapper" && Array.isArray(e.children) ? F(e.children) : []] : []);
887
+ }
888
+ function bt(e, t) {
889
889
  let n = e.l10n;
890
- return O(n) && O(n[t]) ? n[t] : {};
891
- }
892
- function bt(e, t, n) {
893
- let r = _t(e, t, n), i = P(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 = I(A(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);
898
- e.settings.locales.splice(e.settings.locales.indexOf(r), 1), e.settings.locales.length === 0 && delete e.settings.locales;
890
+ return D(n) && D(n[t]) ? n[t] : {};
899
891
  }
900
892
  function xt(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") && [
893
+ let r = vt(e, t, n), i = N(t, n);
894
+ i && (!D(i.blocks) || i.settings !== void 0 && !D(i.settings)) && E("invalid_operation", n, "expect needs a blocks object and an optional settings layer.");
895
+ let a = e.settings, o = F(k(e)), s = Object.fromEntries(o.flatMap((e) => D(e.l10n) && Object.hasOwn(e.l10n, r) ? [[String(e.id), e.l10n[r]]] : []));
896
+ !i || h(s, i.blocks) && h(D(a.l10n) ? a.l10n[r] : void 0, i.settings) || E("precondition_failed", n, `Locale "${r}" has changed since.`);
897
+ for (let e of [...o, a]) D(e.l10n) && (delete e.l10n[r], Object.keys(e.l10n).length === 0 && delete e.l10n);
898
+ e.settings.locales.splice(e.settings.locales.indexOf(r), 1), e.settings.locales.length === 0 && delete e.settings.locales;
899
+ }
900
+ function St(e, t, n) {
901
+ (e.text === void 0 || ((e) => D(e) && Object.values(e).every((e) => D(e) && typeof e.value == "string" && typeof e.sourceHash == "string"))(e.text)) && (e.set === void 0 || D(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") && [
902
902
  "text",
903
903
  "set",
904
904
  "unset",
905
905
  ...n ? [] : ["hidden"]
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 = P(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."), {
906
+ ].some((t) => e[t] !== void 0) || E("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 && !D(r.text) || r.set !== void 0 && !D(r.set) || r.hidden !== void 0 && (n || typeof r.hidden != "boolean")) && E("invalid_operation", t, "The locale layer expect is malformed."), {
909
909
  text: e.text ?? {},
910
910
  set: e.set ?? {},
911
911
  unset: e.unset ?? [],
@@ -913,87 +913,87 @@ function xt(e, t, n) {
913
913
  expect: r
914
914
  };
915
915
  }
916
- function St(e, t, n, r) {
917
- for (let i of Object.keys(t.text)) v(i) && (r ? g.includes(i) : Te(String(e.type), i)) && y(e, i) !== void 0 || D("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 || E("invalid_operation", n, `Text path "${i}" isn't translatable or doesn't resolve.`);
918
918
  for (let i of Object.keys(t.set)) {
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 && Se(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.`);
919
+ let a = i.split("."), o = r ? Ke : We, 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 && !D(s)) && E("invalid_operation", n, `Override path "${i}" is immutable or doesn't resolve.`);
921
921
  }
922
922
  }
923
- function Ct(e, t, n, r) {
923
+ function wt(e, t, n, r) {
924
924
  if (t) {
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);
925
+ for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {})) h(e[i]?.[a] ?? null, o) || E("precondition_failed", n, `Locale path "${a}" has changed since.`, r);
926
+ t.hidden !== void 0 && !h(e.hidden === !0, t.hidden) && E("precondition_failed", n, "The locale's hidden state has changed since.", r);
927
927
  }
928
928
  }
929
- function wt(e, t, n) {
930
- O(e.l10n) || (e.l10n = {});
931
- let r = e.l10n, i = Object.prototype.hasOwnProperty.call(r, t) ? r[t] : void 0, a = O(i) ? i : {};
929
+ function Tt(e, t, n) {
930
+ D(e.l10n) || (e.l10n = {});
931
+ let r = e.l10n, i = Object.prototype.hasOwnProperty.call(r, t) ? r[t] : void 0, a = D(i) ? i : {};
932
932
  a !== i && (r[t] = a);
933
933
  for (let e of n.unset) a.text && delete a.text[e], a.set && delete a.set[e];
934
934
  for (let [e, t] of Object.entries(n.text)) a.text ||= {}, a.text[e] = m(t), a.set && delete a.set[e];
935
935
  for (let [e, t] of Object.entries(n.set)) a.set ||= {}, a.set[e] = m(t), a.text && delete a.text[e];
936
936
  n.hidden === !0 ? a.hidden = !0 : n.hidden === !1 && delete a.hidden, a.text && Object.keys(a.text).length === 0 && delete a.text, a.set && Object.keys(a.set).length === 0 && delete a.set, Object.keys(a).length === 0 && delete r[t], Object.keys(r).length === 0 && delete e.l10n;
937
937
  }
938
- function L(e) {
939
- return O(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(L) : L(e)) : !1;
940
- }
941
- function Tt(e) {
942
- return O(e) && O(e.l10n) && Object.values(e.l10n).some((e) => O(e) && e.hidden === !0);
938
+ function I(e) {
939
+ return D(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(I) : I(e)) : !1;
943
940
  }
944
941
  function Et(e) {
945
- return !O(e) || !L(e) ? !1 : Tt(e) ? !0 : Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(Et) : Et(e));
942
+ return D(e) && D(e.l10n) && Object.values(e.l10n).some((e) => D(e) && e.hidden === !0);
943
+ }
944
+ function Dt(e) {
945
+ return !D(e) || !I(e) ? !1 : Et(e) ? !0 : Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(Dt) : Dt(e));
946
946
  }
947
- function Dt(e, t, n, r, i) {
948
- if (!L(t)) return;
947
+ function Ot(e, t, n, r, i) {
948
+ if (!I(t)) return;
949
949
  let a = n, o = !1;
950
950
  for (; a !== null;) {
951
- let t = j(e, "wrapperId" in a ? a.wrapperId : a.sectionId);
951
+ let t = A(e, "wrapperId" in a ? a.wrapperId : a.sectionId);
952
952
  if (!t) break;
953
- Tt(t.block) && (o = !0), a = t.parent;
953
+ Et(t.block) && (o = !0), a = t.parent;
954
954
  }
955
- (o || i && Et(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);
955
+ (o || i && Dt(t)) && E("invalid_operation", r, "A layout's slot block can't be placed inside a block that a language hides.", D(t) && typeof t.id == "string" ? t.id : void 0);
956
956
  }
957
- function Ot(e, t, n, r) {
958
- let i = _t(e, t, n), a = N(t, n), o = xt(t, n, !1), s = I(A(e)).find((e) => e.id === a);
959
- s || D("block_missing", n, `No block with id "${a}".`, a), St(s, o, n, !1), nt(r, a, i, n), Ct(yt(s, i), o.expect, n, a), o.hidden === !0 && L(s) && D("invalid_operation", n, "A layout's slot block, and any block that contains it, can't be hidden.", a), wt(s, i, o);
957
+ function kt(e, t, n, r) {
958
+ let i = vt(e, t, n), a = M(t, n), o = St(t, n, !1), s = F(k(e)).find((e) => e.id === a);
959
+ s || E("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) && E("invalid_operation", n, "A layout's slot block, and any block that contains it, can't be hidden.", a), Tt(s, i, o);
960
960
  }
961
- function kt(e, t, n) {
962
- let r = _t(e, t, n), i = xt(t, n, !0), a = e.settings;
963
- St(a, i, n, !0), Ct(yt(a, r), i.expect, n), wt(a, r, i);
964
- }
965
- function At(e, t, n, r) {
966
- let i = t.content;
967
- 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.");
968
- lt(i, n, e);
969
- let a = r.locks.find((e) => F(r, e));
970
- 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);
961
+ function At(e, t, n) {
962
+ let r = vt(e, t, n), i = St(t, n, !0), a = e.settings;
963
+ Ct(a, i, n, !0), wt(bt(a, r), i.expect, n), Tt(a, r, i);
971
964
  }
972
965
  function jt(e, t, n, r) {
973
- let i = gt(t, n);
974
- e.settings.locales?.includes(i) || D("invalid_operation", n, `"${i}" is not a language version of this template.`);
975
- let a = Fe(e, i);
976
- 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]);
977
- let o = r.locks.find((e) => F(r, e));
978
- o && D("locked_by_others", n, "Other sessions hold locks on this template.", o.blockId);
966
+ let i = t.content;
967
+ if (!D(i) || !Array.isArray(i.blocks) || !D(i.settings)) return E("invalid_operation", n, "setContent needs content with a blocks array and a settings object.");
968
+ ut(i, n, e);
969
+ let a = r.locks.find((e) => P(r, e));
970
+ a && E("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = m(i.blocks), e.settings = m(i.settings);
971
+ }
972
+ function Mt(e, t, n, r) {
973
+ let i = _t(t, n);
974
+ e.settings.locales?.includes(i) || E("invalid_operation", n, `"${i}" is not a language version of this template.`);
975
+ let a = Ie(e, i);
976
+ a.length && E("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]);
977
+ let o = r.locks.find((e) => P(r, e));
978
+ o && E("locked_by_others", n, "Other sessions hold locks on this template.", o.blockId);
979
979
  let s = t.customTextFields;
980
980
  if (s !== void 0) {
981
- let t = I(e.blocks);
982
- (!O(s) || Object.getOwnPropertyNames(s).some((e) => {
983
- if (Ke.has(e)) return !0;
981
+ let t = F(e.blocks);
982
+ (!D(s) || Object.getOwnPropertyNames(s).some((e) => {
983
+ if (qe.has(e)) return !0;
984
984
  let n = s[e], r = t.find((t) => t.id === e);
985
- return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !v(e) || !Te("custom", e) || typeof y(r, e) != "string");
986
- })) && D("invalid_operation", n, qe);
985
+ return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !v(e) || !Ee("custom", e) || typeof y(r, e) != "string");
986
+ })) && E("invalid_operation", n, Je);
987
987
  }
988
- let c = Re(e, i, t.customTextFields);
988
+ let c = ze(e, i, t.customTextFields);
989
989
  e.blocks = c.blocks, e.settings = c.settings;
990
990
  }
991
991
  // ../types/src/invert-operations.ts
992
- function Mt(e) {
992
+ function Nt(e) {
993
993
  let t = e.children;
994
994
  return e.type === "section" && Array.isArray(t) ? t : [];
995
995
  }
996
- function Nt(e, t, n = null) {
996
+ function Pt(e, t, n = null) {
997
997
  for (let r = 0; r < e.length; r++) {
998
998
  let i = e[r];
999
999
  if (i.id === t) return {
@@ -1001,28 +1001,28 @@ function Nt(e, t, n = null) {
1001
1001
  parent: n,
1002
1002
  after: r > 0 ? e[r - 1].id : null
1003
1003
  };
1004
- let a = Mt(i);
1004
+ let a = Nt(i);
1005
1005
  for (let e = 0; e < a.length; e++) {
1006
1006
  if (!Array.isArray(a[e])) continue;
1007
- let n = Nt(a[e], t, {
1007
+ let n = Pt(a[e], t, {
1008
1008
  sectionId: i.id,
1009
1009
  column: e
1010
1010
  });
1011
1011
  if (n) return n;
1012
1012
  }
1013
1013
  if (i.type === "wrapper" && Array.isArray(i.children)) {
1014
- let e = Nt(i.children, t, { wrapperId: i.id });
1014
+ let e = Pt(i.children, t, { wrapperId: i.id });
1015
1015
  if (e) return e;
1016
1016
  }
1017
1017
  }
1018
1018
  return null;
1019
1019
  }
1020
- function Pt(e, t, n) {
1021
- let r = Nt(e.blocks, t);
1022
- if (!r) throw new T("block_missing", n, `No block with id "${t}".`, t);
1020
+ function Ft(e, t, n) {
1021
+ let r = Pt(e.blocks, t);
1022
+ if (!r) throw new w("block_missing", n, `No block with id "${t}".`, t);
1023
1023
  return r;
1024
1024
  }
1025
- function Ft(e, t, n) {
1025
+ function It(e, t, n) {
1026
1026
  let r = {}, i = [], a = {}, o = [.../* @__PURE__ */ new Set([...Object.keys(t ?? {}), ...n ?? []])];
1027
1027
  for (let n of o) {
1028
1028
  let o = e[n];
@@ -1036,10 +1036,10 @@ function Ft(e, t, n) {
1036
1036
  expect: a
1037
1037
  };
1038
1038
  }
1039
- function R(e, t) {
1039
+ function L(e, t) {
1040
1040
  return e.l10n?.[t] ?? {};
1041
1041
  }
1042
- function z(e, t, n, r) {
1042
+ function R(e, t, n, r) {
1043
1043
  let i = {}, a = {}, o = {};
1044
1044
  n.length && (o.text = {}, o.set = {});
1045
1045
  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);
@@ -1051,21 +1051,21 @@ function z(e, t, n, r) {
1051
1051
  expect: o
1052
1052
  };
1053
1053
  }
1054
- function It(e) {
1055
- let { unset: t, ...n } = z(e, {}, [.../* @__PURE__ */ new Set([...Object.keys(e.text ?? {}), ...Object.keys(e.set ?? {})])], e.hidden === !0);
1054
+ function Lt(e) {
1055
+ let { unset: t, ...n } = R(e, {}, [.../* @__PURE__ */ new Set([...Object.keys(e.text ?? {}), ...Object.keys(e.set ?? {})])], e.hidden === !0);
1056
1056
  return n;
1057
1057
  }
1058
- function B(e) {
1059
- return e.flatMap((e) => [e, ...e.type === "wrapper" ? B(e.children) : Mt(e).flatMap(B)]);
1058
+ function z(e) {
1059
+ return e.flatMap((e) => [e, ...e.type === "wrapper" ? z(e.children) : Nt(e).flatMap(z)]);
1060
1060
  }
1061
- function Lt(e, t) {
1061
+ function Rt(e, t) {
1062
1062
  let n = m(e);
1063
- E(n, [t]);
1063
+ T(n, [t]);
1064
1064
  let r = [], i = (e, t, n) => {
1065
1065
  for (let [i, a] of Object.entries(e.l10n ?? {})) {
1066
1066
  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))])];
1067
1067
  if (!o.length) continue;
1068
- let s = z(a, e, o, !1);
1068
+ let s = R(a, e, o, !1);
1069
1069
  r.push(n === void 0 ? {
1070
1070
  op: "updateSettingsLocale",
1071
1071
  locale: i,
@@ -1080,15 +1080,15 @@ function Lt(e, t) {
1080
1080
  };
1081
1081
  if (t.op === "updateSettings") i(e.settings, n.settings);
1082
1082
  else {
1083
- let t = new Map(B(n.blocks).map((e) => [e.id, e]));
1084
- for (let n of B(e.blocks)) {
1083
+ let t = new Map(z(n.blocks).map((e) => [e.id, e]));
1084
+ for (let n of z(e.blocks)) {
1085
1085
  let e = t.get(n.id);
1086
1086
  e && i(n, e, n.id);
1087
1087
  }
1088
1088
  }
1089
1089
  return r;
1090
1090
  }
1091
- function Rt(e, t, n) {
1091
+ function zt(e, t, n) {
1092
1092
  switch (t.op) {
1093
1093
  case "addBlock": return {
1094
1094
  op: "deleteBlock",
@@ -1096,7 +1096,7 @@ function Rt(e, t, n) {
1096
1096
  expect: { block: m(t.block) }
1097
1097
  };
1098
1098
  case "deleteBlock": {
1099
- let r = Pt(e, t.blockId, n);
1099
+ let r = Ft(e, t.blockId, n);
1100
1100
  return {
1101
1101
  op: "addBlock",
1102
1102
  block: m(r.block),
@@ -1105,7 +1105,7 @@ function Rt(e, t, n) {
1105
1105
  };
1106
1106
  }
1107
1107
  case "moveBlock": {
1108
- let r = Pt(e, t.blockId, n);
1108
+ let r = Ft(e, t.blockId, n);
1109
1109
  return {
1110
1110
  op: "moveBlock",
1111
1111
  blockId: t.blockId,
@@ -1118,23 +1118,23 @@ function Rt(e, t, n) {
1118
1118
  };
1119
1119
  }
1120
1120
  case "updateBlock": {
1121
- let r = Pt(e, t.blockId, n).block, { set: i, unset: a, expect: o } = Ft(r, t.set, t.unset);
1121
+ let r = Ft(e, t.blockId, n).block, { set: i, unset: a, expect: o } = It(r, t.set, t.unset);
1122
1122
  return [{
1123
1123
  op: "updateBlock",
1124
1124
  blockId: t.blockId,
1125
1125
  ...Object.keys(i).length > 0 ? { set: i } : {},
1126
1126
  ...a.length > 0 ? { unset: a } : {},
1127
1127
  expect: o
1128
- }, ...Lt(e, t)];
1128
+ }, ...Rt(e, t)];
1129
1129
  }
1130
1130
  case "updateSettings": {
1131
- let { set: n, unset: r, expect: i } = Ft(e.settings, t.set, t.unset);
1131
+ let { set: n, unset: r, expect: i } = It(e.settings, t.set, t.unset);
1132
1132
  return [{
1133
1133
  op: "updateSettings",
1134
1134
  ...Object.keys(n).length > 0 ? { set: n } : {},
1135
1135
  ...r.length > 0 ? { unset: r } : {},
1136
1136
  expect: i
1137
- }, ...Lt(e, t)];
1137
+ }, ...Rt(e, t)];
1138
1138
  }
1139
1139
  case "addLocale": return {
1140
1140
  op: "removeLocale",
@@ -1147,18 +1147,18 @@ function Rt(e, t, n) {
1147
1147
  locale: t.locale,
1148
1148
  position: e.settings.locales?.indexOf(t.locale)
1149
1149
  }];
1150
- for (let r of B(e.blocks)) {
1150
+ for (let r of z(e.blocks)) {
1151
1151
  let e = r.l10n?.[t.locale];
1152
1152
  e && n.push({
1153
1153
  op: "updateBlockLocale",
1154
1154
  blockId: r.id,
1155
1155
  locale: t.locale,
1156
- ...It(e)
1156
+ ...Lt(e)
1157
1157
  });
1158
1158
  }
1159
1159
  let r = e.settings.l10n?.[t.locale];
1160
1160
  if (r) {
1161
- let { hidden: e, ...i } = It(r);
1161
+ let { hidden: e, ...i } = Lt(r);
1162
1162
  n.push({
1163
1163
  op: "updateSettingsLocale",
1164
1164
  locale: t.locale,
@@ -1170,22 +1170,22 @@ function Rt(e, t, n) {
1170
1170
  case "updateBlockLocale":
1171
1171
  case "updateSettingsLocale": {
1172
1172
  let n = m(e);
1173
- E(n, [t]);
1173
+ T(n, [t]);
1174
1174
  let r = [.../* @__PURE__ */ new Set([
1175
1175
  ...Object.keys(t.text ?? {}),
1176
1176
  ...Object.keys(t.set ?? {}),
1177
1177
  ...t.unset ?? []
1178
1178
  ])];
1179
1179
  if (t.op === "updateBlockLocale") {
1180
- let i = B(e.blocks).find((e) => e.id === t.blockId), a = B(n.blocks).find((e) => e.id === t.blockId);
1180
+ let i = z(e.blocks).find((e) => e.id === t.blockId), a = z(n.blocks).find((e) => e.id === t.blockId);
1181
1181
  return {
1182
1182
  op: "updateBlockLocale",
1183
1183
  blockId: t.blockId,
1184
1184
  locale: t.locale,
1185
- ...z(R(i, t.locale), R(a, t.locale), r, t.hidden !== void 0)
1185
+ ...R(L(i, t.locale), L(a, t.locale), r, t.hidden !== void 0)
1186
1186
  };
1187
1187
  }
1188
- let { hidden: i, ...a } = z(R(e.settings, t.locale), R(n.settings, t.locale), r, !1);
1188
+ let { hidden: i, ...a } = R(L(e.settings, t.locale), L(n.settings, t.locale), r, !1);
1189
1189
  return {
1190
1190
  op: "updateSettingsLocale",
1191
1191
  locale: t.locale,
@@ -1202,89 +1202,89 @@ function Rt(e, t, n) {
1202
1202
  };
1203
1203
  }
1204
1204
  }
1205
- function zt(e, t) {
1205
+ function Bt(e, t) {
1206
1206
  let n = m(e), r = [];
1207
1207
  return t.forEach((e, t) => {
1208
1208
  try {
1209
- let i = Rt(n, e, t);
1210
- r.push(...Array.isArray(i) ? [...i].reverse() : [i]), E(n, [e]);
1209
+ let i = zt(n, e, t);
1210
+ r.push(...Array.isArray(i) ? [...i].reverse() : [i]), T(n, [e]);
1211
1211
  } catch (e) {
1212
- throw e instanceof T ? new T(e.code, t, e.message, e.blockId) : e;
1212
+ throw e instanceof w ? new w(e.code, t, e.message, e.blockId) : e;
1213
1213
  }
1214
1214
  }), r.reverse();
1215
1215
  }
1216
1216
  // ../types/src/collaboration.ts
1217
- function Bt(e) {
1217
+ function Vt(e) {
1218
1218
  return e === "invalid_operation" ? 422 : e === "content_too_large" ? 413 : 409;
1219
1219
  }
1220
- var Vt = class extends ge {
1220
+ var Ht = class extends ge {
1221
1221
  opIndex;
1222
1222
  holder;
1223
1223
  holders;
1224
1224
  constructor(e, t) {
1225
- super(e, t.status ?? Bt(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);
1225
+ 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);
1226
1226
  }
1227
1227
  };
1228
1228
  // ../types/src/guards.ts
1229
- function Ht(e) {
1229
+ function Ut(e) {
1230
1230
  return e.type === "section";
1231
1231
  }
1232
- function Ut(e) {
1232
+ function Wt(e) {
1233
1233
  return e.type === "title";
1234
1234
  }
1235
- function Wt(e) {
1235
+ function Gt(e) {
1236
1236
  return e.type === "paragraph";
1237
1237
  }
1238
- function Gt(e) {
1238
+ function Kt(e) {
1239
1239
  return e.type === "image";
1240
1240
  }
1241
- function Kt(e) {
1241
+ function qt(e) {
1242
1242
  return e.type === "button";
1243
1243
  }
1244
- function qt(e) {
1244
+ function Jt(e) {
1245
1245
  return e.type === "divider";
1246
1246
  }
1247
- function Jt(e) {
1247
+ function Yt(e) {
1248
1248
  return e.type === "video";
1249
1249
  }
1250
- function Yt(e) {
1250
+ function Xt(e) {
1251
1251
  return e.type === "social";
1252
1252
  }
1253
- function Xt(e) {
1253
+ function Zt(e) {
1254
1254
  return e.type === "spacer";
1255
1255
  }
1256
- function Zt(e) {
1256
+ function Qt(e) {
1257
1257
  return e.type === "html";
1258
1258
  }
1259
- function Qt(e) {
1259
+ function $t(e) {
1260
1260
  return e.type === "menu";
1261
1261
  }
1262
- function $t(e) {
1262
+ function en(e) {
1263
1263
  return e.type === "table";
1264
1264
  }
1265
- function en(e) {
1265
+ function tn(e) {
1266
1266
  return e.type === "countdown";
1267
1267
  }
1268
- function tn(e) {
1268
+ function nn(e) {
1269
1269
  return e.type === "custom";
1270
1270
  }
1271
- function V(e) {
1271
+ function B(e) {
1272
1272
  return e.type === "slot";
1273
1273
  }
1274
- function H(e) {
1274
+ function V(e) {
1275
1275
  return e.type === "wrapper";
1276
1276
  }
1277
1277
  // ../types/src/defaults.ts
1278
- var nn = {
1278
+ var rn = {
1279
1279
  content: "<p>Enter your title</p>",
1280
1280
  level: 2,
1281
1281
  textAlign: "left"
1282
- }, rn = { content: "<p>Enter your text here</p>" }, an = {
1282
+ }, an = { content: "<p>Enter your text here</p>" }, on = {
1283
1283
  src: "",
1284
1284
  alt: "",
1285
1285
  width: "full",
1286
1286
  align: "center"
1287
- }, on = {
1287
+ }, sn = {
1288
1288
  text: "Click Here",
1289
1289
  url: "",
1290
1290
  backgroundColor: "#333333",
@@ -1298,36 +1298,36 @@ var nn = {
1298
1298
  left: 24
1299
1299
  },
1300
1300
  align: "center"
1301
- }, sn = {
1301
+ }, cn = {
1302
1302
  lineStyle: "solid",
1303
1303
  color: "#e0e0e0",
1304
1304
  thickness: 1,
1305
1305
  width: "full"
1306
- }, cn = { columns: "1" }, ln = {
1306
+ }, ln = { columns: "1" }, un = {
1307
1307
  url: "",
1308
1308
  thumbnailUrl: "",
1309
1309
  alt: "Video",
1310
1310
  width: "full",
1311
1311
  align: "center"
1312
- }, un = {
1312
+ }, dn = {
1313
1313
  iconStyle: "solid",
1314
1314
  iconSize: "medium",
1315
1315
  spacing: 10,
1316
1316
  align: "center"
1317
- }, dn = { height: 24 }, fn = { content: "" }, pn = {
1317
+ }, fn = { height: 24 }, pn = { content: "" }, mn = {
1318
1318
  fontSize: 15,
1319
1319
  textAlign: "center",
1320
1320
  separator: "|",
1321
1321
  separatorColor: "#e0e0e0",
1322
1322
  spacing: 10
1323
- }, mn = {
1323
+ }, hn = {
1324
1324
  hasHeaderRow: !0,
1325
1325
  borderColor: "#e0e0e0",
1326
1326
  borderWidth: 1,
1327
1327
  cellPadding: 8,
1328
1328
  fontSize: 15,
1329
1329
  textAlign: "left"
1330
- }, hn = {
1330
+ }, gn = {
1331
1331
  targetDate: "",
1332
1332
  timezone: "UTC",
1333
1333
  showDays: !0,
@@ -1347,21 +1347,21 @@ var nn = {
1347
1347
  expiredMessage: "This offer has expired",
1348
1348
  expiredImageUrl: "",
1349
1349
  hideOnExpiry: !1
1350
- }, gn = {
1351
- title: nn,
1352
- paragraph: rn,
1353
- image: an,
1354
- button: on,
1355
- divider: sn,
1356
- section: cn,
1357
- video: ln,
1358
- social: un,
1359
- spacer: dn,
1360
- html: fn,
1361
- menu: pn,
1362
- table: mn,
1363
- countdown: hn
1364
1350
  }, _n = {
1351
+ title: rn,
1352
+ paragraph: an,
1353
+ image: on,
1354
+ button: sn,
1355
+ divider: cn,
1356
+ section: ln,
1357
+ video: un,
1358
+ social: dn,
1359
+ spacer: fn,
1360
+ html: pn,
1361
+ menu: mn,
1362
+ table: hn,
1363
+ countdown: gn
1364
+ }, vn = {
1365
1365
  width: 600,
1366
1366
  backgroundColor: "#ffffff",
1367
1367
  textColor: "#1a1a1a",
@@ -1369,30 +1369,30 @@ var nn = {
1369
1369
  fontFamily: "Arial",
1370
1370
  locale: "en"
1371
1371
  };
1372
- function vn(e) {
1372
+ function yn(e) {
1373
1373
  return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
1374
1374
  }
1375
- function yn(e, t) {
1375
+ function bn(e, t) {
1376
1376
  let n = { ...e };
1377
1377
  for (let r of Object.keys(t)) {
1378
1378
  let i = e[r], a = t[r];
1379
- a !== void 0 && (n[r] = vn(i) && vn(a) ? yn(i, a) : a);
1379
+ a !== void 0 && (n[r] = yn(i) && yn(a) ? bn(i, a) : a);
1380
1380
  }
1381
1381
  return n;
1382
1382
  }
1383
1383
  // ../types/src/template.ts
1384
- function bn(e = "Arial", t) {
1384
+ function xn(e = "Arial", t) {
1385
1385
  return {
1386
1386
  blocks: [],
1387
1387
  settings: {
1388
- ..._n,
1388
+ ...vn,
1389
1389
  fontFamily: e,
1390
1390
  ...t
1391
1391
  }
1392
1392
  };
1393
1393
  }
1394
1394
  // ../types/src/direction.ts
1395
- var xn = [
1395
+ var Sn = [
1396
1396
  "ar",
1397
1397
  "he",
1398
1398
  "iw",
@@ -1406,24 +1406,24 @@ var xn = [
1406
1406
  "ckb",
1407
1407
  "ks"
1408
1408
  ];
1409
- function Sn(e) {
1409
+ function Cn(e) {
1410
1410
  let t = e?.trim().replace(/_/g, "-").split("-")[0]?.toLowerCase();
1411
- return !!t && xn.includes(t);
1411
+ return !!t && Sn.includes(t);
1412
1412
  }
1413
- function Cn(e) {
1414
- return e.direction === "ltr" || e.direction === "rtl" ? e.direction : Sn(e.locale) ? "rtl" : "ltr";
1413
+ function wn(e) {
1414
+ return e.direction === "ltr" || e.direction === "rtl" ? e.direction : Cn(e.locale) ? "rtl" : "ltr";
1415
1415
  }
1416
1416
  // ../types/src/translation.ts
1417
- var wn = 2e4, Tn = /* @__PURE__ */ new Set(["\"", "'"]);
1418
- function En(e, t) {
1417
+ var Tn = 2e4, En = /* @__PURE__ */ new Set(["\"", "'"]);
1418
+ function Dn(e, t) {
1419
1419
  let n = null, r = "tag";
1420
1420
  for (let i = t; i < e.length; i++) {
1421
1421
  let t = e[i];
1422
1422
  if (n !== null) t === n && (n = null);
1423
1423
  else {
1424
1424
  if (r === "beforeValue") {
1425
- if (U(t)) continue;
1426
- if (Tn.has(t)) {
1425
+ if (H(t)) continue;
1426
+ if (En.has(t)) {
1427
1427
  n = t, r = "tag";
1428
1428
  continue;
1429
1429
  }
@@ -1431,19 +1431,19 @@ function En(e, t) {
1431
1431
  }
1432
1432
  if (r === "unquotedValue") {
1433
1433
  if (t === ">") return i;
1434
- U(t) && (r = "tag");
1434
+ H(t) && (r = "tag");
1435
1435
  } else if (t === "=") r = "beforeValue";
1436
1436
  else if (t === ">") return i;
1437
1437
  }
1438
1438
  }
1439
1439
  return -1;
1440
1440
  }
1441
- function Dn(e, t) {
1441
+ function On(e, t) {
1442
1442
  let n = null;
1443
1443
  for (let r = t; r < e.length; r++) {
1444
1444
  let t = e[r];
1445
1445
  if (n !== null) t === n && (n = null);
1446
- else if (Tn.has(t)) n = t;
1446
+ else if (En.has(t)) n = t;
1447
1447
  else if (t === ">") return {
1448
1448
  end: r,
1449
1449
  nextSpan: -1
@@ -1458,13 +1458,13 @@ function Dn(e, t) {
1458
1458
  nextSpan: -1
1459
1459
  };
1460
1460
  }
1461
- function On(e) {
1461
+ function kn(e) {
1462
1462
  return e !== " " && e !== " " && e !== "\n" && e !== "\r" && e !== "\f" && e !== "=" && e !== ">" && e !== "/";
1463
1463
  }
1464
- function U(e) {
1464
+ function H(e) {
1465
1465
  return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
1466
1466
  }
1467
- var kn = {
1467
+ var An = {
1468
1468
  AMP: "&",
1469
1469
  COPY: "©",
1470
1470
  GT: ">",
@@ -1725,54 +1725,54 @@ var kn = {
1725
1725
  zwj: "‍",
1726
1726
  zwnj: "‌"
1727
1727
  };
1728
- function W(e) {
1728
+ function U(e) {
1729
1729
  return e.includes("&") ? e.replace(/&(#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g, (e, t) => {
1730
1730
  if (t[0] === "#") {
1731
1731
  let n = t[1] === "x" || t[1] === "X" ? Number.parseInt(t.slice(2), 16) : Number.parseInt(t.slice(1), 10);
1732
1732
  return !Number.isFinite(n) || n < 1 || n > 1114111 || n >= 55296 && n <= 57343 ? e : String.fromCodePoint(n);
1733
1733
  }
1734
- return Object.hasOwn(kn, t) ? kn[t] : e;
1734
+ return Object.hasOwn(An, t) ? An[t] : e;
1735
1735
  }) : e;
1736
1736
  }
1737
- function An(e, t) {
1737
+ function jn(e, t) {
1738
1738
  let n = t.toLowerCase(), r = 0;
1739
1739
  for (; r < e.length;) {
1740
- for (; r < e.length && (U(e[r]) || e[r] === "/");) r++;
1740
+ for (; r < e.length && (H(e[r]) || e[r] === "/");) r++;
1741
1741
  if (r >= e.length) break;
1742
1742
  let t = r;
1743
- for (; r < e.length && On(e[r]);) r++;
1743
+ for (; r < e.length && kn(e[r]);) r++;
1744
1744
  let i = e.substring(t, r).toLowerCase();
1745
1745
  if (i === "") {
1746
1746
  r++;
1747
1747
  continue;
1748
1748
  }
1749
- for (; r < e.length && U(e[r]);) r++;
1749
+ for (; r < e.length && H(e[r]);) r++;
1750
1750
  if (e[r] !== "=") continue;
1751
- for (r++; r < e.length && U(e[r]);) r++;
1751
+ for (r++; r < e.length && H(e[r]);) r++;
1752
1752
  let a = e[r];
1753
- if (Tn.has(a)) {
1753
+ if (En.has(a)) {
1754
1754
  let t = r + 1, o = e.indexOf(a, t);
1755
1755
  if (o === -1) return null;
1756
- if (i === n) return W(e.substring(t, o));
1756
+ if (i === n) return U(e.substring(t, o));
1757
1757
  r = o + 1;
1758
1758
  continue;
1759
1759
  }
1760
1760
  let o = r;
1761
- for (; r < e.length && !U(e[r]) && e[r] !== ">";) r++;
1762
- if (i === n) return W(e.substring(o, r));
1761
+ for (; r < e.length && !H(e[r]) && e[r] !== ">";) r++;
1762
+ if (i === n) return U(e.substring(o, r));
1763
1763
  }
1764
1764
  return null;
1765
1765
  }
1766
1766
  // ../types/src/merge-tag-html.ts
1767
- function jn(e) {
1768
- return Pn(e, (e) => e, !1);
1767
+ function Mn(e) {
1768
+ return Fn(e, (e) => e, !1);
1769
1769
  }
1770
- function Mn(e, t) {
1771
- return Pn(e, t, !0);
1770
+ function Nn(e, t) {
1771
+ return Fn(e, t, !0);
1772
1772
  }
1773
- function Nn(e) {
1773
+ function Pn(e) {
1774
1774
  let t = [];
1775
- return Pn(e, (n, r, i) => {
1775
+ return Fn(e, (n, r, i) => {
1776
1776
  let a = e.slice(r, i);
1777
1777
  return t.push({
1778
1778
  start: r,
@@ -1781,7 +1781,7 @@ function Nn(e) {
1781
1781
  }), a;
1782
1782
  }, !0), t;
1783
1783
  }
1784
- function Pn(e, t, n) {
1784
+ function Fn(e, t, n) {
1785
1785
  let r = "", i = 0;
1786
1786
  for (; i < e.length;) {
1787
1787
  let a = e.indexOf("<span", i);
@@ -1794,7 +1794,7 @@ function Pn(e, t, n) {
1794
1794
  r += e.substring(i, a + 5), i = a + 5;
1795
1795
  continue;
1796
1796
  }
1797
- let { end: s, nextSpan: c } = Dn(e, a + 5);
1797
+ let { end: s, nextSpan: c } = On(e, a + 5);
1798
1798
  if (c !== -1) {
1799
1799
  r += e.substring(i, c), i = c;
1800
1800
  continue;
@@ -1803,12 +1803,12 @@ function Pn(e, t, n) {
1803
1803
  r += e.substring(i);
1804
1804
  break;
1805
1805
  }
1806
- let l = e.substring(a + 5, s), u = In(l, "data-merge-tag") ?? In(l, "data-logic-merge-tag");
1806
+ let l = e.substring(a + 5, s), u = Ln(l, "data-merge-tag") ?? Ln(l, "data-logic-merge-tag");
1807
1807
  if (u === null) {
1808
1808
  r += e.substring(i, s + 1), i = s + 1;
1809
1809
  continue;
1810
1810
  }
1811
- let d = Fn(e, s + 1, n);
1811
+ let d = In(e, s + 1, n);
1812
1812
  if (d === -1) {
1813
1813
  r += e.substring(i);
1814
1814
  break;
@@ -1817,7 +1817,7 @@ function Pn(e, t, n) {
1817
1817
  }
1818
1818
  return r;
1819
1819
  }
1820
- function Fn(e, t, n) {
1820
+ function In(e, t, n) {
1821
1821
  if (!n) {
1822
1822
  let n = e.indexOf("</span>", t);
1823
1823
  return n === -1 ? -1 : n + 7;
@@ -1826,7 +1826,7 @@ function Fn(e, t, n) {
1826
1826
  for (; i < e.length;) {
1827
1827
  let t = e.indexOf("<", i);
1828
1828
  if (t === -1) return -1;
1829
- let n = En(e, t + 1);
1829
+ let n = Dn(e, t + 1);
1830
1830
  if (n === -1) return -1;
1831
1831
  let a = e.startsWith("</span", t), o = e.startsWith("<span", t), s = e[t + (a ? 6 : 5)];
1832
1832
  if ((o || a) && (s === ">" || s === "/" || /\s/.test(s)) && (r += a ? -1 : 1, r === 0)) return n + 1;
@@ -1834,11 +1834,11 @@ function Fn(e, t, n) {
1834
1834
  }
1835
1835
  return -1;
1836
1836
  }
1837
- function In(e, t) {
1838
- return An(e, t);
1837
+ function Ln(e, t) {
1838
+ return jn(e, t);
1839
1839
  }
1840
1840
  // ../types/src/merge-tags.ts
1841
- var G = {
1841
+ var W = {
1842
1842
  liquid: {
1843
1843
  value: /\{\{.+?\}\}/g,
1844
1844
  logic: /\{%-?\s*(\w+).*?-?%\}/g,
@@ -1864,13 +1864,13 @@ var G = {
1864
1864
  closer: "=%%"
1865
1865
  }
1866
1866
  };
1867
- function K(e) {
1868
- return Object.keys(G).find((t) => {
1869
- let n = G[t];
1867
+ function G(e) {
1868
+ return Object.keys(W).find((t) => {
1869
+ let n = W[t];
1870
1870
  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, ""));
1871
1871
  });
1872
1872
  }
1873
- function Ln(e, t, n) {
1873
+ function Rn(e, t, n) {
1874
1874
  for (let r = n; r < e.length; r++) {
1875
1875
  let n = e.charCodeAt(r);
1876
1876
  if (n === 10 || n === 13 || n === 8232 || n === 8233) return {
@@ -1887,8 +1887,8 @@ function Ln(e, t, n) {
1887
1887
  lineBreak: -1
1888
1888
  };
1889
1889
  }
1890
- function q(e, t, n, r = 0, i = Infinity) {
1891
- let a = K(t);
1890
+ function K(e, t, n, r = 0, i = Infinity) {
1891
+ let a = G(t);
1892
1892
  if (!a) {
1893
1893
  let a = t[n], o = new RegExp(a.source, a.flags.replace(/[gy]/g, "") + "g");
1894
1894
  return o.lastIndex = r, [...e.matchAll(o)].slice(0, i).map((e) => ({
@@ -1912,7 +1912,7 @@ function q(e, t, n, r = 0, i = Infinity) {
1912
1912
  let r = u?.lastIndex ?? t + s.length, i = a === "mailchimp" && n === "value" ? {
1913
1913
  close: e.startsWith(c, r) ? r : -1,
1914
1914
  lineBreak: -1
1915
- } : Ln(e, c, Math.max(r, t + s.length + +(n === "value")));
1915
+ } : Rn(e, c, Math.max(r, t + s.length + +(n === "value")));
1916
1916
  if (i.lineBreak >= 0) {
1917
1917
  let r = i.lineBreak, o = n === "logic" && (a === "liquid" || a === "ampscript") ? e.lastIndexOf(s, r) : -1;
1918
1918
  p = o > t ? o : r + 1;
@@ -1934,8 +1934,8 @@ function q(e, t, n, r = 0, i = Infinity) {
1934
1934
  }
1935
1935
  return f;
1936
1936
  }
1937
- function Rn(e, t) {
1938
- let n = K(t);
1937
+ function zn(e, t) {
1938
+ let n = G(t);
1939
1939
  if (!n) {
1940
1940
  let n = RegExp(`(${t.value.source}|${t.logic.source})`, "g");
1941
1941
  return [...e.matchAll(n)].map((e) => ({
@@ -1943,7 +1943,7 @@ function Rn(e, t) {
1943
1943
  value: e[0]
1944
1944
  }));
1945
1945
  }
1946
- if (n === "handlebars") return q(e, t, "value");
1946
+ if (n === "handlebars") return K(e, t, "value");
1947
1947
  if (n === "mailchimp") {
1948
1948
  let n = [], r = new RegExp(t.value.source, "y"), i = new RegExp(t.logic.source, "y"), a = /\*\|\w+[:|]/y, o = 0;
1949
1949
  for (; o < e.length;) {
@@ -1962,7 +1962,7 @@ function Rn(e, t) {
1962
1962
  o = t + 2;
1963
1963
  continue;
1964
1964
  }
1965
- let c = Ln(e, "|*", a.lastIndex);
1965
+ let c = Rn(e, "|*", a.lastIndex);
1966
1966
  if (c.lineBreak >= 0) {
1967
1967
  o = c.lineBreak + 1;
1968
1968
  continue;
@@ -1977,78 +1977,82 @@ function Rn(e, t) {
1977
1977
  }
1978
1978
  return n;
1979
1979
  }
1980
- let r = [], i = 0, a = q(e, t, "value", i, 1)[0], o = q(e, t, "logic", i, 1)[0];
1980
+ let r = [], i = 0, a = K(e, t, "value", i, 1)[0], o = K(e, t, "logic", i, 1)[0];
1981
1981
  for (; a || o;) {
1982
1982
  let n = !o || a && a.index <= o.index ? a : o;
1983
- r.push(n), i = n.index + n.value.length, (n === a || a && a.index < i) && (a = q(e, t, "value", i, 1)[0]), (n === o || o && o.index < i) && (o = q(e, t, "logic", i, 1)[0]);
1983
+ r.push(n), i = n.index + n.value.length, (n === a || a && a.index < i) && (a = K(e, t, "value", i, 1)[0]), (n === o || o && o.index < i) && (o = K(e, t, "logic", i, 1)[0]);
1984
1984
  }
1985
1985
  return r;
1986
1986
  }
1987
- function zn(e) {
1988
- return typeof e == "string" && e.trim() !== "" ? e : null;
1989
- }
1990
1987
  function Bn(e) {
1991
- return Object.values(G).find((t) => t.value.source === e.value.source) ?? null;
1988
+ return typeof e == "string" && e.trim() !== "" ? e : null;
1992
1989
  }
1993
1990
  function Vn(e) {
1994
- return zn(e.opener) ?? Bn(e)?.opener ?? null;
1991
+ return Object.values(W).find((t) => t.value.source === e.value.source) ?? null;
1995
1992
  }
1996
1993
  function Hn(e) {
1997
- return zn(e.closer) ?? Bn(e)?.closer ?? null;
1994
+ return Bn(e.opener) ?? Vn(e)?.opener ?? null;
1998
1995
  }
1999
1996
  function Un(e) {
2000
- return e ? typeof e == "string" ? G[e] ?? G.liquid : e : G.liquid;
1997
+ return Bn(e.closer) ?? Vn(e)?.closer ?? null;
2001
1998
  }
2002
1999
  function Wn(e) {
2000
+ return e ? typeof e == "string" ? W[e] ?? W.liquid : e : W.liquid;
2001
+ }
2002
+ function Gn(e) {
2003
2003
  let t = e.source, n = e.flags.replace("g", "");
2004
2004
  return RegExp(`^${t}$`, n);
2005
2005
  }
2006
- function Gn(e, t) {
2006
+ function Kn(e, t) {
2007
2007
  let n = e?.trim() || "";
2008
- return !Wn(t.logic).test(n) && Wn(t.value).test(n);
2008
+ return !Gn(t.logic).test(n) && Gn(t.value).test(n);
2009
2009
  }
2010
- function Kn(e, t) {
2010
+ function qn(e, t) {
2011
2011
  let n = t.find((t) => t.value === e);
2012
2012
  return n ? n.label : e;
2013
2013
  }
2014
- function qn(e, t) {
2015
- return rr(e, "data-merge-tag", (e) => Kn(e, t));
2016
- }
2017
2014
  function Jn(e, t) {
2018
- return t.find((t) => t.value === e)?.sample;
2015
+ return q(e, "data-merge-tag", (e) => qn(e, t));
2019
2016
  }
2020
2017
  function Yn(e, t) {
2021
- return rr(e, "data-merge-tag", (e) => Qn(Jn(e, t) ?? Kn(e, t)), { unwrap: (e) => Jn(e, t) !== void 0 });
2018
+ return t.find((t) => t.value === e)?.sample;
2022
2019
  }
2023
- function Xn(e) {
2020
+ function Xn(e, t) {
2021
+ return q(e, "data-merge-tag", (e) => er(Yn(e, t) ?? qn(e, t)), { unwrap: (e) => Yn(e, t) !== void 0 });
2022
+ }
2023
+ function Zn(e, t, n) {
2024
+ let r = (e) => t.some((t) => t.value === e) || Kn(e, n), i = (e) => nr(e, n);
2025
+ return q(q(e, "data-merge-tag", (e) => r(e) ? qn(e, t) : er(e), { unwrap: (e) => !r(e) }), "data-logic-merge-tag", (e) => i(e) ? rr(e, n) : er(e), { unwrap: (e) => !i(e) });
2026
+ }
2027
+ function Qn(e) {
2024
2028
  return e.some((e) => e.sample !== void 0);
2025
2029
  }
2026
- function Zn(e, t) {
2030
+ function $n(e, t) {
2027
2031
  if (!e) return e;
2028
2032
  let n = e;
2029
2033
  for (let e of t) e.sample !== void 0 && (n = n.split(e.value).join(e.sample));
2030
2034
  return n;
2031
2035
  }
2032
- function Qn(e) {
2036
+ function er(e) {
2033
2037
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
2034
2038
  }
2035
- function $n(e, t) {
2039
+ function tr(e, t) {
2036
2040
  if (!e) return !1;
2037
- if (K(t)) return q(e, t, "value", 0, 1).length > 0 || q(e, t, "logic", 0, 1).length > 0;
2041
+ if (G(t)) return K(e, t, "value", 0, 1).length > 0 || K(e, t, "logic", 0, 1).length > 0;
2038
2042
  let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
2039
2043
  return n.test(e) || r.test(e);
2040
2044
  }
2041
- function er(e, t) {
2042
- return Wn(t.logic).test(e?.trim() || "");
2045
+ function nr(e, t) {
2046
+ return Gn(t.logic).test(e?.trim() || "");
2043
2047
  }
2044
- function tr(e, t) {
2048
+ function rr(e, t) {
2045
2049
  let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
2046
2050
  return r && r[1] ? r[1].toUpperCase() : e;
2047
2051
  }
2048
- function nr(e, t) {
2049
- return rr(e, "data-logic-merge-tag", (e) => tr(e, t));
2052
+ function ir(e, t) {
2053
+ return q(e, "data-logic-merge-tag", (e) => rr(e, t));
2050
2054
  }
2051
- function rr(e, t, n, r) {
2055
+ function q(e, t, n, r) {
2052
2056
  let i = "", a = 0;
2053
2057
  for (; a < e.length;) {
2054
2058
  let o = e.indexOf("<span", a);
@@ -2061,7 +2065,7 @@ function rr(e, t, n, r) {
2061
2065
  i += e.substring(a, o + 5), a = o + 5;
2062
2066
  continue;
2063
2067
  }
2064
- let { end: c, nextSpan: l } = Dn(e, o + 5);
2068
+ let { end: c, nextSpan: l } = On(e, o + 5);
2065
2069
  if (l !== -1) {
2066
2070
  i += e.substring(a, l), a = l;
2067
2071
  continue;
@@ -2070,7 +2074,7 @@ function rr(e, t, n, r) {
2070
2074
  i += e.substring(a);
2071
2075
  break;
2072
2076
  }
2073
- let u = An(e.substring(o + 5, c), t);
2077
+ let u = jn(e.substring(o + 5, c), t);
2074
2078
  if (u === null) {
2075
2079
  i += e.substring(a, c + 1), a = c + 1;
2076
2080
  continue;
@@ -2086,14 +2090,14 @@ function rr(e, t, n, r) {
2086
2090
  return i;
2087
2091
  }
2088
2092
  // ../types/src/locale-strings.ts
2089
- var ir = {
2093
+ var ar = {
2090
2094
  title: ["content"],
2091
2095
  paragraph: ["content"]
2092
2096
  };
2093
- function ar(e) {
2097
+ function or(e) {
2094
2098
  let t = [], n = /<[a-z][\w:-]*\b/gi;
2095
2099
  for (; n.exec(e);) {
2096
- let r = En(e, n.lastIndex);
2100
+ let r = Dn(e, n.lastIndex);
2097
2101
  if (r < 0) break;
2098
2102
  let i = n.lastIndex, a = e.slice(i, r), o = /[^\s"'<>/=]+\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/g;
2099
2103
  for (let e; e = o.exec(a);) {
@@ -2107,12 +2111,12 @@ function ar(e) {
2107
2111
  }
2108
2112
  return t;
2109
2113
  }
2110
- function or(e, t, n) {
2111
- let r = n === "html" ? Nn(e) : [], i = n === "html" ? ar(e) : [], a = r.map((e) => ({
2114
+ function sr(e, t, n) {
2115
+ let r = n === "html" ? Pn(e) : [], i = n === "html" ? or(e) : [], a = r.map((e) => ({
2112
2116
  ...e,
2113
2117
  attribute: !1
2114
- })), o = 0, s = K(t) !== void 0, c = (n, r) => {
2115
- let c = e.slice(n, r), l = ["logic", "value"], u = s ? l.map((e) => q(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;
2118
+ })), o = 0, s = G(t) !== void 0, c = (n, r) => {
2119
+ 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;
2116
2120
  for (; f < c.length;) {
2117
2121
  let e = s ? u.flatMap((e) => e ? [e] : []) : d.flatMap((e, t) => {
2118
2122
  let n = u[t];
@@ -2137,20 +2141,20 @@ function or(e, t, n) {
2137
2141
  end: ee,
2138
2142
  markup: r.value,
2139
2143
  attribute: i[o] !== void 0 && p >= i[o].start && ee <= i[o].end
2140
- }), f = r.index + r.value.length, s) for (let e = 0; e < l.length; e++) u[e] && u[e].index < f && (u[e] = q(c, t, l[e], f, 1)[0]);
2144
+ }), 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]);
2141
2145
  }
2142
2146
  }, l = 0;
2143
2147
  for (let e of r) c(l, e.start), l = e.end;
2144
2148
  return c(l, e.length), a.sort((e, t) => e.start - t.start);
2145
2149
  }
2146
- function sr(e) {
2150
+ function cr(e) {
2147
2151
  if (!e.includes("&")) return { text: e };
2148
2152
  let t = "", n = [0], r = 0, i = (i) => {
2149
2153
  for (t += e.slice(r, i); r < i;) n.push(++r);
2150
2154
  };
2151
2155
  for (let a of e.matchAll(/&(?:#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g)) {
2152
2156
  i(a.index);
2153
- let e = W(a[0]);
2157
+ let e = U(a[0]);
2154
2158
  t += e;
2155
2159
  for (let t = 1; t < e.length; t++) n.push(-1);
2156
2160
  r = a.index + a[0].length, n.push(r);
@@ -2160,17 +2164,17 @@ function sr(e) {
2160
2164
  offsets: n
2161
2165
  };
2162
2166
  }
2163
- var J = /* @__PURE__ */ new Map(), cr = 32;
2164
- function lr(e) {
2167
+ var J = /* @__PURE__ */ new Map(), lr = 32;
2168
+ function ur(e) {
2165
2169
  let t = JSON.stringify(e), n = J.get(t);
2166
2170
  if (n === void 0) {
2167
2171
  let r = e.map((e) => e.trim()).filter(Boolean).sort((e, t) => t.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
2168
- n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null, J.size >= cr && J.delete(J.keys().next().value), J.set(t, n);
2172
+ n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null, J.size >= lr && J.delete(J.keys().next().value), J.set(t, n);
2169
2173
  }
2170
2174
  return n;
2171
2175
  }
2172
- function ur(e, t, n) {
2173
- let r = n.length ? lr(n) : null;
2176
+ function dr(e, t, n) {
2177
+ let r = n.length ? ur(n) : null;
2174
2178
  if (!r) return [];
2175
2179
  let i = [];
2176
2180
  if (t === "text") i.push({
@@ -2179,7 +2183,7 @@ function ur(e, t, n) {
2179
2183
  attribute: !1
2180
2184
  });
2181
2185
  else {
2182
- i.push(...ar(e).map((e) => ({
2186
+ i.push(...or(e).map((e) => ({
2183
2187
  ...e,
2184
2188
  attribute: !0
2185
2189
  })));
@@ -2190,7 +2194,7 @@ function ur(e, t, n) {
2190
2194
  end: r.index,
2191
2195
  attribute: !1
2192
2196
  });
2193
- let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) : En(e, t.lastIndex);
2197
+ let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) : Dn(e, t.lastIndex);
2194
2198
  if (a < 0) return [];
2195
2199
  n = a + (r[0] === "<!--" ? 3 : 1), t.lastIndex = n;
2196
2200
  }
@@ -2203,7 +2207,7 @@ function ur(e, t, n) {
2203
2207
  let a = [];
2204
2208
  for (let n of i) {
2205
2209
  r.lastIndex = 0;
2206
- let i = e.slice(n.start, n.end), o = t === "html" ? sr(i) : {
2210
+ let i = e.slice(n.start, n.end), o = t === "html" ? cr(i) : {
2207
2211
  text: i,
2208
2212
  offsets: void 0
2209
2213
  };
@@ -2222,42 +2226,42 @@ function ur(e, t, n) {
2222
2226
  }
2223
2227
  return a;
2224
2228
  }
2225
- function dr(e, t, n, r) {
2226
- let i = or(e, t, n), a = ur(e, n, r?.doNotTranslate ?? []).filter((e) => !i.some((t) => e.start < t.end && e.end > t.start));
2229
+ function fr(e, t, n, r) {
2230
+ 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));
2227
2231
  return [...i, ...a].sort((e, t) => e.start - t.start);
2228
2232
  }
2229
- function fr(e, t, n) {
2233
+ function pr(e, t, n) {
2230
2234
  let r = "", i = 0;
2231
2235
  return t.forEach((t, a) => {
2232
2236
  r += e.slice(i, t.start), r += t.attribute ? `__x${n[a]}__` : `<x id="${n[a]}"/>`, i = t.end;
2233
2237
  }), r + e.slice(i);
2234
2238
  }
2235
- function pr(e, t, n, r) {
2236
- let i = dr(e, t, n, r);
2239
+ function mr(e, t, n, r) {
2240
+ let i = fr(e, t, n, r);
2237
2241
  return {
2238
- text: fr(e, i, i.map((e, t) => t + 1)),
2242
+ text: pr(e, i, i.map((e, t) => t + 1)),
2239
2243
  tokens: i.map((e) => e.markup)
2240
2244
  };
2241
2245
  }
2242
- function mr(e, t) {
2246
+ function hr(e, t) {
2243
2247
  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) => {
2244
2248
  let s = Number(i ?? a ?? o);
2245
2249
  return (s < 1 || s > t.length || n.has(s)) && (r = !1), n.add(s), t[s - 1] ?? "";
2246
2250
  });
2247
2251
  return r && n.size === t.length ? i : null;
2248
2252
  }
2249
- function hr(e, t, n, r, i) {
2250
- let a = dr(e, n, r, i), o = /* @__PURE__ */ new Set(), s = (e) => {
2253
+ function gr(e, t, n, r, i) {
2254
+ let a = fr(e, n, r, i), o = /* @__PURE__ */ new Set(), s = (e) => {
2251
2255
  let n = t.findIndex((t, n) => !o.has(n) && e(t));
2252
2256
  return n >= 0 && o.add(n), n;
2253
2257
  }, c = a.map((e) => s((t) => t === e.markup));
2254
2258
  return a.forEach((e, t) => {
2255
- c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) => W(t) === e.term));
2256
- }), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null : fr(e, a.filter((e, t) => c[t] >= 0), c.filter((e) => e >= 0).map((e) => e + 1));
2259
+ c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) => U(t) === e.term));
2260
+ }), 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));
2257
2261
  }
2258
- function gr(e, t, n = []) {
2262
+ function _r(e, t, n = []) {
2259
2263
  let r = /* @__PURE__ */ new Map();
2260
- if (t === w(e) || !e.settings.locales?.includes(t)) return r;
2264
+ if (t === C(e) || !e.settings.locales?.includes(t)) return r;
2261
2265
  let i = (e, n, i, a) => {
2262
2266
  let o = n.l10n?.[t];
2263
2267
  for (let t of i) {
@@ -2266,7 +2270,7 @@ function gr(e, t, n = []) {
2266
2270
  target: e,
2267
2271
  path: t,
2268
2272
  source: i,
2269
- format: a && ir[a]?.includes(t) ? "html" : "text",
2273
+ format: a && ar[a]?.includes(t) ? "html" : "text",
2270
2274
  text: o?.text?.[t]
2271
2275
  });
2272
2276
  }
@@ -2275,22 +2279,22 @@ function gr(e, t, n = []) {
2275
2279
  if (r.type !== "html" && i({
2276
2280
  kind: "block",
2277
2281
  blockId: r.id
2278
- }, r, S(r, n), r.type), r.type === "section") for (let e of r.children) a(e);
2282
+ }, r, x(r, n), r.type), r.type === "section") for (let e of r.children) a(e);
2279
2283
  else r.type === "wrapper" && a(r.children);
2280
2284
  }
2281
2285
  };
2282
2286
  return a(e.blocks), i({ kind: "settings" }, e.settings, g), r;
2283
2287
  }
2284
- function _r(e, t, n) {
2285
- let r = n.only === "all" ? null : Pe(e, t, n.definitions), i = r && /* @__PURE__ */ new Set([...r.missing, ...r.stale]), a = [], o = {};
2286
- for (let [r, s] of gr(e, t, n.definitions)) {
2288
+ function vr(e, t, n) {
2289
+ let r = n.only === "all" ? null : Fe(e, t, n.definitions), i = r && /* @__PURE__ */ new Set([...r.missing, ...r.stale]), a = [], o = {};
2290
+ for (let [r, s] of _r(e, t, n.definitions)) {
2287
2291
  if (i && !i.has(r) || n.blockId !== void 0 && (s.target.kind !== "block" || s.target.blockId !== n.blockId)) continue;
2288
- let e = pr(s.source, n.syntax, s.format, n), t = s.text ? hr(s.text.value, e.tokens, n.syntax, s.format, n) : void 0;
2292
+ 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;
2289
2293
  a.push({
2290
2294
  id: r,
2291
2295
  format: s.format,
2292
2296
  source: e.text,
2293
- sourceHash: C(s.source),
2297
+ sourceHash: S(s.source),
2294
2298
  ...t == null ? {} : { text: t }
2295
2299
  }), o[r] = e.tokens;
2296
2300
  }
@@ -2299,8 +2303,8 @@ function _r(e, t, n) {
2299
2303
  tokens: o
2300
2304
  };
2301
2305
  }
2302
- function vr(e, t, n, r) {
2303
- let i = gr(e, t, r.definitions), a = /* @__PURE__ */ new Map(), o = (e) => {
2306
+ function yr(e, t, n, r) {
2307
+ let i = _r(e, t, r.definitions), a = /* @__PURE__ */ new Map(), o = (e) => {
2304
2308
  for (let t of e) if (a.set(t.id, t), t.type === "section") for (let e of t.children) o(e);
2305
2309
  else t.type === "wrapper" && o(t.children);
2306
2310
  };
@@ -2316,8 +2320,8 @@ function vr(e, t, n, r) {
2316
2320
  });
2317
2321
  continue;
2318
2322
  }
2319
- let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ? mr(t.text, o) : null;
2320
- if (!o || u === null || hr(u, o, r.syntax, n.format, r) === null) {
2323
+ let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ? hr(t.text, o) : null;
2324
+ if (!o || u === null || gr(u, o, r.syntax, n.format, r) === null) {
2321
2325
  l.push({
2322
2326
  id: t.id,
2323
2327
  reason: "tags_changed"
@@ -2347,21 +2351,21 @@ function vr(e, t, n, r) {
2347
2351
  };
2348
2352
  }
2349
2353
  // ../types/src/custom-block-liquid.ts
2350
- var yr = 1e7, br = 2e3;
2351
- function xr(e) {
2354
+ var br = 1e7, xr = 2e3;
2355
+ function Sr(e) {
2352
2356
  return new e.Liquid({
2353
2357
  strictVariables: !1,
2354
2358
  strictFilters: !1,
2355
2359
  outputEscape: "escape",
2356
- memoryLimit: yr,
2357
- renderLimit: br,
2360
+ memoryLimit: br,
2361
+ renderLimit: xr,
2358
2362
  templates: {}
2359
2363
  });
2360
2364
  }
2361
2365
  // ../types/src/factory.ts
2362
2366
  function Y(e, t) {
2363
2367
  let n = m(e);
2364
- return !t || Object.keys(t).length === 0 ? n : yn(n, t);
2368
+ return !t || Object.keys(t).length === 0 ? n : bn(n, t);
2365
2369
  }
2366
2370
  function X(e) {
2367
2371
  return e === void 0 ? void 0 : m(e);
@@ -2369,7 +2373,7 @@ function X(e) {
2369
2373
  function Z() {
2370
2374
  return crypto.randomUUID();
2371
2375
  }
2372
- function Sr(e = 0) {
2376
+ function Cr(e = 0) {
2373
2377
  return {
2374
2378
  top: e,
2375
2379
  right: e,
@@ -2378,100 +2382,100 @@ function Sr(e = 0) {
2378
2382
  };
2379
2383
  }
2380
2384
  function Q(e = 10) {
2381
- return { padding: Sr(e) };
2385
+ return { padding: Cr(e) };
2382
2386
  }
2383
- function Cr(e = {}) {
2387
+ function wr(e = {}) {
2384
2388
  return Y({
2385
2389
  id: Z(),
2386
2390
  type: "title",
2387
- ...nn,
2391
+ ...rn,
2388
2392
  styles: Q()
2389
2393
  }, e);
2390
2394
  }
2391
- function wr(e = {}) {
2395
+ function Tr(e = {}) {
2392
2396
  return Y({
2393
2397
  id: Z(),
2394
2398
  type: "paragraph",
2395
- ...rn,
2399
+ ...an,
2396
2400
  styles: Q()
2397
2401
  }, e);
2398
2402
  }
2399
- function Tr(e = {}) {
2403
+ function Er(e = {}) {
2400
2404
  return Y({
2401
2405
  id: Z(),
2402
2406
  type: "image",
2403
- ...an,
2407
+ ...on,
2404
2408
  styles: Q()
2405
2409
  }, e);
2406
2410
  }
2407
- function Er(e = {}) {
2411
+ function Dr(e = {}) {
2408
2412
  return Y({
2409
2413
  id: Z(),
2410
2414
  type: "button",
2411
- ...on,
2415
+ ...sn,
2412
2416
  styles: Q()
2413
2417
  }, e);
2414
2418
  }
2415
- function Dr(e = {}) {
2419
+ function Or(e = {}) {
2416
2420
  return Y({
2417
2421
  id: Z(),
2418
2422
  type: "divider",
2419
- ...sn,
2423
+ ...cn,
2420
2424
  styles: Q(20)
2421
2425
  }, e);
2422
2426
  }
2423
- function Or(e = {}) {
2427
+ function kr(e = {}) {
2424
2428
  return Y({
2425
2429
  id: Z(),
2426
2430
  type: "section",
2427
- ...cn,
2431
+ ...ln,
2428
2432
  children: [[]],
2429
2433
  styles: Q(20)
2430
2434
  }, e);
2431
2435
  }
2432
- function kr(e = {}) {
2436
+ function Ar(e = {}) {
2433
2437
  return Y({
2434
2438
  id: Z(),
2435
2439
  type: "video",
2436
- ...ln,
2440
+ ...un,
2437
2441
  styles: Q()
2438
2442
  }, e);
2439
2443
  }
2440
- function Ar(e = {}) {
2444
+ function jr(e = {}) {
2441
2445
  return Y({
2442
2446
  id: Z(),
2443
2447
  type: "social",
2444
2448
  icons: [],
2445
- ...un,
2449
+ ...dn,
2446
2450
  styles: Q()
2447
2451
  }, e);
2448
2452
  }
2449
- function jr(e = {}) {
2453
+ function Mr(e = {}) {
2450
2454
  return Y({
2451
2455
  id: Z(),
2452
2456
  type: "spacer",
2453
- ...dn,
2457
+ ...fn,
2454
2458
  styles: Q(0)
2455
2459
  }, e);
2456
2460
  }
2457
- function Mr(e = {}) {
2461
+ function Nr(e = {}) {
2458
2462
  return Y({
2459
2463
  id: Z(),
2460
2464
  type: "html",
2461
- ...fn,
2465
+ ...pn,
2462
2466
  styles: Q()
2463
2467
  }, e);
2464
2468
  }
2465
- function Nr(e = {}) {
2469
+ function Pr(e = {}) {
2466
2470
  return Y({
2467
2471
  id: Z(),
2468
2472
  type: "menu",
2469
2473
  items: [],
2470
- ...pn,
2474
+ ...mn,
2471
2475
  styles: Q()
2472
2476
  }, e);
2473
2477
  }
2474
- function Pr(e, t) {
2478
+ function Fr(e, t) {
2475
2479
  return Array.from({ length: t }, () => ({
2476
2480
  id: Z(),
2477
2481
  cells: Array.from({ length: e }, () => ({
@@ -2480,29 +2484,29 @@ function Pr(e, t) {
2480
2484
  }))
2481
2485
  }));
2482
2486
  }
2483
- function Fr(e = {}) {
2487
+ function Ir(e = {}) {
2484
2488
  return Y({
2485
2489
  id: Z(),
2486
2490
  type: "table",
2487
- rows: Pr(3, 3),
2488
- ...mn,
2491
+ rows: Fr(3, 3),
2492
+ ...hn,
2489
2493
  styles: Q()
2490
2494
  }, e);
2491
2495
  }
2492
- function Ir(e = {}) {
2496
+ function Lr(e = {}) {
2493
2497
  return Y({
2494
2498
  id: Z(),
2495
2499
  type: "countdown",
2496
- ...hn,
2500
+ ...gn,
2497
2501
  styles: Q()
2498
2502
  }, e);
2499
2503
  }
2500
- function Lr(e) {
2504
+ function Rr(e) {
2501
2505
  return e.type === "repeatable" ? e.default ?? [] : e.type === "boolean" ? e.default ?? !1 : e.type === "number" ? e.default ?? 0 : e.default ?? "";
2502
2506
  }
2503
- function Rr(e) {
2507
+ function zr(e) {
2504
2508
  let t = {};
2505
- for (let n of e.fields) t[n.key] = X(Lr(n));
2509
+ for (let n of e.fields) t[n.key] = X(Rr(n));
2506
2510
  let n = Y(Q(), X(e.defaultStyles));
2507
2511
  return {
2508
2512
  id: Z(),
@@ -2513,14 +2517,14 @@ function Rr(e) {
2513
2517
  ...e.dataSource ? { dataSourceFetched: !1 } : {}
2514
2518
  };
2515
2519
  }
2516
- function zr() {
2520
+ function Br() {
2517
2521
  return {
2518
2522
  id: Z(),
2519
2523
  type: "slot",
2520
2524
  styles: Q(0)
2521
2525
  };
2522
2526
  }
2523
- function Br(e = {}) {
2527
+ function Vr(e = {}) {
2524
2528
  return Y({
2525
2529
  id: Z(),
2526
2530
  type: "wrapper",
@@ -2528,27 +2532,27 @@ function Br(e = {}) {
2528
2532
  styles: Q(0)
2529
2533
  }, e);
2530
2534
  }
2531
- function Vr(e, t) {
2535
+ function Hr(e, t) {
2532
2536
  switch (e) {
2533
- case "section": return Or(X(t?.section));
2534
- case "title": return Cr(X(t?.title));
2535
- case "paragraph": return wr(X(t?.paragraph));
2536
- case "image": return Tr(X(t?.image));
2537
- case "button": return Er(X(t?.button));
2538
- case "divider": return Dr(X(t?.divider));
2539
- case "video": return kr(X(t?.video));
2540
- case "social": return Ar(X(t?.social));
2541
- case "spacer": return jr(X(t?.spacer));
2542
- case "html": return Mr(X(t?.html));
2543
- case "menu": return Nr(X(t?.menu));
2544
- case "table": return Fr(X(t?.table));
2545
- case "countdown": return Ir(X(t?.countdown));
2537
+ case "section": return kr(X(t?.section));
2538
+ case "title": return wr(X(t?.title));
2539
+ case "paragraph": return Tr(X(t?.paragraph));
2540
+ case "image": return Er(X(t?.image));
2541
+ case "button": return Dr(X(t?.button));
2542
+ case "divider": return Or(X(t?.divider));
2543
+ case "video": return Ar(X(t?.video));
2544
+ case "social": return jr(X(t?.social));
2545
+ case "spacer": return Mr(X(t?.spacer));
2546
+ case "html": return Nr(X(t?.html));
2547
+ case "menu": return Pr(X(t?.menu));
2548
+ case "table": return Ir(X(t?.table));
2549
+ case "countdown": return Lr(X(t?.countdown));
2546
2550
  case "slot": throw Error("[Templatical] slot cannot be inserted into content. Use createSlotBlock() to build a layout.");
2547
2551
  case "wrapper": throw Error("[Templatical] wrapper cannot be inserted into content. Use createWrapperBlock() to build a layout.");
2548
2552
  default: throw Error(`Unknown block type: ${e}`);
2549
2553
  }
2550
2554
  }
2551
- function Hr(e, t) {
2555
+ function Ur(e, t) {
2552
2556
  let n = e.l10n;
2553
2557
  if (!n || t.size === 0) return;
2554
2558
  let r = (n) => {
@@ -2563,7 +2567,7 @@ function Hr(e, t) {
2563
2567
  n && (e[t] = Object.fromEntries(Object.entries(n).map(([e, t]) => [r(e), t])));
2564
2568
  }
2565
2569
  }
2566
- function Ur(e) {
2570
+ function Wr(e) {
2567
2571
  let t = JSON.parse(JSON.stringify(e)), n = (e) => {
2568
2572
  e.id = Z();
2569
2573
  let t = /* @__PURE__ */ new Map(), r = (e, n) => {
@@ -2580,79 +2584,79 @@ function Ur(e) {
2580
2584
  if (e.type === "social") for (let t of e.icons) r(t, "icons");
2581
2585
  if (e.type === "section") for (let t of e.children) for (let e of t) n(e);
2582
2586
  if (e.type === "wrapper") for (let t of e.children) n(t);
2583
- Hr(e, t);
2587
+ Ur(e, t);
2584
2588
  };
2585
2589
  return n(t), t;
2586
2590
  }
2587
2591
  // ../types/src/layout.ts
2588
- var Wr = "[Templatical] layout: must contain exactly one slot block", Gr = "[Templatical] layout: slot must be a top-level or wrapper child, not nested in a section", Kr = "[Templatical] layout: a wrapper cannot contain a wrapper", qr = "[Templatical] layout: a wrapper around the slot cannot contain blocks that emit mj-wrapper (section.wrapper)", Jr = "[Templatical] slot is not a valid content block", Yr = "[Templatical] layout: a wrapper cannot contain a section with its own wrapper (section.wrapper)", Xr = "[Templatical] wrapper is not a valid content block";
2592
+ var Gr = "[Templatical] layout: must contain exactly one slot block", Kr = "[Templatical] layout: slot must be a top-level or wrapper child, not nested in a section", qr = "[Templatical] layout: a wrapper cannot contain a wrapper", Jr = "[Templatical] layout: a wrapper around the slot cannot contain blocks that emit mj-wrapper (section.wrapper)", Yr = "[Templatical] slot is not a valid content block", Xr = "[Templatical] layout: a wrapper cannot contain a section with its own wrapper (section.wrapper)", Zr = "[Templatical] wrapper is not a valid content block";
2589
2593
  function $(e, t, n = null, r = !1, i = !1) {
2590
- for (let a of e) if (t(a, n, r, i), Ht(a)) for (let e of a.children) $(e, t, a, !0, i);
2591
- else H(a) && $(a.children, t, a, r, !0);
2594
+ for (let a of e) if (t(a, n, r, i), Ut(a)) for (let e of a.children) $(e, t, a, !0, i);
2595
+ else V(a) && $(a.children, t, a, r, !0);
2592
2596
  }
2593
- function Zr(e) {
2597
+ function Qr(e) {
2594
2598
  let t = 0;
2595
2599
  if ($(e.blocks, (e, n, r, i) => {
2596
- if (i && Ht(e) && e.wrapper) throw Error(Yr);
2597
- if (V(e) && (t += 1, r)) throw Error(Gr);
2598
- if (H(e)) {
2599
- if (r) throw Error(Gr);
2600
- if (e.children.some(H)) throw Error(Kr);
2600
+ if (i && Ut(e) && e.wrapper) throw Error(Xr);
2601
+ if (B(e) && (t += 1, r)) throw Error(Kr);
2602
+ if (V(e)) {
2603
+ if (r) throw Error(Kr);
2604
+ if (e.children.some(V)) throw Error(qr);
2601
2605
  }
2602
- }), t !== 1) throw Error(Wr);
2606
+ }), t !== 1) throw Error(Gr);
2603
2607
  }
2604
- function Qr(e) {
2608
+ function $r(e) {
2605
2609
  $(e.blocks, (e) => {
2606
- if (V(e)) throw Error(Jr);
2610
+ if (B(e)) throw Error(Yr);
2607
2611
  });
2608
2612
  }
2609
- function $r(e) {
2613
+ function ei(e) {
2610
2614
  $(e.blocks, (e) => {
2611
- if (H(e)) throw Error(Xr);
2615
+ if (V(e)) throw Error(Zr);
2612
2616
  });
2613
2617
  }
2614
- function ei(e) {
2618
+ function ti(e) {
2615
2619
  let t = !1;
2616
2620
  return $(e.blocks, (e, n) => {
2617
- V(e) && n !== null && H(n) && (t = !0);
2621
+ B(e) && n !== null && V(n) && (t = !0);
2618
2622
  }), t;
2619
2623
  }
2620
- function ti(e) {
2621
- if (V(e)) return e;
2622
- if (H(e)) {
2623
- let t = Ur({
2624
+ function ni(e) {
2625
+ if (B(e)) return e;
2626
+ if (V(e)) {
2627
+ let t = Wr({
2624
2628
  ...e,
2625
2629
  children: []
2626
2630
  });
2627
- return t.children = e.children.map(ti), t;
2631
+ return t.children = e.children.map(ni), t;
2628
2632
  }
2629
- return Ur(e);
2633
+ return Wr(e);
2630
2634
  }
2631
- function ni(e) {
2635
+ function ri(e) {
2632
2636
  for (let t = 0; t < e.length; t++) {
2633
2637
  let n = e[t];
2634
- if (V(n)) return {
2638
+ if (B(n)) return {
2635
2639
  parent: e,
2636
2640
  index: t
2637
2641
  };
2638
- if (H(n)) {
2639
- let e = ni(n.children);
2642
+ if (V(n)) {
2643
+ let e = ri(n.children);
2640
2644
  if (e) return e;
2641
2645
  }
2642
2646
  }
2643
2647
  return null;
2644
2648
  }
2645
- function ri(e) {
2646
- for (let t of e) if (Ht(t)) {
2649
+ function ii(e) {
2650
+ for (let t of e) if (Ut(t)) {
2647
2651
  if (t.wrapper) return !0;
2648
- for (let e of t.children) if (ri(e)) return !0;
2652
+ for (let e of t.children) if (ii(e)) return !0;
2649
2653
  }
2650
2654
  return !1;
2651
2655
  }
2652
- function ii(e, t) {
2653
- if (Zr(e), Qr(t), $r(t), ei(e) && ri(t.blocks)) throw Error(qr);
2654
- let n = e.blocks.map(ti), r = ni(n);
2655
- if (!r) throw Error(Wr);
2656
+ function ai(e, t) {
2657
+ if (Qr(e), $r(t), ei(t), ti(e) && ii(t.blocks)) throw Error(Jr);
2658
+ let n = e.blocks.map(ni), r = ri(n);
2659
+ if (!r) throw Error(Gr);
2656
2660
  return r.parent.splice(r.index, 1, ...m(t.blocks)), {
2657
2661
  blocks: n,
2658
2662
  settings: {
@@ -2662,7 +2666,7 @@ function ii(e, t) {
2662
2666
  };
2663
2667
  }
2664
2668
  // ../types/src/url-policy.ts
2665
- var ai = Object.freeze([
2669
+ var oi = Object.freeze([
2666
2670
  "http",
2667
2671
  "https",
2668
2672
  "mailto",
@@ -2672,44 +2676,44 @@ var ai = Object.freeze([
2672
2676
  "sms",
2673
2677
  "xmpp",
2674
2678
  "cid"
2675
- ]), oi = Object.freeze([
2679
+ ]), si = Object.freeze([
2676
2680
  "javascript",
2677
2681
  "data",
2678
2682
  "vbscript"
2679
2683
  ]);
2680
- function si(e) {
2684
+ function ci(e) {
2681
2685
  return e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
2682
2686
  }
2683
- function ci(e) {
2684
- let t = /^([a-z][a-z0-9+.-]*):/i.exec(si(e));
2687
+ function li(e) {
2688
+ let t = /^([a-z][a-z0-9+.-]*):/i.exec(ci(e));
2685
2689
  return t ? t[1].toLowerCase() : null;
2686
2690
  }
2687
- var li = /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i, ui = Object.freeze([
2691
+ var ui = /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i, di = Object.freeze([
2688
2692
  "href",
2689
2693
  "xlink:href",
2690
2694
  "background",
2691
2695
  "poster",
2692
2696
  "src"
2693
- ]), di = Object.freeze([
2697
+ ]), fi = Object.freeze([
2694
2698
  "srcdoc",
2695
2699
  "ping",
2696
2700
  "formaction",
2697
2701
  "action"
2698
2702
  ]);
2699
- function fi(e, t) {
2700
- let n = si(e), r = ci(n);
2701
- return r === null || ai.some((e) => e === r) ? !0 : t.toLowerCase() === "src" && li.test(n);
2703
+ function pi(e, t) {
2704
+ let n = ci(e), r = li(n);
2705
+ return r === null || oi.some((e) => e === r) ? !0 : t.toLowerCase() === "src" && ui.test(n);
2702
2706
  }
2703
2707
  // ../types/src/rich-text.ts
2704
- var pi = /<\/?p\b[^<>]*>/gi, mi = /<p\b([^<>]*)>\s*<\/p>/gi;
2705
- function hi(e) {
2706
- return e.replace(pi, "").trim() === "";
2707
- }
2708
+ var mi = /<\/?p\b[^<>]*>/gi, hi = /<p\b([^<>]*)>\s*<\/p>/gi;
2708
2709
  function gi(e) {
2709
- return hi(e) ? e : e.replace(mi, "<p$1>&nbsp;</p>");
2710
+ return e.replace(mi, "").trim() === "";
2711
+ }
2712
+ function _i(e) {
2713
+ return gi(e) ? e : e.replace(hi, "<p$1>&nbsp;</p>");
2710
2714
  }
2711
2715
  // ../types/src/fonts.ts
2712
- var _i = {
2716
+ var vi = {
2713
2717
  arial: "Arial, sans-serif",
2714
2718
  helvetica: "Helvetica, sans-serif",
2715
2719
  georgia: "Georgia, serif",
@@ -2718,13 +2722,13 @@ var _i = {
2718
2722
  "trebuchet ms": "'Trebuchet MS', sans-serif",
2719
2723
  "courier new": "'Courier New', monospace",
2720
2724
  tahoma: "Tahoma, sans-serif"
2721
- }, vi = /* @__PURE__ */ new Set([
2725
+ }, yi = /* @__PURE__ */ new Set([
2722
2726
  "inherit",
2723
2727
  "initial",
2724
2728
  "unset",
2725
2729
  "revert",
2726
2730
  "revert-layer"
2727
- ]), yi = /* @__PURE__ */ new Set([
2731
+ ]), bi = /* @__PURE__ */ new Set([
2728
2732
  "serif",
2729
2733
  "sans-serif",
2730
2734
  "monospace",
@@ -2739,14 +2743,14 @@ var _i = {
2739
2743
  "math",
2740
2744
  "fangsong"
2741
2745
  ]);
2742
- function bi(e) {
2746
+ function xi(e) {
2743
2747
  return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
2744
2748
  }
2745
- function xi(e) {
2749
+ function Si(e) {
2746
2750
  if (typeof e != "string") return [];
2747
2751
  let t = e.replace(/!\s*important\s*$/i, ""), n = [], r = 0;
2748
2752
  for (;;) {
2749
- for (; r < t.length && bi(t[r]);) r++;
2753
+ for (; r < t.length && xi(t[r]);) r++;
2750
2754
  if (r >= t.length) return [];
2751
2755
  let e = t[r];
2752
2756
  if (e === "\"" || e === "'") {
@@ -2763,7 +2767,7 @@ function xi(e) {
2763
2767
  }
2764
2768
  }
2765
2769
  if (!o) return [];
2766
- for (; a < t.length && bi(t[a]);) a++;
2770
+ for (; a < t.length && xi(t[a]);) a++;
2767
2771
  if (a < t.length && t[a] !== ",") return [];
2768
2772
  n.push({
2769
2773
  name: i,
@@ -2771,7 +2775,7 @@ function xi(e) {
2771
2775
  }), r = a;
2772
2776
  } else {
2773
2777
  let e = t.indexOf(",", r), i = e === -1 ? t.length : e, a = t.slice(r, i).trim().split(/\s+/).join(" ");
2774
- if (a === "" || a.includes("\"") || a.includes("'") || vi.has(a.toLowerCase())) return [];
2778
+ if (a === "" || a.includes("\"") || a.includes("'") || yi.has(a.toLowerCase())) return [];
2775
2779
  n.push({
2776
2780
  name: a,
2777
2781
  quoted: !1
@@ -2781,27 +2785,27 @@ function xi(e) {
2781
2785
  r++;
2782
2786
  }
2783
2787
  }
2784
- function Si(e) {
2785
- return `'${e.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
2786
- }
2787
2788
  function Ci(e) {
2788
- return !e.quoted && yi.has(e.name.toLowerCase());
2789
+ return `'${e.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
2789
2790
  }
2790
2791
  function wi(e) {
2791
- return xi(e)[0]?.name ?? "";
2792
+ return !e.quoted && bi.has(e.name.toLowerCase());
2793
+ }
2794
+ function Ti(e) {
2795
+ return Si(e)[0]?.name ?? "";
2792
2796
  }
2793
- function Ti(e, t) {
2794
- let n = (e) => `${Si(e.name)}, ${e.fallback ?? t.defaultFallback}`, r = typeof e == "string" ? e.trim().toLowerCase() : "", i = t.customFonts.find((e) => e.name.toLowerCase() === r);
2797
+ function Ei(e, t) {
2798
+ let n = (e) => `${Ci(e.name)}, ${e.fallback ?? t.defaultFallback}`, r = typeof e == "string" ? e.trim().toLowerCase() : "", i = t.customFonts.find((e) => e.name.toLowerCase() === r);
2795
2799
  if (i) return n(i);
2796
- let a = xi(e);
2800
+ let a = Si(e);
2797
2801
  if (a.length !== 1) return e;
2798
2802
  let [o] = a, s = o.name.toLowerCase(), c = t.customFonts.find((e) => e.name.toLowerCase() === s);
2799
- return c ? n(c) : _i[s] || (Ci(o) ? e : `${Si(o.name)}, ${t.defaultFallback}`);
2803
+ return c ? n(c) : vi[s] || (wi(o) ? e : `${Ci(o.name)}, ${t.defaultFallback}`);
2800
2804
  }
2801
2805
  // ../types/src/preview-resolution.ts
2802
- function Ei(e) {
2806
+ function Di(e) {
2803
2807
  return typeof e != "object" || !e ? !1 : Array.isArray(e.blocks);
2804
2808
  }
2805
- export { nr as $, Ne as $t, Ar as A, Jt as At, _r as B, g as Bt, Dr as C, n as Cn, Wt as Ct, wr as D, Xt as Dt, Nr as E, t as En, Yt as Et, Br as F, He as Ft, tr as G, Se as Gt, G as H, w as Ht, Z as I, E as It, Hn as J, Fe as Jt, Kn as K, Te as Kt, xr as L, M as Lt, Fr as M, Vt as Mt, Cr as N, zt as Nt, Or as O, $t as Ot, kr as P, T as Pt, Gn as Q, y as Qt, ir as R, Be as Rt, Rr as S, c as Sn, Qt as St, Tr as T, o as Tn, V as Tt, K as U, ve as Ut, mr as V, Ie as Vt, $n as W, v as Wt, Xn as X, b as Xt, Vn as Y, Oe as Yt, er as Z, Ce as Zt, Zr as _, i as _n, en as _t, gi as a, se as an, Zn as at, Er as b, s as bn, Zt as bt, di as c, pe as cn, W as ct, ci as d, ie as dn, Cn as dt, C as en, qn as et, fi as f, f as fn, bn as ft, ei as g, ne as gn, Kt as gt, $r as h, te as hn, yn as ht, Ti as i, m as in, Yn as it, jr as j, H as jt, zr as k, Ut as kt, ui as l, fe as ln, En as lt, Qr as m, ee as mn, _n as mt, wi as n, ge as nn, Rn as nt, hi as o, de as on, jn as ot, ii as p, p as pn, gn as pt, Jn as q, Pe as qt, xi as r, h as rn, q as rt, oi as s, ue as sn, Mn as st, Ei as t, S as tn, Un as tt, ai as u, oe as un, wn as ut, Ur as v, e as vn, tn as vt, Mr as w, r as wn, Ht as wt, Ir as x, u as xn, Gt as xt, Vr as y, l as yn, qt as yt, vr as z, Ve as zt };
2809
+ export { ir as $, y as $t, jr as A, Wt as At, vr as B, He as Bt, Or as C, c as Cn, $t as Ct, Tr as D, t as Dn, Xt as Dt, Pr as E, o as En, B as Et, Vr as F, w as Ft, rr as G, v as Gt, W as H, Le as Ht, Z as I, Ue as It, Un as J, Fe as Jt, qn as K, Ce as Kt, Sr as L, T as Lt, Ir as M, V as Mt, wr as N, Ht as Nt, kr as O, Zt as Ot, Ar as P, Bt as Pt, Kn as Q, we as Qt, ar as R, j as Rt, zr as S, u as Sn, Kt as St, Er as T, r as Tn, Ut as Tt, G as U, C as Ut, hr as V, g as Vt, tr as W, ve as Wt, Qn as X, ke as Xt, Hn as Y, Ie as Yt, nr as Z, Se as Zt, Qr as _, ne as _n, qt as _t, _i as a, m as an, $n as at, Dr as b, l as bn, Jt as bt, fi as c, ue as cn, Nn as ct, li as d, oe as dn, Tn as dt, Pe as en, Jn as et, pi as f, ie as fn, wn as ft, ti as g, te as gn, bn as gt, ei as h, ee as hn, vn as ht, Ei as i, h as in, Xn as it, Mr as j, Yt as jt, Br as k, en as kt, di as l, pe as ln, U as lt, $r as m, p as mn, _n as mt, Ti as n, x as nn, zn as nt, gi as o, se as on, Zn as ot, ai as p, f as pn, xn as pt, Yn as q, Ee as qt, Si as r, ge as rn, K as rt, si as s, de as sn, Mn as st, Di as t, S as tn, Wn as tt, oi as u, fe as un, Dn as ut, Wr as v, i as vn, tn as vt, Nr as w, n as wn, Gt as wt, Lr as x, s as xn, Qt as xt, Hr as y, e as yn, nn as yt, yr as z, Ve as zt };
2806
2810
 
2807
- //# sourceMappingURL=src-CVHGPKSW.js.map
2811
+ //# sourceMappingURL=src-DY2kMjoD.js.map