// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
require({cache:{"url:jimu/dijit/templates/_CropImage.html":'\x3cdiv class\x3d"jimu-crop-image"\x3e\r\n\t\x3cimg class\x3d"loading-image" data-dojo-attach-point\x3d"loadingImg" src\x3d""\x3e\r\n\r\n\t\x3cimg class\x3d"base-image hide-status" data-dojo-attach-point\x3d"baseImage" width\x3d"100%" height\x3d"100%" style\x3d"display:none;width:100%;height:100%"\x3e\r\n\x3c/div\x3e\r\n'}});
define("dojo/_base/declare dojo/_base/html dojo/_base/lang dojo/on dijit/_WidgetBase dijit/_TemplatedMixin dojo/text!./templates/_CropImage.html jimu/dijit/Message libs/cropperjs/cropperjs xstyle/css!libs/cropperjs/cropper.css dojo/NodeList-dom".split(" "),function(d,a,c,e,f,g,h,k,l){return d([f,g],{templateString:h,imageSrc:null,type:null,goldenWidth:4,goldenHeight:3,_haveShowReadErrMsg:!1,postCreate:function(){this.type||(this.type="image/jpeg");this.setImageSrc(this.imageSrc);this.loadingImg.src=
require.toUrl("jimu")+"/images/loading.gif";this._checkImgError();this.own(e(this.baseImage,"load",c.hitch(this,function(){a.setStyle(this.loadingImg,"display","none");this._initCropper()})))},_initCropper:function(){this.cropper&&this.cropper.destroy&&this.cropper.destroy();this.cropper=new l(this.baseImage,{aspectRatio:this.goldenWidth/this.goldenHeight,preview:".img-preview"})},setImageSrc:function(b){a.setAttr(this.baseImage,"src",b)},getData:function(){try{var b=this.cropper.getCroppedCanvas();
this.cropper.getCroppedCanvas();return b.toDataURL(this.type||"image/jpeg")}catch(m){return this._readError(),null}},destroy:function(){this.cropper&&this.cropper.destroy&&this.cropper.destroy();this.inherited(arguments)},_checkImgError:function(){setTimeout(c.hitch(this,function(){"none"!==a.getStyle(this.loadingImg,"display")&&this._readError()}),5E3)},_readError:function(){this._haveShowReadErrMsg||(new k({message:this.nls.readError}),this._haveShowReadErrMsg=!0)}})});