@templatical/editor 0.52.1 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/README.md +1 -1
  2. package/dist/AiAltTextPopover-NMJqQKvD.js +106 -0
  3. package/dist/{AiAltTextReview-9ySsXOTU.js → AiAltTextReview-Ci4zHwRc.js} +68 -66
  4. package/dist/AiChatPanel-DdhtfsmO.js +561 -0
  5. package/dist/{AiPanels-DqT4PgQ0.js → AiPanels-HBx7xoJR.js} +6 -6
  6. package/dist/{AiRewriteMenu-28agTycW.js → AiRewriteMenu-DPzSekZt.js} +76 -105
  7. package/dist/BlockIssueBadge-eIXZJ9M3.js +33 -0
  8. package/dist/BlockPreviewCanvas-DO-2TP_6.js +140 -0
  9. package/dist/{CloudHeaderExtras-QI82yF54.js → CloudHeaderExtras-XpjJjn3o.js} +4 -4
  10. package/dist/{CloudPanels-BKJaLkUN.js → CloudPanels-i2kZdrdP.js} +53 -53
  11. package/dist/CollaborationNotices-DANsjl7c.js +65 -0
  12. package/dist/{CollaboratorBar-CXQqN3VP.js → CollaboratorBar-CbbAA0m1.js} +24 -24
  13. package/dist/CommentsPanel-CYW3LWis.js +16 -0
  14. package/dist/CommentsSidebar-CcF4ISMi.js +526 -0
  15. package/dist/{CountdownBlock-CU2yTWtF.js → CountdownBlock-BMezkFbJ.js} +15 -15
  16. package/dist/CountdownToolbar-D3Lv74kU.js +258 -0
  17. package/dist/IssuesPanel-BMAG9042.js +371 -0
  18. package/dist/LanguageMenu-FlP_Jbup.js +403 -0
  19. package/dist/{LoadingTrack-DM4g6j7b.js → LoadingTrack-BG8cg9xi.js} +2 -2
  20. package/dist/LocaleNotices-DAnVszWu.js +46 -0
  21. package/dist/LogicTagInsertButton-BjYs-UQX.js +1096 -0
  22. package/dist/{MediaEditModal-Dy08GEwE.js → MediaEditModal-LnG-cF_S.js} +451 -451
  23. package/dist/{MediaPanels-BgEp7iCp.js → MediaPanels-C2r5fiFo.js} +4 -4
  24. package/dist/{MergeTagInput-B9dtUthD.js → MergeTagInput-BsnogCeY.js} +30 -30
  25. package/dist/{MergeTagModeToggle-DxujhYJ4.js → MergeTagModeToggle-DiufIQ-_.js} +49 -49
  26. package/dist/MergeTagTextarea-BweI-Xsi.js +126 -0
  27. package/dist/ParagraphEditor-qgBp5yIB.js +825 -0
  28. package/dist/{RestoreVersionDialog-C4s_JYCx.js → RestoreVersionDialog-DdYUrFiK.js} +23 -23
  29. package/dist/{RichTextEditorContent-o6HmE8GR.js → RichTextEditorContent-C5MAzx3E.js} +47 -47
  30. package/dist/{SaveBlockDialog-CWLrly6l.js → SaveBlockDialog-eK6fjtTy.js} +86 -86
  31. package/dist/{cdn/chunks/SavedBlocksBrowserModal-BPYcRoGa.js → SavedBlocksBrowserModal-D2QHd2Yp.js} +135 -132
  32. package/dist/{SavedBlocksPanels-BE1N9rNZ.js → SavedBlocksPanels-Cl61f4Mf.js} +9 -9
  33. package/dist/{SavedBlocksPickBar-Dwl94xhP.js → SavedBlocksPickBar-CXP2dkeB.js} +15 -15
  34. package/dist/TemplateSettings-BKJrdZcH.js +294 -0
  35. package/dist/TestEmailModal-DQotJg6g.js +212 -0
  36. package/dist/{TestEmailPanel-DaFjP9QK.js → TestEmailPanel-CwiTzJsh.js} +4 -4
  37. package/dist/TitleEditor-CzSvsPAn.js +202 -0
  38. package/dist/ToggleSwitch-R3wCCYE6.js +43 -0
  39. package/dist/Toolbar-Cd75ci5W.js +3711 -0
  40. package/dist/{TplModal-DLMssVlt.js → TplModal-ZoXu40T9.js} +17 -17
  41. package/dist/{VersionHistoryMenu-BkbYUs0Q.js → VersionHistoryMenu-BvhN-Ofk.js} +39 -39
  42. package/dist/{VersionHistoryPanels-DP7HaYWv.js → VersionHistoryPanels-DPWMnYbd.js} +5 -5
  43. package/dist/VersionPreviewBanner-CuJnasxH.js +37 -0
  44. package/dist/WrapperBlock-D4fPwO0t.js +44 -0
  45. package/dist/{blockTypeIcons-BHjlPnPf.js → blockTypeIcons-BXMxu86H.js} +7 -7
  46. package/dist/bundle-stats.json +8 -8
  47. package/dist/{cdn/chunks/ca-CD-Kt1qz.js → ca-DOuIxWRv.js} +114 -2
  48. package/dist/cdn/chunks/AiAltTextPopover-ByZ0FEqI.js +107 -0
  49. package/dist/cdn/chunks/AiAltTextPopover-ByZ0FEqI.js.map +1 -0
  50. package/dist/cdn/chunks/{AiAltTextReview-BGLLSKLm.js → AiAltTextReview-Dtm3A2cD.js} +70 -68
  51. package/dist/cdn/chunks/AiAltTextReview-Dtm3A2cD.js.map +1 -0
  52. package/dist/cdn/chunks/AiChatPanel-DciEt27y.js +487 -0
  53. package/dist/cdn/chunks/AiChatPanel-DciEt27y.js.map +1 -0
  54. package/dist/cdn/chunks/{AiPanels-0wBarZSH.js → AiPanels-BV5D1itk.js} +11 -11
  55. package/dist/cdn/chunks/{AiPanels-0wBarZSH.js.map → AiPanels-BV5D1itk.js.map} +1 -1
  56. package/dist/cdn/chunks/{AiRewriteMenu-qf-cfEpy.js → AiRewriteMenu-D3jkh6Xb.js} +79 -79
  57. package/dist/cdn/chunks/AiRewriteMenu-D3jkh6Xb.js.map +1 -0
  58. package/dist/cdn/chunks/BlockIssueBadge-DyEgBZtR.js +34 -0
  59. package/dist/cdn/chunks/BlockIssueBadge-DyEgBZtR.js.map +1 -0
  60. package/dist/cdn/chunks/BlockPreviewCanvas-RQFilqXC.js +142 -0
  61. package/dist/cdn/chunks/{BlockPreviewCanvas-DGBh6mqe.js.map → BlockPreviewCanvas-RQFilqXC.js.map} +1 -1
  62. package/dist/cdn/chunks/{CloudHeaderExtras-BMNK_F9p.js → CloudHeaderExtras-BtqdN777.js} +4 -4
  63. package/dist/cdn/chunks/{CloudHeaderExtras-BMNK_F9p.js.map → CloudHeaderExtras-BtqdN777.js.map} +1 -1
  64. package/dist/cdn/chunks/{CloudPanels-JMWIoVWh.js → CloudPanels-BSJ-Z5Hw.js} +45 -45
  65. package/dist/cdn/chunks/{CloudPanels-JMWIoVWh.js.map → CloudPanels-BSJ-Z5Hw.js.map} +1 -1
  66. package/dist/cdn/chunks/CollaborationNotices-BS7xrlPE.js +67 -0
  67. package/dist/cdn/chunks/CollaborationNotices-BS7xrlPE.js.map +1 -0
  68. package/dist/cdn/chunks/{CollaboratorBar-CXByAoUz.js → CollaboratorBar-Bc9914Az.js} +17 -17
  69. package/dist/cdn/chunks/{CollaboratorBar-CXByAoUz.js.map → CollaboratorBar-Bc9914Az.js.map} +1 -1
  70. package/dist/cdn/chunks/CommentsPanel-DbR9phAk.js +18 -0
  71. package/dist/cdn/chunks/{CommentsPanel-DoJnKLXI.js.map → CommentsPanel-DbR9phAk.js.map} +1 -1
  72. package/dist/cdn/chunks/CommentsSidebar-BD4--XP2.js +496 -0
  73. package/dist/cdn/chunks/CommentsSidebar-BD4--XP2.js.map +1 -0
  74. package/dist/cdn/chunks/{CountdownBlock-BqRw147R.js → CountdownBlock-CjMhMhnv.js} +22 -22
  75. package/dist/cdn/chunks/{CountdownBlock-BqRw147R.js.map → CountdownBlock-CjMhMhnv.js.map} +1 -1
  76. package/dist/cdn/chunks/CountdownToolbar-DxwYBw-d.js +260 -0
  77. package/dist/cdn/chunks/CountdownToolbar-DxwYBw-d.js.map +1 -0
  78. package/dist/cdn/chunks/{IssuesPanel-C7LfxaAY.js → IssuesPanel-CUmI4HMm.js} +133 -121
  79. package/dist/cdn/chunks/IssuesPanel-CUmI4HMm.js.map +1 -0
  80. package/dist/cdn/chunks/LanguageMenu-3ydCozQJ.js +359 -0
  81. package/dist/cdn/chunks/LanguageMenu-3ydCozQJ.js.map +1 -0
  82. package/dist/cdn/chunks/{LoadingTrack-CZuLTazv.js → LoadingTrack-DUYcDHOV.js} +2 -2
  83. package/dist/cdn/chunks/{LoadingTrack-CZuLTazv.js.map → LoadingTrack-DUYcDHOV.js.map} +1 -1
  84. package/dist/cdn/chunks/LocaleNotices-BfoH6gST.js +47 -0
  85. package/dist/cdn/chunks/LocaleNotices-BfoH6gST.js.map +1 -0
  86. package/dist/{LogicTagInsertButton-CfscnwCn.js → cdn/chunks/LogicTagInsertButton-5Z3fFzjc.js} +422 -449
  87. package/dist/cdn/chunks/LogicTagInsertButton-5Z3fFzjc.js.map +1 -0
  88. package/dist/cdn/chunks/{MediaEditModal-Cpcod6_U.js → MediaEditModal-DDCIwr9U.js} +421 -421
  89. package/dist/cdn/chunks/MediaEditModal-DDCIwr9U.js.map +1 -0
  90. package/dist/cdn/chunks/{MediaPanels-BIdcW_1f.js → MediaPanels-Dz79oy8P.js} +5 -5
  91. package/dist/cdn/chunks/{MediaPanels-BIdcW_1f.js.map → MediaPanels-Dz79oy8P.js.map} +1 -1
  92. package/dist/cdn/chunks/{MergeTagInput-BvWg8o5E.js → MergeTagInput-CIWy-cXf.js} +28 -28
  93. package/dist/cdn/chunks/{MergeTagInput-BvWg8o5E.js.map → MergeTagInput-CIWy-cXf.js.map} +1 -1
  94. package/dist/cdn/chunks/{MergeTagModeToggle-BgKEVUtV.js → MergeTagModeToggle-BrP5GR-x.js} +52 -52
  95. package/dist/cdn/chunks/MergeTagModeToggle-BrP5GR-x.js.map +1 -0
  96. package/dist/cdn/chunks/MergeTagTextarea-D3nNDlhV.js +128 -0
  97. package/dist/cdn/chunks/MergeTagTextarea-D3nNDlhV.js.map +1 -0
  98. package/dist/cdn/chunks/ParagraphEditor-DDolH_Pf.js +660 -0
  99. package/dist/cdn/chunks/ParagraphEditor-DDolH_Pf.js.map +1 -0
  100. package/dist/cdn/chunks/{RestoreVersionDialog-CjOdD2xj.js → RestoreVersionDialog-Crj1DBqC.js} +22 -22
  101. package/dist/cdn/chunks/{RestoreVersionDialog-CjOdD2xj.js.map → RestoreVersionDialog-Crj1DBqC.js.map} +1 -1
  102. package/dist/cdn/chunks/{RichTextEditorContent-DNjR_sNN.js → RichTextEditorContent-rCCqFlwJ.js} +44 -44
  103. package/dist/cdn/chunks/{RichTextEditorContent-DNjR_sNN.js.map → RichTextEditorContent-rCCqFlwJ.js.map} +1 -1
  104. package/dist/cdn/chunks/{SaveBlockDialog-CUhpawq0.js → SaveBlockDialog-C34RW1aM.js} +77 -77
  105. package/dist/cdn/chunks/{SaveBlockDialog-CUhpawq0.js.map → SaveBlockDialog-C34RW1aM.js.map} +1 -1
  106. package/dist/{SavedBlocksBrowserModal-CE8n4EBS.js → cdn/chunks/SavedBlocksBrowserModal-CJnwWPT-.js} +103 -106
  107. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BPYcRoGa.js.map → SavedBlocksBrowserModal-CJnwWPT-.js.map} +1 -1
  108. package/dist/cdn/chunks/{SavedBlocksPanels-C6--Bc81.js → SavedBlocksPanels-CA2PqXIH.js} +9 -9
  109. package/dist/cdn/chunks/{SavedBlocksPanels-C6--Bc81.js.map → SavedBlocksPanels-CA2PqXIH.js.map} +1 -1
  110. package/dist/cdn/chunks/{SavedBlocksPickBar-DUavxpbU.js → SavedBlocksPickBar-Dj3ortee.js} +16 -16
  111. package/dist/cdn/chunks/{SavedBlocksPickBar-DUavxpbU.js.map → SavedBlocksPickBar-Dj3ortee.js.map} +1 -1
  112. package/dist/cdn/chunks/TemplateSettings-sW0ZlDl1.js +266 -0
  113. package/dist/cdn/chunks/TemplateSettings-sW0ZlDl1.js.map +1 -0
  114. package/dist/cdn/chunks/TestEmailModal-BXeCtTjU.js +212 -0
  115. package/dist/cdn/chunks/TestEmailModal-BXeCtTjU.js.map +1 -0
  116. package/dist/cdn/chunks/{TestEmailPanel-CcUpEpAn.js → TestEmailPanel-CpZcpB9D.js} +5 -5
  117. package/dist/cdn/chunks/{TestEmailPanel-CcUpEpAn.js.map → TestEmailPanel-CpZcpB9D.js.map} +1 -1
  118. package/dist/cdn/chunks/TitleEditor-Bv3SmSO6.js +202 -0
  119. package/dist/cdn/chunks/TitleEditor-Bv3SmSO6.js.map +1 -0
  120. package/dist/cdn/chunks/ToggleSwitch-BSkySwA1.js +45 -0
  121. package/dist/cdn/chunks/ToggleSwitch-BSkySwA1.js.map +1 -0
  122. package/dist/cdn/chunks/Toolbar-BJKpJ2Mg.js +3626 -0
  123. package/dist/cdn/chunks/Toolbar-BJKpJ2Mg.js.map +1 -0
  124. package/dist/cdn/chunks/{TplModal-CFPDgbwQ.js → TplModal-DDDUDMYC.js} +20 -20
  125. package/dist/cdn/chunks/{TplModal-CFPDgbwQ.js.map → TplModal-DDDUDMYC.js.map} +1 -1
  126. package/dist/cdn/chunks/{VersionHistoryMenu-BYlLRvRJ.js → VersionHistoryMenu-DSElv3Sv.js} +33 -33
  127. package/dist/cdn/chunks/{VersionHistoryMenu-BYlLRvRJ.js.map → VersionHistoryMenu-DSElv3Sv.js.map} +1 -1
  128. package/dist/cdn/chunks/{VersionHistoryPanels-C6SOVoiT.js → VersionHistoryPanels-H2nuik1l.js} +6 -6
  129. package/dist/cdn/chunks/{VersionHistoryPanels-C6SOVoiT.js.map → VersionHistoryPanels-H2nuik1l.js.map} +1 -1
  130. package/dist/cdn/chunks/VersionPreviewBanner-Whwxh55w.js +39 -0
  131. package/dist/cdn/chunks/VersionPreviewBanner-Whwxh55w.js.map +1 -0
  132. package/dist/cdn/chunks/WrapperBlock-jTqsuLnS.js +46 -0
  133. package/dist/cdn/chunks/WrapperBlock-jTqsuLnS.js.map +1 -0
  134. package/dist/cdn/chunks/{blockTypeIcons-D7FW7Ypo.js → blockTypeIcons-DMgLcuI8.js} +5 -5
  135. package/dist/cdn/chunks/{blockTypeIcons-D7FW7Ypo.js.map → blockTypeIcons-DMgLcuI8.js.map} +1 -1
  136. package/dist/{ca-CD-Kt1qz.js → cdn/chunks/ca-DOuIxWRv.js} +116 -0
  137. package/dist/cdn/chunks/ca-DOuIxWRv.js.map +1 -0
  138. package/dist/cdn/chunks/composables-D0UYam2P.js +3039 -0
  139. package/dist/cdn/chunks/composables-D0UYam2P.js.map +1 -0
  140. package/dist/cdn/chunks/{createCloudRuntime-Cth2JCEh.js → createCloudRuntime-BdsclY8_.js} +75 -73
  141. package/dist/cdn/chunks/createCloudRuntime-BdsclY8_.js.map +1 -0
  142. package/dist/{de-CeFJ6wbM.js → cdn/chunks/de-DaOUfYBX.js} +116 -0
  143. package/dist/cdn/chunks/de-DaOUfYBX.js.map +1 -0
  144. package/dist/cdn/chunks/{dist-8ym3y-pH.js → dist-BzXULHvI.js} +48 -48
  145. package/dist/cdn/chunks/{dist-8ym3y-pH.js.map → dist-BzXULHvI.js.map} +1 -1
  146. package/dist/cdn/chunks/{dist-BMzNabtD.js → dist-DqGgijFI.js} +114 -114
  147. package/dist/cdn/chunks/{dist-BMzNabtD.js.map → dist-DqGgijFI.js.map} +1 -1
  148. package/dist/cdn/chunks/{draggable-Du8AUMFT.js → draggable-DepKdldn.js} +1491 -1486
  149. package/dist/cdn/chunks/draggable-DepKdldn.js.map +1 -0
  150. package/dist/cdn/chunks/{editor-modal-CyCe560f.js → editor-modal-CPbgthOv.js} +781 -781
  151. package/dist/cdn/chunks/{editor-modal-CyCe560f.js.map → editor-modal-CPbgthOv.js.map} +1 -1
  152. package/dist/{en-D14i5nFh.js → cdn/chunks/en-C0pHHMiR.js} +116 -0
  153. package/dist/cdn/chunks/en-C0pHHMiR.js.map +1 -0
  154. package/dist/cdn/chunks/en-IYVryJRl.js +1 -0
  155. package/dist/{es-zDacbMhs.js → cdn/chunks/es-CxyEKr6n.js} +116 -0
  156. package/dist/cdn/chunks/es-CxyEKr6n.js.map +1 -0
  157. package/dist/cdn/chunks/{extensions-CFF2KWy-.js → extensions-Uh9vuFfK.js} +59 -59
  158. package/dist/cdn/chunks/{extensions-CFF2KWy-.js.map → extensions-Uh9vuFfK.js.map} +1 -1
  159. package/dist/{fr-CSgYtjOd.js → cdn/chunks/fr-CYbamiI6.js} +116 -0
  160. package/dist/cdn/chunks/fr-CYbamiI6.js.map +1 -0
  161. package/dist/cdn/chunks/{icons-okSPsLOa.js → icons-CSSMtbGK.js} +150 -109
  162. package/dist/cdn/chunks/icons-CSSMtbGK.js.map +1 -0
  163. package/dist/{ja-B7H3ID8O.js → cdn/chunks/ja-DfaIAoGI.js} +116 -0
  164. package/dist/cdn/chunks/ja-DfaIAoGI.js.map +1 -0
  165. package/dist/cdn/chunks/keys-CoQtCqNv.js +11 -0
  166. package/dist/cdn/chunks/keys-CoQtCqNv.js.map +1 -0
  167. package/dist/cdn/chunks/languageName-DEEOhDWI.js +12 -0
  168. package/dist/cdn/chunks/languageName-DEEOhDWI.js.map +1 -0
  169. package/dist/{nl-176ySmc5.js → cdn/chunks/nl-DkrB-VKZ.js} +116 -0
  170. package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +1 -0
  171. package/dist/cdn/chunks/normalizeMergeTagMarkup-oGhwVscw.js +290 -0
  172. package/dist/cdn/chunks/normalizeMergeTagMarkup-oGhwVscw.js.map +1 -0
  173. package/dist/cdn/chunks/noticeTones-D7BPu-Le.js +16 -0
  174. package/dist/cdn/chunks/noticeTones-D7BPu-Le.js.map +1 -0
  175. package/dist/cdn/chunks/plural-CyxrJXL1.js +17 -0
  176. package/dist/cdn/chunks/plural-CyxrJXL1.js.map +1 -0
  177. package/dist/cdn/chunks/{preRenderCustomBlocks-BcXIz7oJ.js → preRenderCustomBlocks-C8k7tw98.js} +5 -5
  178. package/dist/cdn/chunks/{preRenderCustomBlocks-BcXIz7oJ.js.map → preRenderCustomBlocks-C8k7tw98.js.map} +1 -1
  179. package/dist/{pt-BR-dDlTwX18.js → cdn/chunks/pt-BR-CY5Ye7eP.js} +116 -0
  180. package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +1 -0
  181. package/dist/cdn/chunks/sanitizeHtml-DYklmvgX.js +61 -0
  182. package/dist/cdn/chunks/sanitizeHtml-DYklmvgX.js.map +1 -0
  183. package/dist/cdn/chunks/socialIcons-BAiuHyJs.js +2638 -0
  184. package/dist/cdn/chunks/socialIcons-BAiuHyJs.js.map +1 -0
  185. package/dist/cdn/chunks/src-CACM3o--.js +2606 -0
  186. package/dist/cdn/chunks/src-CACM3o--.js.map +1 -0
  187. package/dist/cdn/chunks/{src-C7bkofBL.js → src-Ddpm4HsS.js} +222 -256
  188. package/dist/cdn/chunks/src-Ddpm4HsS.js.map +1 -0
  189. package/dist/cdn/chunks/{src-DEd87i_U.js → src-DheBmnvF.js} +635 -478
  190. package/dist/cdn/chunks/src-DheBmnvF.js.map +1 -0
  191. package/dist/{styleConstants-B8xVRiwX.js → cdn/chunks/styleConstants-CgiNKdnc.js} +7 -5
  192. package/dist/cdn/chunks/styleConstants-CgiNKdnc.js.map +1 -0
  193. package/dist/cdn/chunks/templateSettingsFields-cjlP-jdw.js.map +1 -1
  194. package/dist/cdn/chunks/{tiptap-CbiTlECY.js → tiptap-Dipw_zOQ.js} +40 -40
  195. package/dist/cdn/chunks/{tiptap-CbiTlECY.js.map → tiptap-Dipw_zOQ.js.map} +1 -1
  196. package/dist/cdn/chunks/{useCloudI18n-DY8_-ETE.js → useCloudI18n-Cc5NZqiI.js} +3 -3
  197. package/dist/cdn/chunks/{useCloudI18n-DY8_-ETE.js.map → useCloudI18n-Cc5NZqiI.js.map} +1 -1
  198. package/dist/cdn/chunks/useEditorRoot-D_LuZ_hE.js +9 -0
  199. package/dist/cdn/chunks/{useEditorRoot-vjZJwKrV.js.map → useEditorRoot-D_LuZ_hE.js.map} +1 -1
  200. package/dist/cdn/chunks/{useI18n-D8pY4LTq.js → useI18n-BnJYydPv.js} +3 -3
  201. package/dist/cdn/chunks/{useI18n-D8pY4LTq.js.map → useI18n-BnJYydPv.js.map} +1 -1
  202. package/dist/cdn/chunks/useLocalizedDisplay-yXbRKNrs.js +33 -0
  203. package/dist/cdn/chunks/useLocalizedDisplay-yXbRKNrs.js.map +1 -0
  204. package/dist/cdn/chunks/{useLogicTag-DBJDtpKA.js → useLogicTag-B7RpqVFQ.js} +5 -5
  205. package/dist/cdn/chunks/{useLogicTag-DBJDtpKA.js.map → useLogicTag-B7RpqVFQ.js.map} +1 -1
  206. package/dist/cdn/chunks/{useMergeTag-B-aG--s1.js → useMergeTag-C-32ETjj.js} +6 -6
  207. package/dist/cdn/chunks/{useMergeTag-B-aG--s1.js.map → useMergeTag-C-32ETjj.js.map} +1 -1
  208. package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js +78 -0
  209. package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js.map +1 -0
  210. package/dist/cdn/chunks/{useScrollToBlock-vjQ0fe-L.js → useScrollToBlock-Ct1AwLD-.js} +5 -5
  211. package/dist/cdn/chunks/useScrollToBlock-Ct1AwLD-.js.map +1 -0
  212. package/dist/cdn/chunks/{withCurrentFont-hZTvYBHO.js → withCurrentFont-D33ZXoWp.js} +2 -2
  213. package/dist/cdn/chunks/{withCurrentFont-hZTvYBHO.js.map → withCurrentFont-D33ZXoWp.js.map} +1 -1
  214. package/dist/cdn/editor.css +1 -1
  215. package/dist/cdn/editor.js +2190 -1496
  216. package/dist/cdn/editor.js.map +1 -1
  217. package/dist/{check-BZ8o0eet.js → check-ChQ0l8EQ.js} +1 -1
  218. package/dist/{chevron-down-DfAAfILv.js → chevron-down-Bh6cp6PI.js} +1 -1
  219. package/dist/{chevron-right-Bk4mGdr7.js → chevron-right-LUgdqdoW.js} +1 -1
  220. package/dist/{chevron-up-MhUf_azW.js → chevron-up-XsDeJxQN.js} +1 -1
  221. package/dist/{circle-alert-CShJwVFv.js → circle-alert-lODfDsrj.js} +1 -1
  222. package/dist/{clock-CTfD6OCt.js → clock-DrqFEZkT.js} +1 -1
  223. package/dist/composables-BOP3ERRP.js +4517 -0
  224. package/dist/{createCloudRuntime-DCgO4A1r.js → createCloudRuntime-DGV5a5Af.js} +54 -52
  225. package/dist/{createLucideIcon-CvhTA2KG.js → createLucideIcon-Dw5e5gVE.js} +11 -11
  226. package/dist/{cdn/chunks/de-CeFJ6wbM.js → de-DaOUfYBX.js} +114 -2
  227. package/dist/{dist-ByCWA2Tv.js → dist-0alKVRc_.js} +101 -101
  228. package/dist/{dist-Cy8I5scI.js → dist-54VCNoC0.js} +2 -2
  229. package/dist/dist-6DU0me3E.js +4 -0
  230. package/dist/{dist-p3wymUDt.js → dist-B8dY8drK.js} +2 -2
  231. package/dist/{dist-Dd5MU2Ev.js → dist-B9a7iVye.js} +2 -2
  232. package/dist/{dist-V7W1UhVr.js → dist-BWflWcpW.js} +2 -2
  233. package/dist/{dist-D6fZec6r.js → dist-C3hu_C3w.js} +2 -2
  234. package/dist/{dist-CVy-7PHQ.js → dist-CX7skkvG.js} +48 -48
  235. package/dist/dist-CcOn7WCo.js +4 -0
  236. package/dist/dist-Cdkm20M6.js +2542 -0
  237. package/dist/{dist-BS5uKktL.js → dist-ChOb5XHW.js} +2 -2
  238. package/dist/{dist-BF5zEHop.js → dist-DZ3X-uB8.js} +2 -2
  239. package/dist/{dist-CWSG7Kj0.js → dist-D_XrUEET.js} +5 -5
  240. package/dist/{dist-txQLT2sF.js → dist-TAv500j6.js} +2 -2
  241. package/dist/{dist-D6cMdrfG.js → dist-fqSers8_.js} +55 -55
  242. package/dist/{editor-modal-zaZHcmlO.js → editor-modal-B_2EAOjN.js} +953 -952
  243. package/dist/{cdn/chunks/en-D14i5nFh.js → en-C0pHHMiR.js} +114 -2
  244. package/dist/en-DTtwco2Q.js +1 -0
  245. package/dist/{cdn/chunks/es-zDacbMhs.js → es-CxyEKr6n.js} +114 -2
  246. package/dist/{extensions-fo_c-vqf.js → extensions-DOLZkLzV.js} +173 -173
  247. package/dist/{eye-7W4t5e0Q.js → eye-DChfk0gi.js} +1 -1
  248. package/dist/{cdn/chunks/fr-CSgYtjOd.js → fr-CYbamiI6.js} +114 -2
  249. package/dist/{image-BDiRFzSd.js → image--Hj2by1G.js} +1 -1
  250. package/dist/index.d.ts +182 -14
  251. package/dist/{info-Cxi3-Kh9.js → info-BbXgy82f.js} +1 -1
  252. package/dist/{cdn/chunks/ja-B7H3ID8O.js → ja-DfaIAoGI.js} +114 -2
  253. package/dist/keys-BCqskl51.js +9 -0
  254. package/dist/languageName-DEEOhDWI.js +10 -0
  255. package/dist/{link-ju_2Cmir.js → link-C2_8yJno.js} +1 -1
  256. package/dist/{list-DYZJf0aZ.js → list-DLGs2n0V.js} +1 -1
  257. package/dist/{loader-circle-BZRD0a4I.js → loader-circle-BbDItE_O.js} +1 -1
  258. package/dist/{message-circle-DuEw4Zfx.js → message-circle-NAModq0p.js} +1 -1
  259. package/dist/{cdn/chunks/nl-176ySmc5.js → nl-DkrB-VKZ.js} +114 -2
  260. package/dist/normalizeMergeTagMarkup-CUCo7B5X.js +288 -0
  261. package/dist/noticeTones-D7BPu-Le.js +14 -0
  262. package/dist/{package-CePMr2kK.js → package-BuzsfRyH.js} +1 -1
  263. package/dist/{pencil-D3aFCL7c.js → pencil-BTUUECH4.js} +1 -1
  264. package/dist/plural-CyxrJXL1.js +15 -0
  265. package/dist/plus-Dm7DN65T.js +13 -0
  266. package/dist/{preRenderCustomBlocks--_xc0XK3.js → preRenderCustomBlocks-Bs3N9no-.js} +4 -4
  267. package/dist/{cdn/chunks/pt-BR-dDlTwX18.js → pt-BR-CY5Ye7eP.js} +114 -2
  268. package/dist/{refresh-cw-xnro7_Sk.js → refresh-cw-xMURqGWi.js} +2 -12
  269. package/dist/rotate-ccw-DqVcEIn5.js +13 -0
  270. package/dist/{runtime-dom.esm-bundler-BURR-bj5.js → runtime-dom.esm-bundler-DlHp8xgy.js} +154 -154
  271. package/dist/sanitizeHtml-mKgNUdME.js +962 -0
  272. package/dist/{search-CDrstRBv.js → search-Cfr3W44N.js} +1 -1
  273. package/dist/{send-DROkPOaX.js → send-CH1SrvyB.js} +1 -1
  274. package/dist/{smartphone-Bx6u_tjn.js → smartphone-pAkvzjdI.js} +1 -1
  275. package/dist/socialIcons-Dqr4DJOz.js +2705 -0
  276. package/dist/{sparkles-CdaTtvoz.js → sparkles-CRO0cCnp.js} +1 -1
  277. package/dist/{square-BbCROH_f.js → square-CaQWMntx.js} +1 -1
  278. package/dist/style.css +1 -1
  279. package/dist/{cdn/chunks/styleConstants-B8xVRiwX.js → styleConstants-CgiNKdnc.js} +5 -7
  280. package/dist/templatical-editor.js +2438 -1752
  281. package/dist/{text-align-start-CGacJ9Vw.js → text-align-start-BQ39AaRK.js} +1 -1
  282. package/dist/{trash-DxCd7zIy.js → trash-BL5gEFHN.js} +1 -1
  283. package/dist/{triangle-alert-7_oaitpf.js → triangle-alert-BYbKu7zZ.js} +1 -1
  284. package/dist/{upload-DuFEOi_0.js → upload-BhmL4Vqx.js} +1 -1
  285. package/dist/{useCloudI18n-DEMmUKuO.js → useCloudI18n-Dh2iydo1.js} +4 -4
  286. package/dist/useEditorRoot-DY3mgcHm.js +7 -0
  287. package/dist/{useI18n-BBrHTdu8.js → useI18n-CgtvtF4C.js} +4 -4
  288. package/dist/useLocalizedDisplay-DNNwDRxL.js +31 -0
  289. package/dist/{useLogicTag-ZPC39rfH.js → useLogicTag-BXXXQQmi.js} +4 -4
  290. package/dist/{useMergeTag-BQ4qqWpQ.js → useMergeTag-C9Okr87y.js} +5 -5
  291. package/dist/usePopoverPosition-VDQjyX_A.js +76 -0
  292. package/dist/{useScrollToBlock-BSyAV4pk.js → useScrollToBlock-C0Kapxdh.js} +5 -5
  293. package/dist/{vue.runtime.esm-bundler-CnEeTfhs.js → vue.runtime.esm-bundler-BJXc_Mri.js} +1373 -1368
  294. package/dist/withCurrentFont-DJiQqZzL.js +18 -0
  295. package/dist/{x-BpfG7v9g.js → x-B7NZYzhx.js} +1 -1
  296. package/package.json +20 -20
  297. package/dist/AiAltTextPopover-DawbUywc.js +0 -105
  298. package/dist/AiChatPanel-CupPhmsN.js +0 -548
  299. package/dist/BlockIssueBadge-BxpDy3u-.js +0 -33
  300. package/dist/BlockPreviewCanvas-B-4bmJ3t.js +0 -140
  301. package/dist/CollaborationNotices-CTw4JThq.js +0 -75
  302. package/dist/CommentsPanel-DwwFuh1h.js +0 -16
  303. package/dist/CommentsSidebar-9ZfiC2DO.js +0 -500
  304. package/dist/CountdownToolbar-BqoYzf_6.js +0 -197
  305. package/dist/IssuesPanel-4ykrf1ax.js +0 -359
  306. package/dist/MergeTagTextarea-CPFEjJZd.js +0 -69
  307. package/dist/ParagraphEditor-CWXfurGh.js +0 -796
  308. package/dist/TemplateSettings-CS0f1Ues.js +0 -236
  309. package/dist/TestEmailModal-DBD0X5nV.js +0 -209
  310. package/dist/TitleEditor-DSqtle77.js +0 -198
  311. package/dist/ToggleSwitch-JykPyD_8.js +0 -36
  312. package/dist/Toolbar-BZPFfKrf.js +0 -3145
  313. package/dist/VersionPreviewBanner-DECaBwLq.js +0 -37
  314. package/dist/WrapperBlock-BsJv_Fiw.js +0 -44
  315. package/dist/cdn/chunks/AiAltTextPopover-SEEjkd-I.js +0 -106
  316. package/dist/cdn/chunks/AiAltTextPopover-SEEjkd-I.js.map +0 -1
  317. package/dist/cdn/chunks/AiAltTextReview-BGLLSKLm.js.map +0 -1
  318. package/dist/cdn/chunks/AiChatPanel-DKDAaBNi.js +0 -474
  319. package/dist/cdn/chunks/AiChatPanel-DKDAaBNi.js.map +0 -1
  320. package/dist/cdn/chunks/AiRewriteMenu-qf-cfEpy.js.map +0 -1
  321. package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js +0 -34
  322. package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js.map +0 -1
  323. package/dist/cdn/chunks/BlockPreviewCanvas-DGBh6mqe.js +0 -142
  324. package/dist/cdn/chunks/CollaborationNotices-Bsf1rGW9.js +0 -77
  325. package/dist/cdn/chunks/CollaborationNotices-Bsf1rGW9.js.map +0 -1
  326. package/dist/cdn/chunks/CommentsPanel-DoJnKLXI.js +0 -18
  327. package/dist/cdn/chunks/CommentsSidebar-CUtgvdBC.js +0 -470
  328. package/dist/cdn/chunks/CommentsSidebar-CUtgvdBC.js.map +0 -1
  329. package/dist/cdn/chunks/CountdownToolbar-xobieKoU.js +0 -199
  330. package/dist/cdn/chunks/CountdownToolbar-xobieKoU.js.map +0 -1
  331. package/dist/cdn/chunks/IssuesPanel-C7LfxaAY.js.map +0 -1
  332. package/dist/cdn/chunks/LogicTagInsertButton-BIi05UQu.js +0 -1051
  333. package/dist/cdn/chunks/LogicTagInsertButton-BIi05UQu.js.map +0 -1
  334. package/dist/cdn/chunks/MediaEditModal-Cpcod6_U.js.map +0 -1
  335. package/dist/cdn/chunks/MergeTagModeToggle-BgKEVUtV.js.map +0 -1
  336. package/dist/cdn/chunks/MergeTagTextarea-tBz8McZf.js +0 -71
  337. package/dist/cdn/chunks/MergeTagTextarea-tBz8McZf.js.map +0 -1
  338. package/dist/cdn/chunks/ParagraphEditor-B3Rj_cWF.js +0 -631
  339. package/dist/cdn/chunks/ParagraphEditor-B3Rj_cWF.js.map +0 -1
  340. package/dist/cdn/chunks/TemplateSettings-CKtI-dof.js +0 -208
  341. package/dist/cdn/chunks/TemplateSettings-CKtI-dof.js.map +0 -1
  342. package/dist/cdn/chunks/TestEmailModal-CDQTgESD.js +0 -209
  343. package/dist/cdn/chunks/TestEmailModal-CDQTgESD.js.map +0 -1
  344. package/dist/cdn/chunks/TitleEditor-Cob7RLyK.js +0 -198
  345. package/dist/cdn/chunks/TitleEditor-Cob7RLyK.js.map +0 -1
  346. package/dist/cdn/chunks/ToggleSwitch-J7Vwhvha.js +0 -38
  347. package/dist/cdn/chunks/ToggleSwitch-J7Vwhvha.js.map +0 -1
  348. package/dist/cdn/chunks/Toolbar-CdpsvNOR.js +0 -3061
  349. package/dist/cdn/chunks/Toolbar-CdpsvNOR.js.map +0 -1
  350. package/dist/cdn/chunks/VersionPreviewBanner-Dvg0ZfAW.js +0 -39
  351. package/dist/cdn/chunks/VersionPreviewBanner-Dvg0ZfAW.js.map +0 -1
  352. package/dist/cdn/chunks/WrapperBlock-C7Md56IT.js +0 -46
  353. package/dist/cdn/chunks/WrapperBlock-C7Md56IT.js.map +0 -1
  354. package/dist/cdn/chunks/ca-CD-Kt1qz.js.map +0 -1
  355. package/dist/cdn/chunks/createCloudRuntime-Cth2JCEh.js.map +0 -1
  356. package/dist/cdn/chunks/de-CeFJ6wbM.js.map +0 -1
  357. package/dist/cdn/chunks/draggable-Du8AUMFT.js.map +0 -1
  358. package/dist/cdn/chunks/en-D14i5nFh.js.map +0 -1
  359. package/dist/cdn/chunks/en-TIqv4ag3.js +0 -1
  360. package/dist/cdn/chunks/es-zDacbMhs.js.map +0 -1
  361. package/dist/cdn/chunks/fr-CSgYtjOd.js.map +0 -1
  362. package/dist/cdn/chunks/icons-okSPsLOa.js.map +0 -1
  363. package/dist/cdn/chunks/ja-B7H3ID8O.js.map +0 -1
  364. package/dist/cdn/chunks/keys-CUj6UA38.js +0 -11
  365. package/dist/cdn/chunks/keys-CUj6UA38.js.map +0 -1
  366. package/dist/cdn/chunks/nl-176ySmc5.js.map +0 -1
  367. package/dist/cdn/chunks/normalizeMergeTagMarkup-C_KlfSW4.js +0 -198
  368. package/dist/cdn/chunks/normalizeMergeTagMarkup-C_KlfSW4.js.map +0 -1
  369. package/dist/cdn/chunks/pt-BR-dDlTwX18.js.map +0 -1
  370. package/dist/cdn/chunks/sanitizeHtml-CN85EDrO.js +0 -72
  371. package/dist/cdn/chunks/sanitizeHtml-CN85EDrO.js.map +0 -1
  372. package/dist/cdn/chunks/socialIcons-jsTDmkbb.js +0 -2008
  373. package/dist/cdn/chunks/socialIcons-jsTDmkbb.js.map +0 -1
  374. package/dist/cdn/chunks/src-C7bkofBL.js.map +0 -1
  375. package/dist/cdn/chunks/src-DEd87i_U.js.map +0 -1
  376. package/dist/cdn/chunks/src-DwWrYnUj.js +0 -1404
  377. package/dist/cdn/chunks/src-DwWrYnUj.js.map +0 -1
  378. package/dist/cdn/chunks/styleConstants-B8xVRiwX.js.map +0 -1
  379. package/dist/cdn/chunks/useEditorCore-BrY66C2y.js +0 -2582
  380. package/dist/cdn/chunks/useEditorCore-BrY66C2y.js.map +0 -1
  381. package/dist/cdn/chunks/useEditorRoot-vjZJwKrV.js +0 -9
  382. package/dist/cdn/chunks/usePopoverPosition-DSMtmu2W.js +0 -70
  383. package/dist/cdn/chunks/usePopoverPosition-DSMtmu2W.js.map +0 -1
  384. package/dist/cdn/chunks/useScrollToBlock-vjQ0fe-L.js.map +0 -1
  385. package/dist/dist-CKi_npZM.js +0 -1344
  386. package/dist/dist-DyFArF_G.js +0 -4
  387. package/dist/dist-pA3ooG6N.js +0 -4
  388. package/dist/en-Db76vJbY.js +0 -1
  389. package/dist/keys-BgRERHzu.js +0 -9
  390. package/dist/normalizeMergeTagMarkup-CELnOlgK.js +0 -196
  391. package/dist/sanitizeHtml-BzfzpYJY.js +0 -942
  392. package/dist/socialIcons-D7MGsg0d.js +0 -2075
  393. package/dist/useEditorCore-BSo2sSID.js +0 -4059
  394. package/dist/useEditorRoot-BMcoCLBx.js +0 -7
  395. package/dist/usePopoverPosition-DV1PxL66.js +0 -68
  396. package/dist/withCurrentFont-B22FXAF5.js +0 -18
