(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4255e39e"],{"067f":function(t,e,i){},4604:function(t,e,i){},"620c":function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("Row",[i("i-col",{attrs:{span:"12"}},[i("Card",[i("div",{staticClass:"cropper-example cropper-first"},[i("cropper",{attrs:{src:t.exampleImageSrc,"crop-button-text":"确认提交"},on:{"on-crop":t.handleCroped}})],1)])],1)],1)],1)},n=[],o=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"cropper-wrapper"},[i("div",{staticClass:"img-box"},[i("img",{staticClass:"cropper-image",attrs:{id:t.imgId,alt:""}})]),i("div",{staticClass:"right-con"},[t.preview?i("div",{staticClass:"preview-box",attrs:{id:t.previewId}}):t._e(),i("div",{staticClass:"button-box"},[t._t("default",[i("Upload",{attrs:{action:"image/upload","before-upload":t.beforeUpload}},[i("Button",{staticStyle:{width:"150px"},attrs:{type:"primary"}},[t._v("上传图片")])],1)]),i("div",{directives:[{name:"show",rawName:"v-show",value:t.insideSrc,expression:"insideSrc"}]},[i("Button",{attrs:{type:"primary"},on:{click:t.rotate}},[i("Icon",{attrs:{type:"md-refresh",size:18}})],1),i("Button",{attrs:{type:"primary"},on:{click:t.shrink}},[i("Icon",{attrs:{type:"md-remove",size:18}})],1),i("Button",{attrs:{type:"primary"},on:{click:t.magnify}},[i("Icon",{attrs:{type:"md-add",size:18}})],1),i("Button",{attrs:{type:"primary"},on:{click:function(e){return t.scale("X")}}},[i("Icon",{attrs:{custom:"iconfont icon-shuipingfanzhuan",size:18}})],1),i("Button",{attrs:{type:"primary"},on:{click:function(e){return t.scale("Y")}}},[i("Icon",{attrs:{custom:"iconfont icon-chuizhifanzhuan",size:18}})],1),i("Button",{attrs:{type:"primary"},on:{click:function(e){return t.move(0,-t.moveStep)}}},[i("Icon",{attrs:{type:"md-arrow-round-up",size:18}})],1),i("Button",{attrs:{type:"primary"},on:{click:function(e){return t.move(-t.moveStep,0)}}},[i("Icon",{attrs:{type:"md-arrow-round-back",size:18}})],1),i("Button",{attrs:{type:"primary"},on:{click:function(e){return t.move(0,t.moveStep)}}},[i("Icon",{attrs:{type:"md-arrow-round-down",size:18}})],1),i("Button",{attrs:{type:"primary"},on:{click:function(e){return t.move(t.moveStep,0)}}},[i("Icon",{attrs:{type:"md-arrow-round-forward",size:18}})],1),i("Button",{staticStyle:{width:"150px","margin-top":"10px"},attrs:{type:"primary"},on:{click:t.crop}},[t._v(t._s(t.cropButtonText))])],1)],2)])])},r=[],s=(i("a481"),i("c5f6"),i("bab4")),h=i.n(s),c=(i("a0f2"),i("4604"),{name:"Cropper",props:{src:{type:String,default:""},preview:{type:Boolean,default:!0},moveStep:{type:Number,default:4},cropButtonText:{type:String,default:"裁剪"}},data:function(){return{cropper:null,insideSrc:""}},computed:{imgId:function(){return"cropper".concat(this._uid)},previewId:function(){return"cropper_preview".concat(this._uid)}},watch:{src:function(t){this.replace(t)},insideSrc:function(t){this.replace(t)}},methods:{beforeUpload:function(t){var e=this,i=new FileReader;return i.readAsDataURL(t),i.onload=function(t){e.insideSrc=t.srcElement.result},!1},replace:function(t){this.cropper.replace(t),this.insideSrc=t},rotate:function(){this.cropper.rotate(90)},shrink:function(){this.cropper.zoom(-.1)},magnify:function(){this.cropper.zoom(.1)},scale:function(t){this.cropper["scale".concat(t)](-this.cropper.getData()["scale".concat(t)])},move:function(){var t;(t=this.cropper).move.apply(t,arguments)},crop:function(){var t=this;this.cropper.getCroppedCanvas().toBlob((function(e){t.$emit("on-crop",e)}))}},mounted:function(){var t=this;this.$nextTick((function(){var e=document.getElementById(t.imgId);t.cropper=new h.a(e,{preview:"#".concat(t.previewId),checkCrossOrigin:!0})}))}}),p=c,l=i("2877"),d=Object(l["a"])(p,o,r,!1,null,null,null),u=d.exports,m=u,g=i("7e1e"),f={name:"cropper_page",components:{Cropper:m},data:function(){return{exampleImageSrc:""}},methods:{handleCroped:function(t){var e=this,i=new FormData;i.append("croppedImg",t),Object(g["g"])(i).then((function(){e.$Message.success("Upload success~")}))}}},v=f,w=(i("d846"),Object(l["a"])(v,a,n,!1,null,null,null));e["default"]=w.exports},a0f2:function(t,e,i){},bab4:function(t,e,i){
/*!
 * Cropper.js v1.5.6
 * https://fengyuanchen.github.io/cropperjs
 *
 * Copyright 2015-present Chen Fengyuan
 * Released under the MIT license
 *
 * Date: 2019-10-04T04:33:48.372Z
 */
(function(e,i){t.exports=i()})(0,(function(){"use strict";function t(e){return t="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function a(t,e,a){return e&&i(t.prototype,e),a&&i(t,a),t}function n(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function o(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,a)}return i}function r(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?o(i,!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):o(i).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function s(t){return h(t)||c(t)||p()}function h(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}function c(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function p(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var l="undefined"!==typeof window&&"undefined"!==typeof window.document,d=l?window:{},u=!!l&&"ontouchstart"in d.document.documentElement,m=!!l&&"PointerEvent"in d,g="cropper",f="all",v="crop",w="move",b="zoom",y="e",x="w",C="s",M="n",D="ne",k="nw",B="se",O="sw",T="".concat(g,"-crop"),E="".concat(g,"-disabled"),z="".concat(g,"-hidden"),N="".concat(g,"-hide"),W="".concat(g,"-invisible"),H="".concat(g,"-modal"),S="".concat(g,"-move"),L="".concat(g,"Action"),R="".concat(g,"Preview"),Y="crop",X="move",I="none",A="crop",j="cropend",P="cropmove",U="cropstart",_="dblclick",q=u?"touchstart":"mousedown",$=u?"touchmove":"mousemove",Q=u?"touchend touchcancel":"mouseup",K=m?"pointerdown":q,Z=m?"pointermove":$,F=m?"pointerup pointercancel":Q,J="ready",G="resize",V="wheel",tt="zoom",et="image/jpeg",it=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,at=/^data:/,nt=/^data:image\/jpeg;base64,/,ot=/^img|canvas$/i,rt=200,st=100,ht={viewMode:0,dragMode:Y,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},ct='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',pt=Number.isNaN||d.isNaN;function lt(t){return"number"===typeof t&&!pt(t)}var dt=function(t){return t>0&&t<1/0};function ut(t){return"undefined"===typeof t}function mt(e){return"object"===t(e)&&null!==e}var gt=Object.prototype.hasOwnProperty;function ft(t){if(!mt(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&gt.call(i,"isPrototypeOf")}catch(a){return!1}}function vt(t){return"function"===typeof t}var wt=Array.prototype.slice;function bt(t){return Array.from?Array.from(t):wt.call(t)}function yt(t,e){return t&&vt(e)&&(Array.isArray(t)||lt(t.length)?bt(t).forEach((function(i,a){e.call(t,i,a,t)})):mt(t)&&Object.keys(t).forEach((function(i){e.call(t,t[i],i,t)}))),t}var xt=Object.assign||function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),a=1;a<e;a++)i[a-1]=arguments[a];return mt(t)&&i.length>0&&i.forEach((function(e){mt(e)&&Object.keys(e).forEach((function(i){t[i]=e[i]}))})),t},Ct=/\.\d*(?:0|9){12}\d*$/;function Mt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return Ct.test(t)?Math.round(t*e)/e:t}var Dt=/^width|height|left|top|marginLeft|marginTop$/;function kt(t,e){var i=t.style;yt(e,(function(t,e){Dt.test(e)&&lt(t)&&(t="".concat(t,"px")),i[e]=t}))}function Bt(t,e){return t.classList?t.classList.contains(e):t.className.indexOf(e)>-1}function Ot(t,e){if(e)if(lt(t.length))yt(t,(function(t){Ot(t,e)}));else if(t.classList)t.classList.add(e);else{var i=t.className.trim();i?i.indexOf(e)<0&&(t.className="".concat(i," ").concat(e)):t.className=e}}function Tt(t,e){e&&(lt(t.length)?yt(t,(function(t){Tt(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function Et(t,e,i){e&&(lt(t.length)?yt(t,(function(t){Et(t,e,i)})):i?Ot(t,e):Tt(t,e))}var zt=/([a-z\d])([A-Z])/g;function Nt(t){return t.replace(zt,"$1-$2").toLowerCase()}function Wt(t,e){return mt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(Nt(e)))}function Ht(t,e,i){mt(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(Nt(e)),i)}function St(t,e){if(mt(t[e]))try{delete t[e]}catch(i){t[e]=void 0}else if(t.dataset)try{delete t.dataset[e]}catch(i){t.dataset[e]=void 0}else t.removeAttribute("data-".concat(Nt(e)))}var Lt=/\s\s*/,Rt=function(){var t=!1;if(l){var e=!1,i=function(){},a=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});d.addEventListener("test",i,a),d.removeEventListener("test",i,a)}return t}();function Yt(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;e.trim().split(Lt).forEach((function(e){if(!Rt){var o=t.listeners;o&&o[e]&&o[e][i]&&(n=o[e][i],delete o[e][i],0===Object.keys(o[e]).length&&delete o[e],0===Object.keys(o).length&&delete t.listeners)}t.removeEventListener(e,n,a)}))}function Xt(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;e.trim().split(Lt).forEach((function(e){if(a.once&&!Rt){var o=t.listeners,r=void 0===o?{}:o;n=function(){delete r[e][i],t.removeEventListener(e,n,a);for(var o=arguments.length,s=new Array(o),h=0;h<o;h++)s[h]=arguments[h];i.apply(t,s)},r[e]||(r[e]={}),r[e][i]&&t.removeEventListener(e,r[e][i],a),r[e][i]=n,t.listeners=r}t.addEventListener(e,n,a)}))}function It(t,e,i){var a;return vt(Event)&&vt(CustomEvent)?a=new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent"),a.initCustomEvent(e,!0,!0,i)),t.dispatchEvent(a)}function At(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var jt=d.location,Pt=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Ut(t){var e=t.match(Pt);return null!==e&&(e[1]!==jt.protocol||e[2]!==jt.hostname||e[3]!==jt.port)}function _t(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function qt(t){var e=t.rotate,i=t.scaleX,a=t.scaleY,n=t.translateX,o=t.translateY,r=[];lt(n)&&0!==n&&r.push("translateX(".concat(n,"px)")),lt(o)&&0!==o&&r.push("translateY(".concat(o,"px)")),lt(e)&&0!==e&&r.push("rotate(".concat(e,"deg)")),lt(i)&&1!==i&&r.push("scaleX(".concat(i,")")),lt(a)&&1!==a&&r.push("scaleY(".concat(a,")"));var s=r.length?r.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function $t(t){var e=r({},t),i=[];return yt(t,(function(t,a){delete e[a],yt(e,(function(e){var a=Math.abs(t.startX-e.startX),n=Math.abs(t.startY-e.startY),o=Math.abs(t.endX-e.endX),r=Math.abs(t.endY-e.endY),s=Math.sqrt(a*a+n*n),h=Math.sqrt(o*o+r*r),c=(h-s)/s;i.push(c)}))})),i.sort((function(t,e){return Math.abs(t)<Math.abs(e)})),i[0]}function Qt(t,e){var i=t.pageX,a=t.pageY,n={endX:i,endY:a};return e?n:r({startX:i,startY:a},n)}function Kt(t){var e=0,i=0,a=0;return yt(t,(function(t){var n=t.startX,o=t.startY;e+=n,i+=o,a+=1})),e/=a,i/=a,{pageX:e,pageY:i}}function Zt(t){var e=t.aspectRatio,i=t.height,a=t.width,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",o=dt(a),r=dt(i);if(o&&r){var s=i*e;"contain"===n&&s>a||"cover"===n&&s<a?i=a/e:a=i*e}else o?i=a/e:r&&(a=i*e);return{width:a,height:i}}function Ft(t){var e=t.width,i=t.height,a=t.degree;if(a=Math.abs(a)%180,90===a)return{width:i,height:e};var n=a%90*Math.PI/180,o=Math.sin(n),r=Math.cos(n),s=e*r+i*o,h=e*o+i*r;return a>90?{width:h,height:s}:{width:s,height:h}}function Jt(t,e,i,a){var n=e.aspectRatio,o=e.naturalWidth,r=e.naturalHeight,h=e.rotate,c=void 0===h?0:h,p=e.scaleX,l=void 0===p?1:p,d=e.scaleY,u=void 0===d?1:d,m=i.aspectRatio,g=i.naturalWidth,f=i.naturalHeight,v=a.fillColor,w=void 0===v?"transparent":v,b=a.imageSmoothingEnabled,y=void 0===b||b,x=a.imageSmoothingQuality,C=void 0===x?"low":x,M=a.maxWidth,D=void 0===M?1/0:M,k=a.maxHeight,B=void 0===k?1/0:k,O=a.minWidth,T=void 0===O?0:O,E=a.minHeight,z=void 0===E?0:E,N=document.createElement("canvas"),W=N.getContext("2d"),H=Zt({aspectRatio:m,width:D,height:B}),S=Zt({aspectRatio:m,width:T,height:z},"cover"),L=Math.min(H.width,Math.max(S.width,g)),R=Math.min(H.height,Math.max(S.height,f)),Y=Zt({aspectRatio:n,width:D,height:B}),X=Zt({aspectRatio:n,width:T,height:z},"cover"),I=Math.min(Y.width,Math.max(X.width,o)),A=Math.min(Y.height,Math.max(X.height,r)),j=[-I/2,-A/2,I,A];return N.width=Mt(L),N.height=Mt(R),W.fillStyle=w,W.fillRect(0,0,L,R),W.save(),W.translate(L/2,R/2),W.rotate(c*Math.PI/180),W.scale(l,u),W.imageSmoothingEnabled=y,W.imageSmoothingQuality=C,W.drawImage.apply(W,[t].concat(s(j.map((function(t){return Math.floor(Mt(t))}))))),W.restore(),N}var Gt=String.fromCharCode;function Vt(t,e,i){var a="";i+=e;for(var n=e;n<i;n+=1)a+=Gt(t.getUint8(n));return a}var te=/^data:.*,/;function ee(t){var e=t.replace(te,""),i=atob(e),a=new ArrayBuffer(i.length),n=new Uint8Array(a);return yt(n,(function(t,e){n[e]=i.charCodeAt(e)})),a}function ie(t,e){var i=[],a=8192,n=new Uint8Array(t);while(n.length>0)i.push(Gt.apply(null,bt(n.subarray(0,a)))),n=n.subarray(a);return"data:".concat(e,";base64,").concat(btoa(i.join("")))}function ae(t){var e,i=new DataView(t);try{var a,n,o;if(255===i.getUint8(0)&&216===i.getUint8(1)){var r=i.byteLength,s=2;while(s+1<r){if(255===i.getUint8(s)&&225===i.getUint8(s+1)){n=s;break}s+=1}}if(n){var h=n+4,c=n+10;if("Exif"===Vt(i,h,4)){var p=i.getUint16(c);if(a=18761===p,(a||19789===p)&&42===i.getUint16(c+2,a)){var l=i.getUint32(c+4,a);l>=8&&(o=c+l)}}}if(o){var d,u,m=i.getUint16(o,a);for(u=0;u<m;u+=1)if(d=o+12*u+2,274===i.getUint16(d,a)){d+=8,e=i.getUint16(d,a),i.setUint16(d,1,a);break}}}catch(g){e=1}return e}function ne(t){var e=0,i=1,a=1;switch(t){case 2:i=-1;break;case 3:e=-180;break;case 4:a=-1;break;case 5:e=90,a=-1;break;case 6:e=90;break;case 7:e=90,i=-1;break;case 8:e=-90;break;default:}return{rotate:e,scaleX:i,scaleY:a}}var oe={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,e=this.options,i=this.container,a=this.cropper;Ot(a,z),Tt(t,z);var n={width:Math.max(i.offsetWidth,Number(e.minContainerWidth)||200),height:Math.max(i.offsetHeight,Number(e.minContainerHeight)||100)};this.containerData=n,kt(a,{width:n.width,height:n.height}),Ot(t,z),Tt(a,z)},initCanvas:function(){var t=this.containerData,e=this.imageData,i=this.options.viewMode,a=Math.abs(e.rotate)%180===90,n=a?e.naturalHeight:e.naturalWidth,o=a?e.naturalWidth:e.naturalHeight,r=n/o,s=t.width,h=t.height;t.height*r>t.width?3===i?s=t.height*r:h=t.width/r:3===i?h=t.width/r:s=t.height*r;var c={aspectRatio:r,naturalWidth:n,naturalHeight:o,width:s,height:h};c.left=(t.width-s)/2,c.top=(t.height-h)/2,c.oldLeft=c.left,c.oldTop=c.top,this.canvasData=c,this.limited=1===i||2===i,this.limitCanvas(!0,!0),this.initialImageData=xt({},e),this.initialCanvasData=xt({},c)},limitCanvas:function(t,e){var i=this.options,a=this.containerData,n=this.canvasData,o=this.cropBoxData,r=i.viewMode,s=n.aspectRatio,h=this.cropped&&o;if(t){var c=Number(i.minCanvasWidth)||0,p=Number(i.minCanvasHeight)||0;r>1?(c=Math.max(c,a.width),p=Math.max(p,a.height),3===r&&(p*s>c?c=p*s:p=c/s)):r>0&&(c?c=Math.max(c,h?o.width:0):p?p=Math.max(p,h?o.height:0):h&&(c=o.width,p=o.height,p*s>c?c=p*s:p=c/s));var l=Zt({aspectRatio:s,width:c,height:p});c=l.width,p=l.height,n.minWidth=c,n.minHeight=p,n.maxWidth=1/0,n.maxHeight=1/0}if(e)if(r>(h?0:1)){var d=a.width-n.width,u=a.height-n.height;n.minLeft=Math.min(0,d),n.minTop=Math.min(0,u),n.maxLeft=Math.max(0,d),n.maxTop=Math.max(0,u),h&&this.limited&&(n.minLeft=Math.min(o.left,o.left+(o.width-n.width)),n.minTop=Math.min(o.top,o.top+(o.height-n.height)),n.maxLeft=o.left,n.maxTop=o.top,2===r&&(n.width>=a.width&&(n.minLeft=Math.min(0,d),n.maxLeft=Math.max(0,d)),n.height>=a.height&&(n.minTop=Math.min(0,u),n.maxTop=Math.max(0,u))))}else n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=a.width,n.maxTop=a.height},renderCanvas:function(t,e){var i=this.canvasData,a=this.imageData;if(e){var n=Ft({width:a.naturalWidth*Math.abs(a.scaleX||1),height:a.naturalHeight*Math.abs(a.scaleY||1),degree:a.rotate||0}),o=n.width,r=n.height,s=i.width*(o/i.naturalWidth),h=i.height*(r/i.naturalHeight);i.left-=(s-i.width)/2,i.top-=(h-i.height)/2,i.width=s,i.height=h,i.aspectRatio=o/r,i.naturalWidth=o,i.naturalHeight=r,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCanvas(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,kt(this.canvas,xt({width:i.width,height:i.height},qt({translateX:i.left,translateY:i.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var e=this.canvasData,i=this.imageData,a=i.naturalWidth*(e.width/e.naturalWidth),n=i.naturalHeight*(e.height/e.naturalHeight);xt(i,{width:a,height:n,left:(e.width-a)/2,top:(e.height-n)/2}),kt(this.image,xt({width:i.width,height:i.height},qt(xt({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,a=Number(t.autoCropArea)||.8,n={width:e.width,height:e.height};i&&(e.height*i>e.width?n.height=n.width/i:n.width=n.height*i),this.cropBoxData=n,this.limitCropBox(!0,!0),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),n.width=Math.max(n.minWidth,n.width*a),n.height=Math.max(n.minHeight,n.height*a),n.left=e.left+(e.width-n.width)/2,n.top=e.top+(e.height-n.height)/2,n.oldLeft=n.left,n.oldTop=n.top,this.initialCropBoxData=xt({},n)},limitCropBox:function(t,e){var i=this.options,a=this.containerData,n=this.canvasData,o=this.cropBoxData,r=this.limited,s=i.aspectRatio;if(t){var h=Number(i.minCropBoxWidth)||0,c=Number(i.minCropBoxHeight)||0,p=r?Math.min(a.width,n.width,n.width+n.left,a.width-n.left):a.width,l=r?Math.min(a.height,n.height,n.height+n.top,a.height-n.top):a.height;h=Math.min(h,a.width),c=Math.min(c,a.height),s&&(h&&c?c*s>h?c=h/s:h=c*s:h?c=h/s:c&&(h=c*s),l*s>p?l=p/s:p=l*s),o.minWidth=Math.min(h,p),o.minHeight=Math.min(c,l),o.maxWidth=p,o.maxHeight=l}e&&(r?(o.minLeft=Math.max(0,n.left),o.minTop=Math.max(0,n.top),o.maxLeft=Math.min(a.width,n.left+n.width)-o.width,o.maxTop=Math.min(a.height,n.top+n.height)-o.height):(o.minLeft=0,o.minTop=0,o.maxLeft=a.width-o.width,o.maxTop=a.height-o.height))},renderCropBox:function(){var t=this.options,e=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,t.movable&&t.cropBoxMovable&&Ht(this.face,L,i.width>=e.width&&i.height>=e.height?w:f),kt(this.cropBox,xt({width:i.width,height:i.height},qt({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),It(this.element,A,this.getData())}},re={initPreview:function(){var t=this.element,e=this.crossOrigin,i=this.options.preview,a=e?this.crossOriginUrl:this.url,n=t.alt||"The image to preview",o=document.createElement("img");if(e&&(o.crossOrigin=e),o.src=a,o.alt=n,this.viewBox.appendChild(o),this.viewBoxImage=o,i){var r=i;"string"===typeof i?r=t.ownerDocument.querySelectorAll(i):i.querySelector&&(r=[i]),this.previews=r,yt(r,(function(t){var i=document.createElement("img");Ht(t,R,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),e&&(i.crossOrigin=e),i.src=a,i.alt=n,i.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(i)}))}},resetPreview:function(){yt(this.previews,(function(t){var e=Wt(t,R);kt(t,{width:e.width,height:e.height}),t.innerHTML=e.html,St(t,R)}))},preview:function(){var t=this.imageData,e=this.canvasData,i=this.cropBoxData,a=i.width,n=i.height,o=t.width,r=t.height,s=i.left-e.left-t.left,h=i.top-e.top-t.top;this.cropped&&!this.disabled&&(kt(this.viewBoxImage,xt({width:o,height:r},qt(xt({translateX:-s,translateY:-h},t)))),yt(this.previews,(function(e){var i=Wt(e,R),c=i.width,p=i.height,l=c,d=p,u=1;a&&(u=c/a,d=n*u),n&&d>p&&(u=p/n,l=a*u,d=p),kt(e,{width:l,height:d}),kt(e.getElementsByTagName("img")[0],xt({width:o*u,height:r*u},qt(xt({translateX:-s*u,translateY:-h*u},t))))})))}},se={bind:function(){var t=this.element,e=this.options,i=this.cropper;vt(e.cropstart)&&Xt(t,U,e.cropstart),vt(e.cropmove)&&Xt(t,P,e.cropmove),vt(e.cropend)&&Xt(t,j,e.cropend),vt(e.crop)&&Xt(t,A,e.crop),vt(e.zoom)&&Xt(t,tt,e.zoom),Xt(i,K,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&Xt(i,V,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Xt(i,_,this.onDblclick=this.dblclick.bind(this)),Xt(t.ownerDocument,Z,this.onCropMove=this.cropMove.bind(this)),Xt(t.ownerDocument,F,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&Xt(window,G,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,i=this.cropper;vt(e.cropstart)&&Yt(t,U,e.cropstart),vt(e.cropmove)&&Yt(t,P,e.cropmove),vt(e.cropend)&&Yt(t,j,e.cropend),vt(e.crop)&&Yt(t,A,e.crop),vt(e.zoom)&&Yt(t,tt,e.zoom),Yt(i,K,this.onCropStart),e.zoomable&&e.zoomOnWheel&&Yt(i,V,this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Yt(i,_,this.onDblclick),Yt(t.ownerDocument,Z,this.onCropMove),Yt(t.ownerDocument,F,this.onCropEnd),e.responsive&&Yt(window,G,this.onResize)}},he={resize:function(){var t=this.options,e=this.container,i=this.containerData,a=Number(t.minContainerWidth)||rt,n=Number(t.minContainerHeight)||st;if(!(this.disabled||i.width<=a||i.height<=n)){var o,r,s=e.offsetWidth/i.width;if(1!==s||e.offsetHeight!==i.height)t.restore&&(o=this.getCanvasData(),r=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(yt(o,(function(t,e){o[e]=t*s}))),this.setCropBoxData(yt(r,(function(t,e){r[e]=t*s}))))}},dblclick:function(){this.disabled||this.options.dragMode===I||this.setDragMode(Bt(this.dragBox,T)?X:Y)},wheel:function(t){var e=this,i=Number(this.options.wheelZoomRatio)||.1,a=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){e.wheeling=!1}),50),t.deltaY?a=t.deltaY>0?1:-1:t.wheelDelta?a=-t.wheelDelta/120:t.detail&&(a=t.detail>0?1:-1),this.zoom(-a*i,t)))},cropStart:function(t){var e=t.buttons,i=t.button;if(!(this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(lt(e)&&1!==e||lt(i)&&0!==i||t.ctrlKey))){var a,n=this.options,o=this.pointers;t.changedTouches?yt(t.changedTouches,(function(t){o[t.identifier]=Qt(t)})):o[t.pointerId||0]=Qt(t),a=Object.keys(o).length>1&&n.zoomable&&n.zoomOnTouch?b:Wt(t.target,L),it.test(a)&&!1!==It(this.element,U,{originalEvent:t,action:a})&&(t.preventDefault(),this.action=a,this.cropping=!1,a===v&&(this.cropping=!0,Ot(this.dragBox,H)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var i=this.pointers;t.preventDefault(),!1!==It(this.element,P,{originalEvent:t,action:e})&&(t.changedTouches?yt(t.changedTouches,(function(t){xt(i[t.identifier]||{},Qt(t,!0))})):xt(i[t.pointerId||0]||{},Qt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,i=this.pointers;t.changedTouches?yt(t.changedTouches,(function(t){delete i[t.identifier]})):delete i[t.pointerId||0],e&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,Et(this.dragBox,H,this.cropped&&this.options.modal)),It(this.element,j,{originalEvent:t,action:e}))}}},ce={change:function(t){var e,i=this.options,a=this.canvasData,n=this.containerData,o=this.cropBoxData,r=this.pointers,s=this.action,h=i.aspectRatio,c=o.left,p=o.top,l=o.width,d=o.height,u=c+l,m=p+d,g=0,T=0,E=n.width,N=n.height,W=!0;!h&&t.shiftKey&&(h=l&&d?l/d:1),this.limited&&(g=o.minLeft,T=o.minTop,E=g+Math.min(n.width,a.width,a.left+a.width),N=T+Math.min(n.height,a.height,a.top+a.height));var H=r[Object.keys(r)[0]],S={x:H.endX-H.startX,y:H.endY-H.startY},L=function(t){switch(t){case y:u+S.x>E&&(S.x=E-u);break;case x:c+S.x<g&&(S.x=g-c);break;case M:p+S.y<T&&(S.y=T-p);break;case C:m+S.y>N&&(S.y=N-m);break;default:}};switch(s){case f:c+=S.x,p+=S.y;break;case y:if(S.x>=0&&(u>=E||h&&(p<=T||m>=N))){W=!1;break}L(y),l+=S.x,l<0&&(s=x,l=-l,c-=l),h&&(d=l/h,p+=(o.height-d)/2);break;case M:if(S.y<=0&&(p<=T||h&&(c<=g||u>=E))){W=!1;break}L(M),d-=S.y,p+=S.y,d<0&&(s=C,d=-d,p-=d),h&&(l=d*h,c+=(o.width-l)/2);break;case x:if(S.x<=0&&(c<=g||h&&(p<=T||m>=N))){W=!1;break}L(x),l-=S.x,c+=S.x,l<0&&(s=y,l=-l,c-=l),h&&(d=l/h,p+=(o.height-d)/2);break;case C:if(S.y>=0&&(m>=N||h&&(c<=g||u>=E))){W=!1;break}L(C),d+=S.y,d<0&&(s=M,d=-d,p-=d),h&&(l=d*h,c+=(o.width-l)/2);break;case D:if(h){if(S.y<=0&&(p<=T||u>=E)){W=!1;break}L(M),d-=S.y,p+=S.y,l=d*h}else L(M),L(y),S.x>=0?u<E?l+=S.x:S.y<=0&&p<=T&&(W=!1):l+=S.x,S.y<=0?p>T&&(d-=S.y,p+=S.y):(d-=S.y,p+=S.y);l<0&&d<0?(s=O,d=-d,l=-l,p-=d,c-=l):l<0?(s=k,l=-l,c-=l):d<0&&(s=B,d=-d,p-=d);break;case k:if(h){if(S.y<=0&&(p<=T||c<=g)){W=!1;break}L(M),d-=S.y,p+=S.y,l=d*h,c+=o.width-l}else L(M),L(x),S.x<=0?c>g?(l-=S.x,c+=S.x):S.y<=0&&p<=T&&(W=!1):(l-=S.x,c+=S.x),S.y<=0?p>T&&(d-=S.y,p+=S.y):(d-=S.y,p+=S.y);l<0&&d<0?(s=B,d=-d,l=-l,p-=d,c-=l):l<0?(s=D,l=-l,c-=l):d<0&&(s=O,d=-d,p-=d);break;case O:if(h){if(S.x<=0&&(c<=g||m>=N)){W=!1;break}L(x),l-=S.x,c+=S.x,d=l/h}else L(C),L(x),S.x<=0?c>g?(l-=S.x,c+=S.x):S.y>=0&&m>=N&&(W=!1):(l-=S.x,c+=S.x),S.y>=0?m<N&&(d+=S.y):d+=S.y;l<0&&d<0?(s=D,d=-d,l=-l,p-=d,c-=l):l<0?(s=B,l=-l,c-=l):d<0&&(s=k,d=-d,p-=d);break;case B:if(h){if(S.x>=0&&(u>=E||m>=N)){W=!1;break}L(y),l+=S.x,d=l/h}else L(C),L(y),S.x>=0?u<E?l+=S.x:S.y>=0&&m>=N&&(W=!1):l+=S.x,S.y>=0?m<N&&(d+=S.y):d+=S.y;l<0&&d<0?(s=k,d=-d,l=-l,p-=d,c-=l):l<0?(s=O,l=-l,c-=l):d<0&&(s=D,d=-d,p-=d);break;case w:this.move(S.x,S.y),W=!1;break;case b:this.zoom($t(r),t),W=!1;break;case v:if(!S.x||!S.y){W=!1;break}e=At(this.cropper),c=H.startX-e.left,p=H.startY-e.top,l=o.minWidth,d=o.minHeight,S.x>0?s=S.y>0?B:D:S.x<0&&(c-=l,s=S.y>0?O:k),S.y<0&&(p-=d),this.cropped||(Tt(this.cropBox,z),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break;default:}W&&(o.width=l,o.height=d,o.left=c,o.top=p,this.action=s,this.renderCropBox()),yt(r,(function(t){t.startX=t.endX,t.startY=t.endY}))}},pe={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Ot(this.dragBox,H),Tt(this.cropBox,z),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=xt({},this.initialImageData),this.canvasData=xt({},this.initialCanvasData),this.cropBoxData=xt({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(xt(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Tt(this.dragBox,H),Ot(this.cropBox,z)),this},replace:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&t&&(this.isImg&&(this.element.src=t),e?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,yt(this.previews,(function(e){e.getElementsByTagName("img")[0].src=t})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Tt(this.cropper,E)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Ot(this.cropper,E)),this},destroy:function(){var t=this.element;return t[g]?(t[g]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,a=i.left,n=i.top;return this.moveTo(ut(t)?t:a+Number(t),ut(e)?e:n+Number(e))},moveTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(lt(t)&&(i.left=t,a=!0),lt(e)&&(i.top=e,a=!0),a&&this.renderCanvas(!0)),this},zoom:function(t,e){var i=this.canvasData;return t=Number(t),t=t<0?1/(1-t):1+t,this.zoomTo(i.width*t/i.naturalWidth,null,e)},zoomTo:function(t,e,i){var a=this.options,n=this.canvasData,o=n.width,r=n.height,s=n.naturalWidth,h=n.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&a.zoomable){var c=s*t,p=h*t;if(!1===It(this.element,tt,{ratio:t,oldRatio:o/s,originalEvent:i}))return this;if(i){var l=this.pointers,d=At(this.cropper),u=l&&Object.keys(l).length?Kt(l):{pageX:i.pageX,pageY:i.pageY};n.left-=(c-o)*((u.pageX-d.left-n.left)/o),n.top-=(p-r)*((u.pageY-d.top-n.top)/r)}else ft(e)&&lt(e.x)&&lt(e.y)?(n.left-=(c-o)*((e.x-n.left)/o),n.top-=(p-r)*((e.y-n.top)/r)):(n.left-=(c-o)/2,n.top-=(p-r)/2);n.width=c,n.height=p,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),lt(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,lt(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(lt(e)?e:1,t)},scale:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData,a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(lt(t)&&(i.scaleX=t,a=!0),lt(e)&&(i.scaleY=e,a=!0),a&&this.renderCanvas(!0,!0)),this},getData:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.options,a=this.imageData,n=this.canvasData,o=this.cropBoxData;if(this.ready&&this.cropped){t={x:o.left-n.left,y:o.top-n.top,width:o.width,height:o.height};var r=a.width/a.naturalWidth;if(yt(t,(function(e,i){t[i]=e/r})),e){var s=Math.round(t.y+t.height),h=Math.round(t.x+t.width);t.x=Math.round(t.x),t.y=Math.round(t.y),t.width=h-t.x,t.height=s-t.y}}else t={x:0,y:0,width:0,height:0};return i.rotatable&&(t.rotate=a.rotate||0),i.scalable&&(t.scaleX=a.scaleX||1,t.scaleY=a.scaleY||1),t},setData:function(t){var e=this.options,i=this.imageData,a=this.canvasData,n={};if(this.ready&&!this.disabled&&ft(t)){var o=!1;e.rotatable&&lt(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,o=!0),e.scalable&&(lt(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,o=!0),lt(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var r=i.width/i.naturalWidth;lt(t.x)&&(n.left=t.x*r+a.left),lt(t.y)&&(n.top=t.y*r+a.top),lt(t.width)&&(n.width=t.width*r),lt(t.height)&&(n.height=t.height*r),this.setCropBoxData(n)}return this},getContainerData:function(){return this.ready?xt({},this.containerData):{}},getImageData:function(){return this.sized?xt({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&yt(["left","top","width","height","naturalWidth","naturalHeight"],(function(i){e[i]=t[i]})),e},setCanvasData:function(t){var e=this.canvasData,i=e.aspectRatio;return this.ready&&!this.disabled&&ft(t)&&(lt(t.left)&&(e.left=t.left),lt(t.top)&&(e.top=t.top),lt(t.width)?(e.width=t.width,e.height=t.width/i):lt(t.height)&&(e.height=t.height,e.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var t,e=this.cropBoxData;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(t){var e,i,a=this.cropBoxData,n=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&ft(t)&&(lt(t.left)&&(a.left=t.left),lt(t.top)&&(a.top=t.top),lt(t.width)&&t.width!==a.width&&(e=!0,a.width=t.width),lt(t.height)&&t.height!==a.height&&(i=!0,a.height=t.height),n&&(e?a.height=a.width/n:i&&(a.width=a.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var e=this.canvasData,i=Jt(this.image,this.imageData,e,t);if(!this.cropped)return i;var a=this.getData(),n=a.x,o=a.y,r=a.width,h=a.height,c=i.width/Math.floor(e.naturalWidth);1!==c&&(n*=c,o*=c,r*=c,h*=c);var p=r/h,l=Zt({aspectRatio:p,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),d=Zt({aspectRatio:p,width:t.minWidth||0,height:t.minHeight||0},"cover"),u=Zt({aspectRatio:p,width:t.width||(1!==c?i.width:r),height:t.height||(1!==c?i.height:h)}),m=u.width,g=u.height;m=Math.min(l.width,Math.max(d.width,m)),g=Math.min(l.height,Math.max(d.height,g));var f=document.createElement("canvas"),v=f.getContext("2d");f.width=Mt(m),f.height=Mt(g),v.fillStyle=t.fillColor||"transparent",v.fillRect(0,0,m,g);var w=t.imageSmoothingEnabled,b=void 0===w||w,y=t.imageSmoothingQuality;v.imageSmoothingEnabled=b,y&&(v.imageSmoothingQuality=y);var x,C,M,D,k,B,O=i.width,T=i.height,E=n,z=o;E<=-r||E>O?(E=0,x=0,M=0,k=0):E<=0?(M=-E,E=0,x=Math.min(O,r+E),k=x):E<=O&&(M=0,x=Math.min(r,O-E),k=x),x<=0||z<=-h||z>T?(z=0,C=0,D=0,B=0):z<=0?(D=-z,z=0,C=Math.min(T,h+z),B=C):z<=T&&(D=0,C=Math.min(h,T-z),B=C);var N=[E,z,x,C];if(k>0&&B>0){var W=m/r;N.push(M*W,D*W,k*W,B*W)}return v.drawImage.apply(v,[i].concat(s(N.map((function(t){return Math.floor(Mt(t))}))))),f},setAspectRatio:function(t){var e=this.options;return this.disabled||ut(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e=this.options,i=this.dragBox,a=this.face;if(this.ready&&!this.disabled){var n=t===Y,o=e.movable&&t===X;t=n||o?t:I,e.dragMode=t,Ht(i,L,t),Et(i,T,n),Et(i,S,o),e.cropBoxMovable||(Ht(a,L,t),Et(a,T,n),Et(a,S,o))}return this}},le=d.Cropper,de=function(){function t(i){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e(this,t),!i||!ot.test(i.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=i,this.options=xt({},ht,ft(a)&&a),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return a(t,[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e[g]){if(e[g]=this,"img"===i){if(this.isImg=!0,t=e.getAttribute("src")||"",this.originalUrl=t,!t)return;t=e.src}else"canvas"===i&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e=this;if(t){this.url=t,this.imageData={};var i=this.element,a=this.options;if(a.rotatable||a.scalable||(a.checkOrientation=!1),a.checkOrientation&&window.ArrayBuffer)if(at.test(t))nt.test(t)?this.read(ee(t)):this.clone();else{var n=new XMLHttpRequest,o=this.clone.bind(this);this.reloading=!0,this.xhr=n,n.onabort=o,n.onerror=o,n.ontimeout=o,n.onprogress=function(){n.getResponseHeader("content-type")!==et&&n.abort()},n.onload=function(){e.read(n.response)},n.onloadend=function(){e.reloading=!1,e.xhr=null},a.checkCrossOrigin&&Ut(t)&&i.crossOrigin&&(t=_t(t)),n.open("GET",t),n.responseType="arraybuffer",n.withCredentials="use-credentials"===i.crossOrigin,n.send()}else this.clone()}}},{key:"read",value:function(t){var e=this.options,i=this.imageData,a=ae(t),n=0,o=1,r=1;if(a>1){this.url=ie(t,et);var s=ne(a);n=s.rotate,o=s.scaleX,r=s.scaleY}e.rotatable&&(i.rotate=n),e.scalable&&(i.scaleX=o,i.scaleY=r),this.clone()}},{key:"clone",value:function(){var t=this.element,e=this.url,i=t.crossOrigin,a=e;this.options.checkCrossOrigin&&Ut(e)&&(i||(i="anonymous"),a=_t(e)),this.crossOrigin=i,this.crossOriginUrl=a;var n=document.createElement("img");i&&(n.crossOrigin=i),n.src=a||e,n.alt=t.alt||"The image to crop",this.image=n,n.onload=this.start.bind(this),n.onerror=this.stop.bind(this),Ot(n,N),t.parentNode.insertBefore(n,t.nextSibling)}},{key:"start",value:function(){var t=this,e=this.image;e.onload=null,e.onerror=null,this.sizing=!0;var i=d.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(d.navigator.userAgent),a=function(e,i){xt(t.imageData,{naturalWidth:e,naturalHeight:i,aspectRatio:e/i}),t.sizing=!1,t.sized=!0,t.build()};if(!e.naturalWidth||i){var n=document.createElement("img"),o=document.body||document.documentElement;this.sizingImage=n,n.onload=function(){a(n.width,n.height),i||o.removeChild(n)},n.src=e.src,i||(n.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",o.appendChild(n))}else a(e.naturalWidth,e.naturalHeight)}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var t=this.element,e=this.options,i=this.image,a=t.parentNode,n=document.createElement("div");n.innerHTML=ct;var o=n.querySelector(".".concat(g,"-container")),r=o.querySelector(".".concat(g,"-canvas")),s=o.querySelector(".".concat(g,"-drag-box")),h=o.querySelector(".".concat(g,"-crop-box")),c=h.querySelector(".".concat(g,"-face"));this.container=a,this.cropper=o,this.canvas=r,this.dragBox=s,this.cropBox=h,this.viewBox=o.querySelector(".".concat(g,"-view-box")),this.face=c,r.appendChild(i),Ot(t,z),a.insertBefore(o,t.nextSibling),this.isImg||Tt(i,N),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,Ot(h,z),e.guides||Ot(h.getElementsByClassName("".concat(g,"-dashed")),z),e.center||Ot(h.getElementsByClassName("".concat(g,"-center")),z),e.background&&Ot(o,"".concat(g,"-bg")),e.highlight||Ot(c,W),e.cropBoxMovable&&(Ot(c,S),Ht(c,L,f)),e.cropBoxResizable||(Ot(h.getElementsByClassName("".concat(g,"-line")),z),Ot(h.getElementsByClassName("".concat(g,"-point")),z)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),vt(e.ready)&&Xt(t,J,e.ready,{once:!0}),It(t,J)}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),Tt(this.element,z))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=le,t}},{key:"setDefaults",value:function(t){xt(ht,ft(t)&&t)}}]),t}();return xt(de.prototype,oe,re,se,he,ce,pe),de}))},d846:function(t,e,i){"use strict";var a=i("067f"),n=i.n(a);n.a}}]);