@templatical/editor 0.56.1 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{AiAltTextPopover-CpZ7UeAZ.js → AiAltTextPopover-BjClNscQ.js} +5 -5
- package/dist/{AiAltTextReview-LYxvn7Qe.js → AiAltTextReview-DeMdVbtT.js} +6 -6
- package/dist/{AiChatPanel-Cy05P-iO.js → AiChatPanel-Cros4ZCM.js} +22 -25
- package/dist/AiPanels-D_CdHqFZ.js +26 -0
- package/dist/{AiRewriteMenu-DgqJHnza.js → AiRewriteMenu-BSzj1dKC.js} +53 -53
- package/dist/{BlockIssueBadge-CxHJmuOh.js → BlockIssueBadge-i2cZy5PB.js} +5 -5
- package/dist/{BlockPreviewCanvas-DEmNZkEG.js → BlockPreviewCanvas-D-If_vd_.js} +27 -27
- package/dist/{CloudHeaderExtras-Cqhw-jMz.js → CloudHeaderExtras-CJsXi4Ku.js} +2 -2
- package/dist/{CloudPanels-Bmlf05Il.js → CloudPanels-DPeK_siQ.js} +6 -6
- package/dist/{CollaborationNotices-C27GCMvK.js → CollaborationNotices-DkYX-ose.js} +3 -3
- package/dist/{CollaboratorBar-CLQjksX-.js → CollaboratorBar-xDweDvB6.js} +3 -3
- package/dist/CommentsPanel-t3w16YUl.js +23 -0
- package/dist/CommentsSidebar-B3M90RY_.js +516 -0
- package/dist/{CountdownBlock-D8dqjm3F.js → CountdownBlock-BrR2uqM3.js} +4 -4
- package/dist/{CountdownToolbar-IjpCOjCd.js → CountdownToolbar-DBu2ZqC6.js} +7 -7
- package/dist/{IssuesPanel-uwuzeMSW.js → IssuesPanel-BnUut-p-.js} +13 -13
- package/dist/{LanguageMenu-C-eQ0lFy.js → LanguageMenu-DfTxrbvp.js} +16 -16
- package/dist/{LoadingTrack-BG8cg9xi.js → LoadingTrack-c4SeD16s.js} +1 -1
- package/dist/{LocaleNotices-CDK_9D7P.js → LocaleNotices-D6zk-QCL.js} +5 -5
- package/dist/{LogicTagInsertButton-BSolF7Fd.js → LogicTagInsertButton-CJ1Jk6jv.js} +65 -65
- package/dist/{MediaEditModal-C8yc9dxt.js → MediaEditModal-BxbwZxnf.js} +4 -4
- package/dist/{MediaPanels-FI4I8asn.js → MediaPanels-BiUxsTMM.js} +2 -2
- package/dist/{MergeTagInput-B1nl2ZMT.js → MergeTagInput-CV-z85s9.js} +2 -2
- package/dist/{MergeTagModeToggle-DXvb80OE.js → MergeTagModeToggle-CixgX5C_.js} +7 -7
- package/dist/{MergeTagTextarea-DJlf3VbS.js → MergeTagTextarea-B1zOC_Nr.js} +9 -9
- package/dist/{ParagraphEditor-Dqco128s.js → ParagraphEditor-C9UhWvRB.js} +51 -51
- package/dist/{RestoreVersionDialog-hqLCuGV5.js → RestoreVersionDialog-Do7fZWpT.js} +5 -5
- package/dist/{RichTextEditorContent-xIEF0Y3Z.js → RichTextEditorContent-wW_SMun2.js} +10 -10
- package/dist/{SaveBlockDialog-CQlCP_XC.js → SaveBlockDialog-CCHIUfR-.js} +15 -15
- package/dist/{SavedBlocksBrowserModal-BXA32Fx6.js → SavedBlocksBrowserModal-DtPHhfw9.js} +13 -13
- package/dist/{SavedBlocksPanels-BKUzbamj.js → SavedBlocksPanels-CYIby5pR.js} +2 -2
- package/dist/{SavedBlocksPickBar-BlvF-4UF.js → SavedBlocksPickBar-CCwBugqN.js} +4 -4
- package/dist/{TemplateSettings-CYFtR8zv.js → TemplateSettings-B8IVy5q9.js} +14 -14
- package/dist/{TestEmailModal-BbaL17HO.js → TestEmailModal-CS5JoKRH.js} +13 -13
- package/dist/{TestEmailPanel-DhB1CSpg.js → TestEmailPanel-sOIZfKzc.js} +2 -2
- package/dist/{TitleEditor-3BRl8u5l.js → TitleEditor-ZlBcq9_P.js} +14 -14
- package/dist/{ToggleSwitch-R3wCCYE6.js → ToggleSwitch-BIPdFWUr.js} +1 -1
- package/dist/{Toolbar-pzNIakGM.js → Toolbar-c4_rLLJT.js} +218 -218
- package/dist/{TplModal-WNuWhHZm.js → TplModal-DnFFEulp.js} +6 -6
- package/dist/{VersionHistoryMenu--T-Qp_mH.js → VersionHistoryMenu-Cd2IaHgT.js} +10 -10
- package/dist/{VersionHistoryPanels-BPubvYIE.js → VersionHistoryPanels-TdGaMaa_.js} +2 -2
- package/dist/{VersionPreviewBanner-ClL3Wkln.js → VersionPreviewBanner-lkAf7tc8.js} +3 -3
- package/dist/{WrapperBlock-CjfCPceb.js → WrapperBlock-BiW4ye3w.js} +5 -5
- package/dist/{blockTypeIcons-12OMwVyN.js → blockTypeIcons-D1aYMC1M.js} +3 -3
- package/dist/bundle-stats.json +7 -7
- package/dist/cdn/chunks/{AiAltTextPopover-PFjTrl0y.js → AiAltTextPopover-CfGJNBOb.js} +5 -5
- package/dist/cdn/chunks/{AiAltTextPopover-PFjTrl0y.js.map → AiAltTextPopover-CfGJNBOb.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-BMjzvApH.js → AiAltTextReview-PKe31R_g.js} +6 -6
- package/dist/cdn/chunks/{AiAltTextReview-BMjzvApH.js.map → AiAltTextReview-PKe31R_g.js.map} +1 -1
- package/dist/cdn/chunks/{AiChatPanel-C2gpq4kP.js → AiChatPanel-DNCUpV8n.js} +15 -18
- package/dist/cdn/chunks/AiChatPanel-DNCUpV8n.js.map +1 -0
- package/dist/cdn/chunks/AiPanels-IV0VEkBL.js +27 -0
- package/dist/cdn/chunks/AiPanels-IV0VEkBL.js.map +1 -0
- package/dist/cdn/chunks/{AiRewriteMenu-CnkyjPEu.js → AiRewriteMenu-ZDBwReuU.js} +58 -58
- package/dist/cdn/chunks/AiRewriteMenu-ZDBwReuU.js.map +1 -0
- package/dist/cdn/chunks/{BlockIssueBadge-DncZ-HDf.js → BlockIssueBadge-DIlFDDwh.js} +5 -5
- package/dist/cdn/chunks/BlockIssueBadge-DIlFDDwh.js.map +1 -0
- package/dist/cdn/chunks/{BlockPreviewCanvas-CCSEzL46.js → BlockPreviewCanvas-D7U6nQ7t.js} +28 -28
- package/dist/cdn/chunks/BlockPreviewCanvas-D7U6nQ7t.js.map +1 -0
- package/dist/cdn/chunks/{CloudHeaderExtras-uUJYJFJ6.js → CloudHeaderExtras-CazfMn6A.js} +3 -3
- package/dist/cdn/chunks/{CloudHeaderExtras-uUJYJFJ6.js.map → CloudHeaderExtras-CazfMn6A.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-CRztnw4M.js → CloudPanels-EXXNMLbs.js} +5 -5
- package/dist/cdn/chunks/CloudPanels-EXXNMLbs.js.map +1 -0
- package/dist/cdn/chunks/{CollaborationNotices-IuLYT2x7.js → CollaborationNotices-DGA8XRZJ.js} +4 -4
- package/dist/cdn/chunks/{CollaborationNotices-IuLYT2x7.js.map → CollaborationNotices-DGA8XRZJ.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-C1ZI2xwa.js → CollaboratorBar-BWL1Shc1.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-C1ZI2xwa.js.map → CollaboratorBar-BWL1Shc1.js.map} +1 -1
- package/dist/cdn/chunks/CommentsPanel-4mrl4zMK.js +24 -0
- package/dist/cdn/chunks/CommentsPanel-4mrl4zMK.js.map +1 -0
- package/dist/cdn/chunks/CommentsSidebar-BJ87vc7i.js +486 -0
- package/dist/cdn/chunks/CommentsSidebar-BJ87vc7i.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-8aPSExrv.js → CountdownBlock-Do6oItNW.js} +5 -5
- package/dist/cdn/chunks/{CountdownBlock-8aPSExrv.js.map → CountdownBlock-Do6oItNW.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-CnWQEW5g.js → CountdownToolbar-BN2_zvRj.js} +8 -8
- package/dist/cdn/chunks/{CountdownToolbar-CnWQEW5g.js.map → CountdownToolbar-BN2_zvRj.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-CrplCzo8.js → IssuesPanel-BDwegn0s.js} +9 -9
- package/dist/cdn/chunks/IssuesPanel-BDwegn0s.js.map +1 -0
- package/dist/cdn/chunks/{LanguageMenu-B6MNInCL.js → LanguageMenu-DXq9cXUd.js} +105 -105
- package/dist/cdn/chunks/LanguageMenu-DXq9cXUd.js.map +1 -0
- package/dist/cdn/chunks/{LoadingTrack-DUYcDHOV.js → LoadingTrack-o-89hApJ.js} +2 -2
- package/dist/cdn/chunks/{LoadingTrack-DUYcDHOV.js.map → LoadingTrack-o-89hApJ.js.map} +1 -1
- package/dist/cdn/chunks/{LocaleNotices-TxeAl8Iq.js → LocaleNotices-CUN5K5QJ.js} +5 -5
- package/dist/cdn/chunks/{LocaleNotices-TxeAl8Iq.js.map → LocaleNotices-CUN5K5QJ.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-DvSVx2DB.js → LogicTagInsertButton-BEArlbra.js} +12 -12
- package/dist/cdn/chunks/{LogicTagInsertButton-DvSVx2DB.js.map → LogicTagInsertButton-BEArlbra.js.map} +1 -1
- package/dist/cdn/chunks/{MediaEditModal-tGK6htBl.js → MediaEditModal-BHTMNHx0.js} +4 -4
- package/dist/cdn/chunks/{MediaEditModal-tGK6htBl.js.map → MediaEditModal-BHTMNHx0.js.map} +1 -1
- package/dist/cdn/chunks/{MediaPanels-BVrQYz2C.js → MediaPanels-BlianNRh.js} +3 -3
- package/dist/cdn/chunks/{MediaPanels-BVrQYz2C.js.map → MediaPanels-BlianNRh.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-DeuNH3re.js → MergeTagInput-B3SLXXzL.js} +3 -3
- package/dist/cdn/chunks/{MergeTagInput-DeuNH3re.js.map → MergeTagInput-B3SLXXzL.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-D7maMGIM.js → MergeTagModeToggle-Dywp9ntA.js} +6 -6
- package/dist/cdn/chunks/{MergeTagModeToggle-D7maMGIM.js.map → MergeTagModeToggle-Dywp9ntA.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-B2xxIU3e.js → MergeTagTextarea-B9TM7FgM.js} +7 -7
- package/dist/cdn/chunks/{MergeTagTextarea-B2xxIU3e.js.map → MergeTagTextarea-B9TM7FgM.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-Bx_Hlw8d.js → ParagraphEditor-CVGtTYta.js} +30 -30
- package/dist/cdn/chunks/{ParagraphEditor-Bx_Hlw8d.js.map → ParagraphEditor-CVGtTYta.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-CPrrWTsT.js → RestoreVersionDialog-Dt_0qOOW.js} +5 -5
- package/dist/cdn/chunks/RestoreVersionDialog-Dt_0qOOW.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-Dze4C9VI.js → RichTextEditorContent-BjN4mnzL.js} +9 -9
- package/dist/cdn/chunks/{RichTextEditorContent-Dze4C9VI.js.map → RichTextEditorContent-BjN4mnzL.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-CXVwnfsy.js → SaveBlockDialog-D9eBjE99.js} +13 -13
- package/dist/cdn/chunks/{SaveBlockDialog-CXVwnfsy.js.map → SaveBlockDialog-D9eBjE99.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BDTmenOE.js → SavedBlocksBrowserModal-ClsTpkdk.js} +9 -9
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BDTmenOE.js.map → SavedBlocksBrowserModal-ClsTpkdk.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-B41Rk_v1.js → SavedBlocksPanels-CxlNHhUs.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPanels-B41Rk_v1.js.map → SavedBlocksPanels-CxlNHhUs.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-B97z_rFH.js → SavedBlocksPickBar-C7_Z8phX.js} +5 -5
- package/dist/cdn/chunks/{SavedBlocksPickBar-B97z_rFH.js.map → SavedBlocksPickBar-C7_Z8phX.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-YwwRbxPc.js → TemplateSettings-B6zDtjSs.js} +12 -12
- package/dist/cdn/chunks/{TemplateSettings-YwwRbxPc.js.map → TemplateSettings-B6zDtjSs.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-BiFP2Cbx.js → TestEmailModal-CJ_QYFua.js} +10 -10
- package/dist/cdn/chunks/{TestEmailModal-BiFP2Cbx.js.map → TestEmailModal-CJ_QYFua.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-BrivPMk2.js → TestEmailPanel-CsFrTq_a.js} +3 -3
- package/dist/cdn/chunks/{TestEmailPanel-BrivPMk2.js.map → TestEmailPanel-CsFrTq_a.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-CzPkkL2s.js → TitleEditor-CuKJptyw.js} +13 -13
- package/dist/cdn/chunks/{TitleEditor-CzPkkL2s.js.map → TitleEditor-CuKJptyw.js.map} +1 -1
- package/dist/cdn/chunks/{ToggleSwitch-BSkySwA1.js → ToggleSwitch-C0w0srN_.js} +2 -2
- package/dist/cdn/chunks/{ToggleSwitch-BSkySwA1.js.map → ToggleSwitch-C0w0srN_.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-VH07SzX7.js → Toolbar-TS2WwlPW.js} +302 -302
- package/dist/cdn/chunks/Toolbar-TS2WwlPW.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-DMe6J811.js → TplModal-CsadClrH.js} +6 -6
- package/dist/cdn/chunks/{TplModal-DMe6J811.js.map → TplModal-CsadClrH.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-DkwbKhBl.js → VersionHistoryMenu-BNPxnWiO.js} +9 -9
- package/dist/cdn/chunks/{VersionHistoryMenu-DkwbKhBl.js.map → VersionHistoryMenu-BNPxnWiO.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-CgxhMRAl.js → VersionHistoryPanels-CieY91f0.js} +3 -3
- package/dist/cdn/chunks/{VersionHistoryPanels-CgxhMRAl.js.map → VersionHistoryPanels-CieY91f0.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-WVBDBrwQ.js → VersionPreviewBanner-BldFvgxJ.js} +4 -4
- package/dist/cdn/chunks/{VersionPreviewBanner-WVBDBrwQ.js.map → VersionPreviewBanner-BldFvgxJ.js.map} +1 -1
- package/dist/cdn/chunks/{WrapperBlock-CCCIcqe2.js → WrapperBlock-DtnRuKWE.js} +6 -6
- package/dist/cdn/chunks/{WrapperBlock-CCCIcqe2.js.map → WrapperBlock-DtnRuKWE.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-CzYA5DF9.js → blockTypeIcons-19xd5ZPi.js} +6 -6
- package/dist/cdn/chunks/{blockTypeIcons-CzYA5DF9.js.map → blockTypeIcons-19xd5ZPi.js.map} +1 -1
- package/dist/cdn/chunks/{composables-D3lsO7Io.js → composables-CUIiW9OD.js} +750 -730
- package/dist/cdn/chunks/composables-CUIiW9OD.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-CE79GB1H.js → createCloudRuntime-B7D04wKf.js} +157 -143
- package/dist/cdn/chunks/createCloudRuntime-B7D04wKf.js.map +1 -0
- package/dist/cdn/chunks/da-CYWJkrTg.js +97 -0
- package/dist/cdn/chunks/da-CYWJkrTg.js.map +1 -0
- package/dist/cdn/chunks/da-qQzj0QGy.js +950 -0
- package/dist/cdn/chunks/da-qQzj0QGy.js.map +1 -0
- package/dist/cdn/chunks/{dist-BzXULHvI.js → dist-BtWMy7UQ.js} +3 -3
- package/dist/cdn/chunks/{dist-BzXULHvI.js.map → dist-BtWMy7UQ.js.map} +1 -1
- package/dist/cdn/chunks/{dist-Cf1pSluo.js → dist-zu1jwYIS.js} +4 -4
- package/dist/cdn/chunks/{dist-Cf1pSluo.js.map → dist-zu1jwYIS.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-DepKdldn.js → draggable-IRVFEZ-b.js} +1535 -1500
- package/dist/cdn/chunks/draggable-IRVFEZ-b.js.map +1 -0
- package/dist/cdn/chunks/{editor-modal-CN69NlOK.js → editor-modal-CarOiAYJ.js} +77 -76
- package/dist/cdn/chunks/{editor-modal-CN69NlOK.js.map → editor-modal-CarOiAYJ.js.map} +1 -1
- package/dist/cdn/chunks/en-B4s_0ryk.js +1 -0
- package/dist/cdn/chunks/{extensions-8dlM-fU4.js → extensions-Cbvk9i08.js} +7 -7
- package/dist/cdn/chunks/{extensions-8dlM-fU4.js.map → extensions-Cbvk9i08.js.map} +1 -1
- package/dist/cdn/chunks/{icons-DHExFLlT.js → icons-Cl4oR2mf.js} +73 -73
- package/dist/cdn/chunks/icons-Cl4oR2mf.js.map +1 -0
- package/dist/cdn/chunks/keys-BQqbBUag.js +11 -0
- package/dist/cdn/chunks/keys-BQqbBUag.js.map +1 -0
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-aWjkotui.js → normalizeMergeTagMarkup-BJ-MnCqF.js} +55 -55
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-aWjkotui.js.map → normalizeMergeTagMarkup-BJ-MnCqF.js.map} +1 -1
- package/dist/cdn/chunks/{preRenderCustomBlocks-Dn6dFUwx.js → preRenderCustomBlocks-D2wISRHq.js} +2 -2
- package/dist/cdn/chunks/{preRenderCustomBlocks-Dn6dFUwx.js.map → preRenderCustomBlocks-D2wISRHq.js.map} +1 -1
- package/dist/cdn/chunks/{sanitizeHtml-B3njfkSy.js → sanitizeHtml-CB7fjHFs.js} +22 -11
- package/dist/cdn/chunks/sanitizeHtml-CB7fjHFs.js.map +1 -0
- package/dist/cdn/chunks/{socialIcons-BFgc3qqJ.js → socialIcons-C_yggK1_.js} +575 -524
- package/dist/cdn/chunks/socialIcons-C_yggK1_.js.map +1 -0
- package/dist/cdn/chunks/{src-C9JWWxAk.js → src-Bp7bZcuD.js} +108 -95
- package/dist/cdn/chunks/src-Bp7bZcuD.js.map +1 -0
- package/dist/cdn/chunks/{src-mXG-Of9A.js → src-CdVAke9t.js} +721 -696
- package/dist/cdn/chunks/src-CdVAke9t.js.map +1 -0
- package/dist/cdn/chunks/{src-GgKlXNxy.js → src-D-URHI0Z.js} +232 -228
- package/dist/cdn/chunks/src-D-URHI0Z.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-C940SvId.js → tiptap-BPiZqxCt.js} +40 -31
- package/dist/cdn/chunks/tiptap-BPiZqxCt.js.map +1 -0
- package/dist/cdn/chunks/{useCloudI18n-Xsih9yRH.js → useCloudI18n-Dr4S2TRW.js} +3 -3
- package/dist/cdn/chunks/{useCloudI18n-Xsih9yRH.js.map → useCloudI18n-Dr4S2TRW.js.map} +1 -1
- package/dist/cdn/chunks/useEditorRoot-B_kf_k-g.js +9 -0
- package/dist/cdn/chunks/{useEditorRoot-Beau2Z_T.js.map → useEditorRoot-B_kf_k-g.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-D8s7HtTn.js → useI18n-CSf-ZpcM.js} +3 -3
- package/dist/cdn/chunks/{useI18n-D8s7HtTn.js.map → useI18n-CSf-ZpcM.js.map} +1 -1
- package/dist/cdn/chunks/useLocalizedDisplay-slFOCPrh.js +33 -0
- package/dist/cdn/chunks/{useLocalizedDisplay-Bgg4qpev.js.map → useLocalizedDisplay-slFOCPrh.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-B0PDeDxl.js → useLogicTag-lPjCGeGC.js} +4 -4
- package/dist/cdn/chunks/{useLogicTag-B0PDeDxl.js.map → useLogicTag-lPjCGeGC.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-BSU75bKk.js → useMergeTag-BKNBwIry.js} +4 -4
- package/dist/cdn/chunks/{useMergeTag-BSU75bKk.js.map → useMergeTag-BKNBwIry.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-esO6wjvU.js → usePopoverPosition-BJFFi8x6.js} +3 -3
- package/dist/cdn/chunks/{usePopoverPosition-esO6wjvU.js.map → usePopoverPosition-BJFFi8x6.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-CJuUu7Xj.js → useScrollToBlock-MI4PP5lk.js} +3 -3
- package/dist/cdn/chunks/{useScrollToBlock-CJuUu7Xj.js.map → useScrollToBlock-MI4PP5lk.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-QqBilClC.js → withCurrentFont-CzTFFaJA.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-QqBilClC.js.map → withCurrentFont-CzTFFaJA.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +685 -663
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-CcuCoJDh.js → check-C7ua4TAK.js} +1 -1
- package/dist/{chevron-down-BfYIbFbC.js → chevron-down-DftQrAkI.js} +1 -1
- package/dist/{chevron-right-DyjFqY35.js → chevron-right-B-DULGbg.js} +1 -1
- package/dist/{chevron-up-BHEIxuS-.js → chevron-up-CeYsyD8c.js} +1 -1
- package/dist/{circle-alert-Tq7kAh9S.js → circle-exclamation-point-DHjORV_I.js} +3 -3
- package/dist/{clock-Df0ZiXwQ.js → clock-CajOtLEZ.js} +1 -1
- package/dist/{composables-DreAt_0A.js → composables-DbjgUQlV.js} +1123 -1103
- package/dist/{createCloudRuntime-CL4tUlDC.js → createCloudRuntime-Cnh2M6iT.js} +42 -28
- package/dist/{createLucideIcon-CfBdtoUw.js → createLucideIcon-D-mELTSY.js} +6 -6
- package/dist/da-CYWJkrTg.js +95 -0
- package/dist/da-qQzj0QGy.js +948 -0
- package/dist/{dist-CX7skkvG.js → dist-A328tG0Z.js} +2 -2
- package/dist/{dist-BjzK1g4Z.js → dist-B15BvV94.js} +2 -2
- package/dist/{dist-DDytHU_6.js → dist-B3G4Yvpd.js} +3 -3
- package/dist/{dist-CiYotUR8.js → dist-B6ptxfPo.js} +3 -3
- package/dist/{dist-0GWMyHtM.js → dist-BmV-2uBJ.js} +2 -2
- package/dist/{dist-CCLRTtJP.js → dist-BxKFi2h_.js} +5 -5
- package/dist/{dist-BMUUt3zJ.js → dist-CAvsz9cW.js} +680 -655
- package/dist/{dist-CsknfjrZ.js → dist-CMBOqk9I.js} +7 -7
- package/dist/{dist-ZrT0vAB6.js → dist-CXTsTO5h.js} +2 -2
- package/dist/{dist-Dq9VnANT.js → dist-D5BUcCjv.js} +2 -2
- package/dist/dist-D9cbSSSx.js +4 -0
- package/dist/{dist-BsumKKh9.js → dist-DAdrn64r.js} +2 -2
- package/dist/{dist-C3avsUq9.js → dist-DENg3ORe.js} +31 -22
- package/dist/{dist-Cr1CLCmx.js → dist-DI_8rB1X.js} +2 -2
- package/dist/dist-ELLEk-lS.js +4 -0
- package/dist/{editor-modal-BD32TXws.js → editor-modal-CgsaLpwB.js} +20 -19
- package/dist/en-DBLcB-CW.js +1 -0
- package/dist/{extensions-DKxHlSd7.js → extensions-7fb-XtNJ.js} +21 -21
- package/dist/{eye-B3psrAqd.js → eye-fe5sKF_K.js} +1 -1
- package/dist/{image-C3yuPDxx.js → image-CUC7SZiW.js} +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/{info-DKja7A68.js → info-DDbLU4pT.js} +1 -1
- package/dist/keys-D9oKZN1h.js +9 -0
- package/dist/{link-DhzPI4Hn.js → link-C2icj0iH.js} +1 -1
- package/dist/{list-DVGn7Ik2.js → list-KYC_Jb5A.js} +1 -1
- package/dist/{loader-circle-DqKWsMHO.js → loader-circle-DmyagWpc.js} +1 -1
- package/dist/{message-circle-C4TonoBs.js → message-circle-ijyWn6UJ.js} +1 -1
- package/dist/{normalizeMergeTagMarkup-Da9JAgx7.js → normalizeMergeTagMarkup-GrXJfXsQ.js} +82 -82
- package/dist/{package-9OkiEO4S.js → package-CKYm_jQY.js} +1 -1
- package/dist/{pencil-M9vkOB7C.js → pencil-C2TRSR-Y.js} +1 -1
- package/dist/{plus-DxZiv9YC.js → plus-CotJVDxb.js} +1 -1
- package/dist/{preRenderCustomBlocks-CdqSp2P7.js → preRenderCustomBlocks-DuXtzD-F.js} +3 -3
- package/dist/{refresh-cw-UY8_sdFG.js → refresh-cw-CuCRV6D5.js} +1 -1
- package/dist/{rotate-ccw-BFTGCpHn.js → rotate-ccw-BlnQ3y6R.js} +1 -1
- package/dist/{runtime-dom.esm-bundler-DlHp8xgy.js → runtime-dom.esm-bundler-nN-jsqr1.js} +20 -20
- package/dist/{sanitizeHtml-wBibnBF4.js → sanitizeHtml-eV4_BpI6.js} +25 -14
- package/dist/{search-RuGJnMEn.js → search-Dxw6oFrZ.js} +1 -1
- package/dist/{send-DGB1ar02.js → send-C-blQBZ9.js} +1 -1
- package/dist/{smartphone-CVA29CU_.js → smartphone-rLz4X-Dd.js} +1 -1
- package/dist/{socialIcons-oo4uL16Y.js → socialIcons-brRkK9Om.js} +600 -549
- package/dist/{sparkles-IHfEwEcd.js → sparkles-JWQlUiSn.js} +1 -1
- package/dist/{square-_Cl44UU6.js → square-DshDy1Il.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +748 -726
- package/dist/{text-align-start-Dqk2Xt_Q.js → text-align-start-CyasaQtr.js} +13 -13
- package/dist/{trash-Cr7rD5Hh.js → trash-B1lZp2Tv.js} +1 -1
- package/dist/{triangle-alert-CKcpwtUj.js → triangle-exclamation-point-BhJvBEoT.js} +3 -3
- package/dist/{upload-DR9pqVON.js → upload-CNK8JX38.js} +1 -1
- package/dist/{useCloudI18n-BczJoFf4.js → useCloudI18n-HhCZYRV6.js} +2 -2
- package/dist/useEditorRoot-B0Njczhx.js +7 -0
- package/dist/{useI18n-zeWYtWSv.js → useI18n-CM9vKbYc.js} +2 -2
- package/dist/{cdn/chunks/useLocalizedDisplay-Bgg4qpev.js → useLocalizedDisplay-DoaT7nWk.js} +2 -4
- package/dist/{useLogicTag-B4Zpk3eo.js → useLogicTag-cTC2KbWd.js} +3 -3
- package/dist/{useMergeTag-B5qlq8px.js → useMergeTag-D2YDZ8vR.js} +3 -3
- package/dist/{usePopoverPosition-Br3zt_MQ.js → usePopoverPosition-CVRzzLkC.js} +2 -2
- package/dist/{useScrollToBlock-BfOzc1Z6.js → useScrollToBlock-vf_KD0FM.js} +3 -3
- package/dist/{vue.runtime.esm-bundler-BJXc_Mri.js → vue.runtime.esm-bundler-BE5V8ADU.js} +414 -362
- package/dist/{withCurrentFont-m_PHcOD0.js → withCurrentFont-DAmED4fN.js} +1 -1
- package/dist/{x-DZSFHafL.js → x-DbLX5Qdm.js} +1 -1
- package/package.json +23 -23
- package/dist/AiPanels-CwKmXzyr.js +0 -31
- package/dist/CommentsPanel-B5NqPMmY.js +0 -16
- package/dist/CommentsSidebar-BDrcrDxS.js +0 -526
- package/dist/cdn/chunks/AiChatPanel-C2gpq4kP.js.map +0 -1
- package/dist/cdn/chunks/AiPanels-Cx3PE2mE.js +0 -32
- package/dist/cdn/chunks/AiPanels-Cx3PE2mE.js.map +0 -1
- package/dist/cdn/chunks/AiRewriteMenu-CnkyjPEu.js.map +0 -1
- package/dist/cdn/chunks/BlockIssueBadge-DncZ-HDf.js.map +0 -1
- package/dist/cdn/chunks/BlockPreviewCanvas-CCSEzL46.js.map +0 -1
- package/dist/cdn/chunks/CloudPanels-CRztnw4M.js.map +0 -1
- package/dist/cdn/chunks/CommentsPanel-lgjJNrrY.js +0 -18
- package/dist/cdn/chunks/CommentsPanel-lgjJNrrY.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-DTold7iy.js +0 -496
- package/dist/cdn/chunks/CommentsSidebar-DTold7iy.js.map +0 -1
- package/dist/cdn/chunks/IssuesPanel-CrplCzo8.js.map +0 -1
- package/dist/cdn/chunks/LanguageMenu-B6MNInCL.js.map +0 -1
- package/dist/cdn/chunks/RestoreVersionDialog-CPrrWTsT.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-VH07SzX7.js.map +0 -1
- package/dist/cdn/chunks/composables-D3lsO7Io.js.map +0 -1
- package/dist/cdn/chunks/createCloudRuntime-CE79GB1H.js.map +0 -1
- package/dist/cdn/chunks/draggable-DepKdldn.js.map +0 -1
- package/dist/cdn/chunks/en-Bcz4gS9U.js +0 -1
- package/dist/cdn/chunks/icons-DHExFLlT.js.map +0 -1
- package/dist/cdn/chunks/keys-BUmIvYy3.js +0 -11
- package/dist/cdn/chunks/keys-BUmIvYy3.js.map +0 -1
- package/dist/cdn/chunks/sanitizeHtml-B3njfkSy.js.map +0 -1
- package/dist/cdn/chunks/socialIcons-BFgc3qqJ.js.map +0 -1
- package/dist/cdn/chunks/src-C9JWWxAk.js.map +0 -1
- package/dist/cdn/chunks/src-GgKlXNxy.js.map +0 -1
- package/dist/cdn/chunks/src-mXG-Of9A.js.map +0 -1
- package/dist/cdn/chunks/tiptap-C940SvId.js.map +0 -1
- package/dist/cdn/chunks/useEditorRoot-Beau2Z_T.js +0 -9
- package/dist/dist-B_0FPmoy.js +0 -4
- package/dist/dist-DKV9m4Uu.js +0 -4
- package/dist/en-Dgs_-NBw.js +0 -1
- package/dist/keys-w_VRjoMu.js +0 -9
- package/dist/useEditorRoot-BcXKhM_8.js +0 -7
- package/dist/useLocalizedDisplay-Cbhx208c.js +0 -31
|
@@ -45,25 +45,25 @@ var s = {
|
|
|
45
45
|
2: 28,
|
|
46
46
|
3: 22,
|
|
47
47
|
4: 18
|
|
48
|
-
}, c = 1.3, l = {
|
|
48
|
+
}, c = 1.3, l = 1.2, u = {
|
|
49
49
|
paragraphGap: 8,
|
|
50
50
|
listMarginY: 8,
|
|
51
51
|
listPaddingLeft: 24,
|
|
52
52
|
listItemMarginY: 4
|
|
53
|
-
},
|
|
53
|
+
}, d = [
|
|
54
54
|
"cover",
|
|
55
55
|
"contain",
|
|
56
56
|
"auto"
|
|
57
|
-
],
|
|
57
|
+
], f = [
|
|
58
58
|
"left",
|
|
59
59
|
"center",
|
|
60
60
|
"right"
|
|
61
|
-
],
|
|
61
|
+
], p = [
|
|
62
62
|
"top",
|
|
63
63
|
"center",
|
|
64
64
|
"bottom"
|
|
65
65
|
];
|
|
66
|
-
function
|
|
66
|
+
function ee(e) {
|
|
67
67
|
return {
|
|
68
68
|
url: e,
|
|
69
69
|
size: "cover",
|
|
@@ -74,7 +74,7 @@ function p(e) {
|
|
|
74
74
|
repeat: !1
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function te(e) {
|
|
78
78
|
let t = "";
|
|
79
79
|
for (let n of e) {
|
|
80
80
|
let e = n.charCodeAt(0);
|
|
@@ -82,36 +82,36 @@ function m(e) {
|
|
|
82
82
|
}
|
|
83
83
|
return t;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function ne(e) {
|
|
86
86
|
let t = typeof e?.url == "string" ? e.url.trim() : "";
|
|
87
87
|
if (!e || !t) return null;
|
|
88
|
-
let n =
|
|
88
|
+
let n = d.includes(e.size) ? e.size : "cover", r = e.position, i = r && f.includes(r.x) ? r.x : "center", a = r && p.includes(r.y) ? r.y : "center";
|
|
89
89
|
return {
|
|
90
|
-
url:
|
|
90
|
+
url: te(t),
|
|
91
91
|
size: n,
|
|
92
92
|
position: `${i} ${a}`,
|
|
93
93
|
repeat: e.repeat ? "repeat" : "no-repeat"
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
96
|
// ../types/src/hero.ts
|
|
97
|
-
var
|
|
97
|
+
var re = [
|
|
98
98
|
"top",
|
|
99
99
|
"middle",
|
|
100
100
|
"bottom"
|
|
101
101
|
];
|
|
102
|
-
function
|
|
102
|
+
function ie(e) {
|
|
103
103
|
let t = e.hero;
|
|
104
104
|
if (!t || typeof t != "object") return null;
|
|
105
105
|
if (e.columns !== "1") return {
|
|
106
106
|
applied: !1,
|
|
107
107
|
reason: "columns"
|
|
108
108
|
};
|
|
109
|
-
let n =
|
|
109
|
+
let n = ne(e.backgroundImage);
|
|
110
110
|
if (n === null) return {
|
|
111
111
|
applied: !1,
|
|
112
112
|
reason: "image"
|
|
113
113
|
};
|
|
114
|
-
let r =
|
|
114
|
+
let r = oe(e.backgroundImage), i = ae(t.height) ? Math.round(t.height) : "image";
|
|
115
115
|
return i === "image" && r === null ? {
|
|
116
116
|
applied: !1,
|
|
117
117
|
reason: "size"
|
|
@@ -119,19 +119,19 @@ function ne(e) {
|
|
|
119
119
|
applied: !0,
|
|
120
120
|
image: n,
|
|
121
121
|
height: i,
|
|
122
|
-
verticalAlign:
|
|
122
|
+
verticalAlign: re.includes(t.verticalAlign) ? t.verticalAlign : "middle",
|
|
123
123
|
aspectRatio: r
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function ae(e) {
|
|
127
127
|
return typeof e == "number" && Number.isFinite(e) && e >= 1;
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function oe(e) {
|
|
130
130
|
let t = e?.naturalWidth, n = e?.naturalHeight;
|
|
131
131
|
return typeof t != "number" || typeof n != "number" || !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 || n <= 0 ? null : n / t;
|
|
132
132
|
}
|
|
133
133
|
// ../types/src/social.ts
|
|
134
|
-
var
|
|
134
|
+
var se = {
|
|
135
135
|
facebook: {
|
|
136
136
|
color: "#1877F2",
|
|
137
137
|
path: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"
|
|
@@ -204,36 +204,36 @@ var ae = {
|
|
|
204
204
|
color: "#1769FF",
|
|
205
205
|
path: "M22 7h-7V5h7v2zm1.726 10c-.442 1.297-2.029 3-5.101 3-3.074 0-5.564-1.729-5.564-5.675 0-3.91 2.325-5.92 5.466-5.92 3.082 0 4.964 1.782 5.375 4.426.078.506.109 1.188.095 2.14H15.97c.13 3.211 3.483 3.312 4.588 2.029h3.168zm-7.686-4h4.965c-.105-1.547-1.136-2.219-2.477-2.219-1.466 0-2.277.768-2.488 2.219zm-9.574 6.988H0V5.021h6.953c5.476.081 5.58 5.444 2.72 6.906 3.461 1.26 3.577 8.061-3.207 8.061zM3 11h3.584c2.508 0 2.906-3-.312-3H3v3zm3.391 3H3v3.016h3.341c3.055 0 2.868-3.016.05-3.016z"
|
|
206
206
|
}
|
|
207
|
-
},
|
|
207
|
+
}, ce = {
|
|
208
208
|
dark: "#1f1f1f",
|
|
209
209
|
light: "#ffffff"
|
|
210
210
|
};
|
|
211
|
-
function
|
|
211
|
+
function le(e) {
|
|
212
212
|
return e === "dark" || e === "light" ? e : void 0;
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
let n =
|
|
214
|
+
function ue(e, t) {
|
|
215
|
+
let n = le(t);
|
|
216
216
|
return {
|
|
217
|
-
fill: n ?
|
|
218
|
-
onFill: n === "light" ?
|
|
217
|
+
fill: n ? ce[n] : se[e].color,
|
|
218
|
+
onFill: n === "light" ? ce.dark : "#ffffff"
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
let n =
|
|
221
|
+
function de(e, t) {
|
|
222
|
+
let n = le(t);
|
|
223
223
|
return n ? `${e}-${n}` : e;
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
if (
|
|
227
|
-
color:
|
|
225
|
+
function fe(e, t) {
|
|
226
|
+
if (le(t) === "dark" && (e === "plain" || e === "outlined")) return {
|
|
227
|
+
color: ce.light,
|
|
228
228
|
opacity: .6,
|
|
229
229
|
width: 1.4
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function pe(e) {
|
|
233
233
|
return e === "plain" ? .84 : .6;
|
|
234
234
|
}
|
|
235
235
|
// ../types/src/element-ids.ts
|
|
236
|
-
function
|
|
236
|
+
function me(e) {
|
|
237
237
|
let t = [], n = (e, n) => {
|
|
238
238
|
typeof e == "string" && /[./]/.test(e) && t.push({
|
|
239
239
|
path: n,
|
|
@@ -252,7 +252,7 @@ function fe(e) {
|
|
|
252
252
|
return r(e.blocks, "blocks"), t;
|
|
253
253
|
}
|
|
254
254
|
// ../types/src/clone.ts
|
|
255
|
-
function
|
|
255
|
+
function m(e) {
|
|
256
256
|
let t = [];
|
|
257
257
|
return JSON.parse(JSON.stringify(e, function(e, n) {
|
|
258
258
|
if (typeof n != "object" || !n) return n;
|
|
@@ -261,22 +261,22 @@ function h(e) {
|
|
|
261
261
|
}));
|
|
262
262
|
}
|
|
263
263
|
// ../types/src/deep-equal.ts
|
|
264
|
-
function
|
|
264
|
+
function he(e) {
|
|
265
265
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function h(e, t) {
|
|
268
268
|
if (e === t) return !0;
|
|
269
|
-
if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) =>
|
|
270
|
-
if (
|
|
271
|
-
if (!
|
|
269
|
+
if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => h(e, t[n]));
|
|
270
|
+
if (he(e)) {
|
|
271
|
+
if (!he(t)) return !1;
|
|
272
272
|
let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
273
|
-
for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !
|
|
273
|
+
for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !h(e[r], t[r])) return !1;
|
|
274
274
|
return !0;
|
|
275
275
|
}
|
|
276
276
|
return !1;
|
|
277
277
|
}
|
|
278
278
|
// ../types/src/config.ts
|
|
279
|
-
var
|
|
279
|
+
var ge = class extends Error {
|
|
280
280
|
statusCode;
|
|
281
281
|
code;
|
|
282
282
|
constructor(e, t, n, r) {
|
|
@@ -291,7 +291,7 @@ var me = class extends Error {
|
|
|
291
291
|
get isServerError() {
|
|
292
292
|
return this.statusCode !== void 0 && this.statusCode >= 500;
|
|
293
293
|
}
|
|
294
|
-
},
|
|
294
|
+
}, _e = {
|
|
295
295
|
title: ["content"],
|
|
296
296
|
paragraph: ["content"],
|
|
297
297
|
html: ["content"],
|
|
@@ -308,58 +308,58 @@ var me = class extends Error {
|
|
|
308
308
|
"expiredMessage"
|
|
309
309
|
],
|
|
310
310
|
custom: ["fieldValues.*"]
|
|
311
|
-
},
|
|
312
|
-
function
|
|
311
|
+
}, g = ["preheaderText"];
|
|
312
|
+
function ve(e) {
|
|
313
313
|
return typeof e == "string" && /^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/.test(e);
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function _(e) {
|
|
316
316
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
317
317
|
}
|
|
318
|
-
var
|
|
318
|
+
var ye = /* @__PURE__ */ new Set([
|
|
319
319
|
"__proto__",
|
|
320
320
|
"constructor",
|
|
321
321
|
"prototype"
|
|
322
322
|
]);
|
|
323
|
-
function
|
|
324
|
-
return e.split(".").every((e) => e !== "" && !
|
|
323
|
+
function v(e) {
|
|
324
|
+
return e.split(".").every((e) => e !== "" && !ye.has(e));
|
|
325
325
|
}
|
|
326
|
-
function
|
|
327
|
-
if (!
|
|
326
|
+
function be(e, t) {
|
|
327
|
+
if (!ye.has(t)) return Array.isArray(e) ? e.find((e) => _(e) && e.id === t) : _(e) && Object.hasOwn(e, t) ? e[t] : void 0;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
return t.split(".").reduce(
|
|
329
|
+
function y(e, t) {
|
|
330
|
+
return t.split(".").reduce(be, e);
|
|
331
331
|
}
|
|
332
|
-
function
|
|
333
|
-
let t =
|
|
332
|
+
function xe(e) {
|
|
333
|
+
let t = m(e);
|
|
334
334
|
for (let [n, r] of Object.entries(t.l10n ?? {})) {
|
|
335
335
|
for (let t of ["text", "set"]) {
|
|
336
336
|
for (let n of Object.keys(r[t] ?? {})) {
|
|
337
|
-
let i = n.includes(".") ?
|
|
338
|
-
|
|
337
|
+
let i = n.includes(".") ? y(e, n.slice(0, n.lastIndexOf("."))) : e;
|
|
338
|
+
v(n) && (t !== "text" && _(i) || y(e, n) !== void 0) || delete r[t][n];
|
|
339
339
|
}
|
|
340
340
|
r[t] && !Object.keys(r[t]).length && delete r[t];
|
|
341
341
|
}
|
|
342
342
|
Object.keys(r).length || delete t.l10n[n];
|
|
343
343
|
}
|
|
344
|
-
return t.l10n && !Object.keys(t.l10n).length && delete t.l10n,
|
|
344
|
+
return t.l10n && !Object.keys(t.l10n).length && delete t.l10n, h(t, e) ? e : t;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
let t =
|
|
346
|
+
function Se(e) {
|
|
347
|
+
let t = xe(e);
|
|
348
348
|
if (t.type === "wrapper") {
|
|
349
|
-
let e = t.children.map(
|
|
349
|
+
let e = t.children.map(Se);
|
|
350
350
|
return e.some((e, n) => e !== t.children[n]) ? {
|
|
351
351
|
...t,
|
|
352
352
|
children: e
|
|
353
353
|
} : t;
|
|
354
354
|
}
|
|
355
355
|
if (t.type !== "section") return t;
|
|
356
|
-
let n = t.children.map((e) => e.map(
|
|
356
|
+
let n = t.children.map((e) => e.map(Se));
|
|
357
357
|
return n.some((e, n) => e.some((e, r) => e !== t.children[n][r])) ? {
|
|
358
358
|
...t,
|
|
359
359
|
children: n
|
|
360
360
|
} : t;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Ce(e, t, n) {
|
|
363
363
|
if (e.type === "custom") return !1;
|
|
364
364
|
if (e.type === "section") return t === "columns";
|
|
365
365
|
let r = e.type === "menu" ? "items" : e.type === "social" ? "icons" : e.type === "table" ? "rows" : null;
|
|
@@ -372,44 +372,44 @@ function xe(e, t, n) {
|
|
|
372
372
|
let o = a.split(".").length;
|
|
373
373
|
if (i[o] === "id") return !0;
|
|
374
374
|
if (i.length !== o) return !1;
|
|
375
|
-
let s =
|
|
376
|
-
if (!
|
|
375
|
+
let s = y(e, a);
|
|
376
|
+
if (!_(s) || !_(n) || s.id !== n.id) return !0;
|
|
377
377
|
if (e.type === "table" && o === 2) {
|
|
378
|
-
let e = (e) => Array.isArray(e) ? e.map((e) =>
|
|
379
|
-
return !
|
|
378
|
+
let e = (e) => Array.isArray(e) ? e.map((e) => _(e) ? e.id : void 0) : null;
|
|
379
|
+
return !h(e(s.cells), e(n.cells));
|
|
380
380
|
}
|
|
381
381
|
return !1;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
384
|
-
return
|
|
383
|
+
function we(e) {
|
|
384
|
+
return xe(e);
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
if (!
|
|
388
|
-
let r = t.split("."), i = r.pop(), a = r.reduce(
|
|
386
|
+
function b(e, t, n) {
|
|
387
|
+
if (!v(t)) return !1;
|
|
388
|
+
let r = t.split("."), i = r.pop(), a = r.reduce(be, e);
|
|
389
389
|
if (Array.isArray(a)) {
|
|
390
|
-
let e = a.findIndex((e) =>
|
|
391
|
-
return e < 0 ? !1 : (a[e] =
|
|
390
|
+
let e = a.findIndex((e) => _(e) && e.id === i);
|
|
391
|
+
return e < 0 ? !1 : (a[e] = m(n), !0);
|
|
392
392
|
}
|
|
393
|
-
return
|
|
393
|
+
return _(a) ? (n === null ? delete a[i] : a[i] = m(n), !0) : !1;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function Te(e, t) {
|
|
396
396
|
let [n, ...r] = t.split(".");
|
|
397
397
|
if (n === void 0) return [""];
|
|
398
398
|
let i = [];
|
|
399
399
|
if (n === "*") {
|
|
400
400
|
let t = Array.isArray(e) ? e : [];
|
|
401
|
-
for (let e of t) if (
|
|
401
|
+
for (let e of t) if (_(e) && typeof e.id == "string") for (let t of r.length ? Te(e, r.join(".")) : [""]) i.push(t ? `${e.id}.${t}` : e.id);
|
|
402
402
|
return i;
|
|
403
403
|
}
|
|
404
|
-
let a =
|
|
404
|
+
let a = _(e) ? e[n] : void 0;
|
|
405
405
|
if (r.length === 0) return a === void 0 ? [] : [n];
|
|
406
|
-
for (let e of
|
|
406
|
+
for (let e of Te(a, r.join("."))) i.push(`${n}.${e}`);
|
|
407
407
|
return i;
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function x(e, t = []) {
|
|
410
410
|
if (e.type === "custom") {
|
|
411
411
|
let n = t.find((t) => t.type === e.customType), r = new Set((n?.fields ?? []).filter((e) => e.type === "text" || e.type === "textarea").map((e) => e.key)), i = e.fieldValues;
|
|
412
|
-
return
|
|
412
|
+
return _(i) ? Object.keys(i).filter((e) => r.has(e)).map((e) => `fieldValues.${e}`) : [];
|
|
413
413
|
}
|
|
414
414
|
let n = (e) => !e.id.includes("."), r = e.type === "menu" ? {
|
|
415
415
|
...e,
|
|
@@ -421,118 +421,127 @@ function S(e, t = []) {
|
|
|
421
421
|
cells: e.cells.filter(n)
|
|
422
422
|
}))
|
|
423
423
|
} : e;
|
|
424
|
-
return (
|
|
424
|
+
return (_e[e.type] ?? []).flatMap((e) => Te(r, e));
|
|
425
425
|
}
|
|
426
|
-
function
|
|
427
|
-
return (
|
|
426
|
+
function Ee(e, t) {
|
|
427
|
+
return (_e[e] ?? []).some((e) => {
|
|
428
428
|
let n = e.split("."), r = t.split(".");
|
|
429
429
|
return n.length === r.length && n.every((e, t) => e === "*" || e === r[t]);
|
|
430
430
|
});
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function S(e) {
|
|
433
433
|
let t = 2166136261;
|
|
434
434
|
for (let n of new TextEncoder().encode(e)) t ^= n, t = Math.imul(t, 16777619) >>> 0;
|
|
435
435
|
return t.toString(16).padStart(8, "0");
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function De(e) {
|
|
438
438
|
let { l10n: t, ...n } = e;
|
|
439
439
|
return n;
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function C(e = {}) {
|
|
442
442
|
return Object.entries(e).sort(([e], [t]) => e.split(".").length - t.split(".").length);
|
|
443
443
|
}
|
|
444
|
-
function
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
444
|
+
function Oe(e, t, n) {
|
|
445
|
+
return ke(e, m(De(e)), t, n);
|
|
446
|
+
}
|
|
447
|
+
function ke(e, t, n, r) {
|
|
448
|
+
let i = e;
|
|
449
|
+
if (n === r) return t;
|
|
450
|
+
let a = i.l10n?.[n];
|
|
451
|
+
if (!a) return t;
|
|
452
|
+
for (let [e, n] of C(a.set)) b(t, e, n);
|
|
453
|
+
for (let [n, r] of Object.entries(a.text ?? {})) y(e, n) !== void 0 && b(t, n, r.value);
|
|
454
|
+
return e.type === "custom" && (Object.keys(a.text ?? {}).length > 0 || Object.keys(a.set ?? {}).length > 0) && delete t.renderedHtml, t;
|
|
455
|
+
}
|
|
456
|
+
function Ae(e, t, n) {
|
|
457
|
+
let r = e;
|
|
458
|
+
if (r.type !== "section" && r.type !== "wrapper" || !Array.isArray(r.children)) return Oe(e, t, n);
|
|
459
|
+
let { children: i, ...a } = De(r), o = m(a);
|
|
460
|
+
return o.children = i, ke(e, o, t, n);
|
|
452
461
|
}
|
|
453
|
-
function
|
|
462
|
+
function je(e, t) {
|
|
454
463
|
return e.l10n?.[t]?.hidden === !0;
|
|
455
464
|
}
|
|
456
|
-
function
|
|
465
|
+
function Me(e) {
|
|
457
466
|
let { locales: t, l10n: n, ...r } = e;
|
|
458
467
|
return r;
|
|
459
468
|
}
|
|
460
|
-
function
|
|
469
|
+
function w(e) {
|
|
461
470
|
return e.settings?.locale ?? "en";
|
|
462
471
|
}
|
|
463
|
-
function
|
|
464
|
-
let r =
|
|
472
|
+
function Ne(e, t, n) {
|
|
473
|
+
let r = w(e);
|
|
465
474
|
if (t !== r && !(e.settings?.locales ?? []).includes(t)) {
|
|
466
475
|
if (n?.missing === "default") t = r;
|
|
467
|
-
else throw new
|
|
476
|
+
else throw new ge(`This template has no "${t}" version.`, void 0, "unknown_locale");
|
|
468
477
|
}
|
|
469
478
|
let i = (e) => e.flatMap((e) => {
|
|
470
|
-
if (t !== r &&
|
|
471
|
-
let n =
|
|
472
|
-
return
|
|
473
|
-
}), a =
|
|
479
|
+
if (t !== r && je(e, t)) return [];
|
|
480
|
+
let n = e.l10n?.[t], a = [...Object.keys(n?.set ?? {}), ...Object.keys(n?.text ?? {})].some((e) => e.startsWith("children.")) ? Oe(e, t, r) : Ae(e, t, r);
|
|
481
|
+
return a.type === "section" && Array.isArray(a.children) ? a.children = a.children.map((e) => i(e)) : a.type === "wrapper" && Array.isArray(a.children) && (a.children = i(a.children)), [a];
|
|
482
|
+
}), a = m(Me(e.settings)), o = e.settings?.l10n?.[t];
|
|
474
483
|
if (t !== r && o) {
|
|
475
|
-
for (let [e, t] of
|
|
476
|
-
for (let [t, n] of Object.entries(o.text ?? {}))
|
|
484
|
+
for (let [e, t] of C(o.set)) b(a, e, t);
|
|
485
|
+
for (let [t, n] of Object.entries(o.text ?? {})) y(e.settings, t) !== void 0 && b(a, t, n.value);
|
|
477
486
|
}
|
|
478
487
|
return a.locale = t, {
|
|
479
488
|
blocks: i(e.blocks),
|
|
480
489
|
settings: a
|
|
481
490
|
};
|
|
482
491
|
}
|
|
483
|
-
function
|
|
492
|
+
function Pe(e, t, n = []) {
|
|
484
493
|
let r = {
|
|
485
494
|
translated: [],
|
|
486
495
|
missing: [],
|
|
487
496
|
stale: []
|
|
488
497
|
}, i = (e, t, n, i) => {
|
|
489
498
|
for (let a of n) {
|
|
490
|
-
let n =
|
|
499
|
+
let n = y(t, a);
|
|
491
500
|
if (typeof n != "string") continue;
|
|
492
501
|
let o = i?.[a];
|
|
493
|
-
(o || n !== "") && (o ? o.sourceHash ===
|
|
502
|
+
(o || n !== "") && (o ? o.sourceHash === S(n) ? r.translated.push(`${e}/${a}`) : r.stale.push(`${e}/${a}`) : r.missing.push(`${e}/${a}`));
|
|
494
503
|
}
|
|
495
504
|
}, a = (e) => {
|
|
496
505
|
for (let r of e) {
|
|
497
|
-
if (
|
|
506
|
+
if (je(r, t)) continue;
|
|
498
507
|
let e = r.l10n?.[t];
|
|
499
|
-
i(r.id, r,
|
|
508
|
+
i(r.id, r, x(r, n), e?.text);
|
|
500
509
|
let o = r.children;
|
|
501
510
|
if (r.type === "section" && Array.isArray(o)) for (let e of o) a(e);
|
|
502
511
|
else r.type === "wrapper" && Array.isArray(o) && a(o);
|
|
503
512
|
}
|
|
504
513
|
};
|
|
505
|
-
return a(e.blocks), i("settings", e.settings, [...
|
|
514
|
+
return a(e.blocks), i("settings", e.settings, [...g], e.settings?.l10n?.[t]?.text), r;
|
|
506
515
|
}
|
|
507
|
-
function
|
|
508
|
-
if (t ===
|
|
516
|
+
function Fe(e, t) {
|
|
517
|
+
if (t === w(e) || !e.settings.locales?.includes(t)) return [];
|
|
509
518
|
let n = [], r = (e) => {
|
|
510
|
-
for (let i of e)
|
|
519
|
+
for (let i of e) je(i, t) && n.push(i.id), i.type === "section" ? i.children.forEach(r) : i.type === "wrapper" && r(i.children);
|
|
511
520
|
};
|
|
512
521
|
return r(e.blocks), n;
|
|
513
522
|
}
|
|
514
|
-
function
|
|
515
|
-
if (t ===
|
|
523
|
+
function Ie(e, t, n = []) {
|
|
524
|
+
if (t === w(e) || !e.settings.locales?.includes(t)) return [];
|
|
516
525
|
let r = [], i = (e, n, i) => {
|
|
517
|
-
r.push(...
|
|
526
|
+
r.push(...Le(n, t, i).map((t) => `${e}/${t}`));
|
|
518
527
|
}, a = (e) => {
|
|
519
|
-
for (let t of e) i(t.id, t,
|
|
528
|
+
for (let t of e) i(t.id, t, x(t, n)), t.type === "section" ? t.children.forEach(a) : t.type === "wrapper" && a(t.children);
|
|
520
529
|
};
|
|
521
|
-
return a(e.blocks), i("settings", e.settings,
|
|
530
|
+
return a(e.blocks), i("settings", e.settings, g), r;
|
|
522
531
|
}
|
|
523
|
-
function
|
|
532
|
+
function Le(e, t, n) {
|
|
524
533
|
let r = e.l10n?.[t];
|
|
525
534
|
return n.filter((t) => {
|
|
526
|
-
let n =
|
|
527
|
-
return typeof n != "string" || n === "" || r?.text?.[t] ? !1 : !Object.keys(r?.set ?? {}).some((n) => (t === n || t.startsWith(`${n}.`)) && (!n.includes(".") ||
|
|
535
|
+
let n = y(e, t);
|
|
536
|
+
return typeof n != "string" || n === "" || r?.text?.[t] ? !1 : !Object.keys(r?.set ?? {}).some((n) => (t === n || t.startsWith(`${n}.`)) && (!n.includes(".") || y(e, n.slice(0, n.lastIndexOf("."))) !== void 0));
|
|
528
537
|
});
|
|
529
538
|
}
|
|
530
|
-
function
|
|
531
|
-
let r =
|
|
532
|
-
let a =
|
|
539
|
+
function Re(e, t, n = {}) {
|
|
540
|
+
let r = w(e), i = (e, n, i) => {
|
|
541
|
+
let a = Le(e, t, i), o = m(e.l10n ?? {}), s = o[t] ?? {}, c = m(e);
|
|
533
542
|
delete c.l10n;
|
|
534
|
-
for (let [e, t] of
|
|
535
|
-
for (let [t, n] of Object.entries(s.text ?? {}))
|
|
543
|
+
for (let [e, t] of C(s.set)) b(c, e, t);
|
|
544
|
+
for (let [t, n] of Object.entries(s.text ?? {})) y(e, t) !== void 0 && b(c, t, n.value);
|
|
536
545
|
delete o[t];
|
|
537
546
|
let l = {}, u = /* @__PURE__ */ new Set([
|
|
538
547
|
...Object.keys(s.set ?? {}),
|
|
@@ -540,22 +549,22 @@ function Pe(e, t, n = {}) {
|
|
|
540
549
|
...a
|
|
541
550
|
]);
|
|
542
551
|
for (let t of u) {
|
|
543
|
-
let r =
|
|
544
|
-
|
|
552
|
+
let r = y(e, t), i = y(c, t);
|
|
553
|
+
h(r, i) ? (s.text?.[t] || a.includes(t)) && n(t) && typeof r == "string" && r !== "" && ((l.text ??= {})[t] = {
|
|
545
554
|
value: r,
|
|
546
|
-
sourceHash:
|
|
555
|
+
sourceHash: S(r)
|
|
547
556
|
}) : n(t) && typeof r == "string" && typeof i == "string" ? (l.text ??= {})[t] = {
|
|
548
557
|
value: r,
|
|
549
|
-
sourceHash:
|
|
550
|
-
} : (l.set ??= {})[t] = r === void 0 ? null :
|
|
558
|
+
sourceHash: S(i)
|
|
559
|
+
} : (l.set ??= {})[t] = r === void 0 ? null : m(r);
|
|
551
560
|
}
|
|
552
561
|
let d = (e, t) => {
|
|
553
562
|
let n = /* @__PURE__ */ new Set();
|
|
554
563
|
for (let t of Object.keys(e.set ?? {})) {
|
|
555
564
|
let e = t.split(".");
|
|
556
565
|
for (; e.length > 1;) {
|
|
557
|
-
let t =
|
|
558
|
-
if (
|
|
566
|
+
let t = y(c, e.slice(0, -1).join("."));
|
|
567
|
+
if (_(t) || Array.isArray(t) && y(c, e.join(".")) !== void 0) break;
|
|
559
568
|
e.pop();
|
|
560
569
|
}
|
|
561
570
|
let r = e.join(".");
|
|
@@ -563,41 +572,42 @@ function Pe(e, t, n = {}) {
|
|
|
563
572
|
}
|
|
564
573
|
for (let r of n) {
|
|
565
574
|
for (let t of ["text", "set"]) for (let n of Object.keys(e[t] ?? {})) (n === r || n.startsWith(`${r}.`)) && delete e[t][n];
|
|
566
|
-
let n =
|
|
567
|
-
(e.set ??= {})[r] = n === void 0 ? null :
|
|
575
|
+
let n = y(t, r);
|
|
576
|
+
(e.set ??= {})[r] = n === void 0 ? null : m(n);
|
|
568
577
|
}
|
|
569
578
|
e.text && !Object.keys(e.text).length && delete e.text;
|
|
570
579
|
};
|
|
571
580
|
for (let t of Object.values(o)) {
|
|
572
|
-
let n =
|
|
573
|
-
for (let [e, r] of
|
|
574
|
-
for (let [r, i] of Object.entries(t.text ?? {}))
|
|
581
|
+
let n = m(e);
|
|
582
|
+
for (let [e, r] of C(t.set)) b(n, e, r);
|
|
583
|
+
for (let [r, i] of Object.entries(t.text ?? {})) y(e, r) !== void 0 && b(n, r, i.value);
|
|
575
584
|
for (let [n, r] of Object.entries(t.text ?? {})) {
|
|
576
|
-
let i =
|
|
585
|
+
let i = y(c, n);
|
|
577
586
|
if (typeof i != "string") (t.set ??= {})[n] = r.value, delete t.text[n];
|
|
578
587
|
else {
|
|
579
|
-
let t =
|
|
580
|
-
typeof t == "string" && r.sourceHash ===
|
|
588
|
+
let t = y(e, n);
|
|
589
|
+
typeof t == "string" && r.sourceHash === S(t) && (r.sourceHash = S(i));
|
|
581
590
|
}
|
|
582
591
|
}
|
|
583
592
|
d(t, n);
|
|
584
593
|
}
|
|
585
594
|
return Object.keys(l).length && (d(l, e), o[r] = l), Object.keys(o).length && (c.l10n = o), c;
|
|
586
595
|
}, a = (e) => e.map((e) => {
|
|
587
|
-
let t = e.type === "custom" ? [.../* @__PURE__ */ new Set([...Object.hasOwn(n, e.id) ? n[e.id] : [], ...Object.values(e.l10n ?? {}).flatMap((e) => Object.keys(e.text ?? {}))])] :
|
|
588
|
-
return e.type === "custom" && r.type === "custom" && !
|
|
589
|
-
}), o = i(e.settings, (e) =>
|
|
596
|
+
let t = e.type === "custom" ? [.../* @__PURE__ */ new Set([...Object.hasOwn(n, e.id) ? n[e.id] : [], ...Object.values(e.l10n ?? {}).flatMap((e) => Object.keys(e.text ?? {}))])] : x(e), r = i(e, (n) => e.type === "custom" ? t.includes(n) : Ee(e.type, n), t);
|
|
597
|
+
return e.type === "custom" && r.type === "custom" && !h(e.fieldValues, r.fieldValues) && delete r.renderedHtml, r.type === "section" ? r.children = r.children.map(a) : r.type === "wrapper" && (r.children = a(r.children)), r;
|
|
598
|
+
}), o = i(e.settings, (e) => g.includes(e), g);
|
|
590
599
|
return o.locale = t, o.locales = e.settings.locales.map((e) => e === t ? r : e), {
|
|
591
600
|
blocks: a(e.blocks),
|
|
592
601
|
settings: o
|
|
593
602
|
};
|
|
594
603
|
}
|
|
595
604
|
// ../types/src/operations.ts
|
|
596
|
-
|
|
597
|
-
|
|
605
|
+
var ze = "Sections with a wrapper cannot be placed inside wrappers.";
|
|
606
|
+
function Be(e, t, n = []) {
|
|
607
|
+
let r = Object.fromEntries(F(e.blocks).flatMap((e) => {
|
|
598
608
|
if (e.type !== "custom") return [];
|
|
599
|
-
let t =
|
|
600
|
-
return t.length &&
|
|
609
|
+
let t = x(e, n).filter((t) => typeof y(e, t) == "string");
|
|
610
|
+
return t.length && Ke.has(e.id) && D("invalid_operation", 0, qe), t.length ? [[e.id, t]] : [];
|
|
601
611
|
}));
|
|
602
612
|
return {
|
|
603
613
|
op: "setDefaultLocale",
|
|
@@ -605,7 +615,7 @@ function Fe(e, t, n = []) {
|
|
|
605
615
|
...Object.keys(r).length ? { customTextFields: r } : {}
|
|
606
616
|
};
|
|
607
617
|
}
|
|
608
|
-
var
|
|
618
|
+
var T = class extends Error {
|
|
609
619
|
code;
|
|
610
620
|
opIndex;
|
|
611
621
|
blockId;
|
|
@@ -613,173 +623,174 @@ var E = class extends Error {
|
|
|
613
623
|
super(n), this.name = "OperationError", this.code = e, this.opIndex = t, r !== void 0 && (this.blockId = r);
|
|
614
624
|
}
|
|
615
625
|
};
|
|
616
|
-
function
|
|
626
|
+
function Ve(e) {
|
|
617
627
|
return e === "1" ? 1 : e === "3" || e === "1-2-1" ? 3 : e === "4" ? 4 : 2;
|
|
618
628
|
}
|
|
619
|
-
function
|
|
620
|
-
let r =
|
|
621
|
-
return
|
|
629
|
+
function He(e, t, n = {}) {
|
|
630
|
+
let r = m(e);
|
|
631
|
+
return E(r, t, n), r;
|
|
622
632
|
}
|
|
623
|
-
function
|
|
633
|
+
function E(e, t, n = {}) {
|
|
624
634
|
let r = {
|
|
625
635
|
locks: n.locks ?? [],
|
|
626
636
|
session: n.session ?? null
|
|
627
637
|
};
|
|
628
|
-
t.forEach((t, n) =>
|
|
638
|
+
t.forEach((t, n) => dt(e, t, n, r));
|
|
629
639
|
}
|
|
630
|
-
var
|
|
640
|
+
var Ue = /* @__PURE__ */ new Set([
|
|
631
641
|
"id",
|
|
632
642
|
"type",
|
|
633
643
|
"children",
|
|
634
644
|
"l10n"
|
|
635
|
-
]),
|
|
645
|
+
]), We = /* @__PURE__ */ new Set(["locales", "l10n"]), Ge = /* @__PURE__ */ new Set([
|
|
636
646
|
"locale",
|
|
637
647
|
"locales",
|
|
638
648
|
"l10n"
|
|
639
|
-
]),
|
|
649
|
+
]), Ke = /* @__PURE__ */ new Set([
|
|
640
650
|
"__proto__",
|
|
641
651
|
"constructor",
|
|
642
652
|
"prototype"
|
|
643
|
-
]),
|
|
644
|
-
function
|
|
645
|
-
throw new
|
|
653
|
+
]), qe = "customTextFields must map existing custom block ids to lists of string fieldValues paths.";
|
|
654
|
+
function D(e, t, n, r) {
|
|
655
|
+
throw new T(e, t, n, r);
|
|
646
656
|
}
|
|
647
|
-
function
|
|
657
|
+
function O(e) {
|
|
648
658
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
649
659
|
}
|
|
650
|
-
function
|
|
660
|
+
function k(e) {
|
|
651
661
|
return e.type === "section";
|
|
652
662
|
}
|
|
653
|
-
function
|
|
663
|
+
function Je(e) {
|
|
654
664
|
return Array.isArray(e.blocks) ? e.blocks : [];
|
|
655
665
|
}
|
|
656
|
-
function
|
|
666
|
+
function Ye(e) {
|
|
657
667
|
let t = e.children;
|
|
658
668
|
return Array.isArray(t) ? t.map((e) => Array.isArray(e) ? e : []) : [];
|
|
659
669
|
}
|
|
660
|
-
function
|
|
661
|
-
let n =
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
if (!k(r)) continue;
|
|
665
|
-
if (r.id === t) return {
|
|
670
|
+
function* Xe(e, t) {
|
|
671
|
+
for (let n = 0; n < e.length; n++) {
|
|
672
|
+
let r = e[n];
|
|
673
|
+
if (O(r) && (yield {
|
|
666
674
|
block: r,
|
|
667
|
-
list:
|
|
668
|
-
index:
|
|
669
|
-
parent:
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
let a = n[i];
|
|
677
|
-
if (k(a) && a.id === t) return {
|
|
678
|
-
block: a,
|
|
679
|
-
list: n,
|
|
680
|
-
index: i,
|
|
681
|
-
parent: {
|
|
682
|
-
sectionId: r.id,
|
|
683
|
-
column: e
|
|
684
|
-
}
|
|
685
|
-
};
|
|
686
|
-
}
|
|
675
|
+
list: e,
|
|
676
|
+
index: n,
|
|
677
|
+
parent: t
|
|
678
|
+
}, typeof r.id == "string")) {
|
|
679
|
+
if (k(r)) for (let [e, t] of Ye(r).entries()) yield* Xe(t, {
|
|
680
|
+
sectionId: r.id,
|
|
681
|
+
column: e
|
|
682
|
+
});
|
|
683
|
+
else r.type === "wrapper" && Array.isArray(r.children) && (yield* Xe(r.children, { wrapperId: r.id }));
|
|
687
684
|
}
|
|
688
685
|
}
|
|
686
|
+
}
|
|
687
|
+
function A(e, t) {
|
|
688
|
+
for (let n of Xe(Je(e), null)) if (n.block.id === t) return n;
|
|
689
689
|
return null;
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function j(e) {
|
|
692
|
+
if (!O(e)) return [];
|
|
692
693
|
let t = typeof e.id == "string" ? [e.id] : [];
|
|
693
|
-
if (
|
|
694
|
+
if (k(e)) for (let n of Ye(e)) for (let e of Ze(n)) t.push(e);
|
|
695
|
+
else if (e.type === "wrapper" && Array.isArray(e.children)) for (let n of Ze(e.children)) t.push(n);
|
|
694
696
|
return t;
|
|
695
697
|
}
|
|
696
|
-
function
|
|
697
|
-
return e.flatMap(
|
|
698
|
+
function Ze(e) {
|
|
699
|
+
return e.flatMap(j);
|
|
698
700
|
}
|
|
699
|
-
function
|
|
700
|
-
return typeof e.blockId != "string" || e.blockId === "" ?
|
|
701
|
+
function M(e, t) {
|
|
702
|
+
return typeof e.blockId != "string" || e.blockId === "" ? D("invalid_operation", t, "blockId must be a block id.") : e.blockId;
|
|
701
703
|
}
|
|
702
|
-
function
|
|
704
|
+
function Qe(e, t) {
|
|
703
705
|
let n = e.parent;
|
|
704
|
-
return n === null ? null :
|
|
706
|
+
return n === null ? null : O(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
|
|
705
707
|
sectionId: n.sectionId,
|
|
706
708
|
column: n.column
|
|
707
|
-
} : O("invalid_operation", t, "parent must be null
|
|
709
|
+
} : O(n) && typeof n.wrapperId == "string" && n.wrapperId !== "" && !Object.hasOwn(n, "sectionId") && !Object.hasOwn(n, "column") ? { wrapperId: n.wrapperId } : D("invalid_operation", t, "parent must be null, { \"sectionId\", \"column\" }, or { \"wrapperId\" }.");
|
|
708
710
|
}
|
|
709
|
-
function
|
|
711
|
+
function $e(e, t) {
|
|
710
712
|
let n = e.after;
|
|
711
|
-
return n === null ? null : typeof n == "string" && n !== "" ? n :
|
|
713
|
+
return n === null ? null : typeof n == "string" && n !== "" ? n : D("invalid_operation", t, "after must be null or a block id.");
|
|
712
714
|
}
|
|
713
|
-
function
|
|
715
|
+
function N(e, t) {
|
|
714
716
|
let n = e.expect;
|
|
715
|
-
return n == null ? null :
|
|
717
|
+
return n == null ? null : O(n) ? n : D("invalid_operation", t, "expect must be an object.");
|
|
716
718
|
}
|
|
717
|
-
function
|
|
719
|
+
function et(e, t, n) {
|
|
718
720
|
let r = e.set ?? null, i = e.unset ?? [];
|
|
719
|
-
(r === null ||
|
|
721
|
+
(r === null || O(r)) && Array.isArray(i) && i.every((e) => typeof e == "string") || D("invalid_operation", t, "set must be an object and unset a list of keys.");
|
|
720
722
|
let a = r === null ? {} : r, o = Object.keys(a).filter((e) => a[e] !== void 0);
|
|
721
|
-
o.length === 0 && i.length === 0 &&
|
|
722
|
-
for (let e of [...o, ...i]) n.has(e) &&
|
|
723
|
+
o.length === 0 && i.length === 0 && D("invalid_operation", t, "Set or unset at least one key.");
|
|
724
|
+
for (let e of [...o, ...i]) n.has(e) && D("invalid_operation", t, `"${e}" can't be set or unset.`);
|
|
723
725
|
let s = i.find((e) => o.includes(e));
|
|
724
|
-
return s !== void 0 &&
|
|
726
|
+
return s !== void 0 && D("invalid_operation", t, `"${s}" is both set and unset.`), {
|
|
725
727
|
set: Object.fromEntries(o.map((e) => [e, a[e]])),
|
|
726
728
|
unset: i
|
|
727
729
|
};
|
|
728
730
|
}
|
|
729
|
-
function
|
|
730
|
-
if (
|
|
731
|
-
|
|
731
|
+
function tt(e, t, n) {
|
|
732
|
+
if (O(e) && typeof e.id == "string" && e.id !== "" && typeof e.type == "string" || D("invalid_operation", t, "A block needs a non-empty string id and a string type."), e.type === "wrapper") {
|
|
733
|
+
n !== "root" && D("invalid_operation", t, n === "column" ? "Wrappers can only be placed at the top level." : "Wrappers cannot be placed inside wrappers."), Array.isArray(e.children) || D("invalid_operation", t, "A wrapper needs children: a list of blocks.");
|
|
734
|
+
for (let n of e.children) tt(n, t, "wrapper");
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
if (!k(e)) return;
|
|
738
|
+
n === "column" && D("invalid_operation", t, "Sections can only be placed at the top level."), n === "wrapper" && e.wrapper && D("invalid_operation", t, ze);
|
|
732
739
|
let r = e.children;
|
|
733
|
-
Array.isArray(r) && r.every((e) => Array.isArray(e)) ||
|
|
734
|
-
for (let e of r) for (let n of e)
|
|
740
|
+
Array.isArray(r) && r.every((e) => Array.isArray(e)) || D("invalid_operation", t, "A section needs children: a list of columns, each a list of blocks.");
|
|
741
|
+
for (let e of r) for (let n of e) tt(n, t, "column");
|
|
735
742
|
}
|
|
736
|
-
function
|
|
743
|
+
function P(e, t) {
|
|
737
744
|
return e.session === null || t.sessionId !== e.session;
|
|
738
745
|
}
|
|
739
|
-
function
|
|
740
|
-
let r = e.locks.find((n) => t.includes(n.blockId) &&
|
|
741
|
-
r &&
|
|
746
|
+
function nt(e, t, n) {
|
|
747
|
+
let r = e.locks.find((n) => t.includes(n.blockId) && P(e, n));
|
|
748
|
+
r && D("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
|
|
742
749
|
}
|
|
743
|
-
function
|
|
744
|
-
e.locks.find((r) =>
|
|
750
|
+
function rt(e, t, n, r) {
|
|
751
|
+
e.locks.find((r) => P(e, r) && r.blockId === t && ((r.locale ?? null) === null || r.locale === n)) && D("lock_held", r, `Block "${t}" is being edited in another session.`, t);
|
|
745
752
|
}
|
|
746
|
-
function
|
|
747
|
-
for (let [i, a] of Object.entries(t)) a !== void 0 && (
|
|
753
|
+
function it(e, t, n, r) {
|
|
754
|
+
for (let [i, a] of Object.entries(t)) a !== void 0 && (h(Object.hasOwn(e, i) && e[i] !== void 0 ? e[i] : null, a) || D("precondition_failed", n, r === void 0 ? `Setting "${i}" has changed since.` : `"${i}" of block "${r}" has changed since.`, r));
|
|
748
755
|
}
|
|
749
|
-
function
|
|
756
|
+
function at(e, t, n) {
|
|
750
757
|
if (t === null) return Array.isArray(e.blocks) || (e.blocks = []), e.blocks;
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
758
|
+
if ("wrapperId" in t) {
|
|
759
|
+
let r = A(e, t.wrapperId);
|
|
760
|
+
return r ? r.block.type === "wrapper" ? Array.isArray(r.block.children) ? r.block.children : D("invalid_operation", n, `Wrapper "${t.wrapperId}" has no children list.`) : D("invalid_operation", n, `Block "${t.wrapperId}" isn't a wrapper.`) : D("block_missing", n, `No wrapper with id "${t.wrapperId}".`, t.wrapperId);
|
|
761
|
+
}
|
|
762
|
+
let r = A(e, t.sectionId);
|
|
763
|
+
if (!r) return D("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
|
|
764
|
+
if (!k(r.block)) return D("invalid_operation", n, `Block "${t.sectionId}" isn't a section.`);
|
|
754
765
|
let i = r.block.children;
|
|
755
|
-
return !Array.isArray(i) || t.column < 0 || t.column >= i.length ?
|
|
766
|
+
return !Array.isArray(i) || t.column < 0 || t.column >= i.length ? D("invalid_operation", n, `Section "${t.sectionId}" has no column ${t.column}.`) : (Array.isArray(i[t.column]) || (i[t.column] = []), i[t.column]);
|
|
756
767
|
}
|
|
757
|
-
function
|
|
768
|
+
function ot(e, t, n) {
|
|
758
769
|
if (t === null) return 0;
|
|
759
|
-
let r = e.findIndex((e) =>
|
|
760
|
-
return r === -1 ?
|
|
770
|
+
let r = e.findIndex((e) => O(e) && e.id === t);
|
|
771
|
+
return r === -1 ? D("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
|
|
761
772
|
}
|
|
762
|
-
function
|
|
763
|
-
let i =
|
|
773
|
+
function st(e, t, n, r) {
|
|
774
|
+
let i = Ve(t), a = Array.isArray(e.children) ? e.children : [];
|
|
764
775
|
for (let e = i; e < a.length; e++) {
|
|
765
776
|
let t = a[e];
|
|
766
|
-
Array.isArray(t) && t.length > 0 &&
|
|
777
|
+
Array.isArray(t) && t.length > 0 && D("invalid_operation", n, `Column ${e} of section "${r}" still holds blocks, so the layout can't drop it.`);
|
|
767
778
|
}
|
|
768
779
|
let o = a.slice(0, i);
|
|
769
780
|
for (; o.length < i;) o.push([]);
|
|
770
781
|
e.children = o;
|
|
771
782
|
}
|
|
772
|
-
function
|
|
783
|
+
function ct(e, t, n) {
|
|
773
784
|
for (let [n, r] of Object.entries(t)) n === "__proto__" ? Object.defineProperty(e, n, {
|
|
774
|
-
value:
|
|
785
|
+
value: m(r),
|
|
775
786
|
writable: !0,
|
|
776
787
|
enumerable: !0,
|
|
777
788
|
configurable: !0
|
|
778
|
-
}) : e[n] =
|
|
789
|
+
}) : e[n] = m(r);
|
|
779
790
|
for (let t of n) delete e[t];
|
|
780
791
|
}
|
|
781
|
-
function
|
|
782
|
-
return
|
|
792
|
+
function lt(e) {
|
|
793
|
+
return me(e).map((t) => {
|
|
783
794
|
let n = t.path.replace(/\.(items|icons|rows)\[.*$/, "").replace(/\[(\d+)\]/g, ".$1").split(".").reduce((e, t) => e[t], e);
|
|
784
795
|
return {
|
|
785
796
|
id: t.id,
|
|
@@ -787,114 +798,114 @@ function at(e) {
|
|
|
787
798
|
};
|
|
788
799
|
});
|
|
789
800
|
}
|
|
790
|
-
function
|
|
791
|
-
let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ?
|
|
792
|
-
a &&
|
|
801
|
+
function ut(e, t, n) {
|
|
802
|
+
let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ? lt(n).map(r) : []), a = lt(e).find((e) => !i.has(r(e)));
|
|
803
|
+
a && D("invalid_operation", t, `Element id "${a.id}" must not contain "." or "/".`, a.blockId);
|
|
793
804
|
}
|
|
794
|
-
function
|
|
805
|
+
function dt(e, t, n, r) {
|
|
795
806
|
let i = t;
|
|
796
|
-
switch (
|
|
797
|
-
case "addBlock": return
|
|
798
|
-
case "moveBlock": return
|
|
799
|
-
case "deleteBlock": return
|
|
800
|
-
case "updateBlock": return
|
|
801
|
-
case "updateSettings": return
|
|
802
|
-
case "setContent": return
|
|
803
|
-
case "setDefaultLocale": return
|
|
804
|
-
case "addLocale": return
|
|
805
|
-
case "removeLocale": return
|
|
806
|
-
case "updateBlockLocale": return
|
|
807
|
-
case "updateSettingsLocale": return
|
|
808
|
-
default:
|
|
807
|
+
switch (O(i) && typeof i.op == "string" || D("invalid_operation", n, "Each operation must be an object with an \"op\"."), i.op) {
|
|
808
|
+
case "addBlock": return ft(e, i, n);
|
|
809
|
+
case "moveBlock": return pt(e, i, n, r);
|
|
810
|
+
case "deleteBlock": return mt(e, i, n, r);
|
|
811
|
+
case "updateBlock": return ht(e, i, n, r);
|
|
812
|
+
case "updateSettings": return gt(e, i, n);
|
|
813
|
+
case "setContent": return jt(e, i, n, r);
|
|
814
|
+
case "setDefaultLocale": return Mt(e, i, n, r);
|
|
815
|
+
case "addLocale": return yt(e, i, n);
|
|
816
|
+
case "removeLocale": return xt(e, i, n);
|
|
817
|
+
case "updateBlockLocale": return kt(e, i, n, r);
|
|
818
|
+
case "updateSettingsLocale": return At(e, i, n);
|
|
819
|
+
default: D("invalid_operation", n, `Unknown operation "${i.op}".`);
|
|
809
820
|
}
|
|
810
821
|
}
|
|
811
|
-
function
|
|
812
|
-
let r =
|
|
813
|
-
|
|
822
|
+
function ft(e, t, n) {
|
|
823
|
+
let r = Qe(t, n), i = $e(t, n), a = t.block;
|
|
824
|
+
tt(a, n, r === null ? "root" : "wrapperId" in r ? "wrapper" : "column"), ut({
|
|
814
825
|
blocks: [a],
|
|
815
826
|
settings: e.settings
|
|
816
827
|
}, n);
|
|
817
|
-
let o = new Set(
|
|
818
|
-
for (let e of
|
|
819
|
-
let c =
|
|
820
|
-
|
|
821
|
-
}
|
|
822
|
-
function
|
|
823
|
-
let i =
|
|
824
|
-
if (!
|
|
825
|
-
if (
|
|
826
|
-
let e =
|
|
827
|
-
|
|
828
|
+
let o = new Set(Ze(Je(e))), s = /* @__PURE__ */ new Set();
|
|
829
|
+
for (let e of j(a)) (o.has(e) || s.has(e)) && D("block_exists", n, `A block with id "${e}" already exists.`, e), s.add(e);
|
|
830
|
+
let c = at(e, r, n), l = ot(c, i, n);
|
|
831
|
+
Ot(e, a, r, n, !0), c.splice(l, 0, m(a));
|
|
832
|
+
}
|
|
833
|
+
function pt(e, t, n, r) {
|
|
834
|
+
let i = M(t, n), a = Qe(t, n), o = $e(t, n), s = N(t, n), c = s && s.parent !== void 0 ? Qe({ parent: s.parent }, n) : null, l = A(e, i);
|
|
835
|
+
if (!l) return D("block_missing", n, `No block with id "${i}".`, i);
|
|
836
|
+
if (nt(r, j(l.block), n), s) {
|
|
837
|
+
let e = l.index > 0 ? l.list[l.index - 1] : null, t = O(e) ? e.id ?? null : null;
|
|
838
|
+
h(l.parent, c) && h(t, s.after ?? null) || D("precondition_failed", n, `Block "${i}" has moved since.`, i);
|
|
828
839
|
}
|
|
829
|
-
A(
|
|
830
|
-
let
|
|
831
|
-
|
|
832
|
-
}
|
|
833
|
-
function
|
|
834
|
-
let i =
|
|
835
|
-
if (!o) return
|
|
836
|
-
|
|
837
|
-
}
|
|
838
|
-
function
|
|
839
|
-
let i =
|
|
840
|
-
if (!c) return
|
|
841
|
-
let l = c.block, u =
|
|
842
|
-
u && o.includes("columns") &&
|
|
840
|
+
a !== null && ("wrapperId" in a ? a.wrapperId : a.sectionId) === i && D("invalid_operation", n, "A block cannot be moved into itself or its descendants."), a !== null && j(l.block).includes("wrapperId" in a ? a.wrapperId : a.sectionId) && D("invalid_operation", n, "A block cannot be moved into itself or its descendants."), k(l.block) && a !== null && "sectionId" in a && D("invalid_operation", n, "Sections can only be placed at the top level."), k(l.block) && l.block.wrapper && a !== null && "wrapperId" in a && D("invalid_operation", n, ze), l.block.type === "wrapper" && a !== null && D("invalid_operation", n, "wrapperId" in a ? "Wrappers cannot be placed inside wrappers." : "Wrappers can only be placed at the top level."), o === i && D("invalid_operation", n, "A block can't be placed after itself.");
|
|
841
|
+
let u = at(e, a, n);
|
|
842
|
+
ot(u.filter((e) => e !== l.block), o, n), Ot(e, l.block, a, n, !1), l.list.splice(l.index, 1), u.splice(ot(u, o, n), 0, l.block);
|
|
843
|
+
}
|
|
844
|
+
function mt(e, t, n, r) {
|
|
845
|
+
let i = M(t, n), a = N(t, n), o = A(e, i);
|
|
846
|
+
if (!o) return D("block_missing", n, `No block with id "${i}".`, i);
|
|
847
|
+
nt(r, j(o.block), n), a && !h(o.block, a.block ?? null) && D("precondition_failed", n, `Block "${i}" has changed since.`, i), o.list.splice(o.index, 1);
|
|
848
|
+
}
|
|
849
|
+
function ht(e, t, n, r) {
|
|
850
|
+
let i = M(t, n), { set: a, unset: o } = et(t, n, Ue), s = N(t, n), c = A(e, i);
|
|
851
|
+
if (!c) return D("block_missing", n, `No block with id "${i}".`, i);
|
|
852
|
+
let l = c.block, u = k(l);
|
|
853
|
+
u && o.includes("columns") && D("invalid_operation", n, "A section's columns can't be unset; set another layout instead."), nt(r, [i], n), s && it(l, s, n, i), u && c.parent !== null && "wrapperId" in c.parent && a.wrapper && D("invalid_operation", n, ze);
|
|
843
854
|
let d = { ...l };
|
|
844
|
-
|
|
855
|
+
ct(d, a, o), ut({
|
|
845
856
|
blocks: [d],
|
|
846
857
|
settings: e.settings
|
|
847
858
|
}, n, {
|
|
848
859
|
blocks: [l],
|
|
849
860
|
settings: e.settings
|
|
850
|
-
}), u && Object.hasOwn(a, "columns") &&
|
|
851
|
-
let f =
|
|
852
|
-
|
|
861
|
+
}), u && Object.hasOwn(a, "columns") && st(l, a.columns, n, i), ct(l, a, o);
|
|
862
|
+
let f = Se(l);
|
|
863
|
+
h(l.l10n, f.l10n) || (f.l10n ? l.l10n = f.l10n : delete l.l10n), (u || l.type === "wrapper") && !h(l.children, f.children) && (l.children = f.children);
|
|
853
864
|
}
|
|
854
|
-
function
|
|
855
|
-
let { set: r, unset: i } =
|
|
856
|
-
e.settings?.locales?.length && (Object.hasOwn(r, "locale") || i.includes("locale")) &&
|
|
865
|
+
function gt(e, t, n) {
|
|
866
|
+
let { set: r, unset: i } = et(t, n, We), a = N(t, n);
|
|
867
|
+
e.settings?.locales?.length && (Object.hasOwn(r, "locale") || i.includes("locale")) && D("invalid_operation", n, "The default locale can't change while language versions exist."), O(e.settings) || (e.settings = {});
|
|
857
868
|
let o = e.settings;
|
|
858
|
-
a &&
|
|
859
|
-
let s =
|
|
860
|
-
|
|
869
|
+
a && it(o, a, n), ct(o, r, i);
|
|
870
|
+
let s = we(e.settings);
|
|
871
|
+
h(o.l10n, s.l10n) || (s.l10n ? o.l10n = s.l10n : delete o.l10n);
|
|
861
872
|
}
|
|
862
|
-
function
|
|
873
|
+
function _t(e, t) {
|
|
863
874
|
let n = e.locale;
|
|
864
|
-
return
|
|
875
|
+
return ve(n) && n !== "__proto__" && n !== "constructor" && n !== "prototype" || D("invalid_operation", t, "locale must be a language tag."), n;
|
|
865
876
|
}
|
|
866
|
-
function
|
|
867
|
-
let r =
|
|
868
|
-
return e.settings.locales?.includes(r) ||
|
|
877
|
+
function vt(e, t, n) {
|
|
878
|
+
let r = _t(t, n);
|
|
879
|
+
return e.settings.locales?.includes(r) || D("invalid_operation", n, `Locale "${r}" isn't in settings.locales.`), r;
|
|
869
880
|
}
|
|
870
|
-
function
|
|
871
|
-
let r =
|
|
872
|
-
(
|
|
881
|
+
function yt(e, t, n) {
|
|
882
|
+
let r = _t(t, n), i = e.settings.locales ?? [], a = r.toLowerCase(), o = t.position === void 0 ? i.length : t.position;
|
|
883
|
+
(w(e).toLowerCase() === a || i.some((e) => e.toLowerCase() === a) || typeof o != "number" || !Number.isInteger(o) || o < 0 || o > i.length) && D("invalid_operation", n, "The locale already exists or its insertion position is invalid."), e.settings.locales || (e.settings.locales = []), e.settings.locales.splice(o, 0, r);
|
|
873
884
|
}
|
|
874
|
-
function
|
|
875
|
-
return e.flatMap((e) =>
|
|
885
|
+
function F(e) {
|
|
886
|
+
return e.flatMap((e) => O(e) ? [e, ...k(e) ? Ye(e).flatMap(F) : e.type === "wrapper" && Array.isArray(e.children) ? F(e.children) : []] : []);
|
|
876
887
|
}
|
|
877
|
-
function
|
|
888
|
+
function bt(e, t) {
|
|
878
889
|
let n = e.l10n;
|
|
879
|
-
return
|
|
880
|
-
}
|
|
881
|
-
function
|
|
882
|
-
let r =
|
|
883
|
-
i && (!
|
|
884
|
-
let a = e.settings, o =
|
|
885
|
-
!i ||
|
|
886
|
-
for (let e of [...o, a])
|
|
890
|
+
return O(n) && O(n[t]) ? n[t] : {};
|
|
891
|
+
}
|
|
892
|
+
function xt(e, t, n) {
|
|
893
|
+
let r = vt(e, t, n), i = N(t, n);
|
|
894
|
+
i && (!O(i.blocks) || i.settings !== void 0 && !O(i.settings)) && D("invalid_operation", n, "expect needs a blocks object and an optional settings layer.");
|
|
895
|
+
let a = e.settings, o = F(Je(e)), s = Object.fromEntries(o.flatMap((e) => O(e.l10n) && Object.hasOwn(e.l10n, r) ? [[String(e.id), e.l10n[r]]] : []));
|
|
896
|
+
!i || h(s, i.blocks) && h(O(a.l10n) ? a.l10n[r] : void 0, i.settings) || D("precondition_failed", n, `Locale "${r}" has changed since.`);
|
|
897
|
+
for (let e of [...o, a]) O(e.l10n) && (delete e.l10n[r], Object.keys(e.l10n).length === 0 && delete e.l10n);
|
|
887
898
|
e.settings.locales.splice(e.settings.locales.indexOf(r), 1), e.settings.locales.length === 0 && delete e.settings.locales;
|
|
888
899
|
}
|
|
889
|
-
function
|
|
890
|
-
(e.text === void 0 || ((e) =>
|
|
900
|
+
function St(e, t, n) {
|
|
901
|
+
(e.text === void 0 || ((e) => O(e) && Object.values(e).every((e) => O(e) && typeof e.value == "string" && typeof e.sourceHash == "string"))(e.text)) && (e.set === void 0 || O(e.set) && !Object.values(e.set).some((e) => e === void 0)) && (e.unset === void 0 || Array.isArray(e.unset) && e.unset.every((e) => typeof e == "string" && e !== "" && v(e))) && (e.hidden === void 0 || !n && typeof e.hidden == "boolean") && [
|
|
891
902
|
"text",
|
|
892
903
|
"set",
|
|
893
904
|
"unset",
|
|
894
905
|
...n ? [] : ["hidden"]
|
|
895
|
-
].some((t) => e[t] !== void 0) ||
|
|
896
|
-
let r =
|
|
897
|
-
return r && (r.text !== void 0 && !
|
|
906
|
+
].some((t) => e[t] !== void 0) || D("invalid_operation", t, "A locale update needs text, set, unset or a block's boolean hidden.");
|
|
907
|
+
let r = N(e, t);
|
|
908
|
+
return r && (r.text !== void 0 && !O(r.text) || r.set !== void 0 && !O(r.set) || r.hidden !== void 0 && (n || typeof r.hidden != "boolean")) && D("invalid_operation", t, "The locale layer expect is malformed."), {
|
|
898
909
|
text: e.text ?? {},
|
|
899
910
|
set: e.set ?? {},
|
|
900
911
|
unset: e.unset ?? [],
|
|
@@ -902,83 +913,88 @@ function vt(e, t, n) {
|
|
|
902
913
|
expect: r
|
|
903
914
|
};
|
|
904
915
|
}
|
|
905
|
-
function
|
|
906
|
-
for (let i of Object.keys(t.text))
|
|
916
|
+
function Ct(e, t, n, r) {
|
|
917
|
+
for (let i of Object.keys(t.text)) v(i) && (r ? g.includes(i) : Ee(String(e.type), i)) && y(e, i) !== void 0 || D("invalid_operation", n, `Text path "${i}" isn't translatable or doesn't resolve.`);
|
|
907
918
|
for (let i of Object.keys(t.set)) {
|
|
908
|
-
let a = i.split("."), o = r ?
|
|
909
|
-
(!
|
|
919
|
+
let a = i.split("."), o = r ? Ge : Ue, s = a.length === 1 ? e : y(e, a.slice(0, -1).join("."));
|
|
920
|
+
(!v(i) || o.has(a[0]) || !r && Ce(e, i, t.set[i]) || y(e, i) === void 0 && !O(s)) && D("invalid_operation", n, `Override path "${i}" is immutable or doesn't resolve.`);
|
|
910
921
|
}
|
|
911
922
|
}
|
|
912
|
-
function
|
|
923
|
+
function wt(e, t, n, r) {
|
|
913
924
|
if (t) {
|
|
914
|
-
for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {}))
|
|
915
|
-
t.hidden !== void 0 && !
|
|
925
|
+
for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {})) h(e[i]?.[a] ?? null, o) || D("precondition_failed", n, `Locale path "${a}" has changed since.`, r);
|
|
926
|
+
t.hidden !== void 0 && !h(e.hidden === !0, t.hidden) && D("precondition_failed", n, "The locale's hidden state has changed since.", r);
|
|
916
927
|
}
|
|
917
928
|
}
|
|
918
|
-
function
|
|
919
|
-
|
|
929
|
+
function Tt(e, t, n) {
|
|
930
|
+
O(e.l10n) || (e.l10n = {});
|
|
920
931
|
let r = e.l10n;
|
|
921
|
-
|
|
932
|
+
O(r[t]) || (r[t] = {});
|
|
922
933
|
let i = r[t];
|
|
923
934
|
for (let e of n.unset) i.text && delete i.text[e], i.set && delete i.set[e];
|
|
924
|
-
for (let [e, t] of Object.entries(n.text)) i.text ||= {}, i.text[e] =
|
|
925
|
-
for (let [e, t] of Object.entries(n.set)) i.set ||= {}, i.set[e] =
|
|
935
|
+
for (let [e, t] of Object.entries(n.text)) i.text ||= {}, i.text[e] = m(t), i.set && delete i.set[e];
|
|
936
|
+
for (let [e, t] of Object.entries(n.set)) i.set ||= {}, i.set[e] = m(t), i.text && delete i.text[e];
|
|
926
937
|
n.hidden === !0 ? i.hidden = !0 : n.hidden === !1 && delete i.hidden, i.text && Object.keys(i.text).length === 0 && delete i.text, i.set && Object.keys(i.set).length === 0 && delete i.set, Object.keys(i).length === 0 && delete r[t], Object.keys(r).length === 0 && delete e.l10n;
|
|
927
938
|
}
|
|
928
|
-
function
|
|
929
|
-
return
|
|
939
|
+
function I(e) {
|
|
940
|
+
return O(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(I) : I(e)) : !1;
|
|
930
941
|
}
|
|
931
|
-
function
|
|
932
|
-
return
|
|
942
|
+
function Et(e) {
|
|
943
|
+
return O(e) && O(e.l10n) && Object.values(e.l10n).some((e) => O(e) && e.hidden === !0);
|
|
933
944
|
}
|
|
934
|
-
function
|
|
935
|
-
return !
|
|
945
|
+
function Dt(e) {
|
|
946
|
+
return !O(e) || !I(e) ? !1 : Et(e) ? !0 : Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(Dt) : Dt(e));
|
|
936
947
|
}
|
|
937
|
-
function
|
|
938
|
-
if (!
|
|
939
|
-
let a = n
|
|
940
|
-
(a !== null
|
|
948
|
+
function Ot(e, t, n, r, i) {
|
|
949
|
+
if (!I(t)) return;
|
|
950
|
+
let a = n, o = !1;
|
|
951
|
+
for (; a !== null;) {
|
|
952
|
+
let t = A(e, "wrapperId" in a ? a.wrapperId : a.sectionId);
|
|
953
|
+
if (!t) break;
|
|
954
|
+
Et(t.block) && (o = !0), a = t.parent;
|
|
955
|
+
}
|
|
956
|
+
(o || i && Dt(t)) && D("invalid_operation", r, "A layout's slot block can't be placed inside a block that a language hides.", O(t) && typeof t.id == "string" ? t.id : void 0);
|
|
941
957
|
}
|
|
942
|
-
function
|
|
943
|
-
let i =
|
|
944
|
-
s ||
|
|
958
|
+
function kt(e, t, n, r) {
|
|
959
|
+
let i = vt(e, t, n), a = M(t, n), o = St(t, n, !1), s = F(Je(e)).find((e) => e.id === a);
|
|
960
|
+
s || D("block_missing", n, `No block with id "${a}".`, a), Ct(s, o, n, !1), rt(r, a, i, n), wt(bt(s, i), o.expect, n, a), o.hidden === !0 && I(s) && D("invalid_operation", n, "A layout's slot block, and any block that contains it, can't be hidden.", a), Tt(s, i, o);
|
|
945
961
|
}
|
|
946
|
-
function
|
|
947
|
-
let r =
|
|
948
|
-
|
|
962
|
+
function At(e, t, n) {
|
|
963
|
+
let r = vt(e, t, n), i = St(t, n, !0), a = e.settings;
|
|
964
|
+
Ct(a, i, n, !0), wt(bt(a, r), i.expect, n), Tt(a, r, i);
|
|
949
965
|
}
|
|
950
|
-
function
|
|
966
|
+
function jt(e, t, n, r) {
|
|
951
967
|
let i = t.content;
|
|
952
|
-
if (!
|
|
953
|
-
|
|
954
|
-
let a = r.locks.find((e) =>
|
|
955
|
-
a &&
|
|
956
|
-
}
|
|
957
|
-
function
|
|
958
|
-
let i =
|
|
959
|
-
e.settings.locales?.includes(i) ||
|
|
960
|
-
let a =
|
|
961
|
-
a.length &&
|
|
962
|
-
let o = r.locks.find((e) =>
|
|
963
|
-
o &&
|
|
968
|
+
if (!O(i) || !Array.isArray(i.blocks) || !O(i.settings)) return D("invalid_operation", n, "setContent needs content with a blocks array and a settings object.");
|
|
969
|
+
ut(i, n, e);
|
|
970
|
+
let a = r.locks.find((e) => P(r, e));
|
|
971
|
+
a && D("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = m(i.blocks), e.settings = m(i.settings);
|
|
972
|
+
}
|
|
973
|
+
function Mt(e, t, n, r) {
|
|
974
|
+
let i = _t(t, n);
|
|
975
|
+
e.settings.locales?.includes(i) || D("invalid_operation", n, `"${i}" is not a language version of this template.`);
|
|
976
|
+
let a = Fe(e, i);
|
|
977
|
+
a.length && D("invalid_operation", n, a.length === 1 ? `1 block is hidden in "${i}". Show it before making it the default.` : `${a.length} blocks are hidden in "${i}". Show them before making it the default.`, a[0]);
|
|
978
|
+
let o = r.locks.find((e) => P(r, e));
|
|
979
|
+
o && D("locked_by_others", n, "Other sessions hold locks on this template.", o.blockId);
|
|
964
980
|
let s = t.customTextFields;
|
|
965
981
|
if (s !== void 0) {
|
|
966
|
-
let t =
|
|
967
|
-
(!
|
|
968
|
-
if (
|
|
982
|
+
let t = F(e.blocks);
|
|
983
|
+
(!O(s) || Object.getOwnPropertyNames(s).some((e) => {
|
|
984
|
+
if (Ke.has(e)) return !0;
|
|
969
985
|
let n = s[e], r = t.find((t) => t.id === e);
|
|
970
|
-
return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !
|
|
971
|
-
})) &&
|
|
986
|
+
return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !v(e) || !Ee("custom", e) || typeof y(r, e) != "string");
|
|
987
|
+
})) && D("invalid_operation", n, qe);
|
|
972
988
|
}
|
|
973
|
-
let c =
|
|
989
|
+
let c = Re(e, i, t.customTextFields);
|
|
974
990
|
e.blocks = c.blocks, e.settings = c.settings;
|
|
975
991
|
}
|
|
976
992
|
// ../types/src/invert-operations.ts
|
|
977
|
-
function
|
|
993
|
+
function Nt(e) {
|
|
978
994
|
let t = e.children;
|
|
979
995
|
return e.type === "section" && Array.isArray(t) ? t : [];
|
|
980
996
|
}
|
|
981
|
-
function
|
|
997
|
+
function Pt(e, t, n = null) {
|
|
982
998
|
for (let r = 0; r < e.length; r++) {
|
|
983
999
|
let i = e[r];
|
|
984
1000
|
if (i.id === t) return {
|
|
@@ -986,30 +1002,34 @@ function At(e, t, n = null) {
|
|
|
986
1002
|
parent: n,
|
|
987
1003
|
after: r > 0 ? e[r - 1].id : null
|
|
988
1004
|
};
|
|
989
|
-
let a =
|
|
1005
|
+
let a = Nt(i);
|
|
990
1006
|
for (let e = 0; e < a.length; e++) {
|
|
991
1007
|
if (!Array.isArray(a[e])) continue;
|
|
992
|
-
let n =
|
|
1008
|
+
let n = Pt(a[e], t, {
|
|
993
1009
|
sectionId: i.id,
|
|
994
1010
|
column: e
|
|
995
1011
|
});
|
|
996
1012
|
if (n) return n;
|
|
997
1013
|
}
|
|
1014
|
+
if (i.type === "wrapper" && Array.isArray(i.children)) {
|
|
1015
|
+
let e = Pt(i.children, t, { wrapperId: i.id });
|
|
1016
|
+
if (e) return e;
|
|
1017
|
+
}
|
|
998
1018
|
}
|
|
999
1019
|
return null;
|
|
1000
1020
|
}
|
|
1001
|
-
function
|
|
1002
|
-
let r =
|
|
1003
|
-
if (!r) throw new
|
|
1021
|
+
function Ft(e, t, n) {
|
|
1022
|
+
let r = Pt(e.blocks, t);
|
|
1023
|
+
if (!r) throw new T("block_missing", n, `No block with id "${t}".`, t);
|
|
1004
1024
|
return r;
|
|
1005
1025
|
}
|
|
1006
|
-
function
|
|
1026
|
+
function It(e, t, n) {
|
|
1007
1027
|
let r = {}, i = [], a = {}, o = [.../* @__PURE__ */ new Set([...Object.keys(t ?? {}), ...n ?? []])];
|
|
1008
1028
|
for (let n of o) {
|
|
1009
1029
|
let o = e[n];
|
|
1010
|
-
o === void 0 ? i.push(n) : r[n] =
|
|
1030
|
+
o === void 0 ? i.push(n) : r[n] = m(o);
|
|
1011
1031
|
let s = t && n in t ? t[n] : void 0;
|
|
1012
|
-
a[n] = s === void 0 ? null :
|
|
1032
|
+
a[n] = s === void 0 ? null : m(s);
|
|
1013
1033
|
}
|
|
1014
1034
|
return {
|
|
1015
1035
|
set: r,
|
|
@@ -1017,13 +1037,13 @@ function Mt(e, t, n) {
|
|
|
1017
1037
|
expect: a
|
|
1018
1038
|
};
|
|
1019
1039
|
}
|
|
1020
|
-
function
|
|
1040
|
+
function L(e, t) {
|
|
1021
1041
|
return e.l10n?.[t] ?? {};
|
|
1022
1042
|
}
|
|
1023
|
-
function
|
|
1043
|
+
function R(e, t, n, r) {
|
|
1024
1044
|
let i = {}, a = {}, o = {};
|
|
1025
1045
|
n.length && (o.text = {}, o.set = {});
|
|
1026
|
-
for (let r of n) e.text?.[r] !== void 0 && (i[r] =
|
|
1046
|
+
for (let r of n) e.text?.[r] !== void 0 && (i[r] = m(e.text[r])), e.set && Object.hasOwn(e.set, r) && (a[r] = m(e.set[r])), o.text[r] = m(t.text?.[r] ?? null), o.set[r] = m(t.set?.[r] ?? null);
|
|
1027
1047
|
return r && (o.hidden = t.hidden === !0), {
|
|
1028
1048
|
unset: n,
|
|
1029
1049
|
...Object.keys(i).length ? { text: i } : {},
|
|
@@ -1032,21 +1052,21 @@ function L(e, t, n, r) {
|
|
|
1032
1052
|
expect: o
|
|
1033
1053
|
};
|
|
1034
1054
|
}
|
|
1035
|
-
function
|
|
1036
|
-
let { unset: t, ...n } =
|
|
1055
|
+
function Lt(e) {
|
|
1056
|
+
let { unset: t, ...n } = R(e, {}, [.../* @__PURE__ */ new Set([...Object.keys(e.text ?? {}), ...Object.keys(e.set ?? {})])], e.hidden === !0);
|
|
1037
1057
|
return n;
|
|
1038
1058
|
}
|
|
1039
|
-
function
|
|
1040
|
-
return e.flatMap((e) => [e, ...e.type === "wrapper" ?
|
|
1059
|
+
function z(e) {
|
|
1060
|
+
return e.flatMap((e) => [e, ...e.type === "wrapper" ? z(e.children) : Nt(e).flatMap(z)]);
|
|
1041
1061
|
}
|
|
1042
|
-
function
|
|
1043
|
-
let n =
|
|
1044
|
-
|
|
1062
|
+
function Rt(e, t) {
|
|
1063
|
+
let n = m(e);
|
|
1064
|
+
E(n, [t]);
|
|
1045
1065
|
let r = [], i = (e, t, n) => {
|
|
1046
1066
|
for (let [i, a] of Object.entries(e.l10n ?? {})) {
|
|
1047
1067
|
let e = t.l10n?.[i] ?? {}, o = [.../* @__PURE__ */ new Set([...Object.keys(a.text ?? {}).filter((t) => !Object.hasOwn(e.text ?? {}, t)), ...Object.keys(a.set ?? {}).filter((t) => !Object.hasOwn(e.set ?? {}, t))])];
|
|
1048
1068
|
if (!o.length) continue;
|
|
1049
|
-
let s =
|
|
1069
|
+
let s = R(a, e, o, !1);
|
|
1050
1070
|
r.push(n === void 0 ? {
|
|
1051
1071
|
op: "updateSettingsLocale",
|
|
1052
1072
|
locale: i,
|
|
@@ -1061,32 +1081,32 @@ function Pt(e, t) {
|
|
|
1061
1081
|
};
|
|
1062
1082
|
if (t.op === "updateSettings") i(e.settings, n.settings);
|
|
1063
1083
|
else {
|
|
1064
|
-
let t = new Map(
|
|
1065
|
-
for (let n of
|
|
1084
|
+
let t = new Map(z(n.blocks).map((e) => [e.id, e]));
|
|
1085
|
+
for (let n of z(e.blocks)) {
|
|
1066
1086
|
let e = t.get(n.id);
|
|
1067
1087
|
e && i(n, e, n.id);
|
|
1068
1088
|
}
|
|
1069
1089
|
}
|
|
1070
1090
|
return r;
|
|
1071
1091
|
}
|
|
1072
|
-
function
|
|
1092
|
+
function zt(e, t, n) {
|
|
1073
1093
|
switch (t.op) {
|
|
1074
1094
|
case "addBlock": return {
|
|
1075
1095
|
op: "deleteBlock",
|
|
1076
1096
|
blockId: t.block.id,
|
|
1077
|
-
expect: { block:
|
|
1097
|
+
expect: { block: m(t.block) }
|
|
1078
1098
|
};
|
|
1079
1099
|
case "deleteBlock": {
|
|
1080
|
-
let r =
|
|
1100
|
+
let r = Ft(e, t.blockId, n);
|
|
1081
1101
|
return {
|
|
1082
1102
|
op: "addBlock",
|
|
1083
|
-
block:
|
|
1103
|
+
block: m(r.block),
|
|
1084
1104
|
parent: r.parent,
|
|
1085
1105
|
after: r.after
|
|
1086
1106
|
};
|
|
1087
1107
|
}
|
|
1088
1108
|
case "moveBlock": {
|
|
1089
|
-
let r =
|
|
1109
|
+
let r = Ft(e, t.blockId, n);
|
|
1090
1110
|
return {
|
|
1091
1111
|
op: "moveBlock",
|
|
1092
1112
|
blockId: t.blockId,
|
|
@@ -1099,23 +1119,23 @@ function Ft(e, t, n) {
|
|
|
1099
1119
|
};
|
|
1100
1120
|
}
|
|
1101
1121
|
case "updateBlock": {
|
|
1102
|
-
let r =
|
|
1122
|
+
let r = Ft(e, t.blockId, n).block, { set: i, unset: a, expect: o } = It(r, t.set, t.unset);
|
|
1103
1123
|
return [{
|
|
1104
1124
|
op: "updateBlock",
|
|
1105
1125
|
blockId: t.blockId,
|
|
1106
1126
|
...Object.keys(i).length > 0 ? { set: i } : {},
|
|
1107
1127
|
...a.length > 0 ? { unset: a } : {},
|
|
1108
1128
|
expect: o
|
|
1109
|
-
}, ...
|
|
1129
|
+
}, ...Rt(e, t)];
|
|
1110
1130
|
}
|
|
1111
1131
|
case "updateSettings": {
|
|
1112
|
-
let { set: n, unset: r, expect: i } =
|
|
1132
|
+
let { set: n, unset: r, expect: i } = It(e.settings, t.set, t.unset);
|
|
1113
1133
|
return [{
|
|
1114
1134
|
op: "updateSettings",
|
|
1115
1135
|
...Object.keys(n).length > 0 ? { set: n } : {},
|
|
1116
1136
|
...r.length > 0 ? { unset: r } : {},
|
|
1117
1137
|
expect: i
|
|
1118
|
-
}, ...
|
|
1138
|
+
}, ...Rt(e, t)];
|
|
1119
1139
|
}
|
|
1120
1140
|
case "addLocale": return {
|
|
1121
1141
|
op: "removeLocale",
|
|
@@ -1128,18 +1148,18 @@ function Ft(e, t, n) {
|
|
|
1128
1148
|
locale: t.locale,
|
|
1129
1149
|
position: e.settings.locales?.indexOf(t.locale)
|
|
1130
1150
|
}];
|
|
1131
|
-
for (let r of
|
|
1151
|
+
for (let r of z(e.blocks)) {
|
|
1132
1152
|
let e = r.l10n?.[t.locale];
|
|
1133
1153
|
e && n.push({
|
|
1134
1154
|
op: "updateBlockLocale",
|
|
1135
1155
|
blockId: r.id,
|
|
1136
1156
|
locale: t.locale,
|
|
1137
|
-
...
|
|
1157
|
+
...Lt(e)
|
|
1138
1158
|
});
|
|
1139
1159
|
}
|
|
1140
1160
|
let r = e.settings.l10n?.[t.locale];
|
|
1141
1161
|
if (r) {
|
|
1142
|
-
let { hidden: e, ...i } =
|
|
1162
|
+
let { hidden: e, ...i } = Lt(r);
|
|
1143
1163
|
n.push({
|
|
1144
1164
|
op: "updateSettingsLocale",
|
|
1145
1165
|
locale: t.locale,
|
|
@@ -1150,23 +1170,23 @@ function Ft(e, t, n) {
|
|
|
1150
1170
|
}
|
|
1151
1171
|
case "updateBlockLocale":
|
|
1152
1172
|
case "updateSettingsLocale": {
|
|
1153
|
-
let n =
|
|
1154
|
-
|
|
1173
|
+
let n = m(e);
|
|
1174
|
+
E(n, [t]);
|
|
1155
1175
|
let r = [.../* @__PURE__ */ new Set([
|
|
1156
1176
|
...Object.keys(t.text ?? {}),
|
|
1157
1177
|
...Object.keys(t.set ?? {}),
|
|
1158
1178
|
...t.unset ?? []
|
|
1159
1179
|
])];
|
|
1160
1180
|
if (t.op === "updateBlockLocale") {
|
|
1161
|
-
let i =
|
|
1181
|
+
let i = z(e.blocks).find((e) => e.id === t.blockId), a = z(n.blocks).find((e) => e.id === t.blockId);
|
|
1162
1182
|
return {
|
|
1163
1183
|
op: "updateBlockLocale",
|
|
1164
1184
|
blockId: t.blockId,
|
|
1165
1185
|
locale: t.locale,
|
|
1166
|
-
...L(
|
|
1186
|
+
...R(L(i, t.locale), L(a, t.locale), r, t.hidden !== void 0)
|
|
1167
1187
|
};
|
|
1168
1188
|
}
|
|
1169
|
-
let { hidden: i, ...a } = L(
|
|
1189
|
+
let { hidden: i, ...a } = R(L(e.settings, t.locale), L(n.settings, t.locale), r, !1);
|
|
1170
1190
|
return {
|
|
1171
1191
|
op: "updateSettingsLocale",
|
|
1172
1192
|
locale: t.locale,
|
|
@@ -1177,95 +1197,95 @@ function Ft(e, t, n) {
|
|
|
1177
1197
|
case "setContent": return {
|
|
1178
1198
|
op: "setContent",
|
|
1179
1199
|
content: {
|
|
1180
|
-
blocks:
|
|
1181
|
-
settings:
|
|
1200
|
+
blocks: m(e.blocks),
|
|
1201
|
+
settings: m(e.settings)
|
|
1182
1202
|
}
|
|
1183
1203
|
};
|
|
1184
1204
|
}
|
|
1185
1205
|
}
|
|
1186
|
-
function
|
|
1187
|
-
let n =
|
|
1206
|
+
function Bt(e, t) {
|
|
1207
|
+
let n = m(e), r = [];
|
|
1188
1208
|
return t.forEach((e, t) => {
|
|
1189
1209
|
try {
|
|
1190
|
-
let i =
|
|
1191
|
-
r.push(...Array.isArray(i) ? [...i].reverse() : [i]),
|
|
1210
|
+
let i = zt(n, e, t);
|
|
1211
|
+
r.push(...Array.isArray(i) ? [...i].reverse() : [i]), E(n, [e]);
|
|
1192
1212
|
} catch (e) {
|
|
1193
|
-
throw e instanceof
|
|
1213
|
+
throw e instanceof T ? new T(e.code, t, e.message, e.blockId) : e;
|
|
1194
1214
|
}
|
|
1195
1215
|
}), r.reverse();
|
|
1196
1216
|
}
|
|
1197
1217
|
// ../types/src/collaboration.ts
|
|
1198
|
-
function
|
|
1218
|
+
function Vt(e) {
|
|
1199
1219
|
return e === "invalid_operation" ? 422 : e === "content_too_large" ? 413 : 409;
|
|
1200
1220
|
}
|
|
1201
|
-
var
|
|
1221
|
+
var Ht = class extends ge {
|
|
1202
1222
|
opIndex;
|
|
1203
1223
|
holder;
|
|
1204
1224
|
holders;
|
|
1205
1225
|
constructor(e, t) {
|
|
1206
|
-
super(e, t.status ??
|
|
1226
|
+
super(e, t.status ?? Vt(t.code), t.code), this.name = "CollaborationConflict", t.opIndex !== void 0 && (this.opIndex = t.opIndex), t.holder !== void 0 && (this.holder = t.holder), t.holders !== void 0 && (this.holders = t.holders);
|
|
1207
1227
|
}
|
|
1208
1228
|
};
|
|
1209
1229
|
// ../types/src/guards.ts
|
|
1210
|
-
function
|
|
1230
|
+
function Ut(e) {
|
|
1211
1231
|
return e.type === "section";
|
|
1212
1232
|
}
|
|
1213
|
-
function
|
|
1233
|
+
function Wt(e) {
|
|
1214
1234
|
return e.type === "title";
|
|
1215
1235
|
}
|
|
1216
|
-
function
|
|
1236
|
+
function Gt(e) {
|
|
1217
1237
|
return e.type === "paragraph";
|
|
1218
1238
|
}
|
|
1219
|
-
function
|
|
1239
|
+
function Kt(e) {
|
|
1220
1240
|
return e.type === "image";
|
|
1221
1241
|
}
|
|
1222
|
-
function
|
|
1242
|
+
function qt(e) {
|
|
1223
1243
|
return e.type === "button";
|
|
1224
1244
|
}
|
|
1225
|
-
function
|
|
1245
|
+
function Jt(e) {
|
|
1226
1246
|
return e.type === "divider";
|
|
1227
1247
|
}
|
|
1228
|
-
function
|
|
1248
|
+
function Yt(e) {
|
|
1229
1249
|
return e.type === "video";
|
|
1230
1250
|
}
|
|
1231
|
-
function
|
|
1251
|
+
function Xt(e) {
|
|
1232
1252
|
return e.type === "social";
|
|
1233
1253
|
}
|
|
1234
|
-
function
|
|
1254
|
+
function Zt(e) {
|
|
1235
1255
|
return e.type === "spacer";
|
|
1236
1256
|
}
|
|
1237
|
-
function
|
|
1257
|
+
function Qt(e) {
|
|
1238
1258
|
return e.type === "html";
|
|
1239
1259
|
}
|
|
1240
|
-
function
|
|
1260
|
+
function $t(e) {
|
|
1241
1261
|
return e.type === "menu";
|
|
1242
1262
|
}
|
|
1243
|
-
function
|
|
1263
|
+
function en(e) {
|
|
1244
1264
|
return e.type === "table";
|
|
1245
1265
|
}
|
|
1246
|
-
function
|
|
1266
|
+
function tn(e) {
|
|
1247
1267
|
return e.type === "countdown";
|
|
1248
1268
|
}
|
|
1249
|
-
function
|
|
1269
|
+
function nn(e) {
|
|
1250
1270
|
return e.type === "custom";
|
|
1251
1271
|
}
|
|
1252
|
-
function
|
|
1272
|
+
function B(e) {
|
|
1253
1273
|
return e.type === "slot";
|
|
1254
1274
|
}
|
|
1255
|
-
function
|
|
1275
|
+
function V(e) {
|
|
1256
1276
|
return e.type === "wrapper";
|
|
1257
1277
|
}
|
|
1258
1278
|
// ../types/src/defaults.ts
|
|
1259
|
-
var
|
|
1279
|
+
var rn = {
|
|
1260
1280
|
content: "<p>Enter your title</p>",
|
|
1261
1281
|
level: 2,
|
|
1262
1282
|
textAlign: "left"
|
|
1263
|
-
},
|
|
1283
|
+
}, an = { content: "<p>Enter your text here</p>" }, on = {
|
|
1264
1284
|
src: "",
|
|
1265
1285
|
alt: "",
|
|
1266
1286
|
width: "full",
|
|
1267
1287
|
align: "center"
|
|
1268
|
-
},
|
|
1288
|
+
}, sn = {
|
|
1269
1289
|
text: "Click Here",
|
|
1270
1290
|
url: "",
|
|
1271
1291
|
backgroundColor: "#333333",
|
|
@@ -1279,36 +1299,36 @@ var $t = {
|
|
|
1279
1299
|
left: 24
|
|
1280
1300
|
},
|
|
1281
1301
|
align: "center"
|
|
1282
|
-
},
|
|
1302
|
+
}, cn = {
|
|
1283
1303
|
lineStyle: "solid",
|
|
1284
1304
|
color: "#e0e0e0",
|
|
1285
1305
|
thickness: 1,
|
|
1286
1306
|
width: "full"
|
|
1287
|
-
},
|
|
1307
|
+
}, ln = { columns: "1" }, un = {
|
|
1288
1308
|
url: "",
|
|
1289
1309
|
thumbnailUrl: "",
|
|
1290
1310
|
alt: "Video",
|
|
1291
1311
|
width: "full",
|
|
1292
1312
|
align: "center"
|
|
1293
|
-
},
|
|
1313
|
+
}, dn = {
|
|
1294
1314
|
iconStyle: "solid",
|
|
1295
1315
|
iconSize: "medium",
|
|
1296
1316
|
spacing: 10,
|
|
1297
1317
|
align: "center"
|
|
1298
|
-
},
|
|
1318
|
+
}, fn = { height: 24 }, pn = { content: "" }, mn = {
|
|
1299
1319
|
fontSize: 15,
|
|
1300
1320
|
textAlign: "center",
|
|
1301
1321
|
separator: "|",
|
|
1302
1322
|
separatorColor: "#e0e0e0",
|
|
1303
1323
|
spacing: 10
|
|
1304
|
-
},
|
|
1324
|
+
}, hn = {
|
|
1305
1325
|
hasHeaderRow: !0,
|
|
1306
1326
|
borderColor: "#e0e0e0",
|
|
1307
1327
|
borderWidth: 1,
|
|
1308
1328
|
cellPadding: 8,
|
|
1309
1329
|
fontSize: 15,
|
|
1310
1330
|
textAlign: "left"
|
|
1311
|
-
},
|
|
1331
|
+
}, gn = {
|
|
1312
1332
|
targetDate: "",
|
|
1313
1333
|
timezone: "UTC",
|
|
1314
1334
|
showDays: !0,
|
|
@@ -1328,21 +1348,21 @@ var $t = {
|
|
|
1328
1348
|
expiredMessage: "This offer has expired",
|
|
1329
1349
|
expiredImageUrl: "",
|
|
1330
1350
|
hideOnExpiry: !1
|
|
1331
|
-
},
|
|
1332
|
-
title:
|
|
1333
|
-
paragraph:
|
|
1334
|
-
image:
|
|
1335
|
-
button:
|
|
1336
|
-
divider:
|
|
1337
|
-
section:
|
|
1338
|
-
video:
|
|
1339
|
-
social:
|
|
1340
|
-
spacer:
|
|
1341
|
-
html:
|
|
1342
|
-
menu:
|
|
1343
|
-
table:
|
|
1344
|
-
countdown:
|
|
1345
|
-
},
|
|
1351
|
+
}, _n = {
|
|
1352
|
+
title: rn,
|
|
1353
|
+
paragraph: an,
|
|
1354
|
+
image: on,
|
|
1355
|
+
button: sn,
|
|
1356
|
+
divider: cn,
|
|
1357
|
+
section: ln,
|
|
1358
|
+
video: un,
|
|
1359
|
+
social: dn,
|
|
1360
|
+
spacer: fn,
|
|
1361
|
+
html: pn,
|
|
1362
|
+
menu: mn,
|
|
1363
|
+
table: hn,
|
|
1364
|
+
countdown: gn
|
|
1365
|
+
}, vn = {
|
|
1346
1366
|
width: 600,
|
|
1347
1367
|
backgroundColor: "#ffffff",
|
|
1348
1368
|
textColor: "#1a1a1a",
|
|
@@ -1350,30 +1370,30 @@ var $t = {
|
|
|
1350
1370
|
fontFamily: "Arial",
|
|
1351
1371
|
locale: "en"
|
|
1352
1372
|
};
|
|
1353
|
-
function
|
|
1373
|
+
function yn(e) {
|
|
1354
1374
|
return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
|
|
1355
1375
|
}
|
|
1356
|
-
function
|
|
1376
|
+
function bn(e, t) {
|
|
1357
1377
|
let n = { ...e };
|
|
1358
1378
|
for (let r of Object.keys(t)) {
|
|
1359
1379
|
let i = e[r], a = t[r];
|
|
1360
|
-
a !== void 0 && (n[r] =
|
|
1380
|
+
a !== void 0 && (n[r] = yn(i) && yn(a) ? bn(i, a) : a);
|
|
1361
1381
|
}
|
|
1362
1382
|
return n;
|
|
1363
1383
|
}
|
|
1364
1384
|
// ../types/src/template.ts
|
|
1365
|
-
function
|
|
1385
|
+
function xn(e = "Arial", t) {
|
|
1366
1386
|
return {
|
|
1367
1387
|
blocks: [],
|
|
1368
1388
|
settings: {
|
|
1369
|
-
...
|
|
1389
|
+
...vn,
|
|
1370
1390
|
fontFamily: e,
|
|
1371
1391
|
...t
|
|
1372
1392
|
}
|
|
1373
1393
|
};
|
|
1374
1394
|
}
|
|
1375
1395
|
// ../types/src/direction.ts
|
|
1376
|
-
var
|
|
1396
|
+
var Sn = [
|
|
1377
1397
|
"ar",
|
|
1378
1398
|
"he",
|
|
1379
1399
|
"iw",
|
|
@@ -1387,16 +1407,16 @@ var vn = [
|
|
|
1387
1407
|
"ckb",
|
|
1388
1408
|
"ks"
|
|
1389
1409
|
];
|
|
1390
|
-
function
|
|
1410
|
+
function Cn(e) {
|
|
1391
1411
|
let t = e?.trim().replace(/_/g, "-").split("-")[0]?.toLowerCase();
|
|
1392
|
-
return !!t &&
|
|
1412
|
+
return !!t && Sn.includes(t);
|
|
1393
1413
|
}
|
|
1394
|
-
function
|
|
1395
|
-
return e.direction === "ltr" || e.direction === "rtl" ? e.direction :
|
|
1414
|
+
function wn(e) {
|
|
1415
|
+
return e.direction === "ltr" || e.direction === "rtl" ? e.direction : Cn(e.locale) ? "rtl" : "ltr";
|
|
1396
1416
|
}
|
|
1397
1417
|
// ../types/src/translation.ts
|
|
1398
|
-
var
|
|
1399
|
-
function
|
|
1418
|
+
var Tn = 2e4, En = /* @__PURE__ */ new Set(["\"", "'"]);
|
|
1419
|
+
function Dn(e, t) {
|
|
1400
1420
|
let n = null, r = "tag";
|
|
1401
1421
|
for (let i = t; i < e.length; i++) {
|
|
1402
1422
|
let t = e[i];
|
|
@@ -1404,7 +1424,7 @@ function V(e, t) {
|
|
|
1404
1424
|
else {
|
|
1405
1425
|
if (r === "beforeValue") {
|
|
1406
1426
|
if (H(t)) continue;
|
|
1407
|
-
if (
|
|
1427
|
+
if (En.has(t)) {
|
|
1408
1428
|
n = t, r = "tag";
|
|
1409
1429
|
continue;
|
|
1410
1430
|
}
|
|
@@ -1419,12 +1439,12 @@ function V(e, t) {
|
|
|
1419
1439
|
}
|
|
1420
1440
|
return -1;
|
|
1421
1441
|
}
|
|
1422
|
-
function
|
|
1442
|
+
function On(e, t) {
|
|
1423
1443
|
let n = null;
|
|
1424
1444
|
for (let r = t; r < e.length; r++) {
|
|
1425
1445
|
let t = e[r];
|
|
1426
1446
|
if (n !== null) t === n && (n = null);
|
|
1427
|
-
else if (
|
|
1447
|
+
else if (En.has(t)) n = t;
|
|
1428
1448
|
else if (t === ">") return {
|
|
1429
1449
|
end: r,
|
|
1430
1450
|
nextSpan: -1
|
|
@@ -1439,13 +1459,13 @@ function Cn(e, t) {
|
|
|
1439
1459
|
nextSpan: -1
|
|
1440
1460
|
};
|
|
1441
1461
|
}
|
|
1442
|
-
function
|
|
1462
|
+
function kn(e) {
|
|
1443
1463
|
return e !== " " && e !== " " && e !== "\n" && e !== "\r" && e !== "\f" && e !== "=" && e !== ">" && e !== "/";
|
|
1444
1464
|
}
|
|
1445
1465
|
function H(e) {
|
|
1446
1466
|
return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
|
|
1447
1467
|
}
|
|
1448
|
-
var
|
|
1468
|
+
var An = {
|
|
1449
1469
|
AMP: "&",
|
|
1450
1470
|
COPY: "©",
|
|
1451
1471
|
GT: ">",
|
|
@@ -1712,16 +1732,16 @@ function U(e) {
|
|
|
1712
1732
|
let n = t[1] === "x" || t[1] === "X" ? Number.parseInt(t.slice(2), 16) : Number.parseInt(t.slice(1), 10);
|
|
1713
1733
|
return !Number.isFinite(n) || n < 1 || n > 1114111 || n >= 55296 && n <= 57343 ? e : String.fromCodePoint(n);
|
|
1714
1734
|
}
|
|
1715
|
-
return Object.hasOwn(
|
|
1735
|
+
return Object.hasOwn(An, t) ? An[t] : e;
|
|
1716
1736
|
}) : e;
|
|
1717
1737
|
}
|
|
1718
|
-
function
|
|
1738
|
+
function jn(e, t) {
|
|
1719
1739
|
let n = t.toLowerCase(), r = 0;
|
|
1720
1740
|
for (; r < e.length;) {
|
|
1721
1741
|
for (; r < e.length && (H(e[r]) || e[r] === "/");) r++;
|
|
1722
1742
|
if (r >= e.length) break;
|
|
1723
1743
|
let t = r;
|
|
1724
|
-
for (; r < e.length &&
|
|
1744
|
+
for (; r < e.length && kn(e[r]);) r++;
|
|
1725
1745
|
let i = e.substring(t, r).toLowerCase();
|
|
1726
1746
|
if (i === "") {
|
|
1727
1747
|
r++;
|
|
@@ -1731,7 +1751,7 @@ function En(e, t) {
|
|
|
1731
1751
|
if (e[r] !== "=") continue;
|
|
1732
1752
|
for (r++; r < e.length && H(e[r]);) r++;
|
|
1733
1753
|
let a = e[r];
|
|
1734
|
-
if (
|
|
1754
|
+
if (En.has(a)) {
|
|
1735
1755
|
let t = r + 1, o = e.indexOf(a, t);
|
|
1736
1756
|
if (o === -1) return null;
|
|
1737
1757
|
if (i === n) return U(e.substring(t, o));
|
|
@@ -1745,15 +1765,15 @@ function En(e, t) {
|
|
|
1745
1765
|
return null;
|
|
1746
1766
|
}
|
|
1747
1767
|
// ../types/src/merge-tag-html.ts
|
|
1748
|
-
function
|
|
1749
|
-
return
|
|
1768
|
+
function Mn(e) {
|
|
1769
|
+
return Fn(e, (e) => e, !1);
|
|
1750
1770
|
}
|
|
1751
|
-
function
|
|
1752
|
-
return
|
|
1771
|
+
function Nn(e, t) {
|
|
1772
|
+
return Fn(e, t, !0);
|
|
1753
1773
|
}
|
|
1754
|
-
function
|
|
1774
|
+
function Pn(e) {
|
|
1755
1775
|
let t = [];
|
|
1756
|
-
return
|
|
1776
|
+
return Fn(e, (n, r, i) => {
|
|
1757
1777
|
let a = e.slice(r, i);
|
|
1758
1778
|
return t.push({
|
|
1759
1779
|
start: r,
|
|
@@ -1762,7 +1782,7 @@ function kn(e) {
|
|
|
1762
1782
|
}), a;
|
|
1763
1783
|
}, !0), t;
|
|
1764
1784
|
}
|
|
1765
|
-
function
|
|
1785
|
+
function Fn(e, t, n) {
|
|
1766
1786
|
let r = "", i = 0;
|
|
1767
1787
|
for (; i < e.length;) {
|
|
1768
1788
|
let a = e.indexOf("<span", i);
|
|
@@ -1775,7 +1795,7 @@ function An(e, t, n) {
|
|
|
1775
1795
|
r += e.substring(i, a + 5), i = a + 5;
|
|
1776
1796
|
continue;
|
|
1777
1797
|
}
|
|
1778
|
-
let { end: s, nextSpan: c } =
|
|
1798
|
+
let { end: s, nextSpan: c } = On(e, a + 5);
|
|
1779
1799
|
if (c !== -1) {
|
|
1780
1800
|
r += e.substring(i, c), i = c;
|
|
1781
1801
|
continue;
|
|
@@ -1784,12 +1804,12 @@ function An(e, t, n) {
|
|
|
1784
1804
|
r += e.substring(i);
|
|
1785
1805
|
break;
|
|
1786
1806
|
}
|
|
1787
|
-
let l = e.substring(a + 5, s), u =
|
|
1807
|
+
let l = e.substring(a + 5, s), u = Ln(l, "data-merge-tag") ?? Ln(l, "data-logic-merge-tag");
|
|
1788
1808
|
if (u === null) {
|
|
1789
1809
|
r += e.substring(i, s + 1), i = s + 1;
|
|
1790
1810
|
continue;
|
|
1791
1811
|
}
|
|
1792
|
-
let d =
|
|
1812
|
+
let d = In(e, s + 1, n);
|
|
1793
1813
|
if (d === -1) {
|
|
1794
1814
|
r += e.substring(i);
|
|
1795
1815
|
break;
|
|
@@ -1798,7 +1818,7 @@ function An(e, t, n) {
|
|
|
1798
1818
|
}
|
|
1799
1819
|
return r;
|
|
1800
1820
|
}
|
|
1801
|
-
function
|
|
1821
|
+
function In(e, t, n) {
|
|
1802
1822
|
if (!n) {
|
|
1803
1823
|
let n = e.indexOf("</span>", t);
|
|
1804
1824
|
return n === -1 ? -1 : n + 7;
|
|
@@ -1807,7 +1827,7 @@ function jn(e, t, n) {
|
|
|
1807
1827
|
for (; i < e.length;) {
|
|
1808
1828
|
let t = e.indexOf("<", i);
|
|
1809
1829
|
if (t === -1) return -1;
|
|
1810
|
-
let n =
|
|
1830
|
+
let n = Dn(e, t + 1);
|
|
1811
1831
|
if (n === -1) return -1;
|
|
1812
1832
|
let a = e.startsWith("</span", t), o = e.startsWith("<span", t), s = e[t + (a ? 6 : 5)];
|
|
1813
1833
|
if ((o || a) && (s === ">" || s === "/" || /\s/.test(s)) && (r += a ? -1 : 1, r === 0)) return n + 1;
|
|
@@ -1815,8 +1835,8 @@ function jn(e, t, n) {
|
|
|
1815
1835
|
}
|
|
1816
1836
|
return -1;
|
|
1817
1837
|
}
|
|
1818
|
-
function
|
|
1819
|
-
return
|
|
1838
|
+
function Ln(e, t) {
|
|
1839
|
+
return jn(e, t);
|
|
1820
1840
|
}
|
|
1821
1841
|
// ../types/src/merge-tags.ts
|
|
1822
1842
|
var W = {
|
|
@@ -1851,7 +1871,7 @@ function G(e) {
|
|
|
1851
1871
|
return (e.value === n.value || e.value.source === n.value.source && e.value.flags.replace(/[gy]/g, "") === n.value.flags.replace(/[gy]/g, "")) && (e.logic === n.logic || e.logic.source === n.logic.source && e.logic.flags.replace(/[gy]/g, "") === n.logic.flags.replace(/[gy]/g, ""));
|
|
1852
1872
|
});
|
|
1853
1873
|
}
|
|
1854
|
-
function
|
|
1874
|
+
function Rn(e, t, n) {
|
|
1855
1875
|
for (let r = n; r < e.length; r++) {
|
|
1856
1876
|
let n = e.charCodeAt(r);
|
|
1857
1877
|
if (n === 10 || n === 13 || n === 8232 || n === 8233) return {
|
|
@@ -1893,7 +1913,7 @@ function K(e, t, n, r = 0, i = Infinity) {
|
|
|
1893
1913
|
let r = u?.lastIndex ?? t + s.length, i = a === "mailchimp" && n === "value" ? {
|
|
1894
1914
|
close: e.startsWith(c, r) ? r : -1,
|
|
1895
1915
|
lineBreak: -1
|
|
1896
|
-
} :
|
|
1916
|
+
} : Rn(e, c, Math.max(r, t + s.length + +(n === "value")));
|
|
1897
1917
|
if (i.lineBreak >= 0) {
|
|
1898
1918
|
let r = i.lineBreak, o = n === "logic" && (a === "liquid" || a === "ampscript") ? e.lastIndexOf(s, r) : -1;
|
|
1899
1919
|
p = o > t ? o : r + 1;
|
|
@@ -1915,7 +1935,7 @@ function K(e, t, n, r = 0, i = Infinity) {
|
|
|
1915
1935
|
}
|
|
1916
1936
|
return f;
|
|
1917
1937
|
}
|
|
1918
|
-
function
|
|
1938
|
+
function zn(e, t) {
|
|
1919
1939
|
let n = G(t);
|
|
1920
1940
|
if (!n) {
|
|
1921
1941
|
let n = RegExp(`(${t.value.source}|${t.logic.source})`, "g");
|
|
@@ -1943,7 +1963,7 @@ function Pn(e, t) {
|
|
|
1943
1963
|
o = t + 2;
|
|
1944
1964
|
continue;
|
|
1945
1965
|
}
|
|
1946
|
-
let c =
|
|
1966
|
+
let c = Rn(e, "|*", a.lastIndex);
|
|
1947
1967
|
if (c.lineBreak >= 0) {
|
|
1948
1968
|
o = c.lineBreak + 1;
|
|
1949
1969
|
continue;
|
|
@@ -1965,71 +1985,71 @@ function Pn(e, t) {
|
|
|
1965
1985
|
}
|
|
1966
1986
|
return r;
|
|
1967
1987
|
}
|
|
1968
|
-
function
|
|
1988
|
+
function Bn(e) {
|
|
1969
1989
|
return typeof e == "string" && e.trim() !== "" ? e : null;
|
|
1970
1990
|
}
|
|
1971
|
-
function
|
|
1991
|
+
function Vn(e) {
|
|
1972
1992
|
return Object.values(W).find((t) => t.value.source === e.value.source) ?? null;
|
|
1973
1993
|
}
|
|
1974
|
-
function
|
|
1975
|
-
return
|
|
1994
|
+
function Hn(e) {
|
|
1995
|
+
return Bn(e.opener) ?? Vn(e)?.opener ?? null;
|
|
1976
1996
|
}
|
|
1977
|
-
function
|
|
1978
|
-
return
|
|
1997
|
+
function Un(e) {
|
|
1998
|
+
return Bn(e.closer) ?? Vn(e)?.closer ?? null;
|
|
1979
1999
|
}
|
|
1980
|
-
function
|
|
2000
|
+
function Wn(e) {
|
|
1981
2001
|
return e ? typeof e == "string" ? W[e] ?? W.liquid : e : W.liquid;
|
|
1982
2002
|
}
|
|
1983
|
-
function
|
|
2003
|
+
function Gn(e) {
|
|
1984
2004
|
let t = e.source, n = e.flags.replace("g", "");
|
|
1985
2005
|
return RegExp(`^${t}$`, n);
|
|
1986
2006
|
}
|
|
1987
|
-
function
|
|
2007
|
+
function Kn(e, t) {
|
|
1988
2008
|
let n = e?.trim() || "";
|
|
1989
|
-
return !
|
|
2009
|
+
return !Gn(t.logic).test(n) && Gn(t.value).test(n);
|
|
1990
2010
|
}
|
|
1991
|
-
function
|
|
2011
|
+
function qn(e, t) {
|
|
1992
2012
|
let n = t.find((t) => t.value === e);
|
|
1993
2013
|
return n ? n.label : e;
|
|
1994
2014
|
}
|
|
1995
|
-
function
|
|
1996
|
-
return
|
|
2015
|
+
function Jn(e, t) {
|
|
2016
|
+
return ir(e, "data-merge-tag", (e) => qn(e, t));
|
|
1997
2017
|
}
|
|
1998
|
-
function
|
|
2018
|
+
function Yn(e, t) {
|
|
1999
2019
|
return t.find((t) => t.value === e)?.sample;
|
|
2000
2020
|
}
|
|
2001
|
-
function
|
|
2002
|
-
return
|
|
2021
|
+
function Xn(e, t) {
|
|
2022
|
+
return ir(e, "data-merge-tag", (e) => $n(Yn(e, t) ?? qn(e, t)), { unwrap: (e) => Yn(e, t) !== void 0 });
|
|
2003
2023
|
}
|
|
2004
|
-
function
|
|
2024
|
+
function Zn(e) {
|
|
2005
2025
|
return e.some((e) => e.sample !== void 0);
|
|
2006
2026
|
}
|
|
2007
|
-
function
|
|
2027
|
+
function Qn(e, t) {
|
|
2008
2028
|
if (!e) return e;
|
|
2009
2029
|
let n = e;
|
|
2010
2030
|
for (let e of t) e.sample !== void 0 && (n = n.split(e.value).join(e.sample));
|
|
2011
2031
|
return n;
|
|
2012
2032
|
}
|
|
2013
|
-
function
|
|
2033
|
+
function $n(e) {
|
|
2014
2034
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
2015
2035
|
}
|
|
2016
|
-
function
|
|
2036
|
+
function er(e, t) {
|
|
2017
2037
|
if (!e) return !1;
|
|
2018
2038
|
if (G(t)) return K(e, t, "value", 0, 1).length > 0 || K(e, t, "logic", 0, 1).length > 0;
|
|
2019
2039
|
let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
|
|
2020
2040
|
return n.test(e) || r.test(e);
|
|
2021
2041
|
}
|
|
2022
|
-
function
|
|
2023
|
-
return
|
|
2042
|
+
function tr(e, t) {
|
|
2043
|
+
return Gn(t.logic).test(e?.trim() || "");
|
|
2024
2044
|
}
|
|
2025
|
-
function
|
|
2045
|
+
function nr(e, t) {
|
|
2026
2046
|
let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
|
|
2027
2047
|
return r && r[1] ? r[1].toUpperCase() : e;
|
|
2028
2048
|
}
|
|
2029
|
-
function
|
|
2030
|
-
return
|
|
2049
|
+
function rr(e, t) {
|
|
2050
|
+
return ir(e, "data-logic-merge-tag", (e) => nr(e, t));
|
|
2031
2051
|
}
|
|
2032
|
-
function
|
|
2052
|
+
function ir(e, t, n, r) {
|
|
2033
2053
|
let i = "", a = 0;
|
|
2034
2054
|
for (; a < e.length;) {
|
|
2035
2055
|
let o = e.indexOf("<span", a);
|
|
@@ -2042,7 +2062,7 @@ function $n(e, t, n, r) {
|
|
|
2042
2062
|
i += e.substring(a, o + 5), a = o + 5;
|
|
2043
2063
|
continue;
|
|
2044
2064
|
}
|
|
2045
|
-
let { end: c, nextSpan: l } =
|
|
2065
|
+
let { end: c, nextSpan: l } = On(e, o + 5);
|
|
2046
2066
|
if (l !== -1) {
|
|
2047
2067
|
i += e.substring(a, l), a = l;
|
|
2048
2068
|
continue;
|
|
@@ -2051,7 +2071,7 @@ function $n(e, t, n, r) {
|
|
|
2051
2071
|
i += e.substring(a);
|
|
2052
2072
|
break;
|
|
2053
2073
|
}
|
|
2054
|
-
let u =
|
|
2074
|
+
let u = jn(e.substring(o + 5, c), t);
|
|
2055
2075
|
if (u === null) {
|
|
2056
2076
|
i += e.substring(a, c + 1), a = c + 1;
|
|
2057
2077
|
continue;
|
|
@@ -2067,14 +2087,14 @@ function $n(e, t, n, r) {
|
|
|
2067
2087
|
return i;
|
|
2068
2088
|
}
|
|
2069
2089
|
// ../types/src/locale-strings.ts
|
|
2070
|
-
var
|
|
2090
|
+
var ar = {
|
|
2071
2091
|
title: ["content"],
|
|
2072
2092
|
paragraph: ["content"]
|
|
2073
2093
|
};
|
|
2074
|
-
function
|
|
2094
|
+
function or(e) {
|
|
2075
2095
|
let t = [], n = /<[a-z][\w:-]*\b/gi;
|
|
2076
2096
|
for (; n.exec(e);) {
|
|
2077
|
-
let r =
|
|
2097
|
+
let r = Dn(e, n.lastIndex);
|
|
2078
2098
|
if (r < 0) break;
|
|
2079
2099
|
let i = n.lastIndex, a = e.slice(i, r), o = /[^\s"'<>/=]+\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/g;
|
|
2080
2100
|
for (let e; e = o.exec(a);) {
|
|
@@ -2088,39 +2108,43 @@ function tr(e) {
|
|
|
2088
2108
|
}
|
|
2089
2109
|
return t;
|
|
2090
2110
|
}
|
|
2091
|
-
function
|
|
2092
|
-
let r = n === "html" ?
|
|
2111
|
+
function sr(e, t, n) {
|
|
2112
|
+
let r = n === "html" ? Pn(e) : [], i = n === "html" ? or(e) : [], a = r.map((e) => ({
|
|
2093
2113
|
...e,
|
|
2094
2114
|
attribute: !1
|
|
2095
2115
|
})), o = 0, s = G(t) !== void 0, c = (n, r) => {
|
|
2096
|
-
let c = e.slice(n, r), l = ["logic", "value"], u = s ? l.map((e) => K(c, t, e, 0, 1)[0]) :
|
|
2116
|
+
let c = e.slice(n, r), l = ["logic", "value"], u = s ? l.map((e) => K(c, t, e, 0, 1)[0]) : [void 0, void 0], d = s ? null : [t.logic, t.value].map((e) => new RegExp(e.source, e.flags.replace(/[gy]/g, "") + "g")), f = 0;
|
|
2097
2117
|
for (; f < c.length;) {
|
|
2098
|
-
let e = s ? u.flatMap((e) => e ? [e] : []) : d.flatMap((e) => {
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2118
|
+
let e = s ? u.flatMap((e) => e ? [e] : []) : d.flatMap((e, t) => {
|
|
2119
|
+
let n = u[t];
|
|
2120
|
+
if (n === void 0 || n !== null && n.index < f) {
|
|
2121
|
+
e.lastIndex = f;
|
|
2122
|
+
let n = e.exec(c);
|
|
2123
|
+
for (; n && n[0].length === 0;) e.lastIndex = n.index + 1, n = e.exec(c);
|
|
2124
|
+
u[t] = n ? {
|
|
2125
|
+
index: n.index,
|
|
2126
|
+
value: n[0]
|
|
2127
|
+
} : null;
|
|
2128
|
+
}
|
|
2129
|
+
return u[t] ? [u[t]] : [];
|
|
2106
2130
|
});
|
|
2107
2131
|
e.sort((e, t) => e.index - t.index || e.value.length - t.value.length);
|
|
2108
2132
|
let r = e[0];
|
|
2109
2133
|
if (!r) break;
|
|
2110
|
-
let p = n + r.index,
|
|
2134
|
+
let p = n + r.index, ee = p + r.value.length;
|
|
2111
2135
|
for (; i[o]?.end <= p;) o++;
|
|
2112
2136
|
if (a.push({
|
|
2113
2137
|
start: p,
|
|
2114
|
-
end:
|
|
2138
|
+
end: ee,
|
|
2115
2139
|
markup: r.value,
|
|
2116
|
-
attribute: i[o] !== void 0 && p >= i[o].start &&
|
|
2140
|
+
attribute: i[o] !== void 0 && p >= i[o].start && ee <= i[o].end
|
|
2117
2141
|
}), f = r.index + r.value.length, s) for (let e = 0; e < l.length; e++) u[e] && u[e].index < f && (u[e] = K(c, t, l[e], f, 1)[0]);
|
|
2118
2142
|
}
|
|
2119
2143
|
}, l = 0;
|
|
2120
2144
|
for (let e of r) c(l, e.start), l = e.end;
|
|
2121
2145
|
return c(l, e.length), a.sort((e, t) => e.start - t.start);
|
|
2122
2146
|
}
|
|
2123
|
-
function
|
|
2147
|
+
function cr(e) {
|
|
2124
2148
|
if (!e.includes("&")) return { text: e };
|
|
2125
2149
|
let t = "", n = [0], r = 0, i = (i) => {
|
|
2126
2150
|
for (t += e.slice(r, i); r < i;) n.push(++r);
|
|
@@ -2137,17 +2161,17 @@ function rr(e) {
|
|
|
2137
2161
|
offsets: n
|
|
2138
2162
|
};
|
|
2139
2163
|
}
|
|
2140
|
-
var q = /* @__PURE__ */ new Map(),
|
|
2141
|
-
function
|
|
2164
|
+
var q = /* @__PURE__ */ new Map(), lr = 32;
|
|
2165
|
+
function ur(e) {
|
|
2142
2166
|
let t = JSON.stringify(e), n = q.get(t);
|
|
2143
2167
|
if (n === void 0) {
|
|
2144
2168
|
let r = e.map((e) => e.trim()).filter(Boolean).sort((e, t) => t.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
2145
|
-
n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null, q.size >=
|
|
2169
|
+
n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null, q.size >= lr && q.delete(q.keys().next().value), q.set(t, n);
|
|
2146
2170
|
}
|
|
2147
2171
|
return n;
|
|
2148
2172
|
}
|
|
2149
|
-
function
|
|
2150
|
-
let r = n.length ?
|
|
2173
|
+
function dr(e, t, n) {
|
|
2174
|
+
let r = n.length ? ur(n) : null;
|
|
2151
2175
|
if (!r) return [];
|
|
2152
2176
|
let i = [];
|
|
2153
2177
|
if (t === "text") i.push({
|
|
@@ -2156,7 +2180,7 @@ function or(e, t, n) {
|
|
|
2156
2180
|
attribute: !1
|
|
2157
2181
|
});
|
|
2158
2182
|
else {
|
|
2159
|
-
i.push(...
|
|
2183
|
+
i.push(...or(e).map((e) => ({
|
|
2160
2184
|
...e,
|
|
2161
2185
|
attribute: !0
|
|
2162
2186
|
})));
|
|
@@ -2167,7 +2191,7 @@ function or(e, t, n) {
|
|
|
2167
2191
|
end: r.index,
|
|
2168
2192
|
attribute: !1
|
|
2169
2193
|
});
|
|
2170
|
-
let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) :
|
|
2194
|
+
let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) : Dn(e, t.lastIndex);
|
|
2171
2195
|
if (a < 0) return [];
|
|
2172
2196
|
n = a + (r[0] === "<!--" ? 3 : 1), t.lastIndex = n;
|
|
2173
2197
|
}
|
|
@@ -2180,7 +2204,7 @@ function or(e, t, n) {
|
|
|
2180
2204
|
let a = [];
|
|
2181
2205
|
for (let n of i) {
|
|
2182
2206
|
r.lastIndex = 0;
|
|
2183
|
-
let i = e.slice(n.start, n.end), o = t === "html" ?
|
|
2207
|
+
let i = e.slice(n.start, n.end), o = t === "html" ? cr(i) : {
|
|
2184
2208
|
text: i,
|
|
2185
2209
|
offsets: void 0
|
|
2186
2210
|
};
|
|
@@ -2199,51 +2223,51 @@ function or(e, t, n) {
|
|
|
2199
2223
|
}
|
|
2200
2224
|
return a;
|
|
2201
2225
|
}
|
|
2202
|
-
function
|
|
2203
|
-
let i =
|
|
2226
|
+
function fr(e, t, n, r) {
|
|
2227
|
+
let i = sr(e, t, n), a = dr(e, n, r?.doNotTranslate ?? []).filter((e) => !i.some((t) => e.start < t.end && e.end > t.start));
|
|
2204
2228
|
return [...i, ...a].sort((e, t) => e.start - t.start);
|
|
2205
2229
|
}
|
|
2206
|
-
function
|
|
2230
|
+
function pr(e, t, n) {
|
|
2207
2231
|
let r = "", i = 0;
|
|
2208
2232
|
return t.forEach((t, a) => {
|
|
2209
2233
|
r += e.slice(i, t.start), r += t.attribute ? `__x${n[a]}__` : `<x id="${n[a]}"/>`, i = t.end;
|
|
2210
2234
|
}), r + e.slice(i);
|
|
2211
2235
|
}
|
|
2212
|
-
function
|
|
2213
|
-
let i =
|
|
2236
|
+
function mr(e, t, n, r) {
|
|
2237
|
+
let i = fr(e, t, n, r);
|
|
2214
2238
|
return {
|
|
2215
|
-
text:
|
|
2239
|
+
text: pr(e, i, i.map((e, t) => t + 1)),
|
|
2216
2240
|
tokens: i.map((e) => e.markup)
|
|
2217
2241
|
};
|
|
2218
2242
|
}
|
|
2219
|
-
function
|
|
2243
|
+
function hr(e, t) {
|
|
2220
2244
|
let n = /* @__PURE__ */ new Set(), r = !0, i = e.replace(/<x id="(\d+)"\s*\/>|<x id="(\d+)"><\/x>|__x(\d+)__/g, (e, i, a, o) => {
|
|
2221
2245
|
let s = Number(i ?? a ?? o);
|
|
2222
2246
|
return (s < 1 || s > t.length || n.has(s)) && (r = !1), n.add(s), t[s - 1] ?? "";
|
|
2223
2247
|
});
|
|
2224
2248
|
return r && n.size === t.length ? i : null;
|
|
2225
2249
|
}
|
|
2226
|
-
function
|
|
2227
|
-
let a =
|
|
2250
|
+
function gr(e, t, n, r, i) {
|
|
2251
|
+
let a = fr(e, n, r, i), o = /* @__PURE__ */ new Set(), s = (e) => {
|
|
2228
2252
|
let n = t.findIndex((t, n) => !o.has(n) && e(t));
|
|
2229
2253
|
return n >= 0 && o.add(n), n;
|
|
2230
2254
|
}, c = a.map((e) => s((t) => t === e.markup));
|
|
2231
2255
|
return a.forEach((e, t) => {
|
|
2232
2256
|
c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) => U(t) === e.term));
|
|
2233
|
-
}), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null :
|
|
2257
|
+
}), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null : pr(e, a.filter((e, t) => c[t] >= 0), c.filter((e) => e >= 0).map((e) => e + 1));
|
|
2234
2258
|
}
|
|
2235
|
-
function
|
|
2259
|
+
function _r(e, t, n = []) {
|
|
2236
2260
|
let r = /* @__PURE__ */ new Map();
|
|
2237
|
-
if (t ===
|
|
2261
|
+
if (t === w(e) || !e.settings.locales?.includes(t)) return r;
|
|
2238
2262
|
let i = (e, n, i, a) => {
|
|
2239
2263
|
let o = n.l10n?.[t];
|
|
2240
2264
|
for (let t of i) {
|
|
2241
|
-
let i =
|
|
2265
|
+
let i = y(n, t);
|
|
2242
2266
|
typeof i != "string" || i === "" || Object.keys(o?.set ?? {}).some((e) => e === t || t.startsWith(`${e}.`)) || r.set(`${e.kind === "block" ? e.blockId : "settings"}/${t}`, {
|
|
2243
2267
|
target: e,
|
|
2244
2268
|
path: t,
|
|
2245
2269
|
source: i,
|
|
2246
|
-
format: a &&
|
|
2270
|
+
format: a && ar[a]?.includes(t) ? "html" : "text",
|
|
2247
2271
|
text: o?.text?.[t]
|
|
2248
2272
|
});
|
|
2249
2273
|
}
|
|
@@ -2252,22 +2276,22 @@ function fr(e, t, n = []) {
|
|
|
2252
2276
|
if (r.type !== "html" && i({
|
|
2253
2277
|
kind: "block",
|
|
2254
2278
|
blockId: r.id
|
|
2255
|
-
}, r,
|
|
2279
|
+
}, r, x(r, n), r.type), r.type === "section") for (let e of r.children) a(e);
|
|
2256
2280
|
else r.type === "wrapper" && a(r.children);
|
|
2257
2281
|
}
|
|
2258
2282
|
};
|
|
2259
|
-
return a(e.blocks), i({ kind: "settings" }, e.settings,
|
|
2283
|
+
return a(e.blocks), i({ kind: "settings" }, e.settings, g), r;
|
|
2260
2284
|
}
|
|
2261
|
-
function
|
|
2262
|
-
let r = n.only === "all" ? null :
|
|
2263
|
-
for (let [r, s] of
|
|
2285
|
+
function vr(e, t, n) {
|
|
2286
|
+
let r = n.only === "all" ? null : Pe(e, t, n.definitions), i = r && /* @__PURE__ */ new Set([...r.missing, ...r.stale]), a = [], o = {};
|
|
2287
|
+
for (let [r, s] of _r(e, t, n.definitions)) {
|
|
2264
2288
|
if (i && !i.has(r) || n.blockId !== void 0 && (s.target.kind !== "block" || s.target.blockId !== n.blockId)) continue;
|
|
2265
|
-
let e =
|
|
2289
|
+
let e = mr(s.source, n.syntax, s.format, n), t = s.text ? gr(s.text.value, e.tokens, n.syntax, s.format, n) : void 0;
|
|
2266
2290
|
a.push({
|
|
2267
2291
|
id: r,
|
|
2268
2292
|
format: s.format,
|
|
2269
2293
|
source: e.text,
|
|
2270
|
-
sourceHash:
|
|
2294
|
+
sourceHash: S(s.source),
|
|
2271
2295
|
...t == null ? {} : { text: t }
|
|
2272
2296
|
}), o[r] = e.tokens;
|
|
2273
2297
|
}
|
|
@@ -2276,8 +2300,8 @@ function pr(e, t, n) {
|
|
|
2276
2300
|
tokens: o
|
|
2277
2301
|
};
|
|
2278
2302
|
}
|
|
2279
|
-
function
|
|
2280
|
-
let i =
|
|
2303
|
+
function yr(e, t, n, r) {
|
|
2304
|
+
let i = _r(e, t, r.definitions), a = /* @__PURE__ */ new Map(), o = (e) => {
|
|
2281
2305
|
for (let t of e) if (a.set(t.id, t), t.type === "section") for (let e of t.children) o(e);
|
|
2282
2306
|
else t.type === "wrapper" && o(t.children);
|
|
2283
2307
|
};
|
|
@@ -2289,12 +2313,12 @@ function mr(e, t, n, r) {
|
|
|
2289
2313
|
let n = t.id.lastIndexOf("/"), r = t.id.slice(0, n), i = r === "settings" ? [a.get(r), e.settings] : [a.get(r)];
|
|
2290
2314
|
l.push({
|
|
2291
2315
|
id: t.id,
|
|
2292
|
-
reason: n < 0 || !i.some((e) => e &&
|
|
2316
|
+
reason: n < 0 || !i.some((e) => e && y(e, t.id.slice(n + 1)) !== void 0) ? "unknown_field" : "not_translatable"
|
|
2293
2317
|
});
|
|
2294
2318
|
continue;
|
|
2295
2319
|
}
|
|
2296
|
-
let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ?
|
|
2297
|
-
if (!o || u === null ||
|
|
2320
|
+
let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ? hr(t.text, o) : null;
|
|
2321
|
+
if (!o || u === null || gr(u, o, r.syntax, n.format, r) === null) {
|
|
2298
2322
|
l.push({
|
|
2299
2323
|
id: t.id,
|
|
2300
2324
|
reason: "tags_changed"
|
|
@@ -2324,7 +2348,7 @@ function mr(e, t, n, r) {
|
|
|
2324
2348
|
};
|
|
2325
2349
|
}
|
|
2326
2350
|
// ../types/src/custom-block-liquid.ts
|
|
2327
|
-
function
|
|
2351
|
+
function br(e) {
|
|
2328
2352
|
return new e.Liquid({
|
|
2329
2353
|
strictVariables: !1,
|
|
2330
2354
|
strictFilters: !1,
|
|
@@ -2334,16 +2358,16 @@ function hr(e) {
|
|
|
2334
2358
|
}
|
|
2335
2359
|
// ../types/src/factory.ts
|
|
2336
2360
|
function J(e, t) {
|
|
2337
|
-
let n =
|
|
2338
|
-
return !t || Object.keys(t).length === 0 ? n :
|
|
2361
|
+
let n = m(e);
|
|
2362
|
+
return !t || Object.keys(t).length === 0 ? n : bn(n, t);
|
|
2339
2363
|
}
|
|
2340
2364
|
function Y(e) {
|
|
2341
|
-
return e === void 0 ? void 0 :
|
|
2365
|
+
return e === void 0 ? void 0 : m(e);
|
|
2342
2366
|
}
|
|
2343
2367
|
function X() {
|
|
2344
2368
|
return crypto.randomUUID();
|
|
2345
2369
|
}
|
|
2346
|
-
function
|
|
2370
|
+
function xr(e = 0) {
|
|
2347
2371
|
return {
|
|
2348
2372
|
top: e,
|
|
2349
2373
|
right: e,
|
|
@@ -2352,100 +2376,100 @@ function gr(e = 0) {
|
|
|
2352
2376
|
};
|
|
2353
2377
|
}
|
|
2354
2378
|
function Z(e = 10) {
|
|
2355
|
-
return { padding:
|
|
2379
|
+
return { padding: xr(e) };
|
|
2356
2380
|
}
|
|
2357
|
-
function
|
|
2381
|
+
function Sr(e = {}) {
|
|
2358
2382
|
return J({
|
|
2359
2383
|
id: X(),
|
|
2360
2384
|
type: "title",
|
|
2361
|
-
|
|
2385
|
+
...rn,
|
|
2362
2386
|
styles: Z()
|
|
2363
2387
|
}, e);
|
|
2364
2388
|
}
|
|
2365
|
-
function
|
|
2389
|
+
function Cr(e = {}) {
|
|
2366
2390
|
return J({
|
|
2367
2391
|
id: X(),
|
|
2368
2392
|
type: "paragraph",
|
|
2369
|
-
...
|
|
2393
|
+
...an,
|
|
2370
2394
|
styles: Z()
|
|
2371
2395
|
}, e);
|
|
2372
2396
|
}
|
|
2373
|
-
function
|
|
2397
|
+
function wr(e = {}) {
|
|
2374
2398
|
return J({
|
|
2375
2399
|
id: X(),
|
|
2376
2400
|
type: "image",
|
|
2377
|
-
...
|
|
2401
|
+
...on,
|
|
2378
2402
|
styles: Z()
|
|
2379
2403
|
}, e);
|
|
2380
2404
|
}
|
|
2381
|
-
function
|
|
2405
|
+
function Tr(e = {}) {
|
|
2382
2406
|
return J({
|
|
2383
2407
|
id: X(),
|
|
2384
2408
|
type: "button",
|
|
2385
|
-
...
|
|
2409
|
+
...sn,
|
|
2386
2410
|
styles: Z()
|
|
2387
2411
|
}, e);
|
|
2388
2412
|
}
|
|
2389
|
-
function
|
|
2413
|
+
function Er(e = {}) {
|
|
2390
2414
|
return J({
|
|
2391
2415
|
id: X(),
|
|
2392
2416
|
type: "divider",
|
|
2393
|
-
...
|
|
2417
|
+
...cn,
|
|
2394
2418
|
styles: Z(20)
|
|
2395
2419
|
}, e);
|
|
2396
2420
|
}
|
|
2397
|
-
function
|
|
2421
|
+
function Dr(e = {}) {
|
|
2398
2422
|
return J({
|
|
2399
2423
|
id: X(),
|
|
2400
2424
|
type: "section",
|
|
2401
|
-
...
|
|
2425
|
+
...ln,
|
|
2402
2426
|
children: [[]],
|
|
2403
2427
|
styles: Z(20)
|
|
2404
2428
|
}, e);
|
|
2405
2429
|
}
|
|
2406
|
-
function
|
|
2430
|
+
function Or(e = {}) {
|
|
2407
2431
|
return J({
|
|
2408
2432
|
id: X(),
|
|
2409
2433
|
type: "video",
|
|
2410
|
-
...
|
|
2434
|
+
...un,
|
|
2411
2435
|
styles: Z()
|
|
2412
2436
|
}, e);
|
|
2413
2437
|
}
|
|
2414
|
-
function
|
|
2438
|
+
function kr(e = {}) {
|
|
2415
2439
|
return J({
|
|
2416
2440
|
id: X(),
|
|
2417
2441
|
type: "social",
|
|
2418
2442
|
icons: [],
|
|
2419
|
-
...
|
|
2443
|
+
...dn,
|
|
2420
2444
|
styles: Z()
|
|
2421
2445
|
}, e);
|
|
2422
2446
|
}
|
|
2423
|
-
function
|
|
2447
|
+
function Ar(e = {}) {
|
|
2424
2448
|
return J({
|
|
2425
2449
|
id: X(),
|
|
2426
2450
|
type: "spacer",
|
|
2427
|
-
...
|
|
2451
|
+
...fn,
|
|
2428
2452
|
styles: Z(0)
|
|
2429
2453
|
}, e);
|
|
2430
2454
|
}
|
|
2431
|
-
function
|
|
2455
|
+
function jr(e = {}) {
|
|
2432
2456
|
return J({
|
|
2433
2457
|
id: X(),
|
|
2434
2458
|
type: "html",
|
|
2435
|
-
...
|
|
2459
|
+
...pn,
|
|
2436
2460
|
styles: Z()
|
|
2437
2461
|
}, e);
|
|
2438
2462
|
}
|
|
2439
|
-
function
|
|
2463
|
+
function Mr(e = {}) {
|
|
2440
2464
|
return J({
|
|
2441
2465
|
id: X(),
|
|
2442
2466
|
type: "menu",
|
|
2443
2467
|
items: [],
|
|
2444
|
-
...
|
|
2468
|
+
...mn,
|
|
2445
2469
|
styles: Z()
|
|
2446
2470
|
}, e);
|
|
2447
2471
|
}
|
|
2448
|
-
function
|
|
2472
|
+
function Nr(e, t) {
|
|
2449
2473
|
return Array.from({ length: t }, () => ({
|
|
2450
2474
|
id: X(),
|
|
2451
2475
|
cells: Array.from({ length: e }, () => ({
|
|
@@ -2454,29 +2478,29 @@ function Or(e, t) {
|
|
|
2454
2478
|
}))
|
|
2455
2479
|
}));
|
|
2456
2480
|
}
|
|
2457
|
-
function
|
|
2481
|
+
function Pr(e = {}) {
|
|
2458
2482
|
return J({
|
|
2459
2483
|
id: X(),
|
|
2460
2484
|
type: "table",
|
|
2461
|
-
rows:
|
|
2462
|
-
...
|
|
2485
|
+
rows: Nr(3, 3),
|
|
2486
|
+
...hn,
|
|
2463
2487
|
styles: Z()
|
|
2464
2488
|
}, e);
|
|
2465
2489
|
}
|
|
2466
|
-
function
|
|
2490
|
+
function Fr(e = {}) {
|
|
2467
2491
|
return J({
|
|
2468
2492
|
id: X(),
|
|
2469
2493
|
type: "countdown",
|
|
2470
|
-
...
|
|
2494
|
+
...gn,
|
|
2471
2495
|
styles: Z()
|
|
2472
2496
|
}, e);
|
|
2473
2497
|
}
|
|
2474
|
-
function
|
|
2498
|
+
function Ir(e) {
|
|
2475
2499
|
return e.type === "repeatable" ? e.default ?? [] : e.type === "boolean" ? e.default ?? !1 : e.type === "number" ? e.default ?? 0 : e.default ?? "";
|
|
2476
2500
|
}
|
|
2477
|
-
function
|
|
2501
|
+
function Lr(e) {
|
|
2478
2502
|
let t = {};
|
|
2479
|
-
for (let n of e.fields) t[n.key] = Y(
|
|
2503
|
+
for (let n of e.fields) t[n.key] = Y(Ir(n));
|
|
2480
2504
|
let n = J(Z(), Y(e.defaultStyles));
|
|
2481
2505
|
return {
|
|
2482
2506
|
id: X(),
|
|
@@ -2487,14 +2511,14 @@ function Mr(e) {
|
|
|
2487
2511
|
...e.dataSource ? { dataSourceFetched: !1 } : {}
|
|
2488
2512
|
};
|
|
2489
2513
|
}
|
|
2490
|
-
function
|
|
2514
|
+
function Rr() {
|
|
2491
2515
|
return {
|
|
2492
2516
|
id: X(),
|
|
2493
2517
|
type: "slot",
|
|
2494
2518
|
styles: Z(0)
|
|
2495
2519
|
};
|
|
2496
2520
|
}
|
|
2497
|
-
function
|
|
2521
|
+
function zr(e = {}) {
|
|
2498
2522
|
return J({
|
|
2499
2523
|
id: X(),
|
|
2500
2524
|
type: "wrapper",
|
|
@@ -2502,27 +2526,27 @@ function Pr(e = {}) {
|
|
|
2502
2526
|
styles: Z(0)
|
|
2503
2527
|
}, e);
|
|
2504
2528
|
}
|
|
2505
|
-
function
|
|
2529
|
+
function Br(e, t) {
|
|
2506
2530
|
switch (e) {
|
|
2507
|
-
case "section": return
|
|
2508
|
-
case "title": return
|
|
2509
|
-
case "paragraph": return
|
|
2510
|
-
case "image": return
|
|
2511
|
-
case "button": return
|
|
2512
|
-
case "divider": return
|
|
2513
|
-
case "video": return
|
|
2514
|
-
case "social": return
|
|
2515
|
-
case "spacer": return
|
|
2516
|
-
case "html": return
|
|
2517
|
-
case "menu": return
|
|
2518
|
-
case "table": return
|
|
2519
|
-
case "countdown": return
|
|
2531
|
+
case "section": return Dr(Y(t?.section));
|
|
2532
|
+
case "title": return Sr(Y(t?.title));
|
|
2533
|
+
case "paragraph": return Cr(Y(t?.paragraph));
|
|
2534
|
+
case "image": return wr(Y(t?.image));
|
|
2535
|
+
case "button": return Tr(Y(t?.button));
|
|
2536
|
+
case "divider": return Er(Y(t?.divider));
|
|
2537
|
+
case "video": return Or(Y(t?.video));
|
|
2538
|
+
case "social": return kr(Y(t?.social));
|
|
2539
|
+
case "spacer": return Ar(Y(t?.spacer));
|
|
2540
|
+
case "html": return jr(Y(t?.html));
|
|
2541
|
+
case "menu": return Mr(Y(t?.menu));
|
|
2542
|
+
case "table": return Pr(Y(t?.table));
|
|
2543
|
+
case "countdown": return Fr(Y(t?.countdown));
|
|
2520
2544
|
case "slot": throw Error("[Templatical] slot cannot be inserted into content. Use createSlotBlock() to build a layout.");
|
|
2521
2545
|
case "wrapper": throw Error("[Templatical] wrapper cannot be inserted into content. Use createWrapperBlock() to build a layout.");
|
|
2522
2546
|
default: throw Error(`Unknown block type: ${e}`);
|
|
2523
2547
|
}
|
|
2524
2548
|
}
|
|
2525
|
-
function
|
|
2549
|
+
function Vr(e, t) {
|
|
2526
2550
|
let n = e.l10n;
|
|
2527
2551
|
if (!n || t.size === 0) return;
|
|
2528
2552
|
let r = (n) => {
|
|
@@ -2552,86 +2576,87 @@ function Q(e) {
|
|
|
2552
2576
|
}
|
|
2553
2577
|
if (t.type === "menu") for (let e of t.items) r(e, "items");
|
|
2554
2578
|
if (t.type === "social") for (let e of t.icons) r(e, "icons");
|
|
2555
|
-
return t.type === "section" && (t.children = t.children.map((e) => e.map((e) => Q(e)))), t.type === "wrapper" && (t.children = t.children.map((e) => Q(e))),
|
|
2579
|
+
return t.type === "section" && (t.children = t.children.map((e) => e.map((e) => Q(e)))), t.type === "wrapper" && (t.children = t.children.map((e) => Q(e))), Vr(t, n), t;
|
|
2556
2580
|
}
|
|
2557
2581
|
// ../types/src/layout.ts
|
|
2558
|
-
var
|
|
2559
|
-
function $(e, t, n = null, r = !1) {
|
|
2560
|
-
for (let
|
|
2561
|
-
else
|
|
2582
|
+
var Hr = "[Templatical] layout: must contain exactly one slot block", Ur = "[Templatical] layout: slot must be a top-level or wrapper child, not nested in a section", Wr = "[Templatical] layout: a wrapper cannot contain a wrapper", Gr = "[Templatical] layout: a wrapper around the slot cannot contain blocks that emit mj-wrapper (section.wrapper)", Kr = "[Templatical] slot is not a valid content block", qr = "[Templatical] layout: a wrapper cannot contain a section with its own wrapper (section.wrapper)", Jr = "[Templatical] wrapper is not a valid content block";
|
|
2583
|
+
function $(e, t, n = null, r = !1, i = !1) {
|
|
2584
|
+
for (let a of e) if (t(a, n, r, i), Ut(a)) for (let e of a.children) $(e, t, a, !0, i);
|
|
2585
|
+
else V(a) && $(a.children, t, a, r, !0);
|
|
2562
2586
|
}
|
|
2563
|
-
function
|
|
2587
|
+
function Yr(e) {
|
|
2564
2588
|
let t = 0;
|
|
2565
|
-
if ($(e.blocks, (e, n, r) => {
|
|
2566
|
-
if (
|
|
2567
|
-
if (B(e))
|
|
2568
|
-
|
|
2569
|
-
if (
|
|
2589
|
+
if ($(e.blocks, (e, n, r, i) => {
|
|
2590
|
+
if (i && Ut(e) && e.wrapper) throw Error(qr);
|
|
2591
|
+
if (B(e) && (t += 1, r)) throw Error(Ur);
|
|
2592
|
+
if (V(e)) {
|
|
2593
|
+
if (r) throw Error(Ur);
|
|
2594
|
+
if (e.children.some(V)) throw Error(Wr);
|
|
2570
2595
|
}
|
|
2571
|
-
}), t !== 1) throw Error(
|
|
2596
|
+
}), t !== 1) throw Error(Hr);
|
|
2572
2597
|
}
|
|
2573
|
-
function
|
|
2598
|
+
function Xr(e) {
|
|
2574
2599
|
$(e.blocks, (e) => {
|
|
2575
|
-
if (
|
|
2600
|
+
if (B(e)) throw Error(Kr);
|
|
2576
2601
|
});
|
|
2577
2602
|
}
|
|
2578
|
-
function
|
|
2603
|
+
function Zr(e) {
|
|
2579
2604
|
$(e.blocks, (e) => {
|
|
2580
|
-
if (
|
|
2605
|
+
if (V(e)) throw Error(Jr);
|
|
2581
2606
|
});
|
|
2582
2607
|
}
|
|
2583
|
-
function
|
|
2608
|
+
function Qr(e) {
|
|
2584
2609
|
let t = !1;
|
|
2585
2610
|
return $(e.blocks, (e, n) => {
|
|
2586
|
-
|
|
2611
|
+
B(e) && n !== null && V(n) && (t = !0);
|
|
2587
2612
|
}), t;
|
|
2588
2613
|
}
|
|
2589
|
-
function
|
|
2590
|
-
if (
|
|
2591
|
-
if (
|
|
2614
|
+
function $r(e) {
|
|
2615
|
+
if (B(e)) return e;
|
|
2616
|
+
if (V(e)) {
|
|
2592
2617
|
let t = Q({
|
|
2593
2618
|
...e,
|
|
2594
2619
|
children: []
|
|
2595
2620
|
});
|
|
2596
|
-
return t.children = e.children.map(
|
|
2621
|
+
return t.children = e.children.map($r), t;
|
|
2597
2622
|
}
|
|
2598
2623
|
return Q(e);
|
|
2599
2624
|
}
|
|
2600
|
-
function
|
|
2625
|
+
function ei(e) {
|
|
2601
2626
|
for (let t = 0; t < e.length; t++) {
|
|
2602
2627
|
let n = e[t];
|
|
2603
|
-
if (
|
|
2628
|
+
if (B(n)) return {
|
|
2604
2629
|
parent: e,
|
|
2605
2630
|
index: t
|
|
2606
2631
|
};
|
|
2607
|
-
if (
|
|
2608
|
-
let e =
|
|
2632
|
+
if (V(n)) {
|
|
2633
|
+
let e = ei(n.children);
|
|
2609
2634
|
if (e) return e;
|
|
2610
2635
|
}
|
|
2611
2636
|
}
|
|
2612
2637
|
return null;
|
|
2613
2638
|
}
|
|
2614
|
-
function
|
|
2615
|
-
for (let t of e) if (
|
|
2639
|
+
function ti(e) {
|
|
2640
|
+
for (let t of e) if (Ut(t)) {
|
|
2616
2641
|
if (t.wrapper) return !0;
|
|
2617
|
-
for (let e of t.children) if (
|
|
2642
|
+
for (let e of t.children) if (ti(e)) return !0;
|
|
2618
2643
|
}
|
|
2619
2644
|
return !1;
|
|
2620
2645
|
}
|
|
2621
|
-
function
|
|
2622
|
-
if (
|
|
2623
|
-
let n = e.blocks.map(
|
|
2624
|
-
if (!r) throw Error(
|
|
2625
|
-
return r.parent.splice(r.index, 1, ...
|
|
2646
|
+
function ni(e, t) {
|
|
2647
|
+
if (Yr(e), Xr(t), Zr(t), Qr(e) && ti(t.blocks)) throw Error(Gr);
|
|
2648
|
+
let n = e.blocks.map($r), r = ei(n);
|
|
2649
|
+
if (!r) throw Error(Hr);
|
|
2650
|
+
return r.parent.splice(r.index, 1, ...m(t.blocks)), {
|
|
2626
2651
|
blocks: n,
|
|
2627
2652
|
settings: {
|
|
2628
|
-
...
|
|
2653
|
+
...m(t.settings),
|
|
2629
2654
|
backgroundColor: e.settings.backgroundColor
|
|
2630
2655
|
}
|
|
2631
2656
|
};
|
|
2632
2657
|
}
|
|
2633
2658
|
// ../types/src/url-policy.ts
|
|
2634
|
-
var
|
|
2659
|
+
var ri = Object.freeze([
|
|
2635
2660
|
"http",
|
|
2636
2661
|
"https",
|
|
2637
2662
|
"mailto",
|
|
@@ -2641,44 +2666,44 @@ var Zr = Object.freeze([
|
|
|
2641
2666
|
"sms",
|
|
2642
2667
|
"xmpp",
|
|
2643
2668
|
"cid"
|
|
2644
|
-
]),
|
|
2669
|
+
]), ii = Object.freeze([
|
|
2645
2670
|
"javascript",
|
|
2646
2671
|
"data",
|
|
2647
2672
|
"vbscript"
|
|
2648
2673
|
]);
|
|
2649
|
-
function
|
|
2674
|
+
function ai(e) {
|
|
2650
2675
|
return e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
|
|
2651
2676
|
}
|
|
2652
|
-
function
|
|
2653
|
-
let t = /^([a-z][a-z0-9+.-]*):/i.exec(
|
|
2677
|
+
function oi(e) {
|
|
2678
|
+
let t = /^([a-z][a-z0-9+.-]*):/i.exec(ai(e));
|
|
2654
2679
|
return t ? t[1].toLowerCase() : null;
|
|
2655
2680
|
}
|
|
2656
|
-
var
|
|
2681
|
+
var si = /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i, ci = Object.freeze([
|
|
2657
2682
|
"href",
|
|
2658
2683
|
"xlink:href",
|
|
2659
2684
|
"background",
|
|
2660
2685
|
"poster",
|
|
2661
2686
|
"src"
|
|
2662
|
-
]),
|
|
2687
|
+
]), li = Object.freeze([
|
|
2663
2688
|
"srcdoc",
|
|
2664
2689
|
"ping",
|
|
2665
2690
|
"formaction",
|
|
2666
2691
|
"action"
|
|
2667
2692
|
]);
|
|
2668
|
-
function
|
|
2669
|
-
let n =
|
|
2670
|
-
return r === null ||
|
|
2693
|
+
function ui(e, t) {
|
|
2694
|
+
let n = ai(e), r = oi(n);
|
|
2695
|
+
return r === null || ri.some((e) => e === r) ? !0 : t.toLowerCase() === "src" && si.test(n);
|
|
2671
2696
|
}
|
|
2672
2697
|
// ../types/src/rich-text.ts
|
|
2673
|
-
var
|
|
2674
|
-
function
|
|
2675
|
-
return e.replace(
|
|
2698
|
+
var di = /<\/?p\b[^<>]*>/gi, fi = /<p\b([^<>]*)>\s*<\/p>/gi;
|
|
2699
|
+
function pi(e) {
|
|
2700
|
+
return e.replace(di, "").trim() === "";
|
|
2676
2701
|
}
|
|
2677
|
-
function
|
|
2678
|
-
return
|
|
2702
|
+
function mi(e) {
|
|
2703
|
+
return pi(e) ? e : e.replace(fi, "<p$1> </p>");
|
|
2679
2704
|
}
|
|
2680
2705
|
// ../types/src/fonts.ts
|
|
2681
|
-
var
|
|
2706
|
+
var hi = {
|
|
2682
2707
|
arial: "Arial, sans-serif",
|
|
2683
2708
|
helvetica: "Helvetica, sans-serif",
|
|
2684
2709
|
georgia: "Georgia, serif",
|
|
@@ -2687,13 +2712,13 @@ var li = {
|
|
|
2687
2712
|
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
2688
2713
|
"courier new": "'Courier New', monospace",
|
|
2689
2714
|
tahoma: "Tahoma, sans-serif"
|
|
2690
|
-
},
|
|
2715
|
+
}, gi = /* @__PURE__ */ new Set([
|
|
2691
2716
|
"inherit",
|
|
2692
2717
|
"initial",
|
|
2693
2718
|
"unset",
|
|
2694
2719
|
"revert",
|
|
2695
2720
|
"revert-layer"
|
|
2696
|
-
]),
|
|
2721
|
+
]), _i = /* @__PURE__ */ new Set([
|
|
2697
2722
|
"serif",
|
|
2698
2723
|
"sans-serif",
|
|
2699
2724
|
"monospace",
|
|
@@ -2708,14 +2733,14 @@ var li = {
|
|
|
2708
2733
|
"math",
|
|
2709
2734
|
"fangsong"
|
|
2710
2735
|
]);
|
|
2711
|
-
function
|
|
2736
|
+
function vi(e) {
|
|
2712
2737
|
return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
|
|
2713
2738
|
}
|
|
2714
|
-
function
|
|
2739
|
+
function yi(e) {
|
|
2715
2740
|
if (typeof e != "string") return [];
|
|
2716
2741
|
let t = e.replace(/!\s*important\s*$/i, ""), n = [], r = 0;
|
|
2717
2742
|
for (;;) {
|
|
2718
|
-
for (; r < t.length &&
|
|
2743
|
+
for (; r < t.length && vi(t[r]);) r++;
|
|
2719
2744
|
if (r >= t.length) return [];
|
|
2720
2745
|
let e = t[r];
|
|
2721
2746
|
if (e === "\"" || e === "'") {
|
|
@@ -2732,7 +2757,7 @@ function pi(e) {
|
|
|
2732
2757
|
}
|
|
2733
2758
|
}
|
|
2734
2759
|
if (!o) return [];
|
|
2735
|
-
for (; a < t.length &&
|
|
2760
|
+
for (; a < t.length && vi(t[a]);) a++;
|
|
2736
2761
|
if (a < t.length && t[a] !== ",") return [];
|
|
2737
2762
|
n.push({
|
|
2738
2763
|
name: i,
|
|
@@ -2740,7 +2765,7 @@ function pi(e) {
|
|
|
2740
2765
|
}), r = a;
|
|
2741
2766
|
} else {
|
|
2742
2767
|
let e = t.indexOf(",", r), i = e === -1 ? t.length : e, a = t.slice(r, i).trim().split(/\s+/).join(" ");
|
|
2743
|
-
if (a === "" || a.includes("\"") || a.includes("'") ||
|
|
2768
|
+
if (a === "" || a.includes("\"") || a.includes("'") || gi.has(a.toLowerCase())) return [];
|
|
2744
2769
|
n.push({
|
|
2745
2770
|
name: a,
|
|
2746
2771
|
quoted: !1
|
|
@@ -2750,27 +2775,27 @@ function pi(e) {
|
|
|
2750
2775
|
r++;
|
|
2751
2776
|
}
|
|
2752
2777
|
}
|
|
2753
|
-
function
|
|
2778
|
+
function bi(e) {
|
|
2754
2779
|
return `'${e.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
|
|
2755
2780
|
}
|
|
2756
|
-
function
|
|
2757
|
-
return !e.quoted &&
|
|
2781
|
+
function xi(e) {
|
|
2782
|
+
return !e.quoted && _i.has(e.name.toLowerCase());
|
|
2758
2783
|
}
|
|
2759
|
-
function
|
|
2760
|
-
return
|
|
2784
|
+
function Si(e) {
|
|
2785
|
+
return yi(e)[0]?.name ?? "";
|
|
2761
2786
|
}
|
|
2762
|
-
function
|
|
2763
|
-
let n = (e) => `${
|
|
2787
|
+
function Ci(e, t) {
|
|
2788
|
+
let n = (e) => `${bi(e.name)}, ${e.fallback ?? t.defaultFallback}`, r = typeof e == "string" ? e.trim().toLowerCase() : "", i = t.customFonts.find((e) => e.name.toLowerCase() === r);
|
|
2764
2789
|
if (i) return n(i);
|
|
2765
|
-
let a =
|
|
2790
|
+
let a = yi(e);
|
|
2766
2791
|
if (a.length !== 1) return e;
|
|
2767
2792
|
let [o] = a, s = o.name.toLowerCase(), c = t.customFonts.find((e) => e.name.toLowerCase() === s);
|
|
2768
|
-
return c ? n(c) :
|
|
2793
|
+
return c ? n(c) : hi[s] || (xi(o) ? e : `${bi(o.name)}, ${t.defaultFallback}`);
|
|
2769
2794
|
}
|
|
2770
2795
|
// ../types/src/preview-resolution.ts
|
|
2771
|
-
function
|
|
2796
|
+
function wi(e) {
|
|
2772
2797
|
return typeof e != "object" || !e ? !1 : Array.isArray(e.blocks);
|
|
2773
2798
|
}
|
|
2774
|
-
export {
|
|
2799
|
+
export { rr as $, Ne as $t, kr as A, Yt as At, vr as B, g as Bt, Er as C, n as Cn, Gt as Ct, Cr as D, Zt as Dt, Mr as E, t as En, Xt as Et, zr as F, He as Ft, nr as G, Ce as Gt, W as H, w as Ht, X as I, E as It, Un as J, Fe as Jt, qn as K, Ee as Kt, br as L, j as Lt, Pr as M, Ht as Mt, Sr as N, Bt as Nt, Dr as O, en as Ot, Or as P, T as Pt, Kn as Q, y as Qt, ar as R, Be as Rt, Lr as S, c as Sn, $t as St, wr as T, o as Tn, B as Tt, G as U, ve as Ut, hr as V, Ie as Vt, er as W, v as Wt, Zn as X, Se as Xt, Hn as Y, Oe as Yt, tr as Z, we as Zt, Yr as _, i as _n, tn as _t, mi as a, se as an, Qn as at, Tr as b, s as bn, Qt as bt, li as c, pe as cn, U as ct, oi as d, ie as dn, wn as dt, S as en, Jn as et, ui as f, f as fn, xn as ft, Qr as g, ne as gn, qt as gt, Zr as h, te as hn, bn as ht, Ci as i, m as in, Xn as it, Ar as j, V as jt, Rr as k, Wt as kt, ci as l, fe as ln, Dn as lt, Xr as m, ee as mn, vn as mt, Si as n, ge as nn, zn as nt, pi as o, de as on, Mn as ot, ni as p, p as pn, _n as pt, Yn as q, Pe as qt, yi as r, h as rn, K as rt, ii as s, ue as sn, Nn as st, wi as t, x as tn, Wn as tt, ri as u, oe as un, Tn as ut, Q as v, e as vn, nn as vt, jr as w, r as wn, Ut as wt, Fr as x, u as xn, Kt as xt, Br as y, l as yn, Jt as yt, yr as z, Ve as zt };
|
|
2775
2800
|
|
|
2776
|
-
//# sourceMappingURL=src-
|
|
2801
|
+
//# sourceMappingURL=src-CdVAke9t.js.map
|