"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/csstransition"),n=require("primereact/utils"),i=require("primereact/portal"),o=require("primereact/api");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(e),l=a(o);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n=1.5;return r.default.createElement("div",{ref:function(t){return e.mask=t},className:"p-image-mask p-component-overlay p-component-overlay-enter",onClick:this.onMaskClick},r.default.createElement("div",{className:"p-image-toolbar"},this.props.downloadable&&r.default.createElement("button",{className:"p-image-action p-link",onClick:this.onDownload,type:"button"},r.default.createElement("i",{className:"pi pi-download"})),r.default.createElement("button",{className:"p-image-action p-link",onClick:this.rotateRight,type:"button"},r.default.createElement("i",{className:"pi pi-refresh"})),r.default.createElement("button",{className:"p-image-action p-link",onClick:this.rotateLeft,type:"button"},r.default.createElement("i",{className:"pi pi-undo"})),r.default.createElement("button",{className:"p-image-action p-link",onClick:this.zoomOut,type:"button",disabled:i},r.default.createElement("i",{className:"pi pi-search-minus"})),r.default.createElement("button",{className:"p-image-action p-link",onClick:this.zoomIn,type:"button",disabled:i},r.default.createElement("i",{className:"pi pi-search-plus"})),r.default.createElement("button",{className:"p-image-action p-link",type:"button",onClick:this.hidePreview},r.default.createElement("i",{className:"pi pi-times"}))),r.default.createElement(t.CSSTransition,{nodeRef:this.previewRef,classNames:"p-image-preview",in:this.state.previewVisible,timeout:{enter:150,exit:150},unmountOnExit:!0,onEntering:this.onEntering,onEntered:this.onEntered,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited},r.default.createElement("div",{ref:this.previewRef},r.default.createElement("img",{src:this.props.src,className:"p-image-preview",style:n,onClick:this.onPreviewImageClick,alt:this.props.alt}))))}},{key:"render",value:function(){var e=this,t=n.classNames("p-image p-component",this.props.className,{"p-image-preview-container":this.props.preview}),o=this.renderElement(),a=this.props.template?n.ObjectUtils.getJSXElement(this.props.template,this.props):r.default.createElement("i",{className:"p-image-preview-icon pi pi-eye"}),l=this.props;return r.default.createElement("span",{ref:function(t){return e.container=t},className:t,style:this.props.style},r.default.createElement("img",{src:l.src,className:this.props.imageClassName,width:l.width,height:l.height,style:this.props.imageStyle,alt:l.alt}),this.props.preview&&r.default.createElement("div",{className:"p-image-preview-indicator",onClick:this.onImageClick},a),this.state.maskVisible&&r.default.createElement(i.Portal,{element:o,appendTo:document.body}))}}])&&c(f.prototype,v),b&&c(f,b),Object.defineProperty(f,"prototype",{writable:!1}),E}();k={preview:!1,className:null,downloadable:!1,style:null,imageStyle:null,imageClassName:null,template:null,src:null,alt:null,width:null,height:null},(b="defaultProps")in(v=E)?Object.defineProperty(v,b,{value:k,enumerable:!0,configurable:!0,writable:!0}):v[b]=k,exports.Image=E;