(()=>{"use strict";const e=window.wp.element,t=window.wp.editPost,a=window.wp.i18n,i=window.wp.primitives,n=(0,e.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(i.Path,{d:"M7.8 6c0-.7.6-1.2 1.2-1.2h6c.7 0 1.2.6 1.2 1.2v3h1.5V6c0-1.5-1.2-2.8-2.8-2.8H9C7.5 3.2 6.2 4.5 6.2 6v3h1.5V6zm8.4 11c0 .7-.6 1.2-1.2 1.2H9c-.7 0-1.2-.6-1.2-1.2v-3H6.2v3c0 1.5 1.2 2.8 2.8 2.8h6c1.5 0 2.8-1.2 2.8-2.8v-3h-1.5v3zM4 11v1h16v-1H4z"})),o=window.wp.plugins,s=window.wp.components,l=window.wp.compose,c=window.wp.data,{metaKey:p}=autopagingSettings,g=(0,l.compose)([(0,c.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor"),a=t("content");return{disabled:!!t("meta")[p],hasQuicktag:-1!==a.indexOf("wp:nextpage")}})),(0,c.withDispatch)((e=>{const{editPost:t}=e("core/editor");return{setDisabled:e=>{t({meta:{[p]:!!e}})}}}))])((t=>{let{disabled:i,hasQuicktag:n,setDisabled:o}=t;return(0,e.createElement)(e.Fragment,null,n&&(0,e.createElement)("p",{dangerouslySetInnerHTML:{__html:(0,a.__)("Autopaging is disabled because the <em>Page Break</em> block is used.","automatically-paginate-posts")}}),!n&&(0,e.createElement)(s.ToggleControl,{label:(0,a.__)("Disable autopaging for this post?","automatically-paginate-posts"),help:(0,a.__)("Check the box above to prevent this post from automatically being split over multiple pages.","automatically-paginate-posts"),checked:i,onChange:o}))})),r="autopaging";(0,o.registerPlugin)(r,{icon:n,render:()=>(0,e.createElement)(t.PluginDocumentSettingPanel,{name:r,title:(0,a.__)("Autopaging","automatically-paginate-posts"),className:r},(0,e.createElement)(g,null))})})();