@templatical/editor 0.54.1 → 0.55.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 (172) hide show
  1. package/dist/{AiAltTextPopover-NMJqQKvD.js → AiAltTextPopover-D5QosKvB.js} +1 -1
  2. package/dist/{AiAltTextReview-Ci4zHwRc.js → AiAltTextReview-D1W_lrI_.js} +1 -1
  3. package/dist/{AiRewriteMenu-arKoTjsQ.js → AiRewriteMenu-BwztoMov.js} +4 -4
  4. package/dist/{BlockPreviewCanvas-BTieuBmH.js → BlockPreviewCanvas-C23A6FRm.js} +6 -6
  5. package/dist/{CloudPanels-Hxdp0doU.js → CloudPanels-Baoaj6Xf.js} +1 -1
  6. package/dist/{CountdownToolbar-CM4XNEuO.js → CountdownToolbar-CA_gDIdZ.js} +4 -4
  7. package/dist/{IssuesPanel-1wGV0wiy.js → IssuesPanel-nmFhWG1p.js} +1 -1
  8. package/dist/{LanguageMenu-BpxbIJEx.js → LanguageMenu-DcABUYop.js} +5 -5
  9. package/dist/{LogicTagInsertButton-DgTJ6Lvx.js → LogicTagInsertButton-qZ82VMFx.js} +284 -279
  10. package/dist/{MergeTagInput-B_51YcQO.js → MergeTagInput-JJeZbFkD.js} +1 -1
  11. package/dist/{MergeTagModeToggle-D3Q2z317.js → MergeTagModeToggle-DDucd1eC.js} +1 -1
  12. package/dist/{MergeTagTextarea-DZz1L9DE.js → MergeTagTextarea-dQ2LRrNB.js} +2 -2
  13. package/dist/{ParagraphEditor-B38t4E2p.js → ParagraphEditor-VXYwGoz_.js} +8 -8
  14. package/dist/{RestoreVersionDialog-n7FSmWXB.js → RestoreVersionDialog-BibNvAaJ.js} +1 -1
  15. package/dist/{RichTextEditorContent-Dstovi0m.js → RichTextEditorContent-CU5EOlM_.js} +2 -2
  16. package/dist/{SaveBlockDialog-B94NpmDV.js → SaveBlockDialog-S9aFi0cy.js} +4 -4
  17. package/dist/{SavedBlocksBrowserModal-C1vSc8iM.js → SavedBlocksBrowserModal-DIdn6B0J.js} +4 -4
  18. package/dist/{SavedBlocksPanels-DLDmIYeL.js → SavedBlocksPanels-Cme2M6u8.js} +1 -1
  19. package/dist/{SavedBlocksPickBar-ngf2sFEs.js → SavedBlocksPickBar-BDmA7r3m.js} +1 -1
  20. package/dist/{TemplateSettings-Baar78_s.js → TemplateSettings-C_LHLm5M.js} +4 -4
  21. package/dist/{TestEmailModal-CB_9I1bl.js → TestEmailModal-CLIRn7eL.js} +5 -5
  22. package/dist/{TestEmailPanel-BUq-dbXQ.js → TestEmailPanel-frdtjC8h.js} +1 -1
  23. package/dist/{TitleEditor-BLP41rwy.js → TitleEditor-D5kC56Jl.js} +4 -4
  24. package/dist/{Toolbar-bOZ_eq7X.js → Toolbar-D904Yw_R.js} +747 -699
  25. package/dist/{TplModal-DFKqmJQz.js → TplModal-BBdotDf1.js} +1 -1
  26. package/dist/{VersionHistoryPanels-DPxj3mec.js → VersionHistoryPanels-DhagEgOk.js} +1 -1
  27. package/dist/{WrapperBlock-BdVIuGMR.js → WrapperBlock-BAT3T0Cz.js} +3 -3
  28. package/dist/{blockTypeIcons-BUyPZ7Su.js → blockTypeIcons-CoRQV_hP.js} +1 -1
  29. package/dist/bundle-stats.json +6 -6
  30. package/dist/{cdn/chunks/ca-DOuIxWRv.js → ca-DIkMxYCN.js} +10 -3
  31. package/dist/cdn/chunks/{AiAltTextPopover-Cnc_kUmb.js → AiAltTextPopover-CUGOPuRo.js} +2 -2
  32. package/dist/cdn/chunks/{AiAltTextPopover-Cnc_kUmb.js.map → AiAltTextPopover-CUGOPuRo.js.map} +1 -1
  33. package/dist/cdn/chunks/{AiAltTextReview-DPeSY-7r.js → AiAltTextReview-B9vm_L-8.js} +2 -2
  34. package/dist/cdn/chunks/{AiAltTextReview-DPeSY-7r.js.map → AiAltTextReview-B9vm_L-8.js.map} +1 -1
  35. package/dist/cdn/chunks/{AiRewriteMenu-YcVFv6RS.js → AiRewriteMenu-BvV_7tNZ.js} +7 -7
  36. package/dist/cdn/chunks/{AiRewriteMenu-YcVFv6RS.js.map → AiRewriteMenu-BvV_7tNZ.js.map} +1 -1
  37. package/dist/cdn/chunks/{BlockPreviewCanvas-6ck15xz9.js → BlockPreviewCanvas-Dr-xGq6v.js} +7 -7
  38. package/dist/cdn/chunks/{BlockPreviewCanvas-6ck15xz9.js.map → BlockPreviewCanvas-Dr-xGq6v.js.map} +1 -1
  39. package/dist/cdn/chunks/{CloudPanels-BHHpNckC.js → CloudPanels-CQ0vNgsH.js} +2 -2
  40. package/dist/cdn/chunks/{CloudPanels-BHHpNckC.js.map → CloudPanels-CQ0vNgsH.js.map} +1 -1
  41. package/dist/cdn/chunks/{CountdownToolbar-CNgsNL5-.js → CountdownToolbar-BxW-J7DX.js} +5 -5
  42. package/dist/cdn/chunks/{CountdownToolbar-CNgsNL5-.js.map → CountdownToolbar-BxW-J7DX.js.map} +1 -1
  43. package/dist/cdn/chunks/{IssuesPanel-Duic0mIs.js → IssuesPanel-BoHeIjvw.js} +3 -3
  44. package/dist/cdn/chunks/{IssuesPanel-Duic0mIs.js.map → IssuesPanel-BoHeIjvw.js.map} +1 -1
  45. package/dist/cdn/chunks/{LanguageMenu-C6utRx_4.js → LanguageMenu-BnYN5N1h.js} +7 -7
  46. package/dist/cdn/chunks/{LanguageMenu-C6utRx_4.js.map → LanguageMenu-BnYN5N1h.js.map} +1 -1
  47. package/dist/cdn/chunks/{LogicTagInsertButton-Bhvi0nWz.js → LogicTagInsertButton-Bt2PXbQ0.js} +255 -250
  48. package/dist/cdn/chunks/LogicTagInsertButton-Bt2PXbQ0.js.map +1 -0
  49. package/dist/cdn/chunks/{MergeTagInput-CrhZm-AW.js → MergeTagInput-BELdMRni.js} +2 -2
  50. package/dist/cdn/chunks/{MergeTagInput-CrhZm-AW.js.map → MergeTagInput-BELdMRni.js.map} +1 -1
  51. package/dist/cdn/chunks/{MergeTagModeToggle-CWVtXLYa.js → MergeTagModeToggle-DKfMDIEF.js} +2 -2
  52. package/dist/cdn/chunks/{MergeTagModeToggle-CWVtXLYa.js.map → MergeTagModeToggle-DKfMDIEF.js.map} +1 -1
  53. package/dist/cdn/chunks/{MergeTagTextarea-hTIBwX0F.js → MergeTagTextarea-w6xen3Xh.js} +5 -5
  54. package/dist/cdn/chunks/{MergeTagTextarea-hTIBwX0F.js.map → MergeTagTextarea-w6xen3Xh.js.map} +1 -1
  55. package/dist/cdn/chunks/{ParagraphEditor-B3EQ0Ai6.js → ParagraphEditor-Cal9hY3U.js} +9 -9
  56. package/dist/cdn/chunks/{ParagraphEditor-B3EQ0Ai6.js.map → ParagraphEditor-Cal9hY3U.js.map} +1 -1
  57. package/dist/cdn/chunks/{RestoreVersionDialog-DfNrVi0R.js → RestoreVersionDialog-f_ulmASY.js} +2 -2
  58. package/dist/cdn/chunks/{RestoreVersionDialog-DfNrVi0R.js.map → RestoreVersionDialog-f_ulmASY.js.map} +1 -1
  59. package/dist/cdn/chunks/{RichTextEditorContent-up4AqL7D.js → RichTextEditorContent-C_v0kS4A.js} +3 -3
  60. package/dist/cdn/chunks/{RichTextEditorContent-up4AqL7D.js.map → RichTextEditorContent-C_v0kS4A.js.map} +1 -1
  61. package/dist/cdn/chunks/{SaveBlockDialog-BqglcKcN.js → SaveBlockDialog-C6N9RFls.js} +5 -5
  62. package/dist/cdn/chunks/{SaveBlockDialog-BqglcKcN.js.map → SaveBlockDialog-C6N9RFls.js.map} +1 -1
  63. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BewXGlrK.js → SavedBlocksBrowserModal-Bl2sl09D.js} +4 -4
  64. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BewXGlrK.js.map → SavedBlocksBrowserModal-Bl2sl09D.js.map} +1 -1
  65. package/dist/cdn/chunks/{SavedBlocksPanels-0ZpX-jXI.js → SavedBlocksPanels-DqVcmEUK.js} +2 -2
  66. package/dist/cdn/chunks/{SavedBlocksPanels-0ZpX-jXI.js.map → SavedBlocksPanels-DqVcmEUK.js.map} +1 -1
  67. package/dist/cdn/chunks/{SavedBlocksPickBar-DHah-Uf7.js → SavedBlocksPickBar-DE-J1JVL.js} +2 -2
  68. package/dist/cdn/chunks/{SavedBlocksPickBar-DHah-Uf7.js.map → SavedBlocksPickBar-DE-J1JVL.js.map} +1 -1
  69. package/dist/cdn/chunks/{TemplateSettings-CWUpUKJb.js → TemplateSettings-CpoKZ8oV.js} +5 -5
  70. package/dist/cdn/chunks/{TemplateSettings-CWUpUKJb.js.map → TemplateSettings-CpoKZ8oV.js.map} +1 -1
  71. package/dist/cdn/chunks/{TestEmailModal-7pUDYLrk.js → TestEmailModal-DI3z__Bd.js} +8 -8
  72. package/dist/cdn/chunks/{TestEmailModal-7pUDYLrk.js.map → TestEmailModal-DI3z__Bd.js.map} +1 -1
  73. package/dist/cdn/chunks/{TestEmailPanel-DBWwMsH1.js → TestEmailPanel-Cp5d2YGn.js} +2 -2
  74. package/dist/cdn/chunks/{TestEmailPanel-DBWwMsH1.js.map → TestEmailPanel-Cp5d2YGn.js.map} +1 -1
  75. package/dist/cdn/chunks/{TitleEditor-VAanUjPQ.js → TitleEditor-C2syRLdZ.js} +4 -4
  76. package/dist/cdn/chunks/{TitleEditor-VAanUjPQ.js.map → TitleEditor-C2syRLdZ.js.map} +1 -1
  77. package/dist/cdn/chunks/{Toolbar-BlWVQRcA.js → Toolbar-NEE8qxYh.js} +754 -706
  78. package/dist/cdn/chunks/Toolbar-NEE8qxYh.js.map +1 -0
  79. package/dist/cdn/chunks/{TplModal-DDlR7mk3.js → TplModal-B1MgvtX8.js} +2 -2
  80. package/dist/cdn/chunks/{TplModal-DDlR7mk3.js.map → TplModal-B1MgvtX8.js.map} +1 -1
  81. package/dist/cdn/chunks/{VersionHistoryPanels-DJDeaf1B.js → VersionHistoryPanels-Cefd8i_e.js} +2 -2
  82. package/dist/cdn/chunks/{VersionHistoryPanels-DJDeaf1B.js.map → VersionHistoryPanels-Cefd8i_e.js.map} +1 -1
  83. package/dist/cdn/chunks/{WrapperBlock-DRJnrgy-.js → WrapperBlock-DFY-7YSs.js} +4 -4
  84. package/dist/cdn/chunks/{WrapperBlock-DRJnrgy-.js.map → WrapperBlock-DFY-7YSs.js.map} +1 -1
  85. package/dist/{ca-DOuIxWRv.js → cdn/chunks/ca-DIkMxYCN.js} +12 -1
  86. package/dist/cdn/chunks/{ca-DOuIxWRv.js.map → ca-DIkMxYCN.js.map} +1 -1
  87. package/dist/cdn/chunks/{composables-Jc3uZuLs.js → composables-nyxwrM27.js} +619 -597
  88. package/dist/cdn/chunks/composables-nyxwrM27.js.map +1 -0
  89. package/dist/cdn/chunks/{createCloudRuntime-C2Zs5F1O.js → createCloudRuntime-DJkDGKQ_.js} +3 -3
  90. package/dist/cdn/chunks/{createCloudRuntime-C2Zs5F1O.js.map → createCloudRuntime-DJkDGKQ_.js.map} +1 -1
  91. package/dist/{de-DaOUfYBX.js → cdn/chunks/de-Cc6Ue0UD.js} +12 -1
  92. package/dist/cdn/chunks/de-Cc6Ue0UD.js.map +1 -0
  93. package/dist/cdn/chunks/{en-C0pHHMiR.js → en-BX4FujAQ.js} +11 -2
  94. package/dist/cdn/chunks/en-BX4FujAQ.js.map +1 -0
  95. package/dist/{es-CxyEKr6n.js → cdn/chunks/es-Do5b-MKU.js} +12 -1
  96. package/dist/cdn/chunks/es-Do5b-MKU.js.map +1 -0
  97. package/dist/cdn/chunks/{extensions-DcMKZpzh.js → extensions-BcwkOjVq.js} +76 -70
  98. package/dist/cdn/chunks/extensions-BcwkOjVq.js.map +1 -0
  99. package/dist/{fr-CYbamiI6.js → cdn/chunks/fr-S1n2Ebzp.js} +12 -1
  100. package/dist/cdn/chunks/fr-S1n2Ebzp.js.map +1 -0
  101. package/dist/cdn/chunks/{ja-DfaIAoGI.js → ja-DLwcq4bA.js} +11 -2
  102. package/dist/cdn/chunks/ja-DLwcq4bA.js.map +1 -0
  103. package/dist/{nl-DkrB-VKZ.js → cdn/chunks/nl-0JSWaZpT.js} +12 -1
  104. package/dist/cdn/chunks/nl-0JSWaZpT.js.map +1 -0
  105. package/dist/{normalizeMergeTagMarkup-CUCo7B5X.js → cdn/chunks/normalizeMergeTagMarkup-BrGw5jxk.js} +102 -90
  106. package/dist/cdn/chunks/normalizeMergeTagMarkup-BrGw5jxk.js.map +1 -0
  107. package/dist/{preRenderCustomBlocks-Bs3N9no-.js → cdn/chunks/preRenderCustomBlocks-Cj0XYwuh.js} +3 -1
  108. package/dist/cdn/chunks/{preRenderCustomBlocks-f7GEKdvw.js.map → preRenderCustomBlocks-Cj0XYwuh.js.map} +1 -1
  109. package/dist/{pt-BR-CY5Ye7eP.js → cdn/chunks/pt-BR-D3VlIMDZ.js} +12 -1
  110. package/dist/cdn/chunks/pt-BR-D3VlIMDZ.js.map +1 -0
  111. package/dist/cdn/chunks/{sanitizeHtml-WTfz9lZd.js → sanitizeHtml-GxJCxKcP.js} +3 -3
  112. package/dist/cdn/chunks/{sanitizeHtml-WTfz9lZd.js.map → sanitizeHtml-GxJCxKcP.js.map} +1 -1
  113. package/dist/cdn/chunks/{socialIcons-DeCYorUT.js → socialIcons-B5zrrV8-.js} +387 -386
  114. package/dist/cdn/chunks/{socialIcons-DeCYorUT.js.map → socialIcons-B5zrrV8-.js.map} +1 -1
  115. package/dist/cdn/chunks/{src-A_cKeTM_.js → src-Diw9SLIe.js} +673 -554
  116. package/dist/cdn/chunks/src-Diw9SLIe.js.map +1 -0
  117. package/dist/cdn/chunks/src-UR3AQocX.js +683 -0
  118. package/dist/cdn/chunks/src-UR3AQocX.js.map +1 -0
  119. package/dist/cdn/chunks/{src-BQUv2CYU.js → src-v47QHNmB.js} +808 -645
  120. package/dist/cdn/chunks/src-v47QHNmB.js.map +1 -0
  121. package/dist/cdn/chunks/useLocalizedDisplay-DekV8qar.js +33 -0
  122. package/dist/cdn/chunks/{useLocalizedDisplay-aGfnO90D.js.map → useLocalizedDisplay-DekV8qar.js.map} +1 -1
  123. package/dist/cdn/chunks/{useLogicTag-DtYe8HIq.js → useLogicTag-Cbp3I7UN.js} +2 -2
  124. package/dist/cdn/chunks/{useLogicTag-DtYe8HIq.js.map → useLogicTag-Cbp3I7UN.js.map} +1 -1
  125. package/dist/cdn/chunks/{useMergeTag-B8ULmsnp.js → useMergeTag-1lrpNyR5.js} +4 -4
  126. package/dist/cdn/chunks/{useMergeTag-B8ULmsnp.js.map → useMergeTag-1lrpNyR5.js.map} +1 -1
  127. package/dist/cdn/chunks/{withCurrentFont-MK8ga9q9.js → withCurrentFont-DZfmiv8V.js} +2 -2
  128. package/dist/cdn/chunks/{withCurrentFont-MK8ga9q9.js.map → withCurrentFont-DZfmiv8V.js.map} +1 -1
  129. package/dist/cdn/editor.css +1 -1
  130. package/dist/cdn/editor.js +285 -285
  131. package/dist/cdn/editor.js.map +1 -1
  132. package/dist/{composables-XjYKaKhY.js → composables-DPgNn9GZ.js} +963 -941
  133. package/dist/{createCloudRuntime-DGV5a5Af.js → createCloudRuntime-Bw8TLmQ8.js} +2 -2
  134. package/dist/{cdn/chunks/de-DaOUfYBX.js → de-Cc6Ue0UD.js} +10 -3
  135. package/dist/{dist-Cdkm20M6.js → dist-CBdk1Vcb.js} +978 -815
  136. package/dist/{en-C0pHHMiR.js → en-BX4FujAQ.js} +10 -1
  137. package/dist/{cdn/chunks/es-CxyEKr6n.js → es-Do5b-MKU.js} +10 -3
  138. package/dist/{extensions-BJ184osp.js → extensions-QFAARrjF.js} +336 -330
  139. package/dist/{cdn/chunks/fr-CYbamiI6.js → fr-S1n2Ebzp.js} +10 -3
  140. package/dist/index.d.ts +14 -1
  141. package/dist/{ja-DfaIAoGI.js → ja-DLwcq4bA.js} +10 -1
  142. package/dist/{cdn/chunks/nl-DkrB-VKZ.js → nl-0JSWaZpT.js} +10 -3
  143. package/dist/{cdn/chunks/normalizeMergeTagMarkup-cC32Ox6A.js → normalizeMergeTagMarkup-BS0nRvhq.js} +97 -89
  144. package/dist/{cdn/chunks/preRenderCustomBlocks-f7GEKdvw.js → preRenderCustomBlocks-CiKvKd8V.js} +4 -6
  145. package/dist/{cdn/chunks/pt-BR-CY5Ye7eP.js → pt-BR-D3VlIMDZ.js} +10 -3
  146. package/dist/{sanitizeHtml-2rjV0r-6.js → sanitizeHtml-USjTyALR.js} +5 -5
  147. package/dist/{socialIcons-TFiOkpoU.js → socialIcons-NvIg5ahU.js} +401 -400
  148. package/dist/style.css +1 -1
  149. package/dist/templatical-editor.js +190 -190
  150. package/dist/useLocalizedDisplay-LdjosX4w.js +31 -0
  151. package/dist/{useLogicTag-BXXXQQmi.js → useLogicTag-D8zgkXfb.js} +1 -1
  152. package/dist/{useMergeTag-C9Okr87y.js → useMergeTag-k7Kr0nMd.js} +3 -3
  153. package/dist/{withCurrentFont-DJiQqZzL.js → withCurrentFont-Bzeg_gfH.js} +1 -1
  154. package/package.json +7 -7
  155. package/dist/cdn/chunks/LogicTagInsertButton-Bhvi0nWz.js.map +0 -1
  156. package/dist/cdn/chunks/Toolbar-BlWVQRcA.js.map +0 -1
  157. package/dist/cdn/chunks/composables-Jc3uZuLs.js.map +0 -1
  158. package/dist/cdn/chunks/de-DaOUfYBX.js.map +0 -1
  159. package/dist/cdn/chunks/en-C0pHHMiR.js.map +0 -1
  160. package/dist/cdn/chunks/es-CxyEKr6n.js.map +0 -1
  161. package/dist/cdn/chunks/extensions-DcMKZpzh.js.map +0 -1
  162. package/dist/cdn/chunks/fr-CYbamiI6.js.map +0 -1
  163. package/dist/cdn/chunks/ja-DfaIAoGI.js.map +0 -1
  164. package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +0 -1
  165. package/dist/cdn/chunks/normalizeMergeTagMarkup-cC32Ox6A.js.map +0 -1
  166. package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +0 -1
  167. package/dist/cdn/chunks/src-8bYYJPCt.js +0 -671
  168. package/dist/cdn/chunks/src-8bYYJPCt.js.map +0 -1
  169. package/dist/cdn/chunks/src-A_cKeTM_.js.map +0 -1
  170. package/dist/cdn/chunks/src-BQUv2CYU.js.map +0 -1
  171. package/dist/cdn/chunks/useLocalizedDisplay-aGfnO90D.js +0 -33
  172. package/dist/useLocalizedDisplay-DNNwDRxL.js +0 -31
