chunk-0e5127e1.0d29cb61.js 47 KB

1234567891011
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0e5127e1"],{"27f0":function(t,e,i){"use strict";i("eebf")},bab4:function(t,e,i){
  2. /*!
  3. * Cropper.js v1.6.2
  4. * https://fengyuanchen.github.io/cropperjs
  5. *
  6. * Copyright 2015-present Chen Fengyuan
  7. * Released under the MIT license
  8. *
  9. * Date: 2024-04-21T07:43:05.335Z
  10. */
  11. (function(e,i){t.exports=i()})(0,(function(){"use strict";function t(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 e(e){for(var i=1;i<arguments.length;i++){var a=null!=arguments[i]?arguments[i]:{};i%2?t(Object(a),!0).forEach((function(t){h(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function i(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var a=i.call(t,e||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function a(t){var e=i(t,"string");return"symbol"==typeof e?e:e+""}function n(t){return n="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},n(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function s(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function h(t,e,i){return e=a(e),e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function c(t){return l(t)||p(t)||d(t)||m()}function l(t){if(Array.isArray(t))return u(t)}function p(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function d(t,e){if(t){if("string"===typeof t)return u(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i<e;i++)a[i]=t[i];return a}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g="undefined"!==typeof window&&"undefined"!==typeof window.document,f=g?window:{},v=!(!g||!f.document.documentElement)&&"ontouchstart"in f.document.documentElement,b=!!g&&"PointerEvent"in f,w="cropper",y="all",x="crop",C="move",D="zoom",M="e",B="w",k="s",O="n",T="ne",N="nw",z="se",S="sw",W="".concat(w,"-crop"),E="".concat(w,"-disabled"),H="".concat(w,"-hidden"),L="".concat(w,"-hide"),R="".concat(w,"-invisible"),Y="".concat(w,"-modal"),X="".concat(w,"-move"),A="".concat(w,"Action"),j="".concat(w,"Preview"),$="crop",_="move",I="none",P="crop",U="cropend",q="cropmove",F="cropstart",V="dblclick",J=v?"touchstart":"mousedown",Z=v?"touchmove":"mousemove",Q=v?"touchend touchcancel":"mouseup",K=b?"pointerdown":J,G=b?"pointermove":Z,tt=b?"pointerup pointercancel":Q,et="ready",it="resize",at="wheel",nt="zoom",rt="image/jpeg",ot=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,st=/^data:/,ht=/^data:image\/jpeg;base64,/,ct=/^img|canvas$/i,lt=200,pt=100,dt={viewMode:0,dragMode:$,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:lt,minContainerHeight:pt,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},ut='<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>',mt=Number.isNaN||f.isNaN;function gt(t){return"number"===typeof t&&!mt(t)}var ft=function(t){return t>0&&t<1/0};function vt(t){return"undefined"===typeof t}function bt(t){return"object"===n(t)&&null!==t}var wt=Object.prototype.hasOwnProperty;function yt(t){if(!bt(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&wt.call(i,"isPrototypeOf")}catch(a){return!1}}function xt(t){return"function"===typeof t}var Ct=Array.prototype.slice;function Dt(t){return Array.from?Array.from(t):Ct.call(t)}function Mt(t,e){return t&&xt(e)&&(Array.isArray(t)||gt(t.length)?Dt(t).forEach((function(i,a){e.call(t,i,a,t)})):bt(t)&&Object.keys(t).forEach((function(i){e.call(t,t[i],i,t)}))),t}var Bt=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 bt(t)&&i.length>0&&i.forEach((function(e){bt(e)&&Object.keys(e).forEach((function(i){t[i]=e[i]}))})),t},kt=/\.\d*(?:0|9){12}\d*$/;function Ot(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return kt.test(t)?Math.round(t*e)/e:t}var Tt=/^width|height|left|top|marginLeft|marginTop$/;function Nt(t,e){var i=t.style;Mt(e,(function(t,e){Tt.test(e)&&gt(t)&&(t="".concat(t,"px")),i[e]=t}))}function zt(t,e){return t.classList?t.classList.contains(e):t.className.indexOf(e)>-1}function St(t,e){if(e)if(gt(t.length))Mt(t,(function(t){St(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 Wt(t,e){e&&(gt(t.length)?Mt(t,(function(t){Wt(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&&(gt(t.length)?Mt(t,(function(t){Et(t,e,i)})):i?St(t,e):Wt(t,e))}var Ht=/([a-z\d])([A-Z])/g;function Lt(t){return t.replace(Ht,"$1-$2").toLowerCase()}function Rt(t,e){return bt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(Lt(e)))}function Yt(t,e,i){bt(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(Lt(e)),i)}function Xt(t,e){if(bt(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(Lt(e)))}var At=/\s\s*/,jt=function(){var t=!1;if(g){var e=!1,i=function(){},a=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});f.addEventListener("test",i,a),f.removeEventListener("test",i,a)}return t}();function $t(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;e.trim().split(At).forEach((function(e){if(!jt){var r=t.listeners;r&&r[e]&&r[e][i]&&(n=r[e][i],delete r[e][i],0===Object.keys(r[e]).length&&delete r[e],0===Object.keys(r).length&&delete t.listeners)}t.removeEventListener(e,n,a)}))}function _t(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;e.trim().split(At).forEach((function(e){if(a.once&&!jt){var r=t.listeners,o=void 0===r?{}:r;n=function(){delete o[e][i],t.removeEventListener(e,n,a);for(var r=arguments.length,s=new Array(r),h=0;h<r;h++)s[h]=arguments[h];i.apply(t,s)},o[e]||(o[e]={}),o[e][i]&&t.removeEventListener(e,o[e][i],a),o[e][i]=n,t.listeners=o}t.addEventListener(e,n,a)}))}function It(t,e,i){var a;return xt(Event)&&xt(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 Pt(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var Ut=f.location,qt=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Ft(t){var e=t.match(qt);return null!==e&&(e[1]!==Ut.protocol||e[2]!==Ut.hostname||e[3]!==Ut.port)}function Vt(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function Jt(t){var e=t.rotate,i=t.scaleX,a=t.scaleY,n=t.translateX,r=t.translateY,o=[];gt(n)&&0!==n&&o.push("translateX(".concat(n,"px)")),gt(r)&&0!==r&&o.push("translateY(".concat(r,"px)")),gt(e)&&0!==e&&o.push("rotate(".concat(e,"deg)")),gt(i)&&1!==i&&o.push("scaleX(".concat(i,")")),gt(a)&&1!==a&&o.push("scaleY(".concat(a,")"));var s=o.length?o.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Zt(t){var i=e({},t),a=0;return Mt(t,(function(t,e){delete i[e],Mt(i,(function(e){var i=Math.abs(t.startX-e.startX),n=Math.abs(t.startY-e.startY),r=Math.abs(t.endX-e.endX),o=Math.abs(t.endY-e.endY),s=Math.sqrt(i*i+n*n),h=Math.sqrt(r*r+o*o),c=(h-s)/s;Math.abs(c)>Math.abs(a)&&(a=c)}))})),a}function Qt(t,i){var a=t.pageX,n=t.pageY,r={endX:a,endY:n};return i?r:e({startX:a,startY:n},r)}function Kt(t){var e=0,i=0,a=0;return Mt(t,(function(t){var n=t.startX,r=t.startY;e+=n,i+=r,a+=1})),e/=a,i/=a,{pageX:e,pageY:i}}function Gt(t){var e=t.aspectRatio,i=t.height,a=t.width,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",r=ft(a),o=ft(i);if(r&&o){var s=i*e;"contain"===n&&s>a||"cover"===n&&s<a?i=a/e:a=i*e}else r?i=a/e:o&&(a=i*e);return{width:a,height:i}}function te(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,r=Math.sin(n),o=Math.cos(n),s=e*o+i*r,h=e*r+i*o;return a>90?{width:h,height:s}:{width:s,height:h}}function ee(t,e,i,a){var n=e.aspectRatio,r=e.naturalWidth,o=e.naturalHeight,s=e.rotate,h=void 0===s?0:s,l=e.scaleX,p=void 0===l?1:l,d=e.scaleY,u=void 0===d?1:d,m=i.aspectRatio,g=i.naturalWidth,f=i.naturalHeight,v=a.fillColor,b=void 0===v?"transparent":v,w=a.imageSmoothingEnabled,y=void 0===w||w,x=a.imageSmoothingQuality,C=void 0===x?"low":x,D=a.maxWidth,M=void 0===D?1/0:D,B=a.maxHeight,k=void 0===B?1/0:B,O=a.minWidth,T=void 0===O?0:O,N=a.minHeight,z=void 0===N?0:N,S=document.createElement("canvas"),W=S.getContext("2d"),E=Gt({aspectRatio:m,width:M,height:k}),H=Gt({aspectRatio:m,width:T,height:z},"cover"),L=Math.min(E.width,Math.max(H.width,g)),R=Math.min(E.height,Math.max(H.height,f)),Y=Gt({aspectRatio:n,width:M,height:k}),X=Gt({aspectRatio:n,width:T,height:z},"cover"),A=Math.min(Y.width,Math.max(X.width,r)),j=Math.min(Y.height,Math.max(X.height,o)),$=[-A/2,-j/2,A,j];return S.width=Ot(L),S.height=Ot(R),W.fillStyle=b,W.fillRect(0,0,L,R),W.save(),W.translate(L/2,R/2),W.rotate(h*Math.PI/180),W.scale(p,u),W.imageSmoothingEnabled=y,W.imageSmoothingQuality=C,W.drawImage.apply(W,[t].concat(c($.map((function(t){return Math.floor(Ot(t))}))))),W.restore(),S}var ie=String.fromCharCode;function ae(t,e,i){var a="";i+=e;for(var n=e;n<i;n+=1)a+=ie(t.getUint8(n));return a}var ne=/^data:.*,/;function re(t){var e=t.replace(ne,""),i=atob(e),a=new ArrayBuffer(i.length),n=new Uint8Array(a);return Mt(n,(function(t,e){n[e]=i.charCodeAt(e)})),a}function oe(t,e){var i=[],a=8192,n=new Uint8Array(t);while(n.length>0)i.push(ie.apply(null,Dt(n.subarray(0,a)))),n=n.subarray(a);return"data:".concat(e,";base64,").concat(btoa(i.join("")))}function se(t){var e,i=new DataView(t);try{var a,n,r;if(255===i.getUint8(0)&&216===i.getUint8(1)){var o=i.byteLength,s=2;while(s+1<o){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"===ae(i,h,4)){var l=i.getUint16(c);if(a=18761===l,(a||19789===l)&&42===i.getUint16(c+2,a)){var p=i.getUint32(c+4,a);p>=8&&(r=c+p)}}}if(r){var d,u,m=i.getUint16(r,a);for(u=0;u<m;u+=1)if(d=r+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 he(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}return{rotate:e,scaleX:i,scaleY:a}}var ce={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,n=Number(e.minContainerWidth),r=Number(e.minContainerHeight);St(a,H),Wt(t,H);var o={width:Math.max(i.offsetWidth,n>=0?n:lt),height:Math.max(i.offsetHeight,r>=0?r:pt)};this.containerData=o,Nt(a,{width:o.width,height:o.height}),St(t,H),Wt(a,H)},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,r=a?e.naturalWidth:e.naturalHeight,o=n/r,s=t.width,h=t.height;t.height*o>t.width?3===i?s=t.height*o:h=t.width/o:3===i?h=t.width/o:s=t.height*o;var c={aspectRatio:o,naturalWidth:n,naturalHeight:r,width:s,height:h};this.canvasData=c,this.limited=1===i||2===i,this.limitCanvas(!0,!0),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),c.left=(t.width-c.width)/2,c.top=(t.height-c.height)/2,c.oldLeft=c.left,c.oldTop=c.top,this.initialCanvasData=Bt({},c)},limitCanvas:function(t,e){var i=this.options,a=this.containerData,n=this.canvasData,r=this.cropBoxData,o=i.viewMode,s=n.aspectRatio,h=this.cropped&&r;if(t){var c=Number(i.minCanvasWidth)||0,l=Number(i.minCanvasHeight)||0;o>1?(c=Math.max(c,a.width),l=Math.max(l,a.height),3===o&&(l*s>c?c=l*s:l=c/s)):o>0&&(c?c=Math.max(c,h?r.width:0):l?l=Math.max(l,h?r.height:0):h&&(c=r.width,l=r.height,l*s>c?c=l*s:l=c/s));var p=Gt({aspectRatio:s,width:c,height:l});c=p.width,l=p.height,n.minWidth=c,n.minHeight=l,n.maxWidth=1/0,n.maxHeight=1/0}if(e)if(o>(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(r.left,r.left+(r.width-n.width)),n.minTop=Math.min(r.top,r.top+(r.height-n.height)),n.maxLeft=r.left,n.maxTop=r.top,2===o&&(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=te({width:a.naturalWidth*Math.abs(a.scaleX||1),height:a.naturalHeight*Math.abs(a.scaleY||1),degree:a.rotate||0}),r=n.width,o=n.height,s=i.width*(r/i.naturalWidth),h=i.height*(o/i.naturalHeight);i.left-=(s-i.width)/2,i.top-=(h-i.height)/2,i.width=s,i.height=h,i.aspectRatio=r/o,i.naturalWidth=r,i.naturalHeight=o,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,Nt(this.canvas,Bt({width:i.width,height:i.height},Jt({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);Bt(i,{width:a,height:n,left:(e.width-a)/2,top:(e.height-n)/2}),Nt(this.image,Bt({width:i.width,height:i.height},Jt(Bt({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=Bt({},n)},limitCropBox:function(t,e){var i=this.options,a=this.containerData,n=this.canvasData,r=this.cropBoxData,o=this.limited,s=i.aspectRatio;if(t){var h=Number(i.minCropBoxWidth)||0,c=Number(i.minCropBoxHeight)||0,l=o?Math.min(a.width,n.width,n.width+n.left,a.width-n.left):a.width,p=o?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),p*s>l?p=l/s:l=p*s),r.minWidth=Math.min(h,l),r.minHeight=Math.min(c,p),r.maxWidth=l,r.maxHeight=p}e&&(o?(r.minLeft=Math.max(0,n.left),r.minTop=Math.max(0,n.top),r.maxLeft=Math.min(a.width,n.left+n.width)-r.width,r.maxTop=Math.min(a.height,n.top+n.height)-r.height):(r.minLeft=0,r.minTop=0,r.maxLeft=a.width-r.width,r.maxTop=a.height-r.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&&Yt(this.face,A,i.width>=e.width&&i.height>=e.height?C:y),Nt(this.cropBox,Bt({width:i.width,height:i.height},Jt({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,P,this.getData())}},le={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",r=document.createElement("img");if(e&&(r.crossOrigin=e),r.src=a,r.alt=n,this.viewBox.appendChild(r),this.viewBoxImage=r,i){var o=i;"string"===typeof i?o=t.ownerDocument.querySelectorAll(i):i.querySelector&&(o=[i]),this.previews=o,Mt(o,(function(t){var i=document.createElement("img");Yt(t,j,{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(){Mt(this.previews,(function(t){var e=Rt(t,j);Nt(t,{width:e.width,height:e.height}),t.innerHTML=e.html,Xt(t,j)}))},preview:function(){var t=this.imageData,e=this.canvasData,i=this.cropBoxData,a=i.width,n=i.height,r=t.width,o=t.height,s=i.left-e.left-t.left,h=i.top-e.top-t.top;this.cropped&&!this.disabled&&(Nt(this.viewBoxImage,Bt({width:r,height:o},Jt(Bt({translateX:-s,translateY:-h},t)))),Mt(this.previews,(function(e){var i=Rt(e,j),c=i.width,l=i.height,p=c,d=l,u=1;a&&(u=c/a,d=n*u),n&&d>l&&(u=l/n,p=a*u,d=l),Nt(e,{width:p,height:d}),Nt(e.getElementsByTagName("img")[0],Bt({width:r*u,height:o*u},Jt(Bt({translateX:-s*u,translateY:-h*u},t))))})))}},pe={bind:function(){var t=this.element,e=this.options,i=this.cropper;xt(e.cropstart)&&_t(t,F,e.cropstart),xt(e.cropmove)&&_t(t,q,e.cropmove),xt(e.cropend)&&_t(t,U,e.cropend),xt(e.crop)&&_t(t,P,e.crop),xt(e.zoom)&&_t(t,nt,e.zoom),_t(i,K,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&_t(i,at,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&_t(i,V,this.onDblclick=this.dblclick.bind(this)),_t(t.ownerDocument,G,this.onCropMove=this.cropMove.bind(this)),_t(t.ownerDocument,tt,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&_t(window,it,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,i=this.cropper;xt(e.cropstart)&&$t(t,F,e.cropstart),xt(e.cropmove)&&$t(t,q,e.cropmove),xt(e.cropend)&&$t(t,U,e.cropend),xt(e.crop)&&$t(t,P,e.crop),xt(e.zoom)&&$t(t,nt,e.zoom),$t(i,K,this.onCropStart),e.zoomable&&e.zoomOnWheel&&$t(i,at,this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&$t(i,V,this.onDblclick),$t(t.ownerDocument,G,this.onCropMove),$t(t.ownerDocument,tt,this.onCropEnd),e.responsive&&$t(window,it,this.onResize)}},de={resize:function(){if(!this.disabled){var t,e,i=this.options,a=this.container,n=this.containerData,r=a.offsetWidth/n.width,o=a.offsetHeight/n.height,s=Math.abs(r-1)>Math.abs(o-1)?r:o;if(1!==s)i.restore&&(t=this.getCanvasData(),e=this.getCropBoxData()),this.render(),i.restore&&(this.setCanvasData(Mt(t,(function(e,i){t[i]=e*s}))),this.setCropBoxData(Mt(e,(function(t,i){e[i]=t*s}))))}},dblclick:function(){this.disabled||this.options.dragMode===I||this.setDragMode(zt(this.dragBox,W)?_:$)},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)&&(gt(e)&&1!==e||gt(i)&&0!==i||t.ctrlKey))){var a,n=this.options,r=this.pointers;t.changedTouches?Mt(t.changedTouches,(function(t){r[t.identifier]=Qt(t)})):r[t.pointerId||0]=Qt(t),a=Object.keys(r).length>1&&n.zoomable&&n.zoomOnTouch?D:Rt(t.target,A),ot.test(a)&&!1!==It(this.element,F,{originalEvent:t,action:a})&&(t.preventDefault(),this.action=a,this.cropping=!1,a===x&&(this.cropping=!0,St(this.dragBox,Y)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var i=this.pointers;t.preventDefault(),!1!==It(this.element,q,{originalEvent:t,action:e})&&(t.changedTouches?Mt(t.changedTouches,(function(t){Bt(i[t.identifier]||{},Qt(t,!0))})):Bt(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?Mt(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,Y,this.cropped&&this.options.modal)),It(this.element,U,{originalEvent:t,action:e}))}}},ue={change:function(t){var e,i=this.options,a=this.canvasData,n=this.containerData,r=this.cropBoxData,o=this.pointers,s=this.action,h=i.aspectRatio,c=r.left,l=r.top,p=r.width,d=r.height,u=c+p,m=l+d,g=0,f=0,v=n.width,b=n.height,w=!0;!h&&t.shiftKey&&(h=p&&d?p/d:1),this.limited&&(g=r.minLeft,f=r.minTop,v=g+Math.min(n.width,a.width,a.left+a.width),b=f+Math.min(n.height,a.height,a.top+a.height));var W=o[Object.keys(o)[0]],E={x:W.endX-W.startX,y:W.endY-W.startY},L=function(t){switch(t){case M:u+E.x>v&&(E.x=v-u);break;case B:c+E.x<g&&(E.x=g-c);break;case O:l+E.y<f&&(E.y=f-l);break;case k:m+E.y>b&&(E.y=b-m);break}};switch(s){case y:c+=E.x,l+=E.y;break;case M:if(E.x>=0&&(u>=v||h&&(l<=f||m>=b))){w=!1;break}L(M),p+=E.x,p<0&&(s=B,p=-p,c-=p),h&&(d=p/h,l+=(r.height-d)/2);break;case O:if(E.y<=0&&(l<=f||h&&(c<=g||u>=v))){w=!1;break}L(O),d-=E.y,l+=E.y,d<0&&(s=k,d=-d,l-=d),h&&(p=d*h,c+=(r.width-p)/2);break;case B:if(E.x<=0&&(c<=g||h&&(l<=f||m>=b))){w=!1;break}L(B),p-=E.x,c+=E.x,p<0&&(s=M,p=-p,c-=p),h&&(d=p/h,l+=(r.height-d)/2);break;case k:if(E.y>=0&&(m>=b||h&&(c<=g||u>=v))){w=!1;break}L(k),d+=E.y,d<0&&(s=O,d=-d,l-=d),h&&(p=d*h,c+=(r.width-p)/2);break;case T:if(h){if(E.y<=0&&(l<=f||u>=v)){w=!1;break}L(O),d-=E.y,l+=E.y,p=d*h}else L(O),L(M),E.x>=0?u<v?p+=E.x:E.y<=0&&l<=f&&(w=!1):p+=E.x,E.y<=0?l>f&&(d-=E.y,l+=E.y):(d-=E.y,l+=E.y);p<0&&d<0?(s=S,d=-d,p=-p,l-=d,c-=p):p<0?(s=N,p=-p,c-=p):d<0&&(s=z,d=-d,l-=d);break;case N:if(h){if(E.y<=0&&(l<=f||c<=g)){w=!1;break}L(O),d-=E.y,l+=E.y,p=d*h,c+=r.width-p}else L(O),L(B),E.x<=0?c>g?(p-=E.x,c+=E.x):E.y<=0&&l<=f&&(w=!1):(p-=E.x,c+=E.x),E.y<=0?l>f&&(d-=E.y,l+=E.y):(d-=E.y,l+=E.y);p<0&&d<0?(s=z,d=-d,p=-p,l-=d,c-=p):p<0?(s=T,p=-p,c-=p):d<0&&(s=S,d=-d,l-=d);break;case S:if(h){if(E.x<=0&&(c<=g||m>=b)){w=!1;break}L(B),p-=E.x,c+=E.x,d=p/h}else L(k),L(B),E.x<=0?c>g?(p-=E.x,c+=E.x):E.y>=0&&m>=b&&(w=!1):(p-=E.x,c+=E.x),E.y>=0?m<b&&(d+=E.y):d+=E.y;p<0&&d<0?(s=T,d=-d,p=-p,l-=d,c-=p):p<0?(s=z,p=-p,c-=p):d<0&&(s=N,d=-d,l-=d);break;case z:if(h){if(E.x>=0&&(u>=v||m>=b)){w=!1;break}L(M),p+=E.x,d=p/h}else L(k),L(M),E.x>=0?u<v?p+=E.x:E.y>=0&&m>=b&&(w=!1):p+=E.x,E.y>=0?m<b&&(d+=E.y):d+=E.y;p<0&&d<0?(s=N,d=-d,p=-p,l-=d,c-=p):p<0?(s=S,p=-p,c-=p):d<0&&(s=T,d=-d,l-=d);break;case C:this.move(E.x,E.y),w=!1;break;case D:this.zoom(Zt(o),t),w=!1;break;case x:if(!E.x||!E.y){w=!1;break}e=Pt(this.cropper),c=W.startX-e.left,l=W.startY-e.top,p=r.minWidth,d=r.minHeight,E.x>0?s=E.y>0?z:T:E.x<0&&(c-=p,s=E.y>0?S:N),E.y<0&&(l-=d),this.cropped||(Wt(this.cropBox,H),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}w&&(r.width=p,r.height=d,r.left=c,r.top=l,this.action=s,this.renderCropBox()),Mt(o,(function(t){t.startX=t.endX,t.startY=t.endY}))}},me={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&St(this.dragBox,Y),Wt(this.cropBox,H),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Bt({},this.initialImageData),this.canvasData=Bt({},this.initialCanvasData),this.cropBoxData=Bt({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Bt(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Wt(this.dragBox,Y),St(this.cropBox,H)),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,Mt(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,Wt(this.cropper,E)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,St(this.cropper,E)),this},destroy:function(){var t=this.element;return t[w]?(t[w]=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(vt(t)?t:a+Number(t),vt(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&&(gt(t)&&(i.left=t,a=!0),gt(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,r=n.width,o=n.height,s=n.naturalWidth,h=n.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&a.zoomable){var c=s*t,l=h*t;if(!1===It(this.element,nt,{ratio:t,oldRatio:r/s,originalEvent:i}))return this;if(i){var p=this.pointers,d=Pt(this.cropper),u=p&&Object.keys(p).length?Kt(p):{pageX:i.pageX,pageY:i.pageY};n.left-=(c-r)*((u.pageX-d.left-n.left)/r),n.top-=(l-o)*((u.pageY-d.top-n.top)/o)}else yt(e)&&gt(e.x)&&gt(e.y)?(n.left-=(c-r)*((e.x-n.left)/r),n.top-=(l-o)*((e.y-n.top)/o)):(n.left-=(c-r)/2,n.top-=(l-o)/2);n.width=c,n.height=l,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),gt(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,gt(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(gt(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&&(gt(t)&&(i.scaleX=t,a=!0),gt(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,r=this.cropBoxData;if(this.ready&&this.cropped){t={x:r.left-n.left,y:r.top-n.top,width:r.width,height:r.height};var o=a.width/a.naturalWidth;if(Mt(t,(function(e,i){t[i]=e/o})),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&&yt(t)){var r=!1;e.rotatable&&gt(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,r=!0),e.scalable&&(gt(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,r=!0),gt(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,r=!0)),r&&this.renderCanvas(!0,!0);var o=i.width/i.naturalWidth;gt(t.x)&&(n.left=t.x*o+a.left),gt(t.y)&&(n.top=t.y*o+a.top),gt(t.width)&&(n.width=t.width*o),gt(t.height)&&(n.height=t.height*o),this.setCropBoxData(n)}return this},getContainerData:function(){return this.ready?Bt({},this.containerData):{}},getImageData:function(){return this.sized?Bt({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&Mt(["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&&yt(t)&&(gt(t.left)&&(e.left=t.left),gt(t.top)&&(e.top=t.top),gt(t.width)?(e.width=t.width,e.height=t.width/i):gt(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&&yt(t)&&(gt(t.left)&&(a.left=t.left),gt(t.top)&&(a.top=t.top),gt(t.width)&&t.width!==a.width&&(e=!0,a.width=t.width),gt(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=ee(this.image,this.imageData,e,t);if(!this.cropped)return i;var a=this.getData(t.rounded),n=a.x,r=a.y,o=a.width,s=a.height,h=i.width/Math.floor(e.naturalWidth);1!==h&&(n*=h,r*=h,o*=h,s*=h);var l=o/s,p=Gt({aspectRatio:l,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),d=Gt({aspectRatio:l,width:t.minWidth||0,height:t.minHeight||0},"cover"),u=Gt({aspectRatio:l,width:t.width||(1!==h?i.width:o),height:t.height||(1!==h?i.height:s)}),m=u.width,g=u.height;m=Math.min(p.width,Math.max(d.width,m)),g=Math.min(p.height,Math.max(d.height,g));var f=document.createElement("canvas"),v=f.getContext("2d");f.width=Ot(m),f.height=Ot(g),v.fillStyle=t.fillColor||"transparent",v.fillRect(0,0,m,g);var b=t.imageSmoothingEnabled,w=void 0===b||b,y=t.imageSmoothingQuality;v.imageSmoothingEnabled=w,y&&(v.imageSmoothingQuality=y);var x,C,D,M,B,k,O=i.width,T=i.height,N=n,z=r;N<=-o||N>O?(N=0,x=0,D=0,B=0):N<=0?(D=-N,N=0,x=Math.min(O,o+N),B=x):N<=O&&(D=0,x=Math.min(o,O-N),B=x),x<=0||z<=-s||z>T?(z=0,C=0,M=0,k=0):z<=0?(M=-z,z=0,C=Math.min(T,s+z),k=C):z<=T&&(M=0,C=Math.min(s,T-z),k=C);var S=[N,z,x,C];if(B>0&&k>0){var W=m/o;S.push(D*W,M*W,B*W,k*W)}return v.drawImage.apply(v,[i].concat(c(S.map((function(t){return Math.floor(Ot(t))}))))),f},setAspectRatio:function(t){var e=this.options;return this.disabled||vt(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===$,r=e.movable&&t===_;t=n||r?t:I,e.dragMode=t,Yt(i,A,t),Et(i,W,n),Et(i,X,r),e.cropBoxMovable||(Yt(a,A,t),Et(a,W,n),Et(a,X,r))}return this}},ge=f.Cropper,fe=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r(this,t),!e||!ct.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=Bt({},dt,yt(i)&&i),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 s(t,[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e[w]){if(e[w]=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(st.test(t))ht.test(t)?this.read(re(t)):this.clone();else{var n=new XMLHttpRequest,r=this.clone.bind(this);this.reloading=!0,this.xhr=n,n.onabort=r,n.onerror=r,n.ontimeout=r,n.onprogress=function(){n.getResponseHeader("content-type")!==rt&&n.abort()},n.onload=function(){e.read(n.response)},n.onloadend=function(){e.reloading=!1,e.xhr=null},a.checkCrossOrigin&&Ft(t)&&i.crossOrigin&&(t=Vt(t)),n.open("GET",t,!0),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=se(t),n=0,r=1,o=1;if(a>1){this.url=oe(t,rt);var s=he(a);n=s.rotate,r=s.scaleX,o=s.scaleY}e.rotatable&&(i.rotate=n),e.scalable&&(i.scaleX=r,i.scaleY=o),this.clone()}},{key:"clone",value:function(){var t=this.element,e=this.url,i=t.crossOrigin,a=e;this.options.checkCrossOrigin&&Ft(e)&&(i||(i="anonymous"),a=Vt(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),St(n,L),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=f.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(f.navigator.userAgent),a=function(e,i){Bt(t.imageData,{naturalWidth:e,naturalHeight:i,aspectRatio:e/i}),t.initialImageData=Bt({},t.imageData),t.sizing=!1,t.sized=!0,t.build()};if(!e.naturalWidth||i){var n=document.createElement("img"),r=document.body||document.documentElement;this.sizingImage=n,n.onload=function(){a(n.width,n.height),i||r.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;",r.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=ut;var r=n.querySelector(".".concat(w,"-container")),o=r.querySelector(".".concat(w,"-canvas")),s=r.querySelector(".".concat(w,"-drag-box")),h=r.querySelector(".".concat(w,"-crop-box")),c=h.querySelector(".".concat(w,"-face"));this.container=a,this.cropper=r,this.canvas=o,this.dragBox=s,this.cropBox=h,this.viewBox=r.querySelector(".".concat(w,"-view-box")),this.face=c,o.appendChild(i),St(t,H),a.insertBefore(r,t.nextSibling),Wt(i,L),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,St(h,H),e.guides||St(h.getElementsByClassName("".concat(w,"-dashed")),H),e.center||St(h.getElementsByClassName("".concat(w,"-center")),H),e.background&&St(r,"".concat(w,"-bg")),e.highlight||St(c,R),e.cropBoxMovable&&(St(c,X),Yt(c,A,y)),e.cropBoxResizable||(St(h.getElementsByClassName("".concat(w,"-line")),H),St(h.getElementsByClassName("".concat(w,"-point")),H)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),xt(e.ready)&&_t(t,et,e.ready,{once:!0}),It(t,et)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var t=this.cropper.parentNode;t&&t.removeChild(this.cropper),Wt(this.element,H)}}},{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=ge,t}},{key:"setDefaults",value:function(t){Bt(dt,yt(t)&&t)}}])}();return Bt(fe.prototype,ce,le,pe,de,ue,me),fe}))},c80b:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t._self._c;return e("el-dialog",{ref:"editAvatar",staticClass:"cropper-uploader quying-dialog",attrs:{title:t.title,visible:t.dialogVisible,"append-to-body":"","before-close":t.handleClose,"close-on-click-modal":!0,width:t._dialogWidth},on:{"update:visible":function(e){t.dialogVisible=e}}},[e("div",{staticClass:"cropper-uploader-wrap"},[e("input",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],ref:"fileinput",attrs:{type:"file",accept:t.accept},on:{change:t.handleChange}}),e("div",{directives:[{name:"show",rawName:"v-show",value:!t.isLoaded,expression:"!isLoaded"}],staticClass:"cropper-uploader__choose cropper-uploader_left"},[e("el-button",{attrs:{round:""},on:{click:t.handleClick}},[t._v("+选择图片")]),e("p",[t._v(t._s(t._uploadTip))])],1),e("div",{directives:[{name:"show",rawName:"v-show",value:t.isLoaded,expression:"isLoaded"}],staticClass:"cropper-uploader__edit cropper-uploader_left"},[e("div",{staticClass:"cropper-uploader__edit-area"},[e("vue-cropper",t._b({ref:"cropper",style:{height:t._cropperHeight},attrs:{src:t.imgSrc,preview:".preview"}},"vue-cropper",t._cropper,!1))],1),e("div",{staticClass:"tool-bar"},[e("el-button-group",[e("el-button",{attrs:{round:"",size:"mini",icon:"el-icon-edit"},on:{click:t.handleClick}},[t._v("重新选择")]),e("el-button",{attrs:{round:"",size:"mini",type:""},on:{click:t.flipX}},[t._v("左右翻转")]),e("el-button",{attrs:{round:"",size:"mini",type:""},on:{click:t.flipY}},[t._v("上下翻转")]),e("el-button",{attrs:{round:"",size:"mini",type:"",icon:"el-icon-zoom-in"},on:{click:function(e){return t.zoom(.1)}}}),e("el-button",{attrs:{round:"",size:"mini",type:"",icon:"el-icon-zoom-out"},on:{click:function(e){return t.zoom(-.1)}}}),e("el-button",{attrs:{round:"",size:"mini",type:"",icon:"el-icon-refresh-right"},on:{click:function(e){return t.rotate(90)}}},[t._v("旋转")]),e("el-button",{attrs:{round:"",size:"mini",type:"",icon:"el-icon-refresh"},on:{click:t.reset}},[t._v("重置")])],1)],1)]),e("div",{staticClass:"cropper-uploader__preview"},[e("span",{staticClass:"cropper-uploader__preview-title"},[t._v("预览")]),e("div",{staticClass:"cropper-uploader__preview-120 preview"}),e("div",{staticClass:"cropper-uploader__preview-65 preview",class:{round:1===t._cropper.aspectRatio}})])]),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{attrs:{size:"mini"},on:{click:t.handleClose}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.doCropper()}}},[t._v("确 定")])],1)])},n=[],r=(i("99af"),i("e9c4"),i("a9e3"),i("b64b"),i("ac1f"),i("5319"),i("bab4")),o=i.n(r);const s="undefined"===typeof window?[String,Array]:[String,Array,Element,NodeList];var h={render(t){return t("div",{style:this.containerStyle},[t("img",{ref:"img",attrs:{src:this.src,alt:this.alt||"image",style:"max-width: 100%"},style:this.imgStyle})])},props:{containerStyle:Object,src:{type:String,default:""},alt:String,imgStyle:Object,viewMode:Number,dragMode:String,initialAspectRatio:Number,aspectRatio:Number,data:Object,preview:s,responsive:{type:Boolean,default:!0},restore:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},guides:{type:Boolean,default:!0},center:{type:Boolean,default:!0},highlight:{type:Boolean,default:!0},background:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!0},autoCropArea:Number,movable:{type:Boolean,default:!0},rotatable:{type:Boolean,default:!0},scalable:{type:Boolean,default:!0},zoomable:{type:Boolean,default:!0},zoomOnTouch:{type:Boolean,default:!0},zoomOnWheel:{type:Boolean,default:!0},wheelZoomRatio:Number,cropBoxMovable:{type:Boolean,default:!0},cropBoxResizable:{type:Boolean,default:!0},toggleDragModeOnDblclick:{type:Boolean,default:!0},minCanvasWidth:Number,minCanvasHeight:Number,minCropBoxWidth:Number,minCropBoxHeight:Number,minContainerWidth:Number,minContainerHeight:Number,ready:Function,cropstart:Function,cropmove:Function,cropend:Function,crop:Function,zoom:Function},mounted(){const{containerStyle:t,src:e,alt:i,imgStyle:a,...n}=this.$options.props,r={};for(const o in n)void 0!==this[o]&&(r[o]=this[o]);this.cropper=new o.a(this.$refs.img,r)},methods:{reset(){return this.cropper.reset()},clear(){return this.cropper.clear()},initCrop(){return this.cropper.crop()},replace(t,e=!1){return this.cropper.replace(t,e)},enable(){return this.cropper.enable()},disable(){return this.cropper.disable()},destroy(){return this.cropper.destroy()},move(t,e){return this.cropper.move(t,e)},moveTo(t,e=t){return this.cropper.moveTo(t,e)},relativeZoom(t,e){return this.cropper.zoom(t,e)},zoomTo(t,e){return this.cropper.zoomTo(t,e)},rotate(t){return this.cropper.rotate(t)},rotateTo(t){return this.cropper.rotateTo(t)},scaleX(t){return this.cropper.scaleX(t)},scaleY(t){return this.cropper.scaleY(t)},scale(t,e=t){return this.cropper.scale(t,e)},getData(t=!1){return this.cropper.getData(t)},setData(t){return this.cropper.setData(t)},getContainerData(){return this.cropper.getContainerData()},getImageData(){return this.cropper.getImageData()},getCanvasData(){return this.cropper.getCanvasData()},setCanvasData(t){return this.cropper.setCanvasData(t)},getCropBoxData(){return this.cropper.getCropBoxData()},setCropBoxData(t){return this.cropper.setCropBoxData(t)},getCroppedCanvas(t={}){return this.cropper.getCroppedCanvas(t)},setAspectRatio(t){return this.cropper.setAspectRatio(t)},setDragMode(t){return this.cropper.setDragMode(t)}}},c=i("1d2a"),l={name:"d2p-cropper",components:{VueCropper:h},props:{title:{type:String,default:"图片裁剪"},cropperHeight:{type:[String,Number]},dialogWidth:{type:[String,Number],default:"50%"},maxSize:{type:Number,default:5},uploadTip:{type:String},cropper:{type:Object},accept:{type:String,default:".jpg, .jpeg, .png, .gif, .webp"},output:{type:String,default:"blob"}},data:function(){return{dialogVisible:!1,isLoaded:!1,imgSrc:"",data:null,file:void 0,scale:{x:1,y:1}}},computed:{_uploadTip:function(){return null!=this.uploadTip&&""!==this.uploadTip?this.uploadTip:this.maxSize>0?"只支持".concat(this.accept.replace(/,/g,"、"),",大小不超过").concat(this.maxSize,"M"):"只支持".concat(this.accept,",大小无限制")},_cropper:function(){var t={aspectRatio:1,ready:this.ready};if(null==this.cropper)return t;var e=Object.assign(t,this.cropper);return c["a"].debug("cropper options:",e),e},_cropperHeight:function(){var t=this.cropperHeight;return null==t&&(t=.55*document.documentElement.clientHeight,t<270&&(t=270)),"number"===typeof t&&(t+="px"),t},_dialogWidth:function(){var t=this.dialogWidth;return null==t&&(t="50%"),"number"===typeof t&&(t+="px"),t}},methods:{open:function(t){this.dialogVisible=!0,null!=t&&""!==t&&(this.imgSrc=t)},close:function(){this.dialogVisible=!1},clear:function(){this.isLoaded=!1,null!=this.$refs.fileinput&&(this.$refs.fileinput.value=null),null!=this.$refs.cropper&&this.$refs.cropper.clear()},getCropper:function(){return this.$refs.cropper},ready:function(t){c["a"].debug("cropper ready:",t)},preventDefault:function(t){return t.preventDefault(),!1},handleClick:function(t){this.$refs.fileinput.click()},checkFile:function(t){return-1===t.type.indexOf("image")?(this.$message({message:"请选择合适的文件类型",type:"warning"}),!1):!(this.maxSize>0&&t.size/1024/1024>this.maxSize)||(this.$message({message:"图片大小超出最大限制("+this.maxSize+"MB),请重新选择",type:"warning"}),!1)},handleChange:function(t){t.preventDefault();var e=t.target.files||t.dataTransfer.files;this.isLoaded=!0;var i=e[0];this.checkFile(i)&&(this.file=i,this.setImage(t))},handleClose:function(){this.dialogVisible=!1,this.$emit("cancel")},doCropper:function(){this.isLoaded?(this.dialogVisible=!1,this.doOutput(this.file)):this.$message("请先选择图片")},doOutput:function(t){var e=this;c["a"].debug("output this:",this);var i={file:t};"all"===this.output&&this.getCropImageBlob((function(t){var a=e.cropImageDataUrl();i.blob=t,i.dataUrl=a,e.$emit("done",i)})),"blob"===this.output&&this.getCropImageBlob((function(t){i.blob=t,e.$emit("done",i)})),"dataUrl"===this.output&&(i.dataUrl=this.cropImageDataUrl(),this.$emit("done",i))},emit:function(t){this.$emit("done",t)},cropImageDataUrl:function(){return this.$refs.cropper.getCroppedCanvas().toDataURL()},getCropImageBlob:function(t,e,i){this.$refs.cropper.getCroppedCanvas().toBlob(t,e,i)},flipX:function(){this.$refs.cropper.scaleX(this.scale.x*=-1)},flipY:function(){this.$refs.cropper.scaleY(this.scale.y*=-1)},getCropBoxData:function(){this.data=JSON.stringify(this.$refs.cropper.getCropBoxData(),null,4)},getData:function(){this.data=JSON.stringify(this.$refs.cropper.getData(),null,4)},move:function(t,e){this.$refs.cropper.move(t,e)},reset:function(){this.$refs.cropper.reset()},rotate:function(t){this.$refs.cropper.rotate(t)},setCropBoxData:function(){this.data&&this.$refs.cropper.setCropBoxData(JSON.parse(this.data))},setData:function(){this.data&&this.$refs.cropper.setData(JSON.parse(this.data))},setImage:function(t){var e=this,i=t.target.files[0];if(-1!==i.type.indexOf("image/"))if("function"===typeof FileReader){var a=new FileReader;a.onload=function(t){e.imgSrc=t.target.result,e.$refs.cropper.replace(t.target.result)},a.readAsDataURL(i)}else this.$message("Sorry, FileReader API not supported");else this.$message("Please select an image file")},showFileChooser:function(){this.$refs.input.click()},zoom:function(t){this.$refs.cropper.relativeZoom(t)}}},p=l,d=(i("27f0"),i("2877")),u=Object(d["a"])(p,a,n,!1,null,"2d1b0b14",null);e["default"]=u.exports},eebf:function(t,e,i){}}]);