@templatical/editor 0.55.0 → 0.56.1

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 (299) hide show
  1. package/dist/{AiAltTextPopover-D5QosKvB.js → AiAltTextPopover-CpZ7UeAZ.js} +4 -4
  2. package/dist/{AiAltTextReview-D1W_lrI_.js → AiAltTextReview-LYxvn7Qe.js} +4 -4
  3. package/dist/{AiChatPanel-C8SeEJRP.js → AiChatPanel-Cy05P-iO.js} +56 -56
  4. package/dist/{AiPanels-CR6zphjP.js → AiPanels-CwKmXzyr.js} +1 -1
  5. package/dist/{AiRewriteMenu-BwztoMov.js → AiRewriteMenu-DgqJHnza.js} +13 -13
  6. package/dist/{BlockIssueBadge-DaPTq1RE.js → BlockIssueBadge-CxHJmuOh.js} +5 -5
  7. package/dist/BlockPreviewCanvas-DEmNZkEG.js +154 -0
  8. package/dist/{CloudHeaderExtras-XpjJjn3o.js → CloudHeaderExtras-Cqhw-jMz.js} +1 -1
  9. package/dist/{CloudPanels-Baoaj6Xf.js → CloudPanels-Bmlf05Il.js} +12 -12
  10. package/dist/{CollaborationNotices-Cnx0XHzZ.js → CollaborationNotices-C27GCMvK.js} +8 -8
  11. package/dist/{CollaboratorBar-BaBoNhwB.js → CollaboratorBar-CLQjksX-.js} +2 -2
  12. package/dist/{CommentsPanel-Ck3QmqiC.js → CommentsPanel-B5NqPMmY.js} +1 -1
  13. package/dist/{CommentsSidebar-CHknhOar.js → CommentsSidebar-BDrcrDxS.js} +42 -42
  14. package/dist/{CountdownBlock-BMezkFbJ.js → CountdownBlock-D8dqjm3F.js} +6 -6
  15. package/dist/{CountdownToolbar-CA_gDIdZ.js → CountdownToolbar-IjpCOjCd.js} +30 -30
  16. package/dist/{IssuesPanel-nmFhWG1p.js → IssuesPanel-uwuzeMSW.js} +89 -89
  17. package/dist/LanguageMenu-C-eQ0lFy.js +403 -0
  18. package/dist/{LocaleNotices-WzsYtBRs.js → LocaleNotices-CDK_9D7P.js} +10 -10
  19. package/dist/{LogicTagInsertButton-qZ82VMFx.js → LogicTagInsertButton-BSolF7Fd.js} +24 -24
  20. package/dist/{MediaEditModal-C3U9Mi31.js → MediaEditModal-C8yc9dxt.js} +7 -7
  21. package/dist/{MediaPanels-CGmk9ufe.js → MediaPanels-FI4I8asn.js} +1 -1
  22. package/dist/{MergeTagInput-JJeZbFkD.js → MergeTagInput-B1nl2ZMT.js} +12 -12
  23. package/dist/{MergeTagModeToggle-DDucd1eC.js → MergeTagModeToggle-DXvb80OE.js} +6 -6
  24. package/dist/{MergeTagTextarea-dQ2LRrNB.js → MergeTagTextarea-DJlf3VbS.js} +5 -5
  25. package/dist/{ParagraphEditor-VXYwGoz_.js → ParagraphEditor-Dqco128s.js} +173 -173
  26. package/dist/{RestoreVersionDialog-BibNvAaJ.js → RestoreVersionDialog-hqLCuGV5.js} +12 -12
  27. package/dist/{RichTextEditorContent-CU5EOlM_.js → RichTextEditorContent-xIEF0Y3Z.js} +8 -8
  28. package/dist/{SaveBlockDialog-S9aFi0cy.js → SaveBlockDialog-CQlCP_XC.js} +47 -47
  29. package/dist/{SavedBlocksBrowserModal-DIdn6B0J.js → SavedBlocksBrowserModal-BXA32Fx6.js} +24 -24
  30. package/dist/{SavedBlocksPanels-Cme2M6u8.js → SavedBlocksPanels-BKUzbamj.js} +1 -1
  31. package/dist/{SavedBlocksPickBar-BDmA7r3m.js → SavedBlocksPickBar-BlvF-4UF.js} +9 -9
  32. package/dist/{TemplateSettings-C_LHLm5M.js → TemplateSettings-CYFtR8zv.js} +41 -41
  33. package/dist/{TestEmailModal-CLIRn7eL.js → TestEmailModal-BbaL17HO.js} +20 -20
  34. package/dist/{TestEmailPanel-frdtjC8h.js → TestEmailPanel-DhB1CSpg.js} +1 -1
  35. package/dist/{TitleEditor-D5kC56Jl.js → TitleEditor-3BRl8u5l.js} +22 -22
  36. package/dist/{Toolbar-D904Yw_R.js → Toolbar-pzNIakGM.js} +1090 -856
  37. package/dist/{TplModal-BBdotDf1.js → TplModal-WNuWhHZm.js} +4 -4
  38. package/dist/{VersionHistoryMenu-BnP0EyLl.js → VersionHistoryMenu--T-Qp_mH.js} +17 -17
  39. package/dist/{VersionHistoryPanels-DhagEgOk.js → VersionHistoryPanels-BPubvYIE.js} +1 -1
  40. package/dist/{VersionPreviewBanner-BPP939cD.js → VersionPreviewBanner-ClL3Wkln.js} +7 -7
  41. package/dist/WrapperBlock-CjfCPceb.js +56 -0
  42. package/dist/{blockTypeIcons-CoRQV_hP.js → blockTypeIcons-12OMwVyN.js} +3 -3
  43. package/dist/bundle-stats.json +6 -6
  44. package/dist/{ca-DIkMxYCN.js → ca-BJn8lcJx.js} +8 -0
  45. package/dist/cdn/chunks/{AiAltTextPopover-CUGOPuRo.js → AiAltTextPopover-PFjTrl0y.js} +5 -5
  46. package/dist/cdn/chunks/{AiAltTextPopover-CUGOPuRo.js.map → AiAltTextPopover-PFjTrl0y.js.map} +1 -1
  47. package/dist/cdn/chunks/{AiAltTextReview-B9vm_L-8.js → AiAltTextReview-BMjzvApH.js} +5 -5
  48. package/dist/cdn/chunks/{AiAltTextReview-B9vm_L-8.js.map → AiAltTextReview-BMjzvApH.js.map} +1 -1
  49. package/dist/cdn/chunks/{AiChatPanel-By8Uo1nH.js → AiChatPanel-C2gpq4kP.js} +107 -107
  50. package/dist/cdn/chunks/{AiChatPanel-By8Uo1nH.js.map → AiChatPanel-C2gpq4kP.js.map} +1 -1
  51. package/dist/cdn/chunks/{AiPanels-BblCSkQy.js → AiPanels-Cx3PE2mE.js} +2 -2
  52. package/dist/cdn/chunks/{AiPanels-BblCSkQy.js.map → AiPanels-Cx3PE2mE.js.map} +1 -1
  53. package/dist/cdn/chunks/{AiRewriteMenu-BvV_7tNZ.js → AiRewriteMenu-CnkyjPEu.js} +13 -13
  54. package/dist/cdn/chunks/{AiRewriteMenu-BvV_7tNZ.js.map → AiRewriteMenu-CnkyjPEu.js.map} +1 -1
  55. package/dist/cdn/chunks/{BlockIssueBadge-D3Plo_wt.js → BlockIssueBadge-DncZ-HDf.js} +5 -5
  56. package/dist/cdn/chunks/{BlockIssueBadge-D3Plo_wt.js.map → BlockIssueBadge-DncZ-HDf.js.map} +1 -1
  57. package/dist/cdn/chunks/BlockPreviewCanvas-CCSEzL46.js +156 -0
  58. package/dist/cdn/chunks/BlockPreviewCanvas-CCSEzL46.js.map +1 -0
  59. package/dist/cdn/chunks/{CloudHeaderExtras-BtqdN777.js → CloudHeaderExtras-uUJYJFJ6.js} +2 -2
  60. package/dist/cdn/chunks/{CloudHeaderExtras-BtqdN777.js.map → CloudHeaderExtras-uUJYJFJ6.js.map} +1 -1
  61. package/dist/cdn/chunks/{CloudPanels-CQ0vNgsH.js → CloudPanels-CRztnw4M.js} +4 -4
  62. package/dist/cdn/chunks/{CloudPanels-CQ0vNgsH.js.map → CloudPanels-CRztnw4M.js.map} +1 -1
  63. package/dist/cdn/chunks/{CollaborationNotices-DraFUhyo.js → CollaborationNotices-IuLYT2x7.js} +9 -9
  64. package/dist/cdn/chunks/{CollaborationNotices-DraFUhyo.js.map → CollaborationNotices-IuLYT2x7.js.map} +1 -1
  65. package/dist/cdn/chunks/{CollaboratorBar-0OEH3hrj.js → CollaboratorBar-C1ZI2xwa.js} +3 -3
  66. package/dist/cdn/chunks/{CollaboratorBar-0OEH3hrj.js.map → CollaboratorBar-C1ZI2xwa.js.map} +1 -1
  67. package/dist/cdn/chunks/{CommentsPanel-tZZswofV.js → CommentsPanel-lgjJNrrY.js} +2 -2
  68. package/dist/cdn/chunks/{CommentsPanel-tZZswofV.js.map → CommentsPanel-lgjJNrrY.js.map} +1 -1
  69. package/dist/cdn/chunks/{CommentsSidebar-7Hfl3Hdj.js → CommentsSidebar-DTold7iy.js} +214 -214
  70. package/dist/cdn/chunks/{CommentsSidebar-7Hfl3Hdj.js.map → CommentsSidebar-DTold7iy.js.map} +1 -1
  71. package/dist/cdn/chunks/{CountdownBlock-CjMhMhnv.js → CountdownBlock-8aPSExrv.js} +7 -7
  72. package/dist/cdn/chunks/{CountdownBlock-CjMhMhnv.js.map → CountdownBlock-8aPSExrv.js.map} +1 -1
  73. package/dist/cdn/chunks/{CountdownToolbar-BxW-J7DX.js → CountdownToolbar-CnWQEW5g.js} +50 -50
  74. package/dist/cdn/chunks/{CountdownToolbar-BxW-J7DX.js.map → CountdownToolbar-CnWQEW5g.js.map} +1 -1
  75. package/dist/cdn/chunks/{IssuesPanel-BoHeIjvw.js → IssuesPanel-CrplCzo8.js} +13 -13
  76. package/dist/cdn/chunks/{IssuesPanel-BoHeIjvw.js.map → IssuesPanel-CrplCzo8.js.map} +1 -1
  77. package/dist/cdn/chunks/{LanguageMenu-BnYN5N1h.js → LanguageMenu-B6MNInCL.js} +57 -57
  78. package/dist/cdn/chunks/{LanguageMenu-BnYN5N1h.js.map → LanguageMenu-B6MNInCL.js.map} +1 -1
  79. package/dist/cdn/chunks/{LocaleNotices-8J2DRWeg.js → LocaleNotices-TxeAl8Iq.js} +10 -10
  80. package/dist/cdn/chunks/{LocaleNotices-8J2DRWeg.js.map → LocaleNotices-TxeAl8Iq.js.map} +1 -1
  81. package/dist/cdn/chunks/{LogicTagInsertButton-Bt2PXbQ0.js → LogicTagInsertButton-DvSVx2DB.js} +30 -30
  82. package/dist/cdn/chunks/LogicTagInsertButton-DvSVx2DB.js.map +1 -0
  83. package/dist/cdn/chunks/{MediaEditModal-Dz972UFx.js → MediaEditModal-tGK6htBl.js} +8 -8
  84. package/dist/cdn/chunks/{MediaEditModal-Dz972UFx.js.map → MediaEditModal-tGK6htBl.js.map} +1 -1
  85. package/dist/cdn/chunks/{MediaPanels-C6Hqtp1H.js → MediaPanels-BVrQYz2C.js} +2 -2
  86. package/dist/cdn/chunks/{MediaPanels-C6Hqtp1H.js.map → MediaPanels-BVrQYz2C.js.map} +1 -1
  87. package/dist/cdn/chunks/{MergeTagInput-BELdMRni.js → MergeTagInput-DeuNH3re.js} +13 -13
  88. package/dist/cdn/chunks/{MergeTagInput-BELdMRni.js.map → MergeTagInput-DeuNH3re.js.map} +1 -1
  89. package/dist/cdn/chunks/{MergeTagModeToggle-DKfMDIEF.js → MergeTagModeToggle-D7maMGIM.js} +5 -5
  90. package/dist/cdn/chunks/{MergeTagModeToggle-DKfMDIEF.js.map → MergeTagModeToggle-D7maMGIM.js.map} +1 -1
  91. package/dist/cdn/chunks/{MergeTagTextarea-w6xen3Xh.js → MergeTagTextarea-B2xxIU3e.js} +6 -6
  92. package/dist/cdn/chunks/{MergeTagTextarea-w6xen3Xh.js.map → MergeTagTextarea-B2xxIU3e.js.map} +1 -1
  93. package/dist/cdn/chunks/{ParagraphEditor-Cal9hY3U.js → ParagraphEditor-Bx_Hlw8d.js} +106 -106
  94. package/dist/cdn/chunks/{ParagraphEditor-Cal9hY3U.js.map → ParagraphEditor-Bx_Hlw8d.js.map} +1 -1
  95. package/dist/cdn/chunks/{RestoreVersionDialog-f_ulmASY.js → RestoreVersionDialog-CPrrWTsT.js} +12 -12
  96. package/dist/cdn/chunks/{RestoreVersionDialog-f_ulmASY.js.map → RestoreVersionDialog-CPrrWTsT.js.map} +1 -1
  97. package/dist/cdn/chunks/{RichTextEditorContent-C_v0kS4A.js → RichTextEditorContent-Dze4C9VI.js} +8 -8
  98. package/dist/cdn/chunks/{RichTextEditorContent-C_v0kS4A.js.map → RichTextEditorContent-Dze4C9VI.js.map} +1 -1
  99. package/dist/cdn/chunks/{SaveBlockDialog-C6N9RFls.js → SaveBlockDialog-CXVwnfsy.js} +51 -51
  100. package/dist/cdn/chunks/{SaveBlockDialog-C6N9RFls.js.map → SaveBlockDialog-CXVwnfsy.js.map} +1 -1
  101. package/dist/cdn/chunks/{SavedBlocksBrowserModal-Bl2sl09D.js → SavedBlocksBrowserModal-BDTmenOE.js} +23 -23
  102. package/dist/cdn/chunks/{SavedBlocksBrowserModal-Bl2sl09D.js.map → SavedBlocksBrowserModal-BDTmenOE.js.map} +1 -1
  103. package/dist/cdn/chunks/{SavedBlocksPanels-DqVcmEUK.js → SavedBlocksPanels-B41Rk_v1.js} +2 -2
  104. package/dist/cdn/chunks/{SavedBlocksPanels-DqVcmEUK.js.map → SavedBlocksPanels-B41Rk_v1.js.map} +1 -1
  105. package/dist/cdn/chunks/{SavedBlocksPickBar-DE-J1JVL.js → SavedBlocksPickBar-B97z_rFH.js} +11 -11
  106. package/dist/cdn/chunks/{SavedBlocksPickBar-DE-J1JVL.js.map → SavedBlocksPickBar-B97z_rFH.js.map} +1 -1
  107. package/dist/cdn/chunks/{TemplateSettings-CpoKZ8oV.js → TemplateSettings-YwwRbxPc.js} +102 -102
  108. package/dist/cdn/chunks/{TemplateSettings-CpoKZ8oV.js.map → TemplateSettings-YwwRbxPc.js.map} +1 -1
  109. package/dist/cdn/chunks/{TestEmailModal-DI3z__Bd.js → TestEmailModal-BiFP2Cbx.js} +20 -20
  110. package/dist/cdn/chunks/{TestEmailModal-DI3z__Bd.js.map → TestEmailModal-BiFP2Cbx.js.map} +1 -1
  111. package/dist/cdn/chunks/{TestEmailPanel-Cp5d2YGn.js → TestEmailPanel-BrivPMk2.js} +2 -2
  112. package/dist/cdn/chunks/{TestEmailPanel-Cp5d2YGn.js.map → TestEmailPanel-BrivPMk2.js.map} +1 -1
  113. package/dist/cdn/chunks/{TitleEditor-C2syRLdZ.js → TitleEditor-CzPkkL2s.js} +19 -19
  114. package/dist/cdn/chunks/{TitleEditor-C2syRLdZ.js.map → TitleEditor-CzPkkL2s.js.map} +1 -1
  115. package/dist/cdn/chunks/{Toolbar-NEE8qxYh.js → Toolbar-VH07SzX7.js} +1153 -919
  116. package/dist/cdn/chunks/Toolbar-VH07SzX7.js.map +1 -0
  117. package/dist/cdn/chunks/{TplModal-B1MgvtX8.js → TplModal-DMe6J811.js} +6 -6
  118. package/dist/cdn/chunks/{TplModal-B1MgvtX8.js.map → TplModal-DMe6J811.js.map} +1 -1
  119. package/dist/cdn/chunks/{VersionHistoryMenu-CZury5gU.js → VersionHistoryMenu-DkwbKhBl.js} +16 -16
  120. package/dist/cdn/chunks/{VersionHistoryMenu-CZury5gU.js.map → VersionHistoryMenu-DkwbKhBl.js.map} +1 -1
  121. package/dist/cdn/chunks/{VersionHistoryPanels-Cefd8i_e.js → VersionHistoryPanels-CgxhMRAl.js} +2 -2
  122. package/dist/cdn/chunks/{VersionHistoryPanels-Cefd8i_e.js.map → VersionHistoryPanels-CgxhMRAl.js.map} +1 -1
  123. package/dist/cdn/chunks/{VersionPreviewBanner-C4Ji8nu4.js → VersionPreviewBanner-WVBDBrwQ.js} +8 -8
  124. package/dist/cdn/chunks/{VersionPreviewBanner-C4Ji8nu4.js.map → VersionPreviewBanner-WVBDBrwQ.js.map} +1 -1
  125. package/dist/cdn/chunks/WrapperBlock-CCCIcqe2.js +58 -0
  126. package/dist/cdn/chunks/WrapperBlock-CCCIcqe2.js.map +1 -0
  127. package/dist/cdn/chunks/{blockTypeIcons-Cc6RJ27V.js → blockTypeIcons-CzYA5DF9.js} +2 -2
  128. package/dist/cdn/chunks/{blockTypeIcons-Cc6RJ27V.js.map → blockTypeIcons-CzYA5DF9.js.map} +1 -1
  129. package/dist/cdn/chunks/{ca-DIkMxYCN.js → ca-BJn8lcJx.js} +9 -1
  130. package/dist/cdn/chunks/ca-BJn8lcJx.js.map +1 -0
  131. package/dist/cdn/chunks/composables-D3lsO7Io.js +3101 -0
  132. package/dist/cdn/chunks/composables-D3lsO7Io.js.map +1 -0
  133. package/dist/cdn/chunks/{createCloudRuntime-DJkDGKQ_.js → createCloudRuntime-CE79GB1H.js} +16 -16
  134. package/dist/cdn/chunks/{createCloudRuntime-DJkDGKQ_.js.map → createCloudRuntime-CE79GB1H.js.map} +1 -1
  135. package/dist/{de-Cc6Ue0UD.js → cdn/chunks/de-BLFp3nWx.js} +10 -0
  136. package/dist/cdn/chunks/de-BLFp3nWx.js.map +1 -0
  137. package/dist/cdn/chunks/dist-Cf1pSluo.js +405 -0
  138. package/dist/cdn/chunks/{dist-DqGgijFI.js.map → dist-Cf1pSluo.js.map} +1 -1
  139. package/dist/cdn/chunks/{editor-modal-erQEOHZN.js → editor-modal-CN69NlOK.js} +187 -187
  140. package/dist/cdn/chunks/{editor-modal-erQEOHZN.js.map → editor-modal-CN69NlOK.js.map} +1 -1
  141. package/dist/cdn/chunks/en-Bcz4gS9U.js +1 -0
  142. package/dist/cdn/chunks/{en-BX4FujAQ.js → en-DGGQJGbm.js} +9 -1
  143. package/dist/cdn/chunks/en-DGGQJGbm.js.map +1 -0
  144. package/dist/cdn/chunks/{es-Do5b-MKU.js → es-DTY9qgLv.js} +9 -1
  145. package/dist/cdn/chunks/es-DTY9qgLv.js.map +1 -0
  146. package/dist/cdn/chunks/{extensions-BcwkOjVq.js → extensions-8dlM-fU4.js} +112 -112
  147. package/dist/cdn/chunks/extensions-8dlM-fU4.js.map +1 -0
  148. package/dist/{fr-S1n2Ebzp.js → cdn/chunks/fr-L4FqO9Gp.js} +10 -0
  149. package/dist/cdn/chunks/{fr-S1n2Ebzp.js.map → fr-L4FqO9Gp.js.map} +1 -1
  150. package/dist/cdn/chunks/{icons-Da9GKjPx.js → icons-DHExFLlT.js} +43 -43
  151. package/dist/cdn/chunks/{icons-Da9GKjPx.js.map → icons-DHExFLlT.js.map} +1 -1
  152. package/dist/cdn/chunks/{ja-DLwcq4bA.js → ja-6uOXkh4v.js} +9 -1
  153. package/dist/cdn/chunks/ja-6uOXkh4v.js.map +1 -0
  154. package/dist/cdn/chunks/{keys-CoQtCqNv.js → keys-BUmIvYy3.js} +4 -4
  155. package/dist/cdn/chunks/keys-BUmIvYy3.js.map +1 -0
  156. package/dist/{nl-0JSWaZpT.js → cdn/chunks/nl-DCxuxwNq.js} +10 -0
  157. package/dist/cdn/chunks/nl-DCxuxwNq.js.map +1 -0
  158. package/dist/cdn/chunks/{normalizeMergeTagMarkup-BrGw5jxk.js → normalizeMergeTagMarkup-aWjkotui.js} +67 -67
  159. package/dist/cdn/chunks/normalizeMergeTagMarkup-aWjkotui.js.map +1 -0
  160. package/dist/cdn/chunks/{preRenderCustomBlocks-Cj0XYwuh.js → preRenderCustomBlocks-Dn6dFUwx.js} +4 -4
  161. package/dist/cdn/chunks/{preRenderCustomBlocks-Cj0XYwuh.js.map → preRenderCustomBlocks-Dn6dFUwx.js.map} +1 -1
  162. package/dist/{pt-BR-D3VlIMDZ.js → cdn/chunks/pt-BR-CBkcrebr.js} +10 -0
  163. package/dist/cdn/chunks/pt-BR-CBkcrebr.js.map +1 -0
  164. package/dist/cdn/chunks/{sanitizeHtml-GxJCxKcP.js → sanitizeHtml-B3njfkSy.js} +11 -11
  165. package/dist/cdn/chunks/{sanitizeHtml-GxJCxKcP.js.map → sanitizeHtml-B3njfkSy.js.map} +1 -1
  166. package/dist/cdn/chunks/{socialIcons-B5zrrV8-.js → socialIcons-BFgc3qqJ.js} +354 -341
  167. package/dist/cdn/chunks/{socialIcons-B5zrrV8-.js.map → socialIcons-BFgc3qqJ.js.map} +1 -1
  168. package/dist/cdn/chunks/{src-Diw9SLIe.js → src-C9JWWxAk.js} +419 -423
  169. package/dist/cdn/chunks/src-C9JWWxAk.js.map +1 -0
  170. package/dist/cdn/chunks/src-GgKlXNxy.js +710 -0
  171. package/dist/cdn/chunks/src-GgKlXNxy.js.map +1 -0
  172. package/dist/cdn/chunks/{src-v47QHNmB.js → src-mXG-Of9A.js} +669 -662
  173. package/dist/cdn/chunks/src-mXG-Of9A.js.map +1 -0
  174. package/dist/cdn/chunks/{tiptap-Dipw_zOQ.js → tiptap-C940SvId.js} +3 -3
  175. package/dist/cdn/chunks/{tiptap-Dipw_zOQ.js.map → tiptap-C940SvId.js.map} +1 -1
  176. package/dist/cdn/chunks/{useCloudI18n-Cc5NZqiI.js → useCloudI18n-Xsih9yRH.js} +2 -2
  177. package/dist/cdn/chunks/{useCloudI18n-Cc5NZqiI.js.map → useCloudI18n-Xsih9yRH.js.map} +1 -1
  178. package/dist/cdn/chunks/{useEditorRoot-D_LuZ_hE.js → useEditorRoot-Beau2Z_T.js} +2 -2
  179. package/dist/cdn/chunks/{useEditorRoot-D_LuZ_hE.js.map → useEditorRoot-Beau2Z_T.js.map} +1 -1
  180. package/dist/cdn/chunks/{useI18n-BnJYydPv.js → useI18n-D8s7HtTn.js} +2 -2
  181. package/dist/cdn/chunks/{useI18n-BnJYydPv.js.map → useI18n-D8s7HtTn.js.map} +1 -1
  182. package/dist/cdn/chunks/{useLocalizedDisplay-DekV8qar.js → useLocalizedDisplay-Bgg4qpev.js} +6 -6
  183. package/dist/cdn/chunks/{useLocalizedDisplay-DekV8qar.js.map → useLocalizedDisplay-Bgg4qpev.js.map} +1 -1
  184. package/dist/cdn/chunks/{useLogicTag-Cbp3I7UN.js → useLogicTag-B0PDeDxl.js} +5 -5
  185. package/dist/cdn/chunks/{useLogicTag-Cbp3I7UN.js.map → useLogicTag-B0PDeDxl.js.map} +1 -1
  186. package/dist/cdn/chunks/{useMergeTag-1lrpNyR5.js → useMergeTag-BSU75bKk.js} +8 -8
  187. package/dist/cdn/chunks/{useMergeTag-1lrpNyR5.js.map → useMergeTag-BSU75bKk.js.map} +1 -1
  188. package/dist/cdn/chunks/{usePopoverPosition-BWAXWeBv.js → usePopoverPosition-esO6wjvU.js} +5 -5
  189. package/dist/cdn/chunks/{usePopoverPosition-BWAXWeBv.js.map → usePopoverPosition-esO6wjvU.js.map} +1 -1
  190. package/dist/cdn/chunks/{useScrollToBlock-Ct1AwLD-.js → useScrollToBlock-CJuUu7Xj.js} +2 -2
  191. package/dist/cdn/chunks/{useScrollToBlock-Ct1AwLD-.js.map → useScrollToBlock-CJuUu7Xj.js.map} +1 -1
  192. package/dist/cdn/chunks/{withCurrentFont-DZfmiv8V.js → withCurrentFont-QqBilClC.js} +2 -2
  193. package/dist/cdn/chunks/{withCurrentFont-DZfmiv8V.js.map → withCurrentFont-QqBilClC.js.map} +1 -1
  194. package/dist/cdn/editor.css +1 -1
  195. package/dist/cdn/editor.js +814 -817
  196. package/dist/cdn/editor.js.map +1 -1
  197. package/dist/{check-XMnOOIEC.js → check-CcuCoJDh.js} +1 -1
  198. package/dist/{chevron-down-DmamTEWQ.js → chevron-down-BfYIbFbC.js} +1 -1
  199. package/dist/{chevron-right-BEFXOH27.js → chevron-right-DyjFqY35.js} +1 -1
  200. package/dist/{chevron-up-Dw7woXj8.js → chevron-up-BHEIxuS-.js} +1 -1
  201. package/dist/{circle-alert-BTKC9vkq.js → circle-alert-Tq7kAh9S.js} +1 -1
  202. package/dist/{clock-BVT5u2uG.js → clock-Df0ZiXwQ.js} +1 -1
  203. package/dist/{composables-DPgNn9GZ.js → composables-DreAt_0A.js} +1660 -1620
  204. package/dist/{createCloudRuntime-Bw8TLmQ8.js → createCloudRuntime-CL4tUlDC.js} +15 -15
  205. package/dist/{createLucideIcon-CgDE3xAR.js → createLucideIcon-CfBdtoUw.js} +5 -5
  206. package/dist/{cdn/chunks/de-Cc6Ue0UD.js → de-BLFp3nWx.js} +8 -2
  207. package/dist/{dist-ChOb5XHW.js → dist-0GWMyHtM.js} +1 -1
  208. package/dist/{dist-CBdk1Vcb.js → dist-BMUUt3zJ.js} +284 -277
  209. package/dist/{dist-6DU0me3E.js → dist-B_0FPmoy.js} +1 -1
  210. package/dist/{dist-B8dY8drK.js → dist-BjzK1g4Z.js} +1 -1
  211. package/dist/{dist-54VCNoC0.js → dist-BsumKKh9.js} +1 -1
  212. package/dist/{dist-BWflWcpW.js → dist-C3avsUq9.js} +2 -2
  213. package/dist/{dist-fqSers8_.js → dist-CCLRTtJP.js} +197 -197
  214. package/dist/dist-CiYotUR8.js +406 -0
  215. package/dist/{dist-C3hu_C3w.js → dist-Cr1CLCmx.js} +1 -1
  216. package/dist/{dist-D_XrUEET.js → dist-CsknfjrZ.js} +3 -3
  217. package/dist/{dist-TAv500j6.js → dist-DDytHU_6.js} +1 -1
  218. package/dist/{dist-CcOn7WCo.js → dist-DKV9m4Uu.js} +1 -1
  219. package/dist/{dist-B9a7iVye.js → dist-Dq9VnANT.js} +1 -1
  220. package/dist/{dist-DZ3X-uB8.js → dist-ZrT0vAB6.js} +1 -1
  221. package/dist/{editor-modal-BeX6otLk.js → editor-modal-BD32TXws.js} +107 -107
  222. package/dist/{en-BX4FujAQ.js → en-DGGQJGbm.js} +8 -0
  223. package/dist/en-Dgs_-NBw.js +1 -0
  224. package/dist/{es-Do5b-MKU.js → es-DTY9qgLv.js} +8 -0
  225. package/dist/{extensions-QFAARrjF.js → extensions-DKxHlSd7.js} +385 -385
  226. package/dist/{eye-ByMgHeA_.js → eye-B3psrAqd.js} +1 -1
  227. package/dist/{cdn/chunks/fr-S1n2Ebzp.js → fr-L4FqO9Gp.js} +8 -2
  228. package/dist/{image-Ch8tR35K.js → image-C3yuPDxx.js} +1 -1
  229. package/dist/index.d.ts +60 -12
  230. package/dist/{info-DzSD-Wpk.js → info-DKja7A68.js} +1 -1
  231. package/dist/{ja-DLwcq4bA.js → ja-6uOXkh4v.js} +8 -0
  232. package/dist/{keys-BCqskl51.js → keys-w_VRjoMu.js} +3 -3
  233. package/dist/{link-oDn9AR2w.js → link-DhzPI4Hn.js} +1 -1
  234. package/dist/{list-C5t07dp8.js → list-DVGn7Ik2.js} +1 -1
  235. package/dist/{loader-circle-k6xvKgUB.js → loader-circle-DqKWsMHO.js} +1 -1
  236. package/dist/{message-circle-C23R6OJR.js → message-circle-C4TonoBs.js} +1 -1
  237. package/dist/{cdn/chunks/nl-0JSWaZpT.js → nl-DCxuxwNq.js} +8 -2
  238. package/dist/{normalizeMergeTagMarkup-BS0nRvhq.js → normalizeMergeTagMarkup-Da9JAgx7.js} +75 -75
  239. package/dist/{package-C90eQ7NU.js → package-9OkiEO4S.js} +1 -1
  240. package/dist/{pencil-BK7GrQuA.js → pencil-M9vkOB7C.js} +1 -1
  241. package/dist/{plus-Cr0Mis63.js → plus-DxZiv9YC.js} +1 -1
  242. package/dist/{preRenderCustomBlocks-CiKvKd8V.js → preRenderCustomBlocks-CdqSp2P7.js} +4 -4
  243. package/dist/{cdn/chunks/pt-BR-D3VlIMDZ.js → pt-BR-CBkcrebr.js} +8 -2
  244. package/dist/{refresh-cw-_ZLOIEvA.js → refresh-cw-UY8_sdFG.js} +1 -1
  245. package/dist/{rotate-ccw-CB5wsHwv.js → rotate-ccw-BFTGCpHn.js} +1 -1
  246. package/dist/{sanitizeHtml-USjTyALR.js → sanitizeHtml-wBibnBF4.js} +6 -6
  247. package/dist/{search-BmrQNox8.js → search-RuGJnMEn.js} +1 -1
  248. package/dist/{send-blAsIBBg.js → send-DGB1ar02.js} +1 -1
  249. package/dist/{smartphone-BPpWYrwV.js → smartphone-CVA29CU_.js} +1 -1
  250. package/dist/{socialIcons-NvIg5ahU.js → socialIcons-oo4uL16Y.js} +427 -414
  251. package/dist/{sparkles-OqIxrNp-.js → sparkles-IHfEwEcd.js} +1 -1
  252. package/dist/{square-BP-V7iT-.js → square-_Cl44UU6.js} +1 -1
  253. package/dist/style.css +1 -1
  254. package/dist/templatical-editor.js +922 -925
  255. package/dist/{text-align-start-4mwX2o-F.js → text-align-start-Dqk2Xt_Q.js} +13 -13
  256. package/dist/{trash-B99WixTA.js → trash-Cr7rD5Hh.js} +1 -1
  257. package/dist/{triangle-alert-CHMiDkHa.js → triangle-alert-CKcpwtUj.js} +1 -1
  258. package/dist/{upload-Cp8o-hrN.js → upload-DR9pqVON.js} +1 -1
  259. package/dist/{useCloudI18n-Dh2iydo1.js → useCloudI18n-BczJoFf4.js} +1 -1
  260. package/dist/{useEditorRoot-DY3mgcHm.js → useEditorRoot-BcXKhM_8.js} +1 -1
  261. package/dist/{useI18n-CgtvtF4C.js → useI18n-zeWYtWSv.js} +1 -1
  262. package/dist/useLocalizedDisplay-Cbhx208c.js +31 -0
  263. package/dist/{useLogicTag-D8zgkXfb.js → useLogicTag-B4Zpk3eo.js} +4 -4
  264. package/dist/{useMergeTag-k7Kr0nMd.js → useMergeTag-B5qlq8px.js} +8 -8
  265. package/dist/{usePopoverPosition-VDQjyX_A.js → usePopoverPosition-Br3zt_MQ.js} +4 -4
  266. package/dist/{useScrollToBlock-B35ObCGK.js → useScrollToBlock-BfOzc1Z6.js} +2 -2
  267. package/dist/{withCurrentFont-Bzeg_gfH.js → withCurrentFont-m_PHcOD0.js} +1 -1
  268. package/dist/{x-BIBStNMS.js → x-DZSFHafL.js} +1 -1
  269. package/package.json +10 -10
  270. package/dist/BlockPreviewCanvas-C23A6FRm.js +0 -140
  271. package/dist/LanguageMenu-DcABUYop.js +0 -403
  272. package/dist/WrapperBlock-BAT3T0Cz.js +0 -44
  273. package/dist/cdn/chunks/BlockPreviewCanvas-Dr-xGq6v.js +0 -142
  274. package/dist/cdn/chunks/BlockPreviewCanvas-Dr-xGq6v.js.map +0 -1
  275. package/dist/cdn/chunks/LogicTagInsertButton-Bt2PXbQ0.js.map +0 -1
  276. package/dist/cdn/chunks/Toolbar-NEE8qxYh.js.map +0 -1
  277. package/dist/cdn/chunks/WrapperBlock-DFY-7YSs.js +0 -46
  278. package/dist/cdn/chunks/WrapperBlock-DFY-7YSs.js.map +0 -1
  279. package/dist/cdn/chunks/ca-DIkMxYCN.js.map +0 -1
  280. package/dist/cdn/chunks/composables-nyxwrM27.js +0 -3061
  281. package/dist/cdn/chunks/composables-nyxwrM27.js.map +0 -1
  282. package/dist/cdn/chunks/de-Cc6Ue0UD.js.map +0 -1
  283. package/dist/cdn/chunks/dist-DqGgijFI.js +0 -405
  284. package/dist/cdn/chunks/en-B6tLGRHq.js +0 -1
  285. package/dist/cdn/chunks/en-BX4FujAQ.js.map +0 -1
  286. package/dist/cdn/chunks/es-Do5b-MKU.js.map +0 -1
  287. package/dist/cdn/chunks/extensions-BcwkOjVq.js.map +0 -1
  288. package/dist/cdn/chunks/ja-DLwcq4bA.js.map +0 -1
  289. package/dist/cdn/chunks/keys-CoQtCqNv.js.map +0 -1
  290. package/dist/cdn/chunks/nl-0JSWaZpT.js.map +0 -1
  291. package/dist/cdn/chunks/normalizeMergeTagMarkup-BrGw5jxk.js.map +0 -1
  292. package/dist/cdn/chunks/pt-BR-D3VlIMDZ.js.map +0 -1
  293. package/dist/cdn/chunks/src-Diw9SLIe.js.map +0 -1
  294. package/dist/cdn/chunks/src-UR3AQocX.js +0 -683
  295. package/dist/cdn/chunks/src-UR3AQocX.js.map +0 -1
  296. package/dist/cdn/chunks/src-v47QHNmB.js.map +0 -1
  297. package/dist/dist-0alKVRc_.js +0 -406
  298. package/dist/en-Do0SU6tR.js +0 -1
  299. package/dist/useLocalizedDisplay-LdjosX4w.js +0 -31
