import{r as t,B as i,h as e}from"./p-9b6cc562.js";import{c as r,a as n}from"./p-86bd3473.js";var a=r((function(t){
/*!
 * Cropper.js v1.5.13
 * https://fengyuanchen.github.io/cropperjs
 *
 * Copyright 2015-present Chen Fengyuan
 * Released under the MIT license
 *
 * Date: 2022-11-20T05:30:46.114Z
 */
t.exports=function(){function t(t,i){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);i&&(r=r.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),e.push.apply(e,r)}return e}function i(i){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?t(Object(r),!0).forEach((function(t){a(i,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))}))}return i}function e(t){return(e="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)}function r(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function n(t,i){for(var e=0;e<i.length;e++){var r=i[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}function o(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,i){if(t){if("string"==typeof t)return s(t,i);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?s(t,i):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,i){(null==i||i>t.length)&&(i=t.length);for(var e=0,r=new Array(i);e<i;e++)r[e]=t[e];return r}var h="undefined"!=typeof window&&void 0!==window.document,c=h?window:{},p=!(!h||!c.document.documentElement)&&"ontouchstart"in c.document.documentElement,u=!!h&&"PointerEvent"in c,l="cropper",f="all",d="crop",v="move",b="zoom",m="e",g="w",w="s",M="n",y="ne",x="nw",A="se",k="sw",C="".concat(l,"-crop"),j="".concat(l,"-disabled"),O="".concat(l,"-hidden"),N="".concat(l,"-hide"),z="".concat(l,"-invisible"),R="".concat(l,"-modal"),B="".concat(l,"-move"),T="".concat(l,"Action"),D="".concat(l,"Preview"),E="crop",X="move",S="none",Y="crop",H="cropend",W="cropmove",P="cropstart",I="dblclick",F=u?"pointerdown":p?"touchstart":"mousedown",U=u?"pointermove":p?"touchmove":"mousemove",Z=u?"pointerup pointercancel":p?"touchend touchcancel":"mouseup",$="ready",G="resize",Q="wheel",V="zoom",L="image/jpeg",J=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,K=/^data:/,q=/^data:image\/jpeg;base64,/,_=/^img|canvas$/i,tt={viewMode:0,dragMode:E,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},it=Number.isNaN||c.isNaN;function et(t){return"number"==typeof t&&!it(t)}var rt=function(t){return t>0&&t<1/0};function nt(t){return void 0===t}function at(t){return"object"===e(t)&&null!==t}var ot=Object.prototype.hasOwnProperty;function st(t){if(!at(t))return!1;try{var i=t.constructor,e=i.prototype;return i&&e&&ot.call(e,"isPrototypeOf")}catch(t){return!1}}function ht(t){return"function"==typeof t}var ct=Array.prototype.slice;function pt(t){return Array.from?Array.from(t):ct.call(t)}function ut(t,i){return t&&ht(i)&&(Array.isArray(t)||et(t.length)?pt(t).forEach((function(e,r){i.call(t,e,r,t)})):at(t)&&Object.keys(t).forEach((function(e){i.call(t,t[e],e,t)}))),t}var lt=Object.assign||function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),r=1;r<i;r++)e[r-1]=arguments[r];return at(t)&&e.length>0&&e.forEach((function(i){at(i)&&Object.keys(i).forEach((function(e){t[e]=i[e]}))})),t},ft=/\.\d*(?:0|9){12}\d*$/;function dt(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return ft.test(t)?Math.round(t*i)/i:t}var vt=/^width|height|left|top|marginLeft|marginTop$/;function bt(t,i){var e=t.style;ut(i,(function(t,i){vt.test(i)&&et(t)&&(t="".concat(t,"px")),e[i]=t}))}function mt(t,i){if(i)if(et(t.length))ut(t,(function(t){mt(t,i)}));else if(t.classList)t.classList.add(i);else{var e=t.className.trim();e?e.indexOf(i)<0&&(t.className="".concat(e," ").concat(i)):t.className=i}}function gt(t,i){i&&(et(t.length)?ut(t,(function(t){gt(t,i)})):t.classList?t.classList.remove(i):t.className.indexOf(i)>=0&&(t.className=t.className.replace(i,"")))}function wt(t,i,e){i&&(et(t.length)?ut(t,(function(t){wt(t,i,e)})):e?mt(t,i):gt(t,i))}var Mt=/([a-z\d])([A-Z])/g;function yt(t){return t.replace(Mt,"$1-$2").toLowerCase()}function xt(t,i){return at(t[i])?t[i]:t.dataset?t.dataset[i]:t.getAttribute("data-".concat(yt(i)))}function At(t,i,e){at(e)?t[i]=e:t.dataset?t.dataset[i]=e:t.setAttribute("data-".concat(yt(i)),e)}var kt=/\s\s*/,Ct=function(){var t=!1;if(h){var i=!1,e=function(){},r=Object.defineProperty({},"once",{get:function(){return t=!0,i},set:function(t){i=t}});c.addEventListener("test",e,r),c.removeEventListener("test",e,r)}return t}();function jt(t,i,e){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=e;i.trim().split(kt).forEach((function(i){if(!Ct){var a=t.listeners;a&&a[i]&&a[i][e]&&(n=a[i][e],delete a[i][e],0===Object.keys(a[i]).length&&delete a[i],0===Object.keys(a).length&&delete t.listeners)}t.removeEventListener(i,n,r)}))}function Ot(t,i,e){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=e;i.trim().split(kt).forEach((function(i){if(r.once&&!Ct){var a=t.listeners,o=void 0===a?{}:a;n=function(){delete o[i][e],t.removeEventListener(i,n,r);for(var a=arguments.length,s=new Array(a),h=0;h<a;h++)s[h]=arguments[h];e.apply(t,s)},o[i]||(o[i]={}),o[i][e]&&t.removeEventListener(i,o[i][e],r),o[i][e]=n,t.listeners=o}t.addEventListener(i,n,r)}))}function Nt(t,i,e){var r;return ht(Event)&&ht(CustomEvent)?r=new CustomEvent(i,{detail:e,bubbles:!0,cancelable:!0}):(r=document.createEvent("CustomEvent")).initCustomEvent(i,!0,!0,e),t.dispatchEvent(r)}function zt(t){var i=t.getBoundingClientRect();return{left:i.left+(window.pageXOffset-document.documentElement.clientLeft),top:i.top+(window.pageYOffset-document.documentElement.clientTop)}}var Rt=c.location,Bt=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Tt(t){var i=t.match(Bt);return null!==i&&(i[1]!==Rt.protocol||i[2]!==Rt.hostname||i[3]!==Rt.port)}function Dt(t){var i="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+i}function Et(t){var i=t.rotate,e=t.scaleX,r=t.scaleY,n=t.translateX,a=t.translateY,o=[];et(n)&&0!==n&&o.push("translateX(".concat(n,"px)")),et(a)&&0!==a&&o.push("translateY(".concat(a,"px)")),et(i)&&0!==i&&o.push("rotate(".concat(i,"deg)")),et(e)&&1!==e&&o.push("scaleX(".concat(e,")")),et(r)&&1!==r&&o.push("scaleY(".concat(r,")"));var s=o.length?o.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Xt(t,e){var r=t.pageX,n=t.pageY,a={endX:r,endY:n};return e?a:i({startX:r,startY:n},a)}function St(t){var i=t.aspectRatio,e=t.height,r=t.width,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",a=rt(r),o=rt(e);if(a&&o){var s=e*i;"contain"===n&&s>r||"cover"===n&&s<r?e=r/i:r=e*i}else a?e=r/i:o&&(r=e*i);return{width:r,height:e}}function Yt(t,i,e,r){var n=i.aspectRatio,a=i.naturalWidth,s=i.naturalHeight,h=i.rotate,c=void 0===h?0:h,p=i.scaleX,u=void 0===p?1:p,l=i.scaleY,f=void 0===l?1:l,d=e.aspectRatio,v=e.naturalWidth,b=e.naturalHeight,m=r.fillColor,g=void 0===m?"transparent":m,w=r.imageSmoothingEnabled,M=void 0===w||w,y=r.imageSmoothingQuality,x=void 0===y?"low":y,A=r.maxWidth,k=void 0===A?1/0:A,C=r.maxHeight,j=void 0===C?1/0:C,O=r.minWidth,N=void 0===O?0:O,z=r.minHeight,R=void 0===z?0:z,B=document.createElement("canvas"),T=B.getContext("2d"),D=St({aspectRatio:d,width:k,height:j}),E=St({aspectRatio:d,width:N,height:R},"cover"),X=Math.min(D.width,Math.max(E.width,v)),S=Math.min(D.height,Math.max(E.height,b)),Y=St({aspectRatio:n,width:k,height:j}),H=St({aspectRatio:n,width:N,height:R},"cover"),W=Math.min(Y.width,Math.max(H.width,a)),P=Math.min(Y.height,Math.max(H.height,s)),I=[-W/2,-P/2,W,P];return B.width=dt(X),B.height=dt(S),T.fillStyle=g,T.fillRect(0,0,X,S),T.save(),T.translate(X/2,S/2),T.rotate(c*Math.PI/180),T.scale(u,f),T.imageSmoothingEnabled=M,T.imageSmoothingQuality=x,T.drawImage.apply(T,[t].concat(o(I.map((function(t){return Math.floor(dt(t))}))))),T.restore(),B}var Ht=String.fromCharCode;var Wt=/^data:.*,/;function Pt(t){var i,e=new DataView(t);try{var r,n,a;if(255===e.getUint8(0)&&216===e.getUint8(1))for(var o=e.byteLength,s=2;s+1<o;){if(255===e.getUint8(s)&&225===e.getUint8(s+1)){n=s;break}s+=1}if(n){var h=n+10;if("Exif"===function(t,i,e){var r="";e+=i;for(var n=i;n<e;n+=1)r+=Ht(t.getUint8(n));return r}(e,n+4,4)){var c=e.getUint16(h);if(((r=18761===c)||19789===c)&&42===e.getUint16(h+2,r)){var p=e.getUint32(h+4,r);p>=8&&(a=h+p)}}}if(a){var u,l,f=e.getUint16(a,r);for(l=0;l<f;l+=1)if(274===e.getUint16(u=a+12*l+2,r)){i=e.getUint16(u+=8,r),e.setUint16(u,1,r);break}}}catch(t){i=1}return i}var It={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,i=this.options,e=this.container,r=this.cropper,n=Number(i.minContainerWidth),a=Number(i.minContainerHeight);mt(r,O),gt(t,O);var o={width:Math.max(e.offsetWidth,n>=0?n:200),height:Math.max(e.offsetHeight,a>=0?a:100)};this.containerData=o,bt(r,{width:o.width,height:o.height}),mt(t,O),gt(r,O)},initCanvas:function(){var t=this.containerData,i=this.imageData,e=this.options.viewMode,r=Math.abs(i.rotate)%180==90,n=r?i.naturalHeight:i.naturalWidth,a=r?i.naturalWidth:i.naturalHeight,o=n/a,s=t.width,h=t.height;t.height*o>t.width?3===e?s=t.height*o:h=t.width/o:3===e?h=t.width/o:s=t.height*o;var c={aspectRatio:o,naturalWidth:n,naturalHeight:a,width:s,height:h};this.canvasData=c,this.limited=1===e||2===e,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=lt({},c)},limitCanvas:function(t,i){var e=this.options,r=this.containerData,n=this.canvasData,a=this.cropBoxData,o=e.viewMode,s=n.aspectRatio,h=this.cropped&&a;if(t){var c=Number(e.minCanvasWidth)||0,p=Number(e.minCanvasHeight)||0;o>1?(c=Math.max(c,r.width),p=Math.max(p,r.height),3===o&&(p*s>c?c=p*s:p=c/s)):o>0&&(c?c=Math.max(c,h?a.width:0):p?p=Math.max(p,h?a.height:0):h&&((p=a.height)*s>(c=a.width)?c=p*s:p=c/s));var u=St({aspectRatio:s,width:c,height:p});p=u.height,n.minWidth=c=u.width,n.minHeight=p,n.maxWidth=1/0,n.maxHeight=1/0}if(i)if(o>(h?0:1)){var l=r.width-n.width,f=r.height-n.height;n.minLeft=Math.min(0,l),n.minTop=Math.min(0,f),n.maxLeft=Math.max(0,l),n.maxTop=Math.max(0,f),h&&this.limited&&(n.minLeft=Math.min(a.left,a.left+(a.width-n.width)),n.minTop=Math.min(a.top,a.top+(a.height-n.height)),n.maxLeft=a.left,n.maxTop=a.top,2===o&&(n.width>=r.width&&(n.minLeft=Math.min(0,l),n.maxLeft=Math.max(0,l)),n.height>=r.height&&(n.minTop=Math.min(0,f),n.maxTop=Math.max(0,f))))}else n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=r.width,n.maxTop=r.height},renderCanvas:function(t,i){var e=this.canvasData,r=this.imageData;if(i){var n=function(t){var i=t.width,e=t.height,r=t.degree;if(90==(r=Math.abs(r)%180))return{width:e,height:i};var n=r%90*Math.PI/180,a=Math.sin(n),o=Math.cos(n),s=i*o+e*a,h=i*a+e*o;return r>90?{width:h,height:s}:{width:s,height:h}}({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),a=n.width,o=n.height,s=e.width*(a/e.naturalWidth),h=e.height*(o/e.naturalHeight);e.left-=(s-e.width)/2,e.top-=(h-e.height)/2,e.width=s,e.height=h,e.aspectRatio=a/o,e.naturalWidth=a,e.naturalHeight=o,this.limitCanvas(!0,!1)}(e.width>e.maxWidth||e.width<e.minWidth)&&(e.left=e.oldLeft),(e.height>e.maxHeight||e.height<e.minHeight)&&(e.top=e.oldTop),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),this.limitCanvas(!1,!0),e.left=Math.min(Math.max(e.left,e.minLeft),e.maxLeft),e.top=Math.min(Math.max(e.top,e.minTop),e.maxTop),e.oldLeft=e.left,e.oldTop=e.top,bt(this.canvas,lt({width:e.width,height:e.height},Et({translateX:e.left,translateY:e.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var i=this.canvasData,e=this.imageData,r=e.naturalWidth*(i.width/i.naturalWidth),n=e.naturalHeight*(i.height/i.naturalHeight);lt(e,{width:r,height:n,left:(i.width-r)/2,top:(i.height-n)/2}),bt(this.image,lt({width:e.width,height:e.height},Et(lt({translateX:e.left,translateY:e.top},e)))),t&&this.output()},initCropBox:function(){var t=this.options,i=this.canvasData,e=t.aspectRatio||t.initialAspectRatio,r=Number(t.autoCropArea)||.8,n={width:i.width,height:i.height};e&&(i.height*e>i.width?n.height=n.width/e:n.width=n.height*e),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*r),n.height=Math.max(n.minHeight,n.height*r),n.left=i.left+(i.width-n.width)/2,n.top=i.top+(i.height-n.height)/2,n.oldLeft=n.left,n.oldTop=n.top,this.initialCropBoxData=lt({},n)},limitCropBox:function(t,i){var e=this.options,r=this.containerData,n=this.canvasData,a=this.cropBoxData,o=this.limited,s=e.aspectRatio;if(t){var h=Number(e.minCropBoxWidth)||0,c=Number(e.minCropBoxHeight)||0,p=o?Math.min(r.width,n.width,n.width+n.left,r.width-n.left):r.width,u=o?Math.min(r.height,n.height,n.height+n.top,r.height-n.top):r.height;h=Math.min(h,r.width),c=Math.min(c,r.height),s&&(h&&c?c*s>h?c=h/s:h=c*s:h?c=h/s:c&&(h=c*s),u*s>p?u=p/s:p=u*s),a.minWidth=Math.min(h,p),a.minHeight=Math.min(c,u),a.maxWidth=p,a.maxHeight=u}i&&(o?(a.minLeft=Math.max(0,n.left),a.minTop=Math.max(0,n.top),a.maxLeft=Math.min(r.width,n.left+n.width)-a.width,a.maxTop=Math.min(r.height,n.top+n.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=r.width-a.width,a.maxTop=r.height-a.height))},renderCropBox:function(){var t=this.options,i=this.containerData,e=this.cropBoxData;(e.width>e.maxWidth||e.width<e.minWidth)&&(e.left=e.oldLeft),(e.height>e.maxHeight||e.height<e.minHeight)&&(e.top=e.oldTop),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),this.limitCropBox(!1,!0),e.left=Math.min(Math.max(e.left,e.minLeft),e.maxLeft),e.top=Math.min(Math.max(e.top,e.minTop),e.maxTop),e.oldLeft=e.left,e.oldTop=e.top,t.movable&&t.cropBoxMovable&&At(this.face,T,e.width>=i.width&&e.height>=i.height?v:f),bt(this.cropBox,lt({width:e.width,height:e.height},Et({translateX:e.left,translateY:e.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Nt(this.element,Y,this.getData())}},Ft={initPreview:function(){var t=this.element,i=this.crossOrigin,e=this.options.preview,r=i?this.crossOriginUrl:this.url,n=t.alt||"The image to preview",a=document.createElement("img");if(i&&(a.crossOrigin=i),a.src=r,a.alt=n,this.viewBox.appendChild(a),this.viewBoxImage=a,e){var o=e;"string"==typeof e?o=t.ownerDocument.querySelectorAll(e):e.querySelector&&(o=[e]),this.previews=o,ut(o,(function(t){var e=document.createElement("img");At(t,D,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),i&&(e.crossOrigin=i),e.src=r,e.alt=n,e.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(e)}))}},resetPreview:function(){ut(this.previews,(function(t){var i=xt(t,D);bt(t,{width:i.width,height:i.height}),t.innerHTML=i.html,function(t,i){if(at(t[i]))try{delete t[i]}catch(e){t[i]=void 0}else if(t.dataset)try{delete t.dataset[i]}catch(e){t.dataset[i]=void 0}else t.removeAttribute("data-".concat(yt(i)))}(t,D)}))},preview:function(){var t=this.imageData,i=this.canvasData,e=this.cropBoxData,r=e.width,n=e.height,a=t.width,o=t.height,s=e.left-i.left-t.left,h=e.top-i.top-t.top;this.cropped&&!this.disabled&&(bt(this.viewBoxImage,lt({width:a,height:o},Et(lt({translateX:-s,translateY:-h},t)))),ut(this.previews,(function(i){var e=xt(i,D),c=e.width,p=e.height,u=c,l=p,f=1;r&&(l=n*(f=c/r)),n&&l>p&&(u=r*(f=p/n),l=p),bt(i,{width:u,height:l}),bt(i.getElementsByTagName("img")[0],lt({width:a*f,height:o*f},Et(lt({translateX:-s*f,translateY:-h*f},t))))})))}},Ut={bind:function(){var t=this.element,i=this.options,e=this.cropper;ht(i.cropstart)&&Ot(t,P,i.cropstart),ht(i.cropmove)&&Ot(t,W,i.cropmove),ht(i.cropend)&&Ot(t,H,i.cropend),ht(i.crop)&&Ot(t,Y,i.crop),ht(i.zoom)&&Ot(t,V,i.zoom),Ot(e,F,this.onCropStart=this.cropStart.bind(this)),i.zoomable&&i.zoomOnWheel&&Ot(e,Q,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&Ot(e,I,this.onDblclick=this.dblclick.bind(this)),Ot(t.ownerDocument,U,this.onCropMove=this.cropMove.bind(this)),Ot(t.ownerDocument,Z,this.onCropEnd=this.cropEnd.bind(this)),i.responsive&&Ot(window,G,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,i=this.options,e=this.cropper;ht(i.cropstart)&&jt(t,P,i.cropstart),ht(i.cropmove)&&jt(t,W,i.cropmove),ht(i.cropend)&&jt(t,H,i.cropend),ht(i.crop)&&jt(t,Y,i.crop),ht(i.zoom)&&jt(t,V,i.zoom),jt(e,F,this.onCropStart),i.zoomable&&i.zoomOnWheel&&jt(e,Q,this.onWheel,{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&jt(e,I,this.onDblclick),jt(t.ownerDocument,U,this.onCropMove),jt(t.ownerDocument,Z,this.onCropEnd),i.responsive&&jt(window,G,this.onResize)}},Zt={resize:function(){if(!this.disabled){var t,i,e=this.options,r=this.container,n=this.containerData,a=r.offsetWidth/n.width,o=r.offsetHeight/n.height,s=Math.abs(a-1)>Math.abs(o-1)?a:o;1!==s&&(e.restore&&(t=this.getCanvasData(),i=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(ut(t,(function(i,e){t[e]=i*s}))),this.setCropBoxData(ut(i,(function(t,e){i[e]=t*s})))))}},dblclick:function(){var t,i;this.disabled||this.options.dragMode===S||this.setDragMode((i=C,((t=this.dragBox).classList?t.classList.contains(i):t.className.indexOf(i)>-1)?X:E))},wheel:function(t){var i=this,e=Number(this.options.wheelZoomRatio)||.1,r=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){i.wheeling=!1}),50),t.deltaY?r=t.deltaY>0?1:-1:t.wheelDelta?r=-t.wheelDelta/120:t.detail&&(r=t.detail>0?1:-1),this.zoom(-r*e,t)))},cropStart:function(t){var i=t.buttons,e=t.button;if(!(this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(et(i)&&1!==i||et(e)&&0!==e||t.ctrlKey))){var r,n=this.options,a=this.pointers;t.changedTouches?ut(t.changedTouches,(function(t){a[t.identifier]=Xt(t)})):a[t.pointerId||0]=Xt(t),r=Object.keys(a).length>1&&n.zoomable&&n.zoomOnTouch?b:xt(t.target,T),J.test(r)&&!1!==Nt(this.element,P,{originalEvent:t,action:r})&&(t.preventDefault(),this.action=r,this.cropping=!1,r===d&&(this.cropping=!0,mt(this.dragBox,R)))}},cropMove:function(t){var i=this.action;if(!this.disabled&&i){var e=this.pointers;t.preventDefault(),!1!==Nt(this.element,W,{originalEvent:t,action:i})&&(t.changedTouches?ut(t.changedTouches,(function(t){lt(e[t.identifier]||{},Xt(t,!0))})):lt(e[t.pointerId||0]||{},Xt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var i=this.action,e=this.pointers;t.changedTouches?ut(t.changedTouches,(function(t){delete e[t.identifier]})):delete e[t.pointerId||0],i&&(t.preventDefault(),Object.keys(e).length||(this.action=""),this.cropping&&(this.cropping=!1,wt(this.dragBox,R,this.cropped&&this.options.modal)),Nt(this.element,H,{originalEvent:t,action:i}))}}},$t={change:function(t){var e,r=this.canvasData,n=this.containerData,a=this.cropBoxData,o=this.pointers,s=this.action,h=this.options.aspectRatio,c=a.left,p=a.top,u=a.width,l=a.height,C=c+u,j=p+l,N=0,z=0,R=n.width,B=n.height,T=!0;!h&&t.shiftKey&&(h=u&&l?u/l:1),this.limited&&(z=a.minTop,R=(N=a.minLeft)+Math.min(n.width,r.width,r.left+r.width),B=z+Math.min(n.height,r.height,r.top+r.height));var D=o[Object.keys(o)[0]],E={x:D.endX-D.startX,y:D.endY-D.startY},X=function(t){switch(t){case m:C+E.x>R&&(E.x=R-C);break;case g:c+E.x<N&&(E.x=N-c);break;case M:p+E.y<z&&(E.y=z-p);break;case w:j+E.y>B&&(E.y=B-j)}};switch(s){case f:c+=E.x,p+=E.y;break;case m:if(E.x>=0&&(C>=R||h&&(p<=z||j>=B))){T=!1;break}X(m),(u+=E.x)<0&&(s=g,c-=u=-u),h&&(p+=(a.height-(l=u/h))/2);break;case M:if(E.y<=0&&(p<=z||h&&(c<=N||C>=R))){T=!1;break}X(M),p+=E.y,(l-=E.y)<0&&(s=w,p-=l=-l),h&&(c+=(a.width-(u=l*h))/2);break;case g:if(E.x<=0&&(c<=N||h&&(p<=z||j>=B))){T=!1;break}X(g),c+=E.x,(u-=E.x)<0&&(s=m,c-=u=-u),h&&(p+=(a.height-(l=u/h))/2);break;case w:if(E.y>=0&&(j>=B||h&&(c<=N||C>=R))){T=!1;break}X(w),(l+=E.y)<0&&(s=M,p-=l=-l),h&&(c+=(a.width-(u=l*h))/2);break;case y:if(h){if(E.y<=0&&(p<=z||C>=R)){T=!1;break}X(M),p+=E.y,u=(l-=E.y)*h}else X(M),X(m),E.x>=0?C<R?u+=E.x:E.y<=0&&p<=z&&(T=!1):u+=E.x,E.y<=0?p>z&&(l-=E.y,p+=E.y):(l-=E.y,p+=E.y);u<0&&l<0?(s=k,p-=l=-l,c-=u=-u):u<0?(s=x,c-=u=-u):l<0&&(s=A,p-=l=-l);break;case x:if(h){if(E.y<=0&&(p<=z||c<=N)){T=!1;break}X(M),p+=E.y,c+=a.width-(u=(l-=E.y)*h)}else X(M),X(g),E.x<=0?c>N?(u-=E.x,c+=E.x):E.y<=0&&p<=z&&(T=!1):(u-=E.x,c+=E.x),E.y<=0?p>z&&(l-=E.y,p+=E.y):(l-=E.y,p+=E.y);u<0&&l<0?(s=A,p-=l=-l,c-=u=-u):u<0?(s=y,c-=u=-u):l<0&&(s=k,p-=l=-l);break;case k:if(h){if(E.x<=0&&(c<=N||j>=B)){T=!1;break}X(g),c+=E.x,l=(u-=E.x)/h}else X(w),X(g),E.x<=0?c>N?(u-=E.x,c+=E.x):E.y>=0&&j>=B&&(T=!1):(u-=E.x,c+=E.x),E.y>=0?j<B&&(l+=E.y):l+=E.y;u<0&&l<0?(s=y,p-=l=-l,c-=u=-u):u<0?(s=A,c-=u=-u):l<0&&(s=x,p-=l=-l);break;case A:if(h){if(E.x>=0&&(C>=R||j>=B)){T=!1;break}X(m),l=(u+=E.x)/h}else X(w),X(m),E.x>=0?C<R?u+=E.x:E.y>=0&&j>=B&&(T=!1):u+=E.x,E.y>=0?j<B&&(l+=E.y):l+=E.y;u<0&&l<0?(s=x,p-=l=-l,c-=u=-u):u<0?(s=k,c-=u=-u):l<0&&(s=y,p-=l=-l);break;case v:this.move(E.x,E.y),T=!1;break;case b:this.zoom(function(t){var e=i({},t),r=0;return ut(t,(function(t,i){delete e[i],ut(e,(function(i){var e=Math.abs(t.startX-i.startX),n=Math.abs(t.startY-i.startY),a=Math.abs(t.endX-i.endX),o=Math.abs(t.endY-i.endY),s=Math.sqrt(e*e+n*n),h=(Math.sqrt(a*a+o*o)-s)/s;Math.abs(h)>Math.abs(r)&&(r=h)}))})),r}(o),t),T=!1;break;case d:if(!E.x||!E.y){T=!1;break}e=zt(this.cropper),c=D.startX-e.left,p=D.startY-e.top,u=a.minWidth,l=a.minHeight,E.x>0?s=E.y>0?A:y:E.x<0&&(c-=u,s=E.y>0?k:x),E.y<0&&(p-=l),this.cropped||(gt(this.cropBox,O),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}T&&(a.width=u,a.height=l,a.left=c,a.top=p,this.action=s,this.renderCropBox()),ut(o,(function(t){t.startX=t.endX,t.startY=t.endY}))}},Gt={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&mt(this.dragBox,R),gt(this.cropBox,O),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=lt({},this.initialImageData),this.canvasData=lt({},this.initialCanvasData),this.cropBoxData=lt({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(lt(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),gt(this.dragBox,R),mt(this.cropBox,O)),this},replace:function(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&t&&(this.isImg&&(this.element.src=t),i?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,ut(this.previews,(function(i){i.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,gt(this.cropper,j)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,mt(this.cropper,j)),this},destroy:function(){var t=this.element;return t.cropper?(t.cropper=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,e=this.canvasData,r=e.left,n=e.top;return this.moveTo(nt(t)?t:r+Number(t),nt(i)?i:n+Number(i))},moveTo:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,e=this.canvasData,r=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.movable&&(et(t)&&(e.left=t,r=!0),et(i)&&(e.top=i,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(t,i){var e=this.canvasData;return t=Number(t),this.zoomTo(e.width*(t=t<0?1/(1-t):1+t)/e.naturalWidth,null,i)},zoomTo:function(t,i,e){var r=this.options,n=this.canvasData,a=n.width,o=n.height,s=n.naturalWidth,h=n.naturalHeight;if((t=Number(t))>=0&&this.ready&&!this.disabled&&r.zoomable){var c=s*t,p=h*t;if(!1===Nt(this.element,V,{ratio:t,oldRatio:a/s,originalEvent:e}))return this;if(e){var u=this.pointers,l=zt(this.cropper),f=u&&Object.keys(u).length?function(t){var i=0,e=0,r=0;return ut(t,(function(t){i+=t.startX,e+=t.startY,r+=1})),{pageX:i/=r,pageY:e/=r}}(u):{pageX:e.pageX,pageY:e.pageY};n.left-=(f.pageX-l.left-n.left)/a*(c-a),n.top-=(f.pageY-l.top-n.top)/o*(p-o)}else st(i)&&et(i.x)&&et(i.y)?(n.left-=(i.x-n.left)/a*(c-a),n.top-=(i.y-n.top)/o*(p-o)):(n.left-=(c-a)/2,n.top-=(p-o)/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 et(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var i=this.imageData.scaleY;return this.scale(t,et(i)?i:1)},scaleY:function(t){var i=this.imageData.scaleX;return this.scale(et(i)?i:1,t)},scale:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,e=this.imageData,r=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.scalable&&(et(t)&&(e.scaleX=t,r=!0),et(i)&&(e.scaleY=i,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var t,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.options,r=this.imageData,n=this.canvasData,a=this.cropBoxData;if(this.ready&&this.cropped){var o=r.width/r.naturalWidth;if(ut(t={x:a.left-n.left,y:a.top-n.top,width:a.width,height:a.height},(function(i,e){t[e]=i/o})),i){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 e.rotatable&&(t.rotate=r.rotate||0),e.scalable&&(t.scaleX=r.scaleX||1,t.scaleY=r.scaleY||1),t},setData:function(t){var i=this.options,e=this.imageData,r=this.canvasData,n={};if(this.ready&&!this.disabled&&st(t)){var a=!1;i.rotatable&&et(t.rotate)&&t.rotate!==e.rotate&&(e.rotate=t.rotate,a=!0),i.scalable&&(et(t.scaleX)&&t.scaleX!==e.scaleX&&(e.scaleX=t.scaleX,a=!0),et(t.scaleY)&&t.scaleY!==e.scaleY&&(e.scaleY=t.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var o=e.width/e.naturalWidth;et(t.x)&&(n.left=t.x*o+r.left),et(t.y)&&(n.top=t.y*o+r.top),et(t.width)&&(n.width=t.width*o),et(t.height)&&(n.height=t.height*o),this.setCropBoxData(n)}return this},getContainerData:function(){return this.ready?lt({},this.containerData):{}},getImageData:function(){return this.sized?lt({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,i={};return this.ready&&ut(["left","top","width","height","naturalWidth","naturalHeight"],(function(e){i[e]=t[e]})),i},setCanvasData:function(t){var i=this.canvasData,e=i.aspectRatio;return this.ready&&!this.disabled&&st(t)&&(et(t.left)&&(i.left=t.left),et(t.top)&&(i.top=t.top),et(t.width)?(i.width=t.width,i.height=t.width/e):et(t.height)&&(i.height=t.height,i.width=t.height*e),this.renderCanvas(!0)),this},getCropBoxData:function(){var t,i=this.cropBoxData;return this.ready&&this.cropped&&(t={left:i.left,top:i.top,width:i.width,height:i.height}),t||{}},setCropBoxData:function(t){var i,e,r=this.cropBoxData,n=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&st(t)&&(et(t.left)&&(r.left=t.left),et(t.top)&&(r.top=t.top),et(t.width)&&t.width!==r.width&&(i=!0,r.width=t.width),et(t.height)&&t.height!==r.height&&(e=!0,r.height=t.height),n&&(i?r.height=r.width/n:e&&(r.width=r.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 i=this.canvasData,e=Yt(this.image,this.imageData,i,t);if(!this.cropped)return e;var r=this.getData(),n=r.x,a=r.y,s=r.width,h=r.height,c=e.width/Math.floor(i.naturalWidth);1!==c&&(n*=c,a*=c,s*=c,h*=c);var p=s/h,u=St({aspectRatio:p,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),l=St({aspectRatio:p,width:t.minWidth||0,height:t.minHeight||0},"cover"),f=St({aspectRatio:p,width:t.width||(1!==c?e.width:s),height:t.height||(1!==c?e.height:h)}),d=f.width,v=f.height;d=Math.min(u.width,Math.max(l.width,d)),v=Math.min(u.height,Math.max(l.height,v));var b=document.createElement("canvas"),m=b.getContext("2d");b.width=dt(d),b.height=dt(v),m.fillStyle=t.fillColor||"transparent",m.fillRect(0,0,d,v);var g=t.imageSmoothingEnabled,w=t.imageSmoothingQuality;m.imageSmoothingEnabled=void 0===g||g,w&&(m.imageSmoothingQuality=w);var M,y,x,A,k,C,j=e.width,O=e.height,N=n,z=a;N<=-s||N>j?(N=0,M=0,x=0,k=0):N<=0?(x=-N,N=0,k=M=Math.min(j,s+N)):N<=j&&(x=0,k=M=Math.min(s,j-N)),M<=0||z<=-h||z>O?(z=0,y=0,A=0,C=0):z<=0?(A=-z,z=0,C=y=Math.min(O,h+z)):z<=O&&(A=0,C=y=Math.min(h,O-z));var R=[N,z,M,y];if(k>0&&C>0){var B=d/s;R.push(x*B,A*B,k*B,C*B)}return m.drawImage.apply(m,[e].concat(o(R.map((function(t){return Math.floor(dt(t))}))))),b},setAspectRatio:function(t){var i=this.options;return this.disabled||nt(t)||(i.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var i=this.options,e=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var n=t===E,a=i.movable&&t===X;i.dragMode=t=n||a?t:S,At(e,T,t),wt(e,C,n),wt(e,B,a),i.cropBoxMovable||(At(r,T,t),wt(r,C,n),wt(r,B,a))}return this}},Qt=c.Cropper,Vt=function(){function t(i){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r(this,t),!i||!_.test(i.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=i,this.options=lt({},tt,st(e)&&e),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 i=t,a=[{key:"noConflict",value:function(){return window.Cropper=Qt,t}},{key:"setDefaults",value:function(t){lt(tt,st(t)&&t)}}],(e=[{key:"init",value:function(){var t,i=this.element,e=i.tagName.toLowerCase();if(!i.cropper){if(i.cropper=this,"img"===e){if(this.isImg=!0,t=i.getAttribute("src")||"",this.originalUrl=t,!t)return;t=i.src}else"canvas"===e&&window.HTMLCanvasElement&&(t=i.toDataURL());this.load(t)}}},{key:"load",value:function(t){var i,e,r,n,a=this;if(t){this.url=t,this.imageData={};var o=this.element,s=this.options;if(s.rotatable||s.scalable||(s.checkOrientation=!1),s.checkOrientation&&window.ArrayBuffer)if(K.test(t))q.test(t)?this.read((i=t.replace(Wt,""),e=atob(i),r=new ArrayBuffer(e.length),ut(n=new Uint8Array(r),(function(t,i){n[i]=e.charCodeAt(i)})),r)):this.clone();else{var h=new XMLHttpRequest,c=this.clone.bind(this);this.reloading=!0,this.xhr=h,h.onabort=c,h.onerror=c,h.ontimeout=c,h.onprogress=function(){h.getResponseHeader("content-type")!==L&&h.abort()},h.onload=function(){a.read(h.response)},h.onloadend=function(){a.reloading=!1,a.xhr=null},s.checkCrossOrigin&&Tt(t)&&o.crossOrigin&&(t=Dt(t)),h.open("GET",t,!0),h.responseType="arraybuffer",h.withCredentials="use-credentials"===o.crossOrigin,h.send()}else this.clone()}}},{key:"read",value:function(t){var i=this.options,e=this.imageData,r=Pt(t),n=0,a=1,o=1;if(r>1){this.url=function(t,i){for(var e=[],r=new Uint8Array(t);r.length>0;)e.push(Ht.apply(null,pt(r.subarray(0,8192)))),r=r.subarray(8192);return"data:".concat(i,";base64,").concat(btoa(e.join("")))}(t,L);var s=function(t){var i=0,e=1,r=1;switch(t){case 2:e=-1;break;case 3:i=-180;break;case 4:r=-1;break;case 5:i=90,r=-1;break;case 6:i=90;break;case 7:i=90,e=-1;break;case 8:i=-90}return{rotate:i,scaleX:e,scaleY:r}}(r);n=s.rotate,a=s.scaleX,o=s.scaleY}i.rotatable&&(e.rotate=n),i.scalable&&(e.scaleX=a,e.scaleY=o),this.clone()}},{key:"clone",value:function(){var t=this.element,i=this.url,e=t.crossOrigin,r=i;this.options.checkCrossOrigin&&Tt(i)&&(e||(e="anonymous"),r=Dt(i)),this.crossOrigin=e,this.crossOriginUrl=r;var n=document.createElement("img");e&&(n.crossOrigin=e),n.src=r||i,n.alt=t.alt||"The image to crop",this.image=n,n.onload=this.start.bind(this),n.onerror=this.stop.bind(this),mt(n,N),t.parentNode.insertBefore(n,t.nextSibling)}},{key:"start",value:function(){var t=this,i=this.image;i.onload=null,i.onerror=null,this.sizing=!0;var e=c.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(c.navigator.userAgent),r=function(i,e){lt(t.imageData,{naturalWidth:i,naturalHeight:e,aspectRatio:i/e}),t.initialImageData=lt({},t.imageData),t.sizing=!1,t.sized=!0,t.build()};if(!i.naturalWidth||e){var n=document.createElement("img"),a=document.body||document.documentElement;this.sizingImage=n,n.onload=function(){r(n.width,n.height),e||a.removeChild(n)},n.src=i.src,e||(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;",a.appendChild(n))}else r(i.naturalWidth,i.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,i=this.options,e=this.image,r=t.parentNode,n=document.createElement("div");n.innerHTML='<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>';var a=n.querySelector(".".concat(l,"-container")),o=a.querySelector(".".concat(l,"-canvas")),s=a.querySelector(".".concat(l,"-drag-box")),h=a.querySelector(".".concat(l,"-crop-box")),c=h.querySelector(".".concat(l,"-face"));this.container=r,this.cropper=a,this.canvas=o,this.dragBox=s,this.cropBox=h,this.viewBox=a.querySelector(".".concat(l,"-view-box")),this.face=c,o.appendChild(e),mt(t,O),r.insertBefore(a,t.nextSibling),gt(e,N),this.initPreview(),this.bind(),i.initialAspectRatio=Math.max(0,i.initialAspectRatio)||NaN,i.aspectRatio=Math.max(0,i.aspectRatio)||NaN,i.viewMode=Math.max(0,Math.min(3,Math.round(i.viewMode)))||0,mt(h,O),i.guides||mt(h.getElementsByClassName("".concat(l,"-dashed")),O),i.center||mt(h.getElementsByClassName("".concat(l,"-center")),O),i.background&&mt(a,"".concat(l,"-bg")),i.highlight||mt(c,z),i.cropBoxMovable&&(mt(c,B),At(c,T,f)),i.cropBoxResizable||(mt(h.getElementsByClassName("".concat(l,"-line")),O),mt(h.getElementsByClassName("".concat(l,"-point")),O)),this.render(),this.ready=!0,this.setDragMode(i.dragMode),i.autoCrop&&this.crop(),this.setData(i.data),ht(i.ready)&&Ot(t,$,i.ready,{once:!0}),Nt(t,$)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var t=this.cropper.parentNode;t&&t.removeChild(this.cropper),gt(this.element,O)}}},{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()}}])&&n(i.prototype,e),a&&n(i,a),Object.defineProperty(i,"prototype",{writable:!1}),t;var i,e,a}();return lt(Vt.prototype,It,Ft,Ut,Zt,$t,Gt),Vt}()}));const o=class{constructor(i){t(this,i),this.src=void 0,this.aspectRatio=1}async setAspectRatio(t){this.aspectRatio=t}async reset(){return this.cropper.reset()}async getCroppedCanvas(t){return this.cropper.getCroppedCanvas(t)}async getImageData(t="image/png",i=1){return(await this.getCroppedCanvas({fillColor:"#ffffff"})).toDataURL(t,i)}async replace(t,i=!1){return this.src=t,this.cropper.replace(t,i)}componentDidLoad(){(null==i?void 0:i.isBrowser)&&setTimeout((()=>{this.cropper=new a(this.imgEl,{aspectRatio:this.aspectRatio})}),300)}render(){return e("div",null,e("img",{src:this.src,ref:t=>this.imgEl=t}))}};o.style='floodteam-photo-cropper{position:relative;display:block}floodteam-photo-cropper img{display:block;max-width:100%}/*!\n * Cropper.js v1.5.12\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2021-06-12T08:00:11.623Z\n */.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none !important;max-width:none !important;min-height:0 !important;min-width:0 !important;width:100%}.cropper-wrap-box,.cropper-canvas,.cropper-drag-box,.cropper-crop-box,.cropper-modal{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-wrap-box,.cropper-canvas{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:0.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51, 153, 255, 0.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:0.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:calc(100% / 3);left:0;top:calc(100% / 3);width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:calc(100% / 3);top:0;width:calc(100% / 3)}.cropper-center{display:block;height:0;left:50%;opacity:0.75;position:absolute;top:50%;width:0}.cropper-center::before,.cropper-center::after{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center::before{height:1px;left:-3px;top:0;width:7px}.cropper-center::after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:0.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:0.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width: 768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width: 992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width: 1200px){.cropper-point.point-se{height:5px;opacity:0.75;width:5px}}.cropper-point.point-se::before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none !important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}';export{o as floodteam_photo_cropper}