Liferay.Loader.define("dynamic-data-mapping-form-web@4.0.84/admin/js/components/ManagementToolbar.es",["module","exports","require","@liferay/frontend-js-react-web","data-engine-js-components-web","liferay!frontend-js-react-web$react"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.ManagementToolbar=function({onPlusClick:t,onPreviewClick:n,onPublishClick:d,onSaveClick:i,onSettingsClick:l,onShareClick:a,portletNamespace:u,variant:m="builder"}){const{published:f,showPublishAlert:b}=(0,o.useConfig)();return(0,s.useEffect)((()=>{const t=document.querySelector("#".concat(u,"managementToolbar"));return("builder"===m?e:c)(t)}),[]),(0,s.useEffect)((()=>{const e=document.getElementById("addFieldButton");t?e.classList.remove("hide"):e.classList.add("hide")}),[t]),(0,s.useEffect)((()=>{const e=document.querySelector(".lfr-ddm-share-url-button");b&&f&&e.removeAttribute("title")}),[b,f]),(0,r.useEventListener)("click",t,!0,document.getElementById("addFieldButton")),(0,r.useEventListener)("click",n,!0,document.querySelector(".lfr-ddm-preview-button")),(0,r.useEventListener)("click",d,!0,document.querySelector(".lfr-ddm-publish-button")),(0,r.useEventListener)("click",i,!0,document.querySelector(".lfr-ddm-save-button")),(0,r.useEventListener)("click",a,!0,document.querySelector(".lfr-ddm-share-url-button")),(0,r.useEventListener)("click",l,!0,document.querySelector(".lfr-ddm-settings-button")),null};var r=n("@liferay/frontend-js-react-web"),o=n("data-engine-js-components-web"),s=n("liferay!frontend-js-react-web$react");const e=e=>{const t=document.querySelectorAll(".toolbar-group-field .nav-item .lfr-ddm-button"),n=document.querySelector(".publish-icon");return e&&e.classList.remove("hide"),t.forEach((e=>{e.classList.remove("hide")})),n&&n.classList.remove("hide"),()=>{e&&e.classList.add("hide"),t.forEach((e=>{e.classList.add("hide")})),n&&n.classList.add("hide")}},c=e=>{const t=document.querySelectorAll(".toolbar-group-field .nav-item .lfr-ddm-button");return e.classList.remove("hide"),t.forEach((e=>{e.classList.add("hide")})),()=>{e.classList.add("hide")}}}}));
//# sourceMappingURL=ManagementToolbar.es.js.map