Liferay.Loader.define("journal-web@5.0.101/js/ImageInput.es",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","frontend-js-web","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({name:e,portletNamespace:t,previewURL:a}){const[i,o]=(0,c.useState)(a||""),f="".concat(t).concat(e),d=(0,c.useRef)();return c.default.createElement("div",{className:"mb-3"},a?c.default.createElement("div",{className:"aspect-ratio aspect-ratio-16-to-9 mb-2 rounded"},c.default.createElement("img",{alt:Liferay.Language.get("preview"),className:"aspect-ratio-item-fluid",src:a})):null,e?c.default.createElement(l.default.Group,null,c.default.createElement("label",{className:"sr-only",htmlFor:f},Liferay.Language.get("image")),c.default.createElement(l.ClayInput.Group,{small:!0},c.default.createElement(l.ClayInput.GroupItem,null,c.default.createElement("input",{className:"sr-only",id:f,name:e,onChange:e=>{var t,a;return o((null===(t=e.target.files)||void 0===t||null===(a=t[0])||void 0===a?void 0:a.name)||"")},ref:d,type:"file"}),c.default.createElement(l.ClayInput,{onClick:()=>{var e;return null===(e=d.current)||void 0===e?void 0:e.click()},placeholder:Liferay.Language.get("select-image"),readOnly:!0,sizing:"sm",value:i})),c.default.createElement(l.ClayInput.GroupItem,{shrink:!0},c.default.createElement(n.default,{displayType:"secondary",monospaced:!0,onClick:()=>{var e;return null===(e=d.current)||void 0===e?void 0:e.click()},small:!0,title:(0,u.sub)(i?Liferay.Language.get("change-x"):Liferay.Language.get("select-x"),Liferay.Language.get("image"))},c.default.createElement(r.default,{className:"mt-0",symbol:i?"change":"plus"}))))):null)};var n=f(a("@frontend-taglib-clay$clayui/button")),l=o(a("@frontend-taglib-clay$clayui/form")),r=f(a("@frontend-taglib-clay$clayui/icon")),u=a("frontend-js-web"),c=o(a("liferay!frontend-js-react-web$react"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var r=n?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(a,l,r):a[l]=e[l]}return a.default=e,t&&t.set(e,a),a}function f(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=ImageInput.es.js.map