(()=>{"use strict";var e={n:n=>{var o=n&&n.__esModule?()=>n.default:()=>n;return e.d(o,{a:o}),o},d:(n,o)=>{for(var t in o)e.o(o,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:o[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{setIsModalOpen:()=>l});var o={};e.r(o),e.d(o,{isModalOpen:()=>r});const t=window.wp.domReady;var i=e.n(t);const s=window.wp.element,d=window.wp.data;function l(e){return{type:"SET_MODAL_OPEN",isOpen:e}}function r(e){return e.modal.isOpen}const c={reducer:(0,d.combineReducers)({modal:function(e={isOpen:!1},n){return"SET_MODAL_OPEN"===n.type?{...e,isOpen:n.isOpen}:e}}),actions:n,selectors:o},u=(0,d.createReduxStore)("newfold/coming-soon",c);(0,d.register)(u);const a=window.wp.components,p=window.wp.i18n,w=window.ReactJSXRuntime,m=()=>{const{setIsModalOpen:e}=(0,d.useDispatch)(u),{isModalOpen:n}=(0,d.useSelect)((e=>({isModalOpen:e(u).isModalOpen()})));if(!n||!window.NewfoldRuntime.comingSoon.isEnabled)return null;const o=(0,p.__)("Ready to launch your Site?","wp-module-coming-soon"),t=(0,p.__)("Pages and posts you publish will not be visible to the public until you launch your site.","wp-module-coming-soon"),i=(0,p.__)("Publish & Launch Site","wp-module-coming-soon"),s=(0,p.__)("Publish Without Launching","wp-module-coming-soon");return(0,w.jsx)(a.Modal,{title:o,onRequestClose:()=>e(!1),children:(0,w.jsxs)("div",{children:[(0,w.jsx)("p",{children:t}),(0,w.jsx)("br",{}),(0,w.jsxs)("div",{style:{alignContent:"space-between",display:"flex",flexWrap:"wrap",gap:"16px",boxSizing:"inherit"},children:[(0,w.jsx)(a.Button,{variant:"primary",onClick:()=>{window.NewfoldRuntime.comingSoon.disable(),e(!1)},style:{flex:1,justifyContent:"center"},children:i}),(0,w.jsx)(a.Button,{variant:"link",onClick:()=>e(!1),style:{flex:1,justifyContent:"center"},children:s})]})]})})};i()((()=>{b("nfd-pre-publish-modal")}));const b=e=>{const n=document.createElement("div");n.id=e,document.getElementById(e)||document.body.append(n),(0,s.render)((0,w.jsx)(m,{}),n)},y=()=>{const e=window.wp.data.select("core/editor").getEditedPostAttribute("status");void 0!==e?(e=>{if("publish"!==e){const e=(0,d.subscribe)((()=>{if("publish"===window.wp.data.select("core/editor").getEditedPostAttribute("status")){e();const n=()=>{document.querySelector(".components-snackbar-list__notice-container")?(0,d.dispatch)(u).setIsModalOpen(!0):setTimeout(n,50)};n()}}))}})(e):setTimeout(y,50)};y(),((window.newfold=window.newfold||{}).ComingSoon=window.newfold.ComingSoon||{}).prePublishWarning={}})();