@templatical/editor 0.49.0 → 0.51.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 (378) hide show
  1. package/README.md +4 -2
  2. package/dist/AiAltTextPopover-BZQ95GXL.js +106 -0
  3. package/dist/AiAltTextReview-DoBEudnE.js +206 -0
  4. package/dist/AiChatPanel-Bs6sES3b.js +550 -0
  5. package/dist/AiHeaderMenu-BEaTazx4.js +36 -0
  6. package/dist/AiPanels-CfN7A-ZA.js +33 -0
  7. package/dist/AiRewriteMenu-C3ZfDDYy.js +276 -0
  8. package/dist/{BlockIssueBadge-BdpJwim0.js → BlockIssueBadge-CKwZ1Vgn.js} +11 -11
  9. package/dist/{BlockPreviewCanvas-D_sowkf0.js → BlockPreviewCanvas-BXNLLLYi.js} +33 -33
  10. package/dist/CloudHeaderExtras-CsJMEiyN.js +23 -0
  11. package/dist/{CloudPanels-1hwFiJ0G.js → CloudPanels-B4F5m7vy.js} +66 -85
  12. package/dist/{CollaborationNotices-BWpKzueF.js → CollaborationNotices-CNuDp7Y2.js} +19 -16
  13. package/dist/{CollaboratorBar-D87phJsw.js → CollaboratorBar-BtHPiuHq.js} +22 -22
  14. package/dist/{CommentsPanel-BUvUzO3T.js → CommentsPanel-CyCM-BvT.js} +4 -4
  15. package/dist/CommentsSidebar-Ca3DyFOX.js +500 -0
  16. package/dist/{cdn/chunks/CountdownBlock-DB4JNdqh.js → CountdownBlock-DR4Xm2-T.js} +24 -26
  17. package/dist/{CountdownToolbar-CLMIwfK7.js → CountdownToolbar-CEIMPojJ.js} +55 -55
  18. package/dist/IssuesPanel-C8nMUccy.js +360 -0
  19. package/dist/{LoadingTrack-BXOptf5g.js → LoadingTrack-B0RKQWq3.js} +2 -2
  20. package/dist/{LogicTagInsertButton-CR5E4jSG.js → LogicTagInsertButton-CqfU52CO.js} +273 -268
  21. package/dist/{cdn/chunks/MediaEditModal-DD0SZ-S3.js → MediaEditModal-DHtkZ4OU.js} +202 -186
  22. package/dist/{MediaPanels-BVXDkqtH.js → MediaPanels-CGcOB2pR.js} +4 -4
  23. package/dist/{MergeTagInput-BEw_r0PJ.js → MergeTagInput-YnEkorTZ.js} +25 -25
  24. package/dist/{MergeTagModeToggle-CJTpFmVd.js → MergeTagModeToggle-Dhb1DAcQ.js} +40 -40
  25. package/dist/MergeTagTextarea-e4lnwtqZ.js +70 -0
  26. package/dist/ParagraphEditor-B6NK0ytw.js +799 -0
  27. package/dist/{RestoreVersionDialog-BaDpy3cL.js → RestoreVersionDialog-Bq_IGOLJ.js} +21 -21
  28. package/dist/{RichTextEditorContent-CsvniFlI.js → RichTextEditorContent-AOM6fylS.js} +48 -48
  29. package/dist/{SaveBlockDialog-DzWURF_e.js → SaveBlockDialog-C8GngfQx.js} +87 -87
  30. package/dist/{cdn/chunks/SavedBlocksBrowserModal-BMtyUrUP.js → SavedBlocksBrowserModal-wnkvxpm_.js} +102 -99
  31. package/dist/{SavedBlocksPanels-B3Af8ns2.js → SavedBlocksPanels-C2s3q0pJ.js} +9 -9
  32. package/dist/{SavedBlocksPickBar-Dj11-Lqp.js → SavedBlocksPickBar-BjcTiV87.js} +13 -13
  33. package/dist/TemplateSettings-BVBWpiDU.js +237 -0
  34. package/dist/{TestEmailModal-BeRYV3eg.js → TestEmailModal-SyhO9bn3.js} +57 -57
  35. package/dist/{TestEmailPanel-B8c3fQi2.js → TestEmailPanel-BDd2Rtav.js} +4 -4
  36. package/dist/{TitleEditor-CvpNUoAp.js → TitleEditor-pxD53y_l.js} +75 -75
  37. package/dist/ToggleSwitch-D51U9cmR.js +37 -0
  38. package/dist/{Toolbar-BadDSkkF.js → Toolbar-CZSPZYbj.js} +1138 -1138
  39. package/dist/{TplModal-BZgi9Tes.js → TplModal-DCzBzicE.js} +19 -19
  40. package/dist/{VersionHistoryMenu-BRlcQ8wX.js → VersionHistoryMenu-BQeWPT85.js} +35 -35
  41. package/dist/{VersionHistoryPanels-DGkllN3a.js → VersionHistoryPanels-BBm7YbRQ.js} +5 -5
  42. package/dist/{VersionPreviewBanner-F-811aps.js → VersionPreviewBanner-DUGF0tUJ.js} +9 -9
  43. package/dist/WrapperBlock-BO619LAb.js +45 -0
  44. package/dist/aiErrors-D5UOoYOt.js +41 -0
  45. package/dist/aiImageContext-BH4Ss1h3.js +48 -0
  46. package/dist/aiRewritePreview-DLGM05Ge.js +44 -0
  47. package/dist/{blockTypeIcons-CayLluou.js → blockTypeIcons-NzaYvAI4.js} +15 -14
  48. package/dist/bundle-stats.json +8 -8
  49. package/dist/{cdn/chunks/ca-DSJwJ5ov.js → ca-C7mTzW1r.js} +130 -13
  50. package/dist/cdn/chunks/AiAltTextPopover-CQu0Q_ZX.js +107 -0
  51. package/dist/cdn/chunks/AiAltTextPopover-CQu0Q_ZX.js.map +1 -0
  52. package/dist/cdn/chunks/AiAltTextReview-CI2HbWfn.js +207 -0
  53. package/dist/cdn/chunks/AiAltTextReview-CI2HbWfn.js.map +1 -0
  54. package/dist/cdn/chunks/AiChatPanel-BYqn1bKu.js +476 -0
  55. package/dist/cdn/chunks/AiChatPanel-BYqn1bKu.js.map +1 -0
  56. package/dist/cdn/chunks/AiHeaderMenu-oldAAFyL.js +37 -0
  57. package/dist/cdn/chunks/AiHeaderMenu-oldAAFyL.js.map +1 -0
  58. package/dist/cdn/chunks/AiPanels-CIFKQv8Y.js +34 -0
  59. package/dist/cdn/chunks/AiPanels-CIFKQv8Y.js.map +1 -0
  60. package/dist/cdn/chunks/AiRewriteMenu-Bhh71zcc.js +208 -0
  61. package/dist/cdn/chunks/AiRewriteMenu-Bhh71zcc.js.map +1 -0
  62. package/dist/cdn/chunks/{BlockIssueBadge-D1VBS_6x.js → BlockIssueBadge-DAn2vsMJ.js} +13 -13
  63. package/dist/cdn/chunks/{BlockIssueBadge-D1VBS_6x.js.map → BlockIssueBadge-DAn2vsMJ.js.map} +1 -1
  64. package/dist/cdn/chunks/{BlockPreviewCanvas-m2tWRyWv.js → BlockPreviewCanvas-D0--EQkP.js} +38 -38
  65. package/dist/cdn/chunks/{BlockPreviewCanvas-m2tWRyWv.js.map → BlockPreviewCanvas-D0--EQkP.js.map} +1 -1
  66. package/dist/cdn/chunks/CloudHeaderExtras-DaUU8P8R.js +25 -0
  67. package/dist/cdn/chunks/CloudHeaderExtras-DaUU8P8R.js.map +1 -0
  68. package/dist/cdn/chunks/{CloudPanels-XufhBZYF.js → CloudPanels-C3jsxo_f.js} +52 -71
  69. package/dist/cdn/chunks/CloudPanels-C3jsxo_f.js.map +1 -0
  70. package/dist/cdn/chunks/{CollaborationNotices-CBvKEj1Q.js → CollaborationNotices-DjRI8gvs.js} +23 -20
  71. package/dist/cdn/chunks/CollaborationNotices-DjRI8gvs.js.map +1 -0
  72. package/dist/cdn/chunks/{CollaboratorBar-DWW54Bn_.js → CollaboratorBar-Dfzm6A9A.js} +20 -20
  73. package/dist/cdn/chunks/{CollaboratorBar-DWW54Bn_.js.map → CollaboratorBar-Dfzm6A9A.js.map} +1 -1
  74. package/dist/cdn/chunks/CommentsPanel-CSO79OeX.js +20 -0
  75. package/dist/cdn/chunks/{CommentsPanel-R8YLLO3v.js.map → CommentsPanel-CSO79OeX.js.map} +1 -1
  76. package/dist/cdn/chunks/CommentsSidebar-CCvplq1Z.js +470 -0
  77. package/dist/cdn/chunks/{CommentsSidebar-96NZHVq3.js.map → CommentsSidebar-CCvplq1Z.js.map} +1 -1
  78. package/dist/{CountdownBlock-DPQXWRvU.js → cdn/chunks/CountdownBlock-C6USdwk3.js} +19 -17
  79. package/dist/cdn/chunks/{CountdownBlock-DB4JNdqh.js.map → CountdownBlock-C6USdwk3.js.map} +1 -1
  80. package/dist/cdn/chunks/{CountdownToolbar-tmiTPEXm.js → CountdownToolbar-Cjud2Tos.js} +70 -70
  81. package/dist/cdn/chunks/{CountdownToolbar-tmiTPEXm.js.map → CountdownToolbar-Cjud2Tos.js.map} +1 -1
  82. package/dist/cdn/chunks/IssuesPanel-BaWHPDxZ.js +340 -0
  83. package/dist/cdn/chunks/IssuesPanel-BaWHPDxZ.js.map +1 -0
  84. package/dist/cdn/chunks/{LoadingTrack-YU44CM8X.js → LoadingTrack-BIcL4NiY.js} +2 -2
  85. package/dist/cdn/chunks/{LoadingTrack-YU44CM8X.js.map → LoadingTrack-BIcL4NiY.js.map} +1 -1
  86. package/dist/cdn/chunks/{LogicTagInsertButton-BJ2t2vxC.js → LogicTagInsertButton-CsL2JDOG.js} +367 -362
  87. package/dist/cdn/chunks/LogicTagInsertButton-CsL2JDOG.js.map +1 -0
  88. package/dist/{MediaEditModal-C_wxoUMG.js → cdn/chunks/MediaEditModal-BuHCiyMu.js} +544 -560
  89. package/dist/cdn/chunks/MediaEditModal-BuHCiyMu.js.map +1 -0
  90. package/dist/cdn/chunks/MediaPanels-DAgUf_T1.js +45 -0
  91. package/dist/cdn/chunks/{MediaPanels-CkdJ_kGp.js.map → MediaPanels-DAgUf_T1.js.map} +1 -1
  92. package/dist/cdn/chunks/{MergeTagInput-7wXX71DH.js → MergeTagInput-C8U-7LxL.js} +33 -33
  93. package/dist/cdn/chunks/{MergeTagInput-7wXX71DH.js.map → MergeTagInput-C8U-7LxL.js.map} +1 -1
  94. package/dist/cdn/chunks/{MergeTagModeToggle-r9vHH4u_.js → MergeTagModeToggle-Mm-p0A52.js} +41 -41
  95. package/dist/cdn/chunks/{MergeTagModeToggle-r9vHH4u_.js.map → MergeTagModeToggle-Mm-p0A52.js.map} +1 -1
  96. package/dist/cdn/chunks/MergeTagTextarea-DuLScsWM.js +72 -0
  97. package/dist/cdn/chunks/MergeTagTextarea-DuLScsWM.js.map +1 -0
  98. package/dist/cdn/chunks/ParagraphEditor-CqSj6Ayz.js +634 -0
  99. package/dist/cdn/chunks/ParagraphEditor-CqSj6Ayz.js.map +1 -0
  100. package/dist/cdn/chunks/{RestoreVersionDialog-C5cxBRKi.js → RestoreVersionDialog-CdA5osuA.js} +25 -25
  101. package/dist/cdn/chunks/{RestoreVersionDialog-C5cxBRKi.js.map → RestoreVersionDialog-CdA5osuA.js.map} +1 -1
  102. package/dist/cdn/chunks/{RichTextEditorContent-BfE7Bkge.js → RichTextEditorContent-Q1d2xqBT.js} +46 -46
  103. package/dist/cdn/chunks/{RichTextEditorContent-BfE7Bkge.js.map → RichTextEditorContent-Q1d2xqBT.js.map} +1 -1
  104. package/dist/cdn/chunks/{SaveBlockDialog-BKbjUnPM.js → SaveBlockDialog-CijargAy.js} +77 -77
  105. package/dist/cdn/chunks/{SaveBlockDialog-BKbjUnPM.js.map → SaveBlockDialog-CijargAy.js.map} +1 -1
  106. package/dist/cdn/chunks/SavedBlocksBrowserModal-DtOz_X5S.js +357 -0
  107. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BMtyUrUP.js.map → SavedBlocksBrowserModal-DtOz_X5S.js.map} +1 -1
  108. package/dist/cdn/chunks/SavedBlocksPanels-BowyED5h.js +38 -0
  109. package/dist/cdn/chunks/{SavedBlocksPanels-s_gxi1im.js.map → SavedBlocksPanels-BowyED5h.js.map} +1 -1
  110. package/dist/cdn/chunks/{SavedBlocksPickBar-B8WHk5mI.js → SavedBlocksPickBar-BPRaJBv3.js} +18 -18
  111. package/dist/cdn/chunks/{SavedBlocksPickBar-B8WHk5mI.js.map → SavedBlocksPickBar-BPRaJBv3.js.map} +1 -1
  112. package/dist/cdn/chunks/TemplateSettings-ByZeBO34.js +209 -0
  113. package/dist/cdn/chunks/{TemplateSettings-CtrzzQWl.js.map → TemplateSettings-ByZeBO34.js.map} +1 -1
  114. package/dist/cdn/chunks/{TestEmailModal-DuZKYMWD.js → TestEmailModal-BUVTj3Ic.js} +54 -54
  115. package/dist/cdn/chunks/{TestEmailModal-DuZKYMWD.js.map → TestEmailModal-BUVTj3Ic.js.map} +1 -1
  116. package/dist/cdn/chunks/TestEmailPanel-BxutYoWg.js +35 -0
  117. package/dist/cdn/chunks/{TestEmailPanel-DERaCdpG.js.map → TestEmailPanel-BxutYoWg.js.map} +1 -1
  118. package/dist/cdn/chunks/TitleEditor-Ccv6uoTz.js +199 -0
  119. package/dist/cdn/chunks/{TitleEditor-CEgxjtUX.js.map → TitleEditor-Ccv6uoTz.js.map} +1 -1
  120. package/dist/cdn/chunks/ToggleSwitch-Ctdmj621.js +39 -0
  121. package/dist/cdn/chunks/ToggleSwitch-Ctdmj621.js.map +1 -0
  122. package/dist/cdn/chunks/{Toolbar-GFIZQHzw.js → Toolbar-DoprRgTn.js} +986 -987
  123. package/dist/cdn/chunks/{Toolbar-GFIZQHzw.js.map → Toolbar-DoprRgTn.js.map} +1 -1
  124. package/dist/cdn/chunks/{TplModal-DDrbWJcE.js → TplModal-BXQzmsJX.js} +21 -21
  125. package/dist/cdn/chunks/{TplModal-DDrbWJcE.js.map → TplModal-BXQzmsJX.js.map} +1 -1
  126. package/dist/cdn/chunks/{VersionHistoryMenu-MlxsUmuT.js → VersionHistoryMenu-BF2fNCvq.js} +41 -41
  127. package/dist/cdn/chunks/{VersionHistoryMenu-MlxsUmuT.js.map → VersionHistoryMenu-BF2fNCvq.js.map} +1 -1
  128. package/dist/cdn/chunks/VersionHistoryPanels-Dal0Uk69.js +48 -0
  129. package/dist/cdn/chunks/{VersionHistoryPanels-DVOV8QLv.js.map → VersionHistoryPanels-Dal0Uk69.js.map} +1 -1
  130. package/dist/cdn/chunks/{VersionPreviewBanner-BQwRKc6S.js → VersionPreviewBanner-BaGcn-b1.js} +12 -12
  131. package/dist/cdn/chunks/{VersionPreviewBanner-BQwRKc6S.js.map → VersionPreviewBanner-BaGcn-b1.js.map} +1 -1
  132. package/dist/cdn/chunks/WrapperBlock-DkQJtLz0.js +47 -0
  133. package/dist/cdn/chunks/{WrapperBlock-CFuP4R0c.js.map → WrapperBlock-DkQJtLz0.js.map} +1 -1
  134. package/dist/cdn/chunks/aiErrors-D5UOoYOt.js +43 -0
  135. package/dist/cdn/chunks/aiErrors-D5UOoYOt.js.map +1 -0
  136. package/dist/cdn/chunks/aiImageContext-BH4Ss1h3.js +50 -0
  137. package/dist/cdn/chunks/aiImageContext-BH4Ss1h3.js.map +1 -0
  138. package/dist/cdn/chunks/aiRewritePreview-DLGM05Ge.js +46 -0
  139. package/dist/cdn/chunks/aiRewritePreview-DLGM05Ge.js.map +1 -0
  140. package/dist/cdn/chunks/blockTypeIcons-ikZAmd6U.js +22 -0
  141. package/dist/cdn/chunks/{blockTypeIcons-BnAd8qsP.js.map → blockTypeIcons-ikZAmd6U.js.map} +1 -1
  142. package/dist/{ca-DSJwJ5ov.js → cdn/chunks/ca-C7mTzW1r.js} +132 -11
  143. package/dist/cdn/chunks/ca-C7mTzW1r.js.map +1 -0
  144. package/dist/cdn/chunks/{cloud-CI_fgDyy.js → createCloudRuntime-DpBWhrv3.js} +489 -593
  145. package/dist/cdn/chunks/createCloudRuntime-DpBWhrv3.js.map +1 -0
  146. package/dist/cdn/chunks/de-DBOTcDj2.js +22 -0
  147. package/dist/cdn/chunks/de-DBOTcDj2.js.map +1 -0
  148. package/dist/{de-CBE6O79z.js → cdn/chunks/de-DNuYQTmS.js} +132 -11
  149. package/dist/cdn/chunks/de-DNuYQTmS.js.map +1 -0
  150. package/dist/{dist-Bv_GBr2l.js → cdn/chunks/dist-Bo8Thh8v.js} +60 -58
  151. package/dist/cdn/chunks/{dist-Doy3r07H.js.map → dist-Bo8Thh8v.js.map} +1 -1
  152. package/dist/cdn/chunks/dist-S-rLGqax.js +406 -0
  153. package/dist/cdn/chunks/{dist-DdwjXLme.js.map → dist-S-rLGqax.js.map} +1 -1
  154. package/dist/cdn/chunks/{draggable-akeQH_JP.js → draggable-DZ0gwUJ6.js} +1822 -1728
  155. package/dist/cdn/chunks/draggable-DZ0gwUJ6.js.map +1 -0
  156. package/dist/cdn/chunks/{editor-modal-HJBy9kLj.js → editor-modal-CI6EfeMd.js} +884 -884
  157. package/dist/cdn/chunks/{editor-modal-HJBy9kLj.js.map → editor-modal-CI6EfeMd.js.map} +1 -1
  158. package/dist/cdn/chunks/en-CDhWRrF_.js +22 -0
  159. package/dist/cdn/chunks/en-CDhWRrF_.js.map +1 -0
  160. package/dist/{en-CDexnk0p.js → cdn/chunks/en-CW71OK66.js} +132 -11
  161. package/dist/cdn/chunks/en-CW71OK66.js.map +1 -0
  162. package/dist/cdn/chunks/en-ifvu6oPv.js +1 -0
  163. package/dist/{es-BE42B6uN.js → cdn/chunks/es-DdK7zQfi.js} +132 -11
  164. package/dist/cdn/chunks/es-DdK7zQfi.js.map +1 -0
  165. package/dist/cdn/chunks/{extensions-koOuDeZS.js → extensions-taJTZlLK.js} +59 -59
  166. package/dist/cdn/chunks/{extensions-koOuDeZS.js.map → extensions-taJTZlLK.js.map} +1 -1
  167. package/dist/{fr-DlJFPDQR.js → cdn/chunks/fr-Dz5Bgb7-.js} +132 -11
  168. package/dist/cdn/chunks/fr-Dz5Bgb7-.js.map +1 -0
  169. package/dist/cdn/chunks/{icons-CjlNV8xD.js → icons-DNX6StSs.js} +178 -145
  170. package/dist/cdn/chunks/icons-DNX6StSs.js.map +1 -0
  171. package/dist/{ja-CUT8gkNI.js → cdn/chunks/ja-Di-zJiT8.js} +132 -11
  172. package/dist/cdn/chunks/ja-Di-zJiT8.js.map +1 -0
  173. package/dist/cdn/chunks/keys-BTpmg2Tt.js +12 -0
  174. package/dist/cdn/chunks/keys-BTpmg2Tt.js.map +1 -0
  175. package/dist/{logger-BBlvSn6q.js → cdn/chunks/logger-Tj0RPskW.js} +7 -1
  176. package/dist/cdn/chunks/logger-Tj0RPskW.js.map +1 -0
  177. package/dist/{nl-bXWqqRyS.js → cdn/chunks/nl-CvVuHYFL.js} +132 -11
  178. package/dist/cdn/chunks/{nl-bXWqqRyS.js.map → nl-CvVuHYFL.js.map} +1 -1
  179. package/dist/cdn/chunks/normalizeMergeTagMarkup-DyePIGqu.js +199 -0
  180. package/dist/cdn/chunks/normalizeMergeTagMarkup-DyePIGqu.js.map +1 -0
  181. package/dist/cdn/chunks/{preRenderCustomBlocks-DqKbdTJ8.js → preRenderCustomBlocks-Dc-QLntG.js} +4 -4
  182. package/dist/cdn/chunks/{preRenderCustomBlocks-DqKbdTJ8.js.map → preRenderCustomBlocks-Dc-QLntG.js.map} +1 -1
  183. package/dist/cdn/chunks/pt-BR-CHM-ZKvE.js +22 -0
  184. package/dist/cdn/chunks/pt-BR-CHM-ZKvE.js.map +1 -0
  185. package/dist/{pt-BR-2_H4-wlb.js → cdn/chunks/pt-BR-ZhO4vgyq.js} +132 -11
  186. package/dist/cdn/chunks/pt-BR-ZhO4vgyq.js.map +1 -0
  187. package/dist/cdn/chunks/sanitizeRichTextHtml-DeISfLFr.js +62 -0
  188. package/dist/cdn/chunks/sanitizeRichTextHtml-DeISfLFr.js.map +1 -0
  189. package/dist/cdn/chunks/socialIcons-BBvsTwCV.js +2032 -0
  190. package/dist/cdn/chunks/socialIcons-BBvsTwCV.js.map +1 -0
  191. package/dist/{dist-DBG3nh3k.js → cdn/chunks/src-BNFnxfrA.js} +552 -350
  192. package/dist/cdn/chunks/src-BNFnxfrA.js.map +1 -0
  193. package/dist/cdn/chunks/src-Bs_yxk3h.js +4392 -0
  194. package/dist/cdn/chunks/src-Bs_yxk3h.js.map +1 -0
  195. package/dist/cdn/chunks/{src-B77z1iw4.js → src-K6fw_35b.js} +113 -113
  196. package/dist/cdn/chunks/{src-B77z1iw4.js.map → src-K6fw_35b.js.map} +1 -1
  197. package/dist/cdn/chunks/{tiptap-B1RfWFzB.js → tiptap-CtVrAViq.js} +43 -43
  198. package/dist/cdn/chunks/{tiptap-B1RfWFzB.js.map → tiptap-CtVrAViq.js.map} +1 -1
  199. package/dist/cdn/chunks/{useCloudI18n-kp07GQmk.js → useCloudI18n-AVXhzbhQ.js} +4 -4
  200. package/dist/cdn/chunks/{useCloudI18n-kp07GQmk.js.map → useCloudI18n-AVXhzbhQ.js.map} +1 -1
  201. package/dist/cdn/chunks/useEditorCore-CCVFi1YZ.js +2586 -0
  202. package/dist/cdn/chunks/useEditorCore-CCVFi1YZ.js.map +1 -0
  203. package/dist/cdn/chunks/useEditorRoot-CR5GjJD6.js +10 -0
  204. package/dist/cdn/chunks/{useEditorRoot-5SBqm90x.js.map → useEditorRoot-CR5GjJD6.js.map} +1 -1
  205. package/dist/cdn/chunks/{useI18n-DEqtEgOs.js → useI18n-CbVubQhM.js} +3 -3
  206. package/dist/cdn/chunks/{useI18n-DEqtEgOs.js.map → useI18n-CbVubQhM.js.map} +1 -1
  207. package/dist/cdn/chunks/{useLogicTag-X8bc5qNl.js → useLogicTag-B49Nc53Y.js} +5 -5
  208. package/dist/cdn/chunks/{useLogicTag-X8bc5qNl.js.map → useLogicTag-B49Nc53Y.js.map} +1 -1
  209. package/dist/cdn/chunks/{useMergeTag-DFoOexIQ.js → useMergeTag-B0KryMj8.js} +5 -5
  210. package/dist/cdn/chunks/{useMergeTag-DFoOexIQ.js.map → useMergeTag-B0KryMj8.js.map} +1 -1
  211. package/dist/cdn/chunks/{usePopoverPosition-Cz9-XiXR.js → usePopoverPosition-C829ps5i.js} +4 -4
  212. package/dist/cdn/chunks/{usePopoverPosition-Cz9-XiXR.js.map → usePopoverPosition-C829ps5i.js.map} +1 -1
  213. package/dist/cdn/chunks/useScrollToBlock-CAwvulog.js +51 -0
  214. package/dist/cdn/chunks/useScrollToBlock-CAwvulog.js.map +1 -0
  215. package/dist/cdn/chunks/{withCurrentFont-D-f61ghC.js → withCurrentFont-DFPXeVfG.js} +2 -2
  216. package/dist/cdn/chunks/{withCurrentFont-D-f61ghC.js.map → withCurrentFont-DFPXeVfG.js.map} +1 -1
  217. package/dist/cdn/editor.css +1 -1
  218. package/dist/cdn/editor.js +2151 -1480
  219. package/dist/cdn/editor.js.map +1 -1
  220. package/dist/{check-DQQzkmIC.js → check-yYsp5Xpk.js} +1 -1
  221. package/dist/{chevron-down-CIF4bdon.js → chevron-down-DTmD06_j.js} +1 -1
  222. package/dist/{chevron-right-Cg7Xu-ev.js → chevron-right-BSeYZOxc.js} +1 -1
  223. package/dist/{chevron-up-Csu7ISD-.js → chevron-up-BOApwrxi.js} +1 -1
  224. package/dist/{circle-alert-YUvIJAgY.js → circle-alert-BMszY8im.js} +1 -1
  225. package/dist/{clock-CnSIGKQW.js → clock-HADxnl6-.js} +1 -1
  226. package/dist/{cloud-YUYDtdHt.js → createCloudRuntime-DVQI_ReU.js} +474 -570
  227. package/dist/{createLucideIcon-BcP1sjdp.js → createLucideIcon-0lYYH3EW.js} +6 -6
  228. package/dist/de-DBOTcDj2.js +20 -0
  229. package/dist/{cdn/chunks/de-CBE6O79z.js → de-DNuYQTmS.js} +130 -13
  230. package/dist/{cdn/chunks/dist-Doy3r07H.js → dist-C7EtxNCb.js} +49 -51
  231. package/dist/{dist-CNqjHA8e.js → dist-C_dV9QAx.js} +130 -130
  232. package/dist/{cdn/chunks/dist-DdwjXLme.js → dist-DI4_YSnG.js} +111 -110
  233. package/dist/{cdn/chunks/src-CvLTYGdO.js → dist-DtOF3bDW.js} +446 -393
  234. package/dist/{editor-modal--7_9A6j-.js → editor-modal-Bzhl-PgI.js} +832 -834
  235. package/dist/en-CDhWRrF_.js +20 -0
  236. package/dist/{cdn/chunks/en-CDexnk0p.js → en-CW71OK66.js} +130 -13
  237. package/dist/en-DwV15ltA.js +1 -0
  238. package/dist/{cdn/chunks/es-BE42B6uN.js → es-DdK7zQfi.js} +130 -13
  239. package/dist/{extensions-zwsZlWjH.js → extensions-CdyweA50.js} +57 -57
  240. package/dist/{eye-B1bua-ck.js → eye-DWkSvYpj.js} +1 -1
  241. package/dist/{cdn/chunks/fr-DlJFPDQR.js → fr-Dz5Bgb7-.js} +130 -13
  242. package/dist/image-DesWjcZ4.js +28 -0
  243. package/dist/index.d.ts +361 -24
  244. package/dist/{info-x26nGOo2.js → info-ClWJGoZy.js} +1 -1
  245. package/dist/{cdn/chunks/ja-CUT8gkNI.js → ja-Di-zJiT8.js} +130 -13
  246. package/dist/keys-Zd9KWRD1.js +10 -0
  247. package/dist/{link-CezhndyR.js → link-BqRicFTA.js} +1 -1
  248. package/dist/{list-DQqdptI0.js → list-bojQr9bn.js} +1 -1
  249. package/dist/{loader-circle-DCEeoYoi.js → loader-circle-B2B8LbUu.js} +1 -1
  250. package/dist/{cdn/chunks/logger-ByvdoAwq.js → logger-k9Nbj3Cp.js} +5 -3
  251. package/dist/{message-circle-BLGzfv_7.js → message-circle-BEuiNsyZ.js} +1 -1
  252. package/dist/{cdn/chunks/nl-bXWqqRyS.js → nl-CvVuHYFL.js} +130 -13
  253. package/dist/normalizeMergeTagMarkup-P6SUBuPv.js +197 -0
  254. package/dist/{package-D_kEQCMU.js → package-DCROB4aM.js} +1 -1
  255. package/dist/{pencil-Dct8zGLy.js → pencil-CEotCKbf.js} +1 -1
  256. package/dist/{preRenderCustomBlocks-CtKJecE-.js → preRenderCustomBlocks-D8rr61_z.js} +4 -4
  257. package/dist/pt-BR-CHM-ZKvE.js +20 -0
  258. package/dist/{cdn/chunks/pt-BR-2_H4-wlb.js → pt-BR-ZhO4vgyq.js} +130 -13
  259. package/dist/{refresh-cw-tGMRDxr8.js → refresh-cw-C6M2mHNC.js} +12 -2
  260. package/dist/{runtime-dom.esm-bundler-DYn1z2Xf.js → runtime-dom.esm-bundler-B8WCZWUm.js} +134 -134
  261. package/dist/sanitizeRichTextHtml-DeISfLFr.js +60 -0
  262. package/dist/{search-Bm2cCQpe.js → search-Cy99zPYf.js} +1 -1
  263. package/dist/{send-sVLaKZ7f.js → send-BDLJFsf3.js} +1 -1
  264. package/dist/{smartphone-B2W81p02.js → smartphone-CVvQaNA4.js} +1 -1
  265. package/dist/{cdn/chunks/socialIcons-CkZSYpoG.js → socialIcons-Dd-jRiVe.js} +688 -693
  266. package/dist/{sparkles-a1qkBZ8X.js → sparkles-Ce0Qz0ox.js} +1 -1
  267. package/dist/square-BWlolnXe.js +15 -0
  268. package/dist/style.css +1 -1
  269. package/dist/templatical-editor.js +2114 -1422
  270. package/dist/{text-align-start-CTuwQ5YW.js → text-align-start-D1V5gPTy.js} +1 -1
  271. package/dist/{trash-I3D2peFQ.js → trash-CZfiUFmw.js} +1 -1
  272. package/dist/{triangle-alert-CenxmLRE.js → triangle-alert-CFDzyFC7.js} +1 -1
  273. package/dist/upload-BJfvdIrD.js +36 -0
  274. package/dist/{useCloudI18n-CGVEZV3o.js → useCloudI18n-Dcjua65H.js} +5 -5
  275. package/dist/{useEditorCore-DRbMRe8F.js → useEditorCore-BTLeAVlM.js} +1463 -1499
  276. package/dist/{useEditorRoot-BVm2-1N8.js → useEditorRoot-DUy67lJu.js} +2 -2
  277. package/dist/{useI18n-CSh4gO5c.js → useI18n-BdoY7xDE.js} +4 -4
  278. package/dist/{useLogicTag-zcI6BWIf.js → useLogicTag-DKLZ1T9H.js} +3 -3
  279. package/dist/{useMergeTag-C-iBLlp0.js → useMergeTag-Bhdx7AKk.js} +3 -3
  280. package/dist/{usePopoverPosition-CMcsMBtK.js → usePopoverPosition-BZea45XK.js} +2 -2
  281. package/dist/useScrollToBlock-FmNMALM_.js +74 -0
  282. package/dist/{vue.runtime.esm-bundler-DV0Wx4r_.js → vue.runtime.esm-bundler-DgFJ6GPG.js} +1428 -1332
  283. package/dist/{withCurrentFont-D62njRLu.js → withCurrentFont-BATJHNve.js} +1 -1
  284. package/dist/{x-KFQ4S-Kz.js → x-CZ0Js0hA.js} +1 -1
  285. package/package.json +14 -12
  286. package/dist/AiChatSidebar-CdjTb9ej.js +0 -230
  287. package/dist/AiFeatureMenu-DKm7VYCs.js +0 -57
  288. package/dist/CloudHeaderExtras-CI8RR9hG.js +0 -55
  289. package/dist/CommentsSidebar-J65znlrH.js +0 -500
  290. package/dist/DesignReferenceSidebar-BTwCFgz8.js +0 -279
  291. package/dist/IssuesPanel-DeeVsfG7.js +0 -117
  292. package/dist/ParagraphEditor-zLV44z-R.js +0 -797
  293. package/dist/SavedBlocksBrowserModal-B8DCFW7t.js +0 -360
  294. package/dist/TemplateScoringPanel-Ba9sgvjS.js +0 -273
  295. package/dist/TemplateSettings-Cu5X9DgA.js +0 -246
  296. package/dist/ToggleSwitch-DHweVJOr.js +0 -102
  297. package/dist/WrapperBlock-DiiaxpMb.js +0 -45
  298. package/dist/cdn/chunks/AiChatSidebar-yXJ85Zcg.js +0 -205
  299. package/dist/cdn/chunks/AiChatSidebar-yXJ85Zcg.js.map +0 -1
  300. package/dist/cdn/chunks/AiFeatureMenu-4ydjrhsQ.js +0 -57
  301. package/dist/cdn/chunks/AiFeatureMenu-4ydjrhsQ.js.map +0 -1
  302. package/dist/cdn/chunks/CloudHeaderExtras-DEkRww7n.js +0 -56
  303. package/dist/cdn/chunks/CloudHeaderExtras-DEkRww7n.js.map +0 -1
  304. package/dist/cdn/chunks/CloudPanels-XufhBZYF.js.map +0 -1
  305. package/dist/cdn/chunks/CollaborationNotices-CBvKEj1Q.js.map +0 -1
  306. package/dist/cdn/chunks/CommentsPanel-R8YLLO3v.js +0 -20
  307. package/dist/cdn/chunks/CommentsSidebar-96NZHVq3.js +0 -470
  308. package/dist/cdn/chunks/DesignReferenceSidebar-D14IIu_P.js +0 -229
  309. package/dist/cdn/chunks/DesignReferenceSidebar-D14IIu_P.js.map +0 -1
  310. package/dist/cdn/chunks/IssuesPanel-BoPiCLGc.js +0 -100
  311. package/dist/cdn/chunks/IssuesPanel-BoPiCLGc.js.map +0 -1
  312. package/dist/cdn/chunks/LogicTagInsertButton-BJ2t2vxC.js.map +0 -1
  313. package/dist/cdn/chunks/MediaEditModal-DD0SZ-S3.js.map +0 -1
  314. package/dist/cdn/chunks/MediaPanels-CkdJ_kGp.js +0 -45
  315. package/dist/cdn/chunks/ParagraphEditor-CJQjRHXV.js +0 -632
  316. package/dist/cdn/chunks/ParagraphEditor-CJQjRHXV.js.map +0 -1
  317. package/dist/cdn/chunks/SavedBlocksPanels-s_gxi1im.js +0 -38
  318. package/dist/cdn/chunks/TemplateScoringPanel-BBPnHILC.js +0 -237
  319. package/dist/cdn/chunks/TemplateScoringPanel-BBPnHILC.js.map +0 -1
  320. package/dist/cdn/chunks/TemplateSettings-CtrzzQWl.js +0 -208
  321. package/dist/cdn/chunks/TestEmailPanel-DERaCdpG.js +0 -35
  322. package/dist/cdn/chunks/TitleEditor-CEgxjtUX.js +0 -199
  323. package/dist/cdn/chunks/ToggleSwitch-DGQ7iRc-.js +0 -104
  324. package/dist/cdn/chunks/ToggleSwitch-DGQ7iRc-.js.map +0 -1
  325. package/dist/cdn/chunks/VersionHistoryPanels-DVOV8QLv.js +0 -48
  326. package/dist/cdn/chunks/WrapperBlock-CFuP4R0c.js +0 -47
  327. package/dist/cdn/chunks/blockTypeIcons-BnAd8qsP.js +0 -22
  328. package/dist/cdn/chunks/ca-DSJwJ5ov.js.map +0 -1
  329. package/dist/cdn/chunks/cloud-CI_fgDyy.js.map +0 -1
  330. package/dist/cdn/chunks/createCloudRuntime-DiYCJ21w.js +0 -358
  331. package/dist/cdn/chunks/createCloudRuntime-DiYCJ21w.js.map +0 -1
  332. package/dist/cdn/chunks/de-CBE6O79z.js.map +0 -1
  333. package/dist/cdn/chunks/de-D_atmUVB.js +0 -89
  334. package/dist/cdn/chunks/de-D_atmUVB.js.map +0 -1
  335. package/dist/cdn/chunks/draggable-akeQH_JP.js.map +0 -1
  336. package/dist/cdn/chunks/en-CDexnk0p.js.map +0 -1
  337. package/dist/cdn/chunks/en-DhJLnaBx.js +0 -89
  338. package/dist/cdn/chunks/en-DhJLnaBx.js.map +0 -1
  339. package/dist/cdn/chunks/en-Ve-PWSXu.js +0 -1
  340. package/dist/cdn/chunks/es-BE42B6uN.js.map +0 -1
  341. package/dist/cdn/chunks/fr-DlJFPDQR.js.map +0 -1
  342. package/dist/cdn/chunks/icons-CjlNV8xD.js.map +0 -1
  343. package/dist/cdn/chunks/ja-CUT8gkNI.js.map +0 -1
  344. package/dist/cdn/chunks/keys-UAWhQ3zW.js +0 -12
  345. package/dist/cdn/chunks/keys-UAWhQ3zW.js.map +0 -1
  346. package/dist/cdn/chunks/logger-ByvdoAwq.js.map +0 -1
  347. package/dist/cdn/chunks/pt-BR-2_H4-wlb.js.map +0 -1
  348. package/dist/cdn/chunks/pt-BR-BphMoUTw.js +0 -89
  349. package/dist/cdn/chunks/pt-BR-BphMoUTw.js.map +0 -1
  350. package/dist/cdn/chunks/socialIcons-CkZSYpoG.js.map +0 -1
  351. package/dist/cdn/chunks/src-B1e5SSYP.js +0 -1272
  352. package/dist/cdn/chunks/src-B1e5SSYP.js.map +0 -1
  353. package/dist/cdn/chunks/src-CvLTYGdO.js.map +0 -1
  354. package/dist/cdn/chunks/timeouts-o5Y9BuqI.js +0 -6
  355. package/dist/cdn/chunks/timeouts-o5Y9BuqI.js.map +0 -1
  356. package/dist/cdn/chunks/useAliveFlag-PuXh83UK.js +0 -12
  357. package/dist/cdn/chunks/useAliveFlag-PuXh83UK.js.map +0 -1
  358. package/dist/cdn/chunks/useEditorCore-DpCFvHg_.js +0 -2623
  359. package/dist/cdn/chunks/useEditorCore-DpCFvHg_.js.map +0 -1
  360. package/dist/cdn/chunks/useEditorRoot-5SBqm90x.js +0 -10
  361. package/dist/cdn/chunks/useScrollToBlock-MNzurEZV.js +0 -21
  362. package/dist/cdn/chunks/useScrollToBlock-MNzurEZV.js.map +0 -1
  363. package/dist/copy-CUC43md_.js +0 -19
  364. package/dist/createCloudRuntime-BMDRjL0k.js +0 -356
  365. package/dist/de-D_atmUVB.js +0 -87
  366. package/dist/dist-CCqn-RqE.js +0 -407
  367. package/dist/en-BHCMzqib.js +0 -1
  368. package/dist/en-DhJLnaBx.js +0 -87
  369. package/dist/image-up-BqiO7KCO.js +0 -27
  370. package/dist/keys-BymCnLHD.js +0 -10
  371. package/dist/plus-BDd0gTEm.js +0 -14
  372. package/dist/pt-BR-BphMoUTw.js +0 -87
  373. package/dist/shield-check-YhsbXfQc.js +0 -14
  374. package/dist/socialIcons-Bwv-49EB.js +0 -2167
  375. package/dist/timeouts-o5Y9BuqI.js +0 -4
  376. package/dist/upload-uU2cK0Ce.js +0 -21
  377. package/dist/useAliveFlag-BjP0Gxza.js +0 -10
  378. package/dist/useScrollToBlock-CdCQK9QQ.js +0 -47
