Liferay.Loader.define("layout-seo-web@2.0.47/js/seo/openGraphSettings.es",["module","exports","require","frontend-js-web"],(function(e,t,a){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({namespace:e,uploadOpenGraphImageURL:t}){const a=document.getElementById("".concat(e,"openGraphImageButton")),o=document.getElementById("".concat(e,"openGraphImageFileEntryId")),l=document.getElementById("".concat(e,"openGraphImageTitle")),d=document.getElementById("".concat(e,"openGraphPreviewImage")),c=document.getElementById("".concat(e,"openGraphImageAlt")),g=document.getElementById("".concat(e,"openGraphImageAlt_").concat(Liferay.ThemeDisplay.getDefaultLanguageId())),i=document.querySelector('[for="'.concat(e,'openGraphImageAlt"]'));a.addEventListener("click",(a=>{a.preventDefault(),(0,n.openSelectionModal)({buttonAddLabel:Liferay.Language.get("done"),onSelect:e=>{if(e){const t=JSON.parse(e.value);o.value=t.fileEntryId,l.value=t.title,d.src=t.url,d.classList.remove("hide"),(0,n.toggleDisabled)(c,!1),(0,n.toggleDisabled)(g,!1),(0,n.toggleDisabled)(i,!1)}},selectEventName:"".concat(e,"openGraphImageSelectedItem"),title:Liferay.Language.get("open-graph-image"),url:t})}));const s=document.getElementById("".concat(e,"openGraphClearImageButton"));s.addEventListener("click",(()=>{o.value="",l.value="",d.src="",(0,n.toggleDisabled)(c,!0),(0,n.toggleDisabled)(g,!0),(0,n.toggleDisabled)(i,!0),d.classList.add("hide")}));const r=document.getElementById("".concat(e,"openGraphEnabled")),m=document.getElementById("".concat(e,"openGraphSettings"));r.addEventListener("click",(e=>{const t=!e.target.checked,o=t||!l.value;(0,n.toggleDisabled)(l,t),(0,n.toggleDisabled)(a,t),(0,n.toggleDisabled)(s,t),(0,n.toggleDisabled)(c,o),(0,n.toggleDisabled)(g,o),(0,n.toggleDisabled)(i,o),m.classList.toggle("disabled")}))};var n=a("frontend-js-web")}));
//# sourceMappingURL=openGraphSettings.es.js.map