@@ -63,7 +63,7 @@ var s = {
63
63
  "center",
64
64
  "bottom"
65
65
  ];
66
- function ee(e) {
66
+ function p(e) {
67
67
  return {
68
68
  url: e,
69
69
  size: "cover",
@@ -74,7 +74,7 @@ function ee(e) {
74
74
  repeat: !1
75
75
  };
76
76
  }
77
- function te(e) {
77
+ function ee(e) {
78
78
  let t = "";
79
79
  for (let n of e) {
80
80
  let e = n.charCodeAt(0);
@@ -82,36 +82,36 @@ function te(e) {
82
82
  }
83
83
  return t;
84
84
  }
85
- function ne(e) {
85
+ function te(e) {
86
86
  let t = typeof e?.url == "string" ? e.url.trim() : "";
87
87
  if (!e || !t) return null;
88
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
89
  return {
90
- url: te(t),
90
+ url: ee(t),
91
91
  size: n,
92
92
  position: `${i} ${a}`,
93
93
  repeat: e.repeat ? "repeat" : "no-repeat"
94
94
  };
95
95
  }
96
96
  // ../types/src/hero.ts
97
- var re = [
97
+ var ne = [
98
98
  "top",
99
99
  "middle",
100
100
  "bottom"
101
101
  ];
102
- function ie(e) {
102
+ function re(e) {
103
103
  let t = e.hero;
104
104
  if (!t || typeof t != "object") return null;
105
105
  if (e.columns !== "1") return {
106
106
  applied: !1,
107
107
  reason: "columns"
108
108
  };
109
- let n = ne(e.backgroundImage);
109
+ let n = te(e.backgroundImage);
110
110
  if (n === null) return {
111
111
  applied: !1,
112
112
  reason: "image"
113
113
  };
114
- let r = oe(e.backgroundImage), i = ae(t.height) ? Math.round(t.height) : "image";
114
+ let r = ae(e.backgroundImage), i = ie(t.height) ? Math.round(t.height) : "image";
115
115
  return i === "image" && r === null ? {
116
116
  applied: !1,
117
117
  reason: "size"
@@ -119,19 +119,19 @@ function ie(e) {
119
119
  applied: !0,
120
120
  image: n,
121
121
  height: i,
122
- verticalAlign: re.includes(t.verticalAlign) ? t.verticalAlign : "middle",
122
+ verticalAlign: ne.includes(t.verticalAlign) ? t.verticalAlign : "middle",
123
123
  aspectRatio: r
124
124
  };
125
125
  }
126
- function ae(e) {
126
+ function ie(e) {
127
127
  return typeof e == "number" && Number.isFinite(e) && e >= 1;
128
128
  }
129
- function oe(e) {
129
+ function ae(e) {
130
130
  let t = e?.naturalWidth, n = e?.naturalHeight;
131
131
  return typeof t != "number" || typeof n != "number" || !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 || n <= 0 ? null : n / t;
132
132
  }
133
133
  // ../types/src/social.ts
134
- var se = {
134
+ var oe = {
135
135
  facebook: {
136
136
  color: "#1877F2",
137
137
  path: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"
@@ -148,6 +148,10 @@ var se = {
148
148
  color: "#0A66C2",
149
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
150
  },
151
+ xing: {
152
+ color: "#006567",
153
+ path: "M18.188 0c-.517 0-.741.325-.927.66c0 0-7.455 13.224-7.702 13.657c.015.024 4.919 9.023 4.919 9.023c.17.308.436.66.967.66h3.454c.211 0 .375-.078.463-.22c.089-.151.089-.346-.009-.536l-4.879-8.916a.02.02 0 0 1 0-.022L22.139.756c.095-.191.097-.387.006-.535C22.056.078 21.894 0 21.686 0zM3.648 4.74c-.211 0-.385.074-.473.216c-.09.149-.078.339.02.531l2.34 4.05q.006.014 0 .021L1.86 16.051a.52.52 0 0 0 0 .529c.085.142.239.234.45.234h3.461c.518 0 .766-.348.945-.667l3.734-6.609l-2.378-4.155c-.172-.315-.434-.659-.962-.659H3.648z"
154
+ },
151
155
  youtube: {
152
156
  color: "#FF0000",
153
157
  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"
@@ -200,36 +204,36 @@ var se = {
200
204
  color: "#1769FF",
201
205
  path: "M22 7h-7V5h7v2zm1.726 10c-.442 1.297-2.029 3-5.101 3-3.074 0-5.564-1.729-5.564-5.675 0-3.91 2.325-5.92 5.466-5.92 3.082 0 4.964 1.782 5.375 4.426.078.506.109 1.188.095 2.14H15.97c.13 3.211 3.483 3.312 4.588 2.029h3.168zm-7.686-4h4.965c-.105-1.547-1.136-2.219-2.477-2.219-1.466 0-2.277.768-2.488 2.219zm-9.574 6.988H0V5.021h6.953c5.476.081 5.58 5.444 2.72 6.906 3.461 1.26 3.577 8.061-3.207 8.061zM3 11h3.584c2.508 0 2.906-3-.312-3H3v3zm3.391 3H3v3.016h3.341c3.055 0 2.868-3.016.05-3.016z"
202
206
  }
203
- }, ce = {
207
+ }, se = {
204
208
  dark: "#1f1f1f",
205
209
  light: "#ffffff"
206
210
  };
207
- function le(e) {
211
+ function ce(e) {
208
212
  return e === "dark" || e === "light" ? e : void 0;
209
213
  }
210
- function ue(e, t) {
211
- let n = le(t);
214
+ function le(e, t) {
215
+ let n = ce(t);
212
216
  return {
213
- fill: n ? ce[n] : se[e].color,
214
- onFill: n === "light" ? ce.dark : "#ffffff"
217
+ fill: n ? se[n] : oe[e].color,
218
+ onFill: n === "light" ? se.dark : "#ffffff"
215
219
  };
216
220
  }
217
- function de(e, t) {
218
- let n = le(t);
221
+ function ue(e, t) {
222
+ let n = ce(t);
219
223
  return n ? `${e}-${n}` : e;
220
224
  }
221
- function fe(e, t) {
222
- if (le(t) === "dark" && (e === "plain" || e === "outlined")) return {
223
- color: ce.light,
225
+ function de(e, t) {
226
+ if (ce(t) === "dark" && (e === "plain" || e === "outlined")) return {
227
+ color: se.light,
224
228
  opacity: .6,
225
229
  width: 1.4
226
230
  };
227
231
  }
228
- function pe(e) {
232
+ function fe(e) {
229
233
  return e === "plain" ? .84 : .6;
230
234
  }
231
235
  // ../types/src/element-ids.ts
232
- function me(e) {
236
+ function pe(e) {
233
237
  let t = [], n = (e, n) => {
234
238
  typeof e == "string" && /[./]/.test(e) && t.push({
235
239
  path: n,
@@ -248,7 +252,7 @@ function me(e) {
248
252
  return r(e.blocks, "blocks"), t;
249
253
  }
250
254
  // ../types/src/clone.ts
251
- function p(e) {
255
+ function m(e) {
252
256
  let t = [];
253
257
  return JSON.parse(JSON.stringify(e, function(e, n) {
254
258
  if (typeof n != "object" || !n) return n;
@@ -257,22 +261,22 @@ function p(e) {
257
261
  }));
258
262
  }
259
263
  // ../types/src/deep-equal.ts
260
- function he(e) {
264
+ function me(e) {
261
265
  return typeof e == "object" && !!e && !Array.isArray(e);
262
266
  }
263
- function m(e, t) {
267
+ function h(e, t) {
264
268
  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;
269
+ if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => h(e, t[n]));
270
+ if (me(e)) {
271
+ if (!me(t)) return !1;
268
272
  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;
273
+ for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !h(e[r], t[r])) return !1;
270
274
  return !0;
271
275
  }
272
276
  return !1;
273
277
  }
274
278
  // ../types/src/config.ts
275
- var ge = class extends Error {
279
+ var he = class extends Error {
276
280
  statusCode;
277
281
  code;
278
282
  constructor(e, t, n, r) {
@@ -287,7 +291,7 @@ var ge = class extends Error {
287
291
  get isServerError() {
288
292
  return this.statusCode !== void 0 && this.statusCode >= 500;
289
293
  }
290
- }, _e = {
294
+ }, ge = {
291
295
  title: ["content"],
292
296
  paragraph: ["content"],
293
297
  html: ["content"],
@@ -304,58 +308,58 @@ var ge = class extends Error {
304
308
  "expiredMessage"
305
309
  ],
306
310
  custom: ["fieldValues.*"]
307
- }, h = ["preheaderText"];
308
- function ve(e) {
311
+ }, g = ["preheaderText"];
312
+ function _e(e) {
309
313
  return typeof e == "string" && /^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/.test(e);
310
314
  }
311
- function g(e) {
315
+ function _(e) {
312
316
  return typeof e == "object" && !!e && !Array.isArray(e);
313
317
  }
314
- var ye = /* @__PURE__ */ new Set([
318
+ var ve = /* @__PURE__ */ new Set([
315
319
  "__proto__",
316
320
  "constructor",
317
321
  "prototype"
318
322
  ]);
319
- function _(e) {
320
- return e.split(".").every((e) => e !== "" && !ye.has(e));
323
+ function v(e) {
324
+ return e.split(".").every((e) => e !== "" && !ve.has(e));
321
325
  }
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;
326
+ function ye(e, t) {
327
+ if (!ve.has(t)) return Array.isArray(e) ? e.find((e) => _(e) && e.id === t) : _(e) && Object.hasOwn(e, t) ? e[t] : void 0;
324
328
  }
325
- function v(e, t) {
326
- return t.split(".").reduce(be, e);
329
+ function y(e, t) {
330
+ return t.split(".").reduce(ye, e);
327
331
  }
328
- function xe(e) {
329
- let t = p(e);
332
+ function be(e) {
333
+ let t = m(e);
330
334
  for (let [n, r] of Object.entries(t.l10n ?? {})) {
331
335
  for (let t of ["text", "set"]) {
332
336
  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];
337
+ let i = n.includes(".") ? y(e, n.slice(0, n.lastIndexOf("."))) : e;
338
+ v(n) && (t !== "text" && _(i) || y(e, n) !== void 0) || delete r[t][n];
335
339
  }
336
340
  r[t] && !Object.keys(r[t]).length && delete r[t];
337
341
  }
338
342
  Object.keys(r).length || delete t.l10n[n];
339
343
  }
340
- return t.l10n && !Object.keys(t.l10n).length && delete t.l10n, m(t, e) ? e : t;
344
+ return t.l10n && !Object.keys(t.l10n).length && delete t.l10n, h(t, e) ? e : t;
341
345
  }
342
- function y(e) {
343
- let t = xe(e);
346
+ function b(e) {
347
+ let t = be(e);
344
348
  if (t.type === "wrapper") {
345
- let e = t.children.map(y);
349
+ let e = t.children.map(b);
346
350
  return e.some((e, n) => e !== t.children[n]) ? {
347
351
  ...t,
348
352
  children: e
349
353
  } : t;
350
354
  }
351
355
  if (t.type !== "section") return t;
352
- let n = t.children.map((e) => e.map(y));
356
+ let n = t.children.map((e) => e.map(b));
353
357
  return n.some((e, n) => e.some((e, r) => e !== t.children[n][r])) ? {
354
358
  ...t,
355
359
  children: n
356
360
  } : t;
357
361
  }
358
- function Se(e, t, n) {
362
+ function xe(e, t, n) {
359
363
  if (e.type === "custom") return !1;
360
364
  if (e.type === "section") return t === "columns";
361
365
  let r = e.type === "menu" ? "items" : e.type === "social" ? "icons" : e.type === "table" ? "rows" : null;
@@ -368,44 +372,44 @@ function Se(e, t, n) {
368
372
  let o = a.split(".").length;
369
373
  if (i[o] === "id") return !0;
370
374
  if (i.length !== o) return !1;
371
- let s = v(e, a);
372
- if (!g(s) || !g(n) || s.id !== n.id) return !0;
375
+ let s = y(e, a);
376
+ if (!_(s) || !_(n) || s.id !== n.id) return !0;
373
377
  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));
378
+ let e = (e) => Array.isArray(e) ? e.map((e) => _(e) ? e.id : void 0) : null;
379
+ return !h(e(s.cells), e(n.cells));
376
380
  }
377
381
  return !1;
378
382
  }
379
- function Ce(e) {
380
- return xe(e);
383
+ function Se(e) {
384
+ return be(e);
381
385
  }
382
- function b(e, t, n) {
383
- if (!_(t)) return !1;
384
- let r = t.split("."), i = r.pop(), a = r.reduce(be, e);
386
+ function x(e, t, n) {
387
+ if (!v(t)) return !1;
388
+ let r = t.split("."), i = r.pop(), a = r.reduce(ye, e);
385
389
  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);
390
+ let e = a.findIndex((e) => _(e) && e.id === i);
391
+ return e < 0 ? !1 : (a[e] = m(n), !0);
388
392
  }
389
- return g(a) ? (n === null ? delete a[i] : a[i] = p(n), !0) : !1;
393
+ return _(a) ? (n === null ? delete a[i] : a[i] = m(n), !0) : !1;
390
394
  }
391
- function we(e, t) {
395
+ function Ce(e, t) {
392
396
  let [n, ...r] = t.split(".");
393
397
  if (n === void 0) return [""];
394
398
  let i = [];
395
399
  if (n === "*") {
396
400
  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);
401
+ for (let e of t) if (_(e) && typeof e.id == "string") for (let t of r.length ? Ce(e, r.join(".")) : [""]) i.push(t ? `${e.id}.${t}` : e.id);
398
402
  return i;
399
403
  }
400
- let a = g(e) ? e[n] : void 0;
404
+ let a = _(e) ? e[n] : void 0;
401
405
  if (r.length === 0) return a === void 0 ? [] : [n];
402
- for (let e of we(a, r.join("."))) i.push(`${n}.${e}`);
406
+ for (let e of Ce(a, r.join("."))) i.push(`${n}.${e}`);
403
407
  return i;
404
408
  }
405
- function x(e, t = []) {
409
+ function S(e, t = []) {
406
410
  if (e.type === "custom") {
407
411
  let n = t.find((t) => t.type === e.customType), r = new Set((n?.fields ?? []).filter((e) => e.type === "text" || e.type === "textarea").map((e) => e.key)), i = e.fieldValues;
408
- return g(i) ? Object.keys(i).filter((e) => r.has(e)).map((e) => `fieldValues.${e}`) : [];
412
+ return _(i) ? Object.keys(i).filter((e) => r.has(e)).map((e) => `fieldValues.${e}`) : [];
409
413
  }
410
414
  let n = (e) => !e.id.includes("."), r = e.type === "menu" ? {
411
415
  ...e,
@@ -417,10 +421,10 @@ function x(e, t = []) {
417
421
  cells: e.cells.filter(n)
418
422
  }))
419
423
  } : e;
420
- return (_e[e.type] ?? []).flatMap((e) => we(r, e));
424
+ return (ge[e.type] ?? []).flatMap((e) => Ce(r, e));
421
425
  }
422
- function S(e, t) {
423
- return (_e[e] ?? []).some((e) => {
426
+ function we(e, t) {
427
+ return (ge[e] ?? []).some((e) => {
424
428
  let n = e.split("."), r = t.split(".");
425
429
  return n.length === r.length && n.every((e, t) => e === "*" || e === r[t]);
426
430
  });
@@ -434,101 +438,101 @@ function Te(e) {
434
438
  let { l10n: t, ...n } = e;
435
439
  return n;
436
440
  }
437
- function w(e = {}) {
441
+ function Ee(e = {}) {
438
442
  return Object.entries(e).sort(([e], [t]) => e.split(".").length - t.split(".").length);
439
443
  }
440
- function Ee(e, t, n) {
441
- let r = e, i = p(Te(r));
444
+ function De(e, t, n) {
445
+ let r = e, i = m(Te(r));
442
446
  if (t === n) return i;
443
447
  let a = r.l10n?.[t];
444
448
  if (!a) return i;
445
- for (let [e, t] of w(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);
449
+ for (let [e, t] of Ee(a.set)) x(i, e, t);
450
+ for (let [t, n] of Object.entries(a.text ?? {})) y(e, t) !== void 0 && x(i, t, n.value);
447
451
  return e.type === "custom" && (Object.keys(a.text ?? {}).length > 0 || Object.keys(a.set ?? {}).length > 0) && delete i.renderedHtml, i;
448
452
  }
449
- function De(e, t) {
453
+ function Oe(e, t) {
450
454
  return e.l10n?.[t]?.hidden === !0;
451
455
  }
452
- function Oe(e) {
456
+ function ke(e) {
453
457
  let { locales: t, l10n: n, ...r } = e;
454
458
  return r;
455
459
  }
456
- function T(e) {
460
+ function w(e) {
457
461
  return e.settings?.locale ?? "en";
458
462
  }
459
- function ke(e, t, n) {
460
- let r = T(e);
463
+ function Ae(e, t, n) {
464
+ let r = w(e);
461
465
  if (t !== r && !(e.settings?.locales ?? []).includes(t)) {
462
466
  if (n?.missing === "default") t = r;
463
- else throw new ge(`This template has no "${t}" version.`, void 0, "unknown_locale");
467
+ else throw new he(`This template has no "${t}" version.`, void 0, "unknown_locale");
464
468
  }
465
469
  let i = (e) => e.flatMap((e) => {
466
- if (t !== r && De(e, t)) return [];
467
- let n = Ee(e, t, r);
470
+ if (t !== r && Oe(e, t)) return [];
471
+ let n = De(e, t, r);
468
472
  return n.type === "section" && Array.isArray(n.children) ? n.children = n.children.map((e) => i(e)) : n.type === "wrapper" && Array.isArray(n.children) && (n.children = i(n.children)), [n];
469
- }), a = p(Oe(e.settings)), o = e.settings?.l10n?.[t];
473
+ }), a = m(ke(e.settings)), o = e.settings?.l10n?.[t];
470
474
  if (t !== r && o) {
471
- for (let [e, t] of w(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);
475
+ for (let [e, t] of Ee(o.set)) x(a, e, t);
476
+ for (let [t, n] of Object.entries(o.text ?? {})) y(e.settings, t) !== void 0 && x(a, t, n.value);
473
477
  }
474
478
  return a.locale = t, {
475
479
  blocks: i(e.blocks),
476
480
  settings: a
477
481
  };
478
482
  }
479
- function Ae(e, t, n = []) {
483
+ function je(e, t, n = []) {
480
484
  let r = {
481
485
  translated: [],
482
486
  missing: [],
483
487
  stale: []
484
488
  }, i = (e, t, n, i) => {
485
489
  for (let a of n) {
486
- let n = v(t, a);
490
+ let n = y(t, a);
487
491
  if (typeof n != "string") continue;
488
492
  let o = i?.[a];
489
493
  (o || n !== "") && (o ? o.sourceHash === C(n) ? r.translated.push(`${e}/${a}`) : r.stale.push(`${e}/${a}`) : r.missing.push(`${e}/${a}`));
490
494
  }
491
495
  }, a = (e) => {
492
496
  for (let r of e) {
493
- if (De(r, t)) continue;
497
+ if (Oe(r, t)) continue;
494
498
  let e = r.l10n?.[t];
495
- i(r.id, r, x(r, n), e?.text);
499
+ i(r.id, r, S(r, n), e?.text);
496
500
  let o = r.children;
497
501
  if (r.type === "section" && Array.isArray(o)) for (let e of o) a(e);
498
502
  else r.type === "wrapper" && Array.isArray(o) && a(o);
499
503
  }
500
504
  };
501
- return a(e.blocks), i("settings", e.settings, [...h], e.settings?.l10n?.[t]?.text), r;
505
+ return a(e.blocks), i("settings", e.settings, [...g], e.settings?.l10n?.[t]?.text), r;
502
506
  }
503
- function je(e, t) {
504
- if (t === T(e) || !e.settings.locales?.includes(t)) return [];
507
+ function Me(e, t) {
508
+ if (t === w(e) || !e.settings.locales?.includes(t)) return [];
505
509
  let n = [], r = (e) => {
506
- for (let i of e) De(i, t) && n.push(i.id), i.type === "section" ? i.children.forEach(r) : i.type === "wrapper" && r(i.children);
510
+ 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
511
  };
508
512
  return r(e.blocks), n;
509
513
  }
510
- function Me(e, t, n = []) {
511
- if (t === T(e) || !e.settings.locales?.includes(t)) return [];
514
+ function Ne(e, t, n = []) {
515
+ if (t === w(e) || !e.settings.locales?.includes(t)) return [];
512
516
  let r = [], i = (e, n, i) => {
513
- r.push(...Ne(n, t, i).map((t) => `${e}/${t}`));
517
+ r.push(...Pe(n, t, i).map((t) => `${e}/${t}`));
514
518
  }, 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);
519
+ for (let t of e) i(t.id, t, S(t, n)), t.type === "section" ? t.children.forEach(a) : t.type === "wrapper" && a(t.children);
516
520
  };
517
- return a(e.blocks), i("settings", e.settings, h), r;
521
+ return a(e.blocks), i("settings", e.settings, g), r;
518
522
  }
519
- function Ne(e, t, n) {
523
+ function Pe(e, t, n) {
520
524
  let r = e.l10n?.[t];
521
525
  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));
526
+ let n = y(e, t);
527
+ return typeof n != "string" || n === "" || r?.text?.[t] ? !1 : !Object.keys(r?.set ?? {}).some((n) => (t === n || t.startsWith(`${n}.`)) && (!n.includes(".") || y(e, n.slice(0, n.lastIndexOf("."))) !== void 0));
524
528
  });
525
529
  }
526
- function Pe(e, t, n = {}) {
527
- let r = T(e), i = (e, n, i) => {
528
- let a = Ne(e, t, i), o = p(e.l10n ?? {}), s = o[t] ?? {}, c = p(e);
530
+ function Fe(e, t, n = {}) {
531
+ let r = w(e), i = (e, n, i) => {
532
+ let a = Pe(e, t, i), o = m(e.l10n ?? {}), s = o[t] ?? {}, c = m(e);
529
533
  delete c.l10n;
530
- for (let [e, t] of w(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);
534
+ for (let [e, t] of Ee(s.set)) x(c, e, t);
535
+ for (let [t, n] of Object.entries(s.text ?? {})) y(e, t) !== void 0 && x(c, t, n.value);
532
536
  delete o[t];
533
537
  let l = {}, u = /* @__PURE__ */ new Set([
534
538
  ...Object.keys(s.set ?? {}),
@@ -536,22 +540,22 @@ function Pe(e, t, n = {}) {
536
540
  ...a
537
541
  ]);
538
542
  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] = {
543
+ let r = y(e, t), i = y(c, t);
544
+ h(r, i) ? (s.text?.[t] || a.includes(t)) && n(t) && typeof r == "string" && r !== "" && ((l.text ??= {})[t] = {
541
545
  value: r,
542
546
  sourceHash: C(r)
543
547
  }) : n(t) && typeof r == "string" && typeof i == "string" ? (l.text ??= {})[t] = {
544
548
  value: r,
545
549
  sourceHash: C(i)
546
- } : (l.set ??= {})[t] = r === void 0 ? null : p(r);
550
+ } : (l.set ??= {})[t] = r === void 0 ? null : m(r);
547
551
  }
548
552
  let d = (e, t) => {
549
553
  let n = /* @__PURE__ */ new Set();
550
554
  for (let t of Object.keys(e.set ?? {})) {
551
555
  let e = t.split(".");
552
556
  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;
557
+ let t = y(c, e.slice(0, -1).join("."));
558
+ if (_(t) || Array.isArray(t) && y(c, e.join(".")) !== void 0) break;
555
559
  e.pop();
556
560
  }
557
561
  let r = e.join(".");
@@ -559,20 +563,20 @@ function Pe(e, t, n = {}) {
559
563
  }
560
564
  for (let r of n) {
561
565
  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);
566
+ let n = y(t, r);
567
+ (e.set ??= {})[r] = n === void 0 ? null : m(n);
564
568
  }
565
569
  e.text && !Object.keys(e.text).length && delete e.text;
566
570
  };
567
571
  for (let t of Object.values(o)) {
568
- let n = p(e);
569
- for (let [e, r] of w(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);
572
+ let n = m(e);
573
+ for (let [e, r] of Ee(t.set)) x(n, e, r);
574
+ for (let [r, i] of Object.entries(t.text ?? {})) y(e, r) !== void 0 && x(n, r, i.value);
571
575
  for (let [n, r] of Object.entries(t.text ?? {})) {
572
- let i = v(c, n);
576
+ let i = y(c, n);
573
577
  if (typeof i != "string") (t.set ??= {})[n] = r.value, delete t.text[n];
574
578
  else {
575
- let t = v(e, n);
579
+ let t = y(e, n);
576
580
  typeof t == "string" && r.sourceHash === C(t) && (r.sourceHash = C(i));
577
581
  }
578
582
  }
@@ -580,20 +584,20 @@ function Pe(e, t, n = {}) {
580
584
  }
581
585
  return Object.keys(l).length && (d(l, e), o[r] = l), Object.keys(o).length && (c.l10n = o), c;
582
586
  }, 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) : S(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);
587
+ let t = e.type === "custom" ? [.../* @__PURE__ */ new Set([...Object.hasOwn(n, e.id) ? n[e.id] : [], ...Object.values(e.l10n ?? {}).flatMap((e) => Object.keys(e.text ?? {}))])] : S(e), r = i(e, (n) => e.type === "custom" ? t.includes(n) : we(e.type, n), t);
588
+ return e.type === "custom" && r.type === "custom" && !h(e.fieldValues, r.fieldValues) && delete r.renderedHtml, r.type === "section" ? r.children = r.children.map(a) : r.type === "wrapper" && (r.children = a(r.children)), r;
589
+ }), o = i(e.settings, (e) => g.includes(e), g);
586
590
  return o.locale = t, o.locales = e.settings.locales.map((e) => e === t ? r : e), {
587
591
  blocks: a(e.blocks),
588
592
  settings: o
589
593
  };
590
594
  }
591
595
  // ../types/src/operations.ts
592
- function Fe(e, t, n = []) {
596
+ function Ie(e, t, n = []) {
593
597
  let r = Object.fromEntries(I(e.blocks).flatMap((e) => {
594
598
  if (e.type !== "custom") return [];
595
- let t = x(e, n).filter((t) => typeof v(e, t) == "string");
596
- return t.length && Ve.has(e.id) && O("invalid_operation", 0, He), t.length ? [[e.id, t]] : [];
599
+ let t = S(e, n).filter((t) => typeof y(e, t) == "string");
600
+ return t.length && He.has(e.id) && D("invalid_operation", 0, Ue), t.length ? [[e.id, t]] : [];
597
601
  }));
598
602
  return {
599
603
  op: "setDefaultLocale",
@@ -601,7 +605,7 @@ function Fe(e, t, n = []) {
601
605
  ...Object.keys(r).length ? { customTextFields: r } : {}
602
606
  };
603
607
  }
604
- var E = class extends Error {
608
+ var T = class extends Error {
605
609
  code;
606
610
  opIndex;
607
611
  blockId;
@@ -609,68 +613,68 @@ var E = class extends Error {
609
613
  super(n), this.name = "OperationError", this.code = e, this.opIndex = t, r !== void 0 && (this.blockId = r);
610
614
  }
611
615
  };
612
- function Ie(e) {
616
+ function Le(e) {
613
617
  return e === "1" ? 1 : e === "3" ? 3 : 2;
614
618
  }
615
- function Le(e, t, n = {}) {
616
- let r = p(e);
617
- return D(r, t, n), r;
619
+ function Re(e, t, n = {}) {
620
+ let r = m(e);
621
+ return E(r, t, n), r;
618
622
  }
619
- function D(e, t, n = {}) {
623
+ function E(e, t, n = {}) {
620
624
  let r = {
621
625
  locks: n.locks ?? [],
622
626
  session: n.session ?? null
623
627
  };
624
628
  t.forEach((t, n) => at(e, t, n, r));
625
629
  }
626
- var Re = /* @__PURE__ */ new Set([
630
+ var ze = /* @__PURE__ */ new Set([
627
631
  "id",
628
632
  "type",
629
633
  "children",
630
634
  "l10n"
631
- ]), ze = /* @__PURE__ */ new Set(["locales", "l10n"]), Be = /* @__PURE__ */ new Set([
635
+ ]), Be = /* @__PURE__ */ new Set(["locales", "l10n"]), Ve = /* @__PURE__ */ new Set([
632
636
  "locale",
633
637
  "locales",
634
638
  "l10n"
635
- ]), Ve = /* @__PURE__ */ new Set([
639
+ ]), He = /* @__PURE__ */ new Set([
636
640
  "__proto__",
637
641
  "constructor",
638
642
  "prototype"
639
- ]), He = "customTextFields must map existing custom block ids to lists of string fieldValues paths.";
640
- function O(e, t, n, r) {
641
- throw new E(e, t, n, r);
643
+ ]), Ue = "customTextFields must map existing custom block ids to lists of string fieldValues paths.";
644
+ function D(e, t, n, r) {
645
+ throw new T(e, t, n, r);
642
646
  }
643
- function k(e) {
647
+ function O(e) {
644
648
  return typeof e == "object" && !!e && !Array.isArray(e);
645
649
  }
646
- function A(e) {
650
+ function k(e) {
647
651
  return e.type === "section";
648
652
  }
649
- function j(e) {
653
+ function A(e) {
650
654
  return Array.isArray(e.blocks) ? e.blocks : [];
651
655
  }
652
- function Ue(e) {
656
+ function We(e) {
653
657
  let t = e.children;
654
658
  return Array.isArray(t) ? t.map((e) => Array.isArray(e) ? e : []) : [];
655
659
  }
656
- function M(e, t) {
657
- let n = j(e);
660
+ function j(e, t) {
661
+ let n = A(e);
658
662
  for (let e = 0; e < n.length; e++) {
659
663
  let r = n[e];
660
- if (!k(r)) continue;
664
+ if (!O(r)) continue;
661
665
  if (r.id === t) return {
662
666
  block: r,
663
667
  list: n,
664
668
  index: e,
665
669
  parent: null
666
670
  };
667
- if (!A(r) || typeof r.id != "string") continue;
671
+ if (!k(r) || typeof r.id != "string") continue;
668
672
  let i = r.children;
669
673
  if (Array.isArray(i)) for (let e = 0; e < i.length; e++) {
670
674
  let n = i[e];
671
675
  if (Array.isArray(n)) for (let i = 0; i < n.length; i++) {
672
676
  let a = n[i];
673
- if (k(a) && a.id === t) return {
677
+ if (O(a) && a.id === t) return {
674
678
  block: a,
675
679
  list: n,
676
680
  index: i,
@@ -684,49 +688,49 @@ function M(e, t) {
684
688
  }
685
689
  return null;
686
690
  }
687
- function N(e) {
691
+ function M(e) {
688
692
  let t = typeof e.id == "string" ? [e.id] : [];
689
- if (A(e)) for (let n of Ue(e)) t.push(...We(n));
693
+ if (k(e)) for (let n of We(e)) t.push(...Ge(n));
690
694
  return t;
691
695
  }
692
- function We(e) {
693
- return e.flatMap((e) => k(e) ? N(e) : []);
696
+ function Ge(e) {
697
+ return e.flatMap((e) => O(e) ? M(e) : []);
694
698
  }
695
- function Ge(e, t) {
696
- return typeof e.blockId != "string" || e.blockId === "" ? O("invalid_operation", t, "blockId must be a block id.") : e.blockId;
699
+ function N(e, t) {
700
+ return typeof e.blockId != "string" || e.blockId === "" ? D("invalid_operation", t, "blockId must be a block id.") : e.blockId;
697
701
  }
698
702
  function Ke(e, t) {
699
703
  let n = e.parent;
700
- return n === null ? null : k(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
704
+ return n === null ? null : O(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
701
705
  sectionId: n.sectionId,
702
706
  column: n.column
703
- } : O("invalid_operation", t, "parent must be null or { \"sectionId\", \"column\" }.");
707
+ } : D("invalid_operation", t, "parent must be null or { \"sectionId\", \"column\" }.");
704
708
  }
705
709
  function qe(e, t) {
706
710
  let n = e.after;
707
- return n === null ? null : typeof n == "string" && n !== "" ? n : O("invalid_operation", t, "after must be null or a block id.");
711
+ return n === null ? null : typeof n == "string" && n !== "" ? n : D("invalid_operation", t, "after must be null or a block id.");
708
712
  }
709
713
  function P(e, t) {
710
714
  let n = e.expect;
711
- return n == null ? null : k(n) ? n : O("invalid_operation", t, "expect must be an object.");
715
+ return n == null ? null : O(n) ? n : D("invalid_operation", t, "expect must be an object.");
712
716
  }
713
717
  function Je(e, t, n) {
714
718
  let r = e.set ?? null, i = e.unset ?? [];
715
- (r === null || k(r)) && Array.isArray(i) && i.every((e) => typeof e == "string") || O("invalid_operation", t, "set must be an object and unset a list of keys.");
719
+ (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
720
  let a = r === null ? {} : r, o = Object.keys(a).filter((e) => a[e] !== void 0);
717
- o.length === 0 && i.length === 0 && O("invalid_operation", t, "Set or unset at least one key.");
718
- for (let e of [...o, ...i]) n.has(e) && O("invalid_operation", t, `"${e}" can't be set or unset.`);
721
+ o.length === 0 && i.length === 0 && D("invalid_operation", t, "Set or unset at least one key.");
722
+ for (let e of [...o, ...i]) n.has(e) && D("invalid_operation", t, `"${e}" can't be set or unset.`);
719
723
  let s = i.find((e) => o.includes(e));
720
- return s !== void 0 && O("invalid_operation", t, `"${s}" is both set and unset.`), {
724
+ return s !== void 0 && D("invalid_operation", t, `"${s}" is both set and unset.`), {
721
725
  set: Object.fromEntries(o.map((e) => [e, a[e]])),
722
726
  unset: i
723
727
  };
724
728
  }
725
729
  function Ye(e, t, n) {
726
- if (k(e) && typeof e.id == "string" && e.id !== "" && typeof e.type == "string" || O("invalid_operation", t, "A block needs a non-empty string id and a string type."), !A(e)) return;
727
- n && O("invalid_operation", t, "Sections can only be placed at the top level.");
730
+ 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;
731
+ n && D("invalid_operation", t, "Sections can only be placed at the top level.");
728
732
  let r = e.children;
729
- Array.isArray(r) && r.every((e) => Array.isArray(e)) || O("invalid_operation", t, "A section needs children: a list of columns, each a list of blocks.");
733
+ 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
734
  for (let e of r) for (let n of e) Ye(n, t, !0);
731
735
  }
732
736
  function F(e, t) {
@@ -734,32 +738,32 @@ function F(e, t) {
734
738
  }
735
739
  function Xe(e, t, n) {
736
740
  let r = e.locks.find((n) => t.includes(n.blockId) && F(e, n));
737
- r && O("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
741
+ r && D("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
738
742
  }
739
743
  function Ze(e, t, n, r) {
740
- e.locks.find((r) => F(e, r) && r.blockId === t && ((r.locale ?? null) === null || r.locale === n)) && O("lock_held", r, `Block "${t}" is being edited in another session.`, t);
744
+ 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
745
  }
742
746
  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) || O("precondition_failed", n, r === void 0 ? `Setting "${i}" has changed since.` : `"${i}" of block "${r}" has changed since.`, r));
747
+ for (let [i, a] of Object.entries(t)) a !== void 0 && (h(Object.hasOwn(e, i) && e[i] !== void 0 ? e[i] : null, a) || D("precondition_failed", n, r === void 0 ? `Setting "${i}" has changed since.` : `"${i}" of block "${r}" has changed since.`, r));
744
748
  }
745
749
  function $e(e, t, n) {
746
750
  if (t === null) return Array.isArray(e.blocks) || (e.blocks = []), e.blocks;
747
- let r = M(e, t.sectionId);
748
- if (!r) return O("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
749
- if (!A(r.block)) return O("invalid_operation", n, `Block "${t.sectionId}" isn't a section.`);
751
+ let r = j(e, t.sectionId);
752
+ if (!r) return D("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
753
+ if (!k(r.block)) return D("invalid_operation", n, `Block "${t.sectionId}" isn't a section.`);
750
754
  let i = r.block.children;
751
- return !Array.isArray(i) || t.column < 0 || t.column >= i.length ? O("invalid_operation", n, `Section "${t.sectionId}" has no column ${t.column}.`) : (Array.isArray(i[t.column]) || (i[t.column] = []), i[t.column]);
755
+ 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
756
  }
753
757
  function et(e, t, n) {
754
758
  if (t === null) return 0;
755
- let r = e.findIndex((e) => k(e) && e.id === t);
756
- return r === -1 ? O("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
759
+ let r = e.findIndex((e) => O(e) && e.id === t);
760
+ return r === -1 ? D("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
757
761
  }
758
762
  function tt(e, t, n, r) {
759
- let i = Ie(t), a = Array.isArray(e.children) ? e.children : [];
763
+ let i = Le(t), a = Array.isArray(e.children) ? e.children : [];
760
764
  for (let e = i; e < a.length; e++) {
761
765
  let t = a[e];
762
- Array.isArray(t) && t.length > 0 && O("invalid_operation", n, `Column ${e} of section "${r}" still holds blocks, so the layout can't drop it.`);
766
+ 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
767
  }
764
768
  let o = a.slice(0, i);
765
769
  for (; o.length < i;) o.push([]);
@@ -767,15 +771,15 @@ function tt(e, t, n, r) {
767
771
  }
768
772
  function nt(e, t, n) {
769
773
  for (let [n, r] of Object.entries(t)) n === "__proto__" ? Object.defineProperty(e, n, {
770
- value: p(r),
774
+ value: m(r),
771
775
  writable: !0,
772
776
  enumerable: !0,
773
777
  configurable: !0
774
- }) : e[n] = p(r);
778
+ }) : e[n] = m(r);
775
779
  for (let t of n) delete e[t];
776
780
  }
777
781
  function rt(e) {
778
- return me(e).map((t) => {
782
+ return pe(e).map((t) => {
779
783
  let n = t.path.replace(/\.(items|icons|rows)\[.*$/, "").replace(/\[(\d+)\]/g, ".$1").split(".").reduce((e, t) => e[t], e);
780
784
  return {
781
785
  id: t.id,
@@ -785,11 +789,11 @@ function rt(e) {
785
789
  }
786
790
  function it(e, t, n) {
787
791
  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 && O("invalid_operation", t, `Element id "${a.id}" must not contain "." or "/".`, a.blockId);
792
+ a && D("invalid_operation", t, `Element id "${a.id}" must not contain "." or "/".`, a.blockId);
789
793
  }
790
794
  function at(e, t, n, r) {
791
795
  let i = t;
792
- switch (k(i) && typeof i.op == "string" || O("invalid_operation", n, "Each operation must be an object with an \"op\"."), i.op) {
796
+ switch (O(i) && typeof i.op == "string" || D("invalid_operation", n, "Each operation must be an object with an \"op\"."), i.op) {
793
797
  case "addBlock": return ot(e, i, n);
794
798
  case "moveBlock": return st(e, i, n, r);
795
799
  case "deleteBlock": return ct(e, i, n, r);
@@ -801,7 +805,7 @@ function at(e, t, n, r) {
801
805
  case "removeLocale": return ht(e, i, n);
802
806
  case "updateBlockLocale": return Ct(e, i, n, r);
803
807
  case "updateSettingsLocale": return wt(e, i, n);
804
- default: O("invalid_operation", n, `Unknown operation "${i.op}".`);
808
+ default: D("invalid_operation", n, `Unknown operation "${i.op}".`);
805
809
  }
806
810
  }
807
811
  function ot(e, t, n) {
@@ -810,32 +814,32 @@ function ot(e, t, n) {
810
814
  blocks: [a],
811
815
  settings: e.settings
812
816
  }, n);
813
- let o = new Set(We(j(e))), s = /* @__PURE__ */ new Set();
814
- for (let e of N(a)) (o.has(e) || s.has(e)) && O("block_exists", n, `A block with id "${e}" already exists.`, e), s.add(e);
817
+ let o = new Set(Ge(A(e))), s = /* @__PURE__ */ new Set();
818
+ 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
819
  let c = $e(e, r, n), l = et(c, i, n);
816
- St(e, a, r, n, !0), c.splice(l, 0, p(a));
820
+ St(e, a, r, n, !0), c.splice(l, 0, m(a));
817
821
  }
818
822
  function st(e, t, n, r) {
819
- let i = Ge(t, n), a = Ke(t, n), o = qe(t, n), s = P(t, n), c = M(e, i);
820
- if (!c) return O("block_missing", n, `No block with id "${i}".`, i);
821
- if (Xe(r, N(c.block), n), s) {
822
- let e = c.index > 0 ? c.list[c.index - 1] : null, t = k(e) ? e.id ?? null : null;
823
- m(c.parent, s.parent ?? null) && m(t, s.after ?? null) || O("precondition_failed", n, `Block "${i}" has moved since.`, i);
823
+ let i = N(t, n), a = Ke(t, n), o = qe(t, n), s = P(t, n), c = j(e, i);
824
+ if (!c) return D("block_missing", n, `No block with id "${i}".`, i);
825
+ if (Xe(r, M(c.block), n), s) {
826
+ let e = c.index > 0 ? c.list[c.index - 1] : null, t = O(e) ? e.id ?? null : null;
827
+ h(c.parent, s.parent ?? null) && h(t, s.after ?? null) || D("precondition_failed", n, `Block "${i}" has moved since.`, i);
824
828
  }
825
- A(c.block) && a !== null && O("invalid_operation", n, "Sections can only be placed at the top level."), o === i && O("invalid_operation", n, "A block can't be placed after itself.");
829
+ 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
830
  let l = $e(e, a, n);
827
831
  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
832
  }
829
833
  function ct(e, t, n, r) {
830
- let i = Ge(t, n), a = P(t, n), o = M(e, i);
831
- if (!o) return O("block_missing", n, `No block with id "${i}".`, i);
832
- Xe(r, N(o.block), n), a && !m(o.block, a.block ?? null) && O("precondition_failed", n, `Block "${i}" has changed since.`, i), o.list.splice(o.index, 1);
834
+ let i = N(t, n), a = P(t, n), o = j(e, i);
835
+ if (!o) return D("block_missing", n, `No block with id "${i}".`, i);
836
+ Xe(r, M(o.block), n), a && !h(o.block, a.block ?? null) && D("precondition_failed", n, `Block "${i}" has changed since.`, i), o.list.splice(o.index, 1);
833
837
  }
834
838
  function lt(e, t, n, r) {
835
- let i = Ge(t, n), { set: a, unset: o } = Je(t, n, Re), s = P(t, n), c = M(e, i);
836
- if (!c) return O("block_missing", n, `No block with id "${i}".`, i);
837
- let l = c.block, u = A(l);
838
- u && o.includes("columns") && O("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 i = N(t, n), { set: a, unset: o } = Je(t, n, ze), s = P(t, n), c = j(e, i);
840
+ if (!c) return D("block_missing", n, `No block with id "${i}".`, i);
841
+ let l = c.block, u = k(l);
842
+ 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
843
  let d = { ...l };
840
844
  nt(d, a, o), it({
841
845
  blocks: [d],
@@ -844,53 +848,53 @@ function lt(e, t, n, r) {
844
848
  blocks: [l],
845
849
  settings: e.settings
846
850
  }), 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);
851
+ let f = b(l);
852
+ h(l.l10n, f.l10n) || (f.l10n ? l.l10n = f.l10n : delete l.l10n), u && f.type === "section" && !h(l.children, f.children) && (l.children = f.children);
849
853
  }
850
854
  function ut(e, t, n) {
851
- let { set: r, unset: i } = Je(t, n, ze), a = P(t, n);
852
- e.settings?.locales?.length && (Object.hasOwn(r, "locale") || i.includes("locale")) && O("invalid_operation", n, "The default locale can't change while language versions exist."), k(e.settings) || (e.settings = {});
855
+ let { set: r, unset: i } = Je(t, n, Be), a = P(t, n);
856
+ 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
857
  let o = e.settings;
854
858
  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);
859
+ let s = Se(e.settings);
860
+ h(o.l10n, s.l10n) || (s.l10n ? o.l10n = s.l10n : delete o.l10n);
857
861
  }
858
862
  function dt(e, t) {
859
863
  let n = e.locale;
860
- return ve(n) && n !== "__proto__" && n !== "constructor" && n !== "prototype" || O("invalid_operation", t, "locale must be a language tag."), n;
864
+ return _e(n) && n !== "__proto__" && n !== "constructor" && n !== "prototype" || D("invalid_operation", t, "locale must be a language tag."), n;
861
865
  }
862
866
  function ft(e, t, n) {
863
867
  let r = dt(t, n);
864
- return e.settings.locales?.includes(r) || O("invalid_operation", n, `Locale "${r}" isn't in settings.locales.`), r;
868
+ return e.settings.locales?.includes(r) || D("invalid_operation", n, `Locale "${r}" isn't in settings.locales.`), r;
865
869
  }
866
870
  function pt(e, t, n) {
867
871
  let r = dt(t, n), i = e.settings.locales ?? [], a = r.toLowerCase(), o = t.position === void 0 ? i.length : t.position;
868
- (T(e).toLowerCase() === a || i.some((e) => e.toLowerCase() === a) || typeof o != "number" || !Number.isInteger(o) || o < 0 || o > i.length) && O("invalid_operation", n, "The locale already exists or its insertion position is invalid."), e.settings.locales || (e.settings.locales = []), e.settings.locales.splice(o, 0, r);
872
+ (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
873
  }
870
874
  function I(e) {
871
- return e.flatMap((e) => k(e) ? [e, ...A(e) ? Ue(e).flatMap(I) : e.type === "wrapper" && Array.isArray(e.children) ? I(e.children) : []] : []);
875
+ return e.flatMap((e) => O(e) ? [e, ...k(e) ? We(e).flatMap(I) : e.type === "wrapper" && Array.isArray(e.children) ? I(e.children) : []] : []);
872
876
  }
873
877
  function mt(e, t) {
874
878
  let n = e.l10n;
875
- return k(n) && k(n[t]) ? n[t] : {};
879
+ return O(n) && O(n[t]) ? n[t] : {};
876
880
  }
877
881
  function ht(e, t, n) {
878
882
  let r = ft(e, t, n), i = P(t, n);
879
- i && (!k(i.blocks) || i.settings !== void 0 && !k(i.settings)) && O("invalid_operation", n, "expect needs a blocks object and an optional settings layer.");
880
- let a = e.settings, o = I(j(e)), s = Object.fromEntries(o.flatMap((e) => k(e.l10n) && Object.hasOwn(e.l10n, r) ? [[String(e.id), e.l10n[r]]] : []));
881
- !i || m(s, i.blocks) && m(k(a.l10n) ? a.l10n[r] : void 0, i.settings) || O("precondition_failed", n, `Locale "${r}" has changed since.`);
882
- for (let e of [...o, a]) k(e.l10n) && (delete e.l10n[r], Object.keys(e.l10n).length === 0 && delete e.l10n);
883
+ 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.");
884
+ 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]]] : []));
885
+ !i || h(s, i.blocks) && h(O(a.l10n) ? a.l10n[r] : void 0, i.settings) || D("precondition_failed", n, `Locale "${r}" has changed since.`);
886
+ for (let e of [...o, a]) O(e.l10n) && (delete e.l10n[r], Object.keys(e.l10n).length === 0 && delete e.l10n);
883
887
  e.settings.locales.splice(e.settings.locales.indexOf(r), 1), e.settings.locales.length === 0 && delete e.settings.locales;
884
888
  }
885
889
  function gt(e, t, n) {
886
- (e.text === void 0 || ((e) => k(e) && Object.values(e).every((e) => k(e) && typeof e.value == "string" && typeof e.sourceHash == "string"))(e.text)) && (e.set === void 0 || k(e.set) && !Object.values(e.set).some((e) => e === void 0)) && (e.unset === void 0 || Array.isArray(e.unset) && e.unset.every((e) => typeof e == "string" && e !== "" && _(e))) && (e.hidden === void 0 || !n && typeof e.hidden == "boolean") && [
890
+ (e.text === void 0 || ((e) => O(e) && Object.values(e).every((e) => O(e) && typeof e.value == "string" && typeof e.sourceHash == "string"))(e.text)) && (e.set === void 0 || O(e.set) && !Object.values(e.set).some((e) => e === void 0)) && (e.unset === void 0 || Array.isArray(e.unset) && e.unset.every((e) => typeof e == "string" && e !== "" && v(e))) && (e.hidden === void 0 || !n && typeof e.hidden == "boolean") && [
887
891
  "text",
888
892
  "set",
889
893
  "unset",
890
894
  ...n ? [] : ["hidden"]
891
- ].some((t) => e[t] !== void 0) || O("invalid_operation", t, "A locale update needs text, set, unset or a block's boolean hidden.");
895
+ ].some((t) => e[t] !== void 0) || D("invalid_operation", t, "A locale update needs text, set, unset or a block's boolean hidden.");
892
896
  let r = P(e, t);
893
- return r && (r.text !== void 0 && !k(r.text) || r.set !== void 0 && !k(r.set) || r.hidden !== void 0 && (n || typeof r.hidden != "boolean")) && O("invalid_operation", t, "The locale layer expect is malformed."), {
897
+ 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
898
  text: e.text ?? {},
895
899
  set: e.set ?? {},
896
900
  unset: e.unset ?? [],
@@ -899,45 +903,45 @@ function gt(e, t, n) {
899
903
  };
900
904
  }
901
905
  function _t(e, t, n, r) {
902
- for (let i of Object.keys(t.text)) _(i) && (r ? h.includes(i) : S(String(e.type), i)) && v(e, i) !== void 0 || O("invalid_operation", n, `Text path "${i}" isn't translatable or doesn't resolve.`);
906
+ for (let i of Object.keys(t.text)) v(i) && (r ? g.includes(i) : we(String(e.type), i)) && y(e, i) !== void 0 || D("invalid_operation", n, `Text path "${i}" isn't translatable or doesn't resolve.`);
903
907
  for (let i of Object.keys(t.set)) {
904
- let a = i.split("."), o = r ? Be : Re, 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 && !k(s)) && O("invalid_operation", n, `Override path "${i}" is immutable or doesn't resolve.`);
908
+ let a = i.split("."), o = r ? Ve : ze, s = a.length === 1 ? e : y(e, a.slice(0, -1).join("."));
909
+ (!v(i) || o.has(a[0]) || !r && xe(e, i, t.set[i]) || y(e, i) === void 0 && !O(s)) && D("invalid_operation", n, `Override path "${i}" is immutable or doesn't resolve.`);
906
910
  }
907
911
  }
908
912
  function vt(e, t, n, r) {
909
913
  if (t) {
910
- for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {})) m(e[i]?.[a] ?? null, o) || O("precondition_failed", n, `Locale path "${a}" has changed since.`, r);
911
- t.hidden !== void 0 && !m(e.hidden === !0, t.hidden) && O("precondition_failed", n, "The locale's hidden state has changed since.", r);
914
+ for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {})) h(e[i]?.[a] ?? null, o) || D("precondition_failed", n, `Locale path "${a}" has changed since.`, r);
915
+ t.hidden !== void 0 && !h(e.hidden === !0, t.hidden) && D("precondition_failed", n, "The locale's hidden state has changed since.", r);
912
916
  }
913
917
  }
914
918
  function yt(e, t, n) {
915
- k(e.l10n) || (e.l10n = {});
919
+ O(e.l10n) || (e.l10n = {});
916
920
  let r = e.l10n;
917
- k(r[t]) || (r[t] = {});
921
+ O(r[t]) || (r[t] = {});
918
922
  let i = r[t];
919
923
  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];
924
+ for (let [e, t] of Object.entries(n.text)) i.text ||= {}, i.text[e] = m(t), i.set && delete i.set[e];
925
+ for (let [e, t] of Object.entries(n.set)) i.set ||= {}, i.set[e] = m(t), i.text && delete i.text[e];
922
926
  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
927
  }
924
928
  function L(e) {
925
- return k(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(L) : L(e)) : !1;
929
+ return O(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(L) : L(e)) : !1;
926
930
  }
927
931
  function bt(e) {
928
- return k(e) && k(e.l10n) && Object.values(e.l10n).some((e) => k(e) && e.hidden === !0);
932
+ return O(e) && O(e.l10n) && Object.values(e.l10n).some((e) => O(e) && e.hidden === !0);
929
933
  }
930
934
  function xt(e) {
931
- return !k(e) || !L(e) ? !1 : bt(e) ? !0 : Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(xt) : xt(e));
935
+ 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
936
  }
933
937
  function St(e, t, n, r, i) {
934
938
  if (!L(t)) return;
935
- let a = n === null ? null : M(e, n.sectionId);
936
- (a !== null && bt(a.block) || i && xt(t)) && O("invalid_operation", r, "A layout's slot block can't be placed inside a block that a language hides.", k(t) && typeof t.id == "string" ? t.id : void 0);
939
+ let a = n === null ? null : j(e, n.sectionId);
940
+ (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
941
  }
938
942
  function Ct(e, t, n, r) {
939
- let i = ft(e, t, n), a = Ge(t, n), o = gt(t, n, !1), s = I(j(e)).find((e) => e.id === a);
940
- s || O("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) && O("invalid_operation", n, "A layout's slot block, and any block that contains it, can't be hidden.", a), yt(s, i, o);
943
+ let i = ft(e, t, n), a = N(t, n), o = gt(t, n, !1), s = I(A(e)).find((e) => e.id === a);
944
+ 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
945
  }
942
946
  function wt(e, t, n) {
943
947
  let r = ft(e, t, n), i = gt(t, n, !0), a = e.settings;
@@ -945,28 +949,28 @@ function wt(e, t, n) {
945
949
  }
946
950
  function Tt(e, t, n, r) {
947
951
  let i = t.content;
948
- if (!k(i) || !Array.isArray(i.blocks) || !k(i.settings)) return O("invalid_operation", n, "setContent needs content with a blocks array and a settings object.");
952
+ 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
953
  it(i, n, e);
950
954
  let a = r.locks.find((e) => F(r, e));
951
- a && O("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = p(i.blocks), e.settings = p(i.settings);
955
+ a && D("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = m(i.blocks), e.settings = m(i.settings);
952
956
  }
953
957
  function Et(e, t, n, r) {
954
958
  let i = dt(t, n);
955
- e.settings.locales?.includes(i) || O("invalid_operation", n, `"${i}" is not a language version of this template.`);
956
- let a = je(e, i);
957
- a.length && O("invalid_operation", n, a.length === 1 ? `1 block is hidden in "${i}". Show it before making it the default.` : `${a.length} blocks are hidden in "${i}". Show them before making it the default.`, a[0]);
959
+ e.settings.locales?.includes(i) || D("invalid_operation", n, `"${i}" is not a language version of this template.`);
960
+ let a = Me(e, i);
961
+ 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
962
  let o = r.locks.find((e) => F(r, e));
959
- o && O("locked_by_others", n, "Other sessions hold locks on this template.", o.blockId);
963
+ o && D("locked_by_others", n, "Other sessions hold locks on this template.", o.blockId);
960
964
  let s = t.customTextFields;
961
965
  if (s !== void 0) {
962
966
  let t = I(e.blocks);
963
- (!k(s) || Object.getOwnPropertyNames(s).some((e) => {
964
- if (Ve.has(e)) return !0;
967
+ (!O(s) || Object.getOwnPropertyNames(s).some((e) => {
968
+ if (He.has(e)) return !0;
965
969
  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) || !S("custom", e) || typeof v(r, e) != "string");
967
- })) && O("invalid_operation", n, He);
970
+ return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !v(e) || !we("custom", e) || typeof y(r, e) != "string");
971
+ })) && D("invalid_operation", n, Ue);
968
972
  }
969
- let c = Pe(e, i, t.customTextFields);
973
+ let c = Fe(e, i, t.customTextFields);
970
974
  e.blocks = c.blocks, e.settings = c.settings;
971
975
  }
972
976
  // ../types/src/invert-operations.ts
@@ -996,16 +1000,16 @@ function Ot(e, t, n = null) {
996
1000
  }
997
1001
  function kt(e, t, n) {
998
1002
  let r = Ot(e.blocks, t);
999
- if (!r) throw new E("block_missing", n, `No block with id "${t}".`, t);
1003
+ if (!r) throw new T("block_missing", n, `No block with id "${t}".`, t);
1000
1004
  return r;
1001
1005
  }
1002
1006
  function At(e, t, n) {
1003
1007
  let r = {}, i = [], a = {}, o = [.../* @__PURE__ */ new Set([...Object.keys(t ?? {}), ...n ?? []])];
1004
1008
  for (let n of o) {
1005
1009
  let o = e[n];
1006
- o === void 0 ? i.push(n) : r[n] = p(o);
1010
+ o === void 0 ? i.push(n) : r[n] = m(o);
1007
1011
  let s = t && n in t ? t[n] : void 0;
1008
- a[n] = s === void 0 ? null : p(s);
1012
+ a[n] = s === void 0 ? null : m(s);
1009
1013
  }
1010
1014
  return {
1011
1015
  set: r,
@@ -1019,7 +1023,7 @@ function R(e, t) {
1019
1023
  function z(e, t, n, r) {
1020
1024
  let i = {}, a = {}, o = {};
1021
1025
  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);
1026
+ for (let r of n) e.text?.[r] !== void 0 && (i[r] = m(e.text[r])), e.set && Object.hasOwn(e.set, r) && (a[r] = m(e.set[r])), o.text[r] = m(t.text?.[r] ?? null), o.set[r] = m(t.set?.[r] ?? null);
1023
1027
  return r && (o.hidden = t.hidden === !0), {
1024
1028
  unset: n,
1025
1029
  ...Object.keys(i).length ? { text: i } : {},
@@ -1036,8 +1040,8 @@ function B(e) {
1036
1040
  return e.flatMap((e) => [e, ...e.type === "wrapper" ? B(e.children) : Dt(e).flatMap(B)]);
1037
1041
  }
1038
1042
  function Mt(e, t) {
1039
- let n = p(e);
1040
- D(n, [t]);
1043
+ let n = m(e);
1044
+ E(n, [t]);
1041
1045
  let r = [], i = (e, t, n) => {
1042
1046
  for (let [i, a] of Object.entries(e.l10n ?? {})) {
1043
1047
  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))])];
@@ -1070,13 +1074,13 @@ function Nt(e, t, n) {
1070
1074
  case "addBlock": return {
1071
1075
  op: "deleteBlock",
1072
1076
  blockId: t.block.id,
1073
- expect: { block: p(t.block) }
1077
+ expect: { block: m(t.block) }
1074
1078
  };
1075
1079
  case "deleteBlock": {
1076
1080
  let r = kt(e, t.blockId, n);
1077
1081
  return {
1078
1082
  op: "addBlock",
1079
- block: p(r.block),
1083
+ block: m(r.block),
1080
1084
  parent: r.parent,
1081
1085
  after: r.after
1082
1086
  };
@@ -1146,8 +1150,8 @@ function Nt(e, t, n) {
1146
1150
  }
1147
1151
  case "updateBlockLocale":
1148
1152
  case "updateSettingsLocale": {
1149
- let n = p(e);
1150
- D(n, [t]);
1153
+ let n = m(e);
1154
+ E(n, [t]);
1151
1155
  let r = [.../* @__PURE__ */ new Set([
1152
1156
  ...Object.keys(t.text ?? {}),
1153
1157
  ...Object.keys(t.set ?? {}),
@@ -1173,20 +1177,20 @@ function Nt(e, t, n) {
1173
1177
  case "setContent": return {
1174
1178
  op: "setContent",
1175
1179
  content: {
1176
- blocks: p(e.blocks),
1177
- settings: p(e.settings)
1180
+ blocks: m(e.blocks),
1181
+ settings: m(e.settings)
1178
1182
  }
1179
1183
  };
1180
1184
  }
1181
1185
  }
1182
1186
  function Pt(e, t) {
1183
- let n = p(e), r = [];
1187
+ let n = m(e), r = [];
1184
1188
  return t.forEach((e, t) => {
1185
1189
  try {
1186
1190
  let i = Nt(n, e, t);
1187
- r.push(...Array.isArray(i) ? [...i].reverse() : [i]), D(n, [e]);
1191
+ r.push(...Array.isArray(i) ? [...i].reverse() : [i]), E(n, [e]);
1188
1192
  } catch (e) {
1189
- throw e instanceof E ? new E(e.code, t, e.message, e.blockId) : e;
1193
+ throw e instanceof T ? new T(e.code, t, e.message, e.blockId) : e;
1190
1194
  }
1191
1195
  }), r.reverse();
1192
1196
  }
@@ -1194,7 +1198,7 @@ function Pt(e, t) {
1194
1198
  function Ft(e) {
1195
1199
  return e === "invalid_operation" ? 422 : e === "content_too_large" ? 413 : 409;
1196
1200
  }
1197
- var It = class extends ge {
1201
+ var It = class extends he {
1198
1202
  opIndex;
1199
1203
  holder;
1200
1204
  holders;
@@ -1392,23 +1396,56 @@ function vn(e) {
1392
1396
  }
1393
1397
  // ../types/src/translation.ts
1394
1398
  var yn = 2e4, bn = /* @__PURE__ */ new Set(["\"", "'"]);
1395
- function U(e, t) {
1399
+ function xn(e, t) {
1400
+ let n = null, r = "tag";
1401
+ for (let i = t; i < e.length; i++) {
1402
+ let t = e[i];
1403
+ if (n !== null) t === n && (n = null);
1404
+ else {
1405
+ if (r === "beforeValue") {
1406
+ if (U(t)) continue;
1407
+ if (bn.has(t)) {
1408
+ n = t, r = "tag";
1409
+ continue;
1410
+ }
1411
+ r = "unquotedValue";
1412
+ }
1413
+ if (r === "unquotedValue") {
1414
+ if (t === ">") return i;
1415
+ U(t) && (r = "tag");
1416
+ } else if (t === "=") r = "beforeValue";
1417
+ else if (t === ">") return i;
1418
+ }
1419
+ }
1420
+ return -1;
1421
+ }
1422
+ function Sn(e, t) {
1396
1423
  let n = null;
1397
1424
  for (let r = t; r < e.length; r++) {
1398
1425
  let t = e[r];
1399
1426
  if (n !== null) t === n && (n = null);
1400
1427
  else if (bn.has(t)) n = t;
1401
- else if (t === ">") return r;
1428
+ else if (t === ">") return {
1429
+ end: r,
1430
+ nextSpan: -1
1431
+ };
1432
+ else if (t === "<" && e.startsWith("<span", r)) return {
1433
+ end: -1,
1434
+ nextSpan: r
1435
+ };
1402
1436
  }
1403
- return -1;
1437
+ return {
1438
+ end: -1,
1439
+ nextSpan: -1
1440
+ };
1404
1441
  }
1405
- function xn(e) {
1442
+ function Cn(e) {
1406
1443
  return e !== " " && e !== " " && e !== "\n" && e !== "\r" && e !== "\f" && e !== "=" && e !== ">" && e !== "/";
1407
1444
  }
1408
- function W(e) {
1445
+ function U(e) {
1409
1446
  return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
1410
1447
  }
1411
- var Sn = {
1448
+ var wn = {
1412
1449
  AMP: "&",
1413
1450
  COPY: "©",
1414
1451
  GT: ">",
@@ -1669,54 +1706,54 @@ var Sn = {
1669
1706
  zwj: "‍",
1670
1707
  zwnj: "‌"
1671
1708
  };
1672
- function G(e) {
1709
+ function W(e) {
1673
1710
  return e.includes("&") ? e.replace(/&(#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g, (e, t) => {
1674
1711
  if (t[0] === "#") {
1675
1712
  let n = t[1] === "x" || t[1] === "X" ? Number.parseInt(t.slice(2), 16) : Number.parseInt(t.slice(1), 10);
1676
1713
  return !Number.isFinite(n) || n < 1 || n > 1114111 || n >= 55296 && n <= 57343 ? e : String.fromCodePoint(n);
1677
1714
  }
1678
- return Object.hasOwn(Sn, t) ? Sn[t] : e;
1715
+ return Object.hasOwn(wn, t) ? wn[t] : e;
1679
1716
  }) : e;
1680
1717
  }
1681
- function Cn(e, t) {
1718
+ function Tn(e, t) {
1682
1719
  let n = t.toLowerCase(), r = 0;
1683
1720
  for (; r < e.length;) {
1684
- for (; r < e.length && (W(e[r]) || e[r] === "/");) r++;
1721
+ for (; r < e.length && (U(e[r]) || e[r] === "/");) r++;
1685
1722
  if (r >= e.length) break;
1686
1723
  let t = r;
1687
- for (; r < e.length && xn(e[r]);) r++;
1724
+ for (; r < e.length && Cn(e[r]);) r++;
1688
1725
  let i = e.substring(t, r).toLowerCase();
1689
1726
  if (i === "") {
1690
1727
  r++;
1691
1728
  continue;
1692
1729
  }
1693
- for (; r < e.length && W(e[r]);) r++;
1730
+ for (; r < e.length && U(e[r]);) r++;
1694
1731
  if (e[r] !== "=") continue;
1695
- for (r++; r < e.length && W(e[r]);) r++;
1732
+ for (r++; r < e.length && U(e[r]);) r++;
1696
1733
  let a = e[r];
1697
1734
  if (bn.has(a)) {
1698
1735
  let t = r + 1, o = e.indexOf(a, t);
1699
1736
  if (o === -1) return null;
1700
- if (i === n) return G(e.substring(t, o));
1737
+ if (i === n) return W(e.substring(t, o));
1701
1738
  r = o + 1;
1702
1739
  continue;
1703
1740
  }
1704
1741
  let o = r;
1705
- for (; r < e.length && !W(e[r]) && e[r] !== ">";) r++;
1706
- if (i === n) return G(e.substring(o, r));
1742
+ for (; r < e.length && !U(e[r]) && e[r] !== ">";) r++;
1743
+ if (i === n) return W(e.substring(o, r));
1707
1744
  }
1708
1745
  return null;
1709
1746
  }
1710
1747
  // ../types/src/merge-tag-html.ts
1711
- function wn(e) {
1712
- return Dn(e, (e) => e, !1);
1748
+ function En(e) {
1749
+ return kn(e, (e) => e, !1);
1713
1750
  }
1714
- function Tn(e, t) {
1715
- return Dn(e, t, !0);
1751
+ function Dn(e, t) {
1752
+ return kn(e, t, !0);
1716
1753
  }
1717
- function En(e) {
1754
+ function On(e) {
1718
1755
  let t = [];
1719
- return Dn(e, (n, r, i) => {
1756
+ return kn(e, (n, r, i) => {
1720
1757
  let a = e.slice(r, i);
1721
1758
  return t.push({
1722
1759
  start: r,
@@ -1725,7 +1762,7 @@ function En(e) {
1725
1762
  }), a;
1726
1763
  }, !0), t;
1727
1764
  }
1728
- function Dn(e, t, n) {
1765
+ function kn(e, t, n) {
1729
1766
  let r = "", i = 0;
1730
1767
  for (; i < e.length;) {
1731
1768
  let a = e.indexOf("<span", i);
@@ -1738,26 +1775,30 @@ function Dn(e, t, n) {
1738
1775
  r += e.substring(i, a + 5), i = a + 5;
1739
1776
  continue;
1740
1777
  }
1741
- let s = U(e, a + 5);
1778
+ let { end: s, nextSpan: c } = Sn(e, a + 5);
1779
+ if (c !== -1) {
1780
+ r += e.substring(i, c), i = c;
1781
+ continue;
1782
+ }
1742
1783
  if (s === -1) {
1743
1784
  r += e.substring(i);
1744
1785
  break;
1745
1786
  }
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;
1787
+ let l = e.substring(a + 5, s), u = jn(l, "data-merge-tag") ?? jn(l, "data-logic-merge-tag");
1788
+ if (u === null) {
1789
+ r += e.substring(i, s + 1), i = s + 1;
1749
1790
  continue;
1750
1791
  }
1751
- let u = On(e, s + 1, n);
1752
- if (u === -1) {
1792
+ let d = An(e, s + 1, n);
1793
+ if (d === -1) {
1753
1794
  r += e.substring(i);
1754
1795
  break;
1755
1796
  }
1756
- r += e.substring(i, a), r += t(l, a, u), i = u;
1797
+ r += e.substring(i, a), r += t(u, a, d), i = d;
1757
1798
  }
1758
1799
  return r;
1759
1800
  }
1760
- function On(e, t, n) {
1801
+ function An(e, t, n) {
1761
1802
  if (!n) {
1762
1803
  let n = e.indexOf("</span>", t);
1763
1804
  return n === -1 ? -1 : n + 7;
@@ -1766,7 +1807,7 @@ function On(e, t, n) {
1766
1807
  for (; i < e.length;) {
1767
1808
  let t = e.indexOf("<", i);
1768
1809
  if (t === -1) return -1;
1769
- let n = U(e, t + 1);
1810
+ let n = xn(e, t + 1);
1770
1811
  if (n === -1) return -1;
1771
1812
  let a = e.startsWith("</span", t), o = e.startsWith("<span", t), s = e[t + (a ? 6 : 5)];
1772
1813
  if ((o || a) && (s === ">" || s === "/" || /\s/.test(s)) && (r += a ? -1 : 1, r === 0)) return n + 1;
@@ -1774,18 +1815,259 @@ function On(e, t, n) {
1774
1815
  }
1775
1816
  return -1;
1776
1817
  }
1777
- function kn(e, t) {
1778
- return Cn(e, t);
1818
+ function jn(e, t) {
1819
+ return Tn(e, t);
1820
+ }
1821
+ // ../types/src/merge-tags.ts
1822
+ var G = {
1823
+ liquid: {
1824
+ value: /\{\{.+?\}\}/g,
1825
+ logic: /\{%-?\s*(\w+).*?-?%\}/g,
1826
+ opener: "{{",
1827
+ closer: "}}"
1828
+ },
1829
+ handlebars: {
1830
+ value: /\{\{\{?.+?\}?\}\}/g,
1831
+ logic: /\{\{[#/](\w+).*?\}\}/g,
1832
+ opener: "{{",
1833
+ closer: "}}"
1834
+ },
1835
+ mailchimp: {
1836
+ value: /\*\|\w+\|\*/g,
1837
+ logic: /\*\|(\w+)[:|].*?\|\*/g,
1838
+ opener: "*|",
1839
+ closer: "|*"
1840
+ },
1841
+ ampscript: {
1842
+ value: /%%=.+?=%%/g,
1843
+ logic: /%%\[\s*(\w+).*?\]%%/g,
1844
+ opener: "%%=",
1845
+ closer: "=%%"
1846
+ }
1847
+ };
1848
+ function Mn(e, t, n) {
1849
+ for (let r = n; r < e.length; r++) {
1850
+ let n = e.charCodeAt(r);
1851
+ if (n === 10 || n === 13 || n === 8232 || n === 8233) return {
1852
+ close: -1,
1853
+ lineBreak: r
1854
+ };
1855
+ if (e.startsWith(t, r)) return {
1856
+ close: r,
1857
+ lineBreak: -1
1858
+ };
1859
+ }
1860
+ return {
1861
+ close: -1,
1862
+ lineBreak: -1
1863
+ };
1864
+ }
1865
+ function K(e, t, n, r = 0, i = Infinity) {
1866
+ let a = Object.keys(G).find((e) => G[e] === t);
1867
+ if (!a) {
1868
+ let a = t[n], o = new RegExp(a.source, a.flags.replace(/[gy]/g, "") + "g");
1869
+ return o.lastIndex = r, [...e.matchAll(o)].slice(0, i).map((e) => ({
1870
+ index: e.index,
1871
+ value: e[0]
1872
+ }));
1873
+ }
1874
+ let o = t[n], s = a === "ampscript" ? n === "value" ? "%%=" : "%%[" : a === "liquid" && n === "logic" ? "{%" : a === "mailchimp" ? "*|" : "{{", c = a === "ampscript" ? n === "value" ? "=%%" : "]%%" : a === "liquid" && n === "logic" ? "%}" : a === "mailchimp" ? "|*" : "}}", l = n === "logic" ? {
1875
+ liquid: String.raw`\{%-?\s*\w+`,
1876
+ handlebars: String.raw`\{\{[#/]\w+`,
1877
+ mailchimp: String.raw`\*\|\w+[:|]`,
1878
+ ampscript: String.raw`%%\[\s*\w+`
1879
+ }[a] : a === "mailchimp" ? String.raw`\*\|\w+` : null, u = l ? new RegExp(l, "y") : null, d = new RegExp(o.source, "y"), f = [], p = r;
1880
+ for (; p < e.length && f.length < i;) {
1881
+ let t = e.indexOf(s, p);
1882
+ if (t < 0) break;
1883
+ if (u && (u.lastIndex = t, !u.exec(e))) {
1884
+ p = t + 1;
1885
+ continue;
1886
+ }
1887
+ let r = u?.lastIndex ?? t + s.length, i = a === "mailchimp" && n === "value" ? {
1888
+ close: e.startsWith(c, r) ? r : -1,
1889
+ lineBreak: -1
1890
+ } : Mn(e, c, Math.max(r, t + s.length + +(n === "value")));
1891
+ if (i.lineBreak >= 0) {
1892
+ let r = i.lineBreak, o = n === "logic" && (a === "liquid" || a === "ampscript") ? e.lastIndexOf(s, r) : -1;
1893
+ p = o > t ? o : r + 1;
1894
+ continue;
1895
+ }
1896
+ if (i.close < 0) {
1897
+ if (a === "mailchimp" && n === "value") {
1898
+ p = t + 1;
1899
+ continue;
1900
+ }
1901
+ break;
1902
+ }
1903
+ d.lastIndex = t;
1904
+ let o = d.exec(e);
1905
+ o ? (f.push({
1906
+ index: t,
1907
+ value: o[0]
1908
+ }), p = d.lastIndex) : p = t + 1;
1909
+ }
1910
+ return f;
1911
+ }
1912
+ function Nn(e, t) {
1913
+ if (!Object.values(G).includes(t)) {
1914
+ let n = RegExp(`(${t.value.source}|${t.logic.source})`, "g");
1915
+ return [...e.matchAll(n)].map((e) => ({
1916
+ index: e.index,
1917
+ value: e[0]
1918
+ }));
1919
+ }
1920
+ if (t === G.handlebars) return K(e, t, "value");
1921
+ if (t === G.mailchimp) {
1922
+ let n = [], r = new RegExp(t.value.source, "y"), i = new RegExp(t.logic.source, "y"), a = /\*\|\w+[:|]/y, o = 0;
1923
+ for (; o < e.length;) {
1924
+ let t = e.indexOf("*|", o);
1925
+ if (t < 0) break;
1926
+ r.lastIndex = t;
1927
+ let s = r.exec(e);
1928
+ if (s) {
1929
+ n.push({
1930
+ index: t,
1931
+ value: s[0]
1932
+ }), o = r.lastIndex;
1933
+ continue;
1934
+ }
1935
+ if (a.lastIndex = t, !a.exec(e)) {
1936
+ o = t + 2;
1937
+ continue;
1938
+ }
1939
+ let c = Mn(e, "|*", a.lastIndex);
1940
+ if (c.lineBreak >= 0) {
1941
+ o = c.lineBreak + 1;
1942
+ continue;
1943
+ }
1944
+ if (c.close < 0) break;
1945
+ i.lastIndex = t;
1946
+ let l = i.exec(e);
1947
+ l ? (n.push({
1948
+ index: t,
1949
+ value: l[0]
1950
+ }), o = i.lastIndex) : o = t + 2;
1951
+ }
1952
+ return n;
1953
+ }
1954
+ let n = [], r = 0, i = K(e, t, "value", r, 1)[0], a = K(e, t, "logic", r, 1)[0];
1955
+ for (; i || a;) {
1956
+ let o = !a || i && i.index <= a.index ? i : a;
1957
+ n.push(o), r = o.index + o.value.length, (o === i || i && i.index < r) && (i = K(e, t, "value", r, 1)[0]), (o === a || a && a.index < r) && (a = K(e, t, "logic", r, 1)[0]);
1958
+ }
1959
+ return n;
1960
+ }
1961
+ function Pn(e) {
1962
+ return typeof e == "string" && e.trim() !== "" ? e : null;
1963
+ }
1964
+ function Fn(e) {
1965
+ return Object.values(G).find((t) => t.value.source === e.value.source) ?? null;
1966
+ }
1967
+ function In(e) {
1968
+ return Pn(e.opener) ?? Fn(e)?.opener ?? null;
1969
+ }
1970
+ function Ln(e) {
1971
+ return Pn(e.closer) ?? Fn(e)?.closer ?? null;
1972
+ }
1973
+ function Rn(e) {
1974
+ return e ? typeof e == "string" ? G[e] ?? G.liquid : e : G.liquid;
1975
+ }
1976
+ function zn(e) {
1977
+ let t = e.source, n = e.flags.replace("g", "");
1978
+ return RegExp(`^${t}$`, n);
1979
+ }
1980
+ function Bn(e, t) {
1981
+ let n = e?.trim() || "";
1982
+ return !zn(t.logic).test(n) && zn(t.value).test(n);
1983
+ }
1984
+ function Vn(e, t) {
1985
+ let n = t.find((t) => t.value === e);
1986
+ return n ? n.label : e;
1987
+ }
1988
+ function Hn(e, t) {
1989
+ return Qn(e, "data-merge-tag", (e) => Vn(e, t));
1990
+ }
1991
+ function Un(e, t) {
1992
+ return t.find((t) => t.value === e)?.sample;
1993
+ }
1994
+ function Wn(e, t) {
1995
+ return Qn(e, "data-merge-tag", (e) => qn(Un(e, t) ?? Vn(e, t)), { unwrap: (e) => Un(e, t) !== void 0 });
1996
+ }
1997
+ function Gn(e) {
1998
+ return e.some((e) => e.sample !== void 0);
1999
+ }
2000
+ function Kn(e, t) {
2001
+ if (!e) return e;
2002
+ let n = e;
2003
+ for (let e of t) e.sample !== void 0 && (n = n.split(e.value).join(e.sample));
2004
+ return n;
2005
+ }
2006
+ function qn(e) {
2007
+ return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
2008
+ }
2009
+ function Jn(e, t) {
2010
+ if (!e) return !1;
2011
+ if (Object.values(G).includes(t)) return K(e, t, "value", 0, 1).length > 0 || K(e, t, "logic", 0, 1).length > 0;
2012
+ let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
2013
+ return n.test(e) || r.test(e);
2014
+ }
2015
+ function Yn(e, t) {
2016
+ return zn(t.logic).test(e?.trim() || "");
2017
+ }
2018
+ function Xn(e, t) {
2019
+ let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
2020
+ return r && r[1] ? r[1].toUpperCase() : e;
2021
+ }
2022
+ function Zn(e, t) {
2023
+ return Qn(e, "data-logic-merge-tag", (e) => Xn(e, t));
2024
+ }
2025
+ function Qn(e, t, n, r) {
2026
+ let i = "", a = 0;
2027
+ for (; a < e.length;) {
2028
+ let o = e.indexOf("<span", a);
2029
+ if (o === -1) {
2030
+ i += e.substring(a);
2031
+ break;
2032
+ }
2033
+ let s = e[o + 5];
2034
+ if (s !== ">" && s !== " " && s !== " " && s !== "\n" && s !== "\r" && s !== "/") {
2035
+ i += e.substring(a, o + 5), a = o + 5;
2036
+ continue;
2037
+ }
2038
+ let { end: c, nextSpan: l } = Sn(e, o + 5);
2039
+ if (l !== -1) {
2040
+ i += e.substring(a, l), a = l;
2041
+ continue;
2042
+ }
2043
+ if (c === -1) {
2044
+ i += e.substring(a);
2045
+ break;
2046
+ }
2047
+ let u = Tn(e.substring(o + 5, c), t);
2048
+ if (u === null) {
2049
+ i += e.substring(a, c + 1), a = c + 1;
2050
+ continue;
2051
+ }
2052
+ let d = e.indexOf("</span>", c + 1);
2053
+ if (d === -1) {
2054
+ i += e.substring(a);
2055
+ break;
2056
+ }
2057
+ let f = n(u);
2058
+ r?.unwrap?.(u) ? (i += e.substring(a, o), i += f) : (i += e.substring(a, c + 1), i += f, i += "</span>"), a = d + 7;
2059
+ }
2060
+ return i;
1779
2061
  }
1780
2062
  // ../types/src/locale-strings.ts
1781
- var An = {
2063
+ var $n = {
1782
2064
  title: ["content"],
1783
2065
  paragraph: ["content"]
1784
2066
  };
1785
- function jn(e) {
2067
+ function er(e) {
1786
2068
  let t = [], n = /<[a-z][\w:-]*\b/gi;
1787
2069
  for (; n.exec(e);) {
1788
- let r = U(e, n.lastIndex);
2070
+ let r = xn(e, n.lastIndex);
1789
2071
  if (r < 0) break;
1790
2072
  let i = n.lastIndex, a = e.slice(i, r), o = /[^\s"'<>/=]+\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/g;
1791
2073
  for (let e; e = o.exec(a);) {
@@ -1799,42 +2081,46 @@ function jn(e) {
1799
2081
  }
1800
2082
  return t;
1801
2083
  }
1802
- function Mn(e, t, n) {
1803
- let r = n === "html" ? En(e) : [], i = n === "html" ? jn(e) : [], a = r.map((e) => ({
2084
+ function tr(e, t, n) {
2085
+ let r = n === "html" ? On(e) : [], i = n === "html" ? er(e) : [], a = r.map((e) => ({
1804
2086
  ...e,
1805
2087
  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] : [];
2088
+ })), o = 0, s = (n, r) => {
2089
+ let s = e.slice(n, r), c = Object.values(G).includes(t), l = ["logic", "value"], u = c ? l.map((e) => K(s, t, e, 0, 1)[0]) : null, d = c ? null : [t.logic, t.value].map((e) => new RegExp(e.source, e.flags.replace(/[gy]/g, "") + "g")), f = 0;
2090
+ for (; f < s.length;) {
2091
+ let e = c ? u.flatMap((e) => e ? [e] : []) : d.flatMap((e) => {
2092
+ e.lastIndex = f;
2093
+ let t = e.exec(s);
2094
+ for (; t && t[0].length === 0;) e.lastIndex = t.index + 1, t = e.exec(s);
2095
+ return t ? [{
2096
+ index: t.index,
2097
+ value: t[0]
2098
+ }] : [];
1814
2099
  });
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;
2100
+ e.sort((e, t) => e.index - t.index || e.value.length - t.value.length);
2101
+ let r = e[0];
2102
+ if (!r) break;
2103
+ let p = n + r.index, ee = p + r.value.length;
2104
+ for (; i[o]?.end <= p;) o++;
2105
+ if (a.push({
2106
+ start: p,
2107
+ end: ee,
2108
+ markup: r.value,
2109
+ attribute: i[o] !== void 0 && p >= i[o].start && ee <= i[o].end
2110
+ }), f = r.index + r.value.length, c) for (let e = 0; e < l.length; e++) u[e] && u[e].index < f && (u[e] = K(s, t, l[e], f, 1)[0]);
1825
2111
  }
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);
2112
+ }, c = 0;
2113
+ for (let e of r) s(c, e.start), c = e.end;
2114
+ return s(c, e.length), a.sort((e, t) => e.start - t.start);
1829
2115
  }
1830
- function Nn(e) {
2116
+ function nr(e) {
1831
2117
  if (!e.includes("&")) return { text: e };
1832
2118
  let t = "", n = [0], r = 0, i = (i) => {
1833
2119
  for (t += e.slice(r, i); r < i;) n.push(++r);
1834
2120
  };
1835
2121
  for (let a of e.matchAll(/&(?:#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g)) {
1836
2122
  i(a.index);
1837
- let e = G(a[0]);
2123
+ let e = W(a[0]);
1838
2124
  t += e;
1839
2125
  for (let t = 1; t < e.length; t++) n.push(-1);
1840
2126
  r = a.index + a[0].length, n.push(r);
@@ -1844,17 +2130,17 @@ function Nn(e) {
1844
2130
  offsets: n
1845
2131
  };
1846
2132
  }
1847
- var K = /* @__PURE__ */ new Map(), Pn = 32;
1848
- function Fn(e) {
1849
- let t = JSON.stringify(e), n = K.get(t);
2133
+ var q = /* @__PURE__ */ new Map(), rr = 32;
2134
+ function ir(e) {
2135
+ let t = JSON.stringify(e), n = q.get(t);
1850
2136
  if (n === void 0) {
1851
2137
  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);
2138
+ n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null, q.size >= rr && q.delete(q.keys().next().value), q.set(t, n);
1853
2139
  }
1854
2140
  return n;
1855
2141
  }
1856
- function In(e, t, n) {
1857
- let r = n.length ? Fn(n) : null;
2142
+ function ar(e, t, n) {
2143
+ let r = n.length ? ir(n) : null;
1858
2144
  if (!r) return [];
1859
2145
  let i = [];
1860
2146
  if (t === "text") i.push({
@@ -1863,7 +2149,7 @@ function In(e, t, n) {
1863
2149
  attribute: !1
1864
2150
  });
1865
2151
  else {
1866
- i.push(...jn(e).map((e) => ({
2152
+ i.push(...er(e).map((e) => ({
1867
2153
  ...e,
1868
2154
  attribute: !0
1869
2155
  })));
@@ -1874,7 +2160,7 @@ function In(e, t, n) {
1874
2160
  end: r.index,
1875
2161
  attribute: !1
1876
2162
  });
1877
- let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) : U(e, t.lastIndex);
2163
+ let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) : xn(e, t.lastIndex);
1878
2164
  if (a < 0) return [];
1879
2165
  n = a + (r[0] === "<!--" ? 3 : 1), t.lastIndex = n;
1880
2166
  }
@@ -1887,7 +2173,7 @@ function In(e, t, n) {
1887
2173
  let a = [];
1888
2174
  for (let n of i) {
1889
2175
  r.lastIndex = 0;
1890
- let i = e.slice(n.start, n.end), o = t === "html" ? Nn(i) : {
2176
+ let i = e.slice(n.start, n.end), o = t === "html" ? nr(i) : {
1891
2177
  text: i,
1892
2178
  offsets: void 0
1893
2179
  };
@@ -1906,51 +2192,51 @@ function In(e, t, n) {
1906
2192
  }
1907
2193
  return a;
1908
2194
  }
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));
2195
+ function or(e, t, n, r) {
2196
+ let i = tr(e, t, n), a = ar(e, n, r?.doNotTranslate ?? []).filter((e) => !i.some((t) => e.start < t.end && e.end > t.start));
1911
2197
  return [...i, ...a].sort((e, t) => e.start - t.start);
1912
2198
  }
1913
- function Rn(e, t, n) {
2199
+ function sr(e, t, n) {
1914
2200
  let r = "", i = 0;
1915
2201
  return t.forEach((t, a) => {
1916
2202
  r += e.slice(i, t.start), r += t.attribute ? `__x${n[a]}__` : `<x id="${n[a]}"/>`, i = t.end;
1917
2203
  }), r + e.slice(i);
1918
2204
  }
1919
- function zn(e, t, n, r) {
1920
- let i = Ln(e, t, n, r);
2205
+ function cr(e, t, n, r) {
2206
+ let i = or(e, t, n, r);
1921
2207
  return {
1922
- text: Rn(e, i, i.map((e, t) => t + 1)),
2208
+ text: sr(e, i, i.map((e, t) => t + 1)),
1923
2209
  tokens: i.map((e) => e.markup)
1924
2210
  };
1925
2211
  }
1926
- function Bn(e, t) {
2212
+ function lr(e, t) {
1927
2213
  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
2214
  let s = Number(i ?? a ?? o);
1929
2215
  return (s < 1 || s > t.length || n.has(s)) && (r = !1), n.add(s), t[s - 1] ?? "";
1930
2216
  });
1931
2217
  return r && n.size === t.length ? i : null;
1932
2218
  }
1933
- function Vn(e, t, n, r, i) {
1934
- let a = Ln(e, n, r, i), o = /* @__PURE__ */ new Set(), s = (e) => {
2219
+ function ur(e, t, n, r, i) {
2220
+ let a = or(e, n, r, i), o = /* @__PURE__ */ new Set(), s = (e) => {
1935
2221
  let n = t.findIndex((t, n) => !o.has(n) && e(t));
1936
2222
  return n >= 0 && o.add(n), n;
1937
2223
  }, c = a.map((e) => s((t) => t === e.markup));
1938
2224
  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));
2225
+ c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) => W(t) === e.term));
2226
+ }), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null : sr(e, a.filter((e, t) => c[t] >= 0), c.filter((e) => e >= 0).map((e) => e + 1));
1941
2227
  }
1942
- function Hn(e, t, n = []) {
2228
+ function dr(e, t, n = []) {
1943
2229
  let r = /* @__PURE__ */ new Map();
1944
- if (t === T(e) || !e.settings.locales?.includes(t)) return r;
2230
+ if (t === w(e) || !e.settings.locales?.includes(t)) return r;
1945
2231
  let i = (e, n, i, a) => {
1946
2232
  let o = n.l10n?.[t];
1947
2233
  for (let t of i) {
1948
- let i = v(n, t);
2234
+ let i = y(n, t);
1949
2235
  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
2236
  target: e,
1951
2237
  path: t,
1952
2238
  source: i,
1953
- format: a && An[a]?.includes(t) ? "html" : "text",
2239
+ format: a && $n[a]?.includes(t) ? "html" : "text",
1954
2240
  text: o?.text?.[t]
1955
2241
  });
1956
2242
  }
@@ -1959,17 +2245,17 @@ function Hn(e, t, n = []) {
1959
2245
  if (r.type !== "html" && i({
1960
2246
  kind: "block",
1961
2247
  blockId: r.id
1962
- }, r, x(r, n), r.type), r.type === "section") for (let e of r.children) a(e);
2248
+ }, r, S(r, n), r.type), r.type === "section") for (let e of r.children) a(e);
1963
2249
  else r.type === "wrapper" && a(r.children);
1964
2250
  }
1965
2251
  };
1966
- return a(e.blocks), i({ kind: "settings" }, e.settings, h), r;
2252
+ return a(e.blocks), i({ kind: "settings" }, e.settings, g), r;
1967
2253
  }
1968
- function Un(e, t, n) {
1969
- let r = n.only === "all" ? null : Ae(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)) {
2254
+ function fr(e, t, n) {
2255
+ let r = n.only === "all" ? null : je(e, t, n.definitions), i = r && /* @__PURE__ */ new Set([...r.missing, ...r.stale]), a = [], o = {};
2256
+ for (let [r, s] of dr(e, t, n.definitions)) {
1971
2257
  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;
2258
+ let e = cr(s.source, n.syntax, s.format, n), t = s.text ? ur(s.text.value, e.tokens, n.syntax, s.format, n) : void 0;
1973
2259
  a.push({
1974
2260
  id: r,
1975
2261
  format: s.format,
@@ -1983,8 +2269,8 @@ function Un(e, t, n) {
1983
2269
  tokens: o
1984
2270
  };
1985
2271
  }
1986
- function Wn(e, t, n, r) {
1987
- let i = Hn(e, t, r.definitions), a = /* @__PURE__ */ new Map(), o = (e) => {
2272
+ function pr(e, t, n, r) {
2273
+ let i = dr(e, t, r.definitions), a = /* @__PURE__ */ new Map(), o = (e) => {
1988
2274
  for (let t of e) if (a.set(t.id, t), t.type === "section") for (let e of t.children) o(e);
1989
2275
  else t.type === "wrapper" && o(t.children);
1990
2276
  };
@@ -1996,12 +2282,12 @@ function Wn(e, t, n, r) {
1996
2282
  let n = t.id.lastIndexOf("/"), r = t.id.slice(0, n), i = r === "settings" ? [a.get(r), e.settings] : [a.get(r)];
1997
2283
  l.push({
1998
2284
  id: t.id,
1999
- reason: n < 0 || !i.some((e) => e && v(e, t.id.slice(n + 1)) !== void 0) ? "unknown_field" : "not_translatable"
2285
+ reason: n < 0 || !i.some((e) => e && y(e, t.id.slice(n + 1)) !== void 0) ? "unknown_field" : "not_translatable"
2000
2286
  });
2001
2287
  continue;
2002
2288
  }
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) {
2289
+ let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ? lr(t.text, o) : null;
2290
+ if (!o || u === null || ur(u, o, r.syntax, n.format, r) === null) {
2005
2291
  l.push({
2006
2292
  id: t.id,
2007
2293
  reason: "tags_changed"
@@ -2031,7 +2317,7 @@ function Wn(e, t, n, r) {
2031
2317
  };
2032
2318
  }
2033
2319
  // ../types/src/custom-block-liquid.ts
2034
- function Gn(e) {
2320
+ function mr(e) {
2035
2321
  return new e.Liquid({
2036
2322
  strictVariables: !1,
2037
2323
  strictFilters: !1,
@@ -2040,17 +2326,17 @@ function Gn(e) {
2040
2326
  });
2041
2327
  }
2042
2328
  // ../types/src/factory.ts
2043
- function q(e, t) {
2044
- let n = p(e);
2329
+ function J(e, t) {
2330
+ let n = m(e);
2045
2331
  return !t || Object.keys(t).length === 0 ? n : mn(n, t);
2046
2332
  }
2047
- function J(e) {
2048
- return e === void 0 ? void 0 : p(e);
2333
+ function Y(e) {
2334
+ return e === void 0 ? void 0 : m(e);
2049
2335
  }
2050
- function Y() {
2336
+ function X() {
2051
2337
  return crypto.randomUUID();
2052
2338
  }
2053
- function Kn(e = 0) {
2339
+ function hr(e = 0) {
2054
2340
  return {
2055
2341
  top: e,
2056
2342
  right: e,
@@ -2058,135 +2344,135 @@ function Kn(e = 0) {
2058
2344
  left: e
2059
2345
  };
2060
2346
  }
2061
- function X(e = 10) {
2062
- return { padding: Kn(e) };
2347
+ function Z(e = 10) {
2348
+ return { padding: hr(e) };
2063
2349
  }
2064
- function qn(e = {}) {
2065
- return q({
2066
- id: Y(),
2350
+ function gr(e = {}) {
2351
+ return J({
2352
+ id: X(),
2067
2353
  type: "title",
2068
2354
  ...Zt,
2069
- styles: X()
2355
+ styles: Z()
2070
2356
  }, e);
2071
2357
  }
2072
- function Jn(e = {}) {
2073
- return q({
2074
- id: Y(),
2358
+ function _r(e = {}) {
2359
+ return J({
2360
+ id: X(),
2075
2361
  type: "paragraph",
2076
2362
  ...Qt,
2077
- styles: X()
2363
+ styles: Z()
2078
2364
  }, e);
2079
2365
  }
2080
- function Yn(e = {}) {
2081
- return q({
2082
- id: Y(),
2366
+ function vr(e = {}) {
2367
+ return J({
2368
+ id: X(),
2083
2369
  type: "image",
2084
2370
  ...$t,
2085
- styles: X()
2371
+ styles: Z()
2086
2372
  }, e);
2087
2373
  }
2088
- function Xn(e = {}) {
2089
- return q({
2090
- id: Y(),
2374
+ function yr(e = {}) {
2375
+ return J({
2376
+ id: X(),
2091
2377
  type: "button",
2092
2378
  ...en,
2093
- styles: X()
2379
+ styles: Z()
2094
2380
  }, e);
2095
2381
  }
2096
- function Zn(e = {}) {
2097
- return q({
2098
- id: Y(),
2382
+ function br(e = {}) {
2383
+ return J({
2384
+ id: X(),
2099
2385
  type: "divider",
2100
2386
  ...tn,
2101
- styles: X(20)
2387
+ styles: Z(20)
2102
2388
  }, e);
2103
2389
  }
2104
- function Qn(e = {}) {
2105
- return q({
2106
- id: Y(),
2390
+ function xr(e = {}) {
2391
+ return J({
2392
+ id: X(),
2107
2393
  type: "section",
2108
2394
  ...nn,
2109
2395
  children: [[]],
2110
- styles: X(20)
2396
+ styles: Z(20)
2111
2397
  }, e);
2112
2398
  }
2113
- function $n(e = {}) {
2114
- return q({
2115
- id: Y(),
2399
+ function Sr(e = {}) {
2400
+ return J({
2401
+ id: X(),
2116
2402
  type: "video",
2117
2403
  ...rn,
2118
- styles: X()
2404
+ styles: Z()
2119
2405
  }, e);
2120
2406
  }
2121
- function er(e = {}) {
2122
- return q({
2123
- id: Y(),
2407
+ function Cr(e = {}) {
2408
+ return J({
2409
+ id: X(),
2124
2410
  type: "social",
2125
2411
  icons: [],
2126
2412
  ...an,
2127
- styles: X()
2413
+ styles: Z()
2128
2414
  }, e);
2129
2415
  }
2130
- function tr(e = {}) {
2131
- return q({
2132
- id: Y(),
2416
+ function wr(e = {}) {
2417
+ return J({
2418
+ id: X(),
2133
2419
  type: "spacer",
2134
2420
  ...on,
2135
- styles: X(0)
2421
+ styles: Z(0)
2136
2422
  }, e);
2137
2423
  }
2138
- function nr(e = {}) {
2139
- return q({
2140
- id: Y(),
2424
+ function Tr(e = {}) {
2425
+ return J({
2426
+ id: X(),
2141
2427
  type: "html",
2142
2428
  ...sn,
2143
- styles: X()
2429
+ styles: Z()
2144
2430
  }, e);
2145
2431
  }
2146
- function rr(e = {}) {
2147
- return q({
2148
- id: Y(),
2432
+ function Er(e = {}) {
2433
+ return J({
2434
+ id: X(),
2149
2435
  type: "menu",
2150
2436
  items: [],
2151
2437
  ...cn,
2152
- styles: X()
2438
+ styles: Z()
2153
2439
  }, e);
2154
2440
  }
2155
- function ir(e, t) {
2441
+ function Dr(e, t) {
2156
2442
  return Array.from({ length: t }, () => ({
2157
- id: Y(),
2443
+ id: X(),
2158
2444
  cells: Array.from({ length: e }, () => ({
2159
- id: Y(),
2445
+ id: X(),
2160
2446
  content: ""
2161
2447
  }))
2162
2448
  }));
2163
2449
  }
2164
- function ar(e = {}) {
2165
- return q({
2166
- id: Y(),
2450
+ function Or(e = {}) {
2451
+ return J({
2452
+ id: X(),
2167
2453
  type: "table",
2168
- rows: ir(3, 3),
2454
+ rows: Dr(3, 3),
2169
2455
  ...ln,
2170
- styles: X()
2456
+ styles: Z()
2171
2457
  }, e);
2172
2458
  }
2173
- function or(e = {}) {
2174
- return q({
2175
- id: Y(),
2459
+ function kr(e = {}) {
2460
+ return J({
2461
+ id: X(),
2176
2462
  type: "countdown",
2177
2463
  ...un,
2178
- styles: X()
2464
+ styles: Z()
2179
2465
  }, e);
2180
2466
  }
2181
- function sr(e) {
2467
+ function Ar(e) {
2182
2468
  return e.type === "repeatable" ? e.default ?? [] : e.type === "boolean" ? e.default ?? !1 : e.type === "number" ? e.default ?? 0 : e.default ?? "";
2183
2469
  }
2184
- function cr(e) {
2470
+ function jr(e) {
2185
2471
  let t = {};
2186
- for (let n of e.fields) t[n.key] = J(sr(n));
2187
- let n = q(X(), J(e.defaultStyles));
2472
+ for (let n of e.fields) t[n.key] = Y(Ar(n));
2473
+ let n = J(Z(), Y(e.defaultStyles));
2188
2474
  return {
2189
- id: Y(),
2475
+ id: X(),
2190
2476
  type: "custom",
2191
2477
  customType: e.type,
2192
2478
  fieldValues: t,
@@ -2194,42 +2480,42 @@ function cr(e) {
2194
2480
  ...e.dataSource ? { dataSourceFetched: !1 } : {}
2195
2481
  };
2196
2482
  }
2197
- function lr() {
2483
+ function Mr() {
2198
2484
  return {
2199
- id: Y(),
2485
+ id: X(),
2200
2486
  type: "slot",
2201
- styles: X(0)
2487
+ styles: Z(0)
2202
2488
  };
2203
2489
  }
2204
- function ur(e = {}) {
2205
- return q({
2206
- id: Y(),
2490
+ function Nr(e = {}) {
2491
+ return J({
2492
+ id: X(),
2207
2493
  type: "wrapper",
2208
2494
  children: [],
2209
- styles: X(0)
2495
+ styles: Z(0)
2210
2496
  }, e);
2211
2497
  }
2212
- function dr(e, t) {
2498
+ function Pr(e, t) {
2213
2499
  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));
2500
+ case "section": return xr(Y(t?.section));
2501
+ case "title": return gr(Y(t?.title));
2502
+ case "paragraph": return _r(Y(t?.paragraph));
2503
+ case "image": return vr(Y(t?.image));
2504
+ case "button": return yr(Y(t?.button));
2505
+ case "divider": return br(Y(t?.divider));
2506
+ case "video": return Sr(Y(t?.video));
2507
+ case "social": return Cr(Y(t?.social));
2508
+ case "spacer": return wr(Y(t?.spacer));
2509
+ case "html": return Tr(Y(t?.html));
2510
+ case "menu": return Er(Y(t?.menu));
2511
+ case "table": return Or(Y(t?.table));
2512
+ case "countdown": return kr(Y(t?.countdown));
2227
2513
  case "slot": throw Error("[Templatical] slot cannot be inserted into content. Use createSlotBlock() to build a layout.");
2228
2514
  case "wrapper": throw Error("[Templatical] wrapper cannot be inserted into content. Use createWrapperBlock() to build a layout.");
2229
2515
  default: throw Error(`Unknown block type: ${e}`);
2230
2516
  }
2231
2517
  }
2232
- function fr(e, t) {
2518
+ function Fr(e, t) {
2233
2519
  let n = e.l10n;
2234
2520
  if (!n || t.size === 0) return;
2235
2521
  let r = (n) => {
@@ -2244,12 +2530,12 @@ function fr(e, t) {
2244
2530
  n && (e[t] = Object.fromEntries(Object.entries(n).map(([e, t]) => [r(e), t])));
2245
2531
  }
2246
2532
  }
2247
- function Z(e) {
2533
+ function Q(e) {
2248
2534
  let t = JSON.parse(JSON.stringify(e));
2249
- t.id = Y();
2535
+ t.id = X();
2250
2536
  let n = /* @__PURE__ */ new Map(), r = (e, t) => {
2251
2537
  let r = e.id;
2252
- e.id = Y();
2538
+ e.id = X();
2253
2539
  let i = n.get(t);
2254
2540
  return i || (i = /* @__PURE__ */ new Map(), n.set(t, i)), i.set(r, e.id), r;
2255
2541
  };
@@ -2259,52 +2545,52 @@ function Z(e) {
2259
2545
  }
2260
2546
  if (t.type === "menu") for (let e of t.items) r(e, "items");
2261
2547
  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;
2548
+ return t.type === "section" && (t.children = t.children.map((e) => e.map((e) => Q(e)))), t.type === "wrapper" && (t.children = t.children.map((e) => Q(e))), Fr(t, n), t;
2263
2549
  }
2264
2550
  // ../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);
2551
+ var Ir = "[Templatical] layout: must contain exactly one slot block", Lr = "[Templatical] layout: slot must be a top-level or wrapper child, not nested in a section", Rr = "[Templatical] layout: a wrapper cannot contain a wrapper", zr = "[Templatical] layout: a wrapper around the slot cannot contain blocks that emit mj-wrapper (section.wrapper)", Br = "[Templatical] slot is not a valid content block", Vr = "[Templatical] wrapper is not a valid content block";
2552
+ function $(e, t, n = null, r = !1) {
2553
+ for (let i of e) if (t(i, n, r), Lt(i)) for (let e of i.children) $(e, t, i, !0);
2554
+ else H(i) && $(i.children, t, i, r);
2269
2555
  }
2270
- function yr(e) {
2556
+ function Hr(e) {
2271
2557
  let t = 0;
2272
- if (Q(e.blocks, (e, n, r) => {
2273
- if (V(e) && (t += 1, r)) throw Error(mr);
2558
+ if ($(e.blocks, (e, n, r) => {
2559
+ if (V(e) && (t += 1, r)) throw Error(Lr);
2274
2560
  if (H(e)) {
2275
- if (r) throw Error(mr);
2276
- if (e.children.some(H)) throw Error(hr);
2561
+ if (r) throw Error(Lr);
2562
+ if (e.children.some(H)) throw Error(Rr);
2277
2563
  }
2278
- }), t !== 1) throw Error(pr);
2564
+ }), t !== 1) throw Error(Ir);
2279
2565
  }
2280
- function br(e) {
2281
- Q(e.blocks, (e) => {
2282
- if (V(e)) throw Error(_r);
2566
+ function Ur(e) {
2567
+ $(e.blocks, (e) => {
2568
+ if (V(e)) throw Error(Br);
2283
2569
  });
2284
2570
  }
2285
- function xr(e) {
2286
- Q(e.blocks, (e) => {
2287
- if (H(e)) throw Error(vr);
2571
+ function Wr(e) {
2572
+ $(e.blocks, (e) => {
2573
+ if (H(e)) throw Error(Vr);
2288
2574
  });
2289
2575
  }
2290
- function Sr(e) {
2576
+ function Gr(e) {
2291
2577
  let t = !1;
2292
- return Q(e.blocks, (e, n) => {
2578
+ return $(e.blocks, (e, n) => {
2293
2579
  V(e) && n !== null && H(n) && (t = !0);
2294
2580
  }), t;
2295
2581
  }
2296
- function Cr(e) {
2582
+ function Kr(e) {
2297
2583
  if (V(e)) return e;
2298
2584
  if (H(e)) {
2299
- let t = Z({
2585
+ let t = Q({
2300
2586
  ...e,
2301
2587
  children: []
2302
2588
  });
2303
- return t.children = e.children.map(Cr), t;
2589
+ return t.children = e.children.map(Kr), t;
2304
2590
  }
2305
- return Z(e);
2591
+ return Q(e);
2306
2592
  }
2307
- function wr(e) {
2593
+ function qr(e) {
2308
2594
  for (let t = 0; t < e.length; t++) {
2309
2595
  let n = e[t];
2310
2596
  if (V(n)) return {
@@ -2312,33 +2598,33 @@ function wr(e) {
2312
2598
  index: t
2313
2599
  };
2314
2600
  if (H(n)) {
2315
- let e = wr(n.children);
2601
+ let e = qr(n.children);
2316
2602
  if (e) return e;
2317
2603
  }
2318
2604
  }
2319
2605
  return null;
2320
2606
  }
2321
- function Tr(e) {
2607
+ function Jr(e) {
2322
2608
  for (let t of e) if (Lt(t)) {
2323
2609
  if (t.wrapper) return !0;
2324
- for (let e of t.children) if (Tr(e)) return !0;
2610
+ for (let e of t.children) if (Jr(e)) return !0;
2325
2611
  }
2326
2612
  return !1;
2327
2613
  }
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)), {
2614
+ function Yr(e, t) {
2615
+ if (Hr(e), Ur(t), Wr(t), Gr(e) && Jr(t.blocks)) throw Error(zr);
2616
+ let n = e.blocks.map(Kr), r = qr(n);
2617
+ if (!r) throw Error(Ir);
2618
+ return r.parent.splice(r.index, 1, ...m(t.blocks)), {
2333
2619
  blocks: n,
2334
2620
  settings: {
2335
- ...p(t.settings),
2621
+ ...m(t.settings),
2336
2622
  backgroundColor: e.settings.backgroundColor
2337
2623
  }
2338
2624
  };
2339
2625
  }
2340
2626
  // ../types/src/url-policy.ts
2341
- var Dr = Object.freeze([
2627
+ var Xr = Object.freeze([
2342
2628
  "http",
2343
2629
  "https",
2344
2630
  "mailto",
@@ -2348,44 +2634,44 @@ var Dr = Object.freeze([
2348
2634
  "sms",
2349
2635
  "xmpp",
2350
2636
  "cid"
2351
- ]), Or = Object.freeze([
2637
+ ]), Zr = Object.freeze([
2352
2638
  "javascript",
2353
2639
  "data",
2354
2640
  "vbscript"
2355
2641
  ]);
2356
- function kr(e) {
2642
+ function Qr(e) {
2357
2643
  return e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
2358
2644
  }
2359
- function Ar(e) {
2360
- let t = /^([a-z][a-z0-9+.-]*):/i.exec(kr(e));
2645
+ function $r(e) {
2646
+ let t = /^([a-z][a-z0-9+.-]*):/i.exec(Qr(e));
2361
2647
  return t ? t[1].toLowerCase() : null;
2362
2648
  }
2363
- var jr = /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i, Mr = Object.freeze([
2649
+ var ei = /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i, ti = Object.freeze([
2364
2650
  "href",
2365
2651
  "xlink:href",
2366
2652
  "background",
2367
2653
  "poster",
2368
2654
  "src"
2369
- ]), Nr = Object.freeze([
2655
+ ]), ni = Object.freeze([
2370
2656
  "srcdoc",
2371
2657
  "ping",
2372
2658
  "formaction",
2373
2659
  "action"
2374
2660
  ]);
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);
2661
+ function ri(e, t) {
2662
+ let n = Qr(e), r = $r(n);
2663
+ return r === null || Xr.some((e) => e === r) ? !0 : t.toLowerCase() === "src" && ei.test(n);
2378
2664
  }
2379
2665
  // ../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() === "";
2666
+ var ii = /<\/?p\b[^<>]*>/gi, ai = /<p\b([^<>]*)>\s*<\/p>/gi;
2667
+ function oi(e) {
2668
+ return e.replace(ii, "").trim() === "";
2383
2669
  }
2384
- function Rr(e) {
2385
- return Lr(e) ? e : e.replace(Ir, "<p$1>&nbsp;</p>");
2670
+ function si(e) {
2671
+ return oi(e) ? e : e.replace(ai, "<p$1>&nbsp;</p>");
2386
2672
  }
2387
2673
  // ../types/src/fonts.ts
2388
- var zr = {
2674
+ var ci = {
2389
2675
  arial: "Arial, sans-serif",
2390
2676
  helvetica: "Helvetica, sans-serif",
2391
2677
  georgia: "Georgia, serif",
@@ -2394,13 +2680,13 @@ var zr = {
2394
2680
  "trebuchet ms": "'Trebuchet MS', sans-serif",
2395
2681
  "courier new": "'Courier New', monospace",
2396
2682
  tahoma: "Tahoma, sans-serif"
2397
- }, Br = /* @__PURE__ */ new Set([
2683
+ }, li = /* @__PURE__ */ new Set([
2398
2684
  "inherit",
2399
2685
  "initial",
2400
2686
  "unset",
2401
2687
  "revert",
2402
2688
  "revert-layer"
2403
- ]), Vr = /* @__PURE__ */ new Set([
2689
+ ]), ui = /* @__PURE__ */ new Set([
2404
2690
  "serif",
2405
2691
  "sans-serif",
2406
2692
  "monospace",
@@ -2415,14 +2701,14 @@ var zr = {
2415
2701
  "math",
2416
2702
  "fangsong"
2417
2703
  ]);
2418
- function Hr(e) {
2704
+ function di(e) {
2419
2705
  return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
2420
2706
  }
2421
- function Ur(e) {
2707
+ function fi(e) {
2422
2708
  if (typeof e != "string") return [];
2423
2709
  let t = e.replace(/!\s*important\s*$/i, ""), n = [], r = 0;
2424
2710
  for (;;) {
2425
- for (; r < t.length && Hr(t[r]);) r++;
2711
+ for (; r < t.length && di(t[r]);) r++;
2426
2712
  if (r >= t.length) return [];
2427
2713
  let e = t[r];
2428
2714
  if (e === "\"" || e === "'") {
@@ -2439,7 +2725,7 @@ function Ur(e) {
2439
2725
  }
2440
2726
  }
2441
2727
  if (!o) return [];
2442
- for (; a < t.length && Hr(t[a]);) a++;
2728
+ for (; a < t.length && di(t[a]);) a++;
2443
2729
  if (a < t.length && t[a] !== ",") return [];
2444
2730
  n.push({
2445
2731
  name: i,
@@ -2447,7 +2733,7 @@ function Ur(e) {
2447
2733
  }), r = a;
2448
2734
  } else {
2449
2735
  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 [];
2736
+ if (a === "" || a.includes("\"") || a.includes("'") || li.has(a.toLowerCase())) return [];
2451
2737
  n.push({
2452
2738
  name: a,
2453
2739
  quoted: !1
@@ -2457,150 +2743,27 @@ function Ur(e) {
2457
2743
  r++;
2458
2744
  }
2459
2745
  }
2460
- function Wr(e) {
2746
+ function pi(e) {
2461
2747
  return `'${e.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
2462
2748
  }
2463
- function Gr(e) {
2464
- return !e.quoted && Vr.has(e.name.toLowerCase());
2749
+ function mi(e) {
2750
+ return !e.quoted && ui.has(e.name.toLowerCase());
2465
2751
  }
2466
- function Kr(e) {
2467
- return Ur(e)[0]?.name ?? "";
2752
+ function hi(e) {
2753
+ return fi(e)[0]?.name ?? "";
2468
2754
  }
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);
2755
+ function gi(e, t) {
2756
+ let n = (e) => `${pi(e.name)}, ${e.fallback ?? t.defaultFallback}`, r = typeof e == "string" ? e.trim().toLowerCase() : "", i = t.customFonts.find((e) => e.name.toLowerCase() === r);
2471
2757
  if (i) return n(i);
2472
- let a = Ur(e);
2758
+ let a = fi(e);
2473
2759
  if (a.length !== 1) return e;
2474
2760
  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;
2761
+ return c ? n(c) : ci[s] || (mi(o) ? e : `${pi(o.name)}, ${t.defaultFallback}`);
2599
2762
  }
2600
2763
  // ../types/src/preview-resolution.ts
2601
- function pi(e) {
2764
+ function _i(e) {
2602
2765
  return typeof e != "object" || !e ? !1 : Array.isArray(e.blocks);
2603
2766
  }
2604
- export { An as $, m as $t, xr as A, Pt as At, Yn as B, _ as Bt, Nr as C, Wt as Ct, Pr as D, Ut as Dt, Ar as E, Rt as Et, Xn as F, Ie as Ft, er as G, Ee as Gt, Jn as H, S as Ht, or as I, h as It, qn as J, v as Jt, tr as K, y as Kt, cr as L, Me as Lt, yr as M, Le as Mt, Z as N, D as Nt, Er as O, H as Ot, dr as P, Fe as Pt, Gn as Q, ge as Qt, Zn as R, T as Rt, Or as S, V as St, Dr as T, Jt as Tt, Qn as U, Ae as Ut, rr as V, Se as Vt, lr as W, je as Wt, ur as X, C as Xt, $n as Y, ke as Yt, Y as Z, x as Zt, Kr as _, c as _n, Kt as _t, ti as a, fe as an, G as at, Rr as b, o as bn, zt as bt, Xr as c, d as cn, vn as ct, ei as d, te as dn, fn as dt, p as en, Wn as et, di as f, ne as fn, mn as ft, oi as g, l as gn, Ht as gt, ii as h, s as hn, Xt as ht, ui as i, pe as in, Tn as it, Sr as j, E as jt, br as k, It as kt, ai as l, f as ln, hn as lt, Qr as m, e as mn, Yt as mt, $ as n, de as nn, Bn as nt, ri as o, oe as on, U as ot, ni as p, i as pn, Vt as pt, ar as q, Ce as qt, ci as r, ue as rn, wn as rt, Zr as s, ie as sn, yn as st, pi as t, se as tn, Un as tt, li as u, ee as un, dn as ut, Ur as v, n as vn, Bt as vt, Mr as w, Gt as wt, Lr as x, t as xn, Lt as xt, qr as y, r as yn, qt as yt, nr as z, ve as zt };
2767
+ export { Hn as $, S as $t, Cr as A, H as At, fr as B, w as Bt, br as C, t as Cn, Lt as Ct, _r as D, Jt as Dt, Er as E, Gt as Et, Nr as F, E as Ft, Vn as G, je as Gt, G as H, v as Ht, X as I, Ie as It, In as J, b as Jt, Un as K, Me as Kt, mr as L, Le as Lt, Or as M, Pt as Mt, gr as N, T as Nt, xr as O, Rt as Ot, Sr as P, Re as Pt, Zn as Q, C as Qt, $n as R, g as Rt, jr as S, o as Sn, zt as St, vr as T, Wt as Tt, Jn as U, xe as Ut, lr as V, _e as Vt, Xn as W, we as Wt, Yn as X, y as Xt, Gn as Y, Se as Yt, Bn as Z, Ae as Zt, Hr as _, s as _n, Xt as _t, si as a, le as an, En as at, yr as b, n as bn, Bt as bt, ni as c, ae as cn, xn as ct, $r as d, f as dn, hn as dt, he as en, Rn as et, ri as f, p as fn, dn as ft, Gr as g, e as gn, Yt as gt, Wr as h, i as hn, Vt as ht, gi as i, ue as in, Kn as it, wr as j, It as jt, Mr as k, Ut as kt, ti as l, re as ln, yn as lt, Ur as m, te as mn, mn as mt, hi as n, m as nn, K as nt, oi as o, fe as on, Dn as ot, Yr as p, ee as pn, fn as pt, Ln as q, De as qt, fi as r, oe as rn, Wn as rt, Zr as s, de as sn, W as st, _i as t, h as tn, Nn as tt, Xr as u, d as un, vn as ut, Q as v, l as vn, Ht as vt, Tr as w, V as wt, kr as x, r as xn, qt as xt, Pr as y, c as yn, Kt as yt, pr as z, Ne as zt };
2605
2768
 
2606
- //# sourceMappingURL=src-BQUv2CYU.js.map
2769
+ //# sourceMappingURL=src-v47QHNmB.js.map