@@ -1,4 +1,4 @@
1
- //#region ../types/src/blocks.ts
1
+ //#region ../types/dist/index.js
2
2
  var e = [
3
3
  "top",
4
4
  "right",
@@ -37,7 +37,7 @@ function a(e) {
37
37
  }
38
38
  function o(e) {
39
39
  if (e == null) return null;
40
- let t = i.map(typeof e == "number" ? () => a(e) : (t) => a(e[t]));
40
+ let t = typeof e == "number" ? i.map(() => a(e)) : i.map((t) => a(e[t]));
41
41
  return t.every((e) => e === 0) ? null : t.every((e) => e === t[0]) ? `${t[0]}px` : t.map((e) => `${e}px`).join(" ");
42
42
  }
43
43
  var s = {
@@ -93,8 +93,6 @@ function re(e) {
93
93
  repeat: e.repeat ? "repeat" : "no-repeat"
94
94
  };
95
95
  }
96
- //#endregion
97
- //#region ../types/src/hero.ts
98
96
  var ie = [
99
97
  "top",
100
98
  "middle",
@@ -112,7 +110,7 @@ function ae(e) {
112
110
  applied: !1,
113
111
  reason: "image"
114
112
  };
115
- let r = f(e.backgroundImage), i = oe(t.height) ? Math.round(t.height) : "image";
113
+ let r = se(e.backgroundImage), i = oe(t.height) ? Math.round(t.height) : "image";
116
114
  return i === "image" && r === null ? {
117
115
  applied: !1,
118
116
  reason: "size"
@@ -127,13 +125,11 @@ function ae(e) {
127
125
  function oe(e) {
128
126
  return typeof e == "number" && Number.isFinite(e) && e >= 1;
129
127
  }
130
- function f(e) {
128
+ function se(e) {
131
129
  let t = e?.naturalWidth, n = e?.naturalHeight;
132
130
  return typeof t != "number" || typeof n != "number" || !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 || n <= 0 ? null : n / t;
133
131
  }
134
- //#endregion
135
- //#region ../types/src/social.ts
136
- var p = {
132
+ var ce = {
137
133
  facebook: {
138
134
  color: "#1877F2",
139
135
  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"
@@ -202,37 +198,31 @@ var p = {
202
198
  color: "#1769FF",
203
199
  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"
204
200
  }
205
- }, m = {
201
+ }, f = {
206
202
  dark: "#1f1f1f",
207
203
  light: "#ffffff"
208
204
  };
209
- function h(e) {
205
+ function le(e) {
210
206
  return e === "dark" || e === "light" ? e : void 0;
211
207
  }
212
- function se(e, t) {
213
- let n = h(t);
208
+ function ue(e, t) {
209
+ let n = le(t);
214
210
  return {
215
- fill: n ? m[n] : p[e].color,
216
- onFill: n === "light" ? m.dark : "#ffffff"
211
+ fill: n ? f[n] : ce[e].color,
212
+ onFill: n === "light" ? f.dark : "#ffffff"
217
213
  };
218
214
  }
219
- function ce(e, t) {
220
- let n = h(t);
221
- return n ? `${e}-${n}` : e;
222
- }
223
- function le(e, t) {
224
- if (h(t) === "dark" && (e === "plain" || e === "outlined")) return {
225
- color: m.light,
215
+ function de(e, t) {
216
+ if (le(t) === "dark" && (e === "plain" || e === "outlined")) return {
217
+ color: f.light,
226
218
  opacity: .6,
227
219
  width: 1.4
228
220
  };
229
221
  }
230
- function ue(e) {
222
+ function fe(e) {
231
223
  return e === "plain" ? .84 : .6;
232
224
  }
233
- //#endregion
234
- //#region ../types/src/clone.ts
235
- function g(e) {
225
+ function p(e) {
236
226
  let t = [];
237
227
  return JSON.parse(JSON.stringify(e, function(e, n) {
238
228
  if (typeof n != "object" || !n) return n;
@@ -240,25 +230,21 @@ function g(e) {
240
230
  if (!t.includes(n)) return t.push(n), n;
241
231
  }));
242
232
  }
243
- //#endregion
244
- //#region ../types/src/deep-equal.ts
245
- function de(e) {
233
+ function pe(e) {
246
234
  return typeof e == "object" && !!e && !Array.isArray(e);
247
235
  }
248
- function _(e, t) {
236
+ function m(e, t) {
249
237
  if (e === t) return !0;
250
- if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => _(e, t[n]));
251
- if (de(e)) {
252
- if (!de(t)) return !1;
238
+ if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => m(e, t[n]));
239
+ if (pe(e)) {
240
+ if (!pe(t)) return !1;
253
241
  let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
254
- for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !_(e[r], t[r])) return !1;
242
+ for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !m(e[r], t[r])) return !1;
255
243
  return !0;
256
244
  }
257
245
  return !1;
258
246
  }
259
- //#endregion
260
- //#region ../types/src/operations.ts
261
- var fe = class extends Error {
247
+ var h = class extends Error {
262
248
  code;
263
249
  opIndex;
264
250
  blockId;
@@ -266,59 +252,59 @@ var fe = class extends Error {
266
252
  super(n), this.name = "OperationError", this.code = e, this.opIndex = t, r !== void 0 && (this.blockId = r);
267
253
  }
268
254
  };
269
- function pe(e) {
255
+ function me(e) {
270
256
  return e === "1" ? 1 : e === "3" ? 3 : 2;
271
257
  }
272
- function me(e, t, n = {}) {
273
- let r = g(e);
274
- return v(r, t, n), r;
258
+ function he(e, t, n = {}) {
259
+ let r = p(e);
260
+ return g(r, t, n), r;
275
261
  }
276
- function v(e, t, n = {}) {
262
+ function g(e, t, n = {}) {
277
263
  let r = {
278
264
  locks: n.locks ?? [],
279
265
  session: n.session ?? null
280
266
  };
281
- t.forEach((t, n) => be(e, t, n, r));
267
+ t.forEach((t, n) => Ce(e, t, n, r));
282
268
  }
283
- var he = /* @__PURE__ */ new Set([
269
+ var ge = /* @__PURE__ */ new Set([
284
270
  "id",
285
271
  "type",
286
272
  "children"
287
- ]), ge = /* @__PURE__ */ new Set();
288
- function y(e, t, n, r) {
289
- throw new fe(e, t, n, r);
273
+ ]), _e = /* @__PURE__ */ new Set();
274
+ function _(e, t, n, r) {
275
+ throw new h(e, t, n, r);
290
276
  }
291
- function b(e) {
277
+ function v(e) {
292
278
  return typeof e == "object" && !!e && !Array.isArray(e);
293
279
  }
294
- function x(e) {
280
+ function y(e) {
295
281
  return e.type === "section";
296
282
  }
297
- function S(e) {
283
+ function ve(e) {
298
284
  return Array.isArray(e.blocks) ? e.blocks : [];
299
285
  }
300
- function _e(e) {
286
+ function ye(e) {
301
287
  let t = e.children;
302
288
  return Array.isArray(t) ? t.map((e) => Array.isArray(e) ? e : []) : [];
303
289
  }
304
- function C(e, t) {
305
- let n = S(e);
290
+ function b(e, t) {
291
+ let n = ve(e);
306
292
  for (let e = 0; e < n.length; e++) {
307
293
  let r = n[e];
308
- if (!b(r)) continue;
294
+ if (!v(r)) continue;
309
295
  if (r.id === t) return {
310
296
  block: r,
311
297
  list: n,
312
298
  index: e,
313
299
  parent: null
314
300
  };
315
- if (!x(r) || typeof r.id != "string") continue;
301
+ if (!y(r) || typeof r.id != "string") continue;
316
302
  let i = r.children;
317
303
  if (Array.isArray(i)) for (let e = 0; e < i.length; e++) {
318
304
  let n = i[e];
319
305
  if (Array.isArray(n)) for (let i = 0; i < n.length; i++) {
320
306
  let a = n[i];
321
- if (b(a) && a.id === t) return {
307
+ if (v(a) && a.id === t) return {
322
308
  block: a,
323
309
  list: n,
324
310
  index: i,
@@ -332,154 +318,263 @@ function C(e, t) {
332
318
  }
333
319
  return null;
334
320
  }
335
- function w(e) {
321
+ function x(e) {
336
322
  let t = typeof e.id == "string" ? [e.id] : [];
337
- if (x(e)) for (let n of _e(e)) t.push(...T(n));
323
+ if (y(e)) for (let n of ye(e)) t.push(...be(n));
338
324
  return t;
339
325
  }
340
- function T(e) {
341
- return e.flatMap((e) => b(e) ? w(e) : []);
326
+ function be(e) {
327
+ return e.flatMap((e) => v(e) ? x(e) : []);
342
328
  }
343
- function E(e, t) {
344
- return typeof e.blockId != "string" || e.blockId === "" ? y("invalid_operation", t, "blockId must be a block id.") : e.blockId;
329
+ function S(e, t) {
330
+ return typeof e.blockId != "string" || e.blockId === "" ? _("invalid_operation", t, "blockId must be a block id.") : e.blockId;
345
331
  }
346
- function D(e, t) {
332
+ function xe(e, t) {
347
333
  let n = e.parent;
348
- return n === null ? null : b(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
334
+ return n === null ? null : v(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
349
335
  sectionId: n.sectionId,
350
336
  column: n.column
351
- } : y("invalid_operation", t, "parent must be null or { \"sectionId\", \"column\" }.");
337
+ } : _("invalid_operation", t, "parent must be null or { \"sectionId\", \"column\" }.");
352
338
  }
353
- function O(e, t) {
339
+ function C(e, t) {
354
340
  let n = e.after;
355
- return n === null ? null : typeof n == "string" && n !== "" ? n : y("invalid_operation", t, "after must be null or a block id.");
341
+ return n === null ? null : typeof n == "string" && n !== "" ? n : _("invalid_operation", t, "after must be null or a block id.");
356
342
  }
357
- function k(e, t) {
343
+ function w(e, t) {
358
344
  let n = e.expect;
359
- return n == null ? null : b(n) ? n : y("invalid_operation", t, "expect must be an object.");
345
+ return n == null ? null : v(n) ? n : _("invalid_operation", t, "expect must be an object.");
360
346
  }
361
- function A(e, t, n) {
347
+ function T(e, t, n) {
362
348
  let r = e.set ?? null, i = e.unset ?? [];
363
- (r !== null && !b(r) || !Array.isArray(i) || !i.every((e) => typeof e == "string")) && y("invalid_operation", t, "set must be an object and unset a list of keys.");
349
+ (r !== null && !v(r) || !Array.isArray(i) || !i.every((e) => typeof e == "string")) && _("invalid_operation", t, "set must be an object and unset a list of keys.");
364
350
  let a = r === null ? {} : r, o = Object.keys(a).filter((e) => a[e] !== void 0);
365
- o.length === 0 && i.length === 0 && y("invalid_operation", t, "Set or unset at least one key.");
366
- for (let e of [...o, ...i]) n.has(e) && y("invalid_operation", t, `"${e}" can't be set or unset.`);
351
+ o.length === 0 && i.length === 0 && _("invalid_operation", t, "Set or unset at least one key.");
352
+ for (let e of [...o, ...i]) n.has(e) && _("invalid_operation", t, `"${e}" can't be set or unset.`);
367
353
  let s = i.find((e) => o.includes(e));
368
- return s !== void 0 && y("invalid_operation", t, `"${s}" is both set and unset.`), {
354
+ return s !== void 0 && _("invalid_operation", t, `"${s}" is both set and unset.`), {
369
355
  set: Object.fromEntries(o.map((e) => [e, a[e]])),
370
356
  unset: i
371
357
  };
372
358
  }
373
- function j(e, t, n) {
374
- if ((!b(e) || typeof e.id != "string" || e.id === "" || typeof e.type != "string") && y("invalid_operation", t, "A block needs a non-empty string id and a string type."), !x(e)) return;
375
- n && y("invalid_operation", t, "Sections can only be placed at the top level.");
359
+ function E(e, t, n) {
360
+ if ((!v(e) || typeof e.id != "string" || e.id === "" || typeof e.type != "string") && _("invalid_operation", t, "A block needs a non-empty string id and a string type."), !y(e)) return;
361
+ n && _("invalid_operation", t, "Sections can only be placed at the top level.");
376
362
  let r = e.children;
377
- (!Array.isArray(r) || !r.every((e) => Array.isArray(e))) && y("invalid_operation", t, "A section needs children: a list of columns, each a list of blocks.");
378
- for (let e of r) for (let n of e) j(n, t, !0);
363
+ (!Array.isArray(r) || !r.every((e) => Array.isArray(e))) && _("invalid_operation", t, "A section needs children: a list of columns, each a list of blocks.");
364
+ for (let e of r) for (let n of e) E(n, t, !0);
379
365
  }
380
- function ve(e, t) {
366
+ function D(e, t) {
381
367
  return e.session === null || t.sessionId !== e.session;
382
368
  }
383
- function M(e, t, n) {
384
- let r = e.locks.find((n) => t.includes(n.blockId) && ve(e, n));
385
- r && y("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
369
+ function O(e, t, n) {
370
+ let r = e.locks.find((n) => t.includes(n.blockId) && D(e, n));
371
+ r && _("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
386
372
  }
387
- function N(e, t, n, r) {
388
- for (let [i, a] of Object.entries(t)) a !== void 0 && (_(Object.hasOwn(e, i) && e[i] !== void 0 ? e[i] : null, a) || y("precondition_failed", n, r === void 0 ? `Setting "${i}" has changed since.` : `"${i}" of block "${r}" has changed since.`, r));
373
+ function k(e, t, n, r) {
374
+ for (let [i, a] of Object.entries(t)) a !== void 0 && (m(Object.hasOwn(e, i) && e[i] !== void 0 ? e[i] : null, a) || _("precondition_failed", n, r === void 0 ? `Setting "${i}" has changed since.` : `"${i}" of block "${r}" has changed since.`, r));
389
375
  }
390
- function P(e, t, n) {
376
+ function A(e, t, n) {
391
377
  if (t === null) return Array.isArray(e.blocks) || (e.blocks = []), e.blocks;
392
- let r = C(e, t.sectionId);
393
- if (!r) return y("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
394
- if (!x(r.block)) return y("invalid_operation", n, `Block "${t.sectionId}" isn't a section.`);
378
+ let r = b(e, t.sectionId);
379
+ if (!r) return _("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
380
+ if (!y(r.block)) return _("invalid_operation", n, `Block "${t.sectionId}" isn't a section.`);
395
381
  let i = r.block.children;
396
- return !Array.isArray(i) || t.column < 0 || t.column >= i.length ? y("invalid_operation", n, `Section "${t.sectionId}" has no column ${t.column}.`) : (Array.isArray(i[t.column]) || (i[t.column] = []), i[t.column]);
382
+ return !Array.isArray(i) || t.column < 0 || t.column >= i.length ? _("invalid_operation", n, `Section "${t.sectionId}" has no column ${t.column}.`) : (Array.isArray(i[t.column]) || (i[t.column] = []), i[t.column]);
397
383
  }
398
- function F(e, t, n) {
384
+ function j(e, t, n) {
399
385
  if (t === null) return 0;
400
- let r = e.findIndex((e) => b(e) && e.id === t);
401
- return r === -1 ? y("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
386
+ let r = e.findIndex((e) => v(e) && e.id === t);
387
+ return r === -1 ? _("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
402
388
  }
403
- function ye(e, t, n, r) {
404
- let i = pe(t), a = Array.isArray(e.children) ? e.children : [];
389
+ function Se(e, t, n, r) {
390
+ let i = me(t), a = Array.isArray(e.children) ? e.children : [];
405
391
  for (let e = i; e < a.length; e++) {
406
392
  let t = a[e];
407
- Array.isArray(t) && t.length > 0 && y("invalid_operation", n, `Column ${e} of section "${r}" still holds blocks, so the layout can't drop it.`);
393
+ Array.isArray(t) && t.length > 0 && _("invalid_operation", n, `Column ${e} of section "${r}" still holds blocks, so the layout can't drop it.`);
408
394
  }
409
395
  let o = a.slice(0, i);
410
396
  for (; o.length < i;) o.push([]);
411
397
  e.children = o;
412
398
  }
413
- function I(e, t, n) {
399
+ function M(e, t, n) {
414
400
  for (let [n, r] of Object.entries(t)) n === "__proto__" ? Object.defineProperty(e, n, {
415
- value: g(r),
401
+ value: p(r),
416
402
  writable: !0,
417
403
  enumerable: !0,
418
404
  configurable: !0
419
- }) : e[n] = g(r);
405
+ }) : e[n] = p(r);
420
406
  for (let t of n) delete e[t];
421
407
  }
422
- function be(e, t, n, r) {
408
+ function Ce(e, t, n, r) {
423
409
  let i = t;
424
- switch ((!b(i) || typeof i.op != "string") && y("invalid_operation", n, "Each operation must be an object with an \"op\"."), i.op) {
425
- case "addBlock": return xe(e, i, n);
426
- case "moveBlock": return Se(e, i, n, r);
427
- case "deleteBlock": return Ce(e, i, n, r);
428
- case "updateBlock": return we(e, i, n, r);
429
- case "updateSettings": return Te(e, i, n);
430
- case "setContent": return Ee(e, i, n, r);
431
- default: y("invalid_operation", n, `Unknown operation "${i.op}".`);
410
+ switch ((!v(i) || typeof i.op != "string") && _("invalid_operation", n, "Each operation must be an object with an \"op\"."), i.op) {
411
+ case "addBlock": return we(e, i, n);
412
+ case "moveBlock": return Te(e, i, n, r);
413
+ case "deleteBlock": return Ee(e, i, n, r);
414
+ case "updateBlock": return De(e, i, n, r);
415
+ case "updateSettings": return Oe(e, i, n);
416
+ case "setContent": return ke(e, i, n, r);
417
+ default: _("invalid_operation", n, `Unknown operation "${i.op}".`);
432
418
  }
433
419
  }
434
- function xe(e, t, n) {
435
- let r = D(t, n), i = O(t, n), a = t.block;
436
- j(a, n, r !== null);
437
- let o = new Set(T(S(e))), s = /* @__PURE__ */ new Set();
438
- for (let e of w(a)) (o.has(e) || s.has(e)) && y("block_exists", n, `A block with id "${e}" already exists.`, e), s.add(e);
439
- let c = P(e, r, n);
440
- c.splice(F(c, i, n), 0, g(a));
441
- }
442
- function Se(e, t, n, r) {
443
- let i = E(t, n), a = D(t, n), o = O(t, n), s = k(t, n), c = C(e, i);
444
- if (!c) return y("block_missing", n, `No block with id "${i}".`, i);
445
- if (M(r, w(c.block), n), s) {
446
- let e = c.index > 0 ? c.list[c.index - 1] : null, t = b(e) ? e.id ?? null : null;
447
- (!_(c.parent, s.parent ?? null) || !_(t, s.after ?? null)) && y("precondition_failed", n, `Block "${i}" has moved since.`, i);
420
+ function we(e, t, n) {
421
+ let r = xe(t, n), i = C(t, n), a = t.block;
422
+ E(a, n, r !== null);
423
+ let o = new Set(be(ve(e))), s = /* @__PURE__ */ new Set();
424
+ for (let e of x(a)) (o.has(e) || s.has(e)) && _("block_exists", n, `A block with id "${e}" already exists.`, e), s.add(e);
425
+ let c = A(e, r, n);
426
+ c.splice(j(c, i, n), 0, p(a));
427
+ }
428
+ function Te(e, t, n, r) {
429
+ let i = S(t, n), a = xe(t, n), o = C(t, n), s = w(t, n), c = b(e, i);
430
+ if (!c) return _("block_missing", n, `No block with id "${i}".`, i);
431
+ if (O(r, x(c.block), n), s) {
432
+ let e = c.index > 0 ? c.list[c.index - 1] : null, t = v(e) ? e.id ?? null : null;
433
+ (!m(c.parent, s.parent ?? null) || !m(t, s.after ?? null)) && _("precondition_failed", n, `Block "${i}" has moved since.`, i);
448
434
  }
449
- x(c.block) && a !== null && y("invalid_operation", n, "Sections can only be placed at the top level."), o === i && y("invalid_operation", n, "A block can't be placed after itself.");
450
- let l = P(e, a, n);
451
- c.list.splice(c.index, 1), l.splice(F(l, o, n), 0, c.block);
435
+ y(c.block) && a !== null && _("invalid_operation", n, "Sections can only be placed at the top level."), o === i && _("invalid_operation", n, "A block can't be placed after itself.");
436
+ let l = A(e, a, n);
437
+ c.list.splice(c.index, 1), l.splice(j(l, o, n), 0, c.block);
452
438
  }
453
- function Ce(e, t, n, r) {
454
- let i = E(t, n), a = k(t, n), o = C(e, i);
455
- if (!o) return y("block_missing", n, `No block with id "${i}".`, i);
456
- M(r, w(o.block), n), a && !_(o.block, a.block ?? null) && y("precondition_failed", n, `Block "${i}" has changed since.`, i), o.list.splice(o.index, 1);
457
- }
458
- function we(e, t, n, r) {
459
- let i = E(t, n), { set: a, unset: o } = A(t, n, he), s = k(t, n), c = C(e, i);
460
- if (!c) return y("block_missing", n, `No block with id "${i}".`, i);
461
- let l = c.block, u = x(l);
462
- u && o.includes("columns") && y("invalid_operation", n, "A section's columns can't be unset; set another layout instead."), M(r, [i], n), s && N(l, s, n, i), u && Object.hasOwn(a, "columns") && ye(l, a.columns, n, i), I(l, a, o);
463
- }
464
- function Te(e, t, n) {
465
- let { set: r, unset: i } = A(t, n, ge), a = k(t, n);
466
- b(e.settings) || (e.settings = {});
439
+ function Ee(e, t, n, r) {
440
+ let i = S(t, n), a = w(t, n), o = b(e, i);
441
+ if (!o) return _("block_missing", n, `No block with id "${i}".`, i);
442
+ O(r, x(o.block), n), a && !m(o.block, a.block ?? null) && _("precondition_failed", n, `Block "${i}" has changed since.`, i), o.list.splice(o.index, 1);
443
+ }
444
+ function De(e, t, n, r) {
445
+ let i = S(t, n), { set: a, unset: o } = T(t, n, ge), s = w(t, n), c = b(e, i);
446
+ if (!c) return _("block_missing", n, `No block with id "${i}".`, i);
447
+ let l = c.block, u = y(l);
448
+ u && o.includes("columns") && _("invalid_operation", n, "A section's columns can't be unset; set another layout instead."), O(r, [i], n), s && k(l, s, n, i), u && Object.hasOwn(a, "columns") && Se(l, a.columns, n, i), M(l, a, o);
449
+ }
450
+ function Oe(e, t, n) {
451
+ let { set: r, unset: i } = T(t, n, _e), a = w(t, n);
452
+ v(e.settings) || (e.settings = {});
467
453
  let o = e.settings;
468
- a && N(o, a, n), I(o, r, i);
454
+ a && k(o, a, n), M(o, r, i);
469
455
  }
470
- function Ee(e, t, n, r) {
456
+ function ke(e, t, n, r) {
471
457
  let i = t.content;
472
- if (!b(i) || !Array.isArray(i.blocks) || !b(i.settings)) return y("invalid_operation", n, "setContent needs content with a blocks array and a settings object.");
473
- let a = r.locks.find((e) => ve(r, e));
474
- a && y("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = g(i.blocks), e.settings = g(i.settings);
458
+ if (!v(i) || !Array.isArray(i.blocks) || !v(i.settings)) return _("invalid_operation", n, "setContent needs content with a blocks array and a settings object.");
459
+ let a = r.locks.find((e) => D(r, e));
460
+ a && _("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = p(i.blocks), e.settings = p(i.settings);
475
461
  }
476
- //#endregion
477
- //#region ../types/src/config.ts
478
- var De = class extends Error {
462
+ function Ae(e) {
463
+ let t = e.children;
464
+ return e.type === "section" && Array.isArray(t) ? t : [];
465
+ }
466
+ function N(e, t, n = null) {
467
+ for (let r = 0; r < e.length; r++) {
468
+ let i = e[r];
469
+ if (i.id === t) return {
470
+ block: i,
471
+ parent: n,
472
+ after: r > 0 ? e[r - 1].id : null
473
+ };
474
+ let a = Ae(i);
475
+ for (let e = 0; e < a.length; e++) {
476
+ if (!Array.isArray(a[e])) continue;
477
+ let n = N(a[e], t, {
478
+ sectionId: i.id,
479
+ column: e
480
+ });
481
+ if (n) return n;
482
+ }
483
+ }
484
+ return null;
485
+ }
486
+ function P(e, t, n) {
487
+ let r = N(e.blocks, t);
488
+ if (!r) throw new h("block_missing", n, `No block with id "${t}".`, t);
489
+ return r;
490
+ }
491
+ function F(e, t, n) {
492
+ let r = {}, i = [], a = {}, o = [.../* @__PURE__ */ new Set([...Object.keys(t ?? {}), ...n ?? []])];
493
+ for (let n of o) {
494
+ let o = e[n];
495
+ o === void 0 ? i.push(n) : r[n] = p(o);
496
+ let s = t && n in t ? t[n] : void 0;
497
+ a[n] = s === void 0 ? null : p(s);
498
+ }
499
+ return {
500
+ set: r,
501
+ unset: i,
502
+ expect: a
503
+ };
504
+ }
505
+ function je(e, t, n) {
506
+ switch (t.op) {
507
+ case "addBlock": return {
508
+ op: "deleteBlock",
509
+ blockId: t.block.id,
510
+ expect: { block: p(t.block) }
511
+ };
512
+ case "deleteBlock": {
513
+ let r = P(e, t.blockId, n);
514
+ return {
515
+ op: "addBlock",
516
+ block: p(r.block),
517
+ parent: r.parent,
518
+ after: r.after
519
+ };
520
+ }
521
+ case "moveBlock": {
522
+ let r = P(e, t.blockId, n);
523
+ return {
524
+ op: "moveBlock",
525
+ blockId: t.blockId,
526
+ parent: r.parent,
527
+ after: r.after,
528
+ expect: {
529
+ parent: t.parent,
530
+ after: t.after
531
+ }
532
+ };
533
+ }
534
+ case "updateBlock": {
535
+ let r = P(e, t.blockId, n).block, { set: i, unset: a, expect: o } = F(r, t.set, t.unset);
536
+ return {
537
+ op: "updateBlock",
538
+ blockId: t.blockId,
539
+ ...Object.keys(i).length > 0 ? { set: i } : {},
540
+ ...a.length > 0 ? { unset: a } : {},
541
+ expect: o
542
+ };
543
+ }
544
+ case "updateSettings": {
545
+ let { set: n, unset: r, expect: i } = F(e.settings, t.set, t.unset);
546
+ return {
547
+ op: "updateSettings",
548
+ ...Object.keys(n).length > 0 ? { set: n } : {},
549
+ ...r.length > 0 ? { unset: r } : {},
550
+ expect: i
551
+ };
552
+ }
553
+ case "setContent": return {
554
+ op: "setContent",
555
+ content: {
556
+ blocks: p(e.blocks),
557
+ settings: p(e.settings)
558
+ }
559
+ };
560
+ }
561
+ }
562
+ function Me(e, t) {
563
+ let n = p(e), r = [];
564
+ return t.forEach((e, t) => {
565
+ r.push(je(n, e, t));
566
+ try {
567
+ g(n, [e]);
568
+ } catch (e) {
569
+ throw e instanceof h ? new h(e.code, t, e.message, e.blockId) : e;
570
+ }
571
+ }), r.reverse();
572
+ }
573
+ var Ne = class extends Error {
479
574
  statusCode;
480
575
  code;
481
- constructor(e, t, n) {
482
- super(e), this.statusCode = t, this.code = n, this.name = "SdkError";
576
+ constructor(e, t, n, r) {
577
+ super(e), this.statusCode = t, this.code = n, this.name = "SdkError", r !== void 0 && Object.keys(r).length > 0 && (this.details = r);
483
578
  }
484
579
  get isNotFound() {
485
580
  return this.statusCode === 404;
@@ -491,65 +586,39 @@ var De = class extends Error {
491
586
  return this.statusCode !== void 0 && this.statusCode >= 500;
492
587
  }
493
588
  };
494
- //#endregion
495
- //#region ../types/src/guards.ts
496
- function L(e) {
497
- return e.type === "section";
498
- }
499
- function Oe(e) {
500
- return e.type === "title";
501
- }
502
- function ke(e) {
503
- return e.type === "paragraph";
504
- }
505
- function Ae(e) {
506
- return e.type === "image";
507
- }
508
- function je(e) {
509
- return e.type === "button";
510
- }
511
- function Me(e) {
512
- return e.type === "divider";
513
- }
514
- function Ne(e) {
515
- return e.type === "video";
516
- }
517
589
  function Pe(e) {
518
- return e.type === "social";
590
+ return e === "invalid_operation" ? 422 : e === "content_too_large" ? 413 : 409;
519
591
  }
520
- function Fe(e) {
521
- return e.type === "spacer";
592
+ var Fe = class extends Ne {
593
+ opIndex;
594
+ holder;
595
+ holders;
596
+ constructor(e, t) {
597
+ super(e, t.status ?? Pe(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);
598
+ }
599
+ };
600
+ function I(e) {
601
+ return e.type === "section";
522
602
  }
523
603
  function Ie(e) {
524
- return e.type === "html";
525
- }
526
- function Le(e) {
527
- return e.type === "menu";
528
- }
529
- function Re(e) {
530
- return e.type === "table";
531
- }
532
- function ze(e) {
533
604
  return e.type === "custom";
534
605
  }
535
- function R(e) {
606
+ function L(e) {
536
607
  return e.type === "slot";
537
608
  }
538
- function z(e) {
609
+ function R(e) {
539
610
  return e.type === "wrapper";
540
611
  }
541
- //#endregion
542
- //#region ../types/src/defaults.ts
543
- var Be = {
612
+ var Le = {
544
613
  content: "<p>Enter your title</p>",
545
614
  level: 2,
546
615
  textAlign: "left"
547
- }, Ve = { content: "<p>Enter your text here</p>" }, He = {
616
+ }, Re = { content: "<p>Enter your text here</p>" }, ze = {
548
617
  src: "",
549
618
  alt: "",
550
619
  width: "full",
551
620
  align: "center"
552
- }, Ue = {
621
+ }, Be = {
553
622
  text: "Click Here",
554
623
  url: "",
555
624
  backgroundColor: "#333333",
@@ -563,36 +632,36 @@ var Be = {
563
632
  left: 24
564
633
  },
565
634
  align: "center"
566
- }, We = {
635
+ }, Ve = {
567
636
  lineStyle: "solid",
568
637
  color: "#e0e0e0",
569
638
  thickness: 1,
570
639
  width: "full"
571
- }, Ge = { columns: "1" }, Ke = {
640
+ }, He = { columns: "1" }, Ue = {
572
641
  url: "",
573
642
  thumbnailUrl: "",
574
643
  alt: "Video",
575
644
  width: "full",
576
645
  align: "center"
577
- }, qe = {
646
+ }, We = {
578
647
  iconStyle: "solid",
579
648
  iconSize: "medium",
580
649
  spacing: 10,
581
650
  align: "center"
582
- }, Je = { height: 24 }, Ye = { content: "" }, Xe = {
651
+ }, Ge = { height: 24 }, Ke = { content: "" }, qe = {
583
652
  fontSize: 15,
584
653
  textAlign: "center",
585
654
  separator: "|",
586
655
  separatorColor: "#e0e0e0",
587
656
  spacing: 10
588
- }, Ze = {
657
+ }, Je = {
589
658
  hasHeaderRow: !0,
590
659
  borderColor: "#e0e0e0",
591
660
  borderWidth: 1,
592
661
  cellPadding: 8,
593
662
  fontSize: 15,
594
663
  textAlign: "left"
595
- }, Qe = {
664
+ }, z = {
596
665
  targetDate: "",
597
666
  timezone: "UTC",
598
667
  showDays: !0,
@@ -612,21 +681,21 @@ var Be = {
612
681
  expiredMessage: "This offer has expired",
613
682
  expiredImageUrl: "",
614
683
  hideOnExpiry: !1
615
- }, $e = {
616
- title: Be,
617
- paragraph: Ve,
618
- image: He,
619
- button: Ue,
620
- divider: We,
621
- section: Ge,
622
- video: Ke,
623
- social: qe,
624
- spacer: Je,
625
- html: Ye,
626
- menu: Xe,
627
- table: Ze,
628
- countdown: Qe
629
- }, et = {
684
+ }, Ye = {
685
+ title: Le,
686
+ paragraph: Re,
687
+ image: ze,
688
+ button: Be,
689
+ divider: Ve,
690
+ section: He,
691
+ video: Ue,
692
+ social: We,
693
+ spacer: Ge,
694
+ html: Ke,
695
+ menu: qe,
696
+ table: Je,
697
+ countdown: z
698
+ }, Xe = {
630
699
  width: 600,
631
700
  backgroundColor: "#ffffff",
632
701
  textColor: "#1a1a1a",
@@ -634,32 +703,28 @@ var Be = {
634
703
  fontFamily: "Arial",
635
704
  locale: "en"
636
705
  };
637
- function tt(e) {
706
+ function Ze(e) {
638
707
  return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
639
708
  }
640
709
  function B(e, t) {
641
710
  let n = { ...e };
642
711
  for (let r of Object.keys(t)) {
643
712
  let i = e[r], a = t[r];
644
- a !== void 0 && (n[r] = tt(i) && tt(a) ? B(i, a) : a);
713
+ a !== void 0 && (n[r] = Ze(i) && Ze(a) ? B(i, a) : a);
645
714
  }
646
715
  return n;
647
716
  }
648
- //#endregion
649
- //#region ../types/src/template.ts
650
- function nt(e = "Arial", t) {
717
+ function Qe(e = "Arial", t) {
651
718
  return {
652
719
  blocks: [],
653
720
  settings: {
654
- ...et,
721
+ ...Xe,
655
722
  fontFamily: e,
656
723
  ...t
657
724
  }
658
725
  };
659
726
  }
660
- //#endregion
661
- //#region ../types/src/direction.ts
662
- var rt = [
727
+ var $e = [
663
728
  "ar",
664
729
  "he",
665
730
  "iw",
@@ -673,26 +738,24 @@ var rt = [
673
738
  "ckb",
674
739
  "ks"
675
740
  ];
676
- function it(e) {
741
+ function et(e) {
677
742
  let t = e?.trim().replace(/_/g, "-").split("-")[0]?.toLowerCase();
678
- return !!t && rt.includes(t);
743
+ return !!t && $e.includes(t);
679
744
  }
680
- function at(e) {
681
- return e.direction === "ltr" || e.direction === "rtl" ? e.direction : it(e.locale) ? "rtl" : "ltr";
745
+ function tt(e) {
746
+ return e.direction === "ltr" || e.direction === "rtl" ? e.direction : et(e.locale) ? "rtl" : "ltr";
682
747
  }
683
- //#endregion
684
- //#region ../types/src/factory.ts
685
748
  function V(e, t) {
686
- let n = g(e);
749
+ let n = p(e);
687
750
  return !t || Object.keys(t).length === 0 ? n : B(n, t);
688
751
  }
689
752
  function H(e) {
690
- return e === void 0 ? void 0 : g(e);
753
+ return e === void 0 ? void 0 : p(e);
691
754
  }
692
755
  function U() {
693
756
  return crypto.randomUUID();
694
757
  }
695
- function ot(e = 0) {
758
+ function nt(e = 0) {
696
759
  return {
697
760
  top: e,
698
761
  right: e,
@@ -701,100 +764,100 @@ function ot(e = 0) {
701
764
  };
702
765
  }
703
766
  function W(e = 10) {
704
- return { padding: ot(e) };
767
+ return { padding: nt(e) };
705
768
  }
706
- function st(e = {}) {
769
+ function rt(e = {}) {
707
770
  return V({
708
771
  id: U(),
709
772
  type: "title",
710
- ...Be,
773
+ ...Le,
711
774
  styles: W()
712
775
  }, e);
713
776
  }
714
- function ct(e = {}) {
777
+ function it(e = {}) {
715
778
  return V({
716
779
  id: U(),
717
780
  type: "paragraph",
718
- ...Ve,
781
+ ...Re,
719
782
  styles: W()
720
783
  }, e);
721
784
  }
722
- function lt(e = {}) {
785
+ function at(e = {}) {
723
786
  return V({
724
787
  id: U(),
725
788
  type: "image",
726
- ...He,
789
+ ...ze,
727
790
  styles: W()
728
791
  }, e);
729
792
  }
730
- function ut(e = {}) {
793
+ function ot(e = {}) {
731
794
  return V({
732
795
  id: U(),
733
796
  type: "button",
734
- ...Ue,
797
+ ...Be,
735
798
  styles: W()
736
799
  }, e);
737
800
  }
738
- function dt(e = {}) {
801
+ function st(e = {}) {
739
802
  return V({
740
803
  id: U(),
741
804
  type: "divider",
742
- ...We,
805
+ ...Ve,
743
806
  styles: W(20)
744
807
  }, e);
745
808
  }
746
- function ft(e = {}) {
809
+ function ct(e = {}) {
747
810
  return V({
748
811
  id: U(),
749
812
  type: "section",
750
- ...Ge,
813
+ ...He,
751
814
  children: [[]],
752
815
  styles: W(20)
753
816
  }, e);
754
817
  }
755
- function pt(e = {}) {
818
+ function lt(e = {}) {
756
819
  return V({
757
820
  id: U(),
758
821
  type: "video",
759
- ...Ke,
822
+ ...Ue,
760
823
  styles: W()
761
824
  }, e);
762
825
  }
763
- function mt(e = {}) {
826
+ function ut(e = {}) {
764
827
  return V({
765
828
  id: U(),
766
829
  type: "social",
767
830
  icons: [],
768
- ...qe,
831
+ ...We,
769
832
  styles: W()
770
833
  }, e);
771
834
  }
772
- function ht(e = {}) {
835
+ function dt(e = {}) {
773
836
  return V({
774
837
  id: U(),
775
838
  type: "spacer",
776
- ...Je,
839
+ ...Ge,
777
840
  styles: W(0)
778
841
  }, e);
779
842
  }
780
- function gt(e = {}) {
843
+ function ft(e = {}) {
781
844
  return V({
782
845
  id: U(),
783
846
  type: "html",
784
- ...Ye,
847
+ ...Ke,
785
848
  styles: W()
786
849
  }, e);
787
850
  }
788
- function _t(e = {}) {
851
+ function pt(e = {}) {
789
852
  return V({
790
853
  id: U(),
791
854
  type: "menu",
792
855
  items: [],
793
- ...Xe,
856
+ ...qe,
794
857
  styles: W()
795
858
  }, e);
796
859
  }
797
- function vt(e, t) {
860
+ function mt(e, t) {
798
861
  return Array.from({ length: t }, () => ({
799
862
  id: U(),
800
863
  cells: Array.from({ length: e }, () => ({
@@ -803,29 +866,29 @@ function vt(e, t) {
803
866
  }))
804
867
  }));
805
868
  }
806
- function yt(e = {}) {
869
+ function ht(e = {}) {
807
870
  return V({
808
871
  id: U(),
809
872
  type: "table",
810
- rows: vt(3, 3),
811
- ...Ze,
873
+ rows: mt(3, 3),
874
+ ...Je,
812
875
  styles: W()
813
876
  }, e);
814
877
  }
815
- function bt(e = {}) {
878
+ function gt(e = {}) {
816
879
  return V({
817
880
  id: U(),
818
881
  type: "countdown",
819
- ...Qe,
882
+ ...z,
820
883
  styles: W()
821
884
  }, e);
822
885
  }
823
- function xt(e) {
886
+ function _t(e) {
824
887
  return e.type === "repeatable" ? e.default ?? [] : e.type === "boolean" ? e.default ?? !1 : e.type === "number" ? e.default ?? 0 : e.default ?? "";
825
888
  }
826
- function St(e) {
889
+ function vt(e) {
827
890
  let t = {};
828
- for (let n of e.fields) t[n.key] = H(xt(n));
891
+ for (let n of e.fields) t[n.key] = H(_t(n));
829
892
  let n = V(W(), H(e.defaultStyles));
830
893
  return {
831
894
  id: U(),
@@ -836,14 +899,14 @@ function St(e) {
836
899
  ...e.dataSource ? { dataSourceFetched: !1 } : {}
837
900
  };
838
901
  }
839
- function Ct() {
902
+ function yt() {
840
903
  return {
841
904
  id: U(),
842
905
  type: "slot",
843
906
  styles: W(0)
844
907
  };
845
908
  }
846
- function wt(e = {}) {
909
+ function bt(e = {}) {
847
910
  return V({
848
911
  id: U(),
849
912
  type: "wrapper",
@@ -851,21 +914,21 @@ function wt(e = {}) {
851
914
  styles: W(0)
852
915
  }, e);
853
916
  }
854
- function Tt(e, t) {
917
+ function xt(e, t) {
855
918
  switch (e) {
856
- case "section": return ft(H(t?.section));
857
- case "title": return st(H(t?.title));
858
- case "paragraph": return ct(H(t?.paragraph));
859
- case "image": return lt(H(t?.image));
860
- case "button": return ut(H(t?.button));
861
- case "divider": return dt(H(t?.divider));
862
- case "video": return pt(H(t?.video));
863
- case "social": return mt(H(t?.social));
864
- case "spacer": return ht(H(t?.spacer));
865
- case "html": return gt(H(t?.html));
866
- case "menu": return _t(H(t?.menu));
867
- case "table": return yt(H(t?.table));
868
- case "countdown": return bt(H(t?.countdown));
919
+ case "section": return ct(H(t?.section));
920
+ case "title": return rt(H(t?.title));
921
+ case "paragraph": return it(H(t?.paragraph));
922
+ case "image": return at(H(t?.image));
923
+ case "button": return ot(H(t?.button));
924
+ case "divider": return st(H(t?.divider));
925
+ case "video": return lt(H(t?.video));
926
+ case "social": return ut(H(t?.social));
927
+ case "spacer": return dt(H(t?.spacer));
928
+ case "html": return ft(H(t?.html));
929
+ case "menu": return pt(H(t?.menu));
930
+ case "table": return ht(H(t?.table));
931
+ case "countdown": return gt(H(t?.countdown));
869
932
  case "slot": throw Error("[Templatical] slot cannot be inserted into content. Use createSlotBlock() to build a layout.");
870
933
  case "wrapper": throw Error("[Templatical] wrapper cannot be inserted into content. Use createWrapperBlock() to build a layout.");
871
934
  default: throw Error(`Unknown block type: ${e}`);
@@ -881,103 +944,99 @@ function G(e) {
881
944
  if (t.type === "social") for (let e of t.icons) e.id = U();
882
945
  return t.type === "section" && (t.children = t.children.map((e) => e.map((e) => G(e)))), t.type === "wrapper" && (t.children = t.children.map((e) => G(e))), t;
883
946
  }
884
- //#endregion
885
- //#region ../types/src/layout.ts
886
- var Et = "[Templatical] layout: must contain exactly one slot block", Dt = "[Templatical] layout: slot must be a top-level or wrapper child, not nested in a section", Ot = "[Templatical] layout: a wrapper cannot contain a wrapper", kt = "[Templatical] layout: a wrapper around the slot cannot contain blocks that emit mj-wrapper (section.wrapper)", At = "[Templatical] slot is not a valid content block", jt = "[Templatical] wrapper is not a valid content block";
947
+ var St = "[Templatical] layout: must contain exactly one slot block", Ct = "[Templatical] layout: slot must be a top-level or wrapper child, not nested in a section", wt = "[Templatical] layout: a wrapper cannot contain a wrapper", Tt = "[Templatical] layout: a wrapper around the slot cannot contain blocks that emit mj-wrapper (section.wrapper)", Et = "[Templatical] slot is not a valid content block", Dt = "[Templatical] wrapper is not a valid content block";
887
948
  function K(e, t, n = null, r = !1) {
888
- for (let i of e) if (t(i, n, r), L(i)) for (let e of i.children) K(e, t, i, !0);
889
- else z(i) && K(i.children, t, i, r);
949
+ for (let i of e) if (t(i, n, r), I(i)) for (let e of i.children) K(e, t, i, !0);
950
+ else R(i) && K(i.children, t, i, r);
890
951
  }
891
- function Mt(e) {
952
+ function Ot(e) {
892
953
  let t = 0;
893
954
  if (K(e.blocks, (e, n, r) => {
894
- if (R(e) && (t += 1, r)) throw Error(Dt);
895
- if (z(e)) {
896
- if (r) throw Error(Dt);
897
- if (e.children.some(z)) throw Error(Ot);
955
+ if (L(e) && (t += 1, r)) throw Error(Ct);
956
+ if (R(e)) {
957
+ if (r) throw Error(Ct);
958
+ if (e.children.some(R)) throw Error(wt);
898
959
  }
899
- }), t !== 1) throw Error(Et);
960
+ }), t !== 1) throw Error(St);
900
961
  }
901
- function Nt(e) {
962
+ function kt(e) {
902
963
  K(e.blocks, (e) => {
903
- if (R(e)) throw Error(At);
964
+ if (L(e)) throw Error(Et);
904
965
  });
905
966
  }
906
- function Pt(e) {
967
+ function At(e) {
907
968
  K(e.blocks, (e) => {
908
- if (z(e)) throw Error(jt);
969
+ if (R(e)) throw Error(Dt);
909
970
  });
910
971
  }
911
- function Ft(e) {
972
+ function jt(e) {
912
973
  let t = !1;
913
974
  return K(e.blocks, (e, n) => {
914
- R(e) && n !== null && z(n) && (t = !0);
975
+ L(e) && n !== null && R(n) && (t = !0);
915
976
  }), t;
916
977
  }
917
- function It(e) {
918
- if (R(e)) return e;
919
- if (z(e)) {
978
+ function Mt(e) {
979
+ if (L(e)) return e;
980
+ if (R(e)) {
920
981
  let t = G({
921
982
  ...e,
922
983
  children: []
923
984
  });
924
- return t.children = e.children.map(It), t;
985
+ return t.children = e.children.map(Mt), t;
925
986
  }
926
987
  return G(e);
927
988
  }
928
- function Lt(e) {
989
+ function Nt(e) {
929
990
  for (let t = 0; t < e.length; t++) {
930
991
  let n = e[t];
931
- if (R(n)) return {
992
+ if (L(n)) return {
932
993
  parent: e,
933
994
  index: t
934
995
  };
935
- if (z(n)) {
936
- let e = Lt(n.children);
996
+ if (R(n)) {
997
+ let e = Nt(n.children);
937
998
  if (e) return e;
938
999
  }
939
1000
  }
940
1001
  return null;
941
1002
  }
942
- function Rt(e) {
943
- for (let t of e) if (L(t)) {
1003
+ function Pt(e) {
1004
+ for (let t of e) if (I(t)) {
944
1005
  if (t.wrapper) return !0;
945
- for (let e of t.children) if (Rt(e)) return !0;
1006
+ for (let e of t.children) if (Pt(e)) return !0;
946
1007
  }
947
1008
  return !1;
948
1009
  }
949
- function zt(e, t) {
950
- if (Mt(e), Nt(t), Pt(t), Ft(e) && Rt(t.blocks)) throw Error(kt);
951
- let n = e.blocks.map(It), r = Lt(n);
952
- if (!r) throw Error(Et);
953
- return r.parent.splice(r.index, 1, ...g(t.blocks)), {
1010
+ function Ft(e, t) {
1011
+ if (Ot(e), kt(t), At(t), jt(e) && Pt(t.blocks)) throw Error(Tt);
1012
+ let n = e.blocks.map(Mt), r = Nt(n);
1013
+ if (!r) throw Error(St);
1014
+ return r.parent.splice(r.index, 1, ...p(t.blocks)), {
954
1015
  blocks: n,
955
1016
  settings: {
956
- ...g(t.settings),
1017
+ ...p(t.settings),
957
1018
  backgroundColor: e.settings.backgroundColor
958
1019
  }
959
1020
  };
960
1021
  }
961
- //#endregion
962
- //#region ../types/src/html-scan.ts
963
- var Bt = /* @__PURE__ */ new Set(["\"", "'"]);
964
- function Vt(e, t) {
1022
+ var It = /* @__PURE__ */ new Set(["\"", "'"]);
1023
+ function Lt(e, t) {
965
1024
  let n = null;
966
1025
  for (let r = t; r < e.length; r++) {
967
1026
  let t = e[r];
968
1027
  if (n !== null) t === n && (n = null);
969
- else if (Bt.has(t)) n = t;
1028
+ else if (It.has(t)) n = t;
970
1029
  else if (t === ">") return r;
971
1030
  }
972
1031
  return -1;
973
1032
  }
974
- function Ht(e) {
1033
+ function Rt(e) {
975
1034
  return e !== " " && e !== " " && e !== "\n" && e !== "\r" && e !== "\f" && e !== "=" && e !== ">" && e !== "/";
976
1035
  }
977
1036
  function q(e) {
978
1037
  return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
979
1038
  }
980
- var Ut = {
1039
+ var zt = {
981
1040
  amp: "&",
982
1041
  lt: "<",
983
1042
  gt: ">",
@@ -985,22 +1044,22 @@ var Ut = {
985
1044
  apos: "'",
986
1045
  nbsp: "\xA0"
987
1046
  };
988
- function Wt(e) {
1047
+ function Bt(e) {
989
1048
  return e.includes("&") ? e.replace(/&(#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g, (e, t) => {
990
1049
  if (t[0] === "#") {
991
1050
  let n = t[1] === "x" || t[1] === "X" ? Number.parseInt(t.slice(2), 16) : Number.parseInt(t.slice(1), 10);
992
1051
  return !Number.isFinite(n) || n < 1 || n > 1114111 || n >= 55296 && n <= 57343 ? e : String.fromCodePoint(n);
993
1052
  }
994
- return Ut[t.toLowerCase()] ?? e;
1053
+ return zt[t.toLowerCase()] ?? e;
995
1054
  }) : e;
996
1055
  }
997
- function Gt(e, t) {
1056
+ function Vt(e, t) {
998
1057
  let n = t.toLowerCase(), r = 0;
999
1058
  for (; r < e.length;) {
1000
1059
  for (; r < e.length && (q(e[r]) || e[r] === "/");) r++;
1001
1060
  if (r >= e.length) break;
1002
1061
  let t = r;
1003
- for (; r < e.length && Ht(e[r]);) r++;
1062
+ for (; r < e.length && Rt(e[r]);) r++;
1004
1063
  let i = e.substring(t, r).toLowerCase();
1005
1064
  if (i === "") {
1006
1065
  r++;
@@ -1010,31 +1069,27 @@ function Gt(e, t) {
1010
1069
  if (e[r] !== "=") continue;
1011
1070
  for (r++; r < e.length && q(e[r]);) r++;
1012
1071
  let a = e[r];
1013
- if (Bt.has(a)) {
1072
+ if (It.has(a)) {
1014
1073
  let t = r + 1, o = e.indexOf(a, t);
1015
1074
  if (o === -1) return null;
1016
- if (i === n) return Wt(e.substring(t, o));
1075
+ if (i === n) return Bt(e.substring(t, o));
1017
1076
  r = o + 1;
1018
1077
  continue;
1019
1078
  }
1020
1079
  let o = r;
1021
1080
  for (; r < e.length && !q(e[r]) && e[r] !== ">";) r++;
1022
- if (i === n) return Wt(e.substring(o, r));
1081
+ if (i === n) return Bt(e.substring(o, r));
1023
1082
  }
1024
1083
  return null;
1025
1084
  }
1026
- //#endregion
1027
- //#region ../types/src/rich-text.ts
1028
- var Kt = /<\/?p\b[^<>]*>/gi, qt = /<p\b([^<>]*)>\s*<\/p>/gi;
1029
- function Jt(e) {
1030
- return e.replace(Kt, "").trim() === "";
1085
+ var Ht = /<\/?p\b[^<>]*>/gi, Ut = /<p\b([^<>]*)>\s*<\/p>/gi;
1086
+ function Wt(e) {
1087
+ return e.replace(Ht, "").trim() === "";
1031
1088
  }
1032
- function Yt(e) {
1033
- return Jt(e) ? e : e.replace(qt, "<p$1>&nbsp;</p>");
1089
+ function Gt(e) {
1090
+ return Wt(e) ? e : e.replace(Ut, "<p$1>&nbsp;</p>");
1034
1091
  }
1035
- //#endregion
1036
- //#region ../types/src/fonts.ts
1037
- var Xt = {
1092
+ var Kt = {
1038
1093
  arial: "Arial, sans-serif",
1039
1094
  helvetica: "Helvetica, sans-serif",
1040
1095
  georgia: "Georgia, serif",
@@ -1043,13 +1098,13 @@ var Xt = {
1043
1098
  "trebuchet ms": "'Trebuchet MS', sans-serif",
1044
1099
  "courier new": "'Courier New', monospace",
1045
1100
  tahoma: "Tahoma, sans-serif"
1046
- }, Zt = /* @__PURE__ */ new Set([
1101
+ }, qt = /* @__PURE__ */ new Set([
1047
1102
  "inherit",
1048
1103
  "initial",
1049
1104
  "unset",
1050
1105
  "revert",
1051
1106
  "revert-layer"
1052
- ]), Qt = /* @__PURE__ */ new Set([
1107
+ ]), Jt = /* @__PURE__ */ new Set([
1053
1108
  "serif",
1054
1109
  "sans-serif",
1055
1110
  "monospace",
@@ -1064,14 +1119,14 @@ var Xt = {
1064
1119
  "math",
1065
1120
  "fangsong"
1066
1121
  ]);
1067
- function $t(e) {
1122
+ function Yt(e) {
1068
1123
  return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
1069
1124
  }
1070
1125
  function J(e) {
1071
1126
  if (typeof e != "string") return [];
1072
1127
  let t = e.replace(/!\s*important\s*$/i, ""), n = [], r = 0;
1073
1128
  for (;;) {
1074
- for (; r < t.length && $t(t[r]);) r++;
1129
+ for (; r < t.length && Yt(t[r]);) r++;
1075
1130
  if (r >= t.length) return [];
1076
1131
  let e = t[r];
1077
1132
  if (e === "\"" || e === "'") {
@@ -1088,7 +1143,7 @@ function J(e) {
1088
1143
  }
1089
1144
  }
1090
1145
  if (!o) return [];
1091
- for (; a < t.length && $t(t[a]);) a++;
1146
+ for (; a < t.length && Yt(t[a]);) a++;
1092
1147
  if (a < t.length && t[a] !== ",") return [];
1093
1148
  n.push({
1094
1149
  name: i,
@@ -1096,7 +1151,7 @@ function J(e) {
1096
1151
  }), r = a;
1097
1152
  } else {
1098
1153
  let e = t.indexOf(",", r), i = e === -1 ? t.length : e, a = t.slice(r, i).trim().split(/\s+/).join(" ");
1099
- if (a === "" || a.includes("\"") || a.includes("'") || Zt.has(a.toLowerCase())) return [];
1154
+ if (a === "" || a.includes("\"") || a.includes("'") || qt.has(a.toLowerCase())) return [];
1100
1155
  n.push({
1101
1156
  name: a,
1102
1157
  quoted: !1
@@ -1106,69 +1161,69 @@ function J(e) {
1106
1161
  r++;
1107
1162
  }
1108
1163
  }
1109
- function en(e) {
1164
+ function Xt(e) {
1110
1165
  return `'${e.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
1111
1166
  }
1112
- function tn(e) {
1113
- return !e.quoted && Qt.has(e.name.toLowerCase());
1167
+ function Zt(e) {
1168
+ return !e.quoted && Jt.has(e.name.toLowerCase());
1114
1169
  }
1115
- function nn(e) {
1170
+ function Qt(e) {
1116
1171
  return J(e)[0]?.name ?? "";
1117
1172
  }
1118
- function rn(e, t) {
1119
- let n = (e) => `${en(e.name)}, ${e.fallback ?? t.defaultFallback}`, r = typeof e == "string" ? e.trim().toLowerCase() : "", i = t.customFonts.find((e) => e.name.toLowerCase() === r);
1173
+ function $t(e, t) {
1174
+ let n = (e) => `${Xt(e.name)}, ${e.fallback ?? t.defaultFallback}`, r = typeof e == "string" ? e.trim().toLowerCase() : "", i = t.customFonts.find((e) => e.name.toLowerCase() === r);
1120
1175
  if (i) return n(i);
1121
1176
  let a = J(e);
1122
1177
  if (a.length !== 1) return e;
1123
1178
  let [o] = a, s = o.name.toLowerCase(), c = t.customFonts.find((e) => e.name.toLowerCase() === s);
1124
- return c ? n(c) : Xt[s] || (tn(o) ? e : `${en(o.name)}, ${t.defaultFallback}`);
1179
+ return c ? n(c) : Kt[s] || (Zt(o) ? e : `${Xt(o.name)}, ${t.defaultFallback}`);
1125
1180
  }
1126
- //#endregion
1127
- //#region ../types/src/merge-tags.ts
1128
1181
  var Y = {
1129
1182
  liquid: {
1130
1183
  value: /\{\{.+?\}\}/g,
1131
- logic: /\{%-?\s*(\w+).*?-?%\}/g
1184
+ logic: /\{%-?\s*(\w+).*?-?%\}/g,
1185
+ opener: "{{",
1186
+ closer: "}}"
1132
1187
  },
1133
1188
  handlebars: {
1134
1189
  value: /\{\{\{?.+?\}?\}\}/g,
1135
- logic: /\{\{[#/](\w+).*?\}\}/g
1190
+ logic: /\{\{[#/](\w+).*?\}\}/g,
1191
+ opener: "{{",
1192
+ closer: "}}"
1136
1193
  },
1137
1194
  mailchimp: {
1138
1195
  value: /\*\|\w+\|\*/g,
1139
- logic: /\*\|(\w+)[:|].*?\|\*/g
1196
+ logic: /\*\|(\w+)[:|].*?\|\*/g,
1197
+ opener: "*|",
1198
+ closer: "|*"
1140
1199
  },
1141
1200
  ampscript: {
1142
1201
  value: /%%=.+?=%%/g,
1143
- logic: /%%\[\s*(\w+).*?\]%%/g
1202
+ logic: /%%\[\s*(\w+).*?\]%%/g,
1203
+ opener: "%%=",
1204
+ closer: "=%%"
1144
1205
  }
1145
- }, an = {
1146
- liquid: "{{",
1147
- handlebars: "{{",
1148
- mailchimp: "*|",
1149
- ampscript: "%%="
1150
- }, on = {
1151
- liquid: "}}",
1152
- handlebars: "}}",
1153
- mailchimp: "|*",
1154
- ampscript: "=%%"
1155
1206
  };
1156
- function sn(e) {
1157
- for (let t of Object.keys(Y)) if (Y[t].value.source === e.value.source) return an[t];
1158
- return null;
1207
+ function en(e) {
1208
+ return typeof e == "string" && e.trim() !== "" ? e : null;
1159
1209
  }
1160
- function cn(e) {
1161
- for (let t of Object.keys(Y)) if (Y[t].value.source === e.value.source) return on[t];
1162
- return null;
1210
+ function tn(e) {
1211
+ return Object.values(Y).find((t) => t.value.source === e.value.source) ?? null;
1163
1212
  }
1164
- function ln(e) {
1213
+ function nn(e) {
1214
+ return en(e.opener) ?? tn(e)?.opener ?? null;
1215
+ }
1216
+ function rn(e) {
1217
+ return en(e.closer) ?? tn(e)?.closer ?? null;
1218
+ }
1219
+ function an(e) {
1165
1220
  return e ? typeof e == "string" ? Y[e] ?? Y.liquid : e : Y.liquid;
1166
1221
  }
1167
1222
  function X(e) {
1168
1223
  let t = e.source, n = e.flags.replace("g", "");
1169
1224
  return RegExp(`^${t}$`, n);
1170
1225
  }
1171
- function un(e, t) {
1226
+ function on(e, t) {
1172
1227
  let n = e?.trim() || "";
1173
1228
  return !X(t.logic).test(n) && X(t.value).test(n);
1174
1229
  }
@@ -1176,41 +1231,41 @@ function Z(e, t) {
1176
1231
  let n = t.find((t) => t.value === e);
1177
1232
  return n ? n.label : e;
1178
1233
  }
1179
- function dn(e, t) {
1234
+ function sn(e, t) {
1180
1235
  return $(e, "data-merge-tag", (e) => Z(e, t));
1181
1236
  }
1182
1237
  function Q(e, t) {
1183
1238
  return t.find((t) => t.value === e)?.sample;
1184
1239
  }
1185
- function fn(e, t) {
1186
- return $(e, "data-merge-tag", (e) => hn(Q(e, t) ?? Z(e, t)), { unwrap: (e) => Q(e, t) !== void 0 });
1240
+ function cn(e, t) {
1241
+ return $(e, "data-merge-tag", (e) => dn(Q(e, t) ?? Z(e, t)), { unwrap: (e) => Q(e, t) !== void 0 });
1187
1242
  }
1188
- function pn(e) {
1243
+ function ln(e) {
1189
1244
  return e.some((e) => e.sample !== void 0);
1190
1245
  }
1191
- function mn(e, t) {
1246
+ function un(e, t) {
1192
1247
  if (!e) return e;
1193
1248
  let n = e;
1194
1249
  for (let e of t) e.sample !== void 0 && (n = n.split(e.value).join(e.sample));
1195
1250
  return n;
1196
1251
  }
1197
- function hn(e) {
1252
+ function dn(e) {
1198
1253
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1199
1254
  }
1200
- function gn(e, t) {
1255
+ function fn(e, t) {
1201
1256
  if (!e) return !1;
1202
1257
  let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
1203
1258
  return n.test(e) || r.test(e);
1204
1259
  }
1205
- function _n(e, t) {
1260
+ function pn(e, t) {
1206
1261
  return X(t.logic).test(e?.trim() || "");
1207
1262
  }
1208
- function vn(e, t) {
1263
+ function mn(e, t) {
1209
1264
  let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
1210
1265
  return r && r[1] ? r[1].toUpperCase() : e;
1211
1266
  }
1212
- function yn(e, t) {
1213
- return $(e, "data-logic-merge-tag", (e) => vn(e, t));
1267
+ function hn(e, t) {
1268
+ return $(e, "data-logic-merge-tag", (e) => mn(e, t));
1214
1269
  }
1215
1270
  function $(e, t, n, r) {
1216
1271
  let i = "", a = 0;
@@ -1225,7 +1280,7 @@ function $(e, t, n, r) {
1225
1280
  i += e.substring(a, o + 5), a = o + 5;
1226
1281
  continue;
1227
1282
  }
1228
- let c = Vt(e, o + 5);
1283
+ let c = Lt(e, o + 5);
1229
1284
  if (c === -1) {
1230
1285
  i += e.substring(a);
1231
1286
  break;
@@ -1235,7 +1290,7 @@ function $(e, t, n, r) {
1235
1290
  i += e.substring(a);
1236
1291
  break;
1237
1292
  }
1238
- let u = Gt(e.substring(o + 5, c), t);
1293
+ let u = Vt(e.substring(o + 5, c), t);
1239
1294
  if (u === null) {
1240
1295
  i += e.substring(a, o + 5), a = o + 5;
1241
1296
  continue;
@@ -1245,12 +1300,10 @@ function $(e, t, n, r) {
1245
1300
  }
1246
1301
  return i;
1247
1302
  }
1248
- //#endregion
1249
- //#region ../types/src/preview-resolution.ts
1250
- function bn(e) {
1251
- return typeof e != "object" || !e ? !1 : Array.isArray(e.blocks);
1303
+ function gn(e) {
1304
+ if (typeof e != "object" || !e) return !1;
1305
+ let t = e;
1306
+ return Array.isArray(t.blocks);
1252
1307
  }
1253
1308
  //#endregion
1254
- export { je as $, Tt as A, te as At, Ct as B, o as Bt, Gt as C, se as Ct, Ft as D, ae as Dt, Pt as E, f as Et, gt as F, s as Ft, pt as G, ht as H, lt as I, l as It, at as J, wt as K, _t as L, c as Lt, bt as M, re as Mt, St as N, i as Nt, Mt as O, d as Ot, dt as P, e as Pt, B as Q, ct as R, n as Rt, Vt as S, ce as St, Nt as T, le as Tt, yt as U, mt as V, t as Vt, st as W, $e as X, nt as Y, et as Z, nn as _, v as _t, Z as a, ke as at, Yt as b, g as bt, sn as c, Pe as ct, un as d, Oe as dt, ze as et, yn as f, Ne as ft, mn as g, me as gt, fn as h, fe as ht, vn as i, Le as it, ut as j, ne as jt, G as k, ee as kt, pn as l, Fe as lt, ln as m, De as mt, Y as n, Ie as nt, Q as o, L as ot, dn as p, z as pt, U as q, gn as r, Ae as rt, cn as s, R as st, bn as t, Me as tt, _n as u, Re as ut, J as v, pe as vt, zt as w, ue as wt, Jt as x, p as xt, rn as y, _ as yt, ft as z, r as zt };
1255
-
1256
- //# sourceMappingURL=src-CvLTYGdO.js.map
1309
+ export { ln as $, at as A, bt as B, xt as C, un as Ct, Qe as D, t as Dt, vt as E, o as Et, ut as F, Qt as G, B as H, dt as I, mn as J, U as K, ht as L, it as M, ct as N, st as O, Ot, yt as P, nn as Q, rt as R, te as S, cn as St, gt as T, r as Tt, ne as U, m as V, Gt as W, Q as X, Z as Y, rn as Z, g as _, an as _t, Fe as a, gn as at, G as b, fe as bt, s as c, R as ct, ce as d, re as dt, se as et, Y as f, tt as ft, he as g, sn as gt, Ft as h, hn as ht, e as i, on as it, pt as j, ft as k, h as l, jt as lt, c as m, ae as mt, ee as n, Ie as nt, Ye as o, I as ot, Ne as p, $t as pt, me as q, i as r, pn as rt, Xe as s, L as st, d as t, Me as tt, l as u, J as ut, kt as v, p as vt, ot as w, n as wt, fn as x, de as xt, At as y, ue as yt, lt as z };