@@ -0,0 +1,2606 @@
1
+ // ../types/src/blocks.ts
2
+ var e = [
3
+ "top",
4
+ "right",
5
+ "bottom",
6
+ "left"
7
+ ];
8
+ function t(e) {
9
+ return {
10
+ top: { ...e },
11
+ right: { ...e },
12
+ bottom: { ...e },
13
+ left: { ...e }
14
+ };
15
+ }
16
+ function n(e) {
17
+ return !e || typeof e.width != "number" || !Number.isFinite(e.width) || e.width <= 0 ? null : `${e.width}px ${e.style} ${e.color}`;
18
+ }
19
+ function r(t) {
20
+ if (!t) return {};
21
+ let r = e.map((e) => n(t[e]));
22
+ if (r[0] !== null && r.every((e) => e === r[0])) return { border: r[0] };
23
+ let i = {};
24
+ return e.forEach((e, t) => {
25
+ let n = r[t];
26
+ n !== null && (i[`border-${e}`] = n);
27
+ }), i;
28
+ }
29
+ var i = [
30
+ "topLeft",
31
+ "topRight",
32
+ "bottomRight",
33
+ "bottomLeft"
34
+ ];
35
+ function a(e) {
36
+ return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : 0;
37
+ }
38
+ function o(e) {
39
+ if (e == null) return null;
40
+ let t = i.map(typeof e == "number" ? () => a(e) : (t) => a(e[t]));
41
+ return t.every((e) => e === 0) ? null : t.every((e) => e === t[0]) ? `${t[0]}px` : t.map((e) => `${e}px`).join(" ");
42
+ }
43
+ var s = {
44
+ 1: 36,
45
+ 2: 28,
46
+ 3: 22,
47
+ 4: 18
48
+ }, c = 1.3, l = {
49
+ paragraphGap: 8,
50
+ listMarginY: 8,
51
+ listPaddingLeft: 24,
52
+ listItemMarginY: 4
53
+ }, u = [
54
+ "cover",
55
+ "contain",
56
+ "auto"
57
+ ], d = [
58
+ "left",
59
+ "center",
60
+ "right"
61
+ ], f = [
62
+ "top",
63
+ "center",
64
+ "bottom"
65
+ ];
66
+ function ee(e) {
67
+ return {
68
+ url: e,
69
+ size: "cover",
70
+ position: {
71
+ x: "center",
72
+ y: "center"
73
+ },
74
+ repeat: !1
75
+ };
76
+ }
77
+ function te(e) {
78
+ let t = "";
79
+ for (let n of e) {
80
+ let e = n.charCodeAt(0);
81
+ t += e < 32 || e === 127 || n === "'" || n === "\"" || n === "\\" ? `%${e.toString(16).toUpperCase().padStart(2, "0")}` : n;
82
+ }
83
+ return t;
84
+ }
85
+ function ne(e) {
86
+ let t = typeof e?.url == "string" ? e.url.trim() : "";
87
+ if (!e || !t) return null;
88
+ let n = u.includes(e.size) ? e.size : "cover", r = e.position, i = r && d.includes(r.x) ? r.x : "center", a = r && f.includes(r.y) ? r.y : "center";
89
+ return {
90
+ url: te(t),
91
+ size: n,
92
+ position: `${i} ${a}`,
93
+ repeat: e.repeat ? "repeat" : "no-repeat"
94
+ };
95
+ }
96
+ // ../types/src/hero.ts
97
+ var re = [
98
+ "top",
99
+ "middle",
100
+ "bottom"
101
+ ];
102
+ function ie(e) {
103
+ let t = e.hero;
104
+ if (!t || typeof t != "object") return null;
105
+ if (e.columns !== "1") return {
106
+ applied: !1,
107
+ reason: "columns"
108
+ };
109
+ let n = ne(e.backgroundImage);
110
+ if (n === null) return {
111
+ applied: !1,
112
+ reason: "image"
113
+ };
114
+ let r = oe(e.backgroundImage), i = ae(t.height) ? Math.round(t.height) : "image";
115
+ return i === "image" && r === null ? {
116
+ applied: !1,
117
+ reason: "size"
118
+ } : {
119
+ applied: !0,
120
+ image: n,
121
+ height: i,
122
+ verticalAlign: re.includes(t.verticalAlign) ? t.verticalAlign : "middle",
123
+ aspectRatio: r
124
+ };
125
+ }
126
+ function ae(e) {
127
+ return typeof e == "number" && Number.isFinite(e) && e >= 1;
128
+ }
129
+ function oe(e) {
130
+ let t = e?.naturalWidth, n = e?.naturalHeight;
131
+ return typeof t != "number" || typeof n != "number" || !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 || n <= 0 ? null : n / t;
132
+ }
133
+ // ../types/src/social.ts
134
+ var se = {
135
+ facebook: {
136
+ color: "#1877F2",
137
+ path: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"
138
+ },
139
+ twitter: {
140
+ color: "#000000",
141
+ path: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"
142
+ },
143
+ instagram: {
144
+ color: "#E4405F",
145
+ path: "M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z"
146
+ },
147
+ linkedin: {
148
+ color: "#0A66C2",
149
+ path: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"
150
+ },
151
+ youtube: {
152
+ color: "#FF0000",
153
+ path: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"
154
+ },
155
+ tiktok: {
156
+ color: "#000000",
157
+ path: "M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"
158
+ },
159
+ pinterest: {
160
+ color: "#BD081C",
161
+ path: "M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.782c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738.098.119.112.224.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146C9.57 23.812 10.763 24 12 24c6.627 0 12-5.373 12-12 0-6.628-5.373-12-12-12z"
162
+ },
163
+ email: {
164
+ color: "#6B7280",
165
+ path: "M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z"
166
+ },
167
+ website: {
168
+ color: "#6B7280",
169
+ path: "M21.721 12.752a9.711 9.711 0 0 0-.945-5.003 12.754 12.754 0 0 1-4.339 2.708 18.991 18.991 0 0 1-.214 4.772 17.165 17.165 0 0 0 5.498-2.477ZM14.634 15.55a17.324 17.324 0 0 0 .332-4.647c-.952.227-1.945.347-2.966.347-1.021 0-2.014-.12-2.966-.347a17.515 17.515 0 0 0 .332 4.647 17.385 17.385 0 0 0 5.268 0ZM9.772 17.119a18.963 18.963 0 0 0 4.456 0A17.182 17.182 0 0 1 12 21.724a17.18 17.18 0 0 1-2.228-4.605ZM7.777 15.23a18.87 18.87 0 0 1-.214-4.774 12.753 12.753 0 0 1-4.34-2.708 9.711 9.711 0 0 0-.944 5.004 17.165 17.165 0 0 0 5.498 2.477ZM21.356 14.752a9.765 9.765 0 0 1-7.478 6.817 18.64 18.64 0 0 0 1.988-4.718 18.627 18.627 0 0 0 5.49-2.098ZM2.644 14.752c1.682.971 3.53 1.688 5.49 2.099a18.64 18.64 0 0 0 1.988 4.718 9.765 9.765 0 0 1-7.478-6.816ZM13.878 2.43a9.755 9.755 0 0 1 6.116 3.986 11.267 11.267 0 0 1-3.746 2.504 18.63 18.63 0 0 0-2.37-6.49ZM12 2.276a17.152 17.152 0 0 1 2.805 7.121c-.897.23-1.837.353-2.805.353-.968 0-1.908-.122-2.805-.353A17.151 17.151 0 0 1 12 2.276ZM10.122 2.43a18.629 18.629 0 0 0-2.37 6.49 11.266 11.266 0 0 1-3.746-2.504 9.754 9.754 0 0 1 6.116-3.985Z"
170
+ },
171
+ whatsapp: {
172
+ color: "#25D366",
173
+ path: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"
174
+ },
175
+ telegram: {
176
+ color: "#26A5E4",
177
+ path: "M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"
178
+ },
179
+ discord: {
180
+ color: "#5865F2",
181
+ path: "M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"
182
+ },
183
+ snapchat: {
184
+ color: "#FFFC00",
185
+ path: "M12.017 0C5.396 0 .029 5.367.029 11.987c0 5.079 3.158 9.417 7.618 11.162-.105-.949-.199-2.403.041-3.439.219-.937 1.406-5.957 1.406-5.957s-.359-.72-.359-1.781c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738a.36.36 0 01.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146 1.124.347 2.317.535 3.554.535 6.627 0 12.017-5.373 12.017-12.001C24.034 5.367 18.644 0 12.017 0z"
186
+ },
187
+ reddit: {
188
+ color: "#FF4500",
189
+ path: "M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"
190
+ },
191
+ github: {
192
+ color: "#181717",
193
+ path: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"
194
+ },
195
+ dribbble: {
196
+ color: "#EA4C89",
197
+ path: "M12 24C5.385 24 0 18.615 0 12S5.385 0 12 0s12 5.385 12 12-5.385 12-12 12zm10.12-10.358c-.35-.11-3.17-.953-6.384-.438 1.34 3.684 1.887 6.684 1.992 7.308 2.3-1.555 3.936-4.02 4.392-6.87zm-6.115 7.808c-.153-.9-.75-4.032-2.19-7.77l-.066.02c-5.79 2.015-7.86 6.025-8.04 6.4 1.73 1.358 3.92 2.166 6.29 2.166 1.42 0 2.77-.29 4-.814zm-11.62-2.58c.232-.4 3.045-5.055 8.332-6.765.135-.045.27-.084.405-.12-.26-.585-.54-1.167-.832-1.74C7.17 11.775 2.206 11.71 1.756 11.7l-.004.312c0 2.633.998 5.037 2.634 6.855zm-2.42-8.955c.46.008 4.683.026 9.477-1.248-1.698-3.018-3.53-5.558-3.8-5.928-2.868 1.35-5.01 3.99-5.676 7.17zM9.6 2.052c.282.38 2.145 2.914 3.822 6 3.645-1.365 5.19-3.44 5.373-3.702-1.81-1.61-4.19-2.586-6.795-2.586-.825 0-1.63.1-2.4.285zm10.335 3.483c-.218.29-1.935 2.493-5.724 4.04.24.49.47.985.68 1.486.08.18.15.36.22.53 3.41-.43 6.8.26 7.14.33-.02-2.42-.88-4.64-2.31-6.38z"
198
+ },
199
+ behance: {
200
+ color: "#1769FF",
201
+ path: "M22 7h-7V5h7v2zm1.726 10c-.442 1.297-2.029 3-5.101 3-3.074 0-5.564-1.729-5.564-5.675 0-3.91 2.325-5.92 5.466-5.92 3.082 0 4.964 1.782 5.375 4.426.078.506.109 1.188.095 2.14H15.97c.13 3.211 3.483 3.312 4.588 2.029h3.168zm-7.686-4h4.965c-.105-1.547-1.136-2.219-2.477-2.219-1.466 0-2.277.768-2.488 2.219zm-9.574 6.988H0V5.021h6.953c5.476.081 5.58 5.444 2.72 6.906 3.461 1.26 3.577 8.061-3.207 8.061zM3 11h3.584c2.508 0 2.906-3-.312-3H3v3zm3.391 3H3v3.016h3.341c3.055 0 2.868-3.016.05-3.016z"
202
+ }
203
+ }, ce = {
204
+ dark: "#1f1f1f",
205
+ light: "#ffffff"
206
+ };
207
+ function le(e) {
208
+ return e === "dark" || e === "light" ? e : void 0;
209
+ }
210
+ function ue(e, t) {
211
+ let n = le(t);
212
+ return {
213
+ fill: n ? ce[n] : se[e].color,
214
+ onFill: n === "light" ? ce.dark : "#ffffff"
215
+ };
216
+ }
217
+ function de(e, t) {
218
+ let n = le(t);
219
+ return n ? `${e}-${n}` : e;
220
+ }
221
+ function fe(e, t) {
222
+ if (le(t) === "dark" && (e === "plain" || e === "outlined")) return {
223
+ color: ce.light,
224
+ opacity: .6,
225
+ width: 1.4
226
+ };
227
+ }
228
+ function pe(e) {
229
+ return e === "plain" ? .84 : .6;
230
+ }
231
+ // ../types/src/element-ids.ts
232
+ function me(e) {
233
+ let t = [], n = (e, n) => {
234
+ typeof e == "string" && /[./]/.test(e) && t.push({
235
+ path: n,
236
+ id: e
237
+ });
238
+ }, r = (e, t) => {
239
+ Array.isArray(e) && e.forEach((e, i) => {
240
+ if (!e || typeof e != "object") return;
241
+ let a = `${t}[${i}]`;
242
+ e.type === "menu" && Array.isArray(e.items) ? e.items.forEach((e, t) => n(e?.id, `${a}.items[${t}].id`)) : e.type === "social" && Array.isArray(e.icons) ? e.icons.forEach((e, t) => n(e?.id, `${a}.icons[${t}].id`)) : e.type === "table" && Array.isArray(e.rows) ? e.rows.forEach((e, t) => {
243
+ let r = `${a}.rows[${t}]`;
244
+ n(e?.id, `${r}.id`), Array.isArray(e?.cells) && e.cells.forEach((e, t) => n(e?.id, `${r}.cells[${t}].id`));
245
+ }) : e.type === "section" && Array.isArray(e.children) ? e.children.forEach((e, t) => r(e, `${a}.children[${t}]`)) : e.type === "wrapper" && r(e.children, `${a}.children`);
246
+ });
247
+ };
248
+ return r(e.blocks, "blocks"), t;
249
+ }
250
+ // ../types/src/clone.ts
251
+ function p(e) {
252
+ let t = [];
253
+ return JSON.parse(JSON.stringify(e, function(e, n) {
254
+ if (typeof n != "object" || !n) return n;
255
+ for (; t.length > 0 && t[t.length - 1] !== this;) t.pop();
256
+ if (!t.includes(n)) return t.push(n), n;
257
+ }));
258
+ }
259
+ // ../types/src/deep-equal.ts
260
+ function he(e) {
261
+ return typeof e == "object" && !!e && !Array.isArray(e);
262
+ }
263
+ function m(e, t) {
264
+ if (e === t) return !0;
265
+ if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => m(e, t[n]));
266
+ if (he(e)) {
267
+ if (!he(t)) return !1;
268
+ let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
269
+ for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !m(e[r], t[r])) return !1;
270
+ return !0;
271
+ }
272
+ return !1;
273
+ }
274
+ // ../types/src/config.ts
275
+ var ge = class extends Error {
276
+ statusCode;
277
+ code;
278
+ constructor(e, t, n, r) {
279
+ super(e), this.statusCode = t, this.code = n, this.name = "SdkError", r !== void 0 && Object.keys(r).length > 0 && (this.details = r);
280
+ }
281
+ get isNotFound() {
282
+ return this.statusCode === 404;
283
+ }
284
+ get isUnauthorized() {
285
+ return this.statusCode === 401;
286
+ }
287
+ get isServerError() {
288
+ return this.statusCode !== void 0 && this.statusCode >= 500;
289
+ }
290
+ }, _e = {
291
+ title: ["content"],
292
+ paragraph: ["content"],
293
+ html: ["content"],
294
+ image: ["alt"],
295
+ video: ["alt"],
296
+ button: ["text"],
297
+ menu: ["items.*.text"],
298
+ table: ["rows.*.cells.*.content"],
299
+ countdown: [
300
+ "labelDays",
301
+ "labelHours",
302
+ "labelMinutes",
303
+ "labelSeconds",
304
+ "expiredMessage"
305
+ ],
306
+ custom: ["fieldValues.*"]
307
+ }, h = ["preheaderText"];
308
+ function ve(e) {
309
+ return typeof e == "string" && /^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/.test(e);
310
+ }
311
+ function g(e) {
312
+ return typeof e == "object" && !!e && !Array.isArray(e);
313
+ }
314
+ var ye = /* @__PURE__ */ new Set([
315
+ "__proto__",
316
+ "constructor",
317
+ "prototype"
318
+ ]);
319
+ function _(e) {
320
+ return e.split(".").every((e) => e !== "" && !ye.has(e));
321
+ }
322
+ function be(e, t) {
323
+ if (!ye.has(t)) return Array.isArray(e) ? e.find((e) => g(e) && e.id === t) : g(e) && Object.hasOwn(e, t) ? e[t] : void 0;
324
+ }
325
+ function v(e, t) {
326
+ return t.split(".").reduce(be, e);
327
+ }
328
+ function xe(e) {
329
+ let t = p(e);
330
+ for (let [n, r] of Object.entries(t.l10n ?? {})) {
331
+ for (let t of ["text", "set"]) {
332
+ for (let n of Object.keys(r[t] ?? {})) {
333
+ let i = n.includes(".") ? v(e, n.slice(0, n.lastIndexOf("."))) : e;
334
+ _(n) && (t !== "text" && g(i) || v(e, n) !== void 0) || delete r[t][n];
335
+ }
336
+ r[t] && !Object.keys(r[t]).length && delete r[t];
337
+ }
338
+ Object.keys(r).length || delete t.l10n[n];
339
+ }
340
+ return t.l10n && !Object.keys(t.l10n).length && delete t.l10n, m(t, e) ? e : t;
341
+ }
342
+ function y(e) {
343
+ let t = xe(e);
344
+ if (t.type === "wrapper") {
345
+ let e = t.children.map(y);
346
+ return e.some((e, n) => e !== t.children[n]) ? {
347
+ ...t,
348
+ children: e
349
+ } : t;
350
+ }
351
+ if (t.type !== "section") return t;
352
+ let n = t.children.map((e) => e.map(y));
353
+ return n.some((e, n) => e.some((e, r) => e !== t.children[n][r])) ? {
354
+ ...t,
355
+ children: n
356
+ } : t;
357
+ }
358
+ function Se(e, t, n) {
359
+ if (e.type === "custom") return !1;
360
+ if (e.type === "section") return t === "columns";
361
+ let r = e.type === "menu" ? "items" : e.type === "social" ? "icons" : e.type === "table" ? "rows" : null;
362
+ if (!r) return !1;
363
+ let i = t.split(".");
364
+ if (i[0] !== r) return !1;
365
+ if (i.length === 1) return !0;
366
+ let a = e.type === "table" && i[2] === "cells" ? i.slice(0, 4).join(".") : i.slice(0, 2).join(".");
367
+ if (e.type === "table" && i[2] === "cells" && i.length === 3) return !0;
368
+ let o = a.split(".").length;
369
+ if (i[o] === "id") return !0;
370
+ if (i.length !== o) return !1;
371
+ let s = v(e, a);
372
+ if (!g(s) || !g(n) || s.id !== n.id) return !0;
373
+ if (e.type === "table" && o === 2) {
374
+ let e = (e) => Array.isArray(e) ? e.map((e) => g(e) ? e.id : void 0) : null;
375
+ return !m(e(s.cells), e(n.cells));
376
+ }
377
+ return !1;
378
+ }
379
+ function Ce(e) {
380
+ return xe(e);
381
+ }
382
+ function b(e, t, n) {
383
+ if (!_(t)) return !1;
384
+ let r = t.split("."), i = r.pop(), a = r.reduce(be, e);
385
+ if (Array.isArray(a)) {
386
+ let e = a.findIndex((e) => g(e) && e.id === i);
387
+ return e < 0 ? !1 : (a[e] = p(n), !0);
388
+ }
389
+ return g(a) ? (n === null ? delete a[i] : a[i] = p(n), !0) : !1;
390
+ }
391
+ function we(e, t) {
392
+ let [n, ...r] = t.split(".");
393
+ if (n === void 0) return [""];
394
+ let i = [];
395
+ if (n === "*") {
396
+ let t = Array.isArray(e) ? e : [];
397
+ for (let e of t) if (g(e) && typeof e.id == "string") for (let t of r.length ? we(e, r.join(".")) : [""]) i.push(t ? `${e.id}.${t}` : e.id);
398
+ return i;
399
+ }
400
+ let a = g(e) ? e[n] : void 0;
401
+ if (r.length === 0) return a === void 0 ? [] : [n];
402
+ for (let e of we(a, r.join("."))) i.push(`${n}.${e}`);
403
+ return i;
404
+ }
405
+ function x(e, t = []) {
406
+ if (e.type === "custom") {
407
+ 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;
408
+ return g(i) ? Object.keys(i).filter((e) => r.has(e)).map((e) => `fieldValues.${e}`) : [];
409
+ }
410
+ let n = (e) => !e.id.includes("."), r = e.type === "menu" ? {
411
+ ...e,
412
+ items: e.items.filter(n)
413
+ } : e.type === "table" ? {
414
+ ...e,
415
+ rows: e.rows.filter(n).map((e) => ({
416
+ ...e,
417
+ cells: e.cells.filter(n)
418
+ }))
419
+ } : e;
420
+ return (_e[e.type] ?? []).flatMap((e) => we(r, e));
421
+ }
422
+ function Te(e, t) {
423
+ return (_e[e] ?? []).some((e) => {
424
+ let n = e.split("."), r = t.split(".");
425
+ return n.length === r.length && n.every((e, t) => e === "*" || e === r[t]);
426
+ });
427
+ }
428
+ function S(e) {
429
+ let t = 2166136261;
430
+ for (let n of new TextEncoder().encode(e)) t ^= n, t = Math.imul(t, 16777619) >>> 0;
431
+ return t.toString(16).padStart(8, "0");
432
+ }
433
+ function Ee(e) {
434
+ let { l10n: t, ...n } = e;
435
+ return n;
436
+ }
437
+ function C(e = {}) {
438
+ return Object.entries(e).sort(([e], [t]) => e.split(".").length - t.split(".").length);
439
+ }
440
+ function De(e, t, n) {
441
+ let r = e, i = p(Ee(r));
442
+ if (t === n) return i;
443
+ let a = r.l10n?.[t];
444
+ if (!a) return i;
445
+ for (let [e, t] of C(a.set)) b(i, e, t);
446
+ for (let [t, n] of Object.entries(a.text ?? {})) v(e, t) !== void 0 && b(i, t, n.value);
447
+ return e.type === "custom" && (Object.keys(a.text ?? {}).length > 0 || Object.keys(a.set ?? {}).length > 0) && delete i.renderedHtml, i;
448
+ }
449
+ function Oe(e, t) {
450
+ return e.l10n?.[t]?.hidden === !0;
451
+ }
452
+ function ke(e) {
453
+ let { locales: t, l10n: n, ...r } = e;
454
+ return r;
455
+ }
456
+ function w(e) {
457
+ return e.settings?.locale ?? "en";
458
+ }
459
+ function Ae(e, t, n) {
460
+ let r = w(e);
461
+ if (t !== r && !(e.settings?.locales ?? []).includes(t)) {
462
+ if (n?.missing === "default") t = r;
463
+ else throw new ge(`This template has no "${t}" version.`, void 0, "unknown_locale");
464
+ }
465
+ let i = (e) => e.flatMap((e) => {
466
+ if (t !== r && Oe(e, t)) return [];
467
+ let n = De(e, t, r);
468
+ return n.type === "section" && Array.isArray(n.children) ? n.children = n.children.map((e) => i(e)) : n.type === "wrapper" && Array.isArray(n.children) && (n.children = i(n.children)), [n];
469
+ }), a = p(ke(e.settings)), o = e.settings?.l10n?.[t];
470
+ if (t !== r && o) {
471
+ for (let [e, t] of C(o.set)) b(a, e, t);
472
+ for (let [t, n] of Object.entries(o.text ?? {})) v(e.settings, t) !== void 0 && b(a, t, n.value);
473
+ }
474
+ return a.locale = t, {
475
+ blocks: i(e.blocks),
476
+ settings: a
477
+ };
478
+ }
479
+ function je(e, t, n = []) {
480
+ let r = {
481
+ translated: [],
482
+ missing: [],
483
+ stale: []
484
+ }, i = (e, t, n, i) => {
485
+ for (let a of n) {
486
+ let n = v(t, a);
487
+ if (typeof n != "string") continue;
488
+ let o = i?.[a];
489
+ (o || n !== "") && (o ? o.sourceHash === S(n) ? r.translated.push(`${e}/${a}`) : r.stale.push(`${e}/${a}`) : r.missing.push(`${e}/${a}`));
490
+ }
491
+ }, a = (e) => {
492
+ for (let r of e) {
493
+ if (Oe(r, t)) continue;
494
+ let e = r.l10n?.[t];
495
+ i(r.id, r, x(r, n), e?.text);
496
+ let o = r.children;
497
+ if (r.type === "section" && Array.isArray(o)) for (let e of o) a(e);
498
+ else r.type === "wrapper" && Array.isArray(o) && a(o);
499
+ }
500
+ };
501
+ return a(e.blocks), i("settings", e.settings, [...h], e.settings?.l10n?.[t]?.text), r;
502
+ }
503
+ function Me(e, t) {
504
+ if (t === w(e) || !e.settings.locales?.includes(t)) return [];
505
+ let n = [], r = (e) => {
506
+ for (let i of e) Oe(i, t) && n.push(i.id), i.type === "section" ? i.children.forEach(r) : i.type === "wrapper" && r(i.children);
507
+ };
508
+ return r(e.blocks), n;
509
+ }
510
+ function Ne(e, t, n = []) {
511
+ if (t === w(e) || !e.settings.locales?.includes(t)) return [];
512
+ let r = [], i = (e, n, i) => {
513
+ r.push(...Pe(n, t, i).map((t) => `${e}/${t}`));
514
+ }, a = (e) => {
515
+ 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);
516
+ };
517
+ return a(e.blocks), i("settings", e.settings, h), r;
518
+ }
519
+ function Pe(e, t, n) {
520
+ let r = e.l10n?.[t];
521
+ return n.filter((t) => {
522
+ let n = v(e, t);
523
+ return typeof n != "string" || n === "" || r?.text?.[t] ? !1 : !Object.keys(r?.set ?? {}).some((n) => (t === n || t.startsWith(`${n}.`)) && (!n.includes(".") || v(e, n.slice(0, n.lastIndexOf("."))) !== void 0));
524
+ });
525
+ }
526
+ function Fe(e, t, n = {}) {
527
+ let r = w(e), i = (e, n, i) => {
528
+ let a = Pe(e, t, i), o = p(e.l10n ?? {}), s = o[t] ?? {}, c = p(e);
529
+ delete c.l10n;
530
+ for (let [e, t] of C(s.set)) b(c, e, t);
531
+ for (let [t, n] of Object.entries(s.text ?? {})) v(e, t) !== void 0 && b(c, t, n.value);
532
+ delete o[t];
533
+ let l = {}, u = /* @__PURE__ */ new Set([
534
+ ...Object.keys(s.set ?? {}),
535
+ ...Object.keys(s.text ?? {}),
536
+ ...a
537
+ ]);
538
+ for (let t of u) {
539
+ let r = v(e, t), i = v(c, t);
540
+ m(r, i) ? (s.text?.[t] || a.includes(t)) && n(t) && typeof r == "string" && r !== "" && ((l.text ??= {})[t] = {
541
+ value: r,
542
+ sourceHash: S(r)
543
+ }) : n(t) && typeof r == "string" && typeof i == "string" ? (l.text ??= {})[t] = {
544
+ value: r,
545
+ sourceHash: S(i)
546
+ } : (l.set ??= {})[t] = r === void 0 ? null : p(r);
547
+ }
548
+ let d = (e, t) => {
549
+ let n = /* @__PURE__ */ new Set();
550
+ for (let t of Object.keys(e.set ?? {})) {
551
+ let e = t.split(".");
552
+ for (; e.length > 1;) {
553
+ let t = v(c, e.slice(0, -1).join("."));
554
+ if (g(t) || Array.isArray(t) && v(c, e.join(".")) !== void 0) break;
555
+ e.pop();
556
+ }
557
+ let r = e.join(".");
558
+ r !== t && n.add(r);
559
+ }
560
+ for (let r of n) {
561
+ for (let t of ["text", "set"]) for (let n of Object.keys(e[t] ?? {})) (n === r || n.startsWith(`${r}.`)) && delete e[t][n];
562
+ let n = v(t, r);
563
+ (e.set ??= {})[r] = n === void 0 ? null : p(n);
564
+ }
565
+ e.text && !Object.keys(e.text).length && delete e.text;
566
+ };
567
+ for (let t of Object.values(o)) {
568
+ let n = p(e);
569
+ for (let [e, r] of C(t.set)) b(n, e, r);
570
+ for (let [r, i] of Object.entries(t.text ?? {})) v(e, r) !== void 0 && b(n, r, i.value);
571
+ for (let [n, r] of Object.entries(t.text ?? {})) {
572
+ let i = v(c, n);
573
+ if (typeof i != "string") (t.set ??= {})[n] = r.value, delete t.text[n];
574
+ else {
575
+ let t = v(e, n);
576
+ typeof t == "string" && r.sourceHash === S(t) && (r.sourceHash = S(i));
577
+ }
578
+ }
579
+ d(t, n);
580
+ }
581
+ return Object.keys(l).length && (d(l, e), o[r] = l), Object.keys(o).length && (c.l10n = o), c;
582
+ }, a = (e) => e.map((e) => {
583
+ 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) : Te(e.type, n), t);
584
+ return e.type === "custom" && r.type === "custom" && !m(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;
585
+ }), o = i(e.settings, (e) => h.includes(e), h);
586
+ return o.locale = t, o.locales = e.settings.locales.map((e) => e === t ? r : e), {
587
+ blocks: a(e.blocks),
588
+ settings: o
589
+ };
590
+ }
591
+ // ../types/src/operations.ts
592
+ function Ie(e, t, n = []) {
593
+ let r = Object.fromEntries(I(e.blocks).flatMap((e) => {
594
+ if (e.type !== "custom") return [];
595
+ let t = x(e, n).filter((t) => typeof v(e, t) == "string");
596
+ return t.length && He.has(e.id) && D("invalid_operation", 0, Ue), t.length ? [[e.id, t]] : [];
597
+ }));
598
+ return {
599
+ op: "setDefaultLocale",
600
+ locale: t,
601
+ ...Object.keys(r).length ? { customTextFields: r } : {}
602
+ };
603
+ }
604
+ var T = class extends Error {
605
+ code;
606
+ opIndex;
607
+ blockId;
608
+ constructor(e, t, n, r) {
609
+ super(n), this.name = "OperationError", this.code = e, this.opIndex = t, r !== void 0 && (this.blockId = r);
610
+ }
611
+ };
612
+ function Le(e) {
613
+ return e === "1" ? 1 : e === "3" ? 3 : 2;
614
+ }
615
+ function Re(e, t, n = {}) {
616
+ let r = p(e);
617
+ return E(r, t, n), r;
618
+ }
619
+ function E(e, t, n = {}) {
620
+ let r = {
621
+ locks: n.locks ?? [],
622
+ session: n.session ?? null
623
+ };
624
+ t.forEach((t, n) => at(e, t, n, r));
625
+ }
626
+ var ze = /* @__PURE__ */ new Set([
627
+ "id",
628
+ "type",
629
+ "children",
630
+ "l10n"
631
+ ]), Be = /* @__PURE__ */ new Set(["locales", "l10n"]), Ve = /* @__PURE__ */ new Set([
632
+ "locale",
633
+ "locales",
634
+ "l10n"
635
+ ]), He = /* @__PURE__ */ new Set([
636
+ "__proto__",
637
+ "constructor",
638
+ "prototype"
639
+ ]), Ue = "customTextFields must map existing custom block ids to lists of string fieldValues paths.";
640
+ function D(e, t, n, r) {
641
+ throw new T(e, t, n, r);
642
+ }
643
+ function O(e) {
644
+ return typeof e == "object" && !!e && !Array.isArray(e);
645
+ }
646
+ function k(e) {
647
+ return e.type === "section";
648
+ }
649
+ function A(e) {
650
+ return Array.isArray(e.blocks) ? e.blocks : [];
651
+ }
652
+ function We(e) {
653
+ let t = e.children;
654
+ return Array.isArray(t) ? t.map((e) => Array.isArray(e) ? e : []) : [];
655
+ }
656
+ function j(e, t) {
657
+ let n = A(e);
658
+ for (let e = 0; e < n.length; e++) {
659
+ let r = n[e];
660
+ if (!O(r)) continue;
661
+ if (r.id === t) return {
662
+ block: r,
663
+ list: n,
664
+ index: e,
665
+ parent: null
666
+ };
667
+ if (!k(r) || typeof r.id != "string") continue;
668
+ let i = r.children;
669
+ if (Array.isArray(i)) for (let e = 0; e < i.length; e++) {
670
+ let n = i[e];
671
+ if (Array.isArray(n)) for (let i = 0; i < n.length; i++) {
672
+ let a = n[i];
673
+ if (O(a) && a.id === t) return {
674
+ block: a,
675
+ list: n,
676
+ index: i,
677
+ parent: {
678
+ sectionId: r.id,
679
+ column: e
680
+ }
681
+ };
682
+ }
683
+ }
684
+ }
685
+ return null;
686
+ }
687
+ function M(e) {
688
+ let t = typeof e.id == "string" ? [e.id] : [];
689
+ if (k(e)) for (let n of We(e)) t.push(...Ge(n));
690
+ return t;
691
+ }
692
+ function Ge(e) {
693
+ return e.flatMap((e) => O(e) ? M(e) : []);
694
+ }
695
+ function N(e, t) {
696
+ return typeof e.blockId != "string" || e.blockId === "" ? D("invalid_operation", t, "blockId must be a block id.") : e.blockId;
697
+ }
698
+ function Ke(e, t) {
699
+ let n = e.parent;
700
+ return n === null ? null : O(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
701
+ sectionId: n.sectionId,
702
+ column: n.column
703
+ } : D("invalid_operation", t, "parent must be null or { \"sectionId\", \"column\" }.");
704
+ }
705
+ function qe(e, t) {
706
+ let n = e.after;
707
+ return n === null ? null : typeof n == "string" && n !== "" ? n : D("invalid_operation", t, "after must be null or a block id.");
708
+ }
709
+ function P(e, t) {
710
+ let n = e.expect;
711
+ return n == null ? null : O(n) ? n : D("invalid_operation", t, "expect must be an object.");
712
+ }
713
+ function Je(e, t, n) {
714
+ let r = e.set ?? null, i = e.unset ?? [];
715
+ (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.");
716
+ let a = r === null ? {} : r, o = Object.keys(a).filter((e) => a[e] !== void 0);
717
+ o.length === 0 && i.length === 0 && D("invalid_operation", t, "Set or unset at least one key.");
718
+ for (let e of [...o, ...i]) n.has(e) && D("invalid_operation", t, `"${e}" can't be set or unset.`);
719
+ let s = i.find((e) => o.includes(e));
720
+ return s !== void 0 && D("invalid_operation", t, `"${s}" is both set and unset.`), {
721
+ set: Object.fromEntries(o.map((e) => [e, a[e]])),
722
+ unset: i
723
+ };
724
+ }
725
+ function Ye(e, t, n) {
726
+ 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."), !k(e)) return;
727
+ n && D("invalid_operation", t, "Sections can only be placed at the top level.");
728
+ let r = e.children;
729
+ 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.");
730
+ for (let e of r) for (let n of e) Ye(n, t, !0);
731
+ }
732
+ function F(e, t) {
733
+ return e.session === null || t.sessionId !== e.session;
734
+ }
735
+ function Xe(e, t, n) {
736
+ let r = e.locks.find((n) => t.includes(n.blockId) && F(e, n));
737
+ r && D("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
738
+ }
739
+ function Ze(e, t, n, r) {
740
+ 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);
741
+ }
742
+ function Qe(e, t, n, r) {
743
+ for (let [i, a] of Object.entries(t)) a !== void 0 && (m(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));
744
+ }
745
+ function $e(e, t, n) {
746
+ if (t === null) return Array.isArray(e.blocks) || (e.blocks = []), e.blocks;
747
+ let r = j(e, t.sectionId);
748
+ if (!r) return D("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
749
+ if (!k(r.block)) return D("invalid_operation", n, `Block "${t.sectionId}" isn't a section.`);
750
+ let i = r.block.children;
751
+ 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]);
752
+ }
753
+ function et(e, t, n) {
754
+ if (t === null) return 0;
755
+ let r = e.findIndex((e) => O(e) && e.id === t);
756
+ return r === -1 ? D("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
757
+ }
758
+ function tt(e, t, n, r) {
759
+ let i = Le(t), a = Array.isArray(e.children) ? e.children : [];
760
+ for (let e = i; e < a.length; e++) {
761
+ let t = a[e];
762
+ 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.`);
763
+ }
764
+ let o = a.slice(0, i);
765
+ for (; o.length < i;) o.push([]);
766
+ e.children = o;
767
+ }
768
+ function nt(e, t, n) {
769
+ for (let [n, r] of Object.entries(t)) n === "__proto__" ? Object.defineProperty(e, n, {
770
+ value: p(r),
771
+ writable: !0,
772
+ enumerable: !0,
773
+ configurable: !0
774
+ }) : e[n] = p(r);
775
+ for (let t of n) delete e[t];
776
+ }
777
+ function rt(e) {
778
+ return me(e).map((t) => {
779
+ let n = t.path.replace(/\.(items|icons|rows)\[.*$/, "").replace(/\[(\d+)\]/g, ".$1").split(".").reduce((e, t) => e[t], e);
780
+ return {
781
+ id: t.id,
782
+ blockId: typeof n.id == "string" ? n.id : void 0
783
+ };
784
+ });
785
+ }
786
+ function it(e, t, n) {
787
+ let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ? rt(n).map(r) : []), a = rt(e).find((e) => !i.has(r(e)));
788
+ a && D("invalid_operation", t, `Element id "${a.id}" must not contain "." or "/".`, a.blockId);
789
+ }
790
+ function at(e, t, n, r) {
791
+ let i = t;
792
+ switch (O(i) && typeof i.op == "string" || D("invalid_operation", n, "Each operation must be an object with an \"op\"."), i.op) {
793
+ case "addBlock": return ot(e, i, n);
794
+ case "moveBlock": return st(e, i, n, r);
795
+ case "deleteBlock": return ct(e, i, n, r);
796
+ case "updateBlock": return lt(e, i, n, r);
797
+ case "updateSettings": return ut(e, i, n);
798
+ case "setContent": return Tt(e, i, n, r);
799
+ case "setDefaultLocale": return Et(e, i, n, r);
800
+ case "addLocale": return pt(e, i, n);
801
+ case "removeLocale": return ht(e, i, n);
802
+ case "updateBlockLocale": return Ct(e, i, n, r);
803
+ case "updateSettingsLocale": return wt(e, i, n);
804
+ default: D("invalid_operation", n, `Unknown operation "${i.op}".`);
805
+ }
806
+ }
807
+ function ot(e, t, n) {
808
+ let r = Ke(t, n), i = qe(t, n), a = t.block;
809
+ Ye(a, n, r !== null), it({
810
+ blocks: [a],
811
+ settings: e.settings
812
+ }, n);
813
+ let o = new Set(Ge(A(e))), s = /* @__PURE__ */ new Set();
814
+ 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);
815
+ let c = $e(e, r, n), l = et(c, i, n);
816
+ St(e, a, r, n, !0), c.splice(l, 0, p(a));
817
+ }
818
+ function st(e, t, n, r) {
819
+ let i = N(t, n), a = Ke(t, n), o = qe(t, n), s = P(t, n), c = j(e, i);
820
+ if (!c) return D("block_missing", n, `No block with id "${i}".`, i);
821
+ if (Xe(r, M(c.block), n), s) {
822
+ let e = c.index > 0 ? c.list[c.index - 1] : null, t = O(e) ? e.id ?? null : null;
823
+ m(c.parent, s.parent ?? null) && m(t, s.after ?? null) || D("precondition_failed", n, `Block "${i}" has moved since.`, i);
824
+ }
825
+ k(c.block) && a !== null && D("invalid_operation", n, "Sections can only be placed at the top level."), o === i && D("invalid_operation", n, "A block can't be placed after itself.");
826
+ let l = $e(e, a, n);
827
+ et(l.filter((e) => e !== c.block), o, n), St(e, c.block, a, n, !1), c.list.splice(c.index, 1), l.splice(et(l, o, n), 0, c.block);
828
+ }
829
+ function ct(e, t, n, r) {
830
+ let i = N(t, n), a = P(t, n), o = j(e, i);
831
+ if (!o) return D("block_missing", n, `No block with id "${i}".`, i);
832
+ Xe(r, M(o.block), n), a && !m(o.block, a.block ?? null) && D("precondition_failed", n, `Block "${i}" has changed since.`, i), o.list.splice(o.index, 1);
833
+ }
834
+ function lt(e, t, n, r) {
835
+ let i = N(t, n), { set: a, unset: o } = Je(t, n, ze), s = P(t, n), c = j(e, i);
836
+ if (!c) return D("block_missing", n, `No block with id "${i}".`, i);
837
+ let l = c.block, u = k(l);
838
+ u && o.includes("columns") && D("invalid_operation", n, "A section's columns can't be unset; set another layout instead."), Xe(r, [i], n), s && Qe(l, s, n, i);
839
+ let d = { ...l };
840
+ nt(d, a, o), it({
841
+ blocks: [d],
842
+ settings: e.settings
843
+ }, n, {
844
+ blocks: [l],
845
+ settings: e.settings
846
+ }), u && Object.hasOwn(a, "columns") && tt(l, a.columns, n, i), nt(l, a, o);
847
+ let f = y(l);
848
+ m(l.l10n, f.l10n) || (f.l10n ? l.l10n = f.l10n : delete l.l10n), u && f.type === "section" && !m(l.children, f.children) && (l.children = f.children);
849
+ }
850
+ function ut(e, t, n) {
851
+ let { set: r, unset: i } = Je(t, n, Be), a = P(t, n);
852
+ 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 = {});
853
+ let o = e.settings;
854
+ a && Qe(o, a, n), nt(o, r, i);
855
+ let s = Ce(e.settings);
856
+ m(o.l10n, s.l10n) || (s.l10n ? o.l10n = s.l10n : delete o.l10n);
857
+ }
858
+ function dt(e, t) {
859
+ let n = e.locale;
860
+ return ve(n) && n !== "__proto__" && n !== "constructor" && n !== "prototype" || D("invalid_operation", t, "locale must be a language tag."), n;
861
+ }
862
+ function ft(e, t, n) {
863
+ let r = dt(t, n);
864
+ return e.settings.locales?.includes(r) || D("invalid_operation", n, `Locale "${r}" isn't in settings.locales.`), r;
865
+ }
866
+ function pt(e, t, n) {
867
+ let r = dt(t, n), i = e.settings.locales ?? [], a = r.toLowerCase(), o = t.position === void 0 ? i.length : t.position;
868
+ (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);
869
+ }
870
+ function I(e) {
871
+ return e.flatMap((e) => O(e) ? [e, ...k(e) ? We(e).flatMap(I) : e.type === "wrapper" && Array.isArray(e.children) ? I(e.children) : []] : []);
872
+ }
873
+ function mt(e, t) {
874
+ let n = e.l10n;
875
+ return O(n) && O(n[t]) ? n[t] : {};
876
+ }
877
+ function ht(e, t, n) {
878
+ let r = ft(e, t, n), i = P(t, n);
879
+ 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.");
880
+ 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]]] : []));
881
+ !i || m(s, i.blocks) && m(O(a.l10n) ? a.l10n[r] : void 0, i.settings) || D("precondition_failed", n, `Locale "${r}" has changed since.`);
882
+ for (let e of [...o, a]) O(e.l10n) && (delete e.l10n[r], Object.keys(e.l10n).length === 0 && delete e.l10n);
883
+ e.settings.locales.splice(e.settings.locales.indexOf(r), 1), e.settings.locales.length === 0 && delete e.settings.locales;
884
+ }
885
+ function gt(e, t, n) {
886
+ (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 !== "" && _(e))) && (e.hidden === void 0 || !n && typeof e.hidden == "boolean") && [
887
+ "text",
888
+ "set",
889
+ "unset",
890
+ ...n ? [] : ["hidden"]
891
+ ].some((t) => e[t] !== void 0) || D("invalid_operation", t, "A locale update needs text, set, unset or a block's boolean hidden.");
892
+ let r = P(e, t);
893
+ 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."), {
894
+ text: e.text ?? {},
895
+ set: e.set ?? {},
896
+ unset: e.unset ?? [],
897
+ hidden: e.hidden,
898
+ expect: r
899
+ };
900
+ }
901
+ function _t(e, t, n, r) {
902
+ for (let i of Object.keys(t.text)) _(i) && (r ? h.includes(i) : Te(String(e.type), i)) && v(e, i) !== void 0 || D("invalid_operation", n, `Text path "${i}" isn't translatable or doesn't resolve.`);
903
+ for (let i of Object.keys(t.set)) {
904
+ let a = i.split("."), o = r ? Ve : ze, s = a.length === 1 ? e : v(e, a.slice(0, -1).join("."));
905
+ (!_(i) || o.has(a[0]) || !r && Se(e, i, t.set[i]) || v(e, i) === void 0 && !O(s)) && D("invalid_operation", n, `Override path "${i}" is immutable or doesn't resolve.`);
906
+ }
907
+ }
908
+ function vt(e, t, n, r) {
909
+ if (t) {
910
+ for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {})) m(e[i]?.[a] ?? null, o) || D("precondition_failed", n, `Locale path "${a}" has changed since.`, r);
911
+ t.hidden !== void 0 && !m(e.hidden === !0, t.hidden) && D("precondition_failed", n, "The locale's hidden state has changed since.", r);
912
+ }
913
+ }
914
+ function yt(e, t, n) {
915
+ O(e.l10n) || (e.l10n = {});
916
+ let r = e.l10n;
917
+ O(r[t]) || (r[t] = {});
918
+ let i = r[t];
919
+ for (let e of n.unset) i.text && delete i.text[e], i.set && delete i.set[e];
920
+ for (let [e, t] of Object.entries(n.text)) i.text ||= {}, i.text[e] = p(t), i.set && delete i.set[e];
921
+ for (let [e, t] of Object.entries(n.set)) i.set ||= {}, i.set[e] = p(t), i.text && delete i.text[e];
922
+ n.hidden === !0 ? i.hidden = !0 : n.hidden === !1 && delete i.hidden, i.text && Object.keys(i.text).length === 0 && delete i.text, i.set && Object.keys(i.set).length === 0 && delete i.set, Object.keys(i).length === 0 && delete r[t], Object.keys(r).length === 0 && delete e.l10n;
923
+ }
924
+ function L(e) {
925
+ return O(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(L) : L(e)) : !1;
926
+ }
927
+ function bt(e) {
928
+ return O(e) && O(e.l10n) && Object.values(e.l10n).some((e) => O(e) && e.hidden === !0);
929
+ }
930
+ function xt(e) {
931
+ return !O(e) || !L(e) ? !1 : bt(e) ? !0 : Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(xt) : xt(e));
932
+ }
933
+ function St(e, t, n, r, i) {
934
+ if (!L(t)) return;
935
+ let a = n === null ? null : j(e, n.sectionId);
936
+ (a !== null && bt(a.block) || i && xt(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);
937
+ }
938
+ function Ct(e, t, n, r) {
939
+ let i = ft(e, t, n), a = N(t, n), o = gt(t, n, !1), s = I(A(e)).find((e) => e.id === a);
940
+ s || D("block_missing", n, `No block with id "${a}".`, a), _t(s, o, n, !1), Ze(r, a, i, n), vt(mt(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), yt(s, i, o);
941
+ }
942
+ function wt(e, t, n) {
943
+ let r = ft(e, t, n), i = gt(t, n, !0), a = e.settings;
944
+ _t(a, i, n, !0), vt(mt(a, r), i.expect, n), yt(a, r, i);
945
+ }
946
+ function Tt(e, t, n, r) {
947
+ let i = t.content;
948
+ 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.");
949
+ it(i, n, e);
950
+ let a = r.locks.find((e) => F(r, e));
951
+ a && D("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = p(i.blocks), e.settings = p(i.settings);
952
+ }
953
+ function Et(e, t, n, r) {
954
+ let i = dt(t, n);
955
+ e.settings.locales?.includes(i) || D("invalid_operation", n, `"${i}" is not a language version of this template.`);
956
+ let a = Me(e, i);
957
+ 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]);
958
+ let o = r.locks.find((e) => F(r, e));
959
+ o && D("locked_by_others", n, "Other sessions hold locks on this template.", o.blockId);
960
+ let s = t.customTextFields;
961
+ if (s !== void 0) {
962
+ let t = I(e.blocks);
963
+ (!O(s) || Object.getOwnPropertyNames(s).some((e) => {
964
+ if (He.has(e)) return !0;
965
+ let n = s[e], r = t.find((t) => t.id === e);
966
+ return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !_(e) || !Te("custom", e) || typeof v(r, e) != "string");
967
+ })) && D("invalid_operation", n, Ue);
968
+ }
969
+ let c = Fe(e, i, t.customTextFields);
970
+ e.blocks = c.blocks, e.settings = c.settings;
971
+ }
972
+ // ../types/src/invert-operations.ts
973
+ function Dt(e) {
974
+ let t = e.children;
975
+ return e.type === "section" && Array.isArray(t) ? t : [];
976
+ }
977
+ function Ot(e, t, n = null) {
978
+ for (let r = 0; r < e.length; r++) {
979
+ let i = e[r];
980
+ if (i.id === t) return {
981
+ block: i,
982
+ parent: n,
983
+ after: r > 0 ? e[r - 1].id : null
984
+ };
985
+ let a = Dt(i);
986
+ for (let e = 0; e < a.length; e++) {
987
+ if (!Array.isArray(a[e])) continue;
988
+ let n = Ot(a[e], t, {
989
+ sectionId: i.id,
990
+ column: e
991
+ });
992
+ if (n) return n;
993
+ }
994
+ }
995
+ return null;
996
+ }
997
+ function kt(e, t, n) {
998
+ let r = Ot(e.blocks, t);
999
+ if (!r) throw new T("block_missing", n, `No block with id "${t}".`, t);
1000
+ return r;
1001
+ }
1002
+ function At(e, t, n) {
1003
+ let r = {}, i = [], a = {}, o = [.../* @__PURE__ */ new Set([...Object.keys(t ?? {}), ...n ?? []])];
1004
+ for (let n of o) {
1005
+ let o = e[n];
1006
+ o === void 0 ? i.push(n) : r[n] = p(o);
1007
+ let s = t && n in t ? t[n] : void 0;
1008
+ a[n] = s === void 0 ? null : p(s);
1009
+ }
1010
+ return {
1011
+ set: r,
1012
+ unset: i,
1013
+ expect: a
1014
+ };
1015
+ }
1016
+ function R(e, t) {
1017
+ return e.l10n?.[t] ?? {};
1018
+ }
1019
+ function z(e, t, n, r) {
1020
+ let i = {}, a = {}, o = {};
1021
+ n.length && (o.text = {}, o.set = {});
1022
+ for (let r of n) e.text?.[r] !== void 0 && (i[r] = p(e.text[r])), e.set && Object.hasOwn(e.set, r) && (a[r] = p(e.set[r])), o.text[r] = p(t.text?.[r] ?? null), o.set[r] = p(t.set?.[r] ?? null);
1023
+ return r && (o.hidden = t.hidden === !0), {
1024
+ unset: n,
1025
+ ...Object.keys(i).length ? { text: i } : {},
1026
+ ...Object.keys(a).length ? { set: a } : {},
1027
+ ...r ? { hidden: e.hidden === !0 } : {},
1028
+ expect: o
1029
+ };
1030
+ }
1031
+ function jt(e) {
1032
+ let { unset: t, ...n } = z(e, {}, [.../* @__PURE__ */ new Set([...Object.keys(e.text ?? {}), ...Object.keys(e.set ?? {})])], e.hidden === !0);
1033
+ return n;
1034
+ }
1035
+ function B(e) {
1036
+ return e.flatMap((e) => [e, ...e.type === "wrapper" ? B(e.children) : Dt(e).flatMap(B)]);
1037
+ }
1038
+ function Mt(e, t) {
1039
+ let n = p(e);
1040
+ E(n, [t]);
1041
+ let r = [], i = (e, t, n) => {
1042
+ for (let [i, a] of Object.entries(e.l10n ?? {})) {
1043
+ 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))])];
1044
+ if (!o.length) continue;
1045
+ let s = z(a, e, o, !1);
1046
+ r.push(n === void 0 ? {
1047
+ op: "updateSettingsLocale",
1048
+ locale: i,
1049
+ ...s
1050
+ } : {
1051
+ op: "updateBlockLocale",
1052
+ blockId: n,
1053
+ locale: i,
1054
+ ...s
1055
+ });
1056
+ }
1057
+ };
1058
+ if (t.op === "updateSettings") i(e.settings, n.settings);
1059
+ else {
1060
+ let t = new Map(B(n.blocks).map((e) => [e.id, e]));
1061
+ for (let n of B(e.blocks)) {
1062
+ let e = t.get(n.id);
1063
+ e && i(n, e, n.id);
1064
+ }
1065
+ }
1066
+ return r;
1067
+ }
1068
+ function Nt(e, t, n) {
1069
+ switch (t.op) {
1070
+ case "addBlock": return {
1071
+ op: "deleteBlock",
1072
+ blockId: t.block.id,
1073
+ expect: { block: p(t.block) }
1074
+ };
1075
+ case "deleteBlock": {
1076
+ let r = kt(e, t.blockId, n);
1077
+ return {
1078
+ op: "addBlock",
1079
+ block: p(r.block),
1080
+ parent: r.parent,
1081
+ after: r.after
1082
+ };
1083
+ }
1084
+ case "moveBlock": {
1085
+ let r = kt(e, t.blockId, n);
1086
+ return {
1087
+ op: "moveBlock",
1088
+ blockId: t.blockId,
1089
+ parent: r.parent,
1090
+ after: r.after,
1091
+ expect: {
1092
+ parent: t.parent,
1093
+ after: t.after
1094
+ }
1095
+ };
1096
+ }
1097
+ case "updateBlock": {
1098
+ let r = kt(e, t.blockId, n).block, { set: i, unset: a, expect: o } = At(r, t.set, t.unset);
1099
+ return [{
1100
+ op: "updateBlock",
1101
+ blockId: t.blockId,
1102
+ ...Object.keys(i).length > 0 ? { set: i } : {},
1103
+ ...a.length > 0 ? { unset: a } : {},
1104
+ expect: o
1105
+ }, ...Mt(e, t)];
1106
+ }
1107
+ case "updateSettings": {
1108
+ let { set: n, unset: r, expect: i } = At(e.settings, t.set, t.unset);
1109
+ return [{
1110
+ op: "updateSettings",
1111
+ ...Object.keys(n).length > 0 ? { set: n } : {},
1112
+ ...r.length > 0 ? { unset: r } : {},
1113
+ expect: i
1114
+ }, ...Mt(e, t)];
1115
+ }
1116
+ case "addLocale": return {
1117
+ op: "removeLocale",
1118
+ locale: t.locale,
1119
+ expect: { blocks: {} }
1120
+ };
1121
+ case "removeLocale": {
1122
+ let n = [{
1123
+ op: "addLocale",
1124
+ locale: t.locale,
1125
+ position: e.settings.locales?.indexOf(t.locale)
1126
+ }];
1127
+ for (let r of B(e.blocks)) {
1128
+ let e = r.l10n?.[t.locale];
1129
+ e && n.push({
1130
+ op: "updateBlockLocale",
1131
+ blockId: r.id,
1132
+ locale: t.locale,
1133
+ ...jt(e)
1134
+ });
1135
+ }
1136
+ let r = e.settings.l10n?.[t.locale];
1137
+ if (r) {
1138
+ let { hidden: e, ...i } = jt(r);
1139
+ n.push({
1140
+ op: "updateSettingsLocale",
1141
+ locale: t.locale,
1142
+ ...i
1143
+ });
1144
+ }
1145
+ return n;
1146
+ }
1147
+ case "updateBlockLocale":
1148
+ case "updateSettingsLocale": {
1149
+ let n = p(e);
1150
+ E(n, [t]);
1151
+ let r = [.../* @__PURE__ */ new Set([
1152
+ ...Object.keys(t.text ?? {}),
1153
+ ...Object.keys(t.set ?? {}),
1154
+ ...t.unset ?? []
1155
+ ])];
1156
+ if (t.op === "updateBlockLocale") {
1157
+ let i = B(e.blocks).find((e) => e.id === t.blockId), a = B(n.blocks).find((e) => e.id === t.blockId);
1158
+ return {
1159
+ op: "updateBlockLocale",
1160
+ blockId: t.blockId,
1161
+ locale: t.locale,
1162
+ ...z(R(i, t.locale), R(a, t.locale), r, t.hidden !== void 0)
1163
+ };
1164
+ }
1165
+ let { hidden: i, ...a } = z(R(e.settings, t.locale), R(n.settings, t.locale), r, !1);
1166
+ return {
1167
+ op: "updateSettingsLocale",
1168
+ locale: t.locale,
1169
+ ...a
1170
+ };
1171
+ }
1172
+ case "setDefaultLocale":
1173
+ case "setContent": return {
1174
+ op: "setContent",
1175
+ content: {
1176
+ blocks: p(e.blocks),
1177
+ settings: p(e.settings)
1178
+ }
1179
+ };
1180
+ }
1181
+ }
1182
+ function Pt(e, t) {
1183
+ let n = p(e), r = [];
1184
+ return t.forEach((e, t) => {
1185
+ try {
1186
+ let i = Nt(n, e, t);
1187
+ r.push(...Array.isArray(i) ? [...i].reverse() : [i]), E(n, [e]);
1188
+ } catch (e) {
1189
+ throw e instanceof T ? new T(e.code, t, e.message, e.blockId) : e;
1190
+ }
1191
+ }), r.reverse();
1192
+ }
1193
+ // ../types/src/collaboration.ts
1194
+ function Ft(e) {
1195
+ return e === "invalid_operation" ? 422 : e === "content_too_large" ? 413 : 409;
1196
+ }
1197
+ var It = class extends ge {
1198
+ opIndex;
1199
+ holder;
1200
+ holders;
1201
+ constructor(e, t) {
1202
+ super(e, t.status ?? Ft(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);
1203
+ }
1204
+ };
1205
+ // ../types/src/guards.ts
1206
+ function Lt(e) {
1207
+ return e.type === "section";
1208
+ }
1209
+ function Rt(e) {
1210
+ return e.type === "title";
1211
+ }
1212
+ function zt(e) {
1213
+ return e.type === "paragraph";
1214
+ }
1215
+ function Bt(e) {
1216
+ return e.type === "image";
1217
+ }
1218
+ function Vt(e) {
1219
+ return e.type === "button";
1220
+ }
1221
+ function Ht(e) {
1222
+ return e.type === "divider";
1223
+ }
1224
+ function Ut(e) {
1225
+ return e.type === "video";
1226
+ }
1227
+ function Wt(e) {
1228
+ return e.type === "social";
1229
+ }
1230
+ function Gt(e) {
1231
+ return e.type === "spacer";
1232
+ }
1233
+ function Kt(e) {
1234
+ return e.type === "html";
1235
+ }
1236
+ function qt(e) {
1237
+ return e.type === "menu";
1238
+ }
1239
+ function Jt(e) {
1240
+ return e.type === "table";
1241
+ }
1242
+ function Yt(e) {
1243
+ return e.type === "countdown";
1244
+ }
1245
+ function Xt(e) {
1246
+ return e.type === "custom";
1247
+ }
1248
+ function V(e) {
1249
+ return e.type === "slot";
1250
+ }
1251
+ function H(e) {
1252
+ return e.type === "wrapper";
1253
+ }
1254
+ // ../types/src/defaults.ts
1255
+ var Zt = {
1256
+ content: "<p>Enter your title</p>",
1257
+ level: 2,
1258
+ textAlign: "left"
1259
+ }, Qt = { content: "<p>Enter your text here</p>" }, $t = {
1260
+ src: "",
1261
+ alt: "",
1262
+ width: "full",
1263
+ align: "center"
1264
+ }, en = {
1265
+ text: "Click Here",
1266
+ url: "",
1267
+ backgroundColor: "#333333",
1268
+ textColor: "#ffffff",
1269
+ borderRadius: 6,
1270
+ fontSize: 15,
1271
+ buttonPadding: {
1272
+ top: 12,
1273
+ right: 24,
1274
+ bottom: 12,
1275
+ left: 24
1276
+ },
1277
+ align: "center"
1278
+ }, tn = {
1279
+ lineStyle: "solid",
1280
+ color: "#e0e0e0",
1281
+ thickness: 1,
1282
+ width: "full"
1283
+ }, nn = { columns: "1" }, rn = {
1284
+ url: "",
1285
+ thumbnailUrl: "",
1286
+ alt: "Video",
1287
+ width: "full",
1288
+ align: "center"
1289
+ }, an = {
1290
+ iconStyle: "solid",
1291
+ iconSize: "medium",
1292
+ spacing: 10,
1293
+ align: "center"
1294
+ }, on = { height: 24 }, sn = { content: "" }, cn = {
1295
+ fontSize: 15,
1296
+ textAlign: "center",
1297
+ separator: "|",
1298
+ separatorColor: "#e0e0e0",
1299
+ spacing: 10
1300
+ }, ln = {
1301
+ hasHeaderRow: !0,
1302
+ borderColor: "#e0e0e0",
1303
+ borderWidth: 1,
1304
+ cellPadding: 8,
1305
+ fontSize: 15,
1306
+ textAlign: "left"
1307
+ }, un = {
1308
+ targetDate: "",
1309
+ timezone: "UTC",
1310
+ showDays: !0,
1311
+ showHours: !0,
1312
+ showMinutes: !0,
1313
+ showSeconds: !0,
1314
+ separator: ":",
1315
+ digitFontSize: 32,
1316
+ digitColor: "#1a1a1a",
1317
+ labelColor: "#6b7280",
1318
+ labelFontSize: 12,
1319
+ backgroundColor: "#ffffff",
1320
+ labelDays: "Days",
1321
+ labelHours: "Hours",
1322
+ labelMinutes: "Minutes",
1323
+ labelSeconds: "Seconds",
1324
+ expiredMessage: "This offer has expired",
1325
+ expiredImageUrl: "",
1326
+ hideOnExpiry: !1
1327
+ }, dn = {
1328
+ title: Zt,
1329
+ paragraph: Qt,
1330
+ image: $t,
1331
+ button: en,
1332
+ divider: tn,
1333
+ section: nn,
1334
+ video: rn,
1335
+ social: an,
1336
+ spacer: on,
1337
+ html: sn,
1338
+ menu: cn,
1339
+ table: ln,
1340
+ countdown: un
1341
+ }, fn = {
1342
+ width: 600,
1343
+ backgroundColor: "#ffffff",
1344
+ textColor: "#1a1a1a",
1345
+ linkUnderline: !0,
1346
+ fontFamily: "Arial",
1347
+ locale: "en"
1348
+ };
1349
+ function pn(e) {
1350
+ return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
1351
+ }
1352
+ function mn(e, t) {
1353
+ let n = { ...e };
1354
+ for (let r of Object.keys(t)) {
1355
+ let i = e[r], a = t[r];
1356
+ a !== void 0 && (n[r] = pn(i) && pn(a) ? mn(i, a) : a);
1357
+ }
1358
+ return n;
1359
+ }
1360
+ // ../types/src/template.ts
1361
+ function hn(e = "Arial", t) {
1362
+ return {
1363
+ blocks: [],
1364
+ settings: {
1365
+ ...fn,
1366
+ fontFamily: e,
1367
+ ...t
1368
+ }
1369
+ };
1370
+ }
1371
+ // ../types/src/direction.ts
1372
+ var gn = [
1373
+ "ar",
1374
+ "he",
1375
+ "iw",
1376
+ "fa",
1377
+ "ur",
1378
+ "yi",
1379
+ "dv",
1380
+ "ps",
1381
+ "sd",
1382
+ "ug",
1383
+ "ckb",
1384
+ "ks"
1385
+ ];
1386
+ function _n(e) {
1387
+ let t = e?.trim().replace(/_/g, "-").split("-")[0]?.toLowerCase();
1388
+ return !!t && gn.includes(t);
1389
+ }
1390
+ function vn(e) {
1391
+ return e.direction === "ltr" || e.direction === "rtl" ? e.direction : _n(e.locale) ? "rtl" : "ltr";
1392
+ }
1393
+ // ../types/src/translation.ts
1394
+ var yn = 2e4, bn = /* @__PURE__ */ new Set(["\"", "'"]);
1395
+ function U(e, t) {
1396
+ let n = null;
1397
+ for (let r = t; r < e.length; r++) {
1398
+ let t = e[r];
1399
+ if (n !== null) t === n && (n = null);
1400
+ else if (bn.has(t)) n = t;
1401
+ else if (t === ">") return r;
1402
+ }
1403
+ return -1;
1404
+ }
1405
+ function xn(e) {
1406
+ return e !== " " && e !== " " && e !== "\n" && e !== "\r" && e !== "\f" && e !== "=" && e !== ">" && e !== "/";
1407
+ }
1408
+ function W(e) {
1409
+ return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
1410
+ }
1411
+ var Sn = {
1412
+ AMP: "&",
1413
+ COPY: "©",
1414
+ GT: ">",
1415
+ LT: "<",
1416
+ QUOT: "\"",
1417
+ REG: "®",
1418
+ AElig: "Æ",
1419
+ Aacute: "Á",
1420
+ Acirc: "Â",
1421
+ Agrave: "À",
1422
+ Alpha: "Α",
1423
+ Aring: "Å",
1424
+ Atilde: "Ã",
1425
+ Auml: "Ä",
1426
+ Beta: "Β",
1427
+ Ccedil: "Ç",
1428
+ Chi: "Χ",
1429
+ Dagger: "‡",
1430
+ Delta: "Δ",
1431
+ ETH: "Ð",
1432
+ Eacute: "É",
1433
+ Ecirc: "Ê",
1434
+ Egrave: "È",
1435
+ Epsilon: "Ε",
1436
+ Eta: "Η",
1437
+ Euml: "Ë",
1438
+ Gamma: "Γ",
1439
+ Iacute: "Í",
1440
+ Icirc: "Î",
1441
+ Igrave: "Ì",
1442
+ Iota: "Ι",
1443
+ Iuml: "Ï",
1444
+ Kappa: "Κ",
1445
+ Lambda: "Λ",
1446
+ Mu: "Μ",
1447
+ Ntilde: "Ñ",
1448
+ Nu: "Ν",
1449
+ OElig: "Œ",
1450
+ Oacute: "Ó",
1451
+ Ocirc: "Ô",
1452
+ Ograve: "Ò",
1453
+ Omega: "Ω",
1454
+ Omicron: "Ο",
1455
+ Oslash: "Ø",
1456
+ Otilde: "Õ",
1457
+ Ouml: "Ö",
1458
+ Phi: "Φ",
1459
+ Pi: "Π",
1460
+ Prime: "″",
1461
+ Psi: "Ψ",
1462
+ Rho: "Ρ",
1463
+ Scaron: "Š",
1464
+ Sigma: "Σ",
1465
+ THORN: "Þ",
1466
+ Tau: "Τ",
1467
+ Theta: "Θ",
1468
+ Uacute: "Ú",
1469
+ Ucirc: "Û",
1470
+ Ugrave: "Ù",
1471
+ Upsilon: "Υ",
1472
+ Uuml: "Ü",
1473
+ Xi: "Ξ",
1474
+ Yacute: "Ý",
1475
+ Yuml: "Ÿ",
1476
+ Zeta: "Ζ",
1477
+ aacute: "á",
1478
+ acirc: "â",
1479
+ acute: "´",
1480
+ aelig: "æ",
1481
+ agrave: "à",
1482
+ alefsym: "ℵ",
1483
+ alpha: "α",
1484
+ amp: "&",
1485
+ and: "∧",
1486
+ ang: "∠",
1487
+ apos: "'",
1488
+ aring: "å",
1489
+ asymp: "≈",
1490
+ atilde: "ã",
1491
+ auml: "ä",
1492
+ bdquo: "„",
1493
+ beta: "β",
1494
+ brvbar: "¦",
1495
+ bull: "•",
1496
+ cap: "∩",
1497
+ ccedil: "ç",
1498
+ cedil: "¸",
1499
+ cent: "¢",
1500
+ chi: "χ",
1501
+ circ: "ˆ",
1502
+ clubs: "♣",
1503
+ cong: "≅",
1504
+ copy: "©",
1505
+ crarr: "↵",
1506
+ cup: "∪",
1507
+ curren: "¤",
1508
+ dArr: "⇓",
1509
+ dagger: "†",
1510
+ darr: "↓",
1511
+ deg: "°",
1512
+ delta: "δ",
1513
+ diams: "♦",
1514
+ divide: "÷",
1515
+ eacute: "é",
1516
+ ecirc: "ê",
1517
+ egrave: "è",
1518
+ empty: "∅",
1519
+ emsp: " ",
1520
+ ensp: " ",
1521
+ epsilon: "ε",
1522
+ equiv: "≡",
1523
+ eta: "η",
1524
+ eth: "ð",
1525
+ euml: "ë",
1526
+ euro: "€",
1527
+ exist: "∃",
1528
+ fnof: "ƒ",
1529
+ forall: "∀",
1530
+ frac12: "½",
1531
+ frac14: "¼",
1532
+ frac34: "¾",
1533
+ frasl: "⁄",
1534
+ gamma: "γ",
1535
+ ge: "≥",
1536
+ gt: ">",
1537
+ hArr: "⇔",
1538
+ harr: "↔",
1539
+ hearts: "♥",
1540
+ hellip: "…",
1541
+ iacute: "í",
1542
+ icirc: "î",
1543
+ iexcl: "¡",
1544
+ igrave: "ì",
1545
+ image: "ℑ",
1546
+ infin: "∞",
1547
+ int: "∫",
1548
+ iota: "ι",
1549
+ iquest: "¿",
1550
+ isin: "∈",
1551
+ iuml: "ï",
1552
+ kappa: "κ",
1553
+ lArr: "⇐",
1554
+ lambda: "λ",
1555
+ lang: "〈",
1556
+ laquo: "«",
1557
+ larr: "←",
1558
+ lceil: "⌈",
1559
+ ldquo: "“",
1560
+ le: "≤",
1561
+ lfloor: "⌊",
1562
+ lowast: "∗",
1563
+ loz: "◊",
1564
+ lrm: "‎",
1565
+ lsaquo: "‹",
1566
+ lsquo: "‘",
1567
+ lt: "<",
1568
+ macr: "¯",
1569
+ mdash: "—",
1570
+ micro: "µ",
1571
+ middot: "·",
1572
+ minus: "−",
1573
+ mu: "μ",
1574
+ nabla: "∇",
1575
+ nbsp: "\xA0",
1576
+ ndash: "–",
1577
+ ne: "≠",
1578
+ ni: "∋",
1579
+ not: "¬",
1580
+ notin: "∉",
1581
+ nsub: "⊄",
1582
+ ntilde: "ñ",
1583
+ nu: "ν",
1584
+ oacute: "ó",
1585
+ ocirc: "ô",
1586
+ oelig: "œ",
1587
+ ograve: "ò",
1588
+ oline: "‾",
1589
+ omega: "ω",
1590
+ omicron: "ο",
1591
+ oplus: "⊕",
1592
+ or: "∨",
1593
+ ordf: "ª",
1594
+ ordm: "º",
1595
+ oslash: "ø",
1596
+ otilde: "õ",
1597
+ otimes: "⊗",
1598
+ ouml: "ö",
1599
+ para: "¶",
1600
+ part: "∂",
1601
+ permil: "‰",
1602
+ perp: "⊥",
1603
+ phi: "φ",
1604
+ pi: "π",
1605
+ piv: "ϖ",
1606
+ plusmn: "±",
1607
+ pound: "£",
1608
+ prime: "′",
1609
+ prod: "∏",
1610
+ prop: "∝",
1611
+ psi: "ψ",
1612
+ quot: "\"",
1613
+ rArr: "⇒",
1614
+ radic: "√",
1615
+ rang: "〉",
1616
+ raquo: "»",
1617
+ rarr: "→",
1618
+ rceil: "⌉",
1619
+ rdquo: "”",
1620
+ real: "ℜ",
1621
+ reg: "®",
1622
+ rfloor: "⌋",
1623
+ rho: "ρ",
1624
+ rlm: "‏",
1625
+ rsaquo: "›",
1626
+ rsquo: "’",
1627
+ sbquo: "‚",
1628
+ scaron: "š",
1629
+ sdot: "⋅",
1630
+ sect: "§",
1631
+ shy: "­",
1632
+ sigma: "σ",
1633
+ sigmaf: "ς",
1634
+ sim: "∼",
1635
+ spades: "♠",
1636
+ sub: "⊂",
1637
+ sube: "⊆",
1638
+ sum: "∑",
1639
+ sup: "⊃",
1640
+ sup1: "¹",
1641
+ sup2: "²",
1642
+ sup3: "³",
1643
+ supe: "⊇",
1644
+ szlig: "ß",
1645
+ tau: "τ",
1646
+ there4: "∴",
1647
+ theta: "θ",
1648
+ thetasym: "ϑ",
1649
+ thinsp: " ",
1650
+ thorn: "þ",
1651
+ tilde: "˜",
1652
+ times: "×",
1653
+ trade: "™",
1654
+ uArr: "⇑",
1655
+ uacute: "ú",
1656
+ uarr: "↑",
1657
+ ucirc: "û",
1658
+ ugrave: "ù",
1659
+ uml: "¨",
1660
+ upsih: "ϒ",
1661
+ upsilon: "υ",
1662
+ uuml: "ü",
1663
+ weierp: "℘",
1664
+ xi: "ξ",
1665
+ yacute: "ý",
1666
+ yen: "¥",
1667
+ yuml: "ÿ",
1668
+ zeta: "ζ",
1669
+ zwj: "‍",
1670
+ zwnj: "‌"
1671
+ };
1672
+ function G(e) {
1673
+ return e.includes("&") ? e.replace(/&(#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g, (e, t) => {
1674
+ if (t[0] === "#") {
1675
+ let n = t[1] === "x" || t[1] === "X" ? Number.parseInt(t.slice(2), 16) : Number.parseInt(t.slice(1), 10);
1676
+ return !Number.isFinite(n) || n < 1 || n > 1114111 || n >= 55296 && n <= 57343 ? e : String.fromCodePoint(n);
1677
+ }
1678
+ return Object.hasOwn(Sn, t) ? Sn[t] : e;
1679
+ }) : e;
1680
+ }
1681
+ function Cn(e, t) {
1682
+ let n = t.toLowerCase(), r = 0;
1683
+ for (; r < e.length;) {
1684
+ for (; r < e.length && (W(e[r]) || e[r] === "/");) r++;
1685
+ if (r >= e.length) break;
1686
+ let t = r;
1687
+ for (; r < e.length && xn(e[r]);) r++;
1688
+ let i = e.substring(t, r).toLowerCase();
1689
+ if (i === "") {
1690
+ r++;
1691
+ continue;
1692
+ }
1693
+ for (; r < e.length && W(e[r]);) r++;
1694
+ if (e[r] !== "=") continue;
1695
+ for (r++; r < e.length && W(e[r]);) r++;
1696
+ let a = e[r];
1697
+ if (bn.has(a)) {
1698
+ let t = r + 1, o = e.indexOf(a, t);
1699
+ if (o === -1) return null;
1700
+ if (i === n) return G(e.substring(t, o));
1701
+ r = o + 1;
1702
+ continue;
1703
+ }
1704
+ let o = r;
1705
+ for (; r < e.length && !W(e[r]) && e[r] !== ">";) r++;
1706
+ if (i === n) return G(e.substring(o, r));
1707
+ }
1708
+ return null;
1709
+ }
1710
+ // ../types/src/merge-tag-html.ts
1711
+ function wn(e) {
1712
+ return Dn(e, (e) => e, !1);
1713
+ }
1714
+ function Tn(e, t) {
1715
+ return Dn(e, t, !0);
1716
+ }
1717
+ function En(e) {
1718
+ let t = [];
1719
+ return Dn(e, (n, r, i) => {
1720
+ let a = e.slice(r, i);
1721
+ return t.push({
1722
+ start: r,
1723
+ end: i,
1724
+ markup: a
1725
+ }), a;
1726
+ }, !0), t;
1727
+ }
1728
+ function Dn(e, t, n) {
1729
+ let r = "", i = 0;
1730
+ for (; i < e.length;) {
1731
+ let a = e.indexOf("<span", i);
1732
+ if (a === -1) {
1733
+ r += e.substring(i);
1734
+ break;
1735
+ }
1736
+ let o = e[a + 5];
1737
+ if (o !== ">" && o !== " " && o !== " " && o !== "\n" && o !== "\r" && o !== "/") {
1738
+ r += e.substring(i, a + 5), i = a + 5;
1739
+ continue;
1740
+ }
1741
+ let s = U(e, a + 5);
1742
+ if (s === -1) {
1743
+ r += e.substring(i);
1744
+ break;
1745
+ }
1746
+ let c = e.substring(a + 5, s), l = kn(c, "data-merge-tag") ?? kn(c, "data-logic-merge-tag");
1747
+ if (l === null) {
1748
+ r += e.substring(i, a + 5), i = a + 5;
1749
+ continue;
1750
+ }
1751
+ let u = On(e, s + 1, n);
1752
+ if (u === -1) {
1753
+ r += e.substring(i);
1754
+ break;
1755
+ }
1756
+ r += e.substring(i, a), r += t(l, a, u), i = u;
1757
+ }
1758
+ return r;
1759
+ }
1760
+ function On(e, t, n) {
1761
+ if (!n) {
1762
+ let n = e.indexOf("</span>", t);
1763
+ return n === -1 ? -1 : n + 7;
1764
+ }
1765
+ let r = 1, i = t;
1766
+ for (; i < e.length;) {
1767
+ let t = e.indexOf("<", i);
1768
+ if (t === -1) return -1;
1769
+ let n = U(e, t + 1);
1770
+ if (n === -1) return -1;
1771
+ let a = e.startsWith("</span", t), o = e.startsWith("<span", t), s = e[t + (a ? 6 : 5)];
1772
+ if ((o || a) && (s === ">" || s === "/" || /\s/.test(s)) && (r += a ? -1 : 1, r === 0)) return n + 1;
1773
+ i = n + 1;
1774
+ }
1775
+ return -1;
1776
+ }
1777
+ function kn(e, t) {
1778
+ return Cn(e, t);
1779
+ }
1780
+ // ../types/src/locale-strings.ts
1781
+ var An = {
1782
+ title: ["content"],
1783
+ paragraph: ["content"]
1784
+ };
1785
+ function jn(e) {
1786
+ let t = [], n = /<[a-z][\w:-]*\b/gi;
1787
+ for (; n.exec(e);) {
1788
+ let r = U(e, n.lastIndex);
1789
+ if (r < 0) break;
1790
+ let i = n.lastIndex, a = e.slice(i, r), o = /[^\s"'<>/=]+\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/g;
1791
+ for (let e; e = o.exec(a);) {
1792
+ let n = e[1] ?? e[2] ?? e[3], r = i + o.lastIndex - +(e[3] === void 0);
1793
+ t.push({
1794
+ start: r - n.length,
1795
+ end: r
1796
+ });
1797
+ }
1798
+ n.lastIndex = r + 1;
1799
+ }
1800
+ return t;
1801
+ }
1802
+ function Mn(e, t, n) {
1803
+ let r = n === "html" ? En(e) : [], i = n === "html" ? jn(e) : [], a = r.map((e) => ({
1804
+ ...e,
1805
+ attribute: !1
1806
+ })), o = (n, r) => {
1807
+ let o = e.slice(n, r), s = [t.logic, t.value].map((e) => new RegExp(e.source, e.flags.replace(/[gy]/g, "") + "g")), c = 0;
1808
+ for (; c < o.length;) {
1809
+ let e = s.flatMap((e) => {
1810
+ e.lastIndex = c;
1811
+ let t = e.exec(o);
1812
+ for (; t && t[0].length === 0;) e.lastIndex = t.index + 1, t = e.exec(o);
1813
+ return t ? [t] : [];
1814
+ });
1815
+ e.sort((e, t) => e.index - t.index || e[0].length - t[0].length);
1816
+ let t = e[0];
1817
+ if (!t) break;
1818
+ let r = n + t.index, l = r + t[0].length;
1819
+ a.push({
1820
+ start: r,
1821
+ end: l,
1822
+ markup: t[0],
1823
+ attribute: i.some((e) => r >= e.start && l <= e.end)
1824
+ }), c = t.index + t[0].length;
1825
+ }
1826
+ }, s = 0;
1827
+ for (let e of r) o(s, e.start), s = e.end;
1828
+ return o(s, e.length), a.sort((e, t) => e.start - t.start);
1829
+ }
1830
+ function Nn(e) {
1831
+ if (!e.includes("&")) return { text: e };
1832
+ let t = "", n = [0], r = 0, i = (i) => {
1833
+ for (t += e.slice(r, i); r < i;) n.push(++r);
1834
+ };
1835
+ for (let a of e.matchAll(/&(?:#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g)) {
1836
+ i(a.index);
1837
+ let e = G(a[0]);
1838
+ t += e;
1839
+ for (let t = 1; t < e.length; t++) n.push(-1);
1840
+ r = a.index + a[0].length, n.push(r);
1841
+ }
1842
+ return i(e.length), {
1843
+ text: t,
1844
+ offsets: n
1845
+ };
1846
+ }
1847
+ var K = /* @__PURE__ */ new Map(), Pn = 32;
1848
+ function Fn(e) {
1849
+ let t = JSON.stringify(e), n = K.get(t);
1850
+ if (n === void 0) {
1851
+ let r = e.map((e) => e.trim()).filter(Boolean).sort((e, t) => t.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
1852
+ n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null, K.size >= Pn && K.delete(K.keys().next().value), K.set(t, n);
1853
+ }
1854
+ return n;
1855
+ }
1856
+ function In(e, t, n) {
1857
+ let r = n.length ? Fn(n) : null;
1858
+ if (!r) return [];
1859
+ let i = [];
1860
+ if (t === "text") i.push({
1861
+ start: 0,
1862
+ end: e.length,
1863
+ attribute: !1
1864
+ });
1865
+ else {
1866
+ i.push(...jn(e).map((e) => ({
1867
+ ...e,
1868
+ attribute: !0
1869
+ })));
1870
+ let t = /<(?:\/?[a-z][\w:-]*\b|!--|!|\?)/gi, n = 0;
1871
+ for (let r; r = t.exec(e);) {
1872
+ i.push({
1873
+ start: n,
1874
+ end: r.index,
1875
+ attribute: !1
1876
+ });
1877
+ let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) : U(e, t.lastIndex);
1878
+ if (a < 0) return [];
1879
+ n = a + (r[0] === "<!--" ? 3 : 1), t.lastIndex = n;
1880
+ }
1881
+ i.push({
1882
+ start: n,
1883
+ end: e.length,
1884
+ attribute: !1
1885
+ });
1886
+ }
1887
+ let a = [];
1888
+ for (let n of i) {
1889
+ r.lastIndex = 0;
1890
+ let i = e.slice(n.start, n.end), o = t === "html" ? Nn(i) : {
1891
+ text: i,
1892
+ offsets: void 0
1893
+ };
1894
+ for (let t; t = r.exec(o.text);) {
1895
+ let r = o.offsets?.[t.index] ?? t.index, i = o.offsets?.[t.index + t[0].length] ?? t.index + t[0].length;
1896
+ if (r < 0 || i < 0) continue;
1897
+ let s = n.start + r, c = n.start + i;
1898
+ a.push({
1899
+ start: s,
1900
+ end: c,
1901
+ markup: e.slice(s, c),
1902
+ attribute: n.attribute,
1903
+ term: t[0]
1904
+ });
1905
+ }
1906
+ }
1907
+ return a;
1908
+ }
1909
+ function Ln(e, t, n, r) {
1910
+ let i = Mn(e, t, n), a = In(e, n, r?.doNotTranslate ?? []).filter((e) => !i.some((t) => e.start < t.end && e.end > t.start));
1911
+ return [...i, ...a].sort((e, t) => e.start - t.start);
1912
+ }
1913
+ function Rn(e, t, n) {
1914
+ let r = "", i = 0;
1915
+ return t.forEach((t, a) => {
1916
+ r += e.slice(i, t.start), r += t.attribute ? `__x${n[a]}__` : `<x id="${n[a]}"/>`, i = t.end;
1917
+ }), r + e.slice(i);
1918
+ }
1919
+ function zn(e, t, n, r) {
1920
+ let i = Ln(e, t, n, r);
1921
+ return {
1922
+ text: Rn(e, i, i.map((e, t) => t + 1)),
1923
+ tokens: i.map((e) => e.markup)
1924
+ };
1925
+ }
1926
+ function Bn(e, t) {
1927
+ 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) => {
1928
+ let s = Number(i ?? a ?? o);
1929
+ return (s < 1 || s > t.length || n.has(s)) && (r = !1), n.add(s), t[s - 1] ?? "";
1930
+ });
1931
+ return r && n.size === t.length ? i : null;
1932
+ }
1933
+ function Vn(e, t, n, r, i) {
1934
+ let a = Ln(e, n, r, i), o = /* @__PURE__ */ new Set(), s = (e) => {
1935
+ let n = t.findIndex((t, n) => !o.has(n) && e(t));
1936
+ return n >= 0 && o.add(n), n;
1937
+ }, c = a.map((e) => s((t) => t === e.markup));
1938
+ return a.forEach((e, t) => {
1939
+ c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) => G(t) === e.term));
1940
+ }), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null : Rn(e, a.filter((e, t) => c[t] >= 0), c.filter((e) => e >= 0).map((e) => e + 1));
1941
+ }
1942
+ function Hn(e, t, n = []) {
1943
+ let r = /* @__PURE__ */ new Map();
1944
+ if (t === w(e) || !e.settings.locales?.includes(t)) return r;
1945
+ let i = (e, n, i, a) => {
1946
+ let o = n.l10n?.[t];
1947
+ for (let t of i) {
1948
+ let i = v(n, t);
1949
+ typeof i != "string" || i === "" || Object.keys(o?.set ?? {}).some((e) => e === t || t.startsWith(`${e}.`)) || r.set(`${e.kind === "block" ? e.blockId : "settings"}/${t}`, {
1950
+ target: e,
1951
+ path: t,
1952
+ source: i,
1953
+ format: a && An[a]?.includes(t) ? "html" : "text",
1954
+ text: o?.text?.[t]
1955
+ });
1956
+ }
1957
+ }, a = (e) => {
1958
+ for (let r of e) if (!r.l10n?.[t]?.hidden) {
1959
+ if (r.type !== "html" && i({
1960
+ kind: "block",
1961
+ blockId: r.id
1962
+ }, r, x(r, n), r.type), r.type === "section") for (let e of r.children) a(e);
1963
+ else r.type === "wrapper" && a(r.children);
1964
+ }
1965
+ };
1966
+ return a(e.blocks), i({ kind: "settings" }, e.settings, h), r;
1967
+ }
1968
+ function Un(e, t, n) {
1969
+ let r = n.only === "all" ? null : je(e, t, n.definitions), i = r && /* @__PURE__ */ new Set([...r.missing, ...r.stale]), a = [], o = {};
1970
+ for (let [r, s] of Hn(e, t, n.definitions)) {
1971
+ if (i && !i.has(r) || n.blockId !== void 0 && (s.target.kind !== "block" || s.target.blockId !== n.blockId)) continue;
1972
+ let e = zn(s.source, n.syntax, s.format, n), t = s.text ? Vn(s.text.value, e.tokens, n.syntax, s.format, n) : void 0;
1973
+ a.push({
1974
+ id: r,
1975
+ format: s.format,
1976
+ source: e.text,
1977
+ sourceHash: S(s.source),
1978
+ ...t == null ? {} : { text: t }
1979
+ }), o[r] = e.tokens;
1980
+ }
1981
+ return {
1982
+ strings: a,
1983
+ tokens: o
1984
+ };
1985
+ }
1986
+ function Wn(e, t, n, r) {
1987
+ let i = Hn(e, t, r.definitions), a = /* @__PURE__ */ new Map(), o = (e) => {
1988
+ for (let t of e) if (a.set(t.id, t), t.type === "section") for (let e of t.children) o(e);
1989
+ else t.type === "wrapper" && o(t.children);
1990
+ };
1991
+ o(e.blocks);
1992
+ let s = /* @__PURE__ */ new Map(), c, l = [];
1993
+ for (let t of n) {
1994
+ let n = i.get(t.id);
1995
+ if (!n) {
1996
+ let n = t.id.lastIndexOf("/"), r = t.id.slice(0, n), i = r === "settings" ? [a.get(r), e.settings] : [a.get(r)];
1997
+ l.push({
1998
+ id: t.id,
1999
+ reason: n < 0 || !i.some((e) => e && v(e, t.id.slice(n + 1)) !== void 0) ? "unknown_field" : "not_translatable"
2000
+ });
2001
+ continue;
2002
+ }
2003
+ let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ? Bn(t.text, o) : null;
2004
+ if (!o || u === null || Vn(u, o, r.syntax, n.format, r) === null) {
2005
+ l.push({
2006
+ id: t.id,
2007
+ reason: "tags_changed"
2008
+ });
2009
+ continue;
2010
+ }
2011
+ let d = n.target.kind === "settings" ? c ??= {} : s.get(n.target.blockId) ?? {};
2012
+ d[n.path] = {
2013
+ value: u,
2014
+ sourceHash: t.sourceHash
2015
+ }, n.target.kind === "block" && s.set(n.target.blockId, d);
2016
+ }
2017
+ let u = [];
2018
+ for (let [e, n] of s) u.push({
2019
+ op: "updateBlockLocale",
2020
+ blockId: e,
2021
+ locale: t,
2022
+ text: n
2023
+ });
2024
+ return c && u.push({
2025
+ op: "updateSettingsLocale",
2026
+ locale: t,
2027
+ text: c
2028
+ }), {
2029
+ operations: u,
2030
+ rejected: l
2031
+ };
2032
+ }
2033
+ // ../types/src/custom-block-liquid.ts
2034
+ function Gn(e) {
2035
+ return new e.Liquid({
2036
+ strictVariables: !1,
2037
+ strictFilters: !1,
2038
+ outputEscape: "escape",
2039
+ templates: {}
2040
+ });
2041
+ }
2042
+ // ../types/src/factory.ts
2043
+ function q(e, t) {
2044
+ let n = p(e);
2045
+ return !t || Object.keys(t).length === 0 ? n : mn(n, t);
2046
+ }
2047
+ function J(e) {
2048
+ return e === void 0 ? void 0 : p(e);
2049
+ }
2050
+ function Y() {
2051
+ return crypto.randomUUID();
2052
+ }
2053
+ function Kn(e = 0) {
2054
+ return {
2055
+ top: e,
2056
+ right: e,
2057
+ bottom: e,
2058
+ left: e
2059
+ };
2060
+ }
2061
+ function X(e = 10) {
2062
+ return { padding: Kn(e) };
2063
+ }
2064
+ function qn(e = {}) {
2065
+ return q({
2066
+ id: Y(),
2067
+ type: "title",
2068
+ ...Zt,
2069
+ styles: X()
2070
+ }, e);
2071
+ }
2072
+ function Jn(e = {}) {
2073
+ return q({
2074
+ id: Y(),
2075
+ type: "paragraph",
2076
+ ...Qt,
2077
+ styles: X()
2078
+ }, e);
2079
+ }
2080
+ function Yn(e = {}) {
2081
+ return q({
2082
+ id: Y(),
2083
+ type: "image",
2084
+ ...$t,
2085
+ styles: X()
2086
+ }, e);
2087
+ }
2088
+ function Xn(e = {}) {
2089
+ return q({
2090
+ id: Y(),
2091
+ type: "button",
2092
+ ...en,
2093
+ styles: X()
2094
+ }, e);
2095
+ }
2096
+ function Zn(e = {}) {
2097
+ return q({
2098
+ id: Y(),
2099
+ type: "divider",
2100
+ ...tn,
2101
+ styles: X(20)
2102
+ }, e);
2103
+ }
2104
+ function Qn(e = {}) {
2105
+ return q({
2106
+ id: Y(),
2107
+ type: "section",
2108
+ ...nn,
2109
+ children: [[]],
2110
+ styles: X(20)
2111
+ }, e);
2112
+ }
2113
+ function $n(e = {}) {
2114
+ return q({
2115
+ id: Y(),
2116
+ type: "video",
2117
+ ...rn,
2118
+ styles: X()
2119
+ }, e);
2120
+ }
2121
+ function er(e = {}) {
2122
+ return q({
2123
+ id: Y(),
2124
+ type: "social",
2125
+ icons: [],
2126
+ ...an,
2127
+ styles: X()
2128
+ }, e);
2129
+ }
2130
+ function tr(e = {}) {
2131
+ return q({
2132
+ id: Y(),
2133
+ type: "spacer",
2134
+ ...on,
2135
+ styles: X(0)
2136
+ }, e);
2137
+ }
2138
+ function nr(e = {}) {
2139
+ return q({
2140
+ id: Y(),
2141
+ type: "html",
2142
+ ...sn,
2143
+ styles: X()
2144
+ }, e);
2145
+ }
2146
+ function rr(e = {}) {
2147
+ return q({
2148
+ id: Y(),
2149
+ type: "menu",
2150
+ items: [],
2151
+ ...cn,
2152
+ styles: X()
2153
+ }, e);
2154
+ }
2155
+ function ir(e, t) {
2156
+ return Array.from({ length: t }, () => ({
2157
+ id: Y(),
2158
+ cells: Array.from({ length: e }, () => ({
2159
+ id: Y(),
2160
+ content: ""
2161
+ }))
2162
+ }));
2163
+ }
2164
+ function ar(e = {}) {
2165
+ return q({
2166
+ id: Y(),
2167
+ type: "table",
2168
+ rows: ir(3, 3),
2169
+ ...ln,
2170
+ styles: X()
2171
+ }, e);
2172
+ }
2173
+ function or(e = {}) {
2174
+ return q({
2175
+ id: Y(),
2176
+ type: "countdown",
2177
+ ...un,
2178
+ styles: X()
2179
+ }, e);
2180
+ }
2181
+ function sr(e) {
2182
+ return e.type === "repeatable" ? e.default ?? [] : e.type === "boolean" ? e.default ?? !1 : e.type === "number" ? e.default ?? 0 : e.default ?? "";
2183
+ }
2184
+ function cr(e) {
2185
+ let t = {};
2186
+ for (let n of e.fields) t[n.key] = J(sr(n));
2187
+ let n = q(X(), J(e.defaultStyles));
2188
+ return {
2189
+ id: Y(),
2190
+ type: "custom",
2191
+ customType: e.type,
2192
+ fieldValues: t,
2193
+ styles: n,
2194
+ ...e.dataSource ? { dataSourceFetched: !1 } : {}
2195
+ };
2196
+ }
2197
+ function lr() {
2198
+ return {
2199
+ id: Y(),
2200
+ type: "slot",
2201
+ styles: X(0)
2202
+ };
2203
+ }
2204
+ function ur(e = {}) {
2205
+ return q({
2206
+ id: Y(),
2207
+ type: "wrapper",
2208
+ children: [],
2209
+ styles: X(0)
2210
+ }, e);
2211
+ }
2212
+ function dr(e, t) {
2213
+ switch (e) {
2214
+ case "section": return Qn(J(t?.section));
2215
+ case "title": return qn(J(t?.title));
2216
+ case "paragraph": return Jn(J(t?.paragraph));
2217
+ case "image": return Yn(J(t?.image));
2218
+ case "button": return Xn(J(t?.button));
2219
+ case "divider": return Zn(J(t?.divider));
2220
+ case "video": return $n(J(t?.video));
2221
+ case "social": return er(J(t?.social));
2222
+ case "spacer": return tr(J(t?.spacer));
2223
+ case "html": return nr(J(t?.html));
2224
+ case "menu": return rr(J(t?.menu));
2225
+ case "table": return ar(J(t?.table));
2226
+ case "countdown": return or(J(t?.countdown));
2227
+ case "slot": throw Error("[Templatical] slot cannot be inserted into content. Use createSlotBlock() to build a layout.");
2228
+ case "wrapper": throw Error("[Templatical] wrapper cannot be inserted into content. Use createWrapperBlock() to build a layout.");
2229
+ default: throw Error(`Unknown block type: ${e}`);
2230
+ }
2231
+ }
2232
+ function fr(e, t) {
2233
+ let n = e.l10n;
2234
+ if (!n || t.size === 0) return;
2235
+ let r = (n) => {
2236
+ let r = e, i = "";
2237
+ return n.split(".").map((e) => {
2238
+ let n = Array.isArray(r) ? t.get(i)?.get(e) ?? e : e;
2239
+ return r = Array.isArray(r) ? r.find((e) => e.id === n) : r?.[e], i = i ? `${i}.${e}` : e, n;
2240
+ }).join(".");
2241
+ };
2242
+ for (let e of Object.values(n)) for (let t of ["text", "set"]) {
2243
+ let n = e[t];
2244
+ n && (e[t] = Object.fromEntries(Object.entries(n).map(([e, t]) => [r(e), t])));
2245
+ }
2246
+ }
2247
+ function Z(e) {
2248
+ let t = JSON.parse(JSON.stringify(e));
2249
+ t.id = Y();
2250
+ let n = /* @__PURE__ */ new Map(), r = (e, t) => {
2251
+ let r = e.id;
2252
+ e.id = Y();
2253
+ let i = n.get(t);
2254
+ return i || (i = /* @__PURE__ */ new Map(), n.set(t, i)), i.set(r, e.id), r;
2255
+ };
2256
+ if (t.type === "table") for (let e of t.rows) {
2257
+ let t = r(e, "rows");
2258
+ for (let n of e.cells) r(n, `rows.${t}.cells`);
2259
+ }
2260
+ if (t.type === "menu") for (let e of t.items) r(e, "items");
2261
+ if (t.type === "social") for (let e of t.icons) r(e, "icons");
2262
+ return t.type === "section" && (t.children = t.children.map((e) => e.map((e) => Z(e)))), t.type === "wrapper" && (t.children = t.children.map((e) => Z(e))), fr(t, n), t;
2263
+ }
2264
+ // ../types/src/layout.ts
2265
+ var pr = "[Templatical] layout: must contain exactly one slot block", mr = "[Templatical] layout: slot must be a top-level or wrapper child, not nested in a section", hr = "[Templatical] layout: a wrapper cannot contain a wrapper", gr = "[Templatical] layout: a wrapper around the slot cannot contain blocks that emit mj-wrapper (section.wrapper)", _r = "[Templatical] slot is not a valid content block", vr = "[Templatical] wrapper is not a valid content block";
2266
+ function Q(e, t, n = null, r = !1) {
2267
+ for (let i of e) if (t(i, n, r), Lt(i)) for (let e of i.children) Q(e, t, i, !0);
2268
+ else H(i) && Q(i.children, t, i, r);
2269
+ }
2270
+ function yr(e) {
2271
+ let t = 0;
2272
+ if (Q(e.blocks, (e, n, r) => {
2273
+ if (V(e) && (t += 1, r)) throw Error(mr);
2274
+ if (H(e)) {
2275
+ if (r) throw Error(mr);
2276
+ if (e.children.some(H)) throw Error(hr);
2277
+ }
2278
+ }), t !== 1) throw Error(pr);
2279
+ }
2280
+ function br(e) {
2281
+ Q(e.blocks, (e) => {
2282
+ if (V(e)) throw Error(_r);
2283
+ });
2284
+ }
2285
+ function xr(e) {
2286
+ Q(e.blocks, (e) => {
2287
+ if (H(e)) throw Error(vr);
2288
+ });
2289
+ }
2290
+ function Sr(e) {
2291
+ let t = !1;
2292
+ return Q(e.blocks, (e, n) => {
2293
+ V(e) && n !== null && H(n) && (t = !0);
2294
+ }), t;
2295
+ }
2296
+ function Cr(e) {
2297
+ if (V(e)) return e;
2298
+ if (H(e)) {
2299
+ let t = Z({
2300
+ ...e,
2301
+ children: []
2302
+ });
2303
+ return t.children = e.children.map(Cr), t;
2304
+ }
2305
+ return Z(e);
2306
+ }
2307
+ function wr(e) {
2308
+ for (let t = 0; t < e.length; t++) {
2309
+ let n = e[t];
2310
+ if (V(n)) return {
2311
+ parent: e,
2312
+ index: t
2313
+ };
2314
+ if (H(n)) {
2315
+ let e = wr(n.children);
2316
+ if (e) return e;
2317
+ }
2318
+ }
2319
+ return null;
2320
+ }
2321
+ function Tr(e) {
2322
+ for (let t of e) if (Lt(t)) {
2323
+ if (t.wrapper) return !0;
2324
+ for (let e of t.children) if (Tr(e)) return !0;
2325
+ }
2326
+ return !1;
2327
+ }
2328
+ function Er(e, t) {
2329
+ if (yr(e), br(t), xr(t), Sr(e) && Tr(t.blocks)) throw Error(gr);
2330
+ let n = e.blocks.map(Cr), r = wr(n);
2331
+ if (!r) throw Error(pr);
2332
+ return r.parent.splice(r.index, 1, ...p(t.blocks)), {
2333
+ blocks: n,
2334
+ settings: {
2335
+ ...p(t.settings),
2336
+ backgroundColor: e.settings.backgroundColor
2337
+ }
2338
+ };
2339
+ }
2340
+ // ../types/src/url-policy.ts
2341
+ var Dr = Object.freeze([
2342
+ "http",
2343
+ "https",
2344
+ "mailto",
2345
+ "tel",
2346
+ "ftp",
2347
+ "ftps",
2348
+ "sms",
2349
+ "xmpp",
2350
+ "cid"
2351
+ ]), Or = Object.freeze([
2352
+ "javascript",
2353
+ "data",
2354
+ "vbscript"
2355
+ ]);
2356
+ function kr(e) {
2357
+ return e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
2358
+ }
2359
+ function Ar(e) {
2360
+ let t = /^([a-z][a-z0-9+.-]*):/i.exec(kr(e));
2361
+ return t ? t[1].toLowerCase() : null;
2362
+ }
2363
+ var jr = /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i, Mr = Object.freeze([
2364
+ "href",
2365
+ "xlink:href",
2366
+ "background",
2367
+ "poster",
2368
+ "src"
2369
+ ]), Nr = Object.freeze([
2370
+ "srcdoc",
2371
+ "ping",
2372
+ "formaction",
2373
+ "action"
2374
+ ]);
2375
+ function Pr(e, t) {
2376
+ let n = kr(e), r = Ar(n);
2377
+ return r === null || Dr.some((e) => e === r) ? !0 : t.toLowerCase() === "src" && jr.test(n);
2378
+ }
2379
+ // ../types/src/rich-text.ts
2380
+ var Fr = /<\/?p\b[^<>]*>/gi, Ir = /<p\b([^<>]*)>\s*<\/p>/gi;
2381
+ function Lr(e) {
2382
+ return e.replace(Fr, "").trim() === "";
2383
+ }
2384
+ function Rr(e) {
2385
+ return Lr(e) ? e : e.replace(Ir, "<p$1>&nbsp;</p>");
2386
+ }
2387
+ // ../types/src/fonts.ts
2388
+ var zr = {
2389
+ arial: "Arial, sans-serif",
2390
+ helvetica: "Helvetica, sans-serif",
2391
+ georgia: "Georgia, serif",
2392
+ "times new roman": "'Times New Roman', serif",
2393
+ verdana: "Verdana, sans-serif",
2394
+ "trebuchet ms": "'Trebuchet MS', sans-serif",
2395
+ "courier new": "'Courier New', monospace",
2396
+ tahoma: "Tahoma, sans-serif"
2397
+ }, Br = /* @__PURE__ */ new Set([
2398
+ "inherit",
2399
+ "initial",
2400
+ "unset",
2401
+ "revert",
2402
+ "revert-layer"
2403
+ ]), Vr = /* @__PURE__ */ new Set([
2404
+ "serif",
2405
+ "sans-serif",
2406
+ "monospace",
2407
+ "cursive",
2408
+ "fantasy",
2409
+ "system-ui",
2410
+ "ui-serif",
2411
+ "ui-sans-serif",
2412
+ "ui-monospace",
2413
+ "ui-rounded",
2414
+ "emoji",
2415
+ "math",
2416
+ "fangsong"
2417
+ ]);
2418
+ function Hr(e) {
2419
+ return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
2420
+ }
2421
+ function Ur(e) {
2422
+ if (typeof e != "string") return [];
2423
+ let t = e.replace(/!\s*important\s*$/i, ""), n = [], r = 0;
2424
+ for (;;) {
2425
+ for (; r < t.length && Hr(t[r]);) r++;
2426
+ if (r >= t.length) return [];
2427
+ let e = t[r];
2428
+ if (e === "\"" || e === "'") {
2429
+ let i = "", a = r + 1, o = !1;
2430
+ for (; a < t.length;) {
2431
+ let n = t[a];
2432
+ if (n === "\\" && a + 1 < t.length) i += t[a + 1], a += 2;
2433
+ else {
2434
+ if (n === e) {
2435
+ o = !0, a++;
2436
+ break;
2437
+ }
2438
+ i += n, a++;
2439
+ }
2440
+ }
2441
+ if (!o) return [];
2442
+ for (; a < t.length && Hr(t[a]);) a++;
2443
+ if (a < t.length && t[a] !== ",") return [];
2444
+ n.push({
2445
+ name: i,
2446
+ quoted: !0
2447
+ }), r = a;
2448
+ } else {
2449
+ let e = t.indexOf(",", r), i = e === -1 ? t.length : e, a = t.slice(r, i).trim().split(/\s+/).join(" ");
2450
+ if (a === "" || a.includes("\"") || a.includes("'") || Br.has(a.toLowerCase())) return [];
2451
+ n.push({
2452
+ name: a,
2453
+ quoted: !1
2454
+ }), r = i;
2455
+ }
2456
+ if (r >= t.length) return n;
2457
+ r++;
2458
+ }
2459
+ }
2460
+ function Wr(e) {
2461
+ return `'${e.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
2462
+ }
2463
+ function Gr(e) {
2464
+ return !e.quoted && Vr.has(e.name.toLowerCase());
2465
+ }
2466
+ function Kr(e) {
2467
+ return Ur(e)[0]?.name ?? "";
2468
+ }
2469
+ function qr(e, t) {
2470
+ let n = (e) => `${Wr(e.name)}, ${e.fallback ?? t.defaultFallback}`, r = typeof e == "string" ? e.trim().toLowerCase() : "", i = t.customFonts.find((e) => e.name.toLowerCase() === r);
2471
+ if (i) return n(i);
2472
+ let a = Ur(e);
2473
+ if (a.length !== 1) return e;
2474
+ let [o] = a, s = o.name.toLowerCase(), c = t.customFonts.find((e) => e.name.toLowerCase() === s);
2475
+ return c ? n(c) : zr[s] || (Gr(o) ? e : `${Wr(o.name)}, ${t.defaultFallback}`);
2476
+ }
2477
+ // ../types/src/merge-tags.ts
2478
+ var $ = {
2479
+ liquid: {
2480
+ value: /\{\{.+?\}\}/g,
2481
+ logic: /\{%-?\s*(\w+).*?-?%\}/g,
2482
+ opener: "{{",
2483
+ closer: "}}"
2484
+ },
2485
+ handlebars: {
2486
+ value: /\{\{\{?.+?\}?\}\}/g,
2487
+ logic: /\{\{[#/](\w+).*?\}\}/g,
2488
+ opener: "{{",
2489
+ closer: "}}"
2490
+ },
2491
+ mailchimp: {
2492
+ value: /\*\|\w+\|\*/g,
2493
+ logic: /\*\|(\w+)[:|].*?\|\*/g,
2494
+ opener: "*|",
2495
+ closer: "|*"
2496
+ },
2497
+ ampscript: {
2498
+ value: /%%=.+?=%%/g,
2499
+ logic: /%%\[\s*(\w+).*?\]%%/g,
2500
+ opener: "%%=",
2501
+ closer: "=%%"
2502
+ }
2503
+ };
2504
+ function Jr(e) {
2505
+ return typeof e == "string" && e.trim() !== "" ? e : null;
2506
+ }
2507
+ function Yr(e) {
2508
+ return Object.values($).find((t) => t.value.source === e.value.source) ?? null;
2509
+ }
2510
+ function Xr(e) {
2511
+ return Jr(e.opener) ?? Yr(e)?.opener ?? null;
2512
+ }
2513
+ function Zr(e) {
2514
+ return Jr(e.closer) ?? Yr(e)?.closer ?? null;
2515
+ }
2516
+ function Qr(e) {
2517
+ return e ? typeof e == "string" ? $[e] ?? $.liquid : e : $.liquid;
2518
+ }
2519
+ function $r(e) {
2520
+ let t = e.source, n = e.flags.replace("g", "");
2521
+ return RegExp(`^${t}$`, n);
2522
+ }
2523
+ function ei(e, t) {
2524
+ let n = e?.trim() || "";
2525
+ return !$r(t.logic).test(n) && $r(t.value).test(n);
2526
+ }
2527
+ function ti(e, t) {
2528
+ let n = t.find((t) => t.value === e);
2529
+ return n ? n.label : e;
2530
+ }
2531
+ function ni(e, t) {
2532
+ return fi(e, "data-merge-tag", (e) => ti(e, t));
2533
+ }
2534
+ function ri(e, t) {
2535
+ return t.find((t) => t.value === e)?.sample;
2536
+ }
2537
+ function ii(e, t) {
2538
+ return fi(e, "data-merge-tag", (e) => si(ri(e, t) ?? ti(e, t)), { unwrap: (e) => ri(e, t) !== void 0 });
2539
+ }
2540
+ function ai(e) {
2541
+ return e.some((e) => e.sample !== void 0);
2542
+ }
2543
+ function oi(e, t) {
2544
+ if (!e) return e;
2545
+ let n = e;
2546
+ for (let e of t) e.sample !== void 0 && (n = n.split(e.value).join(e.sample));
2547
+ return n;
2548
+ }
2549
+ function si(e) {
2550
+ return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
2551
+ }
2552
+ function ci(e, t) {
2553
+ if (!e) return !1;
2554
+ let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
2555
+ return n.test(e) || r.test(e);
2556
+ }
2557
+ function li(e, t) {
2558
+ return $r(t.logic).test(e?.trim() || "");
2559
+ }
2560
+ function ui(e, t) {
2561
+ let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
2562
+ return r && r[1] ? r[1].toUpperCase() : e;
2563
+ }
2564
+ function di(e, t) {
2565
+ return fi(e, "data-logic-merge-tag", (e) => ui(e, t));
2566
+ }
2567
+ function fi(e, t, n, r) {
2568
+ let i = "", a = 0;
2569
+ for (; a < e.length;) {
2570
+ let o = e.indexOf("<span", a);
2571
+ if (o === -1) {
2572
+ i += e.substring(a);
2573
+ break;
2574
+ }
2575
+ let s = e[o + 5];
2576
+ if (s !== ">" && s !== " " && s !== " " && s !== "\n" && s !== "\r" && s !== "/") {
2577
+ i += e.substring(a, o + 5), a = o + 5;
2578
+ continue;
2579
+ }
2580
+ let c = U(e, o + 5);
2581
+ if (c === -1) {
2582
+ i += e.substring(a);
2583
+ break;
2584
+ }
2585
+ let l = e.indexOf("</span>", c + 1);
2586
+ if (l === -1) {
2587
+ i += e.substring(a);
2588
+ break;
2589
+ }
2590
+ let u = Cn(e.substring(o + 5, c), t);
2591
+ if (u === null) {
2592
+ i += e.substring(a, o + 5), a = o + 5;
2593
+ continue;
2594
+ }
2595
+ let d = n(u);
2596
+ r?.unwrap?.(u) ? (i += e.substring(a, o), i += d) : (i += e.substring(a, c + 1), i += d, i += "</span>"), a = l + 7;
2597
+ }
2598
+ return i;
2599
+ }
2600
+ // ../types/src/preview-resolution.ts
2601
+ function pi(e) {
2602
+ return typeof e != "object" || !e ? !1 : Array.isArray(e.blocks);
2603
+ }
2604
+ export { An as $, p as $t, xr as A, T as At, Yn as B, Se as Bt, Nr as C, Gt as Ct, Pr as D, H as Dt, Ar as E, Ut as Et, Xn as F, h as Ft, er as G, y as Gt, Jn as H, je as Ht, or as I, Ne as It, qn as J, Ae as Jt, tr as K, Ce as Kt, cr as L, w as Lt, yr as M, E as Mt, Z as N, Ie as Nt, Er as O, It as Ot, dr as P, Le as Pt, Gn as Q, m as Qt, Zn as R, ve as Rt, Or as S, Wt as St, Dr as T, Rt as Tt, Qn as U, Me as Ut, rr as V, Te as Vt, lr as W, De as Wt, ur as X, x as Xt, $n as Y, S as Yt, Y as Z, ge as Zt, Kr as _, n as _n, Bt as _t, ti as a, oe as an, G as at, Rr as b, t as bn, Lt as bt, Xr as c, f as cn, hn as ct, ei as d, ne as dn, mn as dt, se as en, Wn as et, di as f, i as fn, Vt as ft, oi as g, c as gn, Kt as gt, ii as h, l as hn, Ht as ht, ui as i, fe as in, Tn as it, Sr as j, Re as jt, br as k, Pt as kt, ai as l, ee as ln, dn as lt, Qr as m, s as mn, Xt as mt, $ as n, ue as nn, Bn as nt, ri as o, ie as on, yn as ot, ni as p, e as pn, Yt as pt, ar as q, v as qt, ci as r, pe as rn, wn as rt, Zr as s, d as sn, vn as st, pi as t, de as tn, Un as tt, li as u, te as un, fn as ut, Ur as v, r as vn, qt as vt, Mr as w, Jt as wt, Lr as x, V as xt, qr as y, o as yn, zt as yt, nr as z, _ as zt };
2605
+
2606
+ //# sourceMappingURL=src-CACM3o--.js.map