Language fix

This commit is contained in:
Tony Air 2019-06-01 00:56:48 +07:00
parent aad4bc32ed
commit e3e69b1da4
5 changed files with 8 additions and 8 deletions

2
dist/app.js vendored
View File

@ -8,5 +8,5 @@
*
* Date: 2019-03-10T09:55:53.729Z
*/
t.exports=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})(e)}function e(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 i(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var a="undefined"!=typeof window,n=a?window:{},o=!!a&&"ontouchstart"in n.document.documentElement,r=!!a&&"PointerEvent"in n,s="".concat("cropper","-crop"),h="".concat("cropper","-disabled"),c="".concat("cropper","-hidden"),p="".concat("cropper","-hide"),l="".concat("cropper","-invisible"),d="".concat("cropper","-modal"),u="".concat("cropper","-move"),m="".concat("cropper","Action"),g="".concat("cropper","Preview"),f=o?"touchstart":"mousedown",v=o?"touchmove":"mousemove",w=o?"touchend touchcancel":"mouseup",b=r?"pointerdown":f,y=r?"pointermove":v,x=r?"pointerup pointercancel":w,M=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,D=/^data:image\/jpeg;base64,/,C=/^img|canvas$/i,k={viewMode:0,dragMode:"crop",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},E=Number.isNaN||n.isNaN;function T(t){return"number"==typeof t&&!E(t)}var O=function(t){return t>0&&t<1/0};function B(t){return void 0===t}function L(e){return"object"===t(e)&&null!==e}var R=Object.prototype.hasOwnProperty;function N(t){if(!L(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&R.call(i,"isPrototypeOf")}catch(t){return!1}}function I(t){return"function"==typeof t}var _=Array.prototype.slice;function j(t){return Array.from?Array.from(t):_.call(t)}function A(t,e){return t&&I(e)&&(Array.isArray(t)||T(t.length)?j(t).forEach(function(i,a){e.call(t,i,a,t)}):L(t)&&Object.keys(t).forEach(function(i){e.call(t,t[i],i,t)})),t}var S=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 L(t)&&i.length>0&&i.forEach(function(e){L(e)&&Object.keys(e).forEach(function(i){t[i]=e[i]})}),t},W=/\.\d*(?:0|9){12}\d*$/;function z(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return W.test(t)?Math.round(t*e)/e:t}var H=/^width|height|left|top|marginLeft|marginTop$/;function $(t,e){var i=t.style;A(e,function(t,e){H.test(e)&&T(t)&&(t="".concat(t,"px")),i[e]=t})}function X(t,e){if(e)if(T(t.length))A(t,function(t){X(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 Y(t,e){e&&(T(t.length)?A(t,function(t){Y(t,e)}):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function U(t,e,i){e&&(T(t.length)?A(t,function(t){U(t,e,i)}):i?X(t,e):Y(t,e))}var P=/([a-z\d])([A-Z])/g;function F(t){return t.replace(P,"$1-$2").toLowerCase()}function q(t,e){return L(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(F(e)))}function Q(t,e,i){L(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(F(e)),i)}var J=/\s\s*/,V=function(){var t=!1;if(a){var e=!1,i=function(){},o=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});n.addEventListener("test",i,o),n.removeEventListener("test",i,o)}return t}();function G(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;e.trim().split(J).forEach(function(e){if(!V){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 Z(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;e.trim().split(J).forEach(function(e){if(a.once&&!V){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 K(t,e,i){var a;return I(Event)&&I(CustomEvent)?a=new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(a)}function tt(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var et=n.location,it=/^(\w+:)\/\/([^:\/?#]*):?(\d*)/i;function at(t){var e=t.match(it);return null!==e&&(e[1]!==et.protocol||e[2]!==et.hostname||e[3]!==et.port)}function nt(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function ot(t){var e=t.rotate,i=t.scaleX,a=t.scaleY,n=t.translateX,o=t.translateY,r=[];T(n)&&0!==n&&r.push("translateX(".concat(n,"px)")),T(o)&&0!==o&&r.push("translateY(".concat(o,"px)")),T(e)&&0!==e&&r.push("rotate(".concat(e,"deg)")),T(i)&&1!==i&&r.push("scaleX(".concat(i,")")),T(a)&&1!==a&&r.push("scaleY(".concat(a,")"));var s=r.length?r.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function rt(t,e){var i=t.pageX,a=t.pageY,n={endX:i,endY:a};return e?n:S({startX:i,startY:a},n)}function st(t){var e=t.aspectRatio,i=t.height,a=t.width,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",o=O(a),r=O(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}}var ht=String.fromCharCode,ct=/^data:.*,/;function pt(t){var e,i=new DataView(t);try{var a,n,o;if(255===i.getUint8(0)&&216===i.getUint8(1))for(var r=i.byteLength,s=2;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"===function(t,e,i){var a="";i+=e;for(var n=e;n<i;n+=1)a+=ht(t.getUint8(n));return a}(i,h,4)){var p=i.getUint16(c);if(((a=18761===p)||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(t){e=1}return e}var lt={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;X(a,c),Y(t,c);var n={width:Math.max(i.offsetWidth,Number(e.minContainerWidth)||200),height:Math.max(i.offsetHeight,Number(e.minContainerHeight)||100)};this.containerData=n,$(a,{width:n.width,height:n.height}),X(t,c),Y(a,c)},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=S({},e),this.initialCanvasData=S({},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)*s>c?c=p*s:p=c/s));var l=st({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=function(t){var e=t.width,i=t.height,a=t.degree;if(90==(a=Math.abs(a)%180))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}}({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,$(this.canvas,S({width:i.width,height:i.height},ot({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);S(i,{width:a,height:n,left:(e.width-a)/2,top:(e.height-n)/2}),$(this.image,S({width:i.width,height:i.height},ot(S({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=S({},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&&Q(this.face,m,i.width>=e.width&&i.height>=e.height?"move":"all"),$(this.cropBox,S({width:i.width,height:i.height},ot({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),K(this.element,"crop",this.getData())}},dt={initPreview:function(){var t=this.crossOrigin,e=this.options.preview,i=t?this.crossOriginUrl:this.url,a=document.createElement("img");if(t&&(a.crossOrigin=t),a.src=i,this.viewBox.appendChild(a),this.viewBoxImage=a,e){var n=e;"string"==typeof e?n=this.element.ownerDocument.querySelectorAll(e):e.querySelector&&(n=[e]),this.previews=n,A(n,function(e){var a=document.createElement("img");Q(e,g,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(a.crossOrigin=t),a.src=i,a.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;"',e.innerHTML="",e.appendChild(a)})}},resetPreview:function(){A(this.previews,function(t){var e=q(t,g);$(t,{width:e.width,height:e.height}),t.innerHTML=e.html,function(t,e){if(L(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(F(e)))}(t,g)})},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&&($(this.viewBoxImage,S({width:o,height:r},ot(S({translateX:-s,translateY:-h},t)))),A(this.previews,function(e){var i=q(e,g),c=i.width,p=i.height,l=c,d=p,u=1;a&&(d=n*(u=c/a)),n&&d>p&&(l=a*(u=p/n),d=p),$(e,{width:l,height:d}),$(e.getElementsByTagName("img")[0],S({width:o*u,height:r*u},ot(S({translateX:-s*u,translateY:-h*u},t))))}))}},ut={bind:function(){var t=this.element,e=this.options,i=this.cropper;I(e.cropstart)&&Z(t,"cropstart",e.cropstart),I(e.cropmove)&&Z(t,"cropmove",e.cropmove),I(e.cropend)&&Z(t,"cropend",e.cropend),I(e.crop)&&Z(t,"crop",e.crop),I(e.zoom)&&Z(t,"zoom",e.zoom),Z(i,b,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&Z(i,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Z(i,"dblclick",this.onDblclick=this.dblclick.bind(this)),Z(t.ownerDocument,y,this.onCropMove=this.cropMove.bind(this)),Z(t.ownerDocument,x,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&Z(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,i=this.cropper;I(e.cropstart)&&G(t,"cropstart",e.cropstart),I(e.cropmove)&&G(t,"cropmove",e.cropmove),I(e.cropend)&&G(t,"cropend",e.cropend),I(e.crop)&&G(t,"crop",e.crop),I(e.zoom)&&G(t,"zoom",e.zoom),G(i,b,this.onCropStart),e.zoomable&&e.zoomOnWheel&&G(i,"wheel",this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&G(i,"dblclick",this.onDblclick),G(t.ownerDocument,y,this.onCropMove),G(t.ownerDocument,x,this.onCropEnd),e.responsive&&G(window,"resize",this.onResize)}},mt={resize:function(){var t=this.options,e=this.container,i=this.containerData,a=Number(t.minContainerWidth)||200,n=Number(t.minContainerHeight)||100;if(!(this.disabled||i.width<=a||i.height<=n)){var o,r,s=e.offsetWidth/i.width;1===s&&e.offsetHeight===i.height||(t.restore&&(o=this.getCanvasData(),r=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(A(o,function(t,e){o[e]=t*s})),this.setCropBoxData(A(r,function(t,e){r[e]=t*s}))))}},dblclick:function(){var t,e;this.disabled||"none"===this.options.dragMode||this.setDragMode((t=this.dragBox,e=s,(t.classList?t.classList.contains(e):t.className.indexOf(e)>-1)?"move":"crop"))},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||T(e)&&1!==e||T(i)&&0!==i||t.ctrlKey)){var a,n=this.options,o=this.pointers;t.changedTouches?A(t.changedTouches,function(t){o[t.identifier]=rt(t)}):o[t.pointerId||0]=rt(t),a=Object.keys(o).length>1&&n.zoomable&&n.zoomOnTouch?"zoom":q(t.target,m),M.test(a)&&!1!==K(this.element,"cropstart",{originalEvent:t,action:a})&&(t.preventDefault(),this.action=a,this.cropping=!1,"crop"===a&&(this.cropping=!0,X(this.dragBox,d)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var i=this.pointers;t.preventDefault(),!1!==K(this.element,"cropmove",{originalEvent:t,action:e})&&(t.changedTouches?A(t.changedTouches,function(t){S(i[t.identifier]||{},rt(t,!0))}):S(i[t.pointerId||0]||{},rt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,i=this.pointers;t.changedTouches?A(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,U(this.dragBox,d,this.cropped&&this.options.modal)),K(this.element,"cropend",{originalEvent:t,action:e}))}}},gt={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,p=o.left,l=o.top,d=o.width,u=o.height,m=p+d,g=l+u,f=0,v=0,w=n.width,b=n.height,y=!0;!h&&t.shiftKey&&(h=d&&u?d/u:1),this.limited&&(f=o.minLeft,v=o.minTop,w=f+Math.min(n.width,a.width,a.left+a.width),b=v+Math.min(n.height,a.height,a.top+a.height));var x=r[Object.keys(r)[0]],M={x:x.endX-x.startX,y:x.endY-x.startY},D=function(t){switch(t){case"e":m+M.x>w&&(M.x=w-m);break;case"w":p+M.x<f&&(M.x=f-p);break;case"n":l+M.y<v&&(M.y=v-l);break;case"s":g+M.y>b&&(M.y=b-g)}};switch(s){case"all":p+=M.x,l+=M.y;break;case"e":if(M.x>=0&&(m>=w||h&&(l<=v||g>=b))){y=!1;break}D("e"),(d+=M.x)<0&&(s="w",p-=d=-d),h&&(u=d/h,l+=(o.height-u)/2);break;case"n":if(M.y<=0&&(l<=v||h&&(p<=f||m>=w))){y=!1;break}D("n"),u-=M.y,l+=M.y,u<0&&(s="s",l-=u=-u),h&&(d=u*h,p+=(o.width-d)/2);break;case"w":if(M.x<=0&&(p<=f||h&&(l<=v||g>=b))){y=!1;break}D("w"),d-=M.x,p+=M.x,d<0&&(s="e",p-=d=-d),h&&(u=d/h,l+=(o.height-u)/2);break;case"s":if(M.y>=0&&(g>=b||h&&(p<=f||m>=w))){y=!1;break}D("s"),(u+=M.y)<0&&(s="n",l-=u=-u),h&&(d=u*h,p+=(o.width-d)/2);break;case"ne":if(h){if(M.y<=0&&(l<=v||m>=w)){y=!1;break}D("n"),u-=M.y,l+=M.y,d=u*h}else D("n"),D("e"),M.x>=0?m<w?d+=M.x:M.y<=0&&l<=v&&(y=!1):d+=M.x,M.y<=0?l>v&&(u-=M.y,l+=M.y):(u-=M.y,l+=M.y);d<0&&u<0?(s="sw",l-=u=-u,p-=d=-d):d<0?(s="nw",p-=d=-d):u<0&&(s="se",l-=u=-u);break;case"nw":if(h){if(M.y<=0&&(l<=v||p<=f)){y=!1;break}D("n"),u-=M.y,l+=M.y,d=u*h,p+=o.width-d}else D("n"),D("w"),M.x<=0?p>f?(d-=M.x,p+=M.x):M.y<=0&&l<=v&&(y=!1):(d-=M.x,p+=M.x),M.y<=0?l>v&&(u-=M.y,l+=M.y):(u-=M.y,l+=M.y);d<0&&u<0?(s="se",l-=u=-u,p-=d=-d):d<0?(s="ne",p-=d=-d):u<0&&(s="sw",l-=u=-u);break;case"sw":if(h){if(M.x<=0&&(p<=f||g>=b)){y=!1;break}D("w"),d-=M.x,p+=M.x,u=d/h}else D("s"),D("w"),M.x<=0?p>f?(d-=M.x,p+=M.x):M.y>=0&&g>=b&&(y=!1):(d-=M.x,p+=M.x),M.y>=0?g<b&&(u+=M.y):u+=M.y;d<0&&u<0?(s="ne",l-=u=-u,p-=d=-d):d<0?(s="se",p-=d=-d):u<0&&(s="nw",l-=u=-u);break;case"se":if(h){if(M.x>=0&&(m>=w||g>=b)){y=!1;break}D("e"),d+=M.x,u=d/h}else D("s"),D("e"),M.x>=0?m<w?d+=M.x:M.y>=0&&g>=b&&(y=!1):d+=M.x,M.y>=0?g<b&&(u+=M.y):u+=M.y;d<0&&u<0?(s="nw",l-=u=-u,p-=d=-d):d<0?(s="sw",p-=d=-d):u<0&&(s="ne",l-=u=-u);break;case"move":this.move(M.x,M.y),y=!1;break;case"zoom":this.zoom(function(t){var e=S({},t),i=[];return A(t,function(t,a){delete e[a],A(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)-s)/s;i.push(h)})}),i.sort(function(t,e){return Math.abs(t)<Math.abs(e)}),i[0]}(r),t),y=!1;break;case"crop":if(!M.x||!M.y){y=!1;break}e=tt(this.cropper),p=x.startX-e.left,l=x.startY-e.top,d=o.minWidth,u=o.minHeight,M.x>0?s=M.y>0?"se":"ne":M.x<0&&(p-=d,s=M.y>0?"sw":"nw"),M.y<0&&(l-=u),this.cropped||(Y(this.cropBox,c),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}y&&(o.width=d,o.height=u,o.left=p,o.top=l,this.action=s,this.renderCropBox()),A(r,function(t){t.startX=t.endX,t.startY=t.endY})}},ft={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&X(this.dragBox,d),Y(this.cropBox,c),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=S({},this.initialImageData),this.canvasData=S({},this.initialCanvasData),this.cropBoxData=S({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(S(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Y(this.dragBox,d),X(this.cropBox,c)),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,A(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,Y(this.cropper,h)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,X(this.cropper,h)),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 e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,a=i.left,n=i.top;return this.moveTo(B(t)?t:a+Number(t),B(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&&(T(t)&&(i.left=t,a=!0),T(e)&&(i.top=e,a=!0),a&&this.renderCanvas(!0)),this},zoom:function(t,e){var i=this.canvasData;return t=(t=Number(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))>=0&&this.ready&&!this.disabled&&a.zoomable){var c=s*t,p=h*t;if(!1===K(this.element,"zoom",{ratio:t,oldRatio:o/s,originalEvent:i}))return this;if(i){var l=this.pointers,d=tt(this.cropper),u=l&&Object.keys(l).length?function(t){var e=0,i=0,a=0;return A(t,function(t){var n=t.startX,o=t.startY;e+=n,i+=o,a+=1}),{pageX:e/=a,pageY:i/=a}}(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 N(e)&&T(e.x)&&T(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(t=Number(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,T(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(T(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&&(T(t)&&(i.scaleX=t,a=!0),T(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(A(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&&N(t)){var o=!1;e.rotatable&&T(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,o=!0),e.scalable&&(T(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,o=!0),T(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var r=i.width/i.naturalWidth;T(t.x)&&(n.left=t.x*r+a.left),T(t.y)&&(n.top=t.y*r+a.top),T(t.width)&&(n.width=t.width*r),T(t.height)&&(n.height=t.height*r),this.setCropBoxData(n)}return this},getContainerData:function(){return this.ready?S({},this.containerData):{}},getImageData:function(){return this.sized?S({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&A(["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&&N(t)&&(T(t.left)&&(e.left=t.left),T(t.top)&&(e.top=t.top),T(t.width)?(e.width=t.width,e.height=t.width/i):T(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&&N(t)&&(T(t.left)&&(a.left=t.left),T(t.top)&&(a.top=t.top),T(t.width)&&t.width!==a.width&&(e=!0,a.width=t.width),T(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,a=function(t,e,a,n){var o=e.aspectRatio,r=e.naturalWidth,s=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=a.aspectRatio,g=a.naturalWidth,f=a.naturalHeight,v=n.fillColor,w=void 0===v?"transparent":v,b=n.imageSmoothingEnabled,y=void 0===b||b,x=n.imageSmoothingQuality,M=void 0===x?"low":x,D=n.maxWidth,C=void 0===D?1/0:D,k=n.maxHeight,E=void 0===k?1/0:k,T=n.minWidth,O=void 0===T?0:T,B=n.minHeight,L=void 0===B?0:B,R=document.createElement("canvas"),N=R.getContext("2d"),I=st({aspectRatio:m,width:C,height:E}),_=st({aspectRatio:m,width:O,height:L},"cover"),j=Math.min(I.width,Math.max(_.width,g)),A=Math.min(I.height,Math.max(_.height,f)),S=st({aspectRatio:o,width:C,height:E}),W=st({aspectRatio:o,width:O,height:L},"cover"),H=Math.min(S.width,Math.max(W.width,r)),$=Math.min(S.height,Math.max(W.height,s)),X=[-H/2,-$/2,H,$];return R.width=z(j),R.height=z(A),N.fillStyle=w,N.fillRect(0,0,j,A),N.save(),N.translate(j/2,A/2),N.rotate(c*Math.PI/180),N.scale(l,u),N.imageSmoothingEnabled=y,N.imageSmoothingQuality=M,N.drawImage.apply(N,[t].concat(i(X.map(function(t){return Math.floor(z(t))})))),N.restore(),R}(this.image,this.imageData,e,t);if(!this.cropped)return a;var n=this.getData(),o=n.x,r=n.y,s=n.width,h=n.height,c=a.width/Math.floor(e.naturalWidth);1!==c&&(o*=c,r*=c,s*=c,h*=c);var p=s/h,l=st({aspectRatio:p,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),d=st({aspectRatio:p,width:t.minWidth||0,height:t.minHeight||0},"cover"),u=st({aspectRatio:p,width:t.width||(1!==c?a.width:s),height:t.height||(1!==c?a.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=z(m),f.height=z(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,M,D,C,k,E,T=a.width,O=a.height,B=o,L=r;B<=-s||B>T?(B=0,x=0,D=0,k=0):B<=0?(D=-B,B=0,x=Math.min(T,s+B),k=x):B<=T&&(D=0,x=Math.min(s,T-B),k=x),x<=0||L<=-h||L>O?(L=0,M=0,C=0,E=0):L<=0?(C=-L,L=0,M=Math.min(O,h+L),E=M):L<=O&&(C=0,M=Math.min(h,O-L),E=M);var R=[B,L,x,M];if(k>0&&E>0){var N=m/s;R.push(D*N,C*N,k*N,E*N)}return v.drawImage.apply(v,[a].concat(i(R.map(function(t){return Math.floor(z(t))})))),f},setAspectRatio:function(t){var e=this.options;return this.disabled||B(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="crop"===t,o=e.movable&&"move"===t;t=n||o?t:"none",e.dragMode=t,Q(i,m,t),U(i,s,n),U(i,u,o),e.cropBoxMovable||(Q(a,m,t),U(a,s,n),U(a,u,o))}return this}},vt=n.Cropper,wt=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e||!C.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=S({},k,N(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 i=t,o=[{key:"noConflict",value:function(){return window.Cropper=vt,t}},{key:"setDefaults",value:function(t){S(k,N(t)&&t)}}],(a=[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e.cropper){if(e.cropper=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(D.test(t))this.read((n=t.replace(ct,""),o=atob(n),r=new ArrayBuffer(o.length),A(s=new Uint8Array(r),function(t,e){s[e]=o.charCodeAt(e)}),r));else{var n,o,r,s,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(){"image/jpeg"!==h.getResponseHeader("content-type")&&h.abort()},h.onload=function(){e.read(h.response)},h.onloadend=function(){e.reloading=!1,e.xhr=null},a.checkCrossOrigin&&at(t)&&i.crossOrigin&&(t=nt(t)),h.open("GET",t),h.responseType="arraybuffer",h.withCredentials="use-credentials"===i.crossOrigin,h.send()}else this.clone()}}},{key:"read",value:function(t){var e=this.options,i=this.imageData,a=pt(t),n=0,o=1,r=1;if(a>1){this.url=function(t,e){for(var i=[],a=new Uint8Array(t);a.length>0;)i.push(ht.apply(null,j(a.subarray(0,8192)))),a=a.subarray(8192);return"data:".concat(e,";base64,").concat(btoa(i.join("")))}(t,"image/jpeg");var s=function(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}return{rotate:e,scaleX:i,scaleY:a}}(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,e,i=this.element,a=this.url;this.options.checkCrossOrigin&&at(a)&&((t=i.crossOrigin)?e=a:(t="anonymous",e=nt(a))),this.crossOrigin=t,this.crossOriginUrl=e;var n=document.createElement("img");t&&(n.crossOrigin=t),n.src=e||a,this.image=n,n.onload=this.start.bind(this),n.onerror=this.stop.bind(this),X(n,p),i.parentNode.insertBefore(n,i.nextSibling)}},{key:"start",value:function(){var t=this,e=this.isImg?this.element:this.image;e.onload=null,e.onerror=null,this.sizing=!0;var i=n.navigator&&/^(?:.(?!chrome|android))*safari/i.test(n.navigator.userAgent),a=function(e,i){S(t.imageData,{naturalWidth:e,naturalHeight:i,aspectRatio:e/i}),t.sizing=!1,t.sized=!0,t.build()};if(!e.naturalWidth||i){var o=document.createElement("img"),r=document.body||document.documentElement;this.sizingImage=o,o.onload=function(){a(o.width,o.height),i||r.removeChild(o)},o.src=e.src,i||(o.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(o))}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='<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 o=n.querySelector(".".concat("cropper","-container")),r=o.querySelector(".".concat("cropper","-canvas")),s=o.querySelector(".".concat("cropper","-drag-box")),h=o.querySelector(".".concat("cropper","-crop-box")),d=h.querySelector(".".concat("cropper","-face"));this.container=a,this.cropper=o,this.canvas=r,this.dragBox=s,this.cropBox=h,this.viewBox=o.querySelector(".".concat("cropper","-view-box")),this.face=d,r.appendChild(i),X(t,c),a.insertBefore(o,t.nextSibling),this.isImg||Y(i,p),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,X(h,c),e.guides||X(h.getElementsByClassName("".concat("cropper","-dashed")),c),e.center||X(h.getElementsByClassName("".concat("cropper","-center")),c),e.background&&X(o,"".concat("cropper","-bg")),e.highlight||X(d,l),e.cropBoxMovable&&(X(d,u),Q(d,m,"all")),e.cropBoxResizable||(X(h.getElementsByClassName("".concat("cropper","-line")),c),X(h.getElementsByClassName("".concat("cropper","-point")),c)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),I(e.ready)&&Z(t,"ready",e.ready,{once:!0}),K(t,"ready")}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),Y(this.element,c))}},{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()}}])&&e(i.prototype,a),o&&e(i,o),t;var i,a,o}();return S(wt.prototype,lt,dt,ut,mt,gt,ft),wt}()},"./node_modules/font-awesome sync \\.(otf|eot|svg|ttf|woff|woff2)$":function(t,e){function i(t){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}i.keys=function(){return[]},i.resolve=i,t.exports=i,i.id="./node_modules/font-awesome sync \\.(otf|eot|svg|ttf|woff|woff2)$"},"./src/_events.js":function(t,e){t.exports={AJAX:"ajax-load",LOADED:"load",SET_TARGET_UPDATE:"set-target-update",RESTORE_FIELD:"restore-field",FORM_INIT_BASICS:"form-basics",FORM_INIT_STEPPED:"form-init-stepped",FORM_INIT_VALIDATE:"form-init-validate",FORM_INIT_VALIDATE_FIELD:"form-init-validate-field",FORM_INIT_STORAGE:"form-init-storage",FORM_VALIDATION_FAILED:"form-validation-failed",FORM_STEPPED_NEW_STEP:"form-new-step",FORM_STEPPED_FIRST_STEP:"form-first-step",FORM_STEPPED_LAST_STEP:"form-last-step"}},"./src/app.js":function(t,e,i){"use strict";i.r(e);i("./src/app.scss");var a=i("./src/_events.js"),n=i.n(a),o=i("jquery"),r=i.n(o),s=function(){function t(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)}}return function(e,i,a){return i&&t(e.prototype,i),a&&t(e,a),e}}();var h=function(t){return function(){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e)}return s(e,null,[{key:"show",value:function(e){t("#PageLoading").show(0,e)}},{key:"hide",value:function(e){t("#PageLoading").hide("slow",e)}}]),e}()}(r.a),c=i("./node_modules/cropperjs/dist/cropper.js"),p=i.n(c),l=function(){function t(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)}}return function(e,i,a){return i&&t(e.prototype,i),a&&t(e,a),e}}();!function(t){var e="jsCroppieUI",i=e,a=window,o=(document,{aspectRatio:16/9}),r=function(){function a(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),s.call(this),console.log("Initializing: "+e);var r=this;r._element=n,r.$el=t(r._element),r.$form=r.$el.parents("form"),r.$input=r.$el.find('input[type="file"]'),r.$el.prepend('<img src="" alt="" class="cropping-image" />'),r.$image=r.$el.find("img.cropping-image"),r.original_image=r.$image[0],r.mask_img=!1,r.name=r.$input.attr("name"),r.width=r.$input.data("width"),r.height=r.$input.data("height"),r.options=o,r.cropper=!1,r.$el.data(i,r),r.$el.prepend('<div class="remove-masks"></div>'),r.$removeBtns=r.$el.find(".remove-masks"),r.masks=[],r.$input.on("change",function(t){var e=t.currentTarget.files;e&&e.length&&r.loadFile(e[0])}),r.$el.append('<a href="/" class="btn act-crop">Обрезать</a>'),r.$el.find(".act-crop").on("click",function(t){if(!r.cropper)return!0;t.preventDefault();var i=r.cropper.getCroppedCanvas({width:r.width,height:r.height});r.$image[0].src=i.toDataURL(),r.original_image=new Image,r.original_image.src=i.toDataURL(),r.cropper.destroy(),r.cropper=!1,r.$el.removeClass(e+"-cropping"),r.$el.addClass(e+"-cropped")}),r.$el.find(".masks .mask-item").on("click",function(e){e.preventDefault(),r.setMask(t(e.currentTarget))}),r.$form.on("submit",function(t){if(!r.cropper)return!0;h.show(),r.saveImage();var e=r.cropper.getCroppedCanvas({width:r.width,height:r.height});r.$image[0].src=e.toDataURL(),e.toBlob(function(t){r.uploadFile(t)}),t.preventDefault()})}return l(a,null,[{key:"dispose",value:function(){console.log("Destroying: "+e)}},{key:"_jQueryInterface",value:function(){return this.each(function(e,n){var o=t(n),r=o.data(i);r||(r=new a(n),o.data(i,r))})}}]),a}(),s=function(){var i=this;this.setMask=function(t){var e=i;e.mask_img&&e.addMask(e.getMask()),e.cropper&&(e.cropper.destroy(),e.cropper=!1,e.saveImage()),e.mask_img=new Image,e.mask_img.src=t.data("src"),e.mask_img.onload=function(){var i=e.mask_img;e.cropper=new p.a(e.$image[0],{aspectRatio:i.width/i.height,viewMode:0,guides:!0,center:!0,highlight:!0,cropBoxMovable:!0,cropBoxResizable:!0,movable:!1,rotatable:!1,zoomable:!1,ready:function(){e.$el.find(".cropper-face").css({"background-color":"transparent","background-image":"url("+e.mask_img.src+")",opacity:"0.8"}),e.$el.find(".cropper-face").data("current-mask",t)}})}},this.addMask=function(e){var a=i,n=Date.now();a.masks[n]=e;var o=t('<a class="remove-mask" href="#" data-id="'+n+'">Удалить #'+n+"</a>");return a.$el.find(".masks").append(o),o.on("click",function(e){e.preventDefault();var i=t(e.currentTarget).data("id");a.removeMask(i)}),n},this.removeMask=function(t){var e=i;delete e.masks[t],e.$el.find('.masks [data-id="'+t+'"]').remove(),e.mask_img=!1,e.$el.find(".cropper-face").data("current-mask").click()},this.getMask=function(){var t=i,e=document.createElement("canvas"),a=e.getContext("2d"),n=t.cropper,o=n.getData().width,r=n.getData().height,s=n.getData().y,h=n.getData().x;n.getImageData().left,n.getImageData().top,n.getImageData().aspectRatio;return e.width=t.width,e.height=t.height,a.imageSmoothingEnabled=!0,{img:t.mask_img,left:h,top:s,width:o,height:r}},this.saveImage=function(){var t=i,e=document.createElement("canvas"),a=e.getContext("2d");for(var n in e.width=t.width,e.height=t.height,a.imageSmoothingEnabled=!0,a.drawImage(t.original_image,0,0,t.width,t.height),t.masks){var o=t.masks[n];console.log(o),a.drawImage(o.img,o.left,o.top,o.width,o.height)}return t.$image[0].src=e.toDataURL(),e},this.loadFile=function(t){var a=i;/^image\/\w+/.test(t.type)?(a.$image[0].src=URL.createObjectURL(t),a.cropper&&a.cropper.destroy(),a.cropper=new p.a(a.$image[0],a.options),a.$input[0].value=null,a.$el.addClass(e+"-cropping")):window.alert("Please choose an image file.")},this.uploadFile=function(e){console.log("Initializing uploading sequence!");var o=i,r=new FormData(o.$form[0]);r.delete("BackURL"),r.delete(o.name),r.append(o.name,e,o.name+"-image.png"),r.append("ajax","1"),t.ajax({url:o.$form.attr("action"),data:r,processData:!1,contentType:!1,type:o.$form.attr("method"),success:function(e){console.log("UPLOAD SUCCESS!"),h.hide(),t(a).trigger(n.a.AJAX)}})}};t.fn[e]=r._jQueryInterface,t.fn[e].Constructor=r,t.fn[e].noConflict=function(){return t.fn[e]=JQUERY_NO_CONFLICT,r._jQueryInterface},t(window).on(n.a.AJAX+" "+n.a.LOADED,function(){t(".field.croppie").jsCroppieUI()})}(r.a);var d=function(){function t(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)}}return function(e,i,a){return i&&t(e.prototype,i),a&&t(e,a),e}}();function u(t){return t.keys().map(t)}u(i("./src/img sync \\.(png|jpe?g|svg)$")),u(i("./node_modules/font-awesome sync \\.(otf|eot|svg|ttf|woff|woff2)$"));var m=function(t){var e=window,i=(document,t("body"),function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return d(t,null,[{key:"init",value:function(){this.dispose(),console.log("Initializing: LayoutUI")}},{key:"dispose",value:function(){console.log("Destroying: LayoutUI")}}]),t}());return t(e).on(n.a.AJAX+" "+n.a.LOADED,function(){i.init()}),e.LayoutUI=i,i}($);e.default=m},"./src/app.scss":function(t,e){},"./src/img sync \\.(png|jpe?g|svg)$":function(t,e,i){var a={"./bg.png":"./src/img/bg.png","./photo1.png":"./src/img/photo1.png","./photo2.jpg":"./src/img/photo2.jpg","./photo3.svg":"./src/img/photo3.svg"};function n(t){var e=o(t);return i(e)}function o(t){if(!i.o(a,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return a[t]}n.keys=function(){return Object.keys(a)},n.resolve=o,t.exports=n,n.id="./src/img sync \\.(png|jpe?g|svg)$"},"./src/img/bg.png":function(t,e){t.exports="../img/bg.png"},"./src/img/photo1.png":function(t,e){t.exports="../img/photo1.png"},"./src/img/photo2.jpg":function(t,e){t.exports="../img/photo2.jpg"},"./src/img/photo3.svg":function(t,e){t.exports="../fonts/photo3.svg"},jquery:function(t,e){t.exports=jQuery}});
t.exports=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})(e)}function e(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 i(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var a="undefined"!=typeof window,n=a?window:{},o=!!a&&"ontouchstart"in n.document.documentElement,r=!!a&&"PointerEvent"in n,s="".concat("cropper","-crop"),h="".concat("cropper","-disabled"),c="".concat("cropper","-hidden"),p="".concat("cropper","-hide"),l="".concat("cropper","-invisible"),d="".concat("cropper","-modal"),u="".concat("cropper","-move"),m="".concat("cropper","Action"),g="".concat("cropper","Preview"),f=o?"touchstart":"mousedown",v=o?"touchmove":"mousemove",w=o?"touchend touchcancel":"mouseup",b=r?"pointerdown":f,y=r?"pointermove":v,x=r?"pointerup pointercancel":w,M=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,D=/^data:image\/jpeg;base64,/,C=/^img|canvas$/i,k={viewMode:0,dragMode:"crop",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},E=Number.isNaN||n.isNaN;function T(t){return"number"==typeof t&&!E(t)}var O=function(t){return t>0&&t<1/0};function B(t){return void 0===t}function L(e){return"object"===t(e)&&null!==e}var R=Object.prototype.hasOwnProperty;function N(t){if(!L(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&R.call(i,"isPrototypeOf")}catch(t){return!1}}function I(t){return"function"==typeof t}var _=Array.prototype.slice;function j(t){return Array.from?Array.from(t):_.call(t)}function A(t,e){return t&&I(e)&&(Array.isArray(t)||T(t.length)?j(t).forEach(function(i,a){e.call(t,i,a,t)}):L(t)&&Object.keys(t).forEach(function(i){e.call(t,t[i],i,t)})),t}var S=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 L(t)&&i.length>0&&i.forEach(function(e){L(e)&&Object.keys(e).forEach(function(i){t[i]=e[i]})}),t},W=/\.\d*(?:0|9){12}\d*$/;function z(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return W.test(t)?Math.round(t*e)/e:t}var H=/^width|height|left|top|marginLeft|marginTop$/;function $(t,e){var i=t.style;A(e,function(t,e){H.test(e)&&T(t)&&(t="".concat(t,"px")),i[e]=t})}function X(t,e){if(e)if(T(t.length))A(t,function(t){X(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 Y(t,e){e&&(T(t.length)?A(t,function(t){Y(t,e)}):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function U(t,e,i){e&&(T(t.length)?A(t,function(t){U(t,e,i)}):i?X(t,e):Y(t,e))}var P=/([a-z\d])([A-Z])/g;function F(t){return t.replace(P,"$1-$2").toLowerCase()}function q(t,e){return L(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(F(e)))}function Q(t,e,i){L(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(F(e)),i)}var J=/\s\s*/,V=function(){var t=!1;if(a){var e=!1,i=function(){},o=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});n.addEventListener("test",i,o),n.removeEventListener("test",i,o)}return t}();function G(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;e.trim().split(J).forEach(function(e){if(!V){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 Z(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;e.trim().split(J).forEach(function(e){if(a.once&&!V){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 K(t,e,i){var a;return I(Event)&&I(CustomEvent)?a=new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(a)}function tt(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var et=n.location,it=/^(\w+:)\/\/([^:\/?#]*):?(\d*)/i;function at(t){var e=t.match(it);return null!==e&&(e[1]!==et.protocol||e[2]!==et.hostname||e[3]!==et.port)}function nt(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function ot(t){var e=t.rotate,i=t.scaleX,a=t.scaleY,n=t.translateX,o=t.translateY,r=[];T(n)&&0!==n&&r.push("translateX(".concat(n,"px)")),T(o)&&0!==o&&r.push("translateY(".concat(o,"px)")),T(e)&&0!==e&&r.push("rotate(".concat(e,"deg)")),T(i)&&1!==i&&r.push("scaleX(".concat(i,")")),T(a)&&1!==a&&r.push("scaleY(".concat(a,")"));var s=r.length?r.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function rt(t,e){var i=t.pageX,a=t.pageY,n={endX:i,endY:a};return e?n:S({startX:i,startY:a},n)}function st(t){var e=t.aspectRatio,i=t.height,a=t.width,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",o=O(a),r=O(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}}var ht=String.fromCharCode,ct=/^data:.*,/;function pt(t){var e,i=new DataView(t);try{var a,n,o;if(255===i.getUint8(0)&&216===i.getUint8(1))for(var r=i.byteLength,s=2;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"===function(t,e,i){var a="";i+=e;for(var n=e;n<i;n+=1)a+=ht(t.getUint8(n));return a}(i,h,4)){var p=i.getUint16(c);if(((a=18761===p)||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(t){e=1}return e}var lt={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;X(a,c),Y(t,c);var n={width:Math.max(i.offsetWidth,Number(e.minContainerWidth)||200),height:Math.max(i.offsetHeight,Number(e.minContainerHeight)||100)};this.containerData=n,$(a,{width:n.width,height:n.height}),X(t,c),Y(a,c)},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=S({},e),this.initialCanvasData=S({},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)*s>c?c=p*s:p=c/s));var l=st({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=function(t){var e=t.width,i=t.height,a=t.degree;if(90==(a=Math.abs(a)%180))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}}({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,$(this.canvas,S({width:i.width,height:i.height},ot({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);S(i,{width:a,height:n,left:(e.width-a)/2,top:(e.height-n)/2}),$(this.image,S({width:i.width,height:i.height},ot(S({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=S({},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&&Q(this.face,m,i.width>=e.width&&i.height>=e.height?"move":"all"),$(this.cropBox,S({width:i.width,height:i.height},ot({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),K(this.element,"crop",this.getData())}},dt={initPreview:function(){var t=this.crossOrigin,e=this.options.preview,i=t?this.crossOriginUrl:this.url,a=document.createElement("img");if(t&&(a.crossOrigin=t),a.src=i,this.viewBox.appendChild(a),this.viewBoxImage=a,e){var n=e;"string"==typeof e?n=this.element.ownerDocument.querySelectorAll(e):e.querySelector&&(n=[e]),this.previews=n,A(n,function(e){var a=document.createElement("img");Q(e,g,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(a.crossOrigin=t),a.src=i,a.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;"',e.innerHTML="",e.appendChild(a)})}},resetPreview:function(){A(this.previews,function(t){var e=q(t,g);$(t,{width:e.width,height:e.height}),t.innerHTML=e.html,function(t,e){if(L(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(F(e)))}(t,g)})},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&&($(this.viewBoxImage,S({width:o,height:r},ot(S({translateX:-s,translateY:-h},t)))),A(this.previews,function(e){var i=q(e,g),c=i.width,p=i.height,l=c,d=p,u=1;a&&(d=n*(u=c/a)),n&&d>p&&(l=a*(u=p/n),d=p),$(e,{width:l,height:d}),$(e.getElementsByTagName("img")[0],S({width:o*u,height:r*u},ot(S({translateX:-s*u,translateY:-h*u},t))))}))}},ut={bind:function(){var t=this.element,e=this.options,i=this.cropper;I(e.cropstart)&&Z(t,"cropstart",e.cropstart),I(e.cropmove)&&Z(t,"cropmove",e.cropmove),I(e.cropend)&&Z(t,"cropend",e.cropend),I(e.crop)&&Z(t,"crop",e.crop),I(e.zoom)&&Z(t,"zoom",e.zoom),Z(i,b,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&Z(i,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Z(i,"dblclick",this.onDblclick=this.dblclick.bind(this)),Z(t.ownerDocument,y,this.onCropMove=this.cropMove.bind(this)),Z(t.ownerDocument,x,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&Z(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,i=this.cropper;I(e.cropstart)&&G(t,"cropstart",e.cropstart),I(e.cropmove)&&G(t,"cropmove",e.cropmove),I(e.cropend)&&G(t,"cropend",e.cropend),I(e.crop)&&G(t,"crop",e.crop),I(e.zoom)&&G(t,"zoom",e.zoom),G(i,b,this.onCropStart),e.zoomable&&e.zoomOnWheel&&G(i,"wheel",this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&G(i,"dblclick",this.onDblclick),G(t.ownerDocument,y,this.onCropMove),G(t.ownerDocument,x,this.onCropEnd),e.responsive&&G(window,"resize",this.onResize)}},mt={resize:function(){var t=this.options,e=this.container,i=this.containerData,a=Number(t.minContainerWidth)||200,n=Number(t.minContainerHeight)||100;if(!(this.disabled||i.width<=a||i.height<=n)){var o,r,s=e.offsetWidth/i.width;1===s&&e.offsetHeight===i.height||(t.restore&&(o=this.getCanvasData(),r=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(A(o,function(t,e){o[e]=t*s})),this.setCropBoxData(A(r,function(t,e){r[e]=t*s}))))}},dblclick:function(){var t,e;this.disabled||"none"===this.options.dragMode||this.setDragMode((t=this.dragBox,e=s,(t.classList?t.classList.contains(e):t.className.indexOf(e)>-1)?"move":"crop"))},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||T(e)&&1!==e||T(i)&&0!==i||t.ctrlKey)){var a,n=this.options,o=this.pointers;t.changedTouches?A(t.changedTouches,function(t){o[t.identifier]=rt(t)}):o[t.pointerId||0]=rt(t),a=Object.keys(o).length>1&&n.zoomable&&n.zoomOnTouch?"zoom":q(t.target,m),M.test(a)&&!1!==K(this.element,"cropstart",{originalEvent:t,action:a})&&(t.preventDefault(),this.action=a,this.cropping=!1,"crop"===a&&(this.cropping=!0,X(this.dragBox,d)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var i=this.pointers;t.preventDefault(),!1!==K(this.element,"cropmove",{originalEvent:t,action:e})&&(t.changedTouches?A(t.changedTouches,function(t){S(i[t.identifier]||{},rt(t,!0))}):S(i[t.pointerId||0]||{},rt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,i=this.pointers;t.changedTouches?A(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,U(this.dragBox,d,this.cropped&&this.options.modal)),K(this.element,"cropend",{originalEvent:t,action:e}))}}},gt={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,p=o.left,l=o.top,d=o.width,u=o.height,m=p+d,g=l+u,f=0,v=0,w=n.width,b=n.height,y=!0;!h&&t.shiftKey&&(h=d&&u?d/u:1),this.limited&&(f=o.minLeft,v=o.minTop,w=f+Math.min(n.width,a.width,a.left+a.width),b=v+Math.min(n.height,a.height,a.top+a.height));var x=r[Object.keys(r)[0]],M={x:x.endX-x.startX,y:x.endY-x.startY},D=function(t){switch(t){case"e":m+M.x>w&&(M.x=w-m);break;case"w":p+M.x<f&&(M.x=f-p);break;case"n":l+M.y<v&&(M.y=v-l);break;case"s":g+M.y>b&&(M.y=b-g)}};switch(s){case"all":p+=M.x,l+=M.y;break;case"e":if(M.x>=0&&(m>=w||h&&(l<=v||g>=b))){y=!1;break}D("e"),(d+=M.x)<0&&(s="w",p-=d=-d),h&&(u=d/h,l+=(o.height-u)/2);break;case"n":if(M.y<=0&&(l<=v||h&&(p<=f||m>=w))){y=!1;break}D("n"),u-=M.y,l+=M.y,u<0&&(s="s",l-=u=-u),h&&(d=u*h,p+=(o.width-d)/2);break;case"w":if(M.x<=0&&(p<=f||h&&(l<=v||g>=b))){y=!1;break}D("w"),d-=M.x,p+=M.x,d<0&&(s="e",p-=d=-d),h&&(u=d/h,l+=(o.height-u)/2);break;case"s":if(M.y>=0&&(g>=b||h&&(p<=f||m>=w))){y=!1;break}D("s"),(u+=M.y)<0&&(s="n",l-=u=-u),h&&(d=u*h,p+=(o.width-d)/2);break;case"ne":if(h){if(M.y<=0&&(l<=v||m>=w)){y=!1;break}D("n"),u-=M.y,l+=M.y,d=u*h}else D("n"),D("e"),M.x>=0?m<w?d+=M.x:M.y<=0&&l<=v&&(y=!1):d+=M.x,M.y<=0?l>v&&(u-=M.y,l+=M.y):(u-=M.y,l+=M.y);d<0&&u<0?(s="sw",l-=u=-u,p-=d=-d):d<0?(s="nw",p-=d=-d):u<0&&(s="se",l-=u=-u);break;case"nw":if(h){if(M.y<=0&&(l<=v||p<=f)){y=!1;break}D("n"),u-=M.y,l+=M.y,d=u*h,p+=o.width-d}else D("n"),D("w"),M.x<=0?p>f?(d-=M.x,p+=M.x):M.y<=0&&l<=v&&(y=!1):(d-=M.x,p+=M.x),M.y<=0?l>v&&(u-=M.y,l+=M.y):(u-=M.y,l+=M.y);d<0&&u<0?(s="se",l-=u=-u,p-=d=-d):d<0?(s="ne",p-=d=-d):u<0&&(s="sw",l-=u=-u);break;case"sw":if(h){if(M.x<=0&&(p<=f||g>=b)){y=!1;break}D("w"),d-=M.x,p+=M.x,u=d/h}else D("s"),D("w"),M.x<=0?p>f?(d-=M.x,p+=M.x):M.y>=0&&g>=b&&(y=!1):(d-=M.x,p+=M.x),M.y>=0?g<b&&(u+=M.y):u+=M.y;d<0&&u<0?(s="ne",l-=u=-u,p-=d=-d):d<0?(s="se",p-=d=-d):u<0&&(s="nw",l-=u=-u);break;case"se":if(h){if(M.x>=0&&(m>=w||g>=b)){y=!1;break}D("e"),d+=M.x,u=d/h}else D("s"),D("e"),M.x>=0?m<w?d+=M.x:M.y>=0&&g>=b&&(y=!1):d+=M.x,M.y>=0?g<b&&(u+=M.y):u+=M.y;d<0&&u<0?(s="nw",l-=u=-u,p-=d=-d):d<0?(s="sw",p-=d=-d):u<0&&(s="ne",l-=u=-u);break;case"move":this.move(M.x,M.y),y=!1;break;case"zoom":this.zoom(function(t){var e=S({},t),i=[];return A(t,function(t,a){delete e[a],A(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)-s)/s;i.push(h)})}),i.sort(function(t,e){return Math.abs(t)<Math.abs(e)}),i[0]}(r),t),y=!1;break;case"crop":if(!M.x||!M.y){y=!1;break}e=tt(this.cropper),p=x.startX-e.left,l=x.startY-e.top,d=o.minWidth,u=o.minHeight,M.x>0?s=M.y>0?"se":"ne":M.x<0&&(p-=d,s=M.y>0?"sw":"nw"),M.y<0&&(l-=u),this.cropped||(Y(this.cropBox,c),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}y&&(o.width=d,o.height=u,o.left=p,o.top=l,this.action=s,this.renderCropBox()),A(r,function(t){t.startX=t.endX,t.startY=t.endY})}},ft={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&X(this.dragBox,d),Y(this.cropBox,c),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=S({},this.initialImageData),this.canvasData=S({},this.initialCanvasData),this.cropBoxData=S({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(S(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Y(this.dragBox,d),X(this.cropBox,c)),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,A(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,Y(this.cropper,h)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,X(this.cropper,h)),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 e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,a=i.left,n=i.top;return this.moveTo(B(t)?t:a+Number(t),B(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&&(T(t)&&(i.left=t,a=!0),T(e)&&(i.top=e,a=!0),a&&this.renderCanvas(!0)),this},zoom:function(t,e){var i=this.canvasData;return t=(t=Number(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))>=0&&this.ready&&!this.disabled&&a.zoomable){var c=s*t,p=h*t;if(!1===K(this.element,"zoom",{ratio:t,oldRatio:o/s,originalEvent:i}))return this;if(i){var l=this.pointers,d=tt(this.cropper),u=l&&Object.keys(l).length?function(t){var e=0,i=0,a=0;return A(t,function(t){var n=t.startX,o=t.startY;e+=n,i+=o,a+=1}),{pageX:e/=a,pageY:i/=a}}(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 N(e)&&T(e.x)&&T(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(t=Number(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,T(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(T(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&&(T(t)&&(i.scaleX=t,a=!0),T(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(A(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&&N(t)){var o=!1;e.rotatable&&T(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,o=!0),e.scalable&&(T(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,o=!0),T(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var r=i.width/i.naturalWidth;T(t.x)&&(n.left=t.x*r+a.left),T(t.y)&&(n.top=t.y*r+a.top),T(t.width)&&(n.width=t.width*r),T(t.height)&&(n.height=t.height*r),this.setCropBoxData(n)}return this},getContainerData:function(){return this.ready?S({},this.containerData):{}},getImageData:function(){return this.sized?S({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&A(["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&&N(t)&&(T(t.left)&&(e.left=t.left),T(t.top)&&(e.top=t.top),T(t.width)?(e.width=t.width,e.height=t.width/i):T(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&&N(t)&&(T(t.left)&&(a.left=t.left),T(t.top)&&(a.top=t.top),T(t.width)&&t.width!==a.width&&(e=!0,a.width=t.width),T(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,a=function(t,e,a,n){var o=e.aspectRatio,r=e.naturalWidth,s=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=a.aspectRatio,g=a.naturalWidth,f=a.naturalHeight,v=n.fillColor,w=void 0===v?"transparent":v,b=n.imageSmoothingEnabled,y=void 0===b||b,x=n.imageSmoothingQuality,M=void 0===x?"low":x,D=n.maxWidth,C=void 0===D?1/0:D,k=n.maxHeight,E=void 0===k?1/0:k,T=n.minWidth,O=void 0===T?0:T,B=n.minHeight,L=void 0===B?0:B,R=document.createElement("canvas"),N=R.getContext("2d"),I=st({aspectRatio:m,width:C,height:E}),_=st({aspectRatio:m,width:O,height:L},"cover"),j=Math.min(I.width,Math.max(_.width,g)),A=Math.min(I.height,Math.max(_.height,f)),S=st({aspectRatio:o,width:C,height:E}),W=st({aspectRatio:o,width:O,height:L},"cover"),H=Math.min(S.width,Math.max(W.width,r)),$=Math.min(S.height,Math.max(W.height,s)),X=[-H/2,-$/2,H,$];return R.width=z(j),R.height=z(A),N.fillStyle=w,N.fillRect(0,0,j,A),N.save(),N.translate(j/2,A/2),N.rotate(c*Math.PI/180),N.scale(l,u),N.imageSmoothingEnabled=y,N.imageSmoothingQuality=M,N.drawImage.apply(N,[t].concat(i(X.map(function(t){return Math.floor(z(t))})))),N.restore(),R}(this.image,this.imageData,e,t);if(!this.cropped)return a;var n=this.getData(),o=n.x,r=n.y,s=n.width,h=n.height,c=a.width/Math.floor(e.naturalWidth);1!==c&&(o*=c,r*=c,s*=c,h*=c);var p=s/h,l=st({aspectRatio:p,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),d=st({aspectRatio:p,width:t.minWidth||0,height:t.minHeight||0},"cover"),u=st({aspectRatio:p,width:t.width||(1!==c?a.width:s),height:t.height||(1!==c?a.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=z(m),f.height=z(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,M,D,C,k,E,T=a.width,O=a.height,B=o,L=r;B<=-s||B>T?(B=0,x=0,D=0,k=0):B<=0?(D=-B,B=0,x=Math.min(T,s+B),k=x):B<=T&&(D=0,x=Math.min(s,T-B),k=x),x<=0||L<=-h||L>O?(L=0,M=0,C=0,E=0):L<=0?(C=-L,L=0,M=Math.min(O,h+L),E=M):L<=O&&(C=0,M=Math.min(h,O-L),E=M);var R=[B,L,x,M];if(k>0&&E>0){var N=m/s;R.push(D*N,C*N,k*N,E*N)}return v.drawImage.apply(v,[a].concat(i(R.map(function(t){return Math.floor(z(t))})))),f},setAspectRatio:function(t){var e=this.options;return this.disabled||B(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="crop"===t,o=e.movable&&"move"===t;t=n||o?t:"none",e.dragMode=t,Q(i,m,t),U(i,s,n),U(i,u,o),e.cropBoxMovable||(Q(a,m,t),U(a,s,n),U(a,u,o))}return this}},vt=n.Cropper,wt=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e||!C.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=S({},k,N(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 i=t,o=[{key:"noConflict",value:function(){return window.Cropper=vt,t}},{key:"setDefaults",value:function(t){S(k,N(t)&&t)}}],(a=[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e.cropper){if(e.cropper=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(D.test(t))this.read((n=t.replace(ct,""),o=atob(n),r=new ArrayBuffer(o.length),A(s=new Uint8Array(r),function(t,e){s[e]=o.charCodeAt(e)}),r));else{var n,o,r,s,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(){"image/jpeg"!==h.getResponseHeader("content-type")&&h.abort()},h.onload=function(){e.read(h.response)},h.onloadend=function(){e.reloading=!1,e.xhr=null},a.checkCrossOrigin&&at(t)&&i.crossOrigin&&(t=nt(t)),h.open("GET",t),h.responseType="arraybuffer",h.withCredentials="use-credentials"===i.crossOrigin,h.send()}else this.clone()}}},{key:"read",value:function(t){var e=this.options,i=this.imageData,a=pt(t),n=0,o=1,r=1;if(a>1){this.url=function(t,e){for(var i=[],a=new Uint8Array(t);a.length>0;)i.push(ht.apply(null,j(a.subarray(0,8192)))),a=a.subarray(8192);return"data:".concat(e,";base64,").concat(btoa(i.join("")))}(t,"image/jpeg");var s=function(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}return{rotate:e,scaleX:i,scaleY:a}}(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,e,i=this.element,a=this.url;this.options.checkCrossOrigin&&at(a)&&((t=i.crossOrigin)?e=a:(t="anonymous",e=nt(a))),this.crossOrigin=t,this.crossOriginUrl=e;var n=document.createElement("img");t&&(n.crossOrigin=t),n.src=e||a,this.image=n,n.onload=this.start.bind(this),n.onerror=this.stop.bind(this),X(n,p),i.parentNode.insertBefore(n,i.nextSibling)}},{key:"start",value:function(){var t=this,e=this.isImg?this.element:this.image;e.onload=null,e.onerror=null,this.sizing=!0;var i=n.navigator&&/^(?:.(?!chrome|android))*safari/i.test(n.navigator.userAgent),a=function(e,i){S(t.imageData,{naturalWidth:e,naturalHeight:i,aspectRatio:e/i}),t.sizing=!1,t.sized=!0,t.build()};if(!e.naturalWidth||i){var o=document.createElement("img"),r=document.body||document.documentElement;this.sizingImage=o,o.onload=function(){a(o.width,o.height),i||r.removeChild(o)},o.src=e.src,i||(o.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(o))}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='<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 o=n.querySelector(".".concat("cropper","-container")),r=o.querySelector(".".concat("cropper","-canvas")),s=o.querySelector(".".concat("cropper","-drag-box")),h=o.querySelector(".".concat("cropper","-crop-box")),d=h.querySelector(".".concat("cropper","-face"));this.container=a,this.cropper=o,this.canvas=r,this.dragBox=s,this.cropBox=h,this.viewBox=o.querySelector(".".concat("cropper","-view-box")),this.face=d,r.appendChild(i),X(t,c),a.insertBefore(o,t.nextSibling),this.isImg||Y(i,p),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,X(h,c),e.guides||X(h.getElementsByClassName("".concat("cropper","-dashed")),c),e.center||X(h.getElementsByClassName("".concat("cropper","-center")),c),e.background&&X(o,"".concat("cropper","-bg")),e.highlight||X(d,l),e.cropBoxMovable&&(X(d,u),Q(d,m,"all")),e.cropBoxResizable||(X(h.getElementsByClassName("".concat("cropper","-line")),c),X(h.getElementsByClassName("".concat("cropper","-point")),c)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),I(e.ready)&&Z(t,"ready",e.ready,{once:!0}),K(t,"ready")}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),Y(this.element,c))}},{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()}}])&&e(i.prototype,a),o&&e(i,o),t;var i,a,o}();return S(wt.prototype,lt,dt,ut,mt,gt,ft),wt}()},"./node_modules/font-awesome sync \\.(otf|eot|svg|ttf|woff|woff2)$":function(t,e){function i(t){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}i.keys=function(){return[]},i.resolve=i,t.exports=i,i.id="./node_modules/font-awesome sync \\.(otf|eot|svg|ttf|woff|woff2)$"},"./src/_events.js":function(t,e){t.exports={AJAX:"ajax-load",LOADED:"load",SET_TARGET_UPDATE:"set-target-update",RESTORE_FIELD:"restore-field",FORM_INIT_BASICS:"form-basics",FORM_INIT_STEPPED:"form-init-stepped",FORM_INIT_VALIDATE:"form-init-validate",FORM_INIT_VALIDATE_FIELD:"form-init-validate-field",FORM_INIT_STORAGE:"form-init-storage",FORM_VALIDATION_FAILED:"form-validation-failed",FORM_STEPPED_NEW_STEP:"form-new-step",FORM_STEPPED_FIRST_STEP:"form-first-step",FORM_STEPPED_LAST_STEP:"form-last-step"}},"./src/app.js":function(t,e,i){"use strict";i.r(e);i("./src/app.scss");var a=i("./src/_events.js"),n=i.n(a),o=i("jquery"),r=i.n(o),s=function(){function t(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)}}return function(e,i,a){return i&&t(e.prototype,i),a&&t(e,a),e}}();var h=function(t){return function(){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e)}return s(e,null,[{key:"show",value:function(e){t("#PageLoading").show(0,e)}},{key:"hide",value:function(e){t("#PageLoading").hide("slow",e)}}]),e}()}(r.a),c=i("./node_modules/cropperjs/dist/cropper.js"),p=i.n(c),l=function(){function t(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)}}return function(e,i,a){return i&&t(e.prototype,i),a&&t(e,a),e}}();!function(t){var e="jsCroppieUI",i=e,a=window,o=(document,{aspectRatio:16/9}),r=function(){function a(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),s.call(this),console.log("Initializing: "+e);var r=this;r._element=n,r.$el=t(r._element),r.$form=r.$el.parents("form"),r.$input=r.$el.find('input[type="file"]'),r.$el.prepend('<img src="" alt="" class="cropping-image" />'),r.$image=r.$el.find("img.cropping-image"),r.original_image=r.$image[0],r.mask_img=!1,r.name=r.$input.attr("name"),r.width=r.$input.data("width"),r.height=r.$input.data("height"),r.options=o,r.cropper=!1,r.$el.data(i,r),r.$el.prepend('<div class="remove-masks"></div>'),r.$removeBtns=r.$el.find(".remove-masks"),r.masks=[],r.$input.on("change",function(t){var e=t.currentTarget.files;e&&e.length&&r.loadFile(e[0])}),r.$el.append('<a href="/" class="btn act-crop">Crop it</a>'),r.$el.find(".act-crop").on("click",function(t){if(!r.cropper)return!0;t.preventDefault();var i=r.cropper.getCroppedCanvas({width:r.width,height:r.height});r.$image[0].src=i.toDataURL(),r.original_image=new Image,r.original_image.src=i.toDataURL(),r.cropper.destroy(),r.cropper=!1,r.$el.removeClass(e+"-cropping"),r.$el.addClass(e+"-cropped")}),r.$el.find(".masks .mask-item").on("click",function(e){e.preventDefault(),r.setMask(t(e.currentTarget))}),r.$form.on("submit",function(t){if(!r.cropper)return!0;h.show(),r.saveImage();var e=r.cropper.getCroppedCanvas({width:r.width,height:r.height});r.$image[0].src=e.toDataURL(),e.toBlob(function(t){r.uploadFile(t)}),t.preventDefault()})}return l(a,null,[{key:"dispose",value:function(){console.log("Destroying: "+e)}},{key:"_jQueryInterface",value:function(){return this.each(function(e,n){var o=t(n),r=o.data(i);r||(r=new a(n),o.data(i,r))})}}]),a}(),s=function(){var i=this;this.setMask=function(t){var e=i;e.mask_img&&e.addMask(e.getMask()),e.cropper&&(e.cropper.destroy(),e.cropper=!1,e.saveImage()),e.mask_img=new Image,e.mask_img.src=t.data("src"),e.mask_img.onload=function(){var i=e.mask_img;e.cropper=new p.a(e.$image[0],{aspectRatio:i.width/i.height,viewMode:0,guides:!0,center:!0,highlight:!0,cropBoxMovable:!0,cropBoxResizable:!0,movable:!1,rotatable:!1,zoomable:!1,ready:function(){e.$el.find(".cropper-face").css({"background-color":"transparent","background-image":"url("+e.mask_img.src+")",opacity:"0.8"}),e.$el.find(".cropper-face").data("current-mask",t)}})}},this.addMask=function(e){var a=i,n=Date.now();a.masks[n]=e;var o=t('<a class="remove-mask" href="#" data-id="'+n+'">Delete mask #'+n+"</a>");return a.$el.find(".masks").append(o),o.on("click",function(e){e.preventDefault();var i=t(e.currentTarget).data("id");a.removeMask(i)}),n},this.removeMask=function(t){var e=i;delete e.masks[t],e.$el.find('.masks [data-id="'+t+'"]').remove(),e.mask_img=!1,e.$el.find(".cropper-face").data("current-mask").click()},this.getMask=function(){var t=i,e=document.createElement("canvas"),a=e.getContext("2d"),n=t.cropper,o=n.getData().width,r=n.getData().height,s=n.getData().y,h=n.getData().x;n.getImageData().left,n.getImageData().top,n.getImageData().aspectRatio;return e.width=t.width,e.height=t.height,a.imageSmoothingEnabled=!0,{img:t.mask_img,left:h,top:s,width:o,height:r}},this.saveImage=function(){var t=i,e=document.createElement("canvas"),a=e.getContext("2d");for(var n in e.width=t.width,e.height=t.height,a.imageSmoothingEnabled=!0,a.drawImage(t.original_image,0,0,t.width,t.height),t.masks){var o=t.masks[n];console.log(o),a.drawImage(o.img,o.left,o.top,o.width,o.height)}return t.$image[0].src=e.toDataURL(),e},this.loadFile=function(t){var a=i;/^image\/\w+/.test(t.type)?(a.$image[0].src=URL.createObjectURL(t),a.cropper&&a.cropper.destroy(),a.cropper=new p.a(a.$image[0],a.options),a.$input[0].value=null,a.$el.addClass(e+"-cropping")):window.alert("Please choose an image file.")},this.uploadFile=function(e){console.log("Initializing uploading sequence!");var o=i,r=new FormData(o.$form[0]);r.delete("BackURL"),r.delete(o.name),r.append(o.name,e,o.name+"-image.png"),r.append("ajax","1"),t.ajax({url:o.$form.attr("action"),data:r,processData:!1,contentType:!1,type:o.$form.attr("method"),success:function(e){console.log("UPLOAD SUCCESS!"),h.hide(),t(a).trigger(n.a.AJAX)}})}};t.fn[e]=r._jQueryInterface,t.fn[e].Constructor=r,t.fn[e].noConflict=function(){return t.fn[e]=JQUERY_NO_CONFLICT,r._jQueryInterface},t(window).on(n.a.AJAX+" "+n.a.LOADED,function(){t(".field.croppie").jsCroppieUI()})}(r.a);var d=function(){function t(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)}}return function(e,i,a){return i&&t(e.prototype,i),a&&t(e,a),e}}();function u(t){return t.keys().map(t)}u(i("./src/img sync \\.(png|jpe?g|svg)$")),u(i("./node_modules/font-awesome sync \\.(otf|eot|svg|ttf|woff|woff2)$"));var m=function(t){var e=window,i=(document,t("body"),function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return d(t,null,[{key:"init",value:function(){this.dispose(),console.log("Initializing: LayoutUI")}},{key:"dispose",value:function(){console.log("Destroying: LayoutUI")}}]),t}());return t(e).on(n.a.AJAX+" "+n.a.LOADED,function(){i.init()}),e.LayoutUI=i,i}($);e.default=m},"./src/app.scss":function(t,e){},"./src/img sync \\.(png|jpe?g|svg)$":function(t,e,i){var a={"./bg.png":"./src/img/bg.png","./photo1.png":"./src/img/photo1.png","./photo2.jpg":"./src/img/photo2.jpg","./photo3.svg":"./src/img/photo3.svg"};function n(t){var e=o(t);return i(e)}function o(t){if(!i.o(a,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return a[t]}n.keys=function(){return Object.keys(a)},n.resolve=o,t.exports=n,n.id="./src/img sync \\.(png|jpe?g|svg)$"},"./src/img/bg.png":function(t,e){t.exports="../img/bg.png"},"./src/img/photo1.png":function(t,e){t.exports="../img/photo1.png"},"./src/img/photo2.jpg":function(t,e){t.exports="../img/photo2.jpg"},"./src/img/photo3.svg":function(t,e){t.exports="../fonts/photo3.svg"},jquery:function(t,e){t.exports=jQuery}});
//# sourceMappingURL=app.js.map

2
dist/app.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/index.html vendored
View File

@ -1 +1 @@
<!doctype html><html lang="ru-RU"><head><title>JCROP</title><link href="css/main.css" rel="stylesheet"></head><body><noscript><div class="main-bn">Please, enable javascript.</div></noscript><div class="wrapper"><header id="Header" class="container"></header><main id="MainContent"><form action="/index.php" method="post" enctype="multipart/form-data" class="form"><fieldset><div class="field file croppie"><div class="masks"><h2>Ткни чтобы выбрать маску</h2><div class="mask-item" data-src="img/photo1.png"><img src="img/photo1.png" alt="Mask #1"></div><div class="mask-item" data-src="img/photo2.jpg"><img src="img/photo2.jpg" alt="Mask #2"></div></div><label class="left" for="Image">Выбери картинку на компе</label><div class="middle-column"><input type="hidden" name="MAX_FILE_SIZE" value="2097152"> <input name="Image" id="Image" accept=".png,image/png,.bmp,image/bmp,.gif,image/gif,.svg,image/svg+xml,.jpg,image/jpeg,.jpeg" type="file" class="file main-image croppie" data-width="1280" data-height="960"></div><label class="right" for="Image">Обрежет до 1280 x 960 pixels</label></div></fieldset><div class="btn-toolbar"><input type="submit" name="action_doSubmit" value="Submit" class="action btn btn-primary" id="Submit" novalidate="novalidate"></div></form></main></div><footer id="Footer" class="site-footer"></footer><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><script src="app.js"></script></body></html>
<!doctype html><html lang="ru-RU"><head><title>JCROP</title><link href="css/main.css" rel="stylesheet"></head><body><noscript><div class="main-bn">Please, enable javascript.</div></noscript><div class="wrapper"><header id="Header" class="container"></header><main id="MainContent"><form action="/index.php" method="post" enctype="multipart/form-data" class="form"><fieldset><div class="field file croppie"><div class="masks"><h2>Select image mask</h2><div class="mask-item" data-src="img/photo1.png"><img src="img/photo1.png" alt="Mask #1"></div><div class="mask-item" data-src="img/photo2.jpg"><img src="img/photo2.jpg" alt="Mask #2"></div></div><label class="left" for="Image">Select image at your computer</label><div class="middle-column"><input type="hidden" name="MAX_FILE_SIZE" value="2097152"> <input name="Image" id="Image" accept=".png,image/png,.bmp,image/bmp,.gif,image/gif,.svg,image/svg+xml,.jpg,image/jpeg,.jpeg" type="file" class="file main-image croppie" data-width="1280" data-height="960"></div><label class="right" for="Image">Image will be cropped to 1280 x 960 pixels</label></div></fieldset><div class="btn-toolbar"><input type="submit" name="action_doSubmit" value="Submit" class="action btn btn-primary" id="Submit" novalidate="novalidate"></div></form></main></div><footer id="Footer" class="site-footer"></footer><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><script src="app.js"></script></body></html>

View File

@ -58,7 +58,7 @@ const CroppieUI = (($) => {
});
// actions
ui.$el.append('<a href="/" class="btn act-crop">Обрезать</a>');
ui.$el.append('<a href="/" class="btn act-crop">Crop it</a>');
// crop
ui.$el.find('.act-crop').on('click', (e) => {
@ -169,7 +169,7 @@ const CroppieUI = (($) => {
ui.masks[id] = mask;
// draw removable button
let $btn = $('<a class="remove-mask" href="#" data-id="' + id + '">Удалить #' + id + '</a>');
let $btn = $('<a class="remove-mask" href="#" data-id="' + id + '">Delete mask #' + id + '</a>');
ui.$el.find('.masks').append($btn);
/*ui.$removeBtns.prepend($btn);

View File

@ -13,7 +13,7 @@
<fieldset>
<div class="field file croppie">
<div class="masks">
<h2>Ткни чтобы выбрать маску</h2>
<h2>Select image mask</h2>
<div class="mask-item" data-src="img/photo1.png">
<img src="img/photo1.png" alt="Mask #1" />
</div>
@ -21,7 +21,7 @@
<img src="img/photo2.jpg" alt="Mask #2" />
</div>
</div>
<label class="left" for="Image">Выбери картинку на компе</label>
<label class="left" for="Image">Select image at your computer</label>
<div class="middle-column">
<input type="hidden" name="MAX_FILE_SIZE" value="2097152" />
<input
@ -34,7 +34,7 @@
data-height="960"
/>
</div>
<label class="right" for="Image">Обрежет до 1280 x 960 pixels</label>
<label class="right" for="Image">Image will be cropped to 1280 x 960 pixels</label>
</div>
</fieldset>
<div class="btn-toolbar">