Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.174/page_editor/app/processors/ImageProcessor",["module","exports","require","../../common/openImageSelector","../utils/getEditableLinkValue","../utils/getEditableLocalizedValue"],(function(e,t,a){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=a("../../common/openImageSelector"),r=a("../utils/getEditableLinkValue"),o=a("../utils/getEditableLocalizedValue");var n={createEditor:function createEditor(e,t,a){(0,l.openImageSelector)((e=>{t(e,{alt:""})}),a)},destroyEditor:function destroyEditor(){},render:function render(e,t,a={},l){let n=null;if(n=e instanceof HTMLImageElement?e:e.querySelector("img"),n){n.alt=(0,o.getEditableLocalizedValue)(a.alt,l)||(null==t?void 0:t.alt)||"";const e=(0,r.getEditableLinkValue)(a,l);if(e.href)if(n.parentElement instanceof HTMLAnchorElement)n.parentElement.href=e.href,n.parentElement.target=e.target;else{const t=document.createElement("a");t.href="".concat(a.prefix||"").concat(e.href),t.target=e.target,n.parentElement.replaceChild(t,n),t.appendChild(n)}const i=t&&"string"!=typeof t?t.url:t;i&&(n.src=i),a.lazyLoading&&(n.loading="lazy")}}};t.default=n}));
//# sourceMappingURL=ImageProcessor.js.map