@@ -1 +0,0 @@
1
- {"version":3,"file":"src-Diw9SLIe.js","names":["de","en","modules","__import_glob__0_0_","__import_glob__0_1_","MESSAGES","en","meta","meta","meta","meta","de","en","modules","__import_glob__0_0_","__import_glob__0_1_","meta","meta","meta","collectTitles","meta","meta","getHtml","meta","getHtml","meta","getHtml","meta","getHtml","meta","meta","meta","meta","meta","meta","meta","meta","meta","de","en","modules","__import_glob__0_0_","__import_glob__0_1_","MESSAGES","en","meta","meta","meta","meta","meta","meta","meta","meta","de","en","modules","__import_glob__0_0_","__import_glob__0_1_","MESSAGES","en","meta","meta","meta","meta","meta","meta","de","en","modules","__import_glob__0_0_","__import_glob__0_1_","MESSAGES","en","meta","meta","meta","de","en","modules","__import_glob__0_0_","__import_glob__0_1_","MESSAGES","en","slugs","__import_glob__0_0_","__import_glob__0_1_","__exportAll","translatableFields","isWrapper","defaultLocaleOf","isSection","isTable","localeCoverage","isTitle","TRANSLATABLE_HTML_FIELDS","SETTINGS_TRANSLATABLE_FIELDS","isParagraph","isSocialIcons","readPath","resolveLocale","HEADING_LEVEL_FONT_SIZE","isImage","extractUrlScheme","resolveSyntax","isCountdown","isButton","isVideo","resolveHero","resolveBackgroundImage","scanSyntaxMatches","replaceMergeTagSpans","DANGEROUS_SCRIPT_SCHEMES","decodeHtmlEntities","isMenu","isHtml","Parser","DEFAULT_DELIVERABILITY_THRESHOLDS","DEFAULT_COMPATIBILITY_THRESHOLDS","DEFAULT_A11Y_THRESHOLDS","DEFAULT_NON_PRODUCTION_HOSTS","DEFAULT_SHORTENER_HOSTS","getContrastRatio","fgRgb","parseHex","fg","bgRgb","bg","l1","relativeLuminance","l2","lighter","darker","HEX3","HEX6","HEX8","input","trimmed","match8","match6","match3","isOpaqueHex","rs","channel","r","gs","g","bs","b","c","DEFAULT_BG","DEFAULT_TEXT","walkBlocks","rootBg","content","rootTextColor","walk","ownBg","block","effectiveBg","ctx","visit","child","runRules","issues","buildIssue","messageId","hit","ruleId","formatted","formatMessage","opts","rules","rule","sev","hits","resolveOptions","overrides","args","thresholds","links","deliverability","compatibility","locale","override","resolveDeliverabilityOptions","tool","resolveCompatibilityOptions","resolveAccessibilityOptions","resolveStructureOptions","resolveLinksOptions","de_exports$6","de$6","en_exports$6","en$6","formatMessagePair","params","template","interpolate","text","value","key","modules$6","MESSAGES$5","path","match","getMessages","imgMissingAlt","meta$37","FILENAME_PATTERNS","imgAltIsFilename","alt","re","imgAltTooLong","imgDecorativeNeedsEmptyAlt","de_exports$5","de$5","en_exports$5","en$5","modules$5","DICTIONARIES","getDictionary","UNIONED_DICTIONARY","unionAll","set","dict","phrase","pick","d","normalizeForMatch","imgLinkedNoContext","tokens","hints","token","extractAnchors","anchors","current","buffer","finalize","parser","name","attribs","html","hasNestedAnchors","stripHtmlComments","depth","out","i","start","end","extractText","chunk","isHtmlWhitespace","char","isAttrNameChar","isTagNameStart","isTagNameChar","doubleQuotedAttr","attrRawValue","attr","quote","findAttrSpans","target","spans","attrs","nameStart","attrName","nameEnd","valueEnd","removeAttrSpan","from","span","rewriteOpenTags","copiedTo","open","tagEnd","replacement","headingEmpty","meta$32","collectTitles$1","blocks","column","headingSkipLevel","titles","lastLevel","title","meta$31","collectTitles","headingMultipleH1","h1s","t","meta$30","getHtml$4","linkEmpty","anchor","meta$29","getHtml$3","linkVagueText","phrases","offender","a","meta$28","getHtml$2","linkHrefEmpty","href","meta$27","getHtml$1","hasSafeRel","rel","linkTargetBlankNoRel","updated","addNoopenerToTargetBlank","decodedAttrs","relSpans","relSpan","relValue","newRel","meta$26","getHtml","linkNestedAnchor","textAllCaps","letters","ch","meta$24","TEXT_ALIGN_DECL","CHARACTER_REFERENCE","splitDeclarations","declarations","escaped","style","chars","reference","decoded","styleValues","values","isJustified","decl","removeTextAlign","unjustify","next","changed","index","remaining","rawName","textJustified","textLowContrast","color","required","ratio","meta$22","getFontSize","ACCESSIBILITY_RULES","fontSize","padding","estimatedHeight","lintAccessibility","options","id","de_exports$4","de$4","en_exports$4","en$4","modules$4","MESSAGES$4","getStructureMessages","formatStructureMessage","meta$17","collectIds","counts","duplicateBlockId","count","meta$16","findEmptyColumns","section","columnIndex","emptyColumn","meta$15","isSectionEmpty","emptySection","heroNotApplied","hero","enclosingBand","isPaintedColor","nestedBackgroundImage","band","nestedSection","meta$11","expectedColumnCount","layout","STRUCTURE_RULES","expected","actual","lintStructure","de_exports$3","de$3","en_exports$3","en$3","modules$3","MESSAGES$3","getLinkMessages","formatLinkMessage","walkUrls","occurrences","item","icon","meta$9","DANGEROUS_SCRIPT_PROTOCOLS","matchDangerousProtocol","scheme","url","legacyScheme","proto","javascriptProtocol","occ","protocol","meta$8","SUPPORTED","DANGEROUS","getProtocol","unsupportedProtocol","meta$7","isMalformedMailto","recipients","list","recipient","at","local","domain","malformedMailto","meta$6","VALID_SUBSCRIBER_CHARS","VALID_PARAM","isMalformedTel","subscriber","p","malformedTel","meta$5","globToRegex","expanded","pattern","extractHost","localhostOrStaging","patterns","regexes","host","meta$4","RELATIVE_URL","LINK_RULES","lintLinks","de_exports$2","de$2","en_exports$2","en$2","modules$2","MESSAGES$2","getDeliverabilityMessages","formatDeliverabilityMessage","MULTI_PART_SUFFIXES","suffixes","parseHttpUrl","normalizedHost","registrableDomain","labels","lastTwo","isSameSite","leftUrl","left","rightUrl","right","meta$3","DOMAIN_LABEL","labelUrl","label","DELIVERABILITY_RULES","textUrl","linkUrl","textHost","linkHost","entry","ipv4","ipv6","hasCustom","hasImage","parts","row","cell","min","lintDeliverability","CANIEMAIL_NICENAMES","\"family\"","\"gmail\"","\"outlook\"","\"yahoo\"","\"aol\"","\"thunderbird\"","\"microsoft\"","\"sfr\"","\"orange\"","\"protonmail\"","\"hey\"","\"fastmail\"","\"laposte\"","\"gmx\"","\"rainloop\"","\"platform\"","\"webmail\"","\"ios\"","\"android\"","\"windows\"","\"macos\"","CANIEMAIL_DATA","\"title\"","\"url\"","\"lastTestDate\"","\"notes\"","\"cells\"","\"value\"","\"version\"","slugs_default","stripCssComments","css","close","stripCssUrlsAndStrings","lower","needle","closers","pos","k","opener","cursor","scanHtml","scan","urls","inStyle","styleText","cssSource","addCss","source","inline","tag","segment","stylesheet","scanBlock","stylesheets","clean","cssExcerpt","prop","element","colorValue","imageMedia","backgroundWithoutFallback","sources","declaration","image","detect","tags","kind","cssUrls","candidate","v","FEATURES","familyOrder","familyNames","platformNames","noteExcludes","slug","note","usage","supported","supportFor","feature","clients","dot","family","platform","support","familyName","platformName","n","formatClientGroups","allByFamily","selected","client","bucket","groups","ai","bi","members","limited","de_exports$1","de$1","en_exports$1","en$1","modules$1","MESSAGES$1","getCompatibilityMessages","formatCompatibilityMessage","map","hand","catalog","handRules","COMPATIBILITY_RULES","bytes","lintScan","resolved","finding","unsupported","defaultSeverity","configured","severity","lintCompatibility","cache","lintCompiledHtml","de_exports","de","en_exports","en","modules","MESSAGES","getLocalizationMessages","formatLocalizationMessage","textFields","fields","field","fieldHit","coverage","spanTokens","marker","format","placeholders","matches","logic","syntax","acceptedLogic","logicIndex","placeholderIndex","placeholder","other","LOCALIZATION_RULES","covered","base","translated","lintLocalization","contentLocale","isLintFullyDisabled","lintTemplate","defaultLocale","projected","issue","withoutFix"],"sources":["../../../../quality/src/types.ts","../../../../quality/src/deliverability/shorteners.ts","../../../../quality/src/contrast.ts","../../../../quality/src/walk.ts","../../../../quality/src/run-rules.ts","../../../../quality/src/accessibility/messages/de.ts","../../../../quality/src/accessibility/messages/en.ts","../../../../quality/src/format-message.ts","../../../../quality/src/accessibility/messages/index.ts","../../../../quality/src/accessibility/rules/img-missing-alt.ts","../../../../quality/src/accessibility/rules/img-alt-is-filename.ts","../../../../quality/src/accessibility/rules/img-alt-too-long.ts","../../../../quality/src/accessibility/rules/img-decorative-needs-empty-alt.ts","../../../../quality/src/accessibility/dictionaries/de.ts","../../../../quality/src/accessibility/dictionaries/en.ts","../../../../quality/src/accessibility/dictionaries/index.ts","../../../../quality/src/accessibility/rules/img-linked-no-context.ts","../../../../quality/src/html-utils.ts","../../../../quality/src/accessibility/rules/heading-empty.ts","../../../../quality/src/accessibility/rules/heading-skip-level.ts","../../../../quality/src/accessibility/rules/heading-multiple-h1.ts","../../../../quality/src/accessibility/rules/link-empty.ts","../../../../quality/src/accessibility/rules/link-vague-text.ts","../../../../quality/src/accessibility/rules/link-href-empty.ts","../../../../quality/src/accessibility/rules/link-target-blank-no-rel.ts","../../../../quality/src/accessibility/rules/link-nested-anchor.ts","../../../../quality/src/accessibility/rules/text-all-caps.ts","../../../../quality/src/accessibility/rules/text-justified.ts","../../../../quality/src/accessibility/rules/text-low-contrast.ts","../../../../quality/src/accessibility/rules/text-too-small.ts","../../../../quality/src/accessibility/rules/button-vague-label.ts","../../../../quality/src/accessibility/rules/button-touch-target.ts","../../../../quality/src/accessibility/rules/button-low-contrast.ts","../../../../quality/src/accessibility/rules/missing-preheader.ts","../../../../quality/src/accessibility/index.ts","../../../../quality/src/structure/messages/de.ts","../../../../quality/src/structure/messages/en.ts","../../../../quality/src/structure/messages/index.ts","../../../../quality/src/structure/rules/duplicate-block-id.ts","../../../../quality/src/structure/rules/empty-column.ts","../../../../quality/src/structure/rules/empty-section.ts","../../../../quality/src/structure/rules/hero-not-applied.ts","../../../../quality/src/structure/band.ts","../../../../quality/src/structure/rules/nested-background-image.ts","../../../../quality/src/structure/rules/nested-section.ts","../../../../quality/src/structure/rules/section-column-mismatch.ts","../../../../quality/src/structure/rules/wrapper-color-over-background-image.ts","../../../../quality/src/structure/index.ts","../../../../quality/src/links/messages/de.ts","../../../../quality/src/links/messages/en.ts","../../../../quality/src/links/messages/index.ts","../../../../quality/src/url-walker.ts","../../../../quality/src/links/rules/javascript-protocol.ts","../../../../quality/src/links/rules/unsupported-protocol.ts","../../../../quality/src/links/rules/malformed-mailto.ts","../../../../quality/src/links/rules/malformed-tel.ts","../../../../quality/src/links/rules/localhost-or-staging.ts","../../../../quality/src/links/rules/relative-url.ts","../../../../quality/src/links/index.ts","../../../../quality/src/deliverability/messages/de.ts","../../../../quality/src/deliverability/messages/en.ts","../../../../quality/src/deliverability/messages/index.ts","../../../../quality/src/deliverability/same-site.ts","../../../../quality/src/deliverability/rules/link-text-domain-mismatch.ts","../../../../quality/src/deliverability/rules/url-shortener.ts","../../../../quality/src/deliverability/rules/ip-address-url.ts","../../../../quality/src/deliverability/rules/low-text.ts","../../../../quality/src/deliverability/index.ts","../../../../quality/src/compatibility/data/caniemail.generated.ts","../../../../quality/src/compatibility/slugs.json","../../../../quality/src/compatibility/scan.ts","../../../../quality/src/compatibility/detect.ts","../../../../quality/src/compatibility/support.ts","../../../../quality/src/compatibility/messages/de.ts","../../../../quality/src/compatibility/messages/en.ts","../../../../quality/src/compatibility/messages/index.ts","../../../../quality/src/compatibility/index.ts","../../../../quality/src/localization/messages/de.ts","../../../../quality/src/localization/messages/en.ts","../../../../quality/src/localization/messages/index.ts","../../../../quality/src/localization/rules.ts","../../../../quality/src/localization/index.ts","../../../../quality/src/util.ts","../../../../quality/src/lint-template.ts"],"sourcesContent":["import type {\n Block,\n CustomBlockDefinition,\n SectionBlock,\n TemplateContent,\n TemplateSettings,\n SyntaxPreset,\n SyntaxPresetName,\n} from \"@templatical/types\";\n\nexport type Severity = \"error\" | \"warning\" | \"info\" | \"off\";\n\nexport interface LintIssue {\n /** Block id, or null for template-level issues. */\n blockId: string | null;\n ruleId: string;\n severity: Exclude<Severity, \"off\">;\n message: string;\n suggestion: string;\n reference: string;\n clients?: ClientSupport[];\n excerpt?: string;\n fix?: LintPatch;\n}\n\nexport interface ClientSupport {\n id: string;\n name: string;\n support: \"unsupported\" | \"partial\";\n notes: string[];\n testedAt: string;\n}\n\nexport interface LintPatchContext {\n updateBlock: (blockId: string, patch: Partial<Block>) => void;\n updateSettings: (patch: Partial<TemplateSettings>) => void;\n removeBlock: (blockId: string) => void;\n}\n\nexport interface LintPatch {\n description: string;\n /** Removal fixes change the shared tree and are omitted in language views. */\n removesBlock?: boolean;\n apply: (ctx: LintPatchContext) => void;\n}\n\nexport interface LintThresholds {\n altMaxLength: number;\n minFontSize: number;\n allCapsMinLength: number;\n minTouchTargetPx: number;\n}\n\n/**\n * Per-rule severity override. Set a rule to `'off'` to disable it.\n * Keys are the full prefixed rule IDs (`a11y.*`, `structure.*`, `link.*`, `deliverability.*`, `compat.*`, `localization.*`)\n * so a value copied from `LintIssue.ruleId` pastes straight in.\n */\nexport type RuleOverrides = Record<string, Severity>;\n\n/** Options consumed only by the accessibility linter. */\nexport interface AccessibilityLintOptions {\n rules?: RuleOverrides;\n thresholds?: Partial<LintThresholds>;\n}\n\n/** Options consumed only by the structure linter. */\nexport interface StructureLintOptions {\n rules?: RuleOverrides;\n}\n\n/** Options consumed only by the links linter. */\nexport interface LinksLintOptions {\n rules?: RuleOverrides;\n /**\n * Host patterns that should flag as \"staging / non-production\".\n * Each entry is a glob-style pattern matched against the URL host.\n * `*` matches any run of characters (including `.`), so `*.staging.*`\n * matches `app.staging.example.com`.\n *\n * Default: ['localhost', '127.0.0.1', '0.0.0.0', '*.local',\n * '*.staging.*', '*.dev.*']\n */\n nonProductionHosts?: string[];\n}\n\nexport interface DeliverabilityThresholds {\n /** Visible characters below which `deliverability.low-text` fires. */\n minTextLength: number;\n}\n\nexport const DEFAULT_DELIVERABILITY_THRESHOLDS: DeliverabilityThresholds = {\n minTextLength: 200,\n};\n\nexport interface DeliverabilityLintOptions {\n rules?: RuleOverrides;\n thresholds?: Partial<DeliverabilityThresholds>;\n /** Hosts treated as URL shorteners. Replaces DEFAULT_SHORTENER_HOSTS; spread the default to extend it. */\n shortenerHosts?: string[];\n}\n\nexport interface CompatibilityThresholds {\n maxHtmlBytes: number;\n}\n\nexport const DEFAULT_COMPATIBILITY_THRESHOLDS: CompatibilityThresholds = {\n maxHtmlBytes: 92_160,\n};\n\nexport interface CompatibilityLintOptions {\n rules?: RuleOverrides;\n thresholds?: Partial<CompatibilityThresholds>;\n}\n\nexport interface LocalizationLintOptions {\n rules?: RuleOverrides;\n}\n\nexport interface LintOptions {\n /**\n * Fully disable linting. When true, the editor skips lazy-loading the\n * package, hides the sidebar tab, and suppresses inline badges.\n */\n disabled?: boolean;\n /** Message language. Falls back to `en`. */\n locale?: string;\n /** Template language to lint. Defaults to `content.settings.locale`. Dictionaries remain a union. */\n contentLocale?: string;\n /** Definitions used to identify custom blocks' translatable text. */\n customBlocks?: CustomBlockDefinition[];\n /** Merge-tag syntax for localization checks. Defaults to Liquid. */\n mergeTagSyntax?: SyntaxPresetName | SyntaxPreset;\n /**\n * Accessibility linter config. Set to `false` to disable the whole\n * `lintAccessibility` linter without enumerating its rules.\n */\n accessibility?: false | AccessibilityLintOptions;\n /**\n * Structure linter config. Set to `false` to disable the whole\n * `lintStructure` linter without enumerating its rules.\n */\n structure?: false | StructureLintOptions;\n /**\n * Links linter config. Set to `false` to disable the whole `lintLinks`\n * linter without enumerating its rules.\n */\n links?: false | LinksLintOptions;\n /**\n * Deliverability linter config. Set to `false` to disable the whole\n * `lintDeliverability` linter without enumerating its rules.\n */\n deliverability?: false | DeliverabilityLintOptions;\n /** Email-client compatibility checks over pass-through content. */\n compatibility?: false | CompatibilityLintOptions;\n /** Missing, stale, and mismatched merge-tag checks for language versions. */\n localization?: false | LocalizationLintOptions;\n}\n\nexport interface ResolvedLinksOptions {\n nonProductionHosts: string[];\n}\n\nexport interface ResolvedDeliverabilityOptions {\n minTextLength: number;\n shortenerHosts: string[];\n}\n\nexport interface ResolvedCompatibilityOptions {\n maxHtmlBytes: number;\n}\n\nexport interface ResolvedOptions {\n locale: string;\n contentLocale?: string;\n customBlocks?: CustomBlockDefinition[];\n mergeTagSyntax?: SyntaxPresetName | SyntaxPreset;\n rules: RuleOverrides;\n thresholds: LintThresholds;\n links: ResolvedLinksOptions;\n deliverability: ResolvedDeliverabilityOptions;\n compatibility: ResolvedCompatibilityOptions;\n /** Returns the effective severity for a rule (override or default). */\n severity: (ruleId: string) => Severity;\n}\n\nexport interface WalkContext {\n parent: Block | null;\n section: SectionBlock | null;\n columnIndex: number | null;\n depth: number;\n /**\n * Nearest opaque ancestor background, or template settings background.\n * Hex string, lowercased.\n */\n resolvedBackgroundColor: string;\n /**\n * Document-level default text color (`settings.textColor`), lowercased hex.\n * A text block that doesn't set its own `color` inherits this, so contrast\n * rules resolve the effective color against it.\n */\n resolvedTextColor: string;\n}\n\nexport interface RuleMeta {\n /** Stable identifier — used for severity overrides and message lookup. */\n id: string;\n /** Default severity when no override is supplied. */\n severity: Exclude<Severity, \"off\">;\n /** Absolute documentation or source URL explaining the rule. */\n reference: string;\n /**\n * For a rule whose hits explain themselves in more than one way: each\n * variant has its own localized message, keyed `<id>.<variant>`, and a hit\n * picks one with `RuleHit.messageVariant`. A rule without variants has one\n * message, keyed by its `id`.\n */\n messageVariants?: readonly string[];\n}\n\n/**\n * What a rule emits per match. The orchestrator combines this with the\n * rule's `meta` (for `ruleId` + default severity) and resolves the\n * localized message via the active locale's message map.\n */\nexport interface RuleHit {\n blockId: string | null;\n /** Interpolation values for the rule's localized message template. */\n params?: Record<string, string | number>;\n /** One of the rule's `meta.messageVariants`: formats the message `<id>.<variant>`. */\n messageVariant?: string;\n clients?: ClientSupport[];\n excerpt?: string;\n fix?: LintPatch;\n}\n\nexport interface Rule {\n meta: RuleMeta;\n /** Block-level rule. Returns a hit or null. */\n block?: (\n block: Block,\n ctx: WalkContext,\n opts: ResolvedOptions,\n ) => RuleHit | null;\n /** Template-level rule. Runs once after the walk. */\n template?: (content: TemplateContent, opts: ResolvedOptions) => RuleHit[];\n compiledHtml?: (html: string, opts: ResolvedOptions) => RuleHit[];\n}\n\nexport const DEFAULT_A11Y_THRESHOLDS: LintThresholds = {\n altMaxLength: 125,\n minFontSize: 14,\n allCapsMinLength: 20,\n minTouchTargetPx: 44,\n};\n\nexport const DEFAULT_NON_PRODUCTION_HOSTS: string[] = [\n \"localhost\",\n \"127.0.0.1\",\n \"0.0.0.0\",\n \"*.local\",\n \"*.staging.*\",\n \"*.dev.*\",\n];\n","/** Hosts commonly used to shorten URLs. */\nexport const DEFAULT_SHORTENER_HOSTS: string[] = [\n \"bit.ly\",\n \"buff.ly\",\n \"cutt.ly\",\n \"dub.sh\",\n \"goo.gl\",\n \"is.gd\",\n \"lnkd.in\",\n \"ow.ly\",\n \"rb.gy\",\n \"rebrand.ly\",\n \"s.id\",\n \"shorturl.at\",\n \"t.co\",\n \"t.ly\",\n \"tiny.cc\",\n \"tinyurl.com\",\n \"v.gd\",\n];\n","/**\n * WCAG 2.1 sRGB relative-luminance contrast.\n *\n * Inputs are hex strings (`#rgb`, `#rrggbb`, optional leading `#`).\n * Returns the contrast ratio (1–21) per WCAG, or `NaN` if either input\n * cannot be parsed as an opaque solid hex color.\n *\n * The codebase uses OKLch for design tokens, but contrast math is\n * sRGB-defined; mixing the two gives incorrect results.\n */\nexport function getContrastRatio(fg: string, bg: string): number {\n const fgRgb = parseHex(fg);\n const bgRgb = parseHex(bg);\n\n if (!fgRgb || !bgRgb) {\n return Number.NaN;\n }\n\n const l1 = relativeLuminance(fgRgb);\n const l2 = relativeLuminance(bgRgb);\n const lighter = Math.max(l1, l2);\n const darker = Math.min(l1, l2);\n\n return (lighter + 0.05) / (darker + 0.05);\n}\n\nexport interface Rgb {\n r: number;\n g: number;\n b: number;\n}\n\nconst HEX3 = /^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i;\nconst HEX6 = /^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;\nconst HEX8 = /^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;\n\nexport function parseHex(input: string | undefined | null): Rgb | null {\n if (typeof input !== \"string\") {\n return null;\n }\n\n const trimmed = input.trim();\n\n const match8 = HEX8.exec(trimmed);\n if (match8) {\n // Only treat fully-opaque (alpha = ff) as a valid RGB color; partial\n // alpha can't be flattened without knowing the underlay.\n if (match8[4].toLowerCase() !== \"ff\") return null;\n return {\n r: parseInt(match8[1], 16),\n g: parseInt(match8[2], 16),\n b: parseInt(match8[3], 16),\n };\n }\n\n const match6 = HEX6.exec(trimmed);\n if (match6) {\n return {\n r: parseInt(match6[1], 16),\n g: parseInt(match6[2], 16),\n b: parseInt(match6[3], 16),\n };\n }\n\n const match3 = HEX3.exec(trimmed);\n if (match3) {\n return {\n r: parseInt(match3[1] + match3[1], 16),\n g: parseInt(match3[2] + match3[2], 16),\n b: parseInt(match3[3] + match3[3], 16),\n };\n }\n\n return null;\n}\n\nexport function isOpaqueHex(input: string | undefined | null): boolean {\n return parseHex(input ?? \"\") !== null;\n}\n\nfunction relativeLuminance({ r, g, b }: Rgb): number {\n const rs = channel(r / 255);\n const gs = channel(g / 255);\n const bs = channel(b / 255);\n return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;\n}\n\nfunction channel(c: number): number {\n return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n}\n","import type { Block, TemplateContent } from \"@templatical/types\";\nimport { isSection, isWrapper } from \"@templatical/types\";\nimport type { WalkContext } from \"./types\";\nimport { isOpaqueHex } from \"./contrast\";\n\nexport type Visitor = (block: Block, ctx: WalkContext) => void;\n\nconst DEFAULT_BG = \"#ffffff\";\nconst DEFAULT_TEXT = \"#1a1a1a\";\n\n/**\n * Pure traversal of the block tree. Calls `visit` once per block in\n * document order, providing a `WalkContext` that includes the resolved\n * background color (nearest opaque ancestor) and structural refs.\n *\n * Sections cannot nest (renderer enforces this), so the walker doesn't\n * descend into a section that lives inside a column. Wrappers are descended\n * so composed layout trees are fully visited. Custom blocks are visited but\n * not descended into.\n */\nexport function walkBlocks(content: TemplateContent, visit: Visitor): void {\n const rootBg = isOpaqueHex(content.settings.backgroundColor)\n ? content.settings.backgroundColor.toLowerCase()\n : DEFAULT_BG;\n // Document-level default text color — constant across the tree. Text blocks\n // that don't set their own `color` inherit it, so it's the effective color\n // contrast rules compare against.\n const rootTextColor = isOpaqueHex(content.settings.textColor)\n ? content.settings.textColor.toLowerCase()\n : DEFAULT_TEXT;\n\n const walk = (block: Block, ctx: WalkContext): void => {\n // A block's own opaque backgroundColor is what's behind its content —\n // visit it with that resolved bg so contrast rules compare against the\n // right surface. Falls back to the inherited section/template bg.\n const ownBg = block.styles?.backgroundColor;\n const effectiveBg = isOpaqueHex(ownBg)\n ? (ownBg as string).toLowerCase()\n : ctx.resolvedBackgroundColor;\n const blockCtx: WalkContext =\n effectiveBg === ctx.resolvedBackgroundColor\n ? ctx\n : { ...ctx, resolvedBackgroundColor: effectiveBg };\n\n visit(block, blockCtx);\n\n if (isWrapper(block)) {\n for (const child of block.children) {\n walk(child, {\n parent: block,\n section: ctx.section,\n columnIndex: null,\n depth: ctx.depth + 1,\n resolvedBackgroundColor: effectiveBg,\n resolvedTextColor: ctx.resolvedTextColor,\n });\n }\n return;\n }\n\n if (!isSection(block)) {\n return;\n }\n\n block.children.forEach((column, columnIndex) => {\n column.forEach((child) =>\n walk(child, {\n parent: block,\n section: block,\n columnIndex,\n depth: ctx.depth + 1,\n resolvedBackgroundColor: effectiveBg,\n resolvedTextColor: ctx.resolvedTextColor,\n }),\n );\n });\n };\n\n for (const block of content.blocks) {\n walk(block, {\n parent: null,\n section: null,\n columnIndex: null,\n depth: 0,\n resolvedBackgroundColor: rootBg,\n resolvedTextColor: rootTextColor,\n });\n }\n}\n","import type { TemplateContent } from \"@templatical/types\";\nimport type {\n AccessibilityLintOptions,\n CompatibilityLintOptions,\n DeliverabilityLintOptions,\n LinksLintOptions,\n LintIssue,\n ResolvedOptions,\n Rule,\n RuleHit,\n RuleOverrides,\n Severity,\n StructureLintOptions,\n} from \"./types\";\nimport {\n DEFAULT_A11Y_THRESHOLDS,\n DEFAULT_COMPATIBILITY_THRESHOLDS,\n DEFAULT_DELIVERABILITY_THRESHOLDS,\n DEFAULT_NON_PRODUCTION_HOSTS,\n} from \"./types\";\nimport { DEFAULT_SHORTENER_HOSTS } from \"./deliverability/shorteners\";\nimport { walkBlocks } from \"./walk\";\n\nexport type MessageFormatter = (\n locale: string,\n /** The rule's id, or `<id>.<variant>` for a hit with a message variant. */\n messageId: string,\n params?: Record<string, string | number>,\n) => { message: string; suggestion: string };\n\n/**\n * Walk the tree once, dispatch every block-level rule, then run every\n * template-level rule. Each tool (lintAccessibility, lintStructure, …)\n * wraps this with its own rule list + message formatter and a pre-built\n * `ResolvedOptions` containing that tool's overrides and tool-scoped config.\n */\nexport function runRules(\n content: TemplateContent,\n rules: Rule[],\n opts: ResolvedOptions,\n formatMessage: MessageFormatter,\n): LintIssue[] {\n const issues: LintIssue[] = [];\n\n function buildIssue(\n ruleId: string,\n severity: Exclude<Severity, \"off\">,\n hit: RuleHit,\n ): LintIssue {\n const messageId = hit.messageVariant\n ? `${ruleId}.${hit.messageVariant}`\n : ruleId;\n const formatted = formatMessage(opts.locale, messageId, hit.params);\n return {\n blockId: hit.blockId,\n ruleId,\n severity,\n ...formatted,\n reference: rules.find((rule) => rule.meta.id === ruleId)!.meta.reference,\n ...(hit.clients ? { clients: hit.clients } : {}),\n ...(hit.excerpt ? { excerpt: hit.excerpt } : {}),\n fix: hit.fix,\n };\n }\n\n walkBlocks(content, (block, ctx) => {\n for (const rule of rules) {\n const sev = opts.severity(rule.meta.id);\n if (sev === \"off\" || !rule.block) continue;\n const hit = rule.block(block, ctx, opts);\n if (hit !== null) {\n issues.push(buildIssue(rule.meta.id, sev, hit));\n }\n }\n });\n\n for (const rule of rules) {\n const sev = opts.severity(rule.meta.id);\n if (sev === \"off\" || !rule.template) continue;\n const hits = rule.template(content, opts);\n for (const hit of hits) {\n issues.push(buildIssue(rule.meta.id, sev, hit));\n }\n }\n\n return issues;\n}\n\n/**\n * Build a `ResolvedOptions` for a given tool. Each tool wrapper passes its\n * own per-tool bag; fields not relevant to the tool fall back to defaults\n * (e.g. `lintStructure` still gets `thresholds` populated, but no structure\n * rule reads them).\n */\nexport function resolveOptions(args: {\n locale: string | undefined;\n rules: Rule[];\n overrides: RuleOverrides | undefined;\n thresholds: Partial<import(\"./types\").LintThresholds> | undefined;\n nonProductionHosts: string[] | undefined;\n deliverabilityThresholds?: Partial<\n import(\"./types\").DeliverabilityThresholds\n >;\n shortenerHosts?: string[];\n compatibilityThresholds?: Partial<import(\"./types\").CompatibilityThresholds>;\n}): ResolvedOptions {\n const overrides = args.overrides ?? {};\n const thresholds = {\n ...DEFAULT_A11Y_THRESHOLDS,\n ...(args.thresholds ?? {}),\n };\n const links = {\n nonProductionHosts: args.nonProductionHosts ?? DEFAULT_NON_PRODUCTION_HOSTS,\n };\n const deliverability = {\n minTextLength:\n args.deliverabilityThresholds?.minTextLength ??\n DEFAULT_DELIVERABILITY_THRESHOLDS.minTextLength,\n shortenerHosts: args.shortenerHosts ?? DEFAULT_SHORTENER_HOSTS,\n };\n const compatibility = {\n maxHtmlBytes:\n args.compatibilityThresholds?.maxHtmlBytes ??\n DEFAULT_COMPATIBILITY_THRESHOLDS.maxHtmlBytes,\n };\n const locale = args.locale ?? \"en\";\n const rules = args.rules;\n\n return {\n locale,\n rules: overrides,\n thresholds,\n links,\n deliverability,\n compatibility,\n severity: (ruleId: string): Severity => {\n const override = overrides[ruleId];\n if (override !== undefined) {\n return override;\n }\n const rule = rules.find((r) => r.meta.id === ruleId);\n return rule?.meta.severity ?? \"warning\";\n },\n };\n}\n\n/** Resolver for the deliverability linter — reads `options.deliverability`. */\nexport function resolveDeliverabilityOptions(\n locale: string | undefined,\n tool: DeliverabilityLintOptions,\n rules: Rule[],\n): ResolvedOptions {\n return resolveOptions({\n locale,\n rules,\n overrides: tool.rules,\n thresholds: undefined,\n nonProductionHosts: undefined,\n deliverabilityThresholds: tool.thresholds,\n shortenerHosts: tool.shortenerHosts,\n });\n}\n\n/** Resolver for pass-through compatibility checks. */\nexport function resolveCompatibilityOptions(\n locale: string | undefined,\n tool: CompatibilityLintOptions,\n rules: Rule[],\n): ResolvedOptions {\n return resolveOptions({\n locale,\n rules,\n overrides: tool.rules,\n thresholds: undefined,\n nonProductionHosts: undefined,\n compatibilityThresholds: tool.thresholds,\n });\n}\n\n/**\n * Resolver for the accessibility linter — reads `options.accessibility`.\n */\nexport function resolveAccessibilityOptions(\n locale: string | undefined,\n tool: AccessibilityLintOptions,\n rules: Rule[],\n): ResolvedOptions {\n return resolveOptions({\n locale,\n rules,\n overrides: tool.rules,\n thresholds: tool.thresholds,\n nonProductionHosts: undefined,\n });\n}\n\n/**\n * Resolver for the structure linter — reads `options.structure`.\n */\nexport function resolveStructureOptions(\n locale: string | undefined,\n tool: StructureLintOptions,\n rules: Rule[],\n): ResolvedOptions {\n return resolveOptions({\n locale,\n rules,\n overrides: tool.rules,\n thresholds: undefined,\n nonProductionHosts: undefined,\n });\n}\n\n/**\n * Resolver for the links linter — reads `options.links`.\n */\nexport function resolveLinksOptions(\n locale: string | undefined,\n tool: LinksLintOptions,\n rules: Rule[],\n): ResolvedOptions {\n return resolveOptions({\n locale,\n rules,\n overrides: tool.rules,\n thresholds: undefined,\n nonProductionHosts: tool.nonProductionHosts,\n });\n}\n","import type en from \"./en\";\n\nconst de: typeof en = {\n \"a11y.img-missing-alt\": {\n message: \"Bild ohne Alt-Text.\",\n suggestion:\n \"Füge eine kurze Beschreibung hinzu oder markiere das Bild als dekorativ.\",\n },\n \"a11y.img-alt-is-filename\": {\n message: 'Alt-Text sieht wie ein Dateiname aus (\"{alt}\").',\n suggestion: \"Beschreibe stattdessen kurz, was das Bild zeigt.\",\n },\n \"a11y.img-alt-too-long\": {\n message: \"Alt-Text ist {length} Zeichen lang.\",\n suggestion: \"Halte den Alt-Text unter {max} Zeichen.\",\n },\n \"a11y.img-decorative-needs-empty-alt\": {\n message: \"Dekoratives Bild hat Alt-Text.\",\n suggestion:\n \"Entferne den Alt-Text oder hebe die Markierung als dekorativ auf.\",\n },\n \"a11y.img-linked-no-context\": {\n message: \"Verlinktes Bild beschreibt nur das Motiv, nicht das Linkziel.\",\n suggestion: \"Nenne das Ziel (z. B. „Frühlingssale ansehen“).\",\n },\n \"a11y.heading-empty\": {\n message: \"Überschrift ist leer.\",\n suggestion: \"Füge Text hinzu oder entferne den Block.\",\n },\n \"a11y.heading-skip-level\": {\n message: \"Überschrift springt von H{from} auf H{to}.\",\n suggestion: \"Gehe jeweils nur eine Ebene weiter.\",\n },\n \"a11y.heading-multiple-h1\": {\n message: \"E-Mail enthält mehr als eine H1.\",\n suggestion: \"Verwende H1 nur einmal für die Hauptüberschrift.\",\n },\n \"a11y.link-empty\": {\n message:\n \"Ein Link in diesem Block hat keinen Text und kein beschriebenes Bild.\",\n suggestion: \"Ergänze Link-Text oder beschreibe das verlinkte Bild.\",\n },\n \"a11y.link-vague-text\": {\n message: \"Link-Text „{text}“ ist unspezifisch.\",\n suggestion: \"Beschreibe stattdessen das Ziel.\",\n },\n \"a11y.link-href-empty\": {\n message: \"Ein Link in diesem Block hat ein leeres oder „#“-href.\",\n suggestion: \"Ergänze eine Ziel-URL oder entferne den Link.\",\n },\n \"a11y.link-target-blank-no-rel\": {\n message: 'Link öffnet in neuem Tab, aber rel=\"noopener\" fehlt.',\n suggestion:\n 'Ergänze rel=\"noopener\", damit das Ziel nicht auf window.opener zugreifen kann.',\n },\n \"a11y.link-nested-anchor\": {\n message:\n \"Ein Link liegt innerhalb eines anderen Links. Verschachtelte Anker sind ungültiges HTML und werden von E-Mail-Clients unterschiedlich gerendert.\",\n suggestion: \"Fasse sie zu einem einzigen Anker zusammen.\",\n },\n \"a11y.text-all-caps\": {\n message: \"Längere Texte in Großbuchstaben sind schwerer lesbar.\",\n suggestion: \"Verwende Groß- und Kleinschreibung.\",\n },\n \"a11y.text-justified\": {\n message:\n \"Blocksatz dehnt die Wortabstände zu ungleichmäßigen „Flüssen“ aus Leerraum, die für Menschen mit Legasthenie und Sehbeeinträchtigung am schwersten zu verfolgen sind.\",\n suggestion: \"Verwende linksbündigen Text.\",\n },\n \"a11y.text-low-contrast\": {\n message: \"Überschriftskontrast beträgt {ratio}:1.\",\n suggestion: \"Erhöhe den Kontrast für WCAG AA auf mindestens {required}:1.\",\n },\n \"a11y.text-too-small\": {\n message: \"Text ist {size}px groß.\",\n suggestion: \"Erhöhe die Größe auf mindestens {min}px.\",\n },\n \"a11y.button-vague-label\": {\n message: \"Button-Beschriftung „{text}“ ist unspezifisch.\",\n suggestion: \"Beschreibe die Aktion.\",\n },\n \"a11y.button-touch-target\": {\n message: \"Button ist etwa {height}px hoch.\",\n suggestion:\n \"Erhöhe ihn auf mindestens {min}px, um Fehltipper auf Mobilgeräten zu vermeiden.\",\n },\n \"a11y.button-low-contrast\": {\n message: \"Buttontextkontrast beträgt {ratio}:1.\",\n suggestion: \"Erhöhe den Kontrast für WCAG AA auf mindestens {required}:1.\",\n },\n \"a11y.missing-preheader\": {\n message:\n \"Kein Preheader-Text gesetzt, daher zeigen Postfächer Bruchstücke des ersten Blocks.\",\n suggestion: \"Ergänze einen Preheader-Text als Vorschau auf die E-Mail.\",\n },\n};\n\nexport default de;\n","const en = {\n \"a11y.img-missing-alt\": {\n message: \"Image is missing alt text.\",\n suggestion: \"Add a short description, or mark the image as decorative.\",\n },\n \"a11y.img-alt-is-filename\": {\n message: 'Alt text looks like a filename (\"{alt}\").',\n suggestion: \"Replace with a short description of what the image conveys.\",\n },\n \"a11y.img-alt-too-long\": {\n message: \"Alt text is {length} characters.\",\n suggestion: \"Keep alt text under {max} characters.\",\n },\n \"a11y.img-decorative-needs-empty-alt\": {\n message: \"Decorative image has alt text.\",\n suggestion: \"Either clear the alt text or unmark the image as decorative.\",\n },\n \"a11y.img-linked-no-context\": {\n message:\n \"Linked image alt describes the image but not the link destination.\",\n suggestion: \"Include where the link goes (e.g. 'Buy spring sale').\",\n },\n \"a11y.heading-empty\": {\n message: \"Heading is empty.\",\n suggestion: \"Add text or remove the block.\",\n },\n \"a11y.heading-skip-level\": {\n message: \"Heading jumps from H{from} to H{to}.\",\n suggestion: \"Step one level at a time.\",\n },\n \"a11y.heading-multiple-h1\": {\n message: \"Email has more than one H1.\",\n suggestion: \"Use H1 once for the main heading.\",\n },\n \"a11y.link-empty\": {\n message: \"A link in this block has no text and no described image.\",\n suggestion: \"Add link text or describe the linked image.\",\n },\n \"a11y.link-vague-text\": {\n message: 'Link text \"{text}\" is vague.',\n suggestion: \"Describe the destination instead.\",\n },\n \"a11y.link-href-empty\": {\n message: \"A link in this block has an empty or '#' href.\",\n suggestion: \"Add a destination URL or remove the link.\",\n },\n \"a11y.link-target-blank-no-rel\": {\n message: 'Link opens in a new tab but is missing rel=\"noopener\".',\n suggestion:\n 'Add rel=\"noopener\" to prevent the destination from accessing window.opener.',\n },\n \"a11y.link-nested-anchor\": {\n message:\n \"A link is nested inside another link. Nested anchors are invalid HTML and clients render them inconsistently.\",\n suggestion: \"Flatten them to a single anchor.\",\n },\n \"a11y.text-all-caps\": {\n message: \"Long all-caps text is harder to read for everyone.\",\n suggestion: \"Use sentence case.\",\n },\n \"a11y.text-justified\": {\n message:\n \"Justified text stretches word spacing into uneven 'rivers' of white space, which is hardest to track for dyslexic and low-vision readers.\",\n suggestion: \"Use left-aligned text.\",\n },\n \"a11y.text-low-contrast\": {\n message: \"Heading contrast is {ratio}:1.\",\n suggestion: \"Increase contrast to at least {required}:1 for WCAG AA.\",\n },\n \"a11y.text-too-small\": {\n message: \"Text is {size}px.\",\n suggestion: \"Increase the size to at least {min}px.\",\n },\n \"a11y.button-vague-label\": {\n message: 'Button label \"{text}\" is vague.',\n suggestion: \"Describe the action.\",\n },\n \"a11y.button-touch-target\": {\n message: \"Button is roughly {height}px tall.\",\n suggestion:\n \"Increase its height to at least {min}px to avoid mis-taps on mobile.\",\n },\n \"a11y.button-low-contrast\": {\n message: \"Button text contrast is {ratio}:1.\",\n suggestion: \"Increase contrast to at least {required}:1 for WCAG AA.\",\n },\n \"a11y.missing-preheader\": {\n message:\n \"No preheader text is set, so inboxes show fragments of the first block.\",\n suggestion: \"Add preheader text that previews the email.\",\n },\n};\n\nexport default en;\n","export interface FormattedMessage {\n message: string;\n suggestion: string;\n}\n\n/** Keep missing placeholders visible so callers can diagnose incomplete params. */\nexport function formatMessagePair(\n template: FormattedMessage,\n params?: Record<string, string | number>,\n): FormattedMessage {\n if (!params) return template;\n const interpolate = (text: string) =>\n text.replace(/\\{(\\w+)\\}/g, (_, key: string) => {\n const value = params[key];\n return value === undefined ? `{${key}}` : String(value);\n });\n return {\n message: interpolate(template.message),\n suggestion: interpolate(template.suggestion),\n };\n}\n","import en from \"./en\";\nimport { formatMessagePair } from \"../../format-message\";\n\nexport type MessageMap = typeof en;\nexport type RuleMessageId = keyof MessageMap;\n\n/**\n * Auto-discovered locale registry. Drop a `messages/<lang>.ts` file and\n * it's bundled automatically — same pattern as the editor's i18n.\n *\n * Eager glob: synchronous, all locales bundled into the package. Tiny\n * (a few hundred bytes per locale) so the cost is negligible compared\n * to the lazy-loading overhead.\n */\nconst modules = import.meta.glob<{ default: MessageMap }>(\"./*.ts\", {\n eager: true,\n});\n\nconst MESSAGES: Record<string, MessageMap> = {};\nfor (const path in modules) {\n const match = /\\.\\/([^/]+)\\.ts$/.exec(path);\n if (!match) continue;\n const locale = match[1];\n if (locale === \"index\") continue;\n MESSAGES[locale] = modules[path].default;\n}\n\nexport const SUPPORTED_MESSAGE_LOCALES = Object.keys(MESSAGES);\n\nexport function getMessages(locale: string): MessageMap {\n const base = locale.split(\"-\")[0]?.toLowerCase() ?? \"en\";\n return MESSAGES[base] ?? MESSAGES.en ?? en;\n}\n\n/**\n * Resolve a localized message for a rule. `params` interpolate `{name}`\n * placeholders. Falls back to English when the locale doesn't ship the\n * key (shouldn't happen — the parity test enforces it).\n */\nexport function formatMessage(\n locale: string,\n ruleId: RuleMessageId,\n params?: Record<string, string | number>,\n): { message: string; suggestion: string } {\n const map = getMessages(locale);\n const template = map[ruleId] ?? en[ruleId];\n return formatMessagePair(template, params);\n}\n","import { isImage } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.img-missing-alt\",\n reference: \"https://www.w3.org/WAI/tutorials/images/\",\n severity: \"error\",\n};\n\nexport const imgMissingAlt: Rule = {\n meta,\n block(block) {\n if (!isImage(block)) return null;\n if (block.decorative === true) return null;\n const alt = block.alt?.trim() ?? \"\";\n if (alt !== \"\") return null;\n if ((block.src ?? \"\").trim() === \"\") return null;\n return { blockId: block.id };\n },\n};\n","import { isImage } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.img-alt-is-filename\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#images\",\n severity: \"warning\",\n};\n\nconst FILENAME_PATTERNS: RegExp[] = [\n /\\.(jpe?g|png|gif|webp|svg)$/i,\n /^IMG[_-]?\\d+/i,\n /^Untitled/i,\n /^Screen[\\s_-]?Shot/i,\n /^DSC[_-]?\\d+/i,\n];\n\nexport const imgAltIsFilename: Rule = {\n meta,\n block(block) {\n if (!isImage(block) || block.decorative === true) return null;\n const alt = block.alt?.trim() ?? \"\";\n if (alt === \"\") return null;\n if (!FILENAME_PATTERNS.some((re) => re.test(alt))) return null;\n\n return {\n blockId: block.id,\n params: { alt },\n };\n },\n};\n","import { isImage } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.img-alt-too-long\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#images\",\n severity: \"warning\",\n};\n\nexport const imgAltTooLong: Rule = {\n meta,\n block(block, _ctx, opts) {\n if (!isImage(block) || block.decorative === true) return null;\n const alt = block.alt ?? \"\";\n if (alt.length <= opts.thresholds.altMaxLength) return null;\n return {\n blockId: block.id,\n params: { length: alt.length, max: opts.thresholds.altMaxLength },\n };\n },\n};\n","import { isImage } from \"@templatical/types\";\nimport type { LintPatchContext, Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.img-decorative-needs-empty-alt\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#images\",\n severity: \"info\",\n};\n\nexport const imgDecorativeNeedsEmptyAlt: Rule = {\n meta,\n block(block) {\n if (!isImage(block)) return null;\n if (block.decorative !== true) return null;\n if ((block.alt ?? \"\").trim() === \"\") return null;\n return {\n blockId: block.id,\n fix: {\n description: \"Clear alt text\",\n apply: (ctx: Omit<LintPatchContext, \"removeBlock\">) =>\n ctx.updateBlock(block.id, { alt: \"\" }),\n },\n };\n },\n};\n","import type en from \"./en\";\n\nconst de: typeof en = {\n vagueLinkText: [\n \"hier klicken\",\n \"hier\",\n \"mehr lesen\",\n \"mehr\",\n \"weiter\",\n \"weiterlesen\",\n \"siehe mehr\",\n \"dies\",\n \"dieser link\",\n \"link\",\n \"klick\",\n ],\n vagueButtonLabels: [\n \"hier klicken\",\n \"klicken\",\n \"senden\",\n \"los\",\n \"ok\",\n \"okay\",\n \"ja\",\n \"nein\",\n ],\n linkedImageActionHints: [\n \"kaufen\",\n \"shoppen\",\n \"ansehen\",\n \"lesen\",\n \"lernen\",\n \"öffnen\",\n \"los\",\n \"sehen\",\n \"entdecken\",\n \"erkunden\",\n \"stöbern\",\n \"herunterladen\",\n \"holen\",\n \"abholen\",\n \"einlösen\",\n \"anschauen\",\n \"jetzt\",\n ],\n};\n\nexport default de;\n","/**\n * English vague-text dictionaries. Treated as the source of truth — other\n * locales annotate themselves `typeof en` so missing/extra phrases fail\n * typecheck.\n *\n * Phrases are matched case-insensitively against trimmed text content.\n */\nconst en = {\n vagueLinkText: [\n \"click here\",\n \"here\",\n \"read more\",\n \"more\",\n \"learn more\",\n \"see more\",\n \"this\",\n \"this link\",\n \"link\",\n \"click\",\n ],\n vagueButtonLabels: [\n \"click here\",\n \"click\",\n \"submit\",\n \"go\",\n \"ok\",\n \"okay\",\n \"yes\",\n \"no\",\n ],\n /**\n * Action verbs that signal a linked image's alt describes the link\n * destination, not just the visual subject. Used by `img-linked-no-context`.\n * Stored lowercase; tokenized matching is case-insensitive.\n */\n linkedImageActionHints: [\n \"buy\",\n \"shop\",\n \"view\",\n \"read\",\n \"learn\",\n \"open\",\n \"go\",\n \"see\",\n \"explore\",\n \"discover\",\n \"browse\",\n \"download\",\n \"get\",\n \"claim\",\n \"redeem\",\n \"watch\",\n ],\n};\n\nexport default en;\n","import en from \"./en\";\n\nexport type Dictionary = typeof en;\n\n/**\n * Auto-discovered locale registry. Drop a `dictionaries/<lang>.ts` file\n * and it's bundled automatically — same pattern as the editor's i18n\n * and the sibling `messages/` registry.\n *\n * Eager glob: synchronous, all locales bundled into the package. Tiny\n * (a few hundred bytes per locale) so the cost is negligible.\n */\nconst modules = import.meta.glob<{ default: Dictionary }>(\"./*.ts\", {\n eager: true,\n});\n\nconst DICTIONARIES: Record<string, Dictionary> = {};\nfor (const path in modules) {\n const match = /\\.\\/([^/]+)\\.ts$/.exec(path);\n if (!match) continue;\n const locale = match[1];\n if (locale === \"index\") continue;\n DICTIONARIES[locale] = modules[path].default;\n}\n\n/**\n * Returns a dictionary that unions every registered locale. Vague phrases\n * are universally vague — a German-locale email with an English \"Click here\"\n * CTA, or an English email with a French \"cliquez ici\", is still a vague\n * CTA, so the rule must detect across languages regardless of editor locale.\n *\n * The `locale` argument is accepted for API symmetry and future use (e.g.\n * weighted matching) but currently doesn't change the returned set.\n */\nexport function getDictionary(_locale: string): Dictionary {\n return UNIONED_DICTIONARY;\n}\n\nfunction unionAll(pick: (d: Dictionary) => readonly string[]): string[] {\n const set = new Set<string>();\n for (const dict of Object.values(DICTIONARIES)) {\n for (const phrase of pick(dict)) set.add(phrase);\n }\n return Array.from(set);\n}\n\nconst UNIONED_DICTIONARY: Dictionary = {\n vagueLinkText: unionAll((d) => d.vagueLinkText),\n vagueButtonLabels: unionAll((d) => d.vagueButtonLabels),\n linkedImageActionHints: unionAll((d) => d.linkedImageActionHints),\n};\n\nexport const SUPPORTED_DICTIONARY_LOCALES = Object.keys(DICTIONARIES);\n\n/**\n * Normalize text for dictionary matching: lowercase, collapse whitespace,\n * strip leading/trailing non-alphanumeric characters (punctuation, arrows,\n * emoji, decorative symbols). \"Click here!\", \"→ click here\", \"click here?\"\n * all collapse to \"click here\" so the dictionary's plain phrase matches.\n */\nexport function normalizeForMatch(input: string): string {\n return input\n .toLowerCase()\n .replace(/\\s+/g, \" \")\n .replace(/^[^\\p{L}\\p{N}]+|[^\\p{L}\\p{N}]+$/gu, \"\")\n .trim();\n}\n","import { isImage } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { getDictionary } from \"../dictionaries\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.img-linked-no-context\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#images\",\n severity: \"warning\",\n};\n\nexport const imgLinkedNoContext: Rule = {\n meta,\n block(block, _ctx, opts) {\n if (!isImage(block) || block.decorative === true) return null;\n if (!block.linkUrl || block.linkUrl.trim() === \"\") return null;\n const alt = (block.alt ?? \"\").trim();\n if (alt === \"\") return null;\n const tokens = alt\n .toLocaleLowerCase()\n .split(/[^\\p{L}\\p{N}]+/u)\n .filter(Boolean);\n const hints = getDictionary(opts.locale).linkedImageActionHints;\n if (tokens.some((token) => hints.includes(token))) return null;\n return { blockId: block.id };\n },\n};\n","import { Parser } from \"htmlparser2\";\n\nexport interface AnchorInfo {\n href: string;\n text: string;\n target: string | null;\n rel: string | null;\n /** True if the anchor wraps an image with non-empty alt. */\n hasImageWithAlt: boolean;\n}\n\n/**\n * Extract every anchor from a TipTap-style HTML fragment. Used by\n * link-* rules. Doesn't try to be a full DOM — only the data the rules\n * need.\n *\n * Nested `<a>` is invalid HTML; htmlparser2 follows the HTML5 spec and\n * emits an implicit `</a>` when a second `<a>` opens, so anchors are\n * effectively flat siblings. We mirror that with a single in-flight\n * anchor (no stack); a defensive finalize-on-reopen handles the\n * theoretical case where the parser ever stops emitting the implicit\n * close. Detecting nested-anchor markup as its own concern lives in\n * the `a11y.link-nested-anchor` rule, which inspects the raw input\n * before this normalization.\n */\nexport function extractAnchors(html: string): AnchorInfo[] {\n const anchors: AnchorInfo[] = [];\n let current: AnchorInfo | null = null;\n let buffer = \"\";\n\n const finalize = () => {\n if (current === null) return;\n current.text = buffer.trim();\n anchors.push(current);\n current = null;\n buffer = \"\";\n };\n\n const parser = new Parser({\n onopentag(name, attribs) {\n if (name === \"a\") {\n finalize();\n current = {\n href: attribs.href ?? \"\",\n text: \"\",\n target: attribs.target ?? null,\n rel: attribs.rel ?? null,\n hasImageWithAlt: false,\n };\n return;\n }\n\n if (name === \"img\" && current !== null) {\n const alt = (attribs.alt ?? \"\").trim();\n if (alt !== \"\") {\n current.hasImageWithAlt = true;\n }\n }\n },\n ontext(text) {\n if (current !== null) {\n buffer += text;\n }\n },\n onclosetag(name) {\n if (name === \"a\") {\n finalize();\n }\n },\n });\n\n parser.write(html);\n parser.end();\n finalize();\n\n return anchors;\n}\n\n/**\n * Whether the raw HTML contains an `<a>` opened inside another open\n * `<a>` — invalid markup that htmlparser2 silently normalizes by\n * emitting an implicit `</a>` before the inner open. `extractAnchors`\n * runs against the normalized parse and therefore can't distinguish\n * nested-from-sibling input; this helper inspects the raw text so the\n * `a11y.link-nested-anchor` rule can flag the structural problem.\n *\n * Tokenization here ignores anchor-like tokens inside HTML comments,\n * which is enough for TipTap email-template HTML. CDATA, `<script>`,\n * and attribute-value occurrences aren't expected in this surface.\n */\nexport function hasNestedAnchors(html: string): boolean {\n const stripped = stripHtmlComments(html);\n const tokens = stripped.matchAll(/<\\/?a\\b[^<>]*>/gi);\n let depth = 0;\n for (const match of tokens) {\n if (match[0].startsWith(\"</\")) {\n if (depth > 0) depth--;\n continue;\n }\n if (depth > 0) return true;\n depth++;\n }\n return false;\n}\n\n/**\n * Linear-time `<!-- … -->` stripper. Replaces the original\n * `replace(/<!--[\\s\\S]*?-->/g, \"\")`, which had two related problems:\n *\n * - Polynomial ReDoS: each `<!--` start re-scanned the rest of the\n * input for `-->`, costing O(n²) over inputs like `<!--<!--<!--…`.\n * - Incomplete sanitization: an unterminated `<!--` left the literal\n * `<!--` in the output, so downstream rendering could still parse it\n * as an open HTML comment and swallow the rest of the document.\n *\n * The scanner discards an unterminated comment entirely — there is no\n * way to recover meaningful content after a stray `<!--`, and leaving\n * it in would re-introduce the sanitizer gap.\n */\nfunction stripHtmlComments(html: string): string {\n let out = \"\";\n let i = 0;\n while (i < html.length) {\n const start = html.indexOf(\"<!--\", i);\n if (start === -1) {\n out += html.substring(i);\n break;\n }\n out += html.substring(i, start);\n const end = html.indexOf(\"-->\", start + 4);\n if (end === -1) {\n // Unterminated comment — drop everything from this point onward.\n break;\n }\n i = end + 3;\n }\n return out;\n}\n\n/**\n * Strip tags and return the visible text content of an HTML fragment.\n * Used by heading-empty and other text-presence rules.\n */\nexport function extractText(html: string): string {\n let text = \"\";\n const parser = new Parser({\n ontext(chunk) {\n text += chunk;\n },\n });\n parser.write(html);\n parser.end();\n return text.trim();\n}\n\n/**\n * One attribute inside an open tag's attribute string. `start` is the first\n * character of the name; `end` is just after the value (closing quote\n * included, or the end of an unquoted value).\n */\nexport interface AttrSpan {\n start: number;\n end: number;\n}\n\nfunction isHtmlWhitespace(char: string): boolean {\n return (\n char === \" \" ||\n char === \"\\t\" ||\n char === \"\\n\" ||\n char === \"\\r\" ||\n char === \"\\f\"\n );\n}\n\n// Same name class as `getTagAttrValue`, so a span slice is the attribute it reads.\nfunction isAttrNameChar(char: string): boolean {\n return (\n char !== \" \" &&\n char !== \"\\t\" &&\n char !== \"\\n\" &&\n char !== \"\\r\" &&\n char !== \"\\f\" &&\n char !== \"=\" &&\n char !== \">\" &&\n char !== \"/\"\n );\n}\n\nfunction isTagNameStart(char: string): boolean {\n return (char >= \"A\" && char <= \"Z\") || (char >= \"a\" && char <= \"z\");\n}\n\nfunction isTagNameChar(char: string): boolean {\n return (\n isTagNameStart(char) ||\n (char >= \"0\" && char <= \"9\") ||\n char === \":\" ||\n char === \"-\" ||\n char === \"_\"\n );\n}\n\n/**\n * `name=\"value\"`. A `\"` in the value is written as `&quot;` so it cannot\n * close the attribute or start a sibling one. `&` and existing entities are\n * copied as written. A double-quoted value contains no raw `\"`, so passing\n * its raw text through here leaves those bytes unchanged.\n */\nexport function doubleQuotedAttr(name: string, value: string): string {\n return `${name}=\"${value.replace(/\"/g, \"&quot;\")}\"`;\n}\n\n/**\n * Raw value text of one attribute span from `findAttrSpans`, with the\n * surrounding quotes removed. Entities stay as written. Returns null when\n * the span is a boolean attribute (no `=`) or its quoted value never closes.\n */\nexport function attrRawValue(attr: string): string | null {\n let i = 0;\n while (i < attr.length && isAttrNameChar(attr[i])) i++;\n while (i < attr.length && isHtmlWhitespace(attr[i])) i++;\n if (i >= attr.length || attr[i] !== \"=\") return null;\n i++;\n while (i < attr.length && isHtmlWhitespace(attr[i])) i++;\n if (i >= attr.length) return null;\n const quote = attr[i];\n if (quote === '\"' || quote === \"'\") {\n const end = attr.indexOf(quote, i + 1);\n if (end === -1) return null;\n return attr.slice(i + 1, end);\n }\n return attr.slice(i);\n}\n\n/**\n * Spans of `name` inside an open tag's attribute string (between the tag\n * name and its `>`). Quote-aware, like `getTagAttrValue`: a single-quoted\n * value may contain `\"`, and an unquoted value ends at whitespace. Returns\n * null when a quoted value never closes — the string is not safe to rewrite.\n */\nexport function findAttrSpans(attrs: string, name: string): AttrSpan[] | null {\n const target = name.toLowerCase();\n const spans: AttrSpan[] = [];\n let i = 0;\n\n while (i < attrs.length) {\n while (\n i < attrs.length &&\n (isHtmlWhitespace(attrs[i]) || attrs[i] === \"/\")\n ) {\n i++;\n }\n if (i >= attrs.length) break;\n\n const nameStart = i;\n while (i < attrs.length && isAttrNameChar(attrs[i])) i++;\n const attrName = attrs.slice(nameStart, i);\n if (attrName === \"\") {\n i++;\n continue;\n }\n const nameEnd = i;\n\n while (i < attrs.length && isHtmlWhitespace(attrs[i])) i++;\n if (i >= attrs.length || attrs[i] !== \"=\") {\n if (attrName.toLowerCase() === target) {\n spans.push({ start: nameStart, end: nameEnd });\n }\n continue;\n }\n i++; // past `=`\n while (i < attrs.length && isHtmlWhitespace(attrs[i])) i++;\n\n const quote = attrs[i];\n if (quote === '\"' || quote === \"'\") {\n const valueEnd = attrs.indexOf(quote, i + 1);\n if (valueEnd === -1) return null;\n const end = valueEnd + 1;\n if (attrName.toLowerCase() === target)\n spans.push({ start: nameStart, end });\n i = end;\n continue;\n }\n\n while (\n i < attrs.length &&\n !isHtmlWhitespace(attrs[i]) &&\n attrs[i] !== \">\"\n ) {\n i++;\n }\n if (attrName.toLowerCase() === target)\n spans.push({ start: nameStart, end: i });\n }\n\n return spans;\n}\n\n/**\n * Drop one attribute, including a single whitespace separator before its\n * name when there is one. The rest of the attribute string stays byte for\n * byte, so a removed `style` leaves `<p>` rather than `<p >`.\n */\nexport function removeAttrSpan(attrs: string, span: AttrSpan): string {\n const from =\n span.start > 0 && isHtmlWhitespace(attrs[span.start - 1])\n ? span.start - 1\n : span.start;\n return attrs.slice(0, from) + attrs.slice(span.end);\n}\n\n/**\n * Rewrite open tags in `html`. `visit` returns a replacement for the whole\n * tag, angle brackets included, or null to keep the original bytes.\n *\n * Parser offsets keep quoted `>` inside attributes and skip comments and\n * raw text. Tags the parser does not open stay unchanged.\n */\nexport function rewriteOpenTags(\n html: string,\n visit: (tag: {\n name: string;\n rawName: string;\n attrs: string;\n decodedAttrs: Record<string, string>;\n }) => string | null,\n): string {\n let out = \"\";\n let copiedTo = 0;\n const parser = new Parser({\n onopentag(name, decodedAttrs) {\n const open = parser.startIndex;\n const tagEnd = parser.endIndex;\n if (!isTagNameStart(html[open + 1])) return;\n let nameEnd = open + 1;\n while (nameEnd < tagEnd && isTagNameChar(html[nameEnd])) nameEnd++;\n const rawName = html.slice(open + 1, nameEnd);\n const attrs = html.slice(nameEnd, tagEnd);\n const replacement = visit({ name, rawName, attrs, decodedAttrs });\n if (replacement === null) return;\n out += html.slice(copiedTo, open);\n out += replacement;\n copiedTo = tagEnd + 1;\n },\n });\n parser.end(html);\n return out + html.slice(copiedTo);\n}\n","import { isTitle } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { extractText } from \"../../html-utils\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.heading-empty\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#headings\",\n severity: \"error\",\n};\n\nexport const headingEmpty: Rule = {\n meta,\n block(block) {\n if (!isTitle(block)) return null;\n const text = extractText(block.content ?? \"\");\n if (text !== \"\") return null;\n return { blockId: block.id };\n },\n};\n","import { isTitle, isSection } from \"@templatical/types\";\nimport type { Block, TitleBlock, TemplateContent } from \"@templatical/types\";\nimport type { Rule, RuleHit, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.heading-skip-level\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#headings\",\n severity: \"error\",\n};\n\nfunction collectTitles(blocks: Block[], out: TitleBlock[]): void {\n for (const block of blocks) {\n if (isTitle(block)) {\n out.push(block);\n continue;\n }\n if (isSection(block)) {\n for (const column of block.children) {\n collectTitles(column, out);\n }\n }\n }\n}\n\nexport const headingSkipLevel: Rule = {\n meta,\n template(content: TemplateContent) {\n const titles: TitleBlock[] = [];\n collectTitles(content.blocks, titles);\n\n const hits: RuleHit[] = [];\n let lastLevel = 0;\n\n for (const title of titles) {\n if (lastLevel !== 0 && title.level > lastLevel + 1) {\n hits.push({\n blockId: title.id,\n params: { from: lastLevel, to: title.level },\n });\n }\n lastLevel = title.level;\n }\n\n return hits;\n },\n};\n","import { isTitle, isSection } from \"@templatical/types\";\nimport type { Block, TitleBlock, TemplateContent } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.heading-multiple-h1\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#headings\",\n severity: \"warning\",\n};\n\nfunction collectTitles(blocks: Block[], out: TitleBlock[]): void {\n for (const block of blocks) {\n if (isTitle(block)) {\n out.push(block);\n continue;\n }\n if (isSection(block)) {\n for (const column of block.children) {\n collectTitles(column, out);\n }\n }\n }\n}\n\nexport const headingMultipleH1: Rule = {\n meta,\n template(content: TemplateContent) {\n const titles: TitleBlock[] = [];\n collectTitles(content.blocks, titles);\n const h1s = titles.filter((t) => t.level === 1);\n if (h1s.length <= 1) return [];\n return h1s.slice(1).map((title) => ({ blockId: title.id }));\n },\n};\n","import { isParagraph, isTitle } from \"@templatical/types\";\nimport type { Block } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { extractAnchors } from \"../../html-utils\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.link-empty\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#links\",\n severity: \"error\",\n};\n\nfunction getHtml(block: Block): string | null {\n if (isParagraph(block) || isTitle(block)) return block.content;\n return null;\n}\n\nexport const linkEmpty: Rule = {\n meta,\n block(block) {\n const html = getHtml(block);\n if (html === null) return null;\n\n const anchors = extractAnchors(html);\n const offender = anchors.find(\n (anchor) => anchor.text === \"\" && !anchor.hasImageWithAlt,\n );\n if (!offender) return null;\n\n return { blockId: block.id };\n },\n};\n","import { isParagraph, isTitle } from \"@templatical/types\";\nimport type { Block } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { extractAnchors } from \"../../html-utils\";\nimport { getDictionary, normalizeForMatch } from \"../dictionaries\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.link-vague-text\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#links\",\n severity: \"warning\",\n};\n\nfunction getHtml(block: Block): string | null {\n if (isParagraph(block) || isTitle(block)) return block.content;\n return null;\n}\n\nexport const linkVagueText: Rule = {\n meta,\n block(block, _ctx, opts) {\n const html = getHtml(block);\n if (html === null) return null;\n\n const phrases = getDictionary(opts.locale).vagueLinkText;\n const anchors = extractAnchors(html);\n const offender = anchors.find((a) => {\n const text = normalizeForMatch(a.text);\n return text !== \"\" && phrases.includes(text);\n });\n if (!offender) return null;\n\n return { blockId: block.id, params: { text: offender.text } };\n },\n};\n","import { isParagraph, isTitle } from \"@templatical/types\";\nimport type { Block } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { extractAnchors } from \"../../html-utils\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.link-href-empty\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#links\",\n severity: \"error\",\n};\n\nfunction getHtml(block: Block): string | null {\n if (isParagraph(block) || isTitle(block)) return block.content;\n return null;\n}\n\nexport const linkHrefEmpty: Rule = {\n meta,\n block(block) {\n const html = getHtml(block);\n if (html === null) return null;\n const anchors = extractAnchors(html);\n const offender = anchors.find((a) => {\n const href = a.href.trim();\n return href === \"\" || href === \"#\";\n });\n if (!offender) return null;\n return { blockId: block.id };\n },\n};\n","import { isParagraph, isTitle } from \"@templatical/types\";\nimport type { Block } from \"@templatical/types\";\nimport type { LintPatchContext, Rule, RuleMeta } from \"../../types\";\nimport {\n attrRawValue,\n doubleQuotedAttr,\n extractAnchors,\n findAttrSpans,\n rewriteOpenTags,\n} from \"../../html-utils\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.link-target-blank-no-rel\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#links\",\n severity: \"warning\",\n};\n\nfunction getHtml(block: Block): string | null {\n if (isParagraph(block) || isTitle(block)) return block.content;\n return null;\n}\n\nfunction hasSafeRel(rel: string | null): boolean {\n if (rel === null) return false;\n const tokens = rel.toLowerCase().split(/[ \\t\\n\\f\\r]+/);\n return tokens.includes(\"noopener\") || tokens.includes(\"noreferrer\");\n}\n\nexport const linkTargetBlankNoRel: Rule = {\n meta,\n block(block) {\n const html = getHtml(block);\n if (html === null) return null;\n const anchors = extractAnchors(html);\n const offender = anchors.find(\n (a) => a.target === \"_blank\" && !hasSafeRel(a.rel),\n );\n if (!offender) return null;\n\n return {\n blockId: block.id,\n fix: {\n description: 'Add rel=\"noopener\"',\n apply: (ctx: Omit<LintPatchContext, \"removeBlock\">) => {\n if (!isParagraph(block) && !isTitle(block)) return;\n const updated = addNoopenerToTargetBlank(block.content ?? \"\");\n ctx.updateBlock(block.id, { content: updated } as Partial<Block>);\n },\n },\n };\n },\n};\n\n/**\n * Add `noopener` on every `<a target=\"_blank\">` that lacks it.\n *\n * The attribute value is the raw text inside its quotes (double-quoted,\n * single-quoted, or unquoted), so an entity such as `&copy;` is kept as\n * written. The value is written back double-quoted, and a `\"` in it is\n * escaped so it cannot close the attribute. The rewritten open tag is a\n * lowercase `<a`. Its boundary and decoded attribute values come from the\n * parser in `rewriteOpenTags`, as they do during detection.\n */\nfunction addNoopenerToTargetBlank(html: string): string {\n return rewriteOpenTags(html, ({ name, attrs, decodedAttrs }) => {\n if (name !== \"a\") return null;\n if (decodedAttrs.target !== \"_blank\") return null;\n\n const relSpans = findAttrSpans(attrs, \"rel\");\n if (relSpans === null) return null;\n const relSpan = relSpans[0];\n if (relSpan === undefined) {\n return `<a${attrs} ${doubleQuotedAttr(\"rel\", \"noopener\")}>`;\n }\n\n const relValue = attrRawValue(attrs.slice(relSpan.start, relSpan.end));\n if (hasSafeRel(decodedAttrs.rel ?? null)) return null;\n const newRel = `${relValue ?? \"\"} noopener`.replace(/^[ \\t\\n\\f\\r]+/, \"\");\n const next =\n attrs.slice(0, relSpan.start) +\n doubleQuotedAttr(\"rel\", newRel) +\n attrs.slice(relSpan.end);\n return `<a${next}>`;\n });\n}\n","import { isParagraph, isTitle } from \"@templatical/types\";\nimport type { Block } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { hasNestedAnchors } from \"../../html-utils\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.link-nested-anchor\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#links\",\n severity: \"error\",\n};\n\nfunction getHtml(block: Block): string | null {\n if (isParagraph(block) || isTitle(block)) return block.content;\n return null;\n}\n\nexport const linkNestedAnchor: Rule = {\n meta,\n block(block) {\n const html = getHtml(block);\n if (html === null) return null;\n if (!hasNestedAnchors(html)) return null;\n return { blockId: block.id };\n },\n};\n","import { isParagraph, isTitle } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { extractText } from \"../../html-utils\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.text-all-caps\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#text\",\n severity: \"warning\",\n};\n\nexport const textAllCaps: Rule = {\n meta,\n block(block, _ctx, opts) {\n if (!isParagraph(block) && !isTitle(block)) return null;\n const text = extractText(block.content ?? \"\");\n const letters = text.replace(/[^\\p{L}]/gu, \"\");\n if (letters.length < opts.thresholds.allCapsMinLength) return null;\n // Caseless scripts (Arabic, Hebrew, …) satisfy `s === s.toLocaleUpperCase()`\n // because toUpperCase is a no-op. Only shout when some letter actually\n // has a case distinction.\n const hasCasedLetter = [...letters].some(\n (ch) => ch.toLocaleLowerCase() !== ch.toLocaleUpperCase(),\n );\n if (!hasCasedLetter) return null;\n if (letters !== letters.toLocaleUpperCase()) return null;\n return { blockId: block.id };\n },\n};\n","import { decodeHtmlEntities, isParagraph } from \"@templatical/types\";\nimport type { Block } from \"@templatical/types\";\nimport type { LintPatchContext, Rule, RuleMeta } from \"../../types\";\nimport {\n attrRawValue,\n doubleQuotedAttr,\n findAttrSpans,\n removeAttrSpan,\n rewriteOpenTags,\n} from \"../../html-utils\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.text-justified\",\n reference: \"https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation\",\n severity: \"warning\",\n};\n\nconst TEXT_ALIGN_DECL = /^\\s*text-align\\s*:\\s*([^;]*)/i;\nconst CHARACTER_REFERENCE =\n /^&(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#[xX][0-9a-fA-F]+);/;\n\n/** Split at decoded declaration boundaries while retaining raw source slices. */\nfunction splitDeclarations(style: string): string[] {\n const declarations: string[] = [];\n let start = 0;\n let depth = 0;\n let quote: '\"' | \"'\" | null = null;\n let escaped = false;\n for (let i = 0; i < style.length;) {\n let chars = style[i];\n let end = i + 1;\n if (chars === \"&\") {\n const reference = CHARACTER_REFERENCE.exec(style.slice(i));\n if (reference !== null) {\n const decoded = decodeHtmlEntities(reference[0]);\n if (decoded !== reference[0]) {\n chars = decoded;\n end = i + reference[0].length;\n }\n }\n }\n for (const char of chars) {\n if (escaped) {\n escaped = false;\n } else if (char === \"\\\\\") {\n escaped = true;\n } else if (quote !== null) {\n if (char === quote) quote = null;\n } else if (char === '\"' || char === \"'\") {\n quote = char;\n } else if (char === \"(\") {\n depth++;\n } else if (char === \")\" && depth > 0) {\n depth--;\n } else if (char === \";\" && depth === 0) {\n declarations.push(style.slice(start, i));\n start = end;\n }\n }\n i = end;\n }\n declarations.push(style.slice(start));\n return declarations;\n}\n\n/** Raw `style` values from every open tag. An unquoted value is included. */\nfunction styleValues(html: string): string[] {\n const values: string[] = [];\n rewriteOpenTags(html, ({ attrs }) => {\n const spans = findAttrSpans(attrs, \"style\");\n if (spans === null) return null;\n for (const span of spans) {\n const value = attrRawValue(attrs.slice(span.start, span.end));\n if (value !== null) values.push(value);\n }\n return null;\n });\n return values;\n}\n\nfunction isJustified(style: string): boolean {\n return splitDeclarations(style).some((decl) => {\n const match = TEXT_ALIGN_DECL.exec(decodeHtmlEntities(decl));\n return match !== null && match[1].trim().toLowerCase() === \"justify\";\n });\n}\n\n/**\n * Drop the `text-align` declaration from one style attribute value,\n * leaving every sibling declaration untouched.\n *\n * TipTap merges each extension's `renderHTML` contribution into a single\n * `style` attribute, so a justified paragraph that also carries a line\n * height is `style=\"text-align: justify; line-height: 1.8\"`. Removing the\n * attribute wholesale would silently discard the line height.\n */\nfunction removeTextAlign(style: string): string {\n return splitDeclarations(style)\n .filter((decl) => !/^\\s*text-align\\s*:/i.test(decodeHtmlEntities(decl)))\n .map((decl) => decl.trim())\n .filter((decl) => decl !== \"\")\n .join(\"; \");\n}\n\n/**\n * Rewrite every justified tag in the fragment, dropping the `style`\n * attribute entirely when `text-align` was its only declaration.\n *\n * Unsetting rather than forcing `left` is deliberate: an absent\n * declaration is how TipTap represents \"no alignment\" (its `renderHTML`\n * emits nothing when the attribute is null), so the paragraph goes back\n * to inheriting the document default — which is also the correct result\n * for right-to-left content, where a hardcoded `left` would be wrong.\n *\n * Each `style` is the raw attribute text and is written back double-quoted.\n * A `\"` in the value is escaped so it stays part of `style`; `&` and\n * existing entities are copied as written. The parser supplies the tag\n * boundary.\n */\nfunction unjustify(html: string): string {\n return rewriteOpenTags(html, ({ rawName, attrs }) => {\n const spans = findAttrSpans(attrs, \"style\");\n if (spans === null || spans.length === 0) return null;\n\n let next = attrs;\n let changed = false;\n // Later spans first, so an edit does not shift the indexes still ahead.\n for (let index = spans.length - 1; index >= 0; index--) {\n const span = spans[index];\n const style = attrRawValue(attrs.slice(span.start, span.end));\n if (style === null || !isJustified(style)) continue;\n const remaining = removeTextAlign(style);\n next =\n remaining === \"\"\n ? removeAttrSpan(next, span)\n : next.slice(0, span.start) +\n doubleQuotedAttr(\"style\", remaining) +\n next.slice(span.end);\n changed = true;\n }\n return changed ? `<${rawName}${next}>` : null;\n });\n}\n\nexport const textJustified: Rule = {\n meta,\n block(block) {\n if (!isParagraph(block)) return null;\n const html = block.content ?? \"\";\n if (!styleValues(html).some(isJustified)) return null;\n\n return {\n blockId: block.id,\n fix: {\n description: \"Remove justified alignment\",\n apply: (ctx: Omit<LintPatchContext, \"removeBlock\">) => {\n if (!isParagraph(block)) return;\n ctx.updateBlock(block.id, {\n content: unjustify(block.content ?? \"\"),\n } as Partial<Block>);\n },\n },\n };\n },\n};\n","import { isTitle } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { getContrastRatio, isOpaqueHex } from \"../../contrast\";\nimport { HEADING_LEVEL_FONT_SIZE } from \"@templatical/types\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.text-low-contrast\",\n reference: \"https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum\",\n severity: \"error\",\n};\n\nexport const textLowContrast: Rule = {\n meta,\n block(block, ctx) {\n if (!isTitle(block)) return null;\n // Unset title color inherits the document text color, so check the\n // effective color against the background.\n const color = block.color ?? ctx.resolvedTextColor;\n if (!isOpaqueHex(color) || !isOpaqueHex(ctx.resolvedBackgroundColor)) {\n return null;\n }\n const fontSize = HEADING_LEVEL_FONT_SIZE[block.level];\n // WCAG large text = 18pt (~24px). Headings have no structured bold\n // flag in this codebase (TipTap stores it inline), so we conservatively\n // skip the 14pt-bold (~18.66px) relaxation and apply the px threshold.\n const required = fontSize >= 24 ? 3 : 4.5;\n const ratio = getContrastRatio(color, ctx.resolvedBackgroundColor);\n if (Number.isNaN(ratio) || ratio >= required) return null;\n return {\n blockId: block.id,\n params: { ratio: ratio.toFixed(2), required },\n };\n },\n};\n","import { isMenu, isTable } from \"@templatical/types\";\nimport type { Block } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.text-too-small\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#text\",\n severity: \"warning\",\n};\n\nfunction getFontSize(block: Block): number | null {\n if (isMenu(block) || isTable(block)) return block.fontSize;\n return null;\n}\n\nexport const textTooSmall: Rule = {\n meta,\n block(block, _ctx, opts) {\n const fontSize = getFontSize(block);\n if (fontSize === null) return null;\n if (fontSize >= opts.thresholds.minFontSize) return null;\n return {\n blockId: block.id,\n params: { size: fontSize, min: opts.thresholds.minFontSize },\n };\n },\n};\n","import { isButton } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { getDictionary, normalizeForMatch } from \"../dictionaries\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.button-vague-label\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#buttons\",\n severity: \"warning\",\n};\n\nexport const buttonVagueLabel: Rule = {\n meta,\n block(block, _ctx, opts) {\n if (!isButton(block)) return null;\n const text = normalizeForMatch(block.text ?? \"\");\n if (text === \"\") return null;\n const phrases = getDictionary(opts.locale).vagueButtonLabels;\n if (!phrases.includes(text)) return null;\n return { blockId: block.id, params: { text: block.text } };\n },\n};\n","import { isButton } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.button-touch-target\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#buttons\",\n severity: \"warning\",\n};\n\nexport const buttonTouchTarget: Rule = {\n meta,\n block(block, _ctx, opts) {\n if (!isButton(block)) return null;\n const padding = block.buttonPadding;\n if (!padding) return null;\n const estimatedHeight = block.fontSize * 1.4 + padding.top + padding.bottom;\n if (estimatedHeight >= opts.thresholds.minTouchTargetPx) return null;\n return {\n blockId: block.id,\n params: {\n height: Math.round(estimatedHeight),\n min: opts.thresholds.minTouchTargetPx,\n },\n };\n },\n};\n","import { isButton } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\nimport { getContrastRatio } from \"../../contrast\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.button-low-contrast\",\n reference: \"https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum\",\n severity: \"error\",\n};\n\nexport const buttonLowContrast: Rule = {\n meta,\n block(block) {\n if (!isButton(block)) return null;\n const ratio = getContrastRatio(block.textColor, block.backgroundColor);\n if (Number.isNaN(ratio)) return null;\n // WCAG large text = 18pt (~24px). Mirrors the heading rule's threshold.\n const required = block.fontSize >= 24 ? 3 : 4.5;\n if (ratio >= required) return null;\n return {\n blockId: block.id,\n params: { ratio: ratio.toFixed(2), required },\n };\n },\n};\n","import type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"a11y.missing-preheader\",\n reference:\n \"https://docs.templatical.com/quality/accessibility/rule-catalog#template-level\",\n severity: \"info\",\n};\n\nexport const missingPreheader: Rule = {\n meta,\n template(content) {\n const text = content.settings.preheaderText?.trim() ?? \"\";\n if (text !== \"\") return [];\n return [{ blockId: null }];\n },\n};\n","import type { TemplateContent } from \"@templatical/types\";\nimport type { LintIssue, LintOptions, Rule } from \"../types\";\nimport { resolveAccessibilityOptions, runRules } from \"../run-rules\";\nimport { formatMessage, type RuleMessageId } from \"./messages\";\nimport { imgMissingAlt } from \"./rules/img-missing-alt\";\nimport { imgAltIsFilename } from \"./rules/img-alt-is-filename\";\nimport { imgAltTooLong } from \"./rules/img-alt-too-long\";\nimport { imgDecorativeNeedsEmptyAlt } from \"./rules/img-decorative-needs-empty-alt\";\nimport { imgLinkedNoContext } from \"./rules/img-linked-no-context\";\nimport { headingEmpty } from \"./rules/heading-empty\";\nimport { headingSkipLevel } from \"./rules/heading-skip-level\";\nimport { headingMultipleH1 } from \"./rules/heading-multiple-h1\";\nimport { linkEmpty } from \"./rules/link-empty\";\nimport { linkVagueText } from \"./rules/link-vague-text\";\nimport { linkHrefEmpty } from \"./rules/link-href-empty\";\nimport { linkTargetBlankNoRel } from \"./rules/link-target-blank-no-rel\";\nimport { linkNestedAnchor } from \"./rules/link-nested-anchor\";\nimport { textAllCaps } from \"./rules/text-all-caps\";\nimport { textJustified } from \"./rules/text-justified\";\nimport { textLowContrast } from \"./rules/text-low-contrast\";\nimport { textTooSmall } from \"./rules/text-too-small\";\nimport { buttonVagueLabel } from \"./rules/button-vague-label\";\nimport { buttonTouchTarget } from \"./rules/button-touch-target\";\nimport { buttonLowContrast } from \"./rules/button-low-contrast\";\nimport { missingPreheader } from \"./rules/missing-preheader\";\n\nexport const ACCESSIBILITY_RULES: Rule[] = [\n imgMissingAlt,\n imgAltIsFilename,\n imgAltTooLong,\n imgDecorativeNeedsEmptyAlt,\n imgLinkedNoContext,\n headingEmpty,\n headingSkipLevel,\n headingMultipleH1,\n linkEmpty,\n linkVagueText,\n linkHrefEmpty,\n linkTargetBlankNoRel,\n linkNestedAnchor,\n textAllCaps,\n textJustified,\n textLowContrast,\n textTooSmall,\n buttonVagueLabel,\n buttonTouchTarget,\n buttonLowContrast,\n missingPreheader,\n];\n\nexport function lintAccessibility(\n content: TemplateContent,\n options: LintOptions = {},\n): LintIssue[] {\n if (options.disabled === true || options.accessibility === false) return [];\n const tool = options.accessibility ?? {};\n const resolved = resolveAccessibilityOptions(\n options.locale,\n tool,\n ACCESSIBILITY_RULES,\n );\n return runRules(\n content,\n ACCESSIBILITY_RULES,\n resolved,\n (locale, id, params) => formatMessage(locale, id as RuleMessageId, params),\n );\n}\n","import type en from \"./en\";\n\nconst de: typeof en = {\n \"structure.duplicate-block-id\": {\n message: \"Block-ID erscheint {count}-mal im Baum.\",\n suggestion: \"Gib jedem Block eine eindeutige ID.\",\n },\n \"structure.section-column-mismatch\": {\n message:\n 'Sektion verwendet Layout „{layout}\" (erwartet {expected} Spalten), hat aber {actual}.',\n suggestion:\n \"Stelle {expected} Spalten wieder her oder wähle ein passendes Layout, um den beschädigten Zustand zu beheben.\",\n },\n \"structure.nested-section\": {\n message:\n \"Sektion ist in einer anderen Sektion verschachtelt. Sektionen können nicht verschachtelt werden; der Renderer wird sich falsch verhalten.\",\n suggestion:\n \"Verschiebe die innere Sektion aus ihrer übergeordneten Sektion.\",\n },\n \"structure.empty-section\": {\n message: \"Sektion enthält keine Blöcke.\",\n suggestion: \"Entferne sie oder füge Inhalt hinzu.\",\n },\n \"structure.empty-column\": {\n message: \"Spalte {columnIndex} dieser Sektion ist leer.\",\n suggestion: \"Füge Inhalt hinzu oder reduziere die Spaltenanzahl.\",\n },\n \"structure.wrapper-color-over-background-image\": {\n message:\n \"Outlook unter Windows malt die Hintergrundfarbe des Wrappers über das Hintergrundbild dieser Sektion.\",\n suggestion:\n \"Entferne die Wrapper-Farbe oder lege das Bild auf den Wrapper.\",\n },\n \"structure.nested-background-image\": {\n message:\n \"Diese Sektion und ihr Wrapper haben beide ein Hintergrundbild. Outlook unter Windows kann sie nicht übereinanderlegen und zerstört das Layout.\",\n suggestion: \"Behalte das Bild nur auf einem von beiden.\",\n },\n \"structure.hero-not-applied.columns\": {\n message:\n \"Der Hero-Modus braucht eine einspaltige Sektion, deshalb wird diese Sektion als normale Sektion dargestellt.\",\n suggestion:\n \"Stelle wieder eine Spalte ein oder schalte den Hero-Modus aus.\",\n },\n \"structure.hero-not-applied.image\": {\n message:\n \"Der Hero-Modus braucht ein Hintergrundbild, deshalb wird diese Sektion bis dahin als normale Sektion dargestellt.\",\n suggestion: \"Ergänze ein Hintergrundbild oder schalte den Hero-Modus aus.\",\n },\n \"structure.hero-not-applied.size\": {\n message:\n \"Der Hero-Modus kann die Form dieses Hintergrundbilds nicht übernehmen, weil seine Größe unbekannt ist (eine Merge-Tag-URL oder ein Bild, das der Editor nicht vermessen hat), deshalb wird die Sektion als normale Sektion dargestellt.\",\n suggestion:\n \"Gib ihr eine feste Höhe oder trage die Größe der Bilddatei ein.\",\n },\n};\n\nexport default de;\n","const en = {\n \"structure.duplicate-block-id\": {\n message: \"Block id appears {count} times in the tree.\",\n suggestion: \"Give each block a unique id.\",\n },\n \"structure.section-column-mismatch\": {\n message:\n 'Section uses layout \"{layout}\" (expects {expected} columns) but has {actual}.',\n suggestion:\n \"Restore {expected} columns or choose a matching layout to repair the corrupted state.\",\n },\n \"structure.nested-section\": {\n message:\n \"Section is nested inside another section. Sections cannot nest; the renderer will misbehave.\",\n suggestion: \"Move the inner section outside its parent.\",\n },\n \"structure.empty-section\": {\n message: \"Section has no blocks.\",\n suggestion: \"Remove it or add content.\",\n },\n \"structure.empty-column\": {\n message: \"Column {columnIndex} of this section is empty.\",\n suggestion: \"Add content or reduce the column count.\",\n },\n \"structure.wrapper-color-over-background-image\": {\n message:\n \"Outlook on Windows paints the wrapper's background color over this section's background image.\",\n suggestion: \"Remove the wrapper color or put the image on the wrapper.\",\n },\n \"structure.nested-background-image\": {\n message:\n \"This section and its wrapper both have a background image. Outlook on Windows can't layer them and breaks the layout.\",\n suggestion: \"Keep the image on one of them.\",\n },\n \"structure.hero-not-applied.columns\": {\n message:\n \"Hero mode needs a one-column section, so this section renders as a regular one.\",\n suggestion: \"Switch it back to one column, or turn hero mode off.\",\n },\n \"structure.hero-not-applied.image\": {\n message:\n \"Hero mode needs a background image, so this section renders as a regular one until it has one.\",\n suggestion: \"Add a background image or turn hero mode off.\",\n },\n \"structure.hero-not-applied.size\": {\n message:\n \"Hero mode can't match this background image's shape because its size is unknown (a merge-tag URL, or an image the editor didn't measure), so the section renders as a regular one.\",\n suggestion: \"Give it a fixed height, or set the image file's size.\",\n },\n};\n\nexport default en;\n","import en from \"./en\";\nimport { formatMessagePair } from \"../../format-message\";\n\nexport type StructureMessageMap = typeof en;\nexport type StructureRuleMessageId = keyof StructureMessageMap;\n\nconst modules = import.meta.glob<{ default: StructureMessageMap }>(\"./*.ts\", {\n eager: true,\n});\n\nconst MESSAGES: Record<string, StructureMessageMap> = {};\nfor (const path in modules) {\n const match = /\\.\\/([^/]+)\\.ts$/.exec(path);\n if (!match) continue;\n const locale = match[1];\n if (locale === \"index\") continue;\n MESSAGES[locale] = modules[path].default;\n}\n\nexport const SUPPORTED_STRUCTURE_MESSAGE_LOCALES = Object.keys(MESSAGES);\n\nexport function getStructureMessages(locale: string): StructureMessageMap {\n const base = locale.split(\"-\")[0]?.toLowerCase() ?? \"en\";\n return MESSAGES[base] ?? MESSAGES.en ?? en;\n}\n\nexport function formatStructureMessage(\n locale: string,\n ruleId: StructureRuleMessageId,\n params?: Record<string, string | number>,\n): { message: string; suggestion: string } {\n const map = getStructureMessages(locale);\n const template = map[ruleId] ?? en[ruleId];\n return formatMessagePair(template, params);\n}\n","import type { Block, SectionBlock, TemplateContent } from \"@templatical/types\";\nimport { isSection } from \"@templatical/types\";\nimport type { Rule, RuleHit, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"structure.duplicate-block-id\",\n reference:\n \"https://docs.templatical.com/quality/structure/rule-catalog#tree-integrity\",\n severity: \"error\",\n};\n\nfunction collectIds(blocks: Block[], counts: Map<string, number>): void {\n for (const block of blocks) {\n counts.set(block.id, (counts.get(block.id) ?? 0) + 1);\n if (isSection(block)) {\n for (const column of (block as SectionBlock).children) {\n collectIds(column, counts);\n }\n }\n }\n}\n\nexport const duplicateBlockId: Rule = {\n meta,\n template(content: TemplateContent): RuleHit[] {\n const counts = new Map<string, number>();\n collectIds(content.blocks, counts);\n\n const hits: RuleHit[] = [];\n for (const [id, count] of counts) {\n if (count > 1) {\n hits.push({ blockId: id, params: { count } });\n }\n }\n return hits;\n },\n};\n","import type { Block, SectionBlock, TemplateContent } from \"@templatical/types\";\nimport { isSection } from \"@templatical/types\";\nimport type { Rule, RuleHit, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"structure.empty-column\",\n reference:\n \"https://docs.templatical.com/quality/structure/rule-catalog#content-presence\",\n severity: \"warning\",\n};\n\nfunction findEmptyColumns(blocks: Block[], hits: RuleHit[]): void {\n for (const block of blocks) {\n if (!isSection(block)) continue;\n const section = block as SectionBlock;\n if (section.children.length > 1) {\n section.children.forEach((column, columnIndex) => {\n if (column.length === 0) {\n hits.push({\n blockId: section.id,\n params: { columnIndex: columnIndex + 1 },\n });\n }\n });\n }\n for (const column of section.children) {\n findEmptyColumns(column, hits);\n }\n }\n}\n\nexport const emptyColumn: Rule = {\n meta,\n template(content: TemplateContent): RuleHit[] {\n const hits: RuleHit[] = [];\n findEmptyColumns(content.blocks, hits);\n return hits;\n },\n};\n","import type { SectionBlock } from \"@templatical/types\";\nimport { isSection } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"structure.empty-section\",\n reference:\n \"https://docs.templatical.com/quality/structure/rule-catalog#content-presence\",\n severity: \"warning\",\n};\n\nfunction isSectionEmpty(section: SectionBlock): boolean {\n if (section.children.length === 0) return true;\n return section.children.every((column) => column.length === 0);\n}\n\nexport const emptySection: Rule = {\n meta,\n block(block) {\n if (!isSection(block)) return null;\n const section = block as SectionBlock;\n if (!isSectionEmpty(section)) return null;\n return {\n blockId: section.id,\n fix: {\n description: \"Remove the empty section\",\n removesBlock: true,\n apply: (ctx) => {\n ctx.removeBlock(section.id);\n },\n },\n };\n },\n};\n","import { isSection, resolveHero } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"structure.hero-not-applied\",\n reference:\n \"https://docs.templatical.com/quality/structure/rule-catalog#content-presence\",\n severity: \"warning\",\n messageVariants: [\"columns\", \"image\", \"size\"],\n};\n\n/**\n * A section with `hero` set that renders as a regular section, and why: more\n * than one column, no background image, or `height: \"image\"` without the\n * image's size. Covers the editor's in-between states (a Hero shortcut before\n * its image is set, a hero switched to two columns) as well as JSON- and\n * agent-authored content and imported heroes that came without a size.\n */\nexport const heroNotApplied: Rule = {\n meta,\n block(block) {\n if (!isSection(block)) return null;\n const hero = resolveHero(block);\n if (hero === null || hero.applied) return null;\n return { blockId: block.id, messageVariant: hero.reason };\n },\n};\n","import type { BackgroundImage, SectionBlock } from \"@templatical/types\";\nimport { isWrapper } from \"@templatical/types\";\nimport type { WalkContext } from \"../types\";\n\n/** The `mj-wrapper` a section renders inside, as far as backgrounds go. */\nexport interface SectionBand {\n backgroundColor?: string;\n backgroundImage?: BackgroundImage;\n}\n\n/**\n * The band directly around a section: its own `wrapper` when set, otherwise\n * the layout `wrapper` block it sits in. `null` when nothing frames it.\n */\nexport function enclosingBand(\n section: SectionBlock,\n ctx: WalkContext,\n): SectionBand | null {\n if (section.wrapper) {\n return section.wrapper;\n }\n\n if (ctx.parent && isWrapper(ctx.parent)) {\n return {\n backgroundColor: ctx.parent.styles?.backgroundColor,\n backgroundImage: ctx.parent.backgroundImage,\n };\n }\n\n return null;\n}\n\n/**\n * A color that actually paints — not unset, empty, `transparent` or a\n * non-string value from hand-edited JSON.\n */\nexport function isPaintedColor(color: string | undefined): boolean {\n if (typeof color !== \"string\") return false;\n const value = color.trim().toLowerCase();\n return value !== \"\" && value !== \"transparent\";\n}\n","import { isSection, resolveBackgroundImage } from \"@templatical/types\";\nimport type { Rule, RuleMeta, WalkContext } from \"../../types\";\nimport { enclosingBand } from \"../band\";\n\nexport const meta: RuleMeta = {\n id: \"structure.nested-background-image\",\n reference:\n \"https://docs.templatical.com/quality/structure/rule-catalog#email-client-compatibility\",\n severity: \"warning\",\n};\n\n/**\n * A background image on both a wrapper and its section nests two VML fills,\n * which Outlook desktop doesn't support (MJML's `mj-wrapper` README).\n */\nexport const nestedBackgroundImage: Rule = {\n meta,\n block(block, ctx: WalkContext) {\n if (!isSection(block)) return null;\n if (resolveBackgroundImage(block.backgroundImage) === null) return null;\n const band = enclosingBand(block, ctx);\n if (band === null) return null;\n if (resolveBackgroundImage(band.backgroundImage) === null) return null;\n return { blockId: block.id };\n },\n};\n","import type { SectionBlock } from \"@templatical/types\";\nimport { isSection } from \"@templatical/types\";\nimport type { Rule, RuleMeta, WalkContext } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"structure.nested-section\",\n reference:\n \"https://docs.templatical.com/quality/structure/rule-catalog#tree-integrity\",\n severity: \"error\",\n};\n\nexport const nestedSection: Rule = {\n meta,\n block(block, ctx: WalkContext) {\n if (!isSection(block)) return null;\n if (ctx.section === null) return null;\n const parentSection = ctx.section as SectionBlock;\n return {\n blockId: block.id,\n params: { parentId: parentSection.id },\n };\n },\n};\n","import type { ColumnLayout, SectionBlock } from \"@templatical/types\";\nimport { isSection } from \"@templatical/types\";\nimport type { Rule, RuleMeta } from \"../../types\";\n\nexport const meta: RuleMeta = {\n id: \"structure.section-column-mismatch\",\n reference:\n \"https://docs.templatical.com/quality/structure/rule-catalog#section-layout\",\n severity: \"error\",\n};\n\nfunction expectedColumnCount(layout: ColumnLayout): number {\n if (layout === \"1\") return 1;\n if (layout === \"3\") return 3;\n return 2;\n}\n\nexport const sectionColumnMismatch: Rule = {\n meta,\n block(block) {\n if (!isSection(block)) return null;\n const section = block as SectionBlock;\n const expected = expectedColumnCount(section.columns);\n const actual = section.children.length;\n if (actual === expected) return null;\n return {\n blockId: section.id,\n params: { layout: section.columns, expected, actual },\n };\n },\n};\n","import { isSection, resolveBackgroundImage } from \"@templatical/types\";\nimport type { Rule, RuleMeta, WalkContext } from \"../../types\";\nimport { enclosingBand, isPaintedColor } from \"../band\";\n\nexport const meta: RuleMeta = {\n id: \"structure.wrapper-color-over-background-image\",\n reference:\n \"https://docs.templatical.com/quality/structure/rule-catalog#email-client-compatibility\",\n severity: \"warning\",\n};\n\n/**\n * Outlook desktop paints a wrapper's background color over its section's\n * VML background image (documented in MJML's `mj-wrapper` README). Every\n * other client layers them correctly, so this warns rather than errors.\n */\nexport const wrapperColorOverBackgroundImage: Rule = {\n meta,\n block(block, ctx: WalkContext) {\n if (!isSection(block)) return null;\n if (resolveBackgroundImage(block.backgroundImage) === null) return null;\n const band = enclosingBand(block, ctx);\n if (band === null || !isPaintedColor(band.backgroundColor)) return null;\n return { blockId: block.id };\n },\n};\n","import type { TemplateContent } from \"@templatical/types\";\nimport type { LintIssue, LintOptions, Rule } from \"../types\";\nimport { resolveStructureOptions, runRules } from \"../run-rules\";\nimport {\n formatStructureMessage,\n type StructureRuleMessageId,\n} from \"./messages\";\nimport { duplicateBlockId } from \"./rules/duplicate-block-id\";\nimport { emptyColumn } from \"./rules/empty-column\";\nimport { emptySection } from \"./rules/empty-section\";\nimport { heroNotApplied } from \"./rules/hero-not-applied\";\nimport { nestedBackgroundImage } from \"./rules/nested-background-image\";\nimport { nestedSection } from \"./rules/nested-section\";\nimport { sectionColumnMismatch } from \"./rules/section-column-mismatch\";\nimport { wrapperColorOverBackgroundImage } from \"./rules/wrapper-color-over-background-image\";\n\nexport const STRUCTURE_RULES: Rule[] = [\n duplicateBlockId,\n emptySection,\n emptyColumn,\n nestedSection,\n sectionColumnMismatch,\n wrapperColorOverBackgroundImage,\n nestedBackgroundImage,\n heroNotApplied,\n];\n\nexport function lintStructure(\n content: TemplateContent,\n options: LintOptions = {},\n): LintIssue[] {\n if (options.disabled === true || options.structure === false) return [];\n const tool = options.structure ?? {};\n const resolved = resolveStructureOptions(\n options.locale,\n tool,\n STRUCTURE_RULES,\n );\n return runRules(content, STRUCTURE_RULES, resolved, (locale, id, params) =>\n formatStructureMessage(locale, id as StructureRuleMessageId, params),\n );\n}\n","import type en from \"./en\";\n\nconst de: typeof en = {\n \"link.javascript-protocol\": {\n message:\n 'Die URL verwendet das Protokoll „{protocol}:\", das beliebigen Skriptcode ausführen kann und aus Sicherheitsgründen beim Rendern entfernt wird.',\n suggestion: \"Ersetze sie durch eine echte URL oder entferne sie.\",\n },\n \"link.unsupported-protocol\": {\n message:\n 'Die URL verwendet das Protokoll „{protocol}\", das von den meisten E-Mail-Clients nicht unterstützt wird.',\n suggestion: \"Verwende http, https, mailto, tel oder sms.\",\n },\n \"link.malformed-mailto\": {\n message: \"mailto:-Link ist fehlerhaft.\",\n suggestion:\n \"Setze eine einzelne Empfängeradresse vor die Abfragezeichenfolge (z. B. mailto:hello@example.com).\",\n },\n \"link.malformed-tel\": {\n message:\n \"tel:-Link enthält andere Zeichen als Ziffern, +, Leerzeichen, Bindestriche, Klammern oder Punkte.\",\n suggestion:\n \"Verwende in der Telefonnummer nur Ziffern, +, Leerzeichen, Bindestriche, Klammern oder Punkte.\",\n },\n \"link.localhost-or-staging\": {\n message: 'Der URL-Host „{host}\" entspricht einem Nicht-Produktionsmuster.',\n suggestion: \"Ersetze ihn vor dem Versand durch die Produktions-URL.\",\n },\n \"link.relative-url\": {\n message:\n 'Die URL „{url}\" ist relativ. Eine versendete E-Mail hat keine Seitenadresse, gegen die sie aufgelöst werden kann, daher funktioniert der Link nicht.',\n suggestion: \"Verwende eine absolute URL (https://…).\",\n },\n};\n\nexport default de;\n","const en = {\n \"link.javascript-protocol\": {\n message:\n 'URL uses the \"{protocol}:\" protocol, which can execute arbitrary script and is stripped at render time for safety.',\n suggestion: \"Replace it with a real link or remove the URL.\",\n },\n \"link.unsupported-protocol\": {\n message:\n 'URL uses the \"{protocol}\" protocol, which most email clients do not support.',\n suggestion: \"Use http, https, mailto, tel, or sms.\",\n },\n \"link.malformed-mailto\": {\n message: \"mailto: link is malformed.\",\n suggestion:\n \"Put a single recipient address before any query string (e.g. mailto:hello@example.com).\",\n },\n \"link.malformed-tel\": {\n message:\n \"tel: link contains characters that are not digits, +, spaces, dashes, parentheses, or dots.\",\n suggestion:\n \"Use only digits, +, spaces, dashes, parentheses, or dots in the phone number.\",\n },\n \"link.localhost-or-staging\": {\n message: 'URL host \"{host}\" matches a non-production pattern.',\n suggestion: \"Replace with the production URL before sending.\",\n },\n \"link.relative-url\": {\n message:\n 'URL \"{url}\" is relative. A sent email has no page address to resolve it against, so the link breaks.',\n suggestion: \"Use an absolute URL (https://…).\",\n },\n};\n\nexport default en;\n","import en from \"./en\";\nimport { formatMessagePair } from \"../../format-message\";\n\nexport type LinkMessageMap = typeof en;\nexport type LinkRuleMessageId = keyof LinkMessageMap;\n\nconst modules = import.meta.glob<{ default: LinkMessageMap }>(\"./*.ts\", {\n eager: true,\n});\n\nconst MESSAGES: Record<string, LinkMessageMap> = {};\nfor (const path in modules) {\n const match = /\\.\\/([^/]+)\\.ts$/.exec(path);\n if (!match) continue;\n const locale = match[1];\n if (locale === \"index\") continue;\n MESSAGES[locale] = modules[path].default;\n}\n\nexport const SUPPORTED_LINK_MESSAGE_LOCALES = Object.keys(MESSAGES);\n\nexport function getLinkMessages(locale: string): LinkMessageMap {\n const base = locale.split(\"-\")[0]?.toLowerCase() ?? \"en\";\n return MESSAGES[base] ?? MESSAGES.en ?? en;\n}\n\nexport function formatLinkMessage(\n locale: string,\n ruleId: LinkRuleMessageId,\n params?: Record<string, string | number>,\n): { message: string; suggestion: string } {\n const map = getLinkMessages(locale);\n const template = map[ruleId] ?? en[ruleId];\n return formatMessagePair(template, params);\n}\n","import type { TemplateContent } from \"@templatical/types\";\nimport {\n isButton,\n isHtml,\n isImage,\n isMenu,\n isParagraph,\n isSocialIcons,\n isTitle,\n isVideo,\n} from \"@templatical/types\";\nimport { walkBlocks } from \"./walk\";\nimport { extractAnchors } from \"./html-utils\";\n\nexport type UrlSource =\n \"anchor\" | \"button\" | \"image-link\" | \"video\" | \"menu-item\" | \"social-icon\";\n\nexport interface UrlOccurrence {\n url: string;\n blockId: string;\n source: UrlSource;\n /** Anchor text or block-derived label, if applicable. */\n label?: string;\n}\n\n/**\n * Visit every URL-bearing field in the template tree.\n *\n * Sources covered:\n * - anchor — `<a href>` inside `title.content`, `paragraph.content`,\n * `html.content` (parsed via extractAnchors)\n * - button — `button.url`\n * - image-link — `image.linkUrl` (only when present + non-empty)\n * - video — `video.url`\n * - menu-item — `menu.items[i].url`\n * - social-icon — `social.icons[i].url`\n *\n * Each rule iterates this list once and decides per occurrence.\n */\nexport function walkUrls(content: TemplateContent): UrlOccurrence[] {\n const occurrences: UrlOccurrence[] = [];\n\n walkBlocks(content, (block) => {\n if (isTitle(block) || isParagraph(block) || isHtml(block)) {\n for (const anchor of extractAnchors(block.content)) {\n occurrences.push({\n url: anchor.href,\n blockId: block.id,\n source: \"anchor\",\n label: anchor.text,\n });\n }\n return;\n }\n\n if (isButton(block)) {\n occurrences.push({\n url: block.url,\n blockId: block.id,\n source: \"button\",\n label: block.text,\n });\n return;\n }\n\n if (isImage(block)) {\n if (block.linkUrl && block.linkUrl !== \"\") {\n occurrences.push({\n url: block.linkUrl,\n blockId: block.id,\n source: \"image-link\",\n label: block.alt || undefined,\n });\n }\n return;\n }\n\n if (isVideo(block)) {\n occurrences.push({\n url: block.url,\n blockId: block.id,\n source: \"video\",\n label: block.alt || undefined,\n });\n return;\n }\n\n if (isMenu(block)) {\n for (const item of block.items) {\n occurrences.push({\n url: item.url,\n blockId: block.id,\n source: \"menu-item\",\n label: item.text,\n });\n }\n return;\n }\n\n if (isSocialIcons(block)) {\n for (const icon of block.icons) {\n occurrences.push({\n url: icon.url,\n blockId: block.id,\n source: \"social-icon\",\n label: icon.platform,\n });\n }\n return;\n }\n });\n\n return occurrences;\n}\n","import type { Rule, RuleHit, RuleMeta } from \"../../types\";\nimport { walkUrls } from \"../../url-walker\";\nimport { DANGEROUS_SCRIPT_SCHEMES, extractUrlScheme } from \"@templatical/types\";\n\nexport const meta: RuleMeta = {\n id: \"link.javascript-protocol\",\n reference:\n \"https://docs.templatical.com/quality/links/rule-catalog#dangerous-protocols\",\n severity: \"error\",\n};\n\n/**\n * The set of URL schemes that can encode executable script or arbitrary\n * payloads inside an `href`/`src` value. All three are in scope for this\n * rule because a sanitizer that strips `javascript:` but leaves `data:` or\n * `vbscript:` through is the textbook \"incomplete URL scheme check\" bug.\n *\n * Rule ID stays `link.javascript-protocol` for back-compat with consumer\n * severity overrides; the message is parameterized so users see the actual\n * matched protocol.\n */\nexport const DANGEROUS_SCRIPT_PROTOCOLS = DANGEROUS_SCRIPT_SCHEMES;\n\ntype DangerousProtocol = (typeof DANGEROUS_SCRIPT_PROTOCOLS)[number];\n\n/**\n * Match dangerous-script schemes after the shared browser-style URL\n * normalization, including embedded tab/LF/CR and leading C0 controls. Keep\n * the rule's older conservative Unicode-whitespace warning for authoring.\n */\nfunction matchDangerousProtocol(url: string): DangerousProtocol | null {\n const scheme = extractUrlScheme(url);\n const legacyScheme = extractUrlScheme(url.replace(/\\s+/g, \"\"));\n return (\n DANGEROUS_SCRIPT_PROTOCOLS.find(\n (proto) => proto === scheme || proto === legacyScheme,\n ) ?? null\n );\n}\n\nexport const javascriptProtocol: Rule = {\n meta,\n template(content): RuleHit[] {\n const hits: RuleHit[] = [];\n for (const occ of walkUrls(content)) {\n const protocol = matchDangerousProtocol(occ.url);\n if (protocol !== null) {\n hits.push({ blockId: occ.blockId, params: { protocol } });\n }\n }\n return hits;\n },\n};\n","import type { Rule, RuleHit, RuleMeta } from \"../../types\";\nimport { walkUrls } from \"../../url-walker\";\nimport { DANGEROUS_SCRIPT_PROTOCOLS } from \"./javascript-protocol\";\n\nexport const meta: RuleMeta = {\n id: \"link.unsupported-protocol\",\n reference:\n \"https://docs.templatical.com/quality/links/rule-catalog#unsupported-protocols\",\n severity: \"warning\",\n};\n\nconst SUPPORTED = new Set([\"http\", \"https\", \"mailto\", \"tel\", \"sms\"]);\nconst DANGEROUS = new Set<string>(DANGEROUS_SCRIPT_PROTOCOLS);\n\n/**\n * Treat dangerous-script schemes (covered by `link.javascript-protocol`) and\n * bare/relative URLs as \"not unsupported\" — this rule fires only for\n * explicitly named schemes that email clients typically refuse.\n */\nfunction getProtocol(url: string): string | null {\n if (!url) return null;\n const trimmed = url.trim();\n const match = /^([a-z][a-z0-9+\\-.]*):/i.exec(trimmed);\n if (!match) return null;\n return match[1].toLowerCase();\n}\n\nexport const unsupportedProtocol: Rule = {\n meta,\n template(content): RuleHit[] {\n const hits: RuleHit[] = [];\n for (const occ of walkUrls(content)) {\n const protocol = getProtocol(occ.url);\n if (protocol === null) continue;\n if (DANGEROUS.has(protocol)) continue;\n if (SUPPORTED.has(protocol)) continue;\n hits.push({ blockId: occ.blockId, params: { protocol } });\n }\n return hits;\n },\n};\n","import type { Rule, RuleHit, RuleMeta } from \"../../types\";\nimport { walkUrls } from \"../../url-walker\";\n\nexport const meta: RuleMeta = {\n id: \"link.malformed-mailto\",\n reference:\n \"https://docs.templatical.com/quality/links/rule-catalog#malformed-uris\",\n severity: \"warning\",\n};\n\n/**\n * Pragmatic RFC-5321-ish sanity check, not a full validator. Splits on `?`,\n * requires the left side to contain exactly one `@` with a non-empty local\n * part and a domain that includes at least one dot.\n *\n * Multi-recipient `mailto:a@x.com,b@y.com` is accepted (commas pass through;\n * each recipient is validated individually).\n */\nfunction isMalformedMailto(url: string): boolean {\n const trimmed = url.trim();\n if (!/^mailto:/i.test(trimmed)) return false;\n const value = trimmed.slice(\"mailto:\".length);\n const [recipients] = value.split(\"?\", 2);\n if (recipients.trim() === \"\") return true;\n\n const list = recipients.split(\",\").map((r) => r.trim());\n for (const recipient of list) {\n if (recipient === \"\") return true;\n const at = recipient.split(\"@\");\n if (at.length !== 2) return true;\n const [local, domain] = at;\n if (local === \"\" || domain === \"\") return true;\n if (!domain.includes(\".\")) return true;\n }\n return false;\n}\n\nexport const malformedMailto: Rule = {\n meta,\n template(content): RuleHit[] {\n const hits: RuleHit[] = [];\n for (const occ of walkUrls(content)) {\n if (isMalformedMailto(occ.url)) {\n hits.push({ blockId: occ.blockId });\n }\n }\n return hits;\n },\n};\n","import type { Rule, RuleHit, RuleMeta } from \"../../types\";\nimport { walkUrls } from \"../../url-walker\";\n\nexport const meta: RuleMeta = {\n id: \"link.malformed-tel\",\n reference:\n \"https://docs.templatical.com/quality/links/rule-catalog#malformed-uris\",\n severity: \"warning\",\n};\n\nconst VALID_SUBSCRIBER_CHARS = /^[+0-9\\s().\\-]+$/;\n// RFC 3966 par = `;` pname [ \"=\" pvalue ]. pname is alphanum/`-`, pvalue is\n// 1+ paramchar. We accept anything non-empty on the right of `=` since email\n// clients don't validate it.\nconst VALID_PARAM = /^[A-Za-z0-9-]+(=[^;]+)?$/;\n\nfunction isMalformedTel(url: string): boolean {\n const trimmed = url.trim();\n if (!/^tel:/i.test(trimmed)) return false;\n const value = trimmed.slice(\"tel:\".length).trim();\n if (value === \"\") return true;\n const [subscriber, ...params] = value.split(\";\");\n if (!VALID_SUBSCRIBER_CHARS.test(subscriber)) return true;\n return params.some((p) => !VALID_PARAM.test(p));\n}\n\nexport const malformedTel: Rule = {\n meta,\n template(content): RuleHit[] {\n const hits: RuleHit[] = [];\n for (const occ of walkUrls(content)) {\n if (isMalformedTel(occ.url)) {\n hits.push({ blockId: occ.blockId });\n }\n }\n return hits;\n },\n};\n","import type { ResolvedOptions, Rule, RuleHit, RuleMeta } from \"../../types\";\nimport { walkUrls } from \"../../url-walker\";\n\nexport const meta: RuleMeta = {\n id: \"link.localhost-or-staging\",\n reference:\n \"https://docs.templatical.com/quality/links/rule-catalog#environment-leaks\",\n severity: \"warning\",\n};\n\n/**\n * Glob → RegExp for the `nonProductionHosts` pattern set. `*` is a wildcard\n * that matches any run of characters (including `.`) so `*.staging.*`\n * matches `app.staging.example.com` and `*.local` matches both `acme.local`\n * and `a.b.c.local`. Case-insensitive.\n */\nfunction globToRegex(pattern: string): RegExp {\n const escaped = pattern.replace(/[.+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const expanded = escaped.replace(/\\*/g, \".*\");\n return new RegExp(`^${expanded}$`, \"i\");\n}\n\nfunction extractHost(url: string): string | null {\n if (!url) return null;\n const trimmed = url.trim();\n // mailto/tel/sms have no host concept worth matching.\n if (!/^(https?|ftps?):\\/\\//i.test(trimmed)) return null;\n try {\n return new URL(trimmed).hostname.toLowerCase();\n } catch {\n return null;\n }\n}\n\nexport const localhostOrStaging: Rule = {\n meta,\n template(content, opts: ResolvedOptions): RuleHit[] {\n const patterns = opts.links.nonProductionHosts;\n if (patterns.length === 0) return [];\n const regexes = patterns.map(globToRegex);\n const hits: RuleHit[] = [];\n\n for (const occ of walkUrls(content)) {\n const host = extractHost(occ.url);\n if (host === null) continue;\n if (regexes.some((re) => re.test(host))) {\n hits.push({ blockId: occ.blockId, params: { host } });\n }\n }\n return hits;\n },\n};\n","import type { Rule, RuleHit, RuleMeta } from \"../../types\";\nimport { walkUrls } from \"../../url-walker\";\n\nexport const meta: RuleMeta = {\n id: \"link.relative-url\",\n reference:\n \"https://docs.templatical.com/quality/links/rule-catalog#unsupported-protocols\",\n severity: \"warning\",\n};\n\n/**\n * Root-relative, `./` / `../` relative, query-only, and protocol-relative\n * (`//host`) URLs. A sent email has no page URL to resolve them against.\n *\n * Keyed on path-shaped prefixes only: the linter has no merge-tag syntax, so\n * \"no scheme\" would also match a URL that opens with a tag the sending system\n * completes (`{{ unsubscribe_url }}`).\n */\nconst RELATIVE_URL = /^(?:\\/|\\.{1,2}\\/|\\?)/;\n\nexport const relativeUrl: Rule = {\n meta,\n template(content): RuleHit[] {\n const hits: RuleHit[] = [];\n for (const occ of walkUrls(content)) {\n const url = occ.url?.trim();\n if (!url || !RELATIVE_URL.test(url)) continue;\n hits.push({ blockId: occ.blockId, params: { url } });\n }\n return hits;\n },\n};\n","import type { TemplateContent } from \"@templatical/types\";\nimport type { LintIssue, LintOptions, Rule } from \"../types\";\nimport { resolveLinksOptions, runRules } from \"../run-rules\";\nimport { formatLinkMessage, type LinkRuleMessageId } from \"./messages\";\nimport { javascriptProtocol } from \"./rules/javascript-protocol\";\nimport { unsupportedProtocol } from \"./rules/unsupported-protocol\";\nimport { malformedMailto } from \"./rules/malformed-mailto\";\nimport { malformedTel } from \"./rules/malformed-tel\";\nimport { localhostOrStaging } from \"./rules/localhost-or-staging\";\nimport { relativeUrl } from \"./rules/relative-url\";\n\nexport const LINK_RULES: Rule[] = [\n javascriptProtocol,\n unsupportedProtocol,\n malformedMailto,\n malformedTel,\n localhostOrStaging,\n relativeUrl,\n];\n\nexport function lintLinks(\n content: TemplateContent,\n options: LintOptions = {},\n): LintIssue[] {\n if (options.disabled === true || options.links === false) return [];\n const tool = options.links ?? {};\n const resolved = resolveLinksOptions(options.locale, tool, LINK_RULES);\n return runRules(content, LINK_RULES, resolved, (locale, id, params) =>\n formatLinkMessage(locale, id as LinkRuleMessageId, params),\n );\n}\n","import type en from \"./en\";\n\nconst de: typeof en = {\n \"deliverability.link-text-domain-mismatch\": {\n message:\n \"Der Linktext zeigt {textHost}, der Link führt aber zu {linkHost}. Spamfilter werten solche Links als Phishing.\",\n suggestion:\n \"Lass den Text zum Ziel passen oder verwende Wörter statt einer Adresse.\",\n },\n \"deliverability.url-shortener\": {\n message:\n \"Dieser Link läuft über den URL-Kürzer {host}. Spamfilter behandeln gekürzte Links mit Misstrauen, weil sie das Ziel verbergen.\",\n suggestion: \"Verlinke direkt auf das Ziel.\",\n },\n \"deliverability.ip-address-url\": {\n message:\n \"Dieser Link führt zur IP-Adresse {host} statt zu einer Domain. Spamfilter werten solche Links als Spam.\",\n suggestion: \"Verlinke auf deine Domain.\",\n },\n \"deliverability.low-text\": {\n message:\n \"Diese E-Mail enthält Bilder, aber nur {count} Zeichen Text (weniger als {min}). Manche Spamfilter bewerten bildlastige E-Mails mit wenig Text negativ, und wer Bilder blockiert, sieht fast nichts.\",\n suggestion: \"Ergänze Text, der die Botschaft trägt.\",\n },\n};\n\nexport default de;\n","const en = {\n \"deliverability.link-text-domain-mismatch\": {\n message:\n \"The link text shows {textHost}, but the link goes to {linkHost}. Spam filters flag links like this as phishing.\",\n suggestion:\n \"Make the text match the destination, or use words instead of an address.\",\n },\n \"deliverability.url-shortener\": {\n message:\n \"This link goes through the URL shortener {host}. Spam filters treat shortener links with suspicion because they hide the destination.\",\n suggestion: \"Link to the destination instead.\",\n },\n \"deliverability.ip-address-url\": {\n message:\n \"This link points to the IP address {host} instead of a domain. Spam filters score links like this as spam.\",\n suggestion: \"Link to your domain.\",\n },\n \"deliverability.low-text\": {\n message:\n \"This email has images but only {count} characters of text (under {min}). Some spam filters score image-heavy emails with little text, and readers who block images see almost nothing.\",\n suggestion: \"Add text that carries the message.\",\n },\n};\n\nexport default en;\n","import en from \"./en\";\nimport { formatMessagePair } from \"../../format-message\";\n\nexport type DeliverabilityMessageMap = typeof en;\nexport type DeliverabilityRuleMessageId = keyof DeliverabilityMessageMap;\n\nconst modules = import.meta.glob<{ default: DeliverabilityMessageMap }>(\n \"./*.ts\",\n { eager: true },\n);\nconst MESSAGES: Record<string, DeliverabilityMessageMap> = {};\nfor (const path in modules) {\n const match = /\\.\\/([^/]+)\\.ts$/.exec(path);\n if (!match) continue;\n const locale = match[1];\n if (locale === \"index\") continue;\n MESSAGES[locale] = modules[path].default;\n}\n\nexport const SUPPORTED_DELIVERABILITY_MESSAGE_LOCALES = Object.keys(MESSAGES);\n\nexport function getDeliverabilityMessages(\n locale: string,\n): DeliverabilityMessageMap {\n const base = locale.split(\"-\")[0]?.toLowerCase() ?? \"en\";\n return MESSAGES[base] ?? MESSAGES.en ?? en;\n}\n\nexport function formatDeliverabilityMessage(\n locale: string,\n ruleId: DeliverabilityRuleMessageId,\n params?: Record<string, string | number>,\n): { message: string; suggestion: string } {\n const map = getDeliverabilityMessages(locale);\n const template = map[ruleId] ?? en[ruleId];\n return formatMessagePair(template, params);\n}\n","/**\n * Explicit suffixes keep same-site comparisons conservative. A missed flag is\n * preferable to a false phishing warning; no public-suffix dependency is needed.\n */\nexport const MULTI_PART_SUFFIXES =\n \"ac.jp ac.uk co.at co.id co.il co.in co.jp co.kr co.nz co.uk co.za com.ar com.au com.br com.cn com.co com.hk com.mx com.my com.ph com.pl com.sg com.tr com.tw com.ua edu.au go.jp gov.au gov.uk ltd.uk me.uk ne.jp net.au net.br net.cn net.in net.nz or.at or.jp or.kr org.au org.br org.cn org.in org.nz org.uk plc.uk\".split(\n \" \",\n );\n\nconst suffixes = new Set(MULTI_PART_SUFFIXES);\n\nexport function parseHttpUrl(value: string): URL | null {\n try {\n const url = new URL(value);\n return (url.protocol === \"http:\" || url.protocol === \"https:\") &&\n !/[{}]/.test(url.hostname)\n ? url\n : null;\n } catch {\n return null;\n }\n}\n\nexport function normalizedHost(url: URL): string {\n return url.hostname\n .toLowerCase()\n .replace(/\\.$/, \"\")\n .replace(/^www\\./, \"\");\n}\n\nfunction registrableDomain(host: string): string {\n if (/^\\d+\\.\\d+\\.\\d+\\.\\d+$/.test(host) || host.startsWith(\"[\")) {\n return host;\n }\n const labels = host.split(\".\");\n const lastTwo = labels.slice(-2).join(\".\");\n return labels.slice(-(suffixes.has(lastTwo) ? 3 : 2)).join(\".\");\n}\n\nexport function isSameSite(left: string, right: string): boolean {\n const leftUrl = parseHttpUrl(`http://${left}`);\n const rightUrl = parseHttpUrl(`http://${right}`);\n if (!leftUrl || !rightUrl) return false;\n return (\n registrableDomain(normalizedHost(leftUrl)) ===\n registrableDomain(normalizedHost(rightUrl))\n );\n}\n","import type { Rule, RuleHit, RuleMeta } from \"../../types\";\nimport { walkUrls } from \"../../url-walker\";\nimport { isSameSite, normalizedHost, parseHttpUrl } from \"../same-site\";\n\nexport const meta: RuleMeta = {\n id: \"deliverability.link-text-domain-mismatch\",\n reference: \"https://docs.rspamd.com/modules/phishing/\",\n severity: \"warning\",\n};\n\nconst DOMAIN_LABEL =\n /^(?:https?:\\/\\/)?(?:[\\p{L}\\p{N}](?:[\\p{L}\\p{N}-]*[\\p{L}\\p{N}])?\\.)+(?:\\p{L}{2,}|xn--[a-z0-9-]+)(?::\\d+)?(?:[/?#][^\\s]*)?$/iu;\n\nfunction labelUrl(label: string | undefined): URL | null {\n if (!label) return null;\n let text = label.trim();\n if (text.startsWith(\"<\") && text.endsWith(\">\")) text = text.slice(1, -1);\n text = text.replace(/[.,;:!?)]+$/, \"\");\n if (!DOMAIN_LABEL.test(text)) return null;\n return parseHttpUrl(/^https?:\\/\\//i.test(text) ? text : `http://${text}`);\n}\n\nexport const linkTextDomainMismatch: Rule = {\n meta,\n template(content): RuleHit[] {\n const hits: RuleHit[] = [];\n for (const occ of walkUrls(content)) {\n if (\n occ.source !== \"anchor\" &&\n occ.source !== \"button\" &&\n occ.source !== \"menu-item\"\n )\n continue;\n const textUrl = labelUrl(occ.label);\n const linkUrl = parseHttpUrl(occ.url);\n if (!textUrl || !linkUrl) continue;\n const textHost = normalizedHost(textUrl);\n const linkHost = normalizedHost(linkUrl);\n if (!isSameSite(textHost, linkHost)) {\n hits.push({ blockId: occ.blockId, params: { textHost, linkHost } });\n }\n }\n return hits;\n },\n};\n","import type { Rule, RuleHit, RuleMeta } from \"../../types\";\nimport { walkUrls } from \"../../url-walker\";\nimport { normalizedHost, parseHttpUrl } from \"../same-site\";\n\nexport const meta: RuleMeta = {\n id: \"deliverability.url-shortener\",\n reference: \"https://docs.rspamd.com/modules/phishing/\",\n severity: \"warning\",\n};\n\nexport const urlShortener: Rule = {\n meta,\n template(content, opts): RuleHit[] {\n const hits: RuleHit[] = [];\n for (const occ of walkUrls(content)) {\n const url = parseHttpUrl(occ.url);\n if (!url) continue;\n const host = normalizedHost(url);\n if (\n opts.deliverability.shortenerHosts.some(\n (entry) => host === entry || host.endsWith(`.${entry}`),\n )\n ) {\n hits.push({ blockId: occ.blockId, params: { host } });\n }\n }\n return hits;\n },\n};\n","import type { Rule, RuleHit, RuleMeta } from \"../../types\";\nimport { walkUrls } from \"../../url-walker\";\nimport { normalizedHost, parseHttpUrl } from \"../same-site\";\n\nexport const meta: RuleMeta = {\n id: \"deliverability.ip-address-url\",\n reference:\n \"https://svn.apache.org/repos/asf/spamassassin/branches/b2_4_0/rules/20_uri_tests.cf\",\n severity: \"warning\",\n};\n\nexport const ipAddressUrl: Rule = {\n meta,\n template(content): RuleHit[] {\n const hits: RuleHit[] = [];\n for (const occ of walkUrls(content)) {\n const url = parseHttpUrl(occ.url);\n if (!url) continue;\n const host = normalizedHost(url);\n const ipv4 = /^(?:\\d{1,3}\\.){3}\\d{1,3}$/.test(host);\n const ipv6 = host.startsWith(\"[\") && host.endsWith(\"]\");\n if (!ipv4 && !ipv6) continue;\n if (host.startsWith(\"127.\") || host === \"0.0.0.0\" || host === \"[::1]\")\n continue;\n hits.push({ blockId: occ.blockId, params: { host } });\n }\n return hits;\n },\n};\n","import {\n isButton,\n isCountdown,\n isHtml,\n isImage,\n isMenu,\n isParagraph,\n isTable,\n isTitle,\n isVideo,\n} from \"@templatical/types\";\nimport type { Rule, RuleHit, RuleMeta } from \"../../types\";\nimport { extractText } from \"../../html-utils\";\nimport { walkBlocks } from \"../../walk\";\n\nexport const meta: RuleMeta = {\n id: \"deliverability.low-text\",\n reference:\n \"https://svn.apache.org/repos/asf/spamassassin/branches/b2_6_0/rules/20_html_tests.cf\",\n severity: \"info\",\n};\n\nexport const lowText: Rule = {\n meta,\n template(content, opts): RuleHit[] {\n let hasCustom = false;\n let hasImage = false;\n const parts: string[] = [];\n walkBlocks(content, (block) => {\n if (block.type === \"custom\") hasCustom = true;\n if (\n (isImage(block) && block.src.trim() !== \"\") ||\n isVideo(block) ||\n isCountdown(block)\n )\n hasImage = true;\n if (isTitle(block) || isParagraph(block) || isHtml(block))\n parts.push(extractText(block.content));\n if (isTable(block)) {\n for (const row of block.rows)\n for (const cell of row.cells) parts.push(extractText(cell.content));\n }\n if (isButton(block)) parts.push(block.text);\n if (isMenu(block)) for (const item of block.items) parts.push(item.text);\n });\n if (hasCustom || !hasImage) return [];\n const count = parts.join(\" \").replace(/\\s+/g, \" \").trim().length;\n const min = opts.deliverability.minTextLength;\n return count < min ? [{ blockId: null, params: { count, min } }] : [];\n },\n};\n","import type { TemplateContent } from \"@templatical/types\";\nimport type { LintIssue, LintOptions, Rule } from \"../types\";\nimport { resolveDeliverabilityOptions, runRules } from \"../run-rules\";\nimport {\n formatDeliverabilityMessage,\n type DeliverabilityRuleMessageId,\n} from \"./messages\";\nimport { linkTextDomainMismatch } from \"./rules/link-text-domain-mismatch\";\nimport { urlShortener } from \"./rules/url-shortener\";\nimport { ipAddressUrl } from \"./rules/ip-address-url\";\nimport { lowText } from \"./rules/low-text\";\n\nexport const DELIVERABILITY_RULES: Rule[] = [\n linkTextDomainMismatch,\n urlShortener,\n ipAddressUrl,\n lowText,\n];\n\nexport function lintDeliverability(\n content: TemplateContent,\n options: LintOptions = {},\n): LintIssue[] {\n if (options.disabled === true || options.deliverability === false) return [];\n const tool = options.deliverability ?? {};\n const resolved = resolveDeliverabilityOptions(\n options.locale,\n tool,\n DELIVERABILITY_RULES,\n );\n return runRules(\n content,\n DELIVERABILITY_RULES,\n resolved,\n (locale, id, params) =>\n formatDeliverabilityMessage(\n locale,\n id as DeliverabilityRuleMessageId,\n params,\n ),\n );\n}\n","/*! caniemail data © Rémi Parmentier, MIT — https://github.com/hteumeuleu/caniemail */\nexport const CANIEMAIL_SOURCE = {\n url: \"https://www.caniemail.com/api/data.json\",\n apiVersion: \"1.0.4\",\n lastUpdateDate: \"2026-09-16 13:05:00 +0000\",\n sha256: \"7328f873fae3bb24455d10bf3005464b2af12cbbcc5b54da51683d4911235628\",\n} as const;\nexport const CANIEMAIL_DATA_DATE = \"2026-09-16\";\n// prettier-ignore\nexport const CANIEMAIL_NICENAMES = {\n \"family\": {\n \"gmail\": \"Gmail\",\n \"outlook\": \"Outlook\",\n \"yahoo\": \"Yahoo! Mail\",\n \"apple-mail\": \"Apple Mail\",\n \"aol\": \"AOL\",\n \"thunderbird\": \"Mozilla Thunderbird\",\n \"microsoft\": \"Microsoft\",\n \"samsung-email\": \"Samsung Email\",\n \"sfr\": \"SFR\",\n \"orange\": \"Orange\",\n \"protonmail\": \"ProtonMail\",\n \"hey\": \"HEY\",\n \"mail-ru\": \"Mail.ru\",\n \"fastmail\": \"Fastmail\",\n \"laposte\": \"LaPoste.net\",\n \"t-online-de\": \"T-online.de\",\n \"free-fr\": \"Free.fr\",\n \"gmx\": \"GMX\",\n \"web-de\": \"WEB.DE\",\n \"ionos-1and1\": \"1&1\",\n \"rainloop\": \"RainLoop\",\n \"wp-pl\": \"WP.pl\"\n },\n \"platform\": {\n \"desktop-app\": \"Desktop\",\n \"desktop-webmail\": \"Desktop Webmail\",\n \"mobile-webmail\": \"Mobile Webmail\",\n \"webmail\": \"Webmail\",\n \"ios\": \"iOS\",\n \"android\": \"Android\",\n \"windows\": \"Windows\",\n \"macos\": \"macOS\",\n \"windows-mail\": \"Windows Mail\",\n \"outlook-com\": \"Outlook.com\"\n }\n} as const;\n// prettier-ignore\nexport const CANIEMAIL_DATA = {\n \"css-display-flex\": {\n \"title\": \"display:flex\",\n \"url\": \"https://www.caniemail.com/features/css-display-flex/\",\n \"lastTestDate\": \"2021-11-02\",\n \"notes\": {\n \"1\": \"Not supported with non Google accounts.\",\n \"2\": \"`display:inline-flex` is not supported.\"\n },\n \"cells\": {\n \"gmail.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"2026-03\"\n },\n \"gmail.android\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"2026-03\"\n },\n \"orange.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"orange.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"orange.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"outlook.windows\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019\"\n },\n \"outlook.windows-mail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"yahoo.desktop-webmail\": {\n \"value\": \"y\",\n \"notes\": [\n 2\n ],\n \"version\": \"2020-11\"\n },\n \"yahoo.ios\": {\n \"value\": \"y\",\n \"notes\": [\n 2\n ],\n \"version\": \"2020-11\"\n },\n \"yahoo.android\": {\n \"value\": \"y\",\n \"notes\": [\n 2\n ],\n \"version\": \"2020-11\"\n },\n \"aol.desktop-webmail\": {\n \"value\": \"y\",\n \"notes\": [\n 2\n ],\n \"version\": \"2020-11\"\n },\n \"aol.ios\": {\n \"value\": \"y\",\n \"notes\": [\n 2\n ],\n \"version\": \"2020-11\"\n },\n \"aol.android\": {\n \"value\": \"y\",\n \"notes\": [\n 2\n ],\n \"version\": \"2020-11\"\n },\n \"gmx.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-06\"\n },\n \"web-de.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-06\"\n }\n }\n },\n \"css-display-grid\": {\n \"title\": \"display:grid\",\n \"url\": \"https://www.caniemail.com/features/css-display-grid/\",\n \"lastTestDate\": \"2019-02-28\",\n \"notes\": {\n \"1\": \"Not supported with non Google accounts.\"\n },\n \"cells\": {\n \"gmail.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"2026-03\"\n },\n \"gmail.android\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"2026-03\"\n },\n \"orange.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"orange.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"orange.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"outlook.windows\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019\"\n },\n \"outlook.windows-mail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"gmx.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-06\"\n },\n \"web-de.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-06\"\n }\n }\n },\n \"css-position\": {\n \"title\": \"position\",\n \"url\": \"https://www.caniemail.com/features/css-position/\",\n \"lastTestDate\": \"2021-05-16\",\n \"notes\": {\n \"1\": \"Partial. Supports `relative`, `absolute` but not `sticky` and `fixed`.\",\n \"2\": \"Partial. Supports `sticky` but not `relative`, `absolute` and `fixed`.\",\n \"3\": \"Partial. Supports `relative` but not `absolute`, `sticky` and `fixed`.\",\n \"4\": \"Partial. Supports `relative` and `sticky` but not `absolute` and `fixed`.\",\n \"5\": \"Buggy. `fixed` elements scroll with page.\",\n \"6\": \"Buggy. `fixed` is replaced by `absolute`.\"\n },\n \"cells\": {\n \"apple-mail.macos\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"14\"\n },\n \"apple-mail.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"14.5\"\n },\n \"gmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-05\"\n },\n \"gmail.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-05\"\n },\n \"gmail.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-05\"\n },\n \"gmail.mobile-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-05\"\n },\n \"orange.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"2021-05\"\n },\n \"orange.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"2021-05\"\n },\n \"orange.android\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"2021-05\"\n },\n \"outlook.windows\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019\"\n },\n \"outlook.windows-mail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-05\"\n },\n \"outlook.macos\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"16.80\"\n },\n \"outlook.outlook-com\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"2023-12\"\n },\n \"outlook.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-05\"\n },\n \"outlook.android\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"2021-05\"\n },\n \"samsung-email.android\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"6.0\"\n },\n \"sfr.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 4\n ],\n \"version\": \"2021-05\"\n },\n \"sfr.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 4\n ],\n \"version\": \"2021-05\"\n },\n \"sfr.android\": {\n \"value\": \"a\",\n \"notes\": [\n 4\n ],\n \"version\": \"2021-05\"\n },\n \"aol.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2021-05\"\n },\n \"aol.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2021-05\"\n },\n \"aol.android\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2021-05\"\n },\n \"yahoo.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2021-05\"\n },\n \"yahoo.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2021-05\"\n },\n \"yahoo.android\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2021-05\"\n },\n \"hey.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 4\n ],\n \"version\": \"2021-05\"\n },\n \"mail-ru.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-05\"\n },\n \"fastmail.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 1,\n 6\n ],\n \"version\": \"2021-07\"\n },\n \"laposte.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 4\n ],\n \"version\": \"2021-08\"\n },\n \"gmx.desktop-webmail\": {\n \"value\": \"y\",\n \"notes\": [\n 2\n ],\n \"version\": \"2022-06\"\n },\n \"gmx.android\": {\n \"value\": \"y\",\n \"notes\": [\n 5\n ],\n \"version\": \"2022-06\"\n },\n \"web-de.desktop-webmail\": {\n \"value\": \"y\",\n \"notes\": [\n 2\n ],\n \"version\": \"2022-06\"\n },\n \"web-de.android\": {\n \"value\": \"y\",\n \"notes\": [\n 5\n ],\n \"version\": \"2022-06\"\n },\n \"ionos-1and1.android\": {\n \"value\": \"y\",\n \"notes\": [\n 5\n ],\n \"version\": \"2022-06\"\n }\n }\n },\n \"css-variables\": {\n \"title\": \"CSS Variables (Custom Properties)\",\n \"url\": \"https://www.caniemail.com/features/css-variables/\",\n \"lastTestDate\": \"2020-02-25\",\n \"notes\": {\n \"1\": \"Partial. The `var()` function is supported, but not the variable declaration.\",\n \"2\": \"Partial. Not supported with non Google accounts.\"\n },\n \"cells\": {\n \"gmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 1\n ],\n \"version\": \"2019-08\"\n },\n \"gmail.ios\": {\n \"value\": \"n\",\n \"notes\": [\n 1,\n 2\n ],\n \"version\": \"2019-08\"\n },\n \"gmail.android\": {\n \"value\": \"n\",\n \"notes\": [\n 1,\n 2\n ],\n \"version\": \"2019-08\"\n },\n \"gmail.mobile-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 1\n ],\n \"version\": \"2020-02\"\n },\n \"orange.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"orange.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"orange.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"outlook.windows\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019\"\n },\n \"outlook.windows-mail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-01\"\n },\n \"outlook.macos\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"16.80\"\n },\n \"outlook.outlook-com\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-01\"\n },\n \"outlook.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"outlook.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"aol.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-01\"\n },\n \"aol.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-01\"\n },\n \"aol.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-01\"\n },\n \"yahoo.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"yahoo.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"yahoo.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"mail-ru.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 1\n ],\n \"version\": \"2020-10\"\n },\n \"fastmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 1\n ],\n \"version\": \"2021-07\"\n },\n \"gmx.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-09\"\n },\n \"web-de.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-09\"\n }\n }\n },\n \"css-at-import\": {\n \"title\": \"@import\",\n \"url\": \"https://www.caniemail.com/features/css-at-import/\",\n \"lastTestDate\": \"2019-02-28\",\n \"notes\": {},\n \"cells\": {\n \"gmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"gmail.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"gmail.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"gmail.mobile-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"orange.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-03\"\n },\n \"orange.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-12\"\n },\n \"orange.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-12\"\n },\n \"outlook.macos\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"16.80\"\n },\n \"outlook.outlook-com\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-12\"\n },\n \"outlook.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"outlook.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"thunderbird.macos\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"78.5\"\n },\n \"yahoo.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"yahoo.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"yahoo.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"aol.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"aol.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"aol.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-01\"\n },\n \"samsung-email.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"5.0.10.2\"\n },\n \"sfr.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2025-07\"\n },\n \"sfr.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-08\"\n },\n \"sfr.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-08\"\n },\n \"protonmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-03\"\n },\n \"protonmail.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-03\"\n },\n \"mail-ru.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"fastmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-07\"\n },\n \"laposte.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2025-07\"\n },\n \"gmx.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-06\"\n },\n \"gmx.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-06\"\n },\n \"web-de.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-06\"\n },\n \"web-de.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-06\"\n },\n \"ionos-1and1.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-06\"\n },\n \"wp-pl.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-12\"\n }\n }\n },\n \"html-link\": {\n \"title\": \"<link> element\",\n \"url\": \"https://www.caniemail.com/features/html-link/\",\n \"lastTestDate\": \"2023-12-21\",\n \"notes\": {},\n \"cells\": {\n \"gmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"gmail.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"gmail.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"gmail.mobile-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"orange.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-12\"\n },\n \"orange.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-12\"\n },\n \"orange.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-12\"\n },\n \"outlook.macos\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"16.80\"\n },\n \"outlook.outlook-com\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-12\"\n },\n \"outlook.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-12\"\n },\n \"outlook.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-12\"\n },\n \"thunderbird.macos\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"78.5\"\n },\n \"yahoo.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"yahoo.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"yahoo.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"aol.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"aol.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"aol.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-01\"\n },\n \"samsung-email.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"5.0.10.2\"\n },\n \"sfr.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-01\"\n },\n \"sfr.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-01\"\n },\n \"sfr.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-01\"\n },\n \"protonmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-03\"\n },\n \"protonmail.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-03\"\n },\n \"protonmail.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-03\"\n },\n \"hey.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-06\"\n },\n \"mail-ru.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-09\"\n },\n \"fastmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-07\"\n },\n \"laposte.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-08\"\n },\n \"gmx.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"gmx.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"web-de.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"web-de.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"ionos-1and1.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"ionos-1and1.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"wp-pl.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-12\"\n }\n }\n },\n \"html-style\": {\n \"title\": \"<style> element\",\n \"url\": \"https://www.caniemail.com/features/html-style/\",\n \"lastTestDate\": \"2023-07-27\",\n \"notes\": {\n \"1\": \"Partial. Not supported inside the `<body>`.\",\n \"2\": \"Partial. Not supported with non Google accounts.\",\n \"3\": \"Buggy. The first `<head>` in the HTML is removed, so `<style>` elements need to be in a second `<head>` element.\",\n \"4\": \"Buggy. `<style>` elements need to be declared before their rules are used.\",\n \"5\": \"A CSS rule following a CSS comment is ignored. (See [email-bugs#25](https://github.com/hteumeuleu/email-bugs/issues/25).)\",\n \"6\": \"The size of the `<style>` tag [is limited to 16 KB](https://github.com/hteumeuleu/email-bugs/issues/90)\"\n },\n \"cells\": {\n \"gmail.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 1,\n 6\n ],\n \"version\": \"2023-01\"\n },\n \"gmail.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 1,\n 2\n ],\n \"version\": \"2023-01\"\n },\n \"gmail.android\": {\n \"value\": \"a\",\n \"notes\": [\n 1,\n 2\n ],\n \"version\": \"2019-06\"\n },\n \"gmail.mobile-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-01\"\n },\n \"outlook.windows\": {\n \"value\": \"a\",\n \"notes\": [\n 4\n ],\n \"version\": \"2019\"\n },\n \"outlook.windows-mail\": {\n \"value\": \"a\",\n \"notes\": [\n 4\n ],\n \"version\": \"2023-01\"\n },\n \"sfr.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2025-07\"\n },\n \"sfr.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2025-07\"\n },\n \"sfr.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-02\"\n },\n \"protonmail.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"2023-01\"\n },\n \"protonmail.android\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"2020-03\"\n },\n \"laposte.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2025-07\"\n },\n \"laposte.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2025-07\"\n },\n \"laposte.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-02\"\n },\n \"gmx.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-07\"\n },\n \"web-de.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2025-04\"\n },\n \"rainloop.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2023-02\"\n }\n }\n },\n \"html-svg\": {\n \"title\": \"Embedded <svg> image\",\n \"url\": \"https://www.caniemail.com/features/html-svg/\",\n \"lastTestDate\": \"2020-02-06\",\n \"notes\": {\n \"1\": \"Buggy. Requires a background on the `<body>`. Can be any type of background, image or a color, can be set as attribute, inline style or in `<style>` block\",\n \"2\": \"Not supported. Element is removed along with any fallback content.\"\n },\n \"cells\": {\n \"apple-mail.macos\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"13\"\n },\n \"gmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"gmail.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"gmail.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"gmail.mobile-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"outlook.windows\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019\"\n },\n \"outlook.windows-mail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"outlook.macos\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"16.80\"\n },\n \"outlook.outlook-com\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-01\"\n },\n \"outlook.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"outlook.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"aol.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"aol.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"aol.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"yahoo.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"yahoo.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"yahoo.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"hey.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-06\"\n },\n \"mail-ru.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"fastmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-07\"\n },\n \"gmx.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"gmx.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"web-de.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"web-de.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"ionos-1and1.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 2\n ],\n \"version\": \"2022-11\"\n },\n \"ionos-1and1.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n }\n }\n },\n \"html-form\": {\n \"title\": \"<form> element\",\n \"url\": \"https://www.caniemail.com/features/html-form/\",\n \"lastTestDate\": \"2019-09-10\",\n \"notes\": {\n \"1\": \"Does not submit in iOS with non Google accounts.\",\n \"2\": \"On submit name values are prefixed with `x_`.\",\n \"3\": \"Does not submit in preview pane, but does when the email is opened in a new window.\",\n \"4\": \"Not supported. `<form>` is transformed into `<noform>`.\",\n \"5\": \"Not supported. The `<form>` and its entire content is removed.\",\n \"6\": \"Not supported. The `<form>` is there but values are not submitted.\"\n },\n \"cells\": {\n \"gmail.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"2019-09\"\n },\n \"orange.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"orange.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"orange.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"outlook.windows\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019\"\n },\n \"outlook.windows-mail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-01\"\n },\n \"outlook.macos\": {\n \"value\": \"a\",\n \"notes\": [\n 6\n ],\n \"version\": \"16.80\"\n },\n \"outlook.outlook-com\": {\n \"value\": \"a\",\n \"notes\": [\n 6\n ],\n \"version\": \"2024-01\"\n },\n \"sfr.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 4\n ],\n \"version\": \"2020-01\"\n },\n \"yahoo.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-09\"\n },\n \"protonmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-03\"\n },\n \"protonmail.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-03\"\n },\n \"protonmail.android\": {\n \"value\": \"n\",\n \"notes\": [\n 5\n ],\n \"version\": \"2020-03\"\n },\n \"hey.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-06\"\n },\n \"mail-ru.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 6\n ],\n \"version\": \"2020-10\"\n },\n \"fastmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-07\"\n },\n \"laposte.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 4\n ],\n \"version\": \"2021-08\"\n },\n \"gmx.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"gmx.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"web-de.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"web-de.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"ionos-1and1.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"ionos-1and1.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n }\n }\n },\n \"html-object\": {\n \"title\": \"<object> element\",\n \"url\": \"https://www.caniemail.com/features/html-object/\",\n \"lastTestDate\": \"2021-02-20\",\n \"notes\": {\n \"1\": \"Partial support. Does not support Videos resources.\",\n \"2\": \"Partial support. Does not support PDF resources.\",\n \"3\": \"Not supported. `<object>` is turned into `<noobject>`.\",\n \"4\": \"Not supported. The `<object>` element and all its content is removed.\"\n },\n \"cells\": {\n \"apple-mail.macos\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"14.0\"\n },\n \"gmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"gmail.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"gmail.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"gmail.mobile-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"orange.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-03\"\n },\n \"orange.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"orange.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"outlook.windows\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019\"\n },\n \"outlook.windows-mail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"outlook.macos\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"16.80\"\n },\n \"outlook.outlook-com\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-01\"\n },\n \"outlook.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"outlook.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"samsung-email.android\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"6.1\"\n },\n \"sfr.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 3\n ],\n \"version\": \"2020-10\"\n },\n \"sfr.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"sfr.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"thunderbird.macos\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"78.7\"\n },\n \"aol.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-02\"\n },\n \"aol.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"aol.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"yahoo.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"yahoo.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"yahoo.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"protonmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"protonmail.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"protonmail.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"hey.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"mail-ru.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"fastmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 4\n ],\n \"version\": \"2021-07\"\n },\n \"laposte.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 3\n ],\n \"version\": \"2021-08\"\n },\n \"gmx.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"gmx.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 1,\n 2\n ],\n \"version\": \"2022-11\"\n },\n \"gmx.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"web-de.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"web-de.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 1,\n 2\n ],\n \"version\": \"2022-11\"\n },\n \"web-de.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"ionos-1and1.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"ionos-1and1.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n }\n }\n },\n \"html-video\": {\n \"title\": \"<video> element\",\n \"url\": \"https://www.caniemail.com/features/html-video/\",\n \"lastTestDate\": \"2019-09-16\",\n \"notes\": {\n \"1\": \"The `<video>` element is supported, but not the inner `<source>` element so no video can play.\",\n \"2\": \"`<video>`, `<source>` and `<track>` tags are replaced by `<u></u>` tags.\",\n \"3\": \"Buggy. Support depends on the version of Internet Explorer installed.\",\n \"4\": \"`<video>`, `<source>` and `<track>` tags are stripped. The fallback content is shown instead.\",\n \"5\": \"Partial support. Requires the `controls` attribute to play.\",\n \"6\": \"Partial support. `autoplay` is not supported.\",\n \"7\": \"The `<video>` element is supported and the `poster` image is visible, but the video can not play due to a strict Content Security Policy.\",\n \"8\": \"The `<video>` element is supported, but the video can not play due to a strict Content Security Policy.\",\n \"9\": \"Not supported. The `<video>` element and all its content is removed.\",\n \"10\": \"Not supported. The `src` attribute is replaced by `data-src`.\",\n \"11\": \"Partial support. The video can be played by doing a right click and play. But `autoplay` and `controls` are not supported.\"\n },\n \"cells\": {\n \"apple-mail.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 5,\n 6\n ],\n \"version\": \"13.3\"\n },\n \"gmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 2\n ],\n \"version\": \"2019-09\"\n },\n \"gmail.ios\": {\n \"value\": \"n\",\n \"notes\": [\n 2\n ],\n \"version\": \"2019-09\"\n },\n \"gmail.android\": {\n \"value\": \"n\",\n \"notes\": [\n 2\n ],\n \"version\": \"2019-09\"\n },\n \"gmail.mobile-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 2\n ],\n \"version\": \"2020-02\"\n },\n \"orange.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"orange.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"orange.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"outlook.windows\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019\"\n },\n \"outlook.windows-mail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-09\"\n },\n \"outlook.macos\": {\n \"value\": \"y\",\n \"notes\": [\n 11\n ],\n \"version\": \"16.80\"\n },\n \"outlook.outlook-com\": {\n \"value\": \"n\",\n \"notes\": [\n 8\n ],\n \"version\": \"2024-01\"\n },\n \"outlook.ios\": {\n \"value\": \"n\",\n \"notes\": [\n 8\n ],\n \"version\": \"2021-05\"\n },\n \"outlook.android\": {\n \"value\": \"n\",\n \"notes\": [\n 8\n ],\n \"version\": \"2021-05\"\n },\n \"samsung-email.android\": {\n \"value\": \"a\",\n \"notes\": [\n 5\n ],\n \"version\": \"6.0\"\n },\n \"aol.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 4\n ],\n \"version\": \"2019-09\"\n },\n \"aol.ios\": {\n \"value\": \"n\",\n \"notes\": [\n 4\n ],\n \"version\": \"2019-09\"\n },\n \"aol.android\": {\n \"value\": \"n\",\n \"notes\": [\n 4\n ],\n \"version\": \"2019-09\"\n },\n \"yahoo.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 4\n ],\n \"version\": \"2019-09\"\n },\n \"yahoo.ios\": {\n \"value\": \"n\",\n \"notes\": [\n 4\n ],\n \"version\": \"2019-09\"\n },\n \"yahoo.android\": {\n \"value\": \"n\",\n \"notes\": [\n 4\n ],\n \"version\": \"2019-09\"\n },\n \"protonmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 7\n ],\n \"version\": \"2020-03\"\n },\n \"protonmail.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-03\"\n },\n \"protonmail.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-03\"\n },\n \"hey.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-06\"\n },\n \"mail-ru.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"fastmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 9\n ],\n \"version\": \"2021-07\"\n },\n \"laposte.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 10\n ],\n \"version\": \"2021-08\"\n },\n \"gmx.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"gmx.ios\": {\n \"value\": \"y\",\n \"notes\": [\n 5,\n 6\n ],\n \"version\": \"2022-11\"\n },\n \"gmx.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"web-de.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"web-de.ios\": {\n \"value\": \"y\",\n \"notes\": [\n 5,\n 6\n ],\n \"version\": \"2022-11\"\n },\n \"web-de.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"ionos-1and1.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 9\n ],\n \"version\": \"2022-11\"\n },\n \"ionos-1and1.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n }\n }\n },\n \"html-audio\": {\n \"title\": \"<audio> element\",\n \"url\": \"https://www.caniemail.com/features/html-audio/\",\n \"lastTestDate\": \"2020-04-21\",\n \"notes\": {\n \"1\": \"Does not play.\",\n \"2\": \"The `src` attribute is transformed into `proton-src`.\",\n \"3\": \"The `<audio>` element is supported but can not be played.\",\n \"4\": \"The `<audio>` element is supported, but the video can not play due to a strict Content Security Policy.\",\n \"5\": \"Not supported. The `<audio>` element and all its content is removed.\",\n \"6\": \"Not supported. The `src` attribute is replaced by `data-src`.\"\n },\n \"cells\": {\n \"gmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-04\"\n },\n \"gmail.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-04\"\n },\n \"gmail.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-04\"\n },\n \"gmail.mobile-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-04\"\n },\n \"orange.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"orange.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"orange.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-04\"\n },\n \"outlook.windows\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019\"\n },\n \"outlook.windows-mail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-04\"\n },\n \"outlook.macos\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"16.80\"\n },\n \"outlook.outlook-com\": {\n \"value\": \"n\",\n \"notes\": [\n 4\n ],\n \"version\": \"2024-01\"\n },\n \"outlook.ios\": {\n \"value\": \"n\",\n \"notes\": [\n 4\n ],\n \"version\": \"2021-05\"\n },\n \"outlook.android\": {\n \"value\": \"n\",\n \"notes\": [\n 4\n ],\n \"version\": \"2021-05\"\n },\n \"aol.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-04\"\n },\n \"aol.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-04\"\n },\n \"aol.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-04\"\n },\n \"yahoo.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-04\"\n },\n \"yahoo.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-04\"\n },\n \"yahoo.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-04\"\n },\n \"protonmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 2\n ],\n \"version\": \"2020-04\"\n },\n \"protonmail.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-04\"\n },\n \"protonmail.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-04\"\n },\n \"hey.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-06\"\n },\n \"mail-ru.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-10\"\n },\n \"fastmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 5\n ],\n \"version\": \"2021-07\"\n },\n \"laposte.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 6\n ],\n \"version\": \"2021-08\"\n },\n \"gmx.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"gmx.ios\": {\n \"value\": \"n\",\n \"notes\": [\n 3\n ],\n \"version\": \"2022-11\"\n },\n \"gmx.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"web-de.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"web-de.ios\": {\n \"value\": \"n\",\n \"notes\": [\n 3\n ],\n \"version\": \"2022-11\"\n },\n \"web-de.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2022-11\"\n },\n \"ionos-1and1.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 5\n ],\n \"version\": \"2022-11\"\n }\n }\n },\n \"css-width\": {\n \"title\": \"width property\",\n \"url\": \"https://www.caniemail.com/features/css-width/\",\n \"lastTestDate\": \"2019-09-27\",\n \"notes\": {\n \"1\": \"Partial. Not supported on `<body>`, `<span>`, `<div>`, `<p>` or `<img>` elements.\",\n \"2\": \"Buggy. The webmail has a generic style that sets `table { width:inherit; }`.\"\n },\n \"cells\": {\n \"outlook.windows\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"2019\"\n },\n \"laposte.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"2021-08\"\n }\n }\n },\n \"css-max-width\": {\n \"title\": \"max-width\",\n \"url\": \"https://www.caniemail.com/features/css-max-width/\",\n \"lastTestDate\": \"2019-08-02\",\n \"notes\": {\n \"1\": \"Partial. Only works on `<table>` elements.\",\n \"2\": \"Partial. Doesn't work on `<table>` elements, as per [CSS 2.1 specification](https://www.w3.org/TR/CSS2/visudet.html#min-max-widths).\"\n },\n \"cells\": {\n \"outlook.windows\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"2019\"\n },\n \"outlook.windows-mail\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"2020-01\"\n }\n }\n },\n \"css-float\": {\n \"title\": \"float\",\n \"url\": \"https://www.caniemail.com/features/css-float/\",\n \"lastTestDate\": \"2024-05-08\",\n \"notes\": {\n \"1\": \"Not supported. `table` and `img` elements can use an `align` attribute to get a similar effect.\",\n \"2\": \"Partial. Logical property values `inline-start` and `inline-end` are not supported.\"\n },\n \"cells\": {\n \"gmail.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"2024-05\"\n },\n \"gmail.android\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"2024-05\"\n },\n \"outlook.windows\": {\n \"value\": \"n\",\n \"notes\": [\n 1\n ],\n \"version\": \"2019\"\n },\n \"outlook.windows-mail\": {\n \"value\": \"n\",\n \"notes\": [\n 1\n ],\n \"version\": \"2019-02\"\n },\n \"yahoo.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"2024-05\"\n },\n \"yahoo.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"2024-05\"\n },\n \"yahoo.android\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"2024-05\"\n },\n \"aol.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"2024-05\"\n },\n \"aol.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"2024-05\"\n },\n \"aol.android\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"2024-05\"\n },\n \"gmx.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"2024-05\"\n },\n \"web-de.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 2\n ],\n \"version\": \"2024-05\"\n }\n }\n },\n \"css-background-image\": {\n \"title\": \"background-image\",\n \"url\": \"https://www.caniemail.com/features/css-background-image/\",\n \"lastTestDate\": \"2023-07-24\",\n \"notes\": {\n \"1\": \"Partial. Not supported with non Google accounts.\",\n \"2\": \"Buggy. Requires at least one `<img>` element in the email to download all images.\",\n \"3\": \"Partial. Does not support multiple values. The comma between two values is removed.\",\n \"4\": \"Partial. Images URL must be between quotes.\",\n \"5\": \"Background images can be used in VML. See [backgrounds.cm](https://backgrounds.cm/) and [VML documentation](https://docs.microsoft.com/en-us/windows/win32/vml/web-workshop---how-to-use-vml-on-web-pages-----fill--element).\",\n \"6\": \"Partial and buggy. Removes the entire `style` attribute or `<style>` tag when a `url()` function with a valid image URL is present. See [Gmail rolling out changes that strip CSS with background images](https://freshinbox.com/blog/gmail-rolling-out-changes-that-strip-background-image-css/) and [Gmail and background images](https://parcel.io/blog/gmail-and-background-images).\"\n },\n \"cells\": {\n \"outlook.windows\": {\n \"value\": \"n\",\n \"notes\": [\n 5\n ],\n \"version\": \"2019\"\n },\n \"outlook.windows-mail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2019-02\"\n },\n \"yahoo.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2021-10\"\n },\n \"yahoo.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2021-10\"\n },\n \"yahoo.android\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2021-10\"\n },\n \"aol.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2021-10\"\n },\n \"aol.ios\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2021-10\"\n },\n \"aol.android\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2021-10\"\n },\n \"t-online-de.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-11\"\n },\n \"free-fr.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2021-11\"\n },\n \"gmx.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2022-06\"\n },\n \"web-de.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2022-06\"\n }\n }\n },\n \"image-base64\": {\n \"title\": \"Base 64 image format\",\n \"url\": \"https://www.caniemail.com/features/image-base64/\",\n \"lastTestDate\": \"2020-02-06\",\n \"notes\": {\n \"1\": \"Partial: Does not render Base 64 gif format.\",\n \"2\": \"Not supported. The `src` is turned into a `nosrc` attribute.\",\n \"3\": \"Partial: Only supports Base 64 png format.\"\n },\n \"cells\": {\n \"gmail.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2024-05\"\n },\n \"gmail.ios\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"gmail.android\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"gmail.mobile-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"outlook.windows\": {\n \"value\": \"a\",\n \"notes\": [\n 1\n ],\n \"version\": \"2019\"\n },\n \"outlook.windows-mail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-02\"\n },\n \"sfr.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 2\n ],\n \"version\": \"2020-02\"\n },\n \"hey.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [],\n \"version\": \"2020-06\"\n },\n \"laposte.desktop-webmail\": {\n \"value\": \"n\",\n \"notes\": [\n 2\n ],\n \"version\": \"2021-08\"\n },\n \"gmx.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2022-09\"\n },\n \"web-de.desktop-webmail\": {\n \"value\": \"a\",\n \"notes\": [\n 3\n ],\n \"version\": \"2022-09\"\n }\n }\n }\n} as const;\n","[\n \"css-display-flex\",\n \"css-display-grid\",\n \"css-position\",\n \"css-variables\",\n \"css-at-import\",\n \"html-link\",\n \"html-style\",\n \"html-svg\",\n \"html-form\",\n \"html-object\",\n \"html-video\",\n \"html-audio\",\n \"css-width\",\n \"css-max-width\",\n \"css-float\",\n \"css-background-image\",\n \"image-base64\"\n]\n","import { Parser } from \"htmlparser2\";\nimport type { Block } from \"@templatical/types\";\n\nexport interface TagMatch {\n tag: string;\n attrs: Record<string, string>;\n}\n\nexport interface CssMatch {\n prop: string;\n value: string;\n tag: string;\n attrs: Record<string, string>;\n inline: boolean;\n group: string;\n}\n\nexport interface Scan {\n tags: TagMatch[];\n css: CssMatch[];\n cssTexts: string[];\n urls: string[];\n}\n\n/** Drops `/* … *\\/` comments in one linear pass; an unterminated comment drops the rest. */\nexport function stripCssComments(css: string): string {\n let out = \"\";\n let i = 0;\n for (;;) {\n const open = css.indexOf(\"/*\", i);\n if (open === -1) return out + css.slice(i);\n out += css.slice(i, open);\n const close = css.indexOf(\"*/\", open + 2);\n if (close === -1) return out;\n i = close + 2;\n }\n}\n\n/**\n * Remove `url(...)` and quoted strings so the class scan can't read `.png` or\n * `\"x.y\"` as a selector. Linear: each opener's next position is searched for\n * again only once the cursor has passed it, so an opener that never closes\n * costs one scan, not one per occurrence. An unterminated `url(` or quote\n * drops the rest, as a CSS parser would.\n */\nexport function stripCssUrlsAndStrings(css: string): string {\n const lower = css.toLowerCase();\n const next = (needle: string, from: number) => {\n const at = lower.indexOf(needle, from);\n return at === -1 ? Infinity : at;\n };\n const closers: Record<string, string> = { \"url(\": \")\", '\"': '\"', \"'\": \"'\" };\n const pos: Record<string, number> = { \"url(\": 0, '\"': 0, \"'\": 0 };\n for (const k of Object.keys(pos)) pos[k] = next(k, 0);\n let out = \"\";\n let i = 0;\n for (;;) {\n let opener = \"\";\n let open = Infinity;\n for (const k of Object.keys(pos)) {\n if (pos[k] < i) pos[k] = next(k, i);\n if (pos[k] < open) {\n open = pos[k];\n opener = k;\n }\n }\n if (open === Infinity) return out + css.slice(i);\n out += css.slice(i, open);\n let close = lower.indexOf(closers[opener], open + opener.length);\n if (opener !== \"url(\") {\n let cursor = open + 1;\n while (cursor < css.length) {\n if (css[cursor] === \"\\\\\") {\n cursor += 2;\n } else if (css[cursor] === opener) {\n close = cursor;\n break;\n } else {\n cursor++;\n }\n }\n if (cursor >= css.length) close = -1;\n }\n if (close === -1) return out;\n i = close + 1;\n }\n}\n\nexport function declarations(\n css: string,\n tag: string,\n attrs: Record<string, string>,\n inline: boolean,\n group: string,\n): CssMatch[] {\n const out: CssMatch[] = [];\n // Keep only a data URL's media type in values retained for issue excerpts.\n // This also keeps the semicolon in `;base64` from splitting a declaration.\n const text = stripCssComments(css).replace(\n /data:([\\w.+-]+\\/[\\w.+-]+)[^)\"']*/gi,\n \"data:$1\",\n );\n const expression = /(?:^|[;{])\\s*([\\w-]+)\\s*:\\s*([^;}]+)/g;\n for (const match of text.matchAll(expression)) {\n out.push({\n prop: match[1].toLowerCase(),\n value: match[2].trim(),\n tag,\n attrs,\n inline,\n group,\n });\n }\n return out;\n}\n\nexport function scanHtml(\n html: string,\n stylesheet = \"\",\n urls: string[] = [],\n): Scan {\n const scan: Scan = { tags: [], css: [], cssTexts: [], urls: [...urls] };\n let inStyle = false;\n let styleText = \"\";\n let cssSource = 0;\n const addCss = (\n css: string,\n tag: string,\n attrs: Record<string, string>,\n inline: boolean,\n ) => {\n scan.cssTexts.push(stripCssComments(css));\n const source = cssSource++;\n if (inline) {\n scan.css.push(...declarations(css, tag, attrs, true, `${source}`));\n } else {\n for (const [index, segment] of css.split(\"}\").entries()) {\n scan.css.push(\n ...declarations(segment, tag, attrs, false, `${source}:${index}`),\n );\n }\n }\n };\n const parser = new Parser(\n {\n onopentag(tag, attrs) {\n scan.tags.push({ tag, attrs });\n if (attrs.style) addCss(attrs.style, tag, attrs, true);\n if (tag === \"img\" && attrs.src) scan.urls.push(attrs.src);\n if (attrs.background) scan.urls.push(attrs.background);\n if (tag === \"style\") {\n inStyle = true;\n styleText = \"\";\n }\n },\n ontext(text) {\n if (inStyle) styleText += text;\n },\n onclosetag(tag) {\n if (tag === \"style\") {\n inStyle = false;\n addCss(styleText, \"style\", {}, false);\n }\n },\n },\n { decodeEntities: true },\n );\n parser.end(html);\n if (stylesheet) addCss(stylesheet, \"stylesheet\", {}, false);\n return scan;\n}\n\nexport function scanBlock(block: Block): Scan {\n const html: string[] = [];\n const stylesheets: string[] = [];\n const urls: string[] = [];\n switch (block.type) {\n case \"html\":\n case \"paragraph\":\n case \"title\":\n html.push(block.content);\n break;\n case \"table\":\n for (const row of block.rows)\n for (const cell of row.cells) html.push(cell.content);\n break;\n case \"custom\":\n if (block.renderedHtml) html.push(block.renderedHtml);\n if (block.renderedStylesheet) stylesheets.push(block.renderedStylesheet);\n break;\n case \"image\":\n urls.push(block.src);\n break;\n case \"video\":\n urls.push(block.thumbnailUrl);\n break;\n case \"section\":\n if (block.backgroundImage) urls.push(block.backgroundImage.url);\n if (block.wrapper?.backgroundImage)\n urls.push(block.wrapper.backgroundImage.url);\n break;\n case \"wrapper\":\n if (block.backgroundImage) urls.push(block.backgroundImage.url);\n break;\n }\n return scanHtml(html.join(\"\\n\"), stylesheets.join(\"\\n\"), urls);\n}\n","import type { Scan, CssMatch } from \"./scan\";\nimport { stripCssUrlsAndStrings } from \"./scan\";\n\nexport interface Detection {\n excerpt: string;\n usage?: string;\n value?: string;\n tag?: string;\n}\n\nconst clean = (value: string): string =>\n value.replace(/\\s+/g, \" \").trim().slice(0, 80);\nconst cssExcerpt = ({ prop, value }: CssMatch) => clean(`${prop}: ${value}`);\nconst element = (tag: string) => `<${tag}>`;\nconst colorValue = /#[0-9a-f]{3,8}\\b|\\b(?:rgba?|hsla?)\\(/i;\n\nfunction imageMedia(value: string): string | null {\n const match = /^\\s*data:(image\\/[\\w.+-]+)/i.exec(value);\n return match ? match[1].toLowerCase() : null;\n}\n\nfunction backgroundWithoutFallback(scan: Scan): CssMatch | undefined {\n const sources = new Map<string, CssMatch[]>();\n for (const declaration of scan.css) {\n const key = declaration.group;\n sources.set(key, [...(sources.get(key) ?? []), declaration]);\n }\n for (const declarations of sources.values()) {\n const image = declarations.find(\n (d) =>\n (d.prop === \"background\" || d.prop === \"background-image\") &&\n /url\\(/i.test(d.value),\n );\n if (!image || \"bgcolor\" in image.attrs) continue;\n const fallback = declarations.some(\n (d) =>\n d.prop === \"background-color\" ||\n (d.prop === \"background\" &&\n colorValue.test(stripCssUrlsAndStrings(d.value))),\n );\n if (!fallback) return image;\n }\n}\n\nexport function detect(scan: Scan, id: string): Detection | null {\n const css = scan.css;\n const tags = scan.tags;\n let match: CssMatch | undefined;\n let tag: string | undefined;\n switch (id) {\n case \"compat.css-display-flex\":\n case \"compat.css-display-grid\": {\n const kind = id.endsWith(\"flex\") ? \"flex\" : \"grid\";\n match = css.find(\n (d) =>\n d.prop === \"display\" &&\n new RegExp(`^(?:inline-)?${kind}\\\\b`, \"i\").test(d.value),\n );\n return match\n ? {\n excerpt: cssExcerpt(match),\n usage: match.value\n .match(/^(?:inline-)?(?:flex|grid)/i)?.[0]\n .toLowerCase(),\n }\n : null;\n }\n case \"compat.css-position\":\n match = css.find(\n (d) =>\n d.prop === \"position\" && /^(absolute|fixed|sticky)\\b/i.test(d.value),\n );\n return match\n ? {\n excerpt: cssExcerpt(match),\n usage: match.value.match(/^\\w+/)?.[0].toLowerCase(),\n value: match.value.match(/^\\w+/)?.[0].toLowerCase(),\n }\n : null;\n case \"compat.css-variables\":\n match = css.find((d) =>\n /\\bvar\\(\\s*--/i.test(stripCssUrlsAndStrings(d.value)),\n );\n return match ? { excerpt: cssExcerpt(match) } : null;\n case \"compat.css-at-import\":\n return scan.cssTexts.some((text) =>\n /@import\\b/i.test(stripCssUrlsAndStrings(text)),\n )\n ? { excerpt: \"@import\" }\n : null;\n case \"compat.html-link\":\n return tags.some(\n (t) =>\n t.tag === \"link\" &&\n /(?:^|\\s)stylesheet(?:\\s|$)/i.test(t.attrs.rel ?? \"\"),\n )\n ? { excerpt: '<link rel=\"stylesheet\">' }\n : null;\n case \"compat.html-style\":\n case \"compat.html-svg\":\n case \"compat.html-object\":\n case \"compat.html-video\":\n case \"compat.html-audio\":\n case \"compat.html-script\":\n case \"compat.html-iframe\":\n tag = id.slice(12);\n return tags.some((t) => t.tag === tag) ? { excerpt: element(tag) } : null;\n case \"compat.html-form\":\n tag = tags.find((t) =>\n [\"form\", \"input\", \"select\", \"textarea\"].includes(t.tag),\n )?.tag;\n return tag ? { excerpt: element(tag) } : null;\n case \"compat.css-width\":\n match = css.find(\n (d) =>\n d.inline &&\n d.prop === \"width\" &&\n ([\"div\", \"p\", \"span\", \"body\"].includes(d.tag) ||\n (d.tag === \"img\" && !(\"width\" in d.attrs))),\n );\n return match ? { excerpt: cssExcerpt(match), tag: match.tag } : null;\n case \"compat.css-max-width\":\n match = css.find(\n (d) => d.inline && d.prop === \"max-width\" && d.tag !== \"table\",\n );\n return match ? { excerpt: cssExcerpt(match), tag: match.tag } : null;\n case \"compat.css-float\":\n match = css.find((d) => d.prop === \"float\");\n return match ? { excerpt: cssExcerpt(match), tag: match.tag } : null;\n case \"compat.css-background-image\":\n match = backgroundWithoutFallback(scan);\n return match ? { excerpt: cssExcerpt(match) } : null;\n case \"compat.image-base64\": {\n const cssUrls = scan.cssTexts.flatMap((text) =>\n [...text.matchAll(/url\\(\\s*['\"]?\\s*(data:image\\/[\\w.+-]+)/gi)].map(\n (match) => match[1],\n ),\n );\n const candidate = [...scan.urls, ...cssUrls]\n .map(imageMedia)\n .find((v) => v !== null);\n return candidate\n ? { excerpt: `data:${candidate}`, usage: candidate }\n : null;\n }\n default:\n return null;\n }\n}\n","import {\n CANIEMAIL_DATA,\n CANIEMAIL_NICENAMES,\n} from \"./data/caniemail.generated\";\nimport pinnedNotes from \"./pinned-notes.json\";\nimport type { ClientSupport } from \"../types\";\n\ntype Feature = {\n url: string;\n lastTestDate: string;\n notes: Record<string, string>;\n cells: Record<\n string,\n { value: \"y\" | \"a\" | \"n\"; notes: readonly number[]; version: string }\n >;\n};\n\nexport const FEATURES: Record<string, Feature> = CANIEMAIL_DATA;\n\n/**\n * Pinned notes narrow the support verdict for the detected usage; their\n * predicates are in `noteExcludes`. The text lives in JSON so the caniemail\n * freshness report (scripts/caniemail-report.mjs) can flag a changed note.\n */\nexport const PINNED_NOTES: Record<string, Record<number, string>> = pinnedNotes;\n\nconst familyOrder = [\n \"gmail\",\n \"outlook\",\n \"apple-mail\",\n \"yahoo\",\n \"samsung-email\",\n];\nconst familyNames: Record<string, string> = CANIEMAIL_NICENAMES.family;\nconst platformNames: Record<string, string> = CANIEMAIL_NICENAMES.platform;\n\nfunction noteExcludes(slug: string, note: number, usage: string): boolean {\n switch (slug) {\n case \"css-display-flex\":\n return note === 2 && usage === \"inline-flex\";\n case \"css-position\": {\n const supported: Record<number, string[]> = {\n 1: [\"relative\", \"absolute\"],\n 2: [\"sticky\"],\n 3: [\"relative\"],\n 4: [\"relative\", \"sticky\"],\n };\n return supported[note] !== undefined && !supported[note].includes(usage);\n }\n case \"html-style\":\n return note === 1;\n case \"css-width\":\n return note === 1;\n case \"css-max-width\":\n return note === 1;\n case \"image-base64\":\n return (\n (note === 1 && usage === \"image/gif\") ||\n (note === 3 && usage !== \"image/png\")\n );\n default:\n return false;\n }\n}\n\nexport function supportFor(slug: string, usage = \"\"): ClientSupport[] {\n const feature = FEATURES[slug];\n if (!feature) return [];\n const clients: ClientSupport[] = [];\n for (const [id, cell] of Object.entries(feature.cells)) {\n const dot = id.indexOf(\".\");\n const family = id.slice(0, dot);\n const platform = id.slice(dot + 1);\n const narrowed = cell.notes.some((note) => noteExcludes(slug, note, usage));\n const support =\n narrowed || cell.value === \"n\"\n ? \"unsupported\"\n : cell.value === \"a\"\n ? \"partial\"\n : null;\n if (!support) continue;\n const familyName = familyNames[family] ?? family;\n const platformName = platformNames[platform] ?? platform;\n clients.push({\n id,\n name: platformName.toLowerCase().includes(familyName.toLowerCase())\n ? platformName\n : `${familyName} ${platformName}`,\n support,\n notes: cell.notes\n .map((n) => feature.notes[String(n)])\n .filter((note): note is string => !!note),\n testedAt: feature.lastTestDate,\n });\n }\n return clients;\n}\n\n/** Group a bucket of clients by family, with priority families first. */\nexport function formatClientGroups(\n clients: ClientSupport[],\n bucket: ClientSupport[\"support\"],\n locale: string,\n): string {\n const allByFamily = new Map<string, ClientSupport[]>();\n const selected = new Map<string, ClientSupport[]>();\n for (const client of clients) {\n const family = client.id.split(\".\")[0];\n allByFamily.set(family, [...(allByFamily.get(family) ?? []), client]);\n if (client.support === bucket)\n selected.set(family, [...(selected.get(family) ?? []), client]);\n }\n const families = [...selected.keys()].sort((a, b) => {\n const ai = familyOrder.indexOf(a);\n const bi = familyOrder.indexOf(b);\n if (ai !== bi) return (ai < 0 ? Infinity : ai) - (bi < 0 ? Infinity : bi);\n return (familyNames[a] ?? a).localeCompare(familyNames[b] ?? b);\n });\n const groups = families.map((family) => {\n const name = familyNames[family] ?? family;\n const members = selected.get(family)!;\n if (members.length === allByFamily.get(family)!.length) return name;\n const platforms = members.map(\n (client) => platformNames[client.id.split(\".\")[1]] ?? client.name,\n );\n return `${name} (${platforms.join(\", \")})`;\n });\n const limited = groups.slice(0, 4);\n if (groups.length > 4)\n limited.push(\n `${groups.length - 4} ${locale.startsWith(\"de\") ? \"weitere\" : \"more\"}`,\n );\n return new Intl.ListFormat(locale.startsWith(\"de\") ? \"de\" : \"en\", {\n type: \"conjunction\",\n }).format(limited);\n}\n","import type en from \"./en\";\n\nconst de: typeof en = {\n templates: {\n unsupported: \"{feature} funktioniert in {unsupported} nicht.\",\n partial: \"{feature} funktioniert in {partial} nur teilweise.\",\n mixed:\n \"{feature} funktioniert in {unsupported} nicht und in {partial} nur teilweise.\",\n },\n more: \"{n} weitere\",\n features: {\n \"css-display-flex\": {\n feature: \"Flex-Layout ({excerpt})\",\n suggestion:\n \"Ordne den Inhalt mit einer Sektion und Spalten oder mit einer Tabelle an.\",\n },\n \"css-display-grid\": {\n feature: \"Grid-Layout ({excerpt})\",\n suggestion:\n \"Ordne den Inhalt mit einer Sektion und Spalten oder mit einer Tabelle an.\",\n },\n \"css-position\": {\n feature: \"position: {value}\",\n suggestion:\n \"Entferne die Positionierung und ordne den Inhalt mit einer Sektion und Spalten oder mit einer Tabelle an.\",\n },\n \"css-variables\": {\n feature: \"Eine CSS-Variable (var(--…))\",\n suggestion: \"Schreibe den Wert direkt statt var(--…).\",\n },\n \"css-at-import\": {\n feature: \"Die @import-Regel\",\n suggestion: \"Schreibe die Regeln direkt in style-Attribute.\",\n },\n \"html-link\": {\n feature: 'Ein externes Stylesheet (<link rel=\"stylesheet\">)',\n suggestion: \"Schreibe die Stile direkt in style-Attribute.\",\n },\n \"html-style\": {\n feature: \"Ein <style>-Element im E-Mail-Body\",\n suggestion: \"Schreibe die Regeln direkt in style-Attribute.\",\n },\n \"html-svg\": {\n feature: \"Ein eingebettetes <svg>-Element\",\n suggestion: \"Verwende stattdessen ein PNG- oder JPEG-Bild.\",\n },\n \"html-form\": {\n feature: \"Ein Formular (<form>, <input>, <select> oder <textarea>)\",\n suggestion: \"Verlinke stattdessen ein Formular auf einer Webseite.\",\n },\n \"html-object\": {\n feature: \"Das <object>-Element\",\n suggestion: \"Verwende stattdessen ein Bild, das auf den Inhalt verlinkt.\",\n },\n \"html-video\": {\n feature: \"Das <video>-Element\",\n suggestion: \"Verwende den Video-Block mit verlinktem Vorschaubild.\",\n },\n \"html-audio\": {\n feature: \"Das <audio>-Element\",\n suggestion: \"Verlinke die Audiodatei oder eine Seite, die sie abspielt.\",\n },\n \"css-width\": {\n feature: \"width auf einem <{tag}>-Element\",\n suggestion:\n \"Setze die Breite auf einer Tabellenzelle oder verwende bei Bildern das width-Attribut.\",\n },\n \"css-max-width\": {\n feature: \"max-width auf einem <{tag}>-Element\",\n suggestion: \"Setze max-width stattdessen auf eine Tabelle.\",\n },\n \"css-float\": {\n feature: \"Eine float-Deklaration ({excerpt}, Quelle: {tag})\",\n suggestion:\n \"Verwende align auf einer Tabelle oder einem Bild oder eine Sektion mit Spalten.\",\n },\n \"css-background-image\": {\n feature: \"Ein Hintergrundbild ohne Ersatzfarbe\",\n suggestion:\n \"Ergänze background-color (oder bgcolor), damit der Text lesbar bleibt.\",\n },\n \"image-base64\": {\n feature: \"Ein Base64-Bild ({excerpt})\",\n suggestion: \"Lade das Bild hoch und verwende seine URL.\",\n },\n },\n hand: {\n \"compat.html-script\": {\n message:\n \"E-Mail-Clients führen kein JavaScript aus, daher bewirkt dieses <script>-Element nichts.\",\n suggestion: \"Entferne das <script>-Element.\",\n },\n \"compat.html-iframe\": {\n message:\n \"Die meisten E-Mail-Clients blockieren <iframe>-Elemente, daher erscheint dieser Inhalt nicht.\",\n suggestion:\n \"Verlinke den Inhalt stattdessen, zum Beispiel mit einem Bild.\",\n },\n \"compat.gmail-clipping\": {\n message:\n \"Das HTML dieser E-Mail ist {size} KB groß. Gmail schneidet Nachrichten ab etwa 102 KB ab und zeigt den Rest erst nach einem Klick; Versanddienste ergänzen Tracking-Links, bevor Gmail misst.\",\n suggestion:\n \"Bleibe unter {max} KB: Kürze den Inhalt, verschiebe lange Abschnitte auf eine Webseite oder ersetze Base64-Bilder durch gehostete Bilder.\",\n },\n },\n};\n\nexport default de;\n","const en = {\n templates: {\n unsupported: \"{feature} doesn't work in {unsupported}.\",\n partial: \"{feature} only partly works in {partial}.\",\n mixed:\n \"{feature} doesn't work in {unsupported} and only partly works in {partial}.\",\n },\n more: \"{n} more\",\n features: {\n \"css-display-flex\": {\n feature: \"Flex layout ({excerpt})\",\n suggestion:\n \"Lay the content out with a section and columns, or with a table.\",\n },\n \"css-display-grid\": {\n feature: \"Grid layout ({excerpt})\",\n suggestion:\n \"Lay the content out with a section and columns, or with a table.\",\n },\n \"css-position\": {\n feature: \"position: {value}\",\n suggestion:\n \"Remove the positioning and lay the content out with a section and columns, or with a table.\",\n },\n \"css-variables\": {\n feature: \"A CSS variable (var(--…))\",\n suggestion: \"Write the value itself instead of var(--…).\",\n },\n \"css-at-import\": {\n feature: \"The @import rule\",\n suggestion: \"Inline the rules as style attributes.\",\n },\n \"html-link\": {\n feature: 'An external stylesheet (<link rel=\"stylesheet\">)',\n suggestion: \"Inline the styles as style attributes.\",\n },\n \"html-style\": {\n feature: \"A <style> element in the email body\",\n suggestion: \"Inline the rules as style attributes.\",\n },\n \"html-svg\": {\n feature: \"An inline <svg> element\",\n suggestion: \"Use a PNG or JPEG image instead.\",\n },\n \"html-form\": {\n feature: \"A form (<form>, <input>, <select> or <textarea>)\",\n suggestion: \"Link to a form on a web page instead.\",\n },\n \"html-object\": {\n feature: \"The <object> element\",\n suggestion: \"Use an image that links to the content instead.\",\n },\n \"html-video\": {\n feature: \"The <video> element\",\n suggestion: \"Use the Video block, which shows a linked thumbnail.\",\n },\n \"html-audio\": {\n feature: \"The <audio> element\",\n suggestion: \"Link to the audio file or a page that plays it.\",\n },\n \"css-width\": {\n feature: \"width on a <{tag}> element\",\n suggestion:\n \"Set the width on a table cell, or use the width attribute on images.\",\n },\n \"css-max-width\": {\n feature: \"max-width on a <{tag}> element\",\n suggestion: \"Put the max-width on a table instead.\",\n },\n \"css-float\": {\n feature: \"A float declaration ({excerpt}, source: {tag})\",\n suggestion: \"Use align on a table or image, or a section with columns.\",\n },\n \"css-background-image\": {\n feature: \"A background image without a fallback color\",\n suggestion:\n \"Add a background-color (or bgcolor) the text stays readable on.\",\n },\n \"image-base64\": {\n feature: \"A base64 image ({excerpt})\",\n suggestion: \"Upload the image and use its URL.\",\n },\n },\n hand: {\n \"compat.html-script\": {\n message:\n \"Email clients don't run JavaScript, so this <script> element does nothing.\",\n suggestion: \"Remove the <script> element.\",\n },\n \"compat.html-iframe\": {\n message:\n \"Most email clients block <iframe> elements, so this content doesn't show.\",\n suggestion: \"Link to the content instead, for example with an image.\",\n },\n \"compat.gmail-clipping\": {\n message:\n \"This email's HTML is {size} KB. Gmail clips messages over about 102 KB and shows the rest only after a click, and sending services add tracking links before Gmail measures.\",\n suggestion:\n \"Bring it under {max} KB: shorten the content, move long sections to a web page, or replace base64 images with hosted ones.\",\n },\n },\n};\n\nexport default en;\n","import en from \"./en\";\nimport { formatMessagePair, type FormattedMessage } from \"../../format-message\";\n\nexport type CompatibilityMessageMap = typeof en;\n\nconst modules = import.meta.glob<{ default: CompatibilityMessageMap }>(\n \"./*.ts\",\n { eager: true },\n);\nconst MESSAGES: Record<string, CompatibilityMessageMap> = {};\nfor (const path in modules) {\n MESSAGES[path.slice(2, -3)] = modules[path].default;\n}\n\nexport const SUPPORTED_COMPATIBILITY_MESSAGE_LOCALES = Object.keys(MESSAGES);\n\nexport function getCompatibilityMessages(\n locale: string,\n): CompatibilityMessageMap {\n const base = locale.split(\"-\")[0]?.toLowerCase() ?? \"en\";\n return MESSAGES[base] ?? MESSAGES.en ?? en;\n}\n\nexport function formatCompatibilityMessage(\n locale: string,\n ruleId: string,\n params: Record<string, string | number> = {},\n): FormattedMessage {\n const map = getCompatibilityMessages(locale);\n const hand = (map.hand as Record<string, FormattedMessage>)[ruleId];\n if (hand) return formatMessagePair(hand, params);\n const slug = ruleId.slice(\"compat.\".length);\n const entry = (\n map.features as Record<string, { feature: string; suggestion: string }>\n )[slug];\n if (!entry) throw new Error(`Missing compatibility message: ${ruleId}`);\n const kind =\n params.unsupported && params.partial\n ? \"mixed\"\n : params.unsupported\n ? \"unsupported\"\n : \"partial\";\n const feature = formatMessagePair(\n { message: entry.feature, suggestion: entry.suggestion },\n params,\n );\n return formatMessagePair(\n {\n message: map.templates[kind],\n suggestion: feature.suggestion,\n },\n { ...params, feature: feature.message },\n );\n}\n","import type { Block, TemplateContent } from \"@templatical/types\";\nimport type {\n CompatibilityLintOptions,\n LintIssue,\n LintOptions,\n Rule,\n Severity,\n} from \"../types\";\nimport { DEFAULT_COMPATIBILITY_THRESHOLDS } from \"../types\";\nimport { walkBlocks } from \"../walk\";\nimport { resolveCompatibilityOptions } from \"../run-rules\";\nimport { CANIEMAIL_DATA } from \"./data/caniemail.generated\";\nimport slugs from \"./slugs.json\";\nimport { detect } from \"./detect\";\nimport { scanBlock, scanHtml, type Scan } from \"./scan\";\nimport { formatClientGroups, supportFor } from \"./support\";\nimport { formatCompatibilityMessage } from \"./messages\";\n\nexport {\n formatCompatibilityMessage,\n getCompatibilityMessages,\n SUPPORTED_COMPATIBILITY_MESSAGE_LOCALES,\n} from \"./messages\";\nexport type { CompatibilityMessageMap } from \"./messages\";\n\nconst catalog =\n \"https://docs.templatical.com/quality/compatibility/rule-catalog\";\nconst handRules = [\"html-script\", \"html-iframe\"] as const;\nconst dataRules: Rule[] = slugs.map((slug) => ({\n meta: {\n id: `compat.${slug}`,\n severity: \"warning\",\n reference: CANIEMAIL_DATA[slug as keyof typeof CANIEMAIL_DATA].url,\n },\n}));\n\nexport const COMPATIBILITY_RULES: Rule[] = [\n ...dataRules,\n ...handRules.map((slug): Rule => ({\n meta: {\n id: `compat.${slug}`,\n severity: \"warning\",\n reference: `${catalog}#compat-${slug}`,\n },\n })),\n {\n meta: {\n id: \"compat.gmail-clipping\",\n severity: \"warning\",\n reference: `${catalog}#compat-gmail-clipping`,\n },\n compiledHtml(html, opts) {\n const bytes = new TextEncoder().encode(html).byteLength;\n return bytes > opts.compatibility.maxHtmlBytes\n ? [\n {\n blockId: null,\n params: {\n size: new Intl.NumberFormat(opts.locale, {\n minimumFractionDigits: 1,\n maximumFractionDigits: 1,\n }).format(bytes / 1024),\n max: new Intl.NumberFormat(opts.locale, {\n minimumFractionDigits: 1,\n maximumFractionDigits: 1,\n }).format(opts.compatibility.maxHtmlBytes / 1024),\n },\n },\n ]\n : [];\n },\n },\n];\n\nfunction lintScan(\n scan: Scan,\n blockId: string | null,\n options: LintOptions,\n): LintIssue[] {\n const tool = options.compatibility || {};\n const resolved = resolveCompatibilityOptions(\n options.locale,\n tool,\n COMPATIBILITY_RULES,\n );\n const issues: LintIssue[] = [];\n for (const rule of COMPATIBILITY_RULES) {\n const id = rule.meta.id;\n if (id === \"compat.gmail-clipping\" || resolved.severity(id) === \"off\")\n continue;\n const finding = detect(scan, id);\n if (!finding) continue;\n const hand = id === \"compat.html-script\" || id === \"compat.html-iframe\";\n const clients = hand ? undefined : supportFor(id.slice(7), finding.usage);\n if (!hand && clients?.length === 0) continue;\n const unsupported =\n clients?.some((client) => client.support === \"unsupported\") ?? true;\n const defaultSeverity: Exclude<Severity, \"off\"> = unsupported\n ? \"warning\"\n : \"info\";\n const configured = tool.rules?.[id];\n const severity =\n configured && configured !== \"off\" ? configured : defaultSeverity;\n const params: Record<string, string | number> = {\n excerpt: finding.excerpt,\n value: finding.value ?? \"\",\n tag: finding.tag ?? \"\",\n };\n if (clients) {\n if (unsupported)\n params.unsupported = formatClientGroups(\n clients,\n \"unsupported\",\n resolved.locale,\n );\n if (clients.some((client) => client.support === \"partial\"))\n params.partial = formatClientGroups(\n clients,\n \"partial\",\n resolved.locale,\n );\n }\n const formatted = formatCompatibilityMessage(resolved.locale, id, params);\n issues.push({\n blockId,\n ruleId: id,\n severity,\n ...formatted,\n reference: rule.meta.reference,\n ...(clients ? { clients } : {}),\n excerpt: finding.excerpt,\n });\n }\n return issues;\n}\n\n/** Scan only authored HTML/CSS and URL fields that pass through rendering. */\nexport function lintCompatibility(\n content: TemplateContent,\n options: LintOptions = {},\n): LintIssue[] {\n if (options.disabled === true || options.compatibility === false) return [];\n const issues: LintIssue[] = [];\n const cache = new WeakMap<Block, Scan>();\n walkBlocks(content, (block) => {\n let scan = cache.get(block);\n if (!scan) {\n scan = scanBlock(block);\n cache.set(block, scan);\n }\n issues.push(...lintScan(scan, block.id, options));\n });\n return issues;\n}\n\nexport interface HtmlFragmentOptions {\n stylesheet?: string;\n locale?: string;\n compatibility?: false | CompatibilityLintOptions;\n}\n\nexport function lintHtmlFragment(\n html: string,\n options: HtmlFragmentOptions = {},\n): LintIssue[] {\n if (options.compatibility === false) return [];\n return lintScan(scanHtml(html, options.stylesheet), null, options);\n}\n\n/** Measure compiled HTML only. Callers choose when and how to render. */\nexport function lintCompiledHtml(\n html: string,\n options: LintOptions = {},\n): LintIssue[] {\n if (options.disabled === true || options.compatibility === false) return [];\n const tool = options.compatibility || {};\n const opts = resolveCompatibilityOptions(\n options.locale,\n tool,\n COMPATIBILITY_RULES,\n );\n const rule = COMPATIBILITY_RULES.find(\n (entry) => entry.meta.id === \"compat.gmail-clipping\",\n )!;\n const severity = opts.severity(rule.meta.id);\n if (severity === \"off\") return [];\n return rule.compiledHtml!(html, opts).map((hit) => ({\n blockId: null,\n ruleId: rule.meta.id,\n severity: severity as Exclude<Severity, \"off\">,\n ...formatCompatibilityMessage(opts.locale, rule.meta.id, hit.params),\n reference: rule.meta.reference,\n }));\n}\n\nexport { DEFAULT_COMPATIBILITY_THRESHOLDS };\n","import type en from \"./en\";\n\nconst de: typeof en = {\n \"localization.untranslated\": {\n message: \"Das Feld {field} hat keine Übersetzung.\",\n suggestion:\n \"Übersetze {field} oder verwende die Standardsprache als Fallback.\",\n },\n \"localization.stale\": {\n message: \"Die Übersetzung von {field} ist nicht mehr aktuell.\",\n suggestion:\n \"Vergleiche {field} mit der Standardsprache und aktualisiere oder behalte den Wert.\",\n },\n \"localization.merge-tags-differ\": {\n message: \"Die Merge-Tags in {field} weichen von der Standardsprache ab.\",\n suggestion:\n \"Verwende in {field} dieselben Merge-Tags mit derselben Anzahl an Vorkommen.\",\n },\n};\n\nexport default de;\n","const en = {\n \"localization.untranslated\": {\n message: \"The field {field} has no translation.\",\n suggestion:\n \"Translate {field}, or keep the default language as a fallback.\",\n },\n \"localization.stale\": {\n message: \"The translation of {field} is out of date.\",\n suggestion:\n \"Review {field} against the default language and update or keep it.\",\n },\n \"localization.merge-tags-differ\": {\n message: \"The merge tags in {field} differ from the default language.\",\n suggestion: \"Keep the same merge tags and occurrence counts in {field}.\",\n },\n};\n\nexport default en;\n","import en from \"./en\";\nimport { formatMessagePair } from \"../../format-message\";\n\nexport type LocalizationMessageMap = typeof en;\nexport type LocalizationRuleMessageId = keyof LocalizationMessageMap;\n\nconst modules = import.meta.glob<{ default: LocalizationMessageMap }>(\n \"./*.ts\",\n { eager: true },\n);\nconst MESSAGES: Record<string, LocalizationMessageMap> = {};\nfor (const path in modules) {\n const match = /\\.\\/([^/]+)\\.ts$/.exec(path);\n if (!match) continue;\n const locale = match[1];\n if (locale === \"index\") continue;\n MESSAGES[locale] = modules[path].default;\n}\n\nexport const SUPPORTED_LOCALIZATION_MESSAGE_LOCALES = Object.keys(MESSAGES);\n\nexport function getLocalizationMessages(\n locale: string,\n): LocalizationMessageMap {\n const base = locale.split(\"-\")[0]?.toLowerCase() ?? \"en\";\n return MESSAGES[base] ?? MESSAGES.en ?? en;\n}\n\nexport function formatLocalizationMessage(\n locale: string,\n ruleId: LocalizationRuleMessageId,\n params?: Record<string, string | number>,\n): { message: string; suggestion: string } {\n const map = getLocalizationMessages(locale);\n return formatMessagePair(map[ruleId] ?? en[ruleId], params);\n}\n","import {\n decodeHtmlEntities,\n localeCoverage,\n readPath,\n replaceMergeTagSpans,\n resolveSyntax,\n scanSyntaxMatches,\n SETTINGS_TRANSLATABLE_FIELDS,\n translatableFields,\n TRANSLATABLE_HTML_FIELDS,\n type Block,\n type SyntaxPreset,\n type TemplateContent,\n type TemplateSettings,\n} from \"@templatical/types\";\nimport type { ResolvedOptions, Rule, RuleHit } from \"../types\";\nimport { walkBlocks } from \"../walk\";\n\ninterface TextField {\n blockId: string | null;\n field: string;\n target: Block | TemplateSettings;\n format: \"html\" | \"text\";\n}\n\nfunction textFields(\n content: TemplateContent,\n opts: ResolvedOptions,\n): Map<string, TextField> {\n const fields = new Map<string, TextField>();\n walkBlocks(content, (block) => {\n for (const field of translatableFields(block, opts.customBlocks)) {\n fields.set(`${block.id}/${field}`, {\n blockId: block.id,\n field,\n target: block,\n format:\n block.type === \"html\" ||\n TRANSLATABLE_HTML_FIELDS[block.type]?.includes(field)\n ? \"html\"\n : \"text\",\n });\n }\n });\n for (const field of SETTINGS_TRANSLATABLE_FIELDS) {\n fields.set(`settings/${field}`, {\n blockId: null,\n field,\n target: content.settings,\n format: \"text\",\n });\n }\n return fields;\n}\n\nfunction fieldHit({ blockId, field }: TextField): RuleHit {\n return {\n blockId,\n params: { field },\n };\n}\n\nfunction coverage(content: TemplateContent, opts: ResolvedOptions) {\n return localeCoverage(content, opts.contentLocale!, opts.customBlocks);\n}\n\n/**\n * HTML span tokens stay opaque and raw matches decode once. Plain text stays\n * literal; copying regexes preserves the consumer's regex state.\n */\nfunction tokens(\n value: string,\n syntax: SyntaxPreset,\n format: TextField[\"format\"],\n): string[] {\n const spanTokens: string[] = [];\n let marker = \"\\u0000MT\";\n while (value.includes(marker)) marker += \"_\";\n const remaining =\n format === \"html\"\n ? replaceMergeTagSpans(value, (token) => {\n const index = spanTokens.push(token) - 1;\n return `${marker}${index}\\u0000`;\n })\n : value;\n const placeholders = Array.from(\n remaining.matchAll(new RegExp(`${marker}\\\\d+\\u0000`, \"g\")),\n (match) => ({ start: match.index, end: match.index + match[0].length }),\n );\n const matches: { start: number; end: number; value: string }[] = [];\n const logic = scanSyntaxMatches(remaining, syntax, \"logic\");\n const acceptedLogic: { start: number; end: number }[] = [];\n let logicIndex = 0;\n for (const kind of [\"logic\", \"value\"] as const) {\n let placeholderIndex = 0;\n for (const match of kind === \"logic\"\n ? logic\n : scanSyntaxMatches(remaining, syntax, \"value\")) {\n const start = match.index;\n const end = start + match.value.length;\n while (placeholders[placeholderIndex]?.end <= start) placeholderIndex++;\n const placeholder = placeholders[placeholderIndex];\n if (placeholder && start < placeholder.end && end > placeholder.start)\n continue;\n if (kind === \"value\") {\n while (acceptedLogic[logicIndex]?.end <= start) logicIndex++;\n const other = acceptedLogic[logicIndex];\n if (other && start < other.end && end > other.start) continue;\n }\n if (kind === \"logic\") acceptedLogic.push({ start, end });\n matches.push({\n start,\n end,\n value:\n format === \"html\" ? decodeHtmlEntities(match.value) : match.value,\n });\n }\n }\n return [...spanTokens, ...matches.map((match) => match.value)].sort();\n}\n\nconst untranslated: Rule = {\n meta: {\n id: \"localization.untranslated\",\n severity: \"warning\",\n reference:\n \"https://docs.templatical.com/guide/localized-templates#missing-values\",\n },\n template: (content, opts) => {\n const fields = textFields(content, opts);\n return coverage(content, opts).missing.map((id) =>\n fieldHit(fields.get(id)!),\n );\n },\n};\n\nconst stale: Rule = {\n meta: {\n id: \"localization.stale\",\n severity: \"warning\",\n reference:\n \"https://docs.templatical.com/guide/localized-templates#out-of-date-values\",\n },\n template: (content, opts) => {\n const fields = textFields(content, opts);\n return coverage(content, opts).stale.map((id) => fieldHit(fields.get(id)!));\n },\n};\n\nconst mergeTagsDiffer: Rule = {\n meta: {\n id: \"localization.merge-tags-differ\",\n severity: \"warning\",\n reference:\n \"https://docs.templatical.com/guide/localized-templates#merge-tags\",\n },\n template: (content, opts) => {\n const fields = textFields(content, opts);\n const covered = coverage(content, opts);\n const syntax = resolveSyntax(opts.mergeTagSyntax);\n return [...covered.translated, ...covered.stale].flatMap((id) => {\n const entry = fields.get(id)!;\n const { target, field, format } = entry;\n const base = readPath(target, field);\n const translated =\n target?.l10n?.[opts.contentLocale!]?.text?.[field]?.value;\n if (typeof base !== \"string\" || translated === undefined) return [];\n return JSON.stringify(tokens(base, syntax, format)) ===\n JSON.stringify(tokens(translated, syntax, format))\n ? []\n : [fieldHit(entry)];\n });\n },\n};\n\nexport const LOCALIZATION_RULES: Rule[] = [\n untranslated,\n stale,\n mergeTagsDiffer,\n];\n","import {\n defaultLocaleOf,\n resolveLocale,\n type TemplateContent,\n} from \"@templatical/types\";\nimport type { LintIssue, LintOptions } from \"../types\";\nimport { resolveOptions, runRules } from \"../run-rules\";\nimport {\n formatLocalizationMessage,\n type LocalizationRuleMessageId,\n} from \"./messages\";\nimport { LOCALIZATION_RULES } from \"./rules\";\n\nexport { LOCALIZATION_RULES } from \"./rules\";\n\nexport function lintLocalization(\n content: TemplateContent,\n options: LintOptions = {},\n): LintIssue[] {\n if (options.disabled === true || options.localization === false) return [];\n const contentLocale = options.contentLocale ?? defaultLocaleOf(content);\n if (contentLocale === defaultLocaleOf(content)) return [];\n // Standalone callers get the same unknown_locale refusal as lintTemplate.\n if (!content.settings.locales?.includes(contentLocale))\n resolveLocale(content, contentLocale);\n const resolved = {\n ...resolveOptions({\n locale: options.locale,\n rules: LOCALIZATION_RULES,\n overrides: options.localization?.rules,\n thresholds: undefined,\n nonProductionHosts: undefined,\n }),\n contentLocale,\n customBlocks: options.customBlocks,\n mergeTagSyntax: options.mergeTagSyntax,\n };\n return runRules(content, LOCALIZATION_RULES, resolved, (locale, id, params) =>\n formatLocalizationMessage(locale, id as LocalizationRuleMessageId, params),\n );\n}\n","import type { LintOptions } from \"./types\";\n\n/**\n * `true` when no linter would run for the given options — either the\n * global `disabled` flag is set, or every per-tool key is `false`.\n *\n * The editor uses this to skip lazy-loading `@templatical/quality`, hide\n * the Issues sidebar tab, and suppress inline canvas badges. Headless\n * callers can use it to short-circuit before any linter call.\n */\nexport function isLintFullyDisabled(options: LintOptions | undefined): boolean {\n if (!options) return false;\n if (options.disabled === true) return true;\n return (\n options.accessibility === false &&\n options.structure === false &&\n options.links === false &&\n options.deliverability === false &&\n options.compatibility === false &&\n options.localization === false\n );\n}\n","import type { TemplateContent } from \"@templatical/types\";\nimport { defaultLocaleOf, resolveLocale } from \"@templatical/types\";\nimport type { LintIssue, LintOptions } from \"./types\";\nimport { lintAccessibility } from \"./accessibility\";\nimport { lintStructure } from \"./structure\";\nimport { lintLinks } from \"./links\";\nimport { lintDeliverability } from \"./deliverability\";\nimport { lintCompatibility } from \"./compatibility\";\nimport { lintLocalization } from \"./localization\";\nimport { isLintFullyDisabled } from \"./util\";\n\n/**\n * Run every linter in the package — accessibility, structure, links,\n * deliverability, compatibility, and localization —\n * against `content` and return the merged issue list.\n *\n * This is the single entry point callers should prefer. CI guards, the\n * editor's live linter, and headless consumers all funnel through here, so\n * a new linter category is picked up everywhere by registering it in this\n * one fan-out — no consumer has to learn about the new function.\n *\n * Per-category options (`options.accessibility`, `options.structure`,\n * `options.links`, `options.deliverability`, `options.compatibility`,\n * `options.localization`) and the\n * global `options.disabled` flag are forwarded\n * unchanged; each sub-linter already short-circuits when its category is\n * `false`, so the per-tool calls below are cheap no-ops when disabled.\n *\n * Issue order is stable: accessibility, structure, links, deliverability,\n * compatibility, localization. `contentLocale` selects the projection;\n * `locale` selects messages. Vague-text dictionaries remain a union.\n * Removal fixes are omitted for non-default languages because they change\n * the shared tree; patch fixes remain available for language-layer edits.\n */\nexport function lintTemplate(\n content: TemplateContent,\n options: LintOptions = {},\n): LintIssue[] {\n if (isLintFullyDisabled(options)) return [];\n const defaultLocale = defaultLocaleOf(content);\n const contentLocale = options.contentLocale ?? defaultLocale;\n const projected = resolveLocale(content, contentLocale);\n const issues = [\n ...lintAccessibility(projected, options),\n ...lintStructure(projected, options),\n ...lintLinks(projected, options),\n ...lintDeliverability(projected, options),\n ...lintCompatibility(projected, options),\n ...lintLocalization(content, options),\n ];\n if (contentLocale === defaultLocale) return issues;\n return issues.map((issue) => {\n if (!issue.fix?.removesBlock) return issue;\n const withoutFix = { ...issue };\n delete withoutFix.fix;\n return withoutFix;\n });\n}\n"],"mappings":";;;;AA2FA,IAAaoH,KAA8D,EACzE,eAAe,IACjB,GAaaC,KAA4D,EACvE,cAAc,MAChB,GA6IaC,KAA0C;CACrD,cAAc;CACd,aAAa;CACb,kBAAkB;CAClB,kBAAkB;AACpB,GAEaC,KAAyC;CACpD;CACA;CACA;CACA;CACA;CACA;AACF,GCtQaC,KAAoC;CAC/C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;ACT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KAAA;EACZ,oBAAoBA,EAAK;CAC3B,CAAC;AACH;;A,mDClOMzL,KAAgB;CACpB,wBAAwB;EACtB,SAAS;EACT,YACE;CACJ;CACA,4BAA4B;EAC1B,SAAS;EACT,YAAY;CACd;CACA,yBAAyB;EACvB,SAAS;EACT,YAAY;CACd;CACA,uCAAuC;EACrC,SAAS;EACT,YACE;CACJ;CACA,8BAA8B;EAC5B,SAAS;EACT,YAAY;CACd;CACA,sBAAsB;EACpB,SAAS;EACT,YAAY;CACd;CACA,2BAA2B;EACzB,SAAS;EACT,YAAY;CACd;CACA,4BAA4B;EAC1B,SAAS;EACT,YAAY;CACd;CACA,mBAAmB;EACjB,SACE;EACF,YAAY;CACd;CACA,wBAAwB;EACtB,SAAS;EACT,YAAY;CACd;CACA,wBAAwB;EACtB,SAAS;EACT,YAAY;CACd;CACA,iCAAiC;EAC/B,SAAS;EACT,YACE;CACJ;CACA,2BAA2B;EACzB,SACE;EACF,YAAY;CACd;CACA,sBAAsB;EACpB,SAAS;EACT,YAAY;CACd;CACA,uBAAuB;EACrB,SACE;EACF,YAAY;CACd;CACA,0BAA0B;EACxB,SAAS;EACT,YAAY;CACd;CACA,uBAAuB;EACrB,SAAS;EACT,YAAY;CACd;CACA,2BAA2B;EACzB,SAAS;EACT,YAAY;CACd;CACA,4BAA4B;EAC1B,SAAS;EACT,YACE;CACJ;CACA,4BAA4B;EAC1B,SAAS;EACT,YAAY;CACd;CACA,0BAA0B;EACxB,SACE;EACF,YAAY;CACd;AACF,G,8CC/FMC,IAAK;CACT,wBAAwB;EACtB,SAAS;EACT,YAAY;CACd;CACA,4BAA4B;EAC1B,SAAS;EACT,YAAY;CACd;CACA,yBAAyB;EACvB,SAAS;EACT,YAAY;CACd;CACA,uCAAuC;EACrC,SAAS;EACT,YAAY;CACd;CACA,8BAA8B;EAC5B,SACE;EACF,YAAY;CACd;CACA,sBAAsB;EACpB,SAAS;EACT,YAAY;CACd;CACA,2BAA2B;EACzB,SAAS;EACT,YAA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AClE;CACF;AACF,GCXa2C,KAAmC;CAC9C,MAAA;EAPA,IAAI;EACJ,WACE;EACF,UAAU;CAIV;CACA,MAAM,GAAO;EAIX,OAHI,CAAChH,EAAQwD,CAAK,KACdA,EAAM,eAAe,OACpBA,EAAM,OAAO,GAAA,CAAI,KAAK,MAAM,KAAW,OACrC;GACL,SAASA,EAAM;GACf,KAAK;IACH,aAAa;IACb,QAAQ,MACNE,EAAI,YAAYF,EAAM,IAAI,EAAE,KAAK,GAAG,CAAC;GACzC;EACF;CACF;AACF,G,+CCvBMlJ,KAAgB;CACpB,eAAe;EACb;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,mBAAmB;EACjB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,wBAAwB;EACtB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF,G,+CCtCMC,KAAK;CACT,eAAe;EACb;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,mBAAmB;EACjB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CAMA,wBAAwB;EACtB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF,GCzCMC,KAAU,uBAAA,OAAA;CAAA,WAAAC;CAAA,WAAAC;AAAA,CAAA,GAIV4M,KAA2C,CAAC;AAClD,KAAK,IAAMhB,KAAQ9L,IAAS;CAC1B,IAAM+L,IAAQ,mBAAmB,KAAKD,CAAI;CAC1C,IAAI,CAACC,GAAO;CACZ,IAAMtB,IAASsB,EAAM;CACrB,AAAItB,MAAW,YACf,GAAaA,KAAUzK,GAAQ8L,EAAK,CAAC;AACvC;AAWA,SAAgBiB,EAAc,GAA6B;CACzD,OAAOC;AACT;AAEA,SAASC,EAAS,GAAsD;CACtE,IAAMC,oBAAM,IAAI,IAAY;CAC5B,K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ZD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;EACF;CACF;CACA,oBAAoB;EAClBN,OAAS;EACTC,KAAO;EACPC,cAAgB;EAChBC,OAAS,EACP,GAAK,0CACP;EACAC,OAAS;GACP,aAAa;IACXC,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,cAAc;IACZD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;EACF;CACF;CACA,gBAAgB;EACdN,OAAS;EACTC,KAAO;EACPC,cAAgB;EAChBC,OAAS;GACP,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;EACP;EACAC,OAAS;GACP,oBAAoB;IAClBC,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,cAAc;IACZD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,4BAA4B;IAC1BD,OAAS;IACTF,OAAS,CACP,GACA,CACF;IACAG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;EACF;CACF;CACA,iBAAiB;EACfN,OAAS;EACTC,KAAO;EACPC,cAAgB;EAChBC,OAAS;GACP,GAAK;GACL,GAAK;EACP;EACAC,OAAS;GACP,yBAAyB;IACvBC,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CACP,GACA,CACF;IACAG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CACP,GACA,CACF;IACAG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,cAAc;IACZD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,4BAA4B;IAC1BD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;EACF;CACF;CACA,iBAAiB;EACfN,OAAS;EACTC,KAAO;EACPC,cAAgB;EAChBC,OAAS,CAAC;EACVC,OAAS;GACP,yBAAyB;IACvBC,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,cAAc;IACZD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,qBAAqB;IACnBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iB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ACP,yBAAyB;IACvBC,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,cAAc;IACZD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,qBAAqB;IACnBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,8BAA8B;IAC5BD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,sBAAsB;IACpBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,4BAA4B;IAC1BD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,+BAA+B;IAC7BD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;EACF;CACF;CACA,cAAc;EACZN,OAAS;EACTC,KAAO;EACPC,cAAgB;EAChBC,OAAS;GACP,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;EACP;EACAC,OAAS;GACP,yBAAyB;IACvBC,OAAS;IACTF,OAAS,CACP,GACA,CACF;IACAG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CACP,GACA,CACF;IACAG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CACP,GACA,CACF;IACAG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,sBAAsB;IACpBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,4BAA4B;IAC1BD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;EACF;CACF;CACA,YAAY;EACVN,OAAS;EACTC,KAAO;EACPC,cAAgB;EAChBC,OAAS;GACP,GAAK;GACL,GAAK;EACP;EACAC,OAAS;GACP,oBAAoB;IAClBC,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,i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,OAAS,CAAC;IACVG,SAAW;GACb;GACA,+BAA+B;IAC7BD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;EACF;CACF;CACA,aAAa;EACXN,OAAS;EACTC,KAAO;EACPC,cAAgB;EAChBC,OAAS;GACP,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;EACP;EACAC,OAAS;GACP,aAAa;IACXC,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,cAAc;IACZD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,8BAA8B;IAC5BD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,sBAAsB;IACpBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,4BAA4B;IAC1BD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,+BAA+B;IAC7BD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;EACF;CACF;CACA,eAAe;EACbN,OAAS;EACTC,KAAO;EACPC,cAAgB;EAChBC,OAAS;GACP,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;EACP;EACAC,OAAS;GACP,oBAAoB;IAClBC,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,cAAc;IACZD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,qBAAqB;IACnBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,8BAA8B;IAC5BD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,sBAAsB;IACpBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,4BAA4B;IAC1BD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CACP,GACA,CACF;IACAG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,cAAc;IACZD,OAAS;IACTF,OAAS,CACP,GACA,CACF;IACAG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,+BAA+B;IAC7BD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;EACF;CACF;CACA,cAAc;EACZN,OAAS;EACTC,KAAO;EACPC,cAAgB;EAChBC,OAAS;GACP,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,IAAM;GACN,IAAM;EACR;EACAC,OAAS;GACP,kBAAkB;IAChBC,OAAS;IACTF,OAAS,CACP,GACA,CACF;IACAG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,cAAc;IACZD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CACP,EACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,8BAA8B;IAC5BD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,sBAAsB;IACpBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,4BAA4B;IAC1BD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS,CACP,EACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CACP,GACA,CACF;IACAG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,cAAc;IACZD,OAAS;IACTF,OAAS,CACP,GACA,CACF;IACAG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,+BAA+B;IAC7BD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;EACF;CACF;CACA,cAAc;EACZN,OAAS;EACTC,KAAO;EACPC,cAAgB;EAChBC,OAAS;GACP,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;EACP;EACAC,OAAS;GACP,yBAAyB;IACvBC,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,cAAc;IACZD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,8BAA8B;IAC5BD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,sBAAsB;IACpBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,4BAA4B;IAC1BD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,cAAc;IACZD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,kBAAkB;IAChBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,+BAA+B;IAC7BD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;EACF;CACF;CACA,aAAa;EACXN,OAAS;EACTC,KAAO;EACPC,cAAgB;EAChBC,OAAS;GACP,GAAK;GACL,GAAK;EACP;EACAC,OAAS;GACP,mBAAmB;IACjBC,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;EACF;CACF;CACA,iBAAiB;EACfN,OAAS;EACTC,KAAO;EACPC,cAAgB;EAChBC,OAAS;GACP,GAAK;GACL,GAAK;EACP;EACAC,OAAS;GACP,mBAAmB;IACjBC,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;EACF;CACF;CACA,aAAa;EACXN,OAAS;EACTC,KAAO;EACPC,cAAgB;EAChBC,OAAS;GACP,GAAK;GACL,GAAK;EACP;EACAC,OAAS;GACP,aAAa;IACXC,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,mBAAmB;IACjBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,0BAA0B;IACxBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;EACF;CACF;CACA,wBAAwB;EACtBN,OAAS;EACTC,KAAO;EACPC,cAAgB;EAChBC,OAAS;GACP,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;GACL,GAAK;EACP;EACAC,OAAS;GACP,mBAAmB;IACjBC,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,wBAAwB;IACtBD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,yBAAyB;IACvBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,aAAa;IACXD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,iBAAiB;IACfD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,uBAAuB;IACrBD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,WAAW;IACTD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,eAAe;IACbD,OAAS;IACTF,OAAS,CACP,CACF;IACAG,SAAW;GACb;GACA,+BAA+B;IAC7BD,OAAS;IACTF,OAAS,CAAC;IACVG,SAAW;GACb;GACA,2BAA2B;IACzBD,OAAS;IACTF,OAAS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ACK,IAAI,KAAK,WAAWA,EAAO,WAAW,IAAI,IAAI,OAAO,MAAM,EAChE,MAAM,cACR,CAAC,CAAC,CAAC,OAAOqZ,CAAO;AACnB;;A,mDCrIM/f,KAAgB;CACpB,WAAW;EACT,aAAa;EACb,SAAS;EACT,OACE;CACJ;CACA,MAAM;CACN,UAAU;EACR,oBAAoB;GAClB,SAAS;GACT,YACE;EACJ;EACA,oBAAoB;GAClB,SAAS;GACT,YACE;EACJ;EACA,gBAAgB;GACd,SAAS;GACT,YACE;EACJ;EACA,iBAAiB;GACf,SAAS;GACT,YAAY;EACd;EACA,iBAAiB;GACf,SAAS;GACT,YAAY;EACd;EACA,aAAa;GACX,SAAS;GACT,YAAY;EACd;EACA,cAAc;GACZ,SAAS;GACT,YAAY;EACd;EACA,YAAY;GACV,SAAS;GACT,YAAY;EACd;EACA,aAAa;GACX,SAAS;GACT,YAAY;EACd;EACA,eAAe;GACb,SAAS;GACT,YAAY;EACd;EACA,cAAc;GACZ,SAAS;GACT,YAAY;EACd;EACA,cAAc;GACZ,SAAS;GACT,YAAY;EACd;EACA,aAAa;GACX,SAAS;GACT,YACE;EACJ;EACA,iBAAiB;GACf,SAAS;GACT,YAAY;EACd;EACA,aAAa;GACX,SAAS;GACT,YACE;EACJ;EACA,wBAAwB;GACtB,SAAS;GACT,YACE;EACJ;EACA,gBAAgB;GACd,SAAS;GACT,YAAY;EACd;CACF;CACA,MAAM;EACJ,sBAAsB;GACpB,SACE;GACF,YAAY;EACd;EACA,sBAAsB;GACpB,SACE;GACF,YACE;EACJ;EACA,yBAAyB;GACvB,SACE;GACF,YACE;EACJ;CACF;AACF,G,+CCzGMC,KAAK;CACT,WAAW;EACT,aAAa;EACb,SAAS;EACT,OACE;CACJ;CACA,MAAM;CACN,UAAU;EACR,oBAAoB;GAClB,SAAS;GACT,YACE;EACJ;EACA,oBAAoB;GAClB,SAAS;GACT,YACE;EACJ;EACA,gBAAgB;GACd,SAAS;GACT,YACE;EACJ;EACA,iBA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