Liferay.Loader.define("style-book-web@2.0.76/js/style-book-editor/PublishButton",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/modal","@liferay/layout-content-page-editor-web","liferay!frontend-js-react-web$react","./StyleErrorsModal","./config"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function PublishButton(){const e=(0,i.useRef)(),t=(0,l.useHasStyleErrors)(),[a,c]=(0,i.useState)(!1),[d,f]=(0,i.useState)(!1),{observer:s,onClose:y}=(0,n.useModal)({onClose:()=>c(!1)});return i.default.createElement(i.default.Fragment,null,i.default.createElement("form",{action:u.config.publishURL,method:"POST",ref:e},i.default.createElement("input",{name:"".concat(u.config.namespace,"redirect"),type:"hidden",value:u.config.redirectURL}),i.default.createElement("input",{name:"".concat(u.config.namespace,"styleBookEntryId"),type:"hidden",value:u.config.styleBookEntryId}),i.default.createElement(r.default,{"aria-label":Liferay.Language.get("publish"),disabled:u.config.pending,displayType:"primary",onClick:t?()=>f(!0):()=>c(!0),size:"sm",type:"button"},Liferay.Language.get("publish"))),d&&t&&i.default.createElement(o.StyleErrorsModal,{onCloseModal:()=>f(!1),onPublish:()=>{f(!1),c(!0)}}),a&&i.default.createElement(n.default,{"aria-label":Liferay.Language.get("publishing-info"),observer:s,status:"info"},i.default.createElement(n.default.Header,null,Liferay.Language.get("publishing-info")),i.default.createElement(n.default.Body,null,i.default.createElement("p",null,Liferay.Language.get("once-published-these-changes-will-affect-all-instances-of-the-site-using-these-properties-do-you-want-to-publish-now"))),i.default.createElement(n.default.Footer,{last:i.default.createElement(r.default.Group,{spaced:!0},i.default.createElement(r.default,{displayType:"secondary",onClick:y},Liferay.Language.get("cancel")),i.default.createElement(r.default,{displayType:"info",onClick:()=>{e.current&&e.current.submit()},type:"submit"},Liferay.Language.get("publish")))})))};var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(a("@frontend-taglib-clay$clayui/button")),n=_interopRequireWildcard(a("@frontend-taglib-clay$clayui/modal")),l=a("@liferay/layout-content-page-editor-web"),i=_interopRequireWildcard(a("liferay!frontend-js-react-web$react")),o=a("./StyleErrorsModal"),u=a("./config");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=r?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(a,n,l):a[n]=e[n]}return a.default=e,t&&t.set(e,a),a}}}));
//# sourceMappingURL=PublishButton.js.map