Liferay.Loader.define("@liferay/document-library-web@6.0.111/document_library/js/image-editor/EditImageWithImageEditor",["module","exports","require","@frontend-taglib-clay$clayui/modal","frontend-js-web","item-selector-taglib","liferay!frontend-js-react-web$react"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({editImageURL:e,portletNamespace:t,redirectURL:r}){const o=(0,l.useRef)(),[u,d]=(0,l.useState)(),[c,f]=(0,l.useState)(),{observer:s,onClose:m}=(0,a.useModal)({onClose:()=>{f(!1)}});return(0,l.useEffect)((()=>(window["".concat(t,"editWithImageEditor")]=({fileEntryId:e,imageURL:t})=>{o.current=e,d(t),f(!0)},()=>{window["".concat(t,"editWithImageEditor")]=()=>{}})),[t]),l.default.createElement(l.default.Fragment,null,c&&l.default.createElement(a.default,{className:"image-editor-modal",observer:s,size:"full-screen"},l.default.createElement(a.default.Header,null,Liferay.Language.get("editing-image")),l.default.createElement(a.default.Body,null,u&&l.default.createElement(i.ImageEditor,{imageId:o.current,imageSrc:u,onCancel:m,onSave:e=>{(null==e?void 0:e.success)&&(0,n.navigate)(r)},saveURL:e}))))};var a=u(r("@frontend-taglib-clay$clayui/modal")),n=r("frontend-js-web"),i=r("item-selector-taglib"),l=u(r("liferay!frontend-js-react-web$react"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}}}));
//# sourceMappingURL=EditImageWithImageEditor.js.map