Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-advanced-cropper

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-advanced-cropper - npm Package Compare versions

Comparing version 0.16.4 to 0.16.5

4

dist/index.umd.js

@@ -1,2 +0,2 @@

(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):(e=e||self,t(e["vue-advanced-cropper"]={},e.Vue))})(this,function(e,t){'use strict';var F=Math.floor,N=Math.abs,q=Math.max,j=Math.min,G=Math.ceil,Z=String.fromCharCode;function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var o,a=0;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}function n(e,t,i){return t&&a(e.prototype,t),i&&a(e,i),e}function s(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function r(e){for(var t=1;t<arguments.length;t++){var o=null==arguments[t]?{}:arguments[t],a=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),a.forEach(function(t){s(e,t,o[t])})}return e}function l(e){return c(e)||h(e)||d()}function c(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t<e.length;t++)o[t]=e[t];return o}}function h(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function d(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function m(e,t,i){function o(){var c=Date.now()-r;c<t&&0<=c?a=setTimeout(o,t-c):(a=null,!i&&(l=e.apply(s,n),s=n=null))}var a,n,s,r,l;null==t&&(t=100);var c=function(){s=this,n=arguments,r=Date.now();var c=i&&!a;return a||(a=setTimeout(o,t)),c&&(l=e.apply(s,n),s=n=null),l};return c.clear=function(){a&&(clearTimeout(a),a=null)},c.flush=function(){a&&(l=e.apply(s,n),s=n=null,clearTimeout(a),a=null)},c}function p(e,t){var i,o;return e&&t?(i="".concat(e).concat(t[0].toUpperCase()).concat(t.slice(1)),o="".concat(e,"-").concat(t)):(i=e||t,o=e||t),{name:i,classname:o}}function g(e){return /^data:/.test(e)||/^blob:/.test(e)}function f(e){if(g(e))return!1;var t=window.location,i=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/,o=i.exec(e)||[],a={protocol:o[1]||"",host:o[2]||"",port:o[3]||""},n=function(e){return{"http:":80,"https:":443}[e]},s=function(e){return e.port||n(e.protocol||t.protocol)};return(a.protocol||a.host||a.port)&&!!!(a.protocol&&a.protocol==t.protocol&&a.host&&a.host==t.host&&a.host&&s(a)==s(t))}function u(e){return"undefined"==typeof e}function v(e){return"object"===i(e)&&null!==e}function w(e){var t="timestamp=".concat(new Date().getTime());return e+(-1===e.indexOf("?")?"?":"&")+t}function b(e,t){var i=Math.pow;return Math.sqrt(i(e.x-t.x,2)+i(e.y-t.y,2))}function y(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=r({enabled:!!e},t);return v(e)&&(i=r({},i,e)),i}function x(e){var t=Number.isNaN,i=+e;return t(i)?e:i}function C(e,t,i){var o=Math.PI,a=i.flipped,n=i.orientation,s=t.naturalWidth,r=t.naturalHeight,l=e.getContext("2d");return e.width=s,e.height=r,l.save(),a&&(e.width=r,e.height=s),2==n?(l.translate(s,0),l.scale(-1,1)):3==n?(l.translate(s,r),l.rotate(1*o)):4==n?(l.translate(0,r),l.scale(1,-1)):5==n?(l.rotate(90/180*o),l.scale(1,-1)):6==n?(l.rotate(90/180*o),l.translate(0,-r)):7==n?(l.rotate(270/180*o),l.translate(-s,r),l.scale(1,-1)):8==n&&(l.translate(0,s),l.rotate(270/180*o)),l.drawImage(t,0,0,s,r),l.restore(),e}function z(e){var t={orientation:e};return e&&(2===e?t.scaleX=-1:3===e?t.rotate=-180:4===e?t.scaleY=-1:5===e?(t.rotate=90,t.scaleY=-1):6===e?t.rotate=90:7===e?(t.rotate=90,t.scaleX=-1):8===e?t.rotate=-90:void 0),(90===t.rotate||-90===t.rotate)&&(t.flipped=!0),t}function E(e){var t=e.rotate,i=e.scaleX,o=e.scaleY,a="";return(t||i||o)&&(t&&(a+=" rotate(".concat(t,"deg) ")),i&&(a+=" scaleX(".concat(i,") ")),o&&(a+=" scaleY(".concat(o,") "))),a}function S(e){return new Promise(function(t){R(e).then(function(i){t(i?{source:e,arrayBuffer:i,orientation:H(i)}:{source:e,arrayBuffer:null,orientation:null})}).catch(function(i){console.warn(i),t({source:e,arrayBuffer:null,orientation:null})})})}function R(e){return new Promise(function(t,i){try{if(!e)i("Error: the image is empty");else if(/^data:/i.test(e))t(T(e));else if(/^blob:/i.test(e)){var o=new FileReader;o.onload=function(i){t(i.target.result)},W(e,function(e){o.readAsArrayBuffer(e)})}else{var a=new XMLHttpRequest;a.onreadystatechange=function(){4!==this.readyState||(200===this.status||0===this.status?t(this.response):i("Warning: could not load an image to parse its orientation"),a=null)},a.onprogress=function(){"image/jpeg"!==a.getResponseHeader("content-type")&&a.abort()},a.withCredentials=!1,a.open("GET",e,!0),a.responseType="arraybuffer",a.send(null)}}catch(t){i(t)}})}function W(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="blob",i.onload=function(){(200==this.status||0===this.status)&&t(this.response)},i.send()}function T(e){e=e.replace(/^data:([^;]+);base64,/gmi,"");for(var t=atob(e),o=t.length,a=new ArrayBuffer(o),n=new Uint8Array(a),s=0;s<o;s++)n[s]=t.charCodeAt(s);return a}function M(e,t,o){var a,n="";for(a=t,o+=t;a<o;a++)n+=Z(e.getUint8(a));return n}function H(e){try{var t,o,a,n,s,r,l=new DataView(e);if(255===l.getUint8(0)&&216===l.getUint8(1))for(var c=l.byteLength,h=2;h+1<c;){if(255===l.getUint8(h)&&225===l.getUint8(h+1)){s=h;break}h++}if(s&&(o=s+4,a=s+10,"Exif"===M(l,o,4))){var d=l.getUint16(a);if(n=18761===d,(n||19789===d)&&42===l.getUint16(a+2,n)){var m=l.getUint32(a+4,n);8<=m&&(r=a+m)}}if(r)for(var p,g=l.getUint16(r,n),f=0;f<g;f++)if(p=r+12*f+2,274===l.getUint16(p,n)){p+=8,t=l.getUint16(p,n),l.setUint16(p,1,n);break}return t}catch(e){return null}}function A(e){for(var t=[],i=8192,o=new Uint8Array(e);0<o.length;){var a=o.subarray(0,i);t.push(Z.apply(null,Array.from?Array.from(a):Array.slice(a))),o=o.subarray(i)}return"data:image/jpeg;base64,".concat(btoa(t.join("")))}function D(e){return{left:e.left,top:e.top,right:e.left+e.width,bottom:e.top+e.height}}function $(e){if("right"===e)return"left";return"bottom"===e?"top":"left"===e||"top"===e?e:void 0}function P(e,t){return e.width+(t.left+t.right)}function L(e,t){return e.height+(t.top+t.bottom)}function _(e,t,i){return{left:"left"in i?-j(0,G(e.left-i.left)-t.left):0,top:"top"in i?-j(0,G(e.top-i.top)-t.top):0,bottom:"bottom"in i?-j(0,i.bottom-(e.bottom+t.bottom)):0,right:"right"in i?-j(0,i.right-(e.right+t.right)):0}}function I(e){var t=e.directions,i=e.coordinates,o=e.restrictions,a=e.preserveAspectRatio,n=e.stopOnBreak,s=e.mode,c=void 0===s?"crop":s,h=e.allowedArea,d=void 0===h?{}:h,m=r({},t),p=P(i,m),g=L(i,m);0>p&&(0>m.left&&0>m.right?(m.left=-(i.width-o.minWidth)/(m.left/m.right),m.right=-(i.width-o.minWidth)/(m.right/m.left)):0>m.left?m.left=-(i.width-o.minWidth):0>m.right&&(m.right=-(i.width-o.minWidth))),0>g&&(0>m.top&&0>m.bottom?(m.top=-(i.height-o.minHeight)/(m.top/m.bottom),m.bottom=-(i.height-o.minHeight)/(m.bottom/m.top)):0>m.top?m.top=-(i.height-o.minHeight):0>m.bottom&&(m.bottom=-(i.height-o.minHeight)));var f=_(i,m,d);"move"===c&&(0<f.left&&0===f.right?(m.right+=f.left,m.left-=f.left):0<f.right&&0===f.left&&(m.left+=f.right,m.right-=f.right),0<f.top&&0===f.bottom?(m.bottom+=f.top,m.top-=f.top):0<f.bottom&&0===f.top&&(m.top+=f.bottom,m.bottom-=f.bottom),f=_(i,m,d));var u={width:1/0,height:1/0};if(xe.forEach(function(e){u[e]=f[e]&&m[e]?q(0,1-f[e]/m[e]):1/0}),a){var v=j.apply(Math,l(xe.map(function(e){return u[e]})));v!==1/0&&xe.forEach(function(e){m[e]*=v})}else be.forEach(function(e){var t=n?j(u.top,u.bottom):u[e];t!==1/0&&(m[e]*=t)}),ye.forEach(function(e){var t=n?j(u.top,u.bottom):u[e];t!==1/0&&(m[e]*=t)});if(p=P(i,m),g=L(i,m),m.right+m.left&&(p>o.maxWidth?u.width=(o.maxWidth-i.width)/(m.right+m.left):p<o.minWidth&&(u.width=(o.minWidth-i.width)/(m.right+m.left))),m.bottom+m.top&&(g>o.maxHeight?u.height=(o.maxHeight-i.height)/(m.bottom+m.top):g<o.minHeight&&(u.height=(o.minHeight-i.height)/(m.bottom+m.top))),a){var w=j(u.width,u.height);w!==1/0&&xe.forEach(function(e){m[e]*=w})}else u.width!==1/0&&be.forEach(function(e){m[e]*=u.width}),u.height!==1/0&&ye.forEach(function(e){m[e]*=u.height});return m}function Y(e,t,i,o,a){var n;return i.minimum&&e/t<i.minimum?n=i.minimum:i.maximum&&e/t>i.maximum?n=i.maximum:a&&(n=o.width/o.height),n}function X(e){var t=e.coordinates,i=e.allowedArea,o=void 0===i?{}:i,a=e.moveEvent,n=r({},a.directions),s={left:t.left+n.left,top:t.top+n.top,width:t.width,height:t.height};return"left"in o&&s.left<o.left&&(s.left=o.left),"right"in o&&s.left+s.width>o.right&&(s.left=o.right-s.width),"top"in o&&s.top<o.top&&(s.top=o.top),"bottom"in o&&s.top+s.height>o.bottom&&(s.top=o.bottom-s.height),s}function k(e){var t=e.coordinates,i=e.stencilCoordinates,o=e.worldTransforms,a=e.coefficient,n=e.imageSize,s=e.allowedArea,l=r({},o),c={width:l.scale*t.width/a,height:l.scale*t.height/a,left:i.left,top:i.top};l.shift.left-=t.left*l.scale+l.shift.left-i.left*a,l.shift.top-=t.top*l.scale+l.shift.top-i.top*a;var h=1;c.width>n.width/a&&(h=j(h,n.width/a/c.width)),c.height>n.height/a&&(h=j(h,n.height/a/c.height)),1!==h&&(l.scale*=h,c.left+=c.width*(1-h)/2,c.top+=c.height*(1-h)/2,l.shift.left=c.left*a-t.left*l.scale,l.shift.top=c.top*a-t.top*l.scale,c.width*=h,c.height*=h),0>c.left&&(l.shift.left-=c.left*a,c.left=0),0>c.top&&(l.shift.top-=c.top*a,c.top=0),c.left+c.width>n.width/a&&(l.shift.left-=(c.left+c.width)*a-n.width,c.left=n.width/a-c.width),c.top+c.height>n.height/a&&(l.shift.top-=(c.top+c.height)*a-n.height,c.top=n.height/a-c.height);var d={width:n.width*l.scale,height:n.height*l.scale};return l.shift.left>-s.left*l.scale&&(c.left-=(l.shift.left+s.left*l.scale)/a,l.shift.left=-(s.left*l.scale)),l.shift.left<n.width-d.width-(s.right-n.width)*l.scale&&(c.left-=(l.shift.left-(n.width-d.width)+(s.right-n.width)*l.scale)/a,l.shift.left=n.width-d.width-(s.right-n.width)*l.scale),l.shift.top>-s.top*l.scale&&(c.top-=(l.shift.top+s.top*l.scale)/a,l.shift.top=-s.top*l.scale),l.shift.top<n.height-d.height-(s.bottom-n.height)*l.scale&&(c.top-=(l.shift.top-(n.height-d.height)+(s.bottom-n.height)*l.scale)/a,l.shift.top=n.height-d.height-(s.bottom-n.height)*l.scale),{stencilCoordinates:c,worldTransforms:l}}function B(e){var t=e.manipulateImageEvent,i=e.coordinates,o=e.stencilRestrictions,a=e.coefficient,n=e.stencilCoordinates,s=e.worldTransforms,l=e.imageSize,c=e.frozenDirections,h=e.allowedArea,d=e.fitImage,m=t.scale,p=t.move,g=r({},s),f={width:l.width*g.scale,height:l.height*g.scale},u={left:p.left||0,top:p.top||0},v=1,w=1,b=d?1:q("left"in h&&"right"in h?n.width*a/(h.right-h.left):.01,"top"in h&&"bottom"in h?n.height*a/(h.bottom-h.top):.01);if(!c.width&&!c.height&&1e-3<N(m.factor-1)){var y=N(1-v)/2,x=o.maxWidth,C=o.maxHeight,z=o.minWidth,E=o.minHeight;v=m.factor,g.scale/v<b+y&&(v=g.scale/b);var S=i.width*v,R=i.height*v,W={minWidth:S<z+y,minHeight:R<E+y,maxWidth:S>x-y,maxHeight:R>C-y};if(W.minWidth&&(v=z/i.width),W.minHeight&&(v=E/i.height),W.maxHeight||W.maxWidth){var T=v;W.maxWidth&&W.maxHeight?T=j(C/i.height,i.width):W.maxHeight?T=C/i.height:W.maxWidth&&(T=x/i.width),1<=g.scale*v?w=T/v:v=T}var M={width:f.width*(1-1/v),height:f.height*(1-1/v)};u.left+=M.width*N((g.shift.left-m.center.left*a)/f.width),u.top+=M.height*N((g.shift.top-m.center.top*a)/f.height),f.width/=v,f.height/=v}if(g.scale/=v,d)0<G(g.shift.left+u.left)?u.left=-g.shift.left:g.shift.left+u.left<l.width-f.width&&(u.left=l.width-f.width-g.shift.left),0<G(g.shift.top+u.top)?u.top=-g.shift.top:g.shift.top+u.top<l.height-f.height&&(u.top=l.height-f.height-g.shift.top);else{var H={};xe.forEach(function(e){H[e]=e in h?g.shift[$(e)]+u[$(e)]+(h[e]*g.scale-D(n)[e]*a):0}),0<H.left?u.left-=H.left:0>H.right&&(u.left-=H.right),0<H.top?u.top-=H.top:0>H.bottom&&(u.top-=H.bottom)}g.shift.left+=u.left,g.shift.top+=u.top;var A={left:0,top:0};return l.width!==i.width&&1<=g.scale&&(A.left=n.width*(1-w)*(i.left/(l.width-i.width))),l.height!==i.height&&1<=g.scale&&(A.top=n.height*(1-w)*(i.top/(l.height-i.height))),{coordinates:{width:i.width*v*w,height:i.height*v*w,left:(n.left-g.shift.left/a+A.left)*a/g.scale,top:(n.top-g.shift.top/a+A.top)*a/g.scale},worldTransforms:g}}function U(e){var t=Math.round,i=e.coordinates,o=e.restrictions,a=e.allowedArea,n={width:t(i.width),height:t(i.height),left:t(i.left),top:t(i.top)};return n.width>o.maxWidth?n.width=F(i.width):n.width<o.minWidth&&(n.width=G(i.width)),n.height>o.maxHeight?n.height=F(i.height):n.height<o.minHeight&&(n.height=G(i.height)),(n.left<a.left||n.left+n.width>a.right)&&(n.left=F(a.left)),(n.top<a.top||n.top+n.height>a.bottom)&&(n.top=F(a.top)),n}function O(e,t,i){function o(o){return console.warn("The arguments will be passed to the prop '".concat(t,"' as an single object {").concat(Object.keys(o).join(","),"} in the future releases. You should change the interface of your function.")),e.apply(void 0,l(i(o)))}return function(t){if(1<e.length)return o(t);try{return e(t)}catch(i){return o(t)}}}t=t&&t.hasOwnProperty("default")?t["default"]:t;var V=function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e){(function(){function t(){for(var e,o=[],a=0;a<arguments.length;a++)if(e=arguments[a],e){var n=typeof e;if("string"===n||"number"===n)o.push(e);else if(Array.isArray(e)&&e.length){var s=t.apply(null,e);s&&o.push(s)}else if("object"===n)for(var r in e)i.call(e,r)&&e[r]&&o.push(r)}return o.join(" ")}var i={}.hasOwnProperty;e.exports?(t.default=t,e.exports=t):window.classNames=t})()}),K=function(e){return function(t,i){if(!t)return e;var o;"string"==typeof t?o=t:i=t;var a=e;return o&&(a+="__"+o),a+(i?Object.keys(i).reduce(function(e,t){var o=i[t];return o&&(e+=" "+("boolean"==typeof o?a+"--"+t:a+"--"+t+"_"+o)),e},""):"")}};m.debounce=m;var J=function e(t){var i=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{};o(this,e),this.nativeEvent=t,this.move=i,this.scale=a,this.params=n},Q=function e(t,i){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};o(this,e),this.nativeEvent=t,this.directions=i,this.params=a},ee=function e(t,i){o(this,e),this.nativeEvent=t,this.directions=i},te=function(){function e(t,i,a,n,s){o(this,e),this.nativeEvent=t,this.position=a,this.previousPosition=n,this.element=i,this.anchor=s}return n(e,[{key:"shift",value:function(){var e=this.element,t=this.anchor,i=this.position,o=e.getBoundingClientRect(),a=o.left,n=o.top;return{left:i.left-a-t.left,top:i.top-n-t.top}}}]),e}(),ie={name:"DraggableElement",mixins:[{beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){if(!this.$refs.draggable)throw new Error("You should add ref \"draggable\" to your root element to use draggable mixin");this.touches=[],this.draggingAnchor=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit("enter"))},onMouseLeave:function(){this.hovered&&(this.hovered=!1,this.$emit("leave"))},onTouchStart:function(t){t.cancelable&&!this.disabled&&1===t.touches.length&&(this.touches=l(t.touches),!this.hovered&&this.$emit("enter"),t.touches.length&&this.initAnchor(this.touches.reduce(function(e,i){return{clientX:e.clientX+i.clientX/t.touches.length,clientY:e.clientY+i.clientY/t.touches.length}},{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){if(!this.disabled){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.preventDefault())},onMouseUp:function(){this.touches=[]},initAnchor:function(e){var t=this.$refs.draggable,i=t.getBoundingClientRect(),o=i.left,a=i.right,n=i.bottom,s=i.top;this.anchor={left:e.clientX-o,top:e.clientY-s,bottom:n-e.clientY,right:a-e.clientX}},processMove:function(e,t){var i=l(t);if(this.touches.length){if(1===this.touches.length&&1===i.length){var o=this.$refs.draggable;this.$emit("drag",new te(e,o,{left:i[0].clientX,top:i[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=i}},processEnd:function(){this.touches=[],this.hovered&&(this.$emit("leave"),this.hovered=!1)}}}],props:{classname:{type:String}}},oe=function(e,t,i,o,a,n,s,r,l,c){"boolean"!=typeof s&&(l=r,r=s,s=!1);var h="function"==typeof i?i.options:i;e&&e.render&&(h.render=e.render,h.staticRenderFns=e.staticRenderFns,h._compiled=!0,a&&(h.functional=!0)),o&&(h._scopeId=o);var d;if(n?(d=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(n)},h._ssrRegister=d):t&&(d=s?function(){t.call(this,c(this.$root.$options.shadowRoot))}:function(e){t.call(this,r(e))}),d)if(h.functional){var m=h.render;h.render=function(e,t){return d.call(t),m(e,t)}}else{var p=h.beforeCreate;h.beforeCreate=p?[].concat(p,d):[d]}return i},ae=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"draggable",class:e.classname,on:{touchstart:e.onTouchStart,mousedown:e.onMouseDown,mouseover:e.onMouseOver,mouseleave:e.onMouseLeave}},[e._t("default")],2)},staticRenderFns:[]},void 0,ie,void 0,!1,void 0,void 0,void 0),ne=K("vue-handler-wrapper"),se={name:"HandlerWrapper",components:{DraggableElement:ae},props:{horizontalPosition:{type:String},verticalPosition:{type:String},classname:{type:String},disabled:{type:Boolean,default:!1}},computed:{classnames:function(){var e;if(this.horizontalPosition||this.verticalPosition){var t,i=p(this.horizontalPosition,this.verticalPosition);e=V(this.classname,ne((t={},s(t,i.classname,!0),s(t,"disabled",this.disabled),t)))}else e=V(this.classname,ne({disabled:this.disabled}));return{default:e,draggable:ne("draggable")}}}},re=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default},[i("DraggableElement",{class:e.classnames.draggable,attrs:{disabled:e.disabled},on:{drag:function(t){return e.$emit("drag",t)},leave:function(){return e.$emit("leave")},enter:function(){return e.$emit("enter")}}},[e._t("default")],2)],1)},staticRenderFns:[]},void 0,se,void 0,!1,void 0,void 0,void 0),le=K("vue-line-wrapper"),ce={name:"LineWrapper",components:{DraggableElement:ae},props:{position:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classname:function(){var e;return le((e={},s(e,this.position,!0),s(e,"disabled",this.disabled),e))}}},he=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("DraggableElement",{class:e.classname,attrs:{disabled:e.disabled},on:{drag:function(t){return e.$emit("drag",t)},leave:function(){return e.$emit("leave")},enter:function(){return e.$emit("enter")}}},[e._t("default")],2)},staticRenderFns:[]},void 0,ce,void 0,!1,void 0,void 0,void 0),de=K("vue-bounding-box"),me=["east","west",null],pe=["south","north",null],ge={name:"BoundingBox",props:{classname:{type:String},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlerComponent:{type:[Object,String]},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},lineComponent:{type:[Object,String]},linesClassnames:{type:Object,default:function(){return{}}},scalable:{type:Boolean,default:!0}},data:function(){var e=[];return me.forEach(function(t){pe.forEach(function(i){if(t!==i){var o=p(t,i),a=o.name,n=o.classname;e.push({name:a,classname:n,verticalDirection:i,horizontalDirection:t})}})}),{points:e}},computed:{classnames:function(){var e=this.handlersClassnames,t=this.linesClassnames;return{default:V(de(),this.classname),handlers:e,lines:t}},lineNodes:function(){var e=this,t=[];return this.points.forEach(function(i){i.horizontalDirection&&i.verticalDirection||!e.lines[i.name]||t.push({name:i.name,component:e.lineComponent,classname:V(e.classnames.lines.default,e.classnames.lines[i.name],!e.scalable&&e.classnames.lines.disabled),hoverClassname:e.classnames.lines.hover,verticalDirection:i.verticalDirection,horizontalDirection:i.horizontalDirection,disabled:!e.scalable})}),t},handlerNodes:function(){var e=this,t=[];return this.points.forEach(function(i){e.handlers[i.name]&&t.push({name:i.name,component:e.handlerComponent,classname:V(e.classnames.handlers.default,e.classnames.handlers[i.name]),hoverClassname:e.classnames.handlers.hover,verticalDirection:i.verticalDirection,horizontalDirection:i.horizontalDirection,disabled:!e.scalable})}),t}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[]},methods:{onHandlerDrag:function(e,t,i){var o=e.shift(),a=o.left,n=o.top,s={left:0,right:0,top:0,bottom:0};"west"===t?s.left-=a:"east"==t&&(s.right+=a),"north"===i?s.top-=n:"south"==i&&(s.bottom+=n);var r;!i&&t?r="width":i&&!t&&(r="height"),this.scalable&&this.$emit("resize",new Q(e.nativeEvent,s,{allowedDirections:{left:"west"===t||!t,right:"east"===t||!t,bottom:"south"===i||!i,top:"north"===i||!i},preserveAspectRatio:e.nativeEvent.shiftKey,respectDirection:r}))}}},fe=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"box",class:e.classnames.default},[e._t("default"),e._v(" "),i("div",e._l(e.lineNodes,function(t){return i(t.component,{key:t.name,tag:"component",attrs:{classname:t.classname,"hover-classname":t.hoverClassname,position:t.name,disabled:t.disabled},on:{drag:function(i){return e.onHandlerDrag(i,t.horizontalDirection,t.verticalDirection)}}})}),1),e._v(" "),i("div",e._l(e.handlerNodes,function(t){return i(t.component,{key:t.name,tag:"component",attrs:{classname:t.classname,"hover-classname":t.hoverClassname,"horizontal-position":t.horizontalDirection,"vertical-position":t.verticalDirection,disabled:t.disabled},on:{drag:function(i){return e.onHandlerDrag(i,t.horizontalDirection,t.verticalDirection)}}})}),1)],2)},staticRenderFns:[]},void 0,ge,void 0,!1,void 0,void 0,void 0),ue=K("vue-draggable-area"),ve={name:"DraggableArea",props:{movable:{type:Boolean,default:!0},activationDistance:{type:Number,default:10}},computed:{classnames:function(){return{default:V(ue(),this.classname)}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.touchStarted=!1},methods:{onTouchStart:function(t){if(t.cancelable){var e=this.movable&&1===t.touches.length;e&&(this.touches=l(t.touches)),(this.touchStarted||e)&&(t.preventDefault(),t.stopPropagation())}},onTouchEnd:function(){this.touchStarted=!1,this.processEnd()},onTouchMove:function(t){1<=this.touches.length&&(this.touchStarted?(this.processMove(t,t.touches),t.preventDefault(),t.stopPropagation()):b({x:this.touches[0].clientX,y:this.touches[0].clientY},{x:t.touches[0].clientX,y:t.touches[0].clientY})>this.activationDistance&&(this.initAnchor({clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}),this.touchStarted=!0))},onMouseDown:function(t){if(this.movable){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault(),t.stopPropagation())},onMouseUp:function(){this.touches=[]},initAnchor:function(e){var t=this.$refs.container,i=t.getBoundingClientRect(),o=i.left,a=i.top;this.anchor={x:e.clientX-o,y:e.clientY-a}},processMove:function(e,t){var i=l(t);if(this.touches.length){var o=this.$refs.container,a=o.getBoundingClientRect(),n=a.left,s=a.top;1===this.touches.length&&1===i.length&&this.$emit("move",new ee(e,{left:i[0].clientX-n-this.anchor.x,top:i[0].clientY-s-this.anchor.y}))}},processEnd:function(){this.touches=[]}}},we=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"container",on:{touchstart:e.onTouchStart,mousedown:e.onMouseDown}},[e._t("default")],2)},staticRenderFns:[]},void 0,ve,void 0,!1,void 0,void 0,void 0),be=["left","right"],ye=["top","bottom"],xe=["left","right","top","bottom"],Ce=["area","stencil","none"],ze=.1,Ee={left:0,top:0,width:0,height:0},Se=K("vue-preview-result"),Re={name:"PreviewResult",props:{img:{type:Object},classname:{type:String},imageClassname:{type:String},stencilCoordinates:{type:Object,default:function(){return{width:0,height:0,left:0,top:0}}}},computed:{classnames:function(){return{default:V(Se(),this.classname),image:V(Se("image"),this.imageClassname),wrapper:Se("wrapper")}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"calc(50% - ".concat(this.stencilCoordinates.width/2,"px)"),top:"calc(50% - ".concat(this.stencilCoordinates.height/2,"px)")}},imageStyle:function(){var e=this.img.transforms,t=e.flipped,i=this.img.coefficient,o=this.img.size.height/i,a=this.img.size.width/i,n={width:"".concat(a,"px"),height:"".concat(o,"px")};return t?(n.width="".concat(o,"px"),n.height="".concat(a,"px"),n.left="".concat(-this.stencilCoordinates.left-(o-a)/2+e.translateX,"px"),n.top="".concat(-this.stencilCoordinates.top-(a-o)/2+e.translateY,"px")):(n.left="".concat(-this.stencilCoordinates.left+e.translateX,"px"),n.top="".concat(-this.stencilCoordinates.top+e.translateY,"px")),n.transform=E(e),n}}},We=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default},[i("div",{ref:"wrapper",class:e.classnames.wrapper,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img.src}})])])},staticRenderFns:[]},void 0,Re,void 0,!1,void 0,void 0,void 0),Te={name:"CropperWrapper",props:{touchMove:{type:Object,required:!0},mouseMove:{type:Object,required:!0},touchResize:{type:Object,required:!0},wheelResize:{type:Object,required:!0}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[]},methods:{onTouchStart:function(t){if(t.cancelable&&(this.touchMove.enabled||this.touchResize.enabled&&1<t.touches.length)){var e=this.$refs.container,i=e.getBoundingClientRect(),o=i.left,a=i.top,n=i.bottom,s=i.right;this.touches=l(t.touches).filter(function(e){return e.clientX>o&&e.clientX<s&&e.clientY>a&&e.clientY<n}),this.oldGeometricProperties=this.calculateGeometricProperties(this.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation()}},onTouchEnd:function(t){0===t.touches.length&&this.processEnd()},onTouchMove:function(t){var e=this;if(this.touches.length){var i=l(t.touches).filter(function(t){return!t.identifier||e.touches.find(function(e){return e.identifier===t.identifier})});this.processMove(t,i),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation()}},onMouseDown:function(t){if(this.mouseMove&&"buttons"in t&&1===t.buttons){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault())},onMouseUp:function(){this.touches=[]},calculateGeometricProperties:function(e){var t=this.$refs.container,i=t.getBoundingClientRect(),o=i.left,a=i.top,n={left:0,top:0},s=0;return e.forEach(function(t){n.left+=(t.clientX-o)/e.length,n.top+=(t.clientY-a)/e.length}),e.forEach(function(e){s+=b({x:n.left,y:n.top},{x:e.clientX-o,y:e.clientY-a})}),{centerMass:n,spread:s,count:e.length}},processMove:function(e,t){if(this.touches.length){if(1===this.touches.length&&1===t.length&&this.touchMove.enabled)this.$emit("move",new J(e,{left:t[0].clientX-this.touches[0].clientX,top:t[0].clientY-this.touches[0].clientY}));else if(1<this.touches.length&&this.touchResize){var i=this.oldGeometricProperties,o=this.calculateGeometricProperties(t);i.count===o.count&&1<i.count&&this.$emit("resize",new J(e,{left:o.centerMass.left-i.centerMass.left,top:o.centerMass.top-i.centerMass.top},{factor:i.spread/o.spread,center:o.centerMass})),this.oldGeometricProperties=o}this.touches=t}},processEnd:function(){this.touches=[]},onWheel:function(e){if(this.wheelResize.enabled){var t=this.$refs.container,i=t.getBoundingClientRect(),o=i.left,a=i.top,n=1+this.wheelResize.ratio*Math.sign(e.deltaY||e.detail||e.wheelDelta),s={left:e.clientX-o,top:e.clientY-a};this.$emit("resize",new J(e,{},{factor:n,center:s})),e.preventDefault(),e.stopPropagation()}}}},Me=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"container",on:{touchstart:e.onTouchStart,mousedown:e.onMouseDown,wheel:e.onWheel}},[e._t("default")],2)},staticRenderFns:[]},void 0,Te,void 0,!1,void 0,void 0,void 0),He=K("vue-square-handler"),Ae={name:"SimpleHandler",components:{HandlerWrapper:re},props:{classname:{type:String},hoverClassname:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},computed:{classnames:function(){return{default:V(He(s({},this.position,!0)),this.classname,this.hover&&this.hoverClassname)}}},methods:{onDrag:function(e){this.$emit("drag",e)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1}}},De=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("HandlerWrapper",{attrs:{"vertical-position":e.verticalPosition,"horizontal-position":e.horizontalPosition,disabled:e.disabled},on:{drag:e.onDrag}},[i("div",{class:e.classnames.default})])},staticRenderFns:[]},void 0,Ae,void 0,!1,void 0,void 0,void 0),$e=K("vue-simple-line"),Pe={name:"SimpleLine",components:{LineWrapper:he},props:{classname:{type:String},hoverClassname:{type:String},position:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classnames:function(){return{default:V($e(s({},this.position,!0)),this.classname,this.hover&&this.hoverClassname)}}},methods:{onDrag:function(e){this.$emit("drag",e)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1}}},Le=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("LineWrapper",{attrs:{position:e.position,disabled:e.disabled},on:{enter:e.onEnter,leave:e.onLeave,drag:e.onDrag}},[i("div",{class:e.classnames.default})])},staticRenderFns:[]},void 0,Pe,void 0,!1,void 0,void 0,void 0),_e=K("vue-rectangle-stencil"),Ie={name:"RectangleStencil",components:{PreviewResult:We,BoundingBox:fe,DraggableArea:we},props:{img:{type:Object},resultCoordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlerComponent:{type:[Object,String],default:function(){return De}},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object},lineComponent:{type:[Object,String],default:function(){return Le}},linesClassnames:{type:Object,default:function(){return{}}},classname:{type:String},previewClassname:{type:String},boundingBoxClassname:{type:String},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},scalable:{type:Boolean,default:!0}},computed:{classes:function(){return{stencil:V(_e({movable:this.movable}),this.classname),preview:V(_e("preview"),this.previewClassname),boundingBox:V(_e("bounding-box"),this.boundingBoxClassname)}},style:function(){var e=this.stencilCoordinates,t=e.height,i=e.width,o=e.left,a=e.top;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(o,"px"),top:"".concat(a,"px")}}},methods:{onMove:function(e){this.$emit("move",e)},onResize:function(e){this.$emit("resize",e)},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}}},Ye=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classes.stencil,style:e.style},[i("BoundingBox",{attrs:{classname:e.classes.boundingBox,handlers:e.handlers,"handler-component":e.handlerComponent,"handlers-classnames":e.handlersClassnames,lines:e.lines,"line-component":e.lineComponent,"lines-classnames":e.linesClassnames,scalable:e.scalable},on:{resize:e.onResize}},[i("DraggableArea",{attrs:{movable:e.movable},on:{move:e.onMove}},[i("PreviewResult",{attrs:{img:e.img,classname:e.classes.preview,"result-coordinates":e.resultCoordinates,"stencil-coordinates":e.stencilCoordinates}})],1)],1)],1)},staticRenderFns:[]},void 0,Ie,void 0,!1,void 0,void 0,void 0),Xe=K("vue-circle-stencil"),ke={name:"CircleStencil",components:{PreviewResult:We,BoundingBox:fe,DraggableArea:we},props:{img:{type:Object},stencilClass:{type:String},resultCoordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,westNorth:!0,westSouth:!0,eastSouth:!0}}},handlerComponent:{type:[Object,String],default:function(){return De}},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object},lineComponent:{type:[Object,String],default:function(){return Le}},linesClassnames:{type:Object,default:function(){return{}}},classname:{type:String},previewClassname:{type:String},boundingBoxClassname:{type:String},movable:{type:Boolean,default:!0},scalable:{type:Boolean,default:!0}},computed:{classes:function(){return{stencil:V(Xe(),this.classname),preview:V(Xe("preview"),this.previewClassname),boundingBox:V(Xe("bounding-box"),this.boundingBox)}},style:function(){var e=this.stencilCoordinates,t=e.height,i=e.width,o=e.left,a=e.top;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(o,"px"),top:"".concat(a,"px")}}},methods:{onMove:function(e){this.$emit("move",e)},onResize:function(e){this.$emit("resize",e)},aspectRatios:function(){return{minimum:1,maximum:1}}}},Be=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classes.stencil,style:e.style},[i("BoundingBox",{attrs:{classname:e.classes.boundingBox,handlers:e.handlers,"handler-component":e.handlerComponent,"handlers-classnames":e.handlersClassnames,lines:e.lines,"line-component":e.lineComponent,"lines-classnames":e.linesClassnames,scalable:e.scalable},on:{resize:e.onResize}},[i("DraggableArea",{attrs:{movable:e.movable},on:{move:e.onMove}},[i("PreviewResult",{attrs:{img:e.img,classname:e.classes.preview,"result-coordinates":e.resultCoordinates,"stencil-coordinates":e.stencilCoordinates}})],1)],1)],1)},staticRenderFns:[]},void 0,ke,void 0,!1,void 0,void 0,void 0),Ue=K("vue-advanced-cropper"),Oe={name:"Cropper",components:{CropperWrapper:Me},props:{src:{type:String,default:null},bustCache:{type:Boolean,default:!1},allowedArea:{type:Function,default:function(e){var t=e.breakBoundaries,i=e.imageSize,o=e.worldTransforms,a=e.imageRestriction,n={};if("none"!==a&&(n={left:0,top:0,right:i.width,bottom:i.height}),!t){var s={left:-o.shift.left/o.scale,top:-o.shift.top/o.scale,right:(i.width-o.shift.left)/o.scale,bottom:(i.height-o.shift.top)/o.scale};xe.forEach(function(e){n[e]=u(n[e])?s[e]:"left"===e||"top"===e?q(n[e],s[e]):j(n[e],s[e])})}return n}},resizeAlgorithm:{type:Function,default:function(e){var t=e.coordinates,i=e.restrictions,o=e.allowedArea,a=e.aspectRatio,n=e.resizeEvent,s=r({},t,{right:t.left+t.width,bottom:t.top+t.height}),l=n.params||{},c=r({},n.directions),h=r({},i,{minWidth:q(i.minWidth,.1*(o.right-o.left)),minHeight:q(i.minHeight,.1*(o.bottom-o.top))}),d=l.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};xe.forEach(function(e){d[e]||(c[e]=0)}),c=I({directions:c,restrictions:h,coordinates:s,allowedArea:o,stopOnBreak:l.stopOnBreak});var m=P(s,c),p=L(s,c),g=Y(m,p,a,s,l.preserveAspectRatio);if(g){var f=l.respectDirection;if(f||(s.width>=s.height||1==g?f="width":f="height"),"width"===f){var u=m/g-s.height;d.top&&d.bottom?(c.bottom=u/2,c.top=u/2):d.bottom?c.bottom=u:d.top?c.top=u:d.right?c.right=0:d.left&&(c.left=0)}else if("height"===f){var v=s.width-p*g;d.left&&d.right?(c.left=-v/2,c.right=-v/2):d.left?c.left=-v:d.right?c.right=-v:d.top?c.top=0:d.bottom&&(c.bottom=0)}c=I({directions:c,restrictions:h,coordinates:s,allowedArea:o,preserveAspectRatio:!0,mode:l.compensate&&!l.stopOnBreak?"move":"crop"})}return m=P(s,c),p=L(s,c),g=Y(m,p,a,s,l.preserveAspectRatio),1e-3<N(g-m/p)&&(console.error("Something went wrong and ratio was broken: ".concat(m/p," instead of ").concat(g)),xe.forEach(function(e){d[e]||(c[e]=0)})),X({coordinates:{width:t.width+c.right+c.left,height:t.height+c.top+c.bottom,left:t.left,top:t.top},allowedArea:o,moveEvent:new ee({},{left:-c.left,top:-c.top})})}},moveAlgorithm:{type:Function,default:X},defaultSize:{type:Function,default:function(e){var t,i,o=e.cropper,a=e.image,n=e.minWidth,s=e.minHeight,r=e.maxWidth,l=e.maxHeight,c=e.imageWidth,h=e.imageHeight,d=e.aspectRatio,m=e.props,p=c,g=h,f=c>h?d.maximum:d.minimum;return(c/h>d.maximum||c/h<d.minimum)&&(1>=f?(g=h,p=g*d.maximum):(p=c,g=p/d.minimum)),t=j(l,q(s,.8*g)),i=j(r,q(n,.8*p)),{height:t,width:i}}},defaultPosition:{type:Function,default:function(e){var t=e.cropper,i=e.image,o=e.stencilWidth,a=e.stencilHeight,n=e.imageWidth,s=e.imageHeight,r=e.props;return{left:n/2-o/2,top:s/2-a/2}}},areaSize:{type:Function,default:function(e){var t=e.cropper,i=e.image,o=e.imageWidth,a=e.imageHeight,n=t.clientHeight,s=t.clientWidth,r=n,l=o*n/a;return l>s&&(l=s,r=a*s/o),{width:l,height:r}}},restrictions:{type:Function,default:function(e){var t=e.minWidth,i=e.minHeight,o=e.maxWidth,a=e.maxHeight,n=e.imageWidth,s=e.imageHeight;return{minWidth:t/100*n,minHeight:i/100*s,maxWidth:o/100*n,maxHeight:a/100*s}}},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},stencilComponent:{type:[Object,String],default:function(){return Ye}},stencilProps:{type:Object,default:function(){return{}}},classname:{type:String},imageClassname:{type:String},areaClassname:{type:String},backgroundClassname:{type:String},debounce:{type:Number,default:500},canvas:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},crossOrigin:{type:String,default:"anonymous"},transitionTime:{type:Number,default:300},wheelResize:{type:[Boolean,Object],default:!0},touchResize:{type:[Boolean,Object],default:!0},touchMove:{type:[Boolean,Object],default:!0},mouseMove:{type:[Boolean,Object],default:!0},imageRestriction:{type:String,default:"area",validator:function(e){return-1!==Ce.indexOf(e)}},roundResult:{type:Boolean,default:!0}},data:function(){return{boundarySize:{width:null,height:null},imageLoaded:!1,imageAttributes:{crossOrigin:!1,src:null},basicImageTransforms:{rotate:null,scaleX:null,scaleY:null},imageSize:{width:null,height:null},coordinates:r({},Ee),stencilCoordinates:r({},Ee),frozenDirections:{width:!1,height:!1},worldTransforms:{scale:1,shift:{left:0,top:0}}}},computed:{settings:function e(){var e={touchResize:y(this.touchResize),touchMove:y(this.touchMove),mouseMove:y(this.mouseMove),wheelResize:y(this.wheelResize,{ratio:.1})};return e.touchMove.enabled=e.touchMove.enabled&&(1!==this.worldTransforms.scale||"none"===this.imageRestriction),e},imageTransforms:function(){return r({},this.basicImageTransforms,{scaleX:(this.basicImageTransforms.scaleX||1)*this.worldTransforms.scale,scaleY:(this.basicImageTransforms.scaleY||1)*this.worldTransforms.scale,translateX:this.worldTransforms.shift.left/this.coefficient+(this.imageSize.width*this.worldTransforms.scale-this.imageSize.width)/2/this.coefficient,translateY:this.worldTransforms.shift.top/this.coefficient+(this.imageSize.height*this.worldTransforms.scale-this.imageSize.height)/2/this.coefficient})},coefficient:function(){return this.imageSize.width?this.imageSize.width/this.boundarySize.width:0},classes:function(){return{cropper:V(Ue(),this.classname),image:V(Ue("image"),this.imageClassname),area:V(Ue("area"),this.areaClassname),stretcher:V(Ue("stretcher")),background:V(Ue("background"),this.backgroundClassname),imageWrapper:V(Ue("image-wrapper")),cropperWrapper:V(Ue("cropper-wrapper"))}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"".concat(this.stencilCoordinates.left,"px"),top:"".concat(this.stencilCoordinates.top,"px")}},areaStyle:function(){return{width:this.boundarySize.width?"".concat(this.boundarySize.width,"px"):"auto",height:this.boundarySize.height?"".concat(this.boundarySize.height,"px"):"auto",opacity:this.imageLoaded?1:0,transition:"opacity ".concat(this.transitionTime,"ms"),pointerEvents:this.imageLoaded?"all":"none"}},imageStyle:function(){var e={left:"calc(50% + ".concat(this.imageTransforms.translateX,"px)"),top:"calc(50% + ".concat(this.imageTransforms.translateY,"px)"),transform:"translate(-50%, -50%)"+E(this.imageTransforms)},t=this.imageTransforms.flipped;return t?(e.width="".concat(this.boundarySize.height,"px"),e.height="".concat(this.boundarySize.width,"px")):(e.width="".concat(this.boundarySize.width,"px"),e.height="".concat(this.boundarySize.height,"px")),e},stencilRestrictions:function(){var e=q(ze*this.imageSize.width/this.coefficient/this.worldTransforms.scale,ze*this.imageSize.height/this.coefficient/this.worldTransforms.scale),t={minWidth:u(this.minWidth)?0:this.minWidth,minHeight:u(this.minHeight)?0:this.minHeight,maxWidth:u(this.maxWidth)?1/0:this.maxWidth,maxHeight:u(this.maxHeight)?1/0:this.maxHeight},i=O(this.restrictions,"restrictions",function(e){return[e.minWidth,e.minHeight,e.maxWidth,e.maxHeight,e.imageWidth,e.imageHeight]})({minWidth:x(t.minWidth),minHeight:x(t.minHeight),maxWidth:x(t.maxWidth),maxHeight:x(t.maxHeight),imageWidth:this.imageSize.width,imageHeight:this.imageSize.height,props:this.$props});return u(i.minWidth)&&(i.minWidth=F(e)),u(i.minHeight)&&(i.minHeight=F(e)),i.minWidth>i.maxWidth&&(console.warn("Warning: maximum width (".concat(i.maxWidth,"px) fewer that the minimum width (").concat(i.minWidth,"px). It is set equal to the minimum width and width resizing was blocked")),i.maxWidth=i.minWidth,i.widthFrozen=!0),i.minHeight>i.maxHeight&&(console.warn("Warning: maximum height (".concat(i.maxHeight,"px) fewer that the minimum height (").concat(i.minHeight,"px). It is set equal to the minimum height and height resizing was blocked")),i.maxHeight=i.minHeight,i.heightFrozen=!0),"none"!==this.imageRestriction&&((!i.maxWidth||i.maxWidth>this.imageSize.width)&&(i.maxWidth=this.imageSize.width),(!i.maxHeight||i.maxHeight>this.imageSize.height)&&(i.maxHeight=this.imageSize.height)),i}},watch:{src:function(){this.onChangeImage()},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.resetCoordinates()},stencilProps:function(e,i){["aspectRatio","minAspectRatio","maxAspectRatio"].find(function(t){return e[t]!==i[t]})&&t.nextTick(this.onPropsChange)}},mounted:function(){var e=this;this.debouncedUpdate=m(this.update,this.debounce),window.addEventListener("resize",this.onResizeWindow),window.addEventListener("orientationchange",this.onResizeWindow),this.$refs.image.addEventListener("load",function(){e.onSuccessLoadImage()}),this.$refs.image.addEventListener("error",function(){e.onFailLoadImage()}),this.onChangeImage()},destroyed:function(){window.removeEventListener("resize",this.refreshImage),window.removeEventListener("orientationchange",this.refreshImage)},methods:{getResult:function(){var e=this.prepareResult(r({},this.coordinates));return this.canvas&&this.src&&this.imageLoaded?(this.updateCanvas(this.coordinates),{coordinates:e,canvas:this.$refs.canvas}):{coordinates:e}},prepareResult:function(e){return this.roundResult?U({coordinates:e,restrictions:this.restrictions,allowedArea:this.getAllowedArea()}):e},getArea:function(){return this.$refs.area},getStencil:function(){return this.$refs.stencil},autoZoom:function(e){var t=k({coordinates:e,stencilCoordinates:this.stencilCoordinates,worldTransforms:this.worldTransforms,coefficient:this.coefficient,imageSize:this.imageSize,allowedArea:this.getAllowedArea(!0)}),i=t.worldTransforms,o=t.stencilCoordinates;this.worldTransforms=i,this.stencilCoordinates=o},updateStencilCoordinates:function(e){var t=e.width,i=e.height,o=e.left,a=e.top;this.stencilCoordinates={width:this.worldTransforms.scale*t/this.coefficient,height:this.worldTransforms.scale*i/this.coefficient,left:(o*this.worldTransforms.scale+this.worldTransforms.shift.left)/this.coefficient,top:(a*this.worldTransforms.scale+this.worldTransforms.shift.top)/this.coefficient}},updateCanvas:function(e){if(this.$refs.canvas){var t=this.$refs.image,i=this.checkOrientation?C(this.$refs.sourceCanvas,t,this.imageTransforms):t,o=this.$refs.canvas;o.width=e.width,o.height=e.height;var a=o.getContext("2d");a.drawImage(i,e.left,e.top,e.width,e.height,0,0,e.width,e.height)}},update:function(){this.$emit("change",this.getResult())},onResizeWindow:function(){var e=this,t=this.$refs.image;this.src&&t&&this.refreshImage().then(function(){e.updateStencilCoordinates(e.coordinates)})},onChangeCoordinates:function(e){var t=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1];this.coordinates=e,this.$listeners&&this.$listeners.change&&(t?this.debouncedUpdate():this.update())},onChangeImage:function(){var e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.imageAttributes.src=null,this.src){var t=f(this.src);t&&this.canvas&&this.checkCrossOrigin&&(this.imageAttributes.crossOrigin=this.crossOrigin),setTimeout(function(){var t=e.bustCache?w(e.src):e.src;e.checkOrientation?S(t).then(e.onParseImage):e.onParseImage({source:t})},this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.clearImage(),this.$emit("error")},onSuccessLoadImage:function(){var e=this;this.$refs.image&&!this.imageLoaded&&(this.imageLoaded=!0,this.refreshImage().then(function(){e.resetCoordinates(),e.$emit("ready")}))},onParseImage:function(e){var i=this,o=e.source,a=e.arrayBuffer,n=e.orientation;this.imageAttributes.src=a&&n&&g(o)?A(a):o,this.basicImageTransforms=z(n),t.nextTick(function(){var e=i.$refs.image;e&&e.complete&&(e.naturalWidth?i.onSuccessLoadImage():i.onFailLoadImage())})},onResize:function(e){var t=this;this.frozenDirections.width&&(e.directions.left=0,e.directions.right=0),this.frozenDirections.height&&(e.directions.top=0,e.directions.bottom=0),xe.forEach(function(i){e.directions[i]/=t.worldTransforms.scale/t.coefficient}),this.onChangeCoordinates(this.resizeAlgorithm({coordinates:this.coordinates,restrictions:this.stencilRestrictions,allowedArea:this.getAllowedArea(),aspectRatio:this.stencilAspectRatios(),resizeEvent:e})),this.updateStencilCoordinates(this.coordinates)},onManipulateImage:function(e){e.move.left&&(e.move.left*=this.coefficient),e.move.top&&(e.move.top*=this.coefficient);var t=B({manipulateImageEvent:e,coordinates:this.coordinates,coefficient:this.coefficient,stencilRestrictions:this.stencilRestrictions,imageSize:this.imageSize,frozenDirections:this.frozenDirections,stencilCoordinates:this.stencilCoordinates,worldTransforms:this.worldTransforms,allowedArea:this.getAllowedArea(!0),minScale:"none"===this.imageRestriction?ze:1,fitImage:"area"===this.imageRestriction}),i=t.worldTransforms,o=t.coordinates;this.worldTransforms=i,this.onChangeCoordinates(o),this.updateStencilCoordinates(o)},onMove:function(e){var t=this;xe.forEach(function(i){e.directions[i]/=t.worldTransforms.scale/t.coefficient}),this.onChangeCoordinates(this.moveAlgorithm({coordinates:this.coordinates,allowedArea:this.getAllowedArea(),moveEvent:e})),this.updateStencilCoordinates(this.coordinates)},defaultCoordinates:function(){var e=this.stencilAspectRatios(),t=this.stencilRestrictions,i=t.minWidth,o=t.minHeight,a=t.maxWidth,n=t.maxHeight,s=this.imageSize,r={};if(!e.minimum&&!e.maximum)r.height=o,r.width=i;else{var l={width:{maximum:e.minimum?j(n,i/e.minimum):n,minimum:e.maximum?q(o,i/e.maximum):o},height:{maximum:e.maximum?j(a,o*e.maximum):a,minimum:e.minimum?q(i,o*e.minimum):i}};if(l.width.maximum>=l.width.minimum)r.width=i,r.height=l.width.minimum;else if(l.height.maximum>=l.height.minimum)r.height=o,r.width=l.height.minimum;else throw"Error: current aspect ratio is incompatible with minimum/maximum height and width settings. Can't setup default coordinates"}return r.left=s.width/2-r.width/2,r.top=s.height/2-r.height/2,r},setCoordinates:function(e){var i=this,o=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},a=o.autoZoom;t.nextTick(function(){return i.imageLoaded?void i.applyTransforms(e,!(void 0!==a)||a):void(i.delayedTransforms=e)})},onPropsChange:function(){this.applyTransforms(this.coordinates,!0)},applyTransforms:function(e){var t=this,i=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],o=this.stencilAspectRatios(),a=this.getAllowedArea(!0),n=function(e,i){return t.moveAlgorithm({coordinates:e,allowedArea:a,moveEvent:new ee(null,{left:i.left-e.left,top:i.top-e.top})})},s=function(e,i){var s=t.defaultCoordinates();return s=t.resizeAlgorithm({coordinates:s,restrictions:t.stencilRestrictions,allowedArea:a,aspectRatio:o,resizeEvent:new Q(null,{left:(i.width-s.width)/2,right:(i.width-s.width)/2,top:(i.height-s.height)/2,bottom:(i.height-s.height)/2})}),n(s,{left:e.left,top:e.top})},l=this.coordinates;return Array.isArray(e)||(e=[e]),e.forEach(function(e){var i={};i="function"==typeof e?e(r({},l),t.imageSize):e,u(i.width)&&u(i.height)||(l=s(l,r({},l,i))),u(i.left)&&u(i.top)||(l=n(l,r({},l,i)))}),i?this.autoZoom(l):(1<this.worldTransforms.scale&&this.resetWorldTransforms(),this.updateStencilCoordinates(l)),this.onChangeCoordinates(l,!1),l},resetWorldTransforms:function(){this.worldTransforms={scale:1,shift:{left:0,top:0}}},resetCoordinates:function(){var e=this;if(this.$refs.image){var t=this.$refs.cropper,i=this.$refs.image,o=this.stencilRestrictions,a=o.minWidth,n=o.minHeight,s=o.maxWidth,c=o.maxHeight,h=o.widthFrozen,d=o.heightFrozen;this.frozenDirections.width=!!h,this.frozenDirections.height=!!d;var m=O(this.defaultSize,"defaultSize",function(e){return[e.cropper,e.image,{minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight},e.imageWidth,e.imageHeight,e.props]})(r({cropper:t,image:i,imageWidth:this.imageSize.width,imageHeight:this.imageSize.height,props:this.$props,aspectRatio:this.stencilAspectRatios()},this.stencilRestrictions));(m.width<a||m.height<n||m.width>s||m.height>c)&&console.warn("Warning: the default size breaks size restrictions. Check your defaultSize function",m,this.stencilRestrictions);var p=[m,function(o){return r({},O(e.defaultPosition,"defaultPosition",function(e){return[e.cropper,e.image,e.stencilWidth,e.stencilHeight,e.imageWidth,e.imageHeight,e.props]})({cropper:t,image:i,stencilWidth:o.width,stencilHeight:o.height,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height,props:e.$props}))}];this.delayedTransforms&&p.push.apply(p,l(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.resetWorldTransforms(),this.applyTransforms(p),this.delayedTransforms=null}},clearImage:function(){var e=this,t=this.$refs.stretcher;this.imageLoaded=!1,setTimeout(function(){t.style.height="auto",t.style.width="auto",e.coordinates=r({},Ee),e.boundarySize={width:0,height:0},e.updateStencilCoordinates(r({},Ee))},this.transitionTime)},refreshImage:function(){var e=this;return new Promise(function(i,o){var a=e.$refs.image,n=e.$refs.cropper;if(e.src&&a){var s=e.$refs.stretcher;e.imageTransforms.flipped?(e.imageSize.height=a.naturalWidth,e.imageSize.width=a.naturalHeight):(e.imageSize.height=a.naturalHeight,e.imageSize.width=a.naturalWidth);var r=e.imageSize.width/e.imageSize.height;e.imageSize.height>e.imageSize.width?(s.style.height="".concat(e.imageSize.height,"px"),s.style.width="".concat(s.clientHeight*r,"px"),s.clientWidth/s.clientHeight!=r&&(s.style.height="".concat(s.clientWidth/r,"px"))):(s.style.width="".concat(e.imageSize.width,"px"),s.style.height="".concat(s.clientWidth/r,"px"),s.clientHeight/s.clientWidth!=r&&(s.style.width="".concat(s.clientHeight*r,"px"))),t.nextTick(function(){var t=O(e.areaSize,"areaSize",function(e){return[e.cropper,e.image,e.imageWidth,e.imageHeight]})({cropper:n,image:a,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height}),o=t.height,s=t.width;o&&(e.boundarySize.height=o),s&&(e.boundarySize.width=s),i()})}else o()})},getAllowedArea:function(e){return this.allowedArea({breakBoundaries:e,imageSize:this.imageSize,worldTransforms:this.worldTransforms,imageRestriction:this.imageRestriction})},stencilAspectRatios:function(){return this.$refs.stencil.aspectRatios?this.$refs.stencil.aspectRatios():{minimum:this.stencilProps.aspectRatio||this.stencilProps.minAspectRatio,maximum:this.stencilProps.aspectRatio||this.stencilProps.maxAspectRatio}}}},Fe=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cropper",class:e.classes.cropper},[i("div",{class:e.classes.background,style:e.areaStyle}),e._v(" "),i("div",{ref:"stretcher",class:e.classes.stretcher}),e._v(" "),i("div",{ref:"area",class:e.classes.area,style:e.areaStyle},[i("CropperWrapper",{class:e.classes.cropperWrapper,attrs:{"wheel-resize":e.settings.wheelResize,"touch-resize":e.settings.touchResize,"touch-move":e.settings.touchMove,"mouse-move":e.settings.touchMove},on:{move:e.onManipulateImage,resize:e.onManipulateImage}},[i("div",{class:e.classes.imageWrapper},[i("img",{ref:"image",class:e.classes.image,style:e.imageStyle,attrs:{crossOrigin:e.imageAttributes.crossOrigin,src:e.imageAttributes.src},on:{mousedown:function(e){e.preventDefault()}}})]),e._v(" "),i(e.stencilComponent,e._b({ref:"stencil",tag:"component",attrs:{img:{src:e.imageAttributes.src,size:e.imageSize,transforms:e.imageTransforms,coefficient:e.coefficient},"result-coordinates":e.coordinates,"stencil-coordinates":e.stencilCoordinates},on:{resize:e.onResize,move:e.onMove}},"component",e.stencilProps,!1)),e._v(" "),e.canvas?i("canvas",{ref:"canvas",style:{display:"none"}}):e._e(),e._v(" "),e.canvas?i("canvas",{ref:"sourceCanvas",style:{display:"none"}}):e._e()],1)],1)])},staticRenderFns:[]},void 0,Oe,void 0,!1,void 0,void 0,void 0),Ne=K("vue-preview-image"),qe={name:"PreviewImage",props:{img:{type:String},classname:{type:String},imageClassname:{type:String},width:{type:Number},height:{type:Number},top:{type:Number},left:{type:Number},previewWidth:{type:Number,required:!0},previewHeight:{type:Number,required:!0}},data:function(){return{imageSize:{width:0,height:0}}},computed:{classnames:function(){return{default:V(Ne(),this.classname),image:V(Ne("image"),this.imageClassname)}},wrapperStyle:function(){return{width:"".concat(this.previewWidth,"px"),height:"".concat(this.previewHeight,"px")}},imageStyle:function(){var e=this.previewHeight/this.height;return{width:"".concat(this.imageSize.width*e,"px"),height:"".concat(this.imageSize.height*e,"px"),left:"".concat(-this.left*e,"px"),top:"".concat(-this.top*e,"px")}}},watch:{img:function(){this.onChangeImage()}},mounted:function(){this.onChangeImage()},methods:{refreshImage:function(){var e=this.$refs.image;this.imageSize.height=e.naturalHeight,this.imageSize.width=e.naturalWidth},onChangeImage:function(){var e=this,t=this.$refs.image;t.complete?this.refreshImage():t.addEventListener("load",function(){e.refreshImage()})}}},je=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img}})])},staticRenderFns:[]},void 0,qe,void 0,!1,void 0,void 0,void 0);t.component("cropper",Fe),t.component("rectangle-stencil",Ye),t.component("circle-stencil",Be),t.component("simple-handler",De),t.component("simple-line",Le),e.BoundingBox=fe,e.CircleStencil=Be,e.Cropper=Fe,e.DragEvent=te,e.DraggableArea=we,e.DraggableElement=ae,e.HandlerWrapper=re,e.LineWrapper=he,e.MoveEvent=ee,e.PreviewImage=je,e.PreviewResult=We,e.RectangleStencil=Ye,e.ResizeEvent=Q,e.SimpleHandler=De,e.SimpleLine=Le,Object.defineProperty(e,"__esModule",{value:!0})});
(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):(e=e||self,t(e["vue-advanced-cropper"]={},e.Vue))})(this,function(e,t){'use strict';var F=Math.floor,N=Math.abs,q=Math.max,j=Math.min,G=Math.ceil,Z=String.fromCharCode;function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var o,a=0;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}function n(e,t,i){return t&&a(e.prototype,t),i&&a(e,i),e}function s(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function r(e){for(var t=1;t<arguments.length;t++){var o=null==arguments[t]?{}:arguments[t],a=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),a.forEach(function(t){s(e,t,o[t])})}return e}function l(e){return c(e)||h(e)||d()}function c(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t<e.length;t++)o[t]=e[t];return o}}function h(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function d(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function m(e,t,i){function o(){var c=Date.now()-r;c<t&&0<=c?a=setTimeout(o,t-c):(a=null,!i&&(l=e.apply(s,n),s=n=null))}var a,n,s,r,l;null==t&&(t=100);var c=function(){s=this,n=arguments,r=Date.now();var c=i&&!a;return a||(a=setTimeout(o,t)),c&&(l=e.apply(s,n),s=n=null),l};return c.clear=function(){a&&(clearTimeout(a),a=null)},c.flush=function(){a&&(l=e.apply(s,n),s=n=null,clearTimeout(a),a=null)},c}function p(e,t){var i,o;return e&&t?(i="".concat(e).concat(t[0].toUpperCase()).concat(t.slice(1)),o="".concat(e,"-").concat(t)):(i=e||t,o=e||t),{name:i,classname:o}}function g(e){return /^data:/.test(e)||/^blob:/.test(e)}function f(e){if(g(e))return!1;var t=window.location,i=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/,o=i.exec(e)||[],a={protocol:o[1]||"",host:o[2]||"",port:o[3]||""},n=function(e){return{"http:":80,"https:":443}[e]},s=function(e){return e.port||n(e.protocol||t.protocol)};return(a.protocol||a.host||a.port)&&!!!(a.protocol&&a.protocol==t.protocol&&a.host&&a.host==t.host&&a.host&&s(a)==s(t))}function u(e){return"undefined"==typeof e}function v(e){return"object"===i(e)&&null!==e}function w(e){var t="timestamp=".concat(new Date().getTime());return e+(-1===e.indexOf("?")?"?":"&")+t}function b(e,t){var i=Math.pow;return Math.sqrt(i(e.x-t.x,2)+i(e.y-t.y,2))}function y(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=r({enabled:!!e},t);return v(e)&&(i=r({},i,e)),i}function x(e){var t=Number.isNaN,i=+e;return t(i)?e:i}function C(e,t,i){var o=Math.PI,a=i.flipped,n=i.orientation,s=t.naturalWidth,r=t.naturalHeight,l=e.getContext("2d");return e.width=s,e.height=r,l.save(),a&&(e.width=r,e.height=s),2==n?(l.translate(s,0),l.scale(-1,1)):3==n?(l.translate(s,r),l.rotate(1*o)):4==n?(l.translate(0,r),l.scale(1,-1)):5==n?(l.rotate(90/180*o),l.scale(1,-1)):6==n?(l.rotate(90/180*o),l.translate(0,-r)):7==n?(l.rotate(270/180*o),l.translate(-s,r),l.scale(1,-1)):8==n&&(l.translate(0,s),l.rotate(270/180*o)),l.drawImage(t,0,0,s,r),l.restore(),e}function z(e){var t={orientation:e};return e&&(2===e?t.scaleX=-1:3===e?t.rotate=-180:4===e?t.scaleY=-1:5===e?(t.rotate=90,t.scaleY=-1):6===e?t.rotate=90:7===e?(t.rotate=90,t.scaleX=-1):8===e?t.rotate=-90:void 0),(90===t.rotate||-90===t.rotate)&&(t.flipped=!0),t}function E(e){var t=e.rotate,i=e.scaleX,o=e.scaleY,a="";return(t||i||o)&&(t&&(a+=" rotate(".concat(t,"deg) ")),i&&(a+=" scaleX(".concat(i,") ")),o&&(a+=" scaleY(".concat(o,") "))),a}function S(e){return new Promise(function(t){R(e).then(function(i){t(i?{source:e,arrayBuffer:i,orientation:H(i)}:{source:e,arrayBuffer:null,orientation:null})}).catch(function(i){console.warn(i),t({source:e,arrayBuffer:null,orientation:null})})})}function R(e){return new Promise(function(t,i){try{if(!e)i("Error: the image is empty");else if(/^data:/i.test(e))t(T(e));else if(/^blob:/i.test(e)){var o=new FileReader;o.onload=function(i){t(i.target.result)},W(e,function(e){o.readAsArrayBuffer(e)})}else{var a=new XMLHttpRequest;a.onreadystatechange=function(){4!==this.readyState||(200===this.status||0===this.status?t(this.response):i("Warning: could not load an image to parse its orientation"),a=null)},a.onprogress=function(){"image/jpeg"!==a.getResponseHeader("content-type")&&a.abort()},a.withCredentials=!1,a.open("GET",e,!0),a.responseType="arraybuffer",a.send(null)}}catch(t){i(t)}})}function W(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="blob",i.onload=function(){(200==this.status||0===this.status)&&t(this.response)},i.send()}function T(e){e=e.replace(/^data:([^;]+);base64,/gmi,"");for(var t=atob(e),o=t.length,a=new ArrayBuffer(o),n=new Uint8Array(a),s=0;s<o;s++)n[s]=t.charCodeAt(s);return a}function M(e,t,o){var a,n="";for(a=t,o+=t;a<o;a++)n+=Z(e.getUint8(a));return n}function H(e){try{var t,o,a,n,s,r,l=new DataView(e);if(255===l.getUint8(0)&&216===l.getUint8(1))for(var c=l.byteLength,h=2;h+1<c;){if(255===l.getUint8(h)&&225===l.getUint8(h+1)){s=h;break}h++}if(s&&(o=s+4,a=s+10,"Exif"===M(l,o,4))){var d=l.getUint16(a);if(n=18761===d,(n||19789===d)&&42===l.getUint16(a+2,n)){var m=l.getUint32(a+4,n);8<=m&&(r=a+m)}}if(r)for(var p,g=l.getUint16(r,n),f=0;f<g;f++)if(p=r+12*f+2,274===l.getUint16(p,n)){p+=8,t=l.getUint16(p,n),l.setUint16(p,1,n);break}return t}catch(e){return null}}function A(e){for(var t=[],i=8192,o=new Uint8Array(e);0<o.length;){var a=o.subarray(0,i);t.push(Z.apply(null,Array.from?Array.from(a):Array.slice(a))),o=o.subarray(i)}return"data:image/jpeg;base64,".concat(btoa(t.join("")))}function D(e){return{left:e.left,top:e.top,right:e.left+e.width,bottom:e.top+e.height}}function $(e){if("right"===e)return"left";return"bottom"===e?"top":"left"===e||"top"===e?e:void 0}function P(e,t){return e.width+(t.left+t.right)}function L(e,t){return e.height+(t.top+t.bottom)}function _(e,t,i){return{left:"left"in i?-j(0,G(e.left-i.left)-t.left):0,top:"top"in i?-j(0,G(e.top-i.top)-t.top):0,bottom:"bottom"in i?-j(0,i.bottom-(e.bottom+t.bottom)):0,right:"right"in i?-j(0,i.right-(e.right+t.right)):0}}function I(e){var t=e.directions,i=e.coordinates,o=e.restrictions,a=e.preserveAspectRatio,n=e.stopOnBreak,s=e.mode,c=void 0===s?"crop":s,h=e.allowedArea,d=void 0===h?{}:h,m=r({},t),p=P(i,m),g=L(i,m);0>p&&(0>m.left&&0>m.right?(m.left=-(i.width-o.minWidth)/(m.left/m.right),m.right=-(i.width-o.minWidth)/(m.right/m.left)):0>m.left?m.left=-(i.width-o.minWidth):0>m.right&&(m.right=-(i.width-o.minWidth))),0>g&&(0>m.top&&0>m.bottom?(m.top=-(i.height-o.minHeight)/(m.top/m.bottom),m.bottom=-(i.height-o.minHeight)/(m.bottom/m.top)):0>m.top?m.top=-(i.height-o.minHeight):0>m.bottom&&(m.bottom=-(i.height-o.minHeight)));var f=_(i,m,d);"move"===c&&(0<f.left&&0===f.right?(m.right+=f.left,m.left-=f.left):0<f.right&&0===f.left&&(m.left+=f.right,m.right-=f.right),0<f.top&&0===f.bottom?(m.bottom+=f.top,m.top-=f.top):0<f.bottom&&0===f.top&&(m.top+=f.bottom,m.bottom-=f.bottom),f=_(i,m,d));var u={width:1/0,height:1/0};if(xe.forEach(function(e){u[e]=f[e]&&m[e]?q(0,1-f[e]/m[e]):1/0}),a){var v=j.apply(Math,l(xe.map(function(e){return u[e]})));v!==1/0&&xe.forEach(function(e){m[e]*=v})}else be.forEach(function(e){var t=n?j(u.top,u.bottom):u[e];t!==1/0&&(m[e]*=t)}),ye.forEach(function(e){var t=n?j(u.top,u.bottom):u[e];t!==1/0&&(m[e]*=t)});if(p=P(i,m),g=L(i,m),m.right+m.left&&(p>o.maxWidth?u.width=(o.maxWidth-i.width)/(m.right+m.left):p<o.minWidth&&(u.width=(o.minWidth-i.width)/(m.right+m.left))),m.bottom+m.top&&(g>o.maxHeight?u.height=(o.maxHeight-i.height)/(m.bottom+m.top):g<o.minHeight&&(u.height=(o.minHeight-i.height)/(m.bottom+m.top))),a){var w=j(u.width,u.height);w!==1/0&&xe.forEach(function(e){m[e]*=w})}else u.width!==1/0&&be.forEach(function(e){m[e]*=u.width}),u.height!==1/0&&ye.forEach(function(e){m[e]*=u.height});return m}function Y(e,t,i,o,a){var n;return i.minimum&&e/t<i.minimum?n=i.minimum:i.maximum&&e/t>i.maximum?n=i.maximum:a&&(n=o.width/o.height),n}function X(e){var t=e.coordinates,i=e.allowedArea,o=void 0===i?{}:i,a=e.moveEvent,n=r({},a.directions),s={left:t.left+n.left,top:t.top+n.top,width:t.width,height:t.height};return"left"in o&&s.left<o.left&&(s.left=o.left),"right"in o&&s.left+s.width>o.right&&(s.left=o.right-s.width),"top"in o&&s.top<o.top&&(s.top=o.top),"bottom"in o&&s.top+s.height>o.bottom&&(s.top=o.bottom-s.height),s}function k(e){var t=e.coordinates,i=e.stencilCoordinates,o=e.worldTransforms,a=e.coefficient,n=e.imageSize,s=e.allowedArea,l=r({},o),c={width:l.scale*t.width/a,height:l.scale*t.height/a,left:i.left,top:i.top};l.shift.left-=t.left*l.scale+l.shift.left-i.left*a,l.shift.top-=t.top*l.scale+l.shift.top-i.top*a;var h=1;c.width>n.width/a&&(h=j(h,n.width/a/c.width)),c.height>n.height/a&&(h=j(h,n.height/a/c.height)),1!==h&&(l.scale*=h,c.left+=c.width*(1-h)/2,c.top+=c.height*(1-h)/2,l.shift.left=c.left*a-t.left*l.scale,l.shift.top=c.top*a-t.top*l.scale,c.width*=h,c.height*=h),0>c.left&&(l.shift.left-=c.left*a,c.left=0),0>c.top&&(l.shift.top-=c.top*a,c.top=0),c.left+c.width>n.width/a&&(l.shift.left-=(c.left+c.width)*a-n.width,c.left=n.width/a-c.width),c.top+c.height>n.height/a&&(l.shift.top-=(c.top+c.height)*a-n.height,c.top=n.height/a-c.height);var d={width:n.width*l.scale,height:n.height*l.scale};return l.shift.left>-s.left*l.scale&&(c.left-=(l.shift.left+s.left*l.scale)/a,l.shift.left=-(s.left*l.scale)),l.shift.left<n.width-d.width-(s.right-n.width)*l.scale&&(c.left-=(l.shift.left-(n.width-d.width)+(s.right-n.width)*l.scale)/a,l.shift.left=n.width-d.width-(s.right-n.width)*l.scale),l.shift.top>-s.top*l.scale&&(c.top-=(l.shift.top+s.top*l.scale)/a,l.shift.top=-s.top*l.scale),l.shift.top<n.height-d.height-(s.bottom-n.height)*l.scale&&(c.top-=(l.shift.top-(n.height-d.height)+(s.bottom-n.height)*l.scale)/a,l.shift.top=n.height-d.height-(s.bottom-n.height)*l.scale),{stencilCoordinates:c,worldTransforms:l}}function B(e){var t=e.manipulateImageEvent,i=e.coordinates,o=e.stencilRestrictions,a=e.coefficient,n=e.stencilCoordinates,s=e.worldTransforms,l=e.imageSize,c=e.frozenDirections,h=e.allowedArea,d=e.fitImage,m=t.scale,p=t.move,g=r({},s),f={width:l.width*g.scale,height:l.height*g.scale},u={left:p.left||0,top:p.top||0},v=1,w=1,b=d?1:q("left"in h&&"right"in h?n.width*a/(h.right-h.left):.01,"top"in h&&"bottom"in h?n.height*a/(h.bottom-h.top):.01);if(!c.width&&!c.height&&1e-3<N(m.factor-1)){var y=N(1-v)/2,x=o.maxWidth,C=o.maxHeight,z=o.minWidth,E=o.minHeight;v=m.factor,g.scale/v<b+y&&(v=g.scale/b);var S=i.width*v,R=i.height*v,W={minWidth:S<z+y,minHeight:R<E+y,maxWidth:S>x-y,maxHeight:R>C-y};if(W.minWidth&&(v=z/i.width),W.minHeight&&(v=E/i.height),W.maxHeight||W.maxWidth){var T=v;W.maxWidth&&W.maxHeight?T=j(C/i.height,i.width):W.maxHeight?T=C/i.height:W.maxWidth&&(T=x/i.width),1<=g.scale*v?w=T/v:v=T}var M={width:f.width*(1-1/v),height:f.height*(1-1/v)};u.left+=M.width*N((g.shift.left-m.center.left*a)/f.width),u.top+=M.height*N((g.shift.top-m.center.top*a)/f.height),f.width/=v,f.height/=v}if(g.scale/=v,d)0<G(g.shift.left+u.left)?u.left=-g.shift.left:g.shift.left+u.left<l.width-f.width&&(u.left=l.width-f.width-g.shift.left),0<G(g.shift.top+u.top)?u.top=-g.shift.top:g.shift.top+u.top<l.height-f.height&&(u.top=l.height-f.height-g.shift.top);else{var H={};xe.forEach(function(e){H[e]=e in h?g.shift[$(e)]+u[$(e)]+(h[e]*g.scale-D(n)[e]*a):0}),0<H.left?u.left-=H.left:0>H.right&&(u.left-=H.right),0<H.top?u.top-=H.top:0>H.bottom&&(u.top-=H.bottom)}g.shift.left+=u.left,g.shift.top+=u.top;var A={left:0,top:0};return l.width!==i.width&&1<=g.scale&&(A.left=n.width*(1-w)*(i.left/(l.width-i.width))),l.height!==i.height&&1<=g.scale&&(A.top=n.height*(1-w)*(i.top/(l.height-i.height))),{coordinates:{width:i.width*v*w,height:i.height*v*w,left:(n.left-g.shift.left/a+A.left)*a/g.scale,top:(n.top-g.shift.top/a+A.top)*a/g.scale},worldTransforms:g}}function U(e){var t=Math.round,i=e.coordinates,o=e.restrictions,a=e.allowedArea,n={width:t(i.width),height:t(i.height),left:t(i.left),top:t(i.top)};return n.width>o.maxWidth?n.width=F(i.width):n.width<o.minWidth&&(n.width=G(i.width)),n.height>o.maxHeight?n.height=F(i.height):n.height<o.minHeight&&(n.height=G(i.height)),(n.left<a.left||n.left+n.width>a.right)&&(n.left=F(a.left)),(n.top<a.top||n.top+n.height>a.bottom)&&(n.top=F(a.top)),n}function O(e,t,i){function o(o){return console.warn("The arguments will be passed to the prop '".concat(t,"' as an single object {").concat(Object.keys(o).join(","),"} in the future releases. You should change the interface of your function.")),e.apply(void 0,l(i(o)))}return function(t){if(1<e.length)return o(t);try{return e(t)}catch(i){return o(t)}}}t=t&&t.hasOwnProperty("default")?t["default"]:t;var V=function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e){(function(){function t(){for(var e,o=[],a=0;a<arguments.length;a++)if(e=arguments[a],e){var n=typeof e;if("string"===n||"number"===n)o.push(e);else if(Array.isArray(e)&&e.length){var s=t.apply(null,e);s&&o.push(s)}else if("object"===n)for(var r in e)i.call(e,r)&&e[r]&&o.push(r)}return o.join(" ")}var i={}.hasOwnProperty;e.exports?(t.default=t,e.exports=t):window.classNames=t})()}),K=function(e){return function(t,i){if(!t)return e;var o;"string"==typeof t?o=t:i=t;var a=e;return o&&(a+="__"+o),a+(i?Object.keys(i).reduce(function(e,t){var o=i[t];return o&&(e+=" "+("boolean"==typeof o?a+"--"+t:a+"--"+t+"_"+o)),e},""):"")}};m.debounce=m;var J=function e(t){var i=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{};o(this,e),this.nativeEvent=t,this.move=i,this.scale=a,this.params=n},Q=function e(t,i){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};o(this,e),this.nativeEvent=t,this.directions=i,this.params=a},ee=function e(t,i){o(this,e),this.nativeEvent=t,this.directions=i},te=function(){function e(t,i,a,n,s){o(this,e),this.nativeEvent=t,this.position=a,this.previousPosition=n,this.element=i,this.anchor=s}return n(e,[{key:"shift",value:function(){var e=this.element,t=this.anchor,i=this.position,o=e.getBoundingClientRect(),a=o.left,n=o.top;return{left:i.left-a-t.left,top:i.top-n-t.top}}}]),e}(),ie={name:"DraggableElement",mixins:[{beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){if(!this.$refs.draggable)throw new Error("You should add ref \"draggable\" to your root element to use draggable mixin");this.touches=[],this.draggingAnchor=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit("enter"))},onMouseLeave:function(){this.hovered&&(this.hovered=!1,this.$emit("leave"))},onTouchStart:function(t){t.cancelable&&!this.disabled&&1===t.touches.length&&(this.touches=l(t.touches),!this.hovered&&this.$emit("enter"),t.touches.length&&this.initAnchor(this.touches.reduce(function(e,i){return{clientX:e.clientX+i.clientX/t.touches.length,clientY:e.clientY+i.clientY/t.touches.length}},{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){if(!this.disabled){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.preventDefault())},onMouseUp:function(){this.touches=[]},initAnchor:function(e){var t=this.$refs.draggable,i=t.getBoundingClientRect(),o=i.left,a=i.right,n=i.bottom,s=i.top;this.anchor={left:e.clientX-o,top:e.clientY-s,bottom:n-e.clientY,right:a-e.clientX}},processMove:function(e,t){var i=l(t);if(this.touches.length){if(1===this.touches.length&&1===i.length){var o=this.$refs.draggable;this.$emit("drag",new te(e,o,{left:i[0].clientX,top:i[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=i}},processEnd:function(){this.touches=[],this.hovered&&(this.$emit("leave"),this.hovered=!1)}}}],props:{classname:{type:String}}},oe=function(e,t,i,o,a,n,s,r,l,c){"boolean"!=typeof s&&(l=r,r=s,s=!1);var h="function"==typeof i?i.options:i;e&&e.render&&(h.render=e.render,h.staticRenderFns=e.staticRenderFns,h._compiled=!0,a&&(h.functional=!0)),o&&(h._scopeId=o);var d;if(n?(d=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(n)},h._ssrRegister=d):t&&(d=s?function(){t.call(this,c(this.$root.$options.shadowRoot))}:function(e){t.call(this,r(e))}),d)if(h.functional){var m=h.render;h.render=function(e,t){return d.call(t),m(e,t)}}else{var p=h.beforeCreate;h.beforeCreate=p?[].concat(p,d):[d]}return i},ae=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"draggable",class:e.classname,on:{touchstart:e.onTouchStart,mousedown:e.onMouseDown,mouseover:e.onMouseOver,mouseleave:e.onMouseLeave}},[e._t("default")],2)},staticRenderFns:[]},void 0,ie,void 0,!1,void 0,void 0,void 0),ne=K("vue-handler-wrapper"),se={name:"HandlerWrapper",components:{DraggableElement:ae},props:{horizontalPosition:{type:String},verticalPosition:{type:String},classname:{type:String},disabled:{type:Boolean,default:!1}},computed:{classnames:function(){var e;if(this.horizontalPosition||this.verticalPosition){var t,i=p(this.horizontalPosition,this.verticalPosition);e=V(this.classname,ne((t={},s(t,i.classname,!0),s(t,"disabled",this.disabled),t)))}else e=V(this.classname,ne({disabled:this.disabled}));return{default:e,draggable:ne("draggable")}}}},re=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default},[i("DraggableElement",{class:e.classnames.draggable,attrs:{disabled:e.disabled},on:{drag:function(t){return e.$emit("drag",t)},leave:function(){return e.$emit("leave")},enter:function(){return e.$emit("enter")}}},[e._t("default")],2)],1)},staticRenderFns:[]},void 0,se,void 0,!1,void 0,void 0,void 0),le=K("vue-line-wrapper"),ce={name:"LineWrapper",components:{DraggableElement:ae},props:{position:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classname:function(){var e;return le((e={},s(e,this.position,!0),s(e,"disabled",this.disabled),e))}}},he=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("DraggableElement",{class:e.classname,attrs:{disabled:e.disabled},on:{drag:function(t){return e.$emit("drag",t)},leave:function(){return e.$emit("leave")},enter:function(){return e.$emit("enter")}}},[e._t("default")],2)},staticRenderFns:[]},void 0,ce,void 0,!1,void 0,void 0,void 0),de=K("vue-bounding-box"),me=["east","west",null],pe=["south","north",null],ge={name:"BoundingBox",props:{classname:{type:String},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlerComponent:{type:[Object,String]},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},lineComponent:{type:[Object,String]},linesClassnames:{type:Object,default:function(){return{}}},scalable:{type:Boolean,default:!0}},data:function(){var e=[];return me.forEach(function(t){pe.forEach(function(i){if(t!==i){var o=p(t,i),a=o.name,n=o.classname;e.push({name:a,classname:n,verticalDirection:i,horizontalDirection:t})}})}),{points:e}},computed:{classnames:function(){var e=this.handlersClassnames,t=this.linesClassnames;return{default:V(de(),this.classname),handlers:e,lines:t}},lineNodes:function(){var e=this,t=[];return this.points.forEach(function(i){i.horizontalDirection&&i.verticalDirection||!e.lines[i.name]||t.push({name:i.name,component:e.lineComponent,classname:V(e.classnames.lines.default,e.classnames.lines[i.name],!e.scalable&&e.classnames.lines.disabled),hoverClassname:e.classnames.lines.hover,verticalDirection:i.verticalDirection,horizontalDirection:i.horizontalDirection,disabled:!e.scalable})}),t},handlerNodes:function(){var e=this,t=[];return this.points.forEach(function(i){e.handlers[i.name]&&t.push({name:i.name,component:e.handlerComponent,classname:V(e.classnames.handlers.default,e.classnames.handlers[i.name]),hoverClassname:e.classnames.handlers.hover,verticalDirection:i.verticalDirection,horizontalDirection:i.horizontalDirection,disabled:!e.scalable})}),t}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[]},methods:{onHandlerDrag:function(e,t,i){var o=e.shift(),a=o.left,n=o.top,s={left:0,right:0,top:0,bottom:0};"west"===t?s.left-=a:"east"==t&&(s.right+=a),"north"===i?s.top-=n:"south"==i&&(s.bottom+=n);var r;!i&&t?r="width":i&&!t&&(r="height"),this.scalable&&this.$emit("resize",new Q(e.nativeEvent,s,{allowedDirections:{left:"west"===t||!t,right:"east"===t||!t,bottom:"south"===i||!i,top:"north"===i||!i},preserveAspectRatio:e.nativeEvent.shiftKey,respectDirection:r}))}}},fe=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"box",class:e.classnames.default},[e._t("default"),e._v(" "),i("div",e._l(e.lineNodes,function(t){return i(t.component,{key:t.name,tag:"component",attrs:{classname:t.classname,"hover-classname":t.hoverClassname,position:t.name,disabled:t.disabled},on:{drag:function(i){return e.onHandlerDrag(i,t.horizontalDirection,t.verticalDirection)}}})}),1),e._v(" "),i("div",e._l(e.handlerNodes,function(t){return i(t.component,{key:t.name,tag:"component",attrs:{classname:t.classname,"hover-classname":t.hoverClassname,"horizontal-position":t.horizontalDirection,"vertical-position":t.verticalDirection,disabled:t.disabled},on:{drag:function(i){return e.onHandlerDrag(i,t.horizontalDirection,t.verticalDirection)}}})}),1)],2)},staticRenderFns:[]},void 0,ge,void 0,!1,void 0,void 0,void 0),ue=K("vue-draggable-area"),ve={name:"DraggableArea",props:{movable:{type:Boolean,default:!0},activationDistance:{type:Number,default:10}},computed:{classnames:function(){return{default:V(ue(),this.classname)}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.touchStarted=!1},methods:{onTouchStart:function(t){if(t.cancelable){var e=this.movable&&1===t.touches.length;e&&(this.touches=l(t.touches)),(this.touchStarted||e)&&(t.preventDefault(),t.stopPropagation())}},onTouchEnd:function(){this.touchStarted=!1,this.processEnd()},onTouchMove:function(t){1<=this.touches.length&&(this.touchStarted?(this.processMove(t,t.touches),t.preventDefault(),t.stopPropagation()):b({x:this.touches[0].clientX,y:this.touches[0].clientY},{x:t.touches[0].clientX,y:t.touches[0].clientY})>this.activationDistance&&(this.initAnchor({clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}),this.touchStarted=!0))},onMouseDown:function(t){if(this.movable){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault(),t.stopPropagation())},onMouseUp:function(){this.touches=[]},initAnchor:function(e){var t=this.$refs.container,i=t.getBoundingClientRect(),o=i.left,a=i.top;this.anchor={x:e.clientX-o,y:e.clientY-a}},processMove:function(e,t){var i=l(t);if(this.touches.length){var o=this.$refs.container,a=o.getBoundingClientRect(),n=a.left,s=a.top;1===this.touches.length&&1===i.length&&this.$emit("move",new ee(e,{left:i[0].clientX-n-this.anchor.x,top:i[0].clientY-s-this.anchor.y}))}},processEnd:function(){this.touches=[]}}},we=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"container",on:{touchstart:e.onTouchStart,mousedown:e.onMouseDown}},[e._t("default")],2)},staticRenderFns:[]},void 0,ve,void 0,!1,void 0,void 0,void 0),be=["left","right"],ye=["top","bottom"],xe=["left","right","top","bottom"],Ce=["area","stencil","none"],ze=.1,Ee={left:0,top:0,width:0,height:0},Se=K("vue-preview-result"),Re={name:"PreviewResult",props:{img:{type:Object},classname:{type:String},imageClassname:{type:String},stencilCoordinates:{type:Object,default:function(){return{width:0,height:0,left:0,top:0}}}},computed:{classnames:function(){return{default:V(Se(),this.classname),image:V(Se("image"),this.imageClassname),wrapper:Se("wrapper")}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"calc(50% - ".concat(this.stencilCoordinates.width/2,"px)"),top:"calc(50% - ".concat(this.stencilCoordinates.height/2,"px)")}},imageStyle:function(){var e=this.img.transforms,t=e.flipped,i=this.img.coefficient,o=this.img.size.height/i,a=this.img.size.width/i,n={width:"".concat(a,"px"),height:"".concat(o,"px")};return t?(n.width="".concat(o,"px"),n.height="".concat(a,"px"),n.left="".concat(-this.stencilCoordinates.left-(o-a)/2+e.translateX,"px"),n.top="".concat(-this.stencilCoordinates.top-(a-o)/2+e.translateY,"px")):(n.left="".concat(-this.stencilCoordinates.left+e.translateX,"px"),n.top="".concat(-this.stencilCoordinates.top+e.translateY,"px")),n.transform=E(e),n}}},We=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default},[i("div",{ref:"wrapper",class:e.classnames.wrapper,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img.src}})])])},staticRenderFns:[]},void 0,Re,void 0,!1,void 0,void 0,void 0),Te={name:"CropperWrapper",props:{touchMove:{type:Object,required:!0},mouseMove:{type:Object,required:!0},touchResize:{type:Object,required:!0},wheelResize:{type:Object,required:!0}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[]},methods:{onTouchStart:function(t){if(t.cancelable&&(this.touchMove.enabled||this.touchResize.enabled&&1<t.touches.length)){var e=this.$refs.container,i=e.getBoundingClientRect(),o=i.left,a=i.top,n=i.bottom,s=i.right;this.touches=l(t.touches).filter(function(e){return e.clientX>o&&e.clientX<s&&e.clientY>a&&e.clientY<n}),this.oldGeometricProperties=this.calculateGeometricProperties(this.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation()}},onTouchEnd:function(t){0===t.touches.length&&this.processEnd()},onTouchMove:function(t){var e=this;if(this.touches.length){var i=l(t.touches).filter(function(t){return!t.identifier||e.touches.find(function(e){return e.identifier===t.identifier})});this.processMove(t,i),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation()}},onMouseDown:function(t){if(this.mouseMove&&"buttons"in t&&1===t.buttons){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault())},onMouseUp:function(){this.touches=[]},calculateGeometricProperties:function(e){var t=this.$refs.container,i=t.getBoundingClientRect(),o=i.left,a=i.top,n={left:0,top:0},s=0;return e.forEach(function(t){n.left+=(t.clientX-o)/e.length,n.top+=(t.clientY-a)/e.length}),e.forEach(function(e){s+=b({x:n.left,y:n.top},{x:e.clientX-o,y:e.clientY-a})}),{centerMass:n,spread:s,count:e.length}},processMove:function(e,t){if(this.touches.length){if(1===this.touches.length&&1===t.length&&this.touchMove.enabled)this.$emit("move",new J(e,{left:t[0].clientX-this.touches[0].clientX,top:t[0].clientY-this.touches[0].clientY}));else if(1<this.touches.length&&this.touchResize){var i=this.oldGeometricProperties,o=this.calculateGeometricProperties(t);i.count===o.count&&1<i.count&&this.$emit("resize",new J(e,{left:o.centerMass.left-i.centerMass.left,top:o.centerMass.top-i.centerMass.top},{factor:i.spread/o.spread,center:o.centerMass})),this.oldGeometricProperties=o}this.touches=t}},processEnd:function(){this.touches=[]},onWheel:function(e){if(this.wheelResize.enabled){var t=this.$refs.container,i=t.getBoundingClientRect(),o=i.left,a=i.top,n=1+this.wheelResize.ratio*Math.sign(e.deltaY||e.detail||e.wheelDelta),s={left:e.clientX-o,top:e.clientY-a};this.$emit("resize",new J(e,{},{factor:n,center:s})),e.preventDefault(),e.stopPropagation()}}}},Me=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"container",on:{touchstart:e.onTouchStart,mousedown:e.onMouseDown,wheel:e.onWheel}},[e._t("default")],2)},staticRenderFns:[]},void 0,Te,void 0,!1,void 0,void 0,void 0),He=K("vue-square-handler"),Ae={name:"SimpleHandler",components:{HandlerWrapper:re},props:{classname:{type:String},hoverClassname:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},computed:{classnames:function(){return{default:V(He(s({},this.position,!0)),this.classname,this.hover&&this.hoverClassname)}}},methods:{onDrag:function(e){this.$emit("drag",e)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1}}},De=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("HandlerWrapper",{attrs:{"vertical-position":e.verticalPosition,"horizontal-position":e.horizontalPosition,disabled:e.disabled},on:{drag:e.onDrag}},[i("div",{class:e.classnames.default})])},staticRenderFns:[]},void 0,Ae,void 0,!1,void 0,void 0,void 0),$e=K("vue-simple-line"),Pe={name:"SimpleLine",components:{LineWrapper:he},props:{classname:{type:String},hoverClassname:{type:String},position:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classnames:function(){return{default:V($e(s({},this.position,!0)),this.classname,this.hover&&this.hoverClassname)}}},methods:{onDrag:function(e){this.$emit("drag",e)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1}}},Le=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("LineWrapper",{attrs:{position:e.position,disabled:e.disabled},on:{enter:e.onEnter,leave:e.onLeave,drag:e.onDrag}},[i("div",{class:e.classnames.default})])},staticRenderFns:[]},void 0,Pe,void 0,!1,void 0,void 0,void 0),_e=K("vue-rectangle-stencil"),Ie={name:"RectangleStencil",components:{PreviewResult:We,BoundingBox:fe,DraggableArea:we},props:{img:{type:Object},resultCoordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlerComponent:{type:[Object,String],default:function(){return De}},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object},lineComponent:{type:[Object,String],default:function(){return Le}},linesClassnames:{type:Object,default:function(){return{}}},classname:{type:String},previewClassname:{type:String},boundingBoxClassname:{type:String},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},scalable:{type:Boolean,default:!0}},computed:{classes:function(){return{stencil:V(_e({movable:this.movable}),this.classname),preview:V(_e("preview"),this.previewClassname),boundingBox:V(_e("bounding-box"),this.boundingBoxClassname)}},style:function(){var e=this.stencilCoordinates,t=e.height,i=e.width,o=e.left,a=e.top;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(o,"px"),top:"".concat(a,"px")}}},methods:{onMove:function(e){this.$emit("move",e)},onResize:function(e){this.$emit("resize",e)},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}}},Ye=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classes.stencil,style:e.style},[i("BoundingBox",{attrs:{classname:e.classes.boundingBox,handlers:e.handlers,"handler-component":e.handlerComponent,"handlers-classnames":e.handlersClassnames,lines:e.lines,"line-component":e.lineComponent,"lines-classnames":e.linesClassnames,scalable:e.scalable},on:{resize:e.onResize}},[i("DraggableArea",{attrs:{movable:e.movable},on:{move:e.onMove}},[i("PreviewResult",{attrs:{img:e.img,classname:e.classes.preview,"result-coordinates":e.resultCoordinates,"stencil-coordinates":e.stencilCoordinates}})],1)],1)],1)},staticRenderFns:[]},void 0,Ie,void 0,!1,void 0,void 0,void 0),Xe=K("vue-circle-stencil"),ke={name:"CircleStencil",components:{PreviewResult:We,BoundingBox:fe,DraggableArea:we},props:{img:{type:Object},stencilClass:{type:String},resultCoordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,westNorth:!0,westSouth:!0,eastSouth:!0}}},handlerComponent:{type:[Object,String],default:function(){return De}},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object},lineComponent:{type:[Object,String],default:function(){return Le}},linesClassnames:{type:Object,default:function(){return{}}},classname:{type:String},previewClassname:{type:String},boundingBoxClassname:{type:String},movable:{type:Boolean,default:!0},scalable:{type:Boolean,default:!0}},computed:{classes:function(){return{stencil:V(Xe(),this.classname),preview:V(Xe("preview"),this.previewClassname),boundingBox:V(Xe("bounding-box"),this.boundingBox)}},style:function(){var e=this.stencilCoordinates,t=e.height,i=e.width,o=e.left,a=e.top;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(o,"px"),top:"".concat(a,"px")}}},methods:{onMove:function(e){this.$emit("move",e)},onResize:function(e){this.$emit("resize",e)},aspectRatios:function(){return{minimum:1,maximum:1}}}},Be=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classes.stencil,style:e.style},[i("BoundingBox",{attrs:{classname:e.classes.boundingBox,handlers:e.handlers,"handler-component":e.handlerComponent,"handlers-classnames":e.handlersClassnames,lines:e.lines,"line-component":e.lineComponent,"lines-classnames":e.linesClassnames,scalable:e.scalable},on:{resize:e.onResize}},[i("DraggableArea",{attrs:{movable:e.movable},on:{move:e.onMove}},[i("PreviewResult",{attrs:{img:e.img,classname:e.classes.preview,"result-coordinates":e.resultCoordinates,"stencil-coordinates":e.stencilCoordinates}})],1)],1)],1)},staticRenderFns:[]},void 0,ke,void 0,!1,void 0,void 0,void 0),Ue=K("vue-advanced-cropper"),Oe={name:"Cropper",components:{CropperWrapper:Me},props:{src:{type:String,default:null},bustCache:{type:Boolean,default:!1},allowedArea:{type:Function,default:function(e){var t=e.breakBoundaries,i=e.imageSize,o=e.worldTransforms,a=e.imageRestriction,n={};if("none"!==a&&(n={left:0,top:0,right:i.width,bottom:i.height}),!t){var s={left:-o.shift.left/o.scale,top:-o.shift.top/o.scale,right:(i.width-o.shift.left)/o.scale,bottom:(i.height-o.shift.top)/o.scale};xe.forEach(function(e){n[e]=u(n[e])?s[e]:"left"===e||"top"===e?q(n[e],s[e]):j(n[e],s[e])})}return n}},resizeAlgorithm:{type:Function,default:function(e){var t=e.coordinates,i=e.restrictions,o=e.allowedArea,a=e.aspectRatio,n=e.resizeEvent,s=r({},t,{right:t.left+t.width,bottom:t.top+t.height}),l=n.params||{},c=r({},n.directions),h=r({},i,{minWidth:q(i.minWidth,.1*(o.right-o.left)),minHeight:q(i.minHeight,.1*(o.bottom-o.top))}),d=l.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};xe.forEach(function(e){d[e]||(c[e]=0)}),c=I({directions:c,restrictions:h,coordinates:s,allowedArea:o,stopOnBreak:l.stopOnBreak});var m=P(s,c),p=L(s,c),g=Y(m,p,a,s,l.preserveAspectRatio);if(g){var f=l.respectDirection;if(f||(s.width>=s.height||1==g?f="width":f="height"),"width"===f){var u=m/g-s.height;d.top&&d.bottom?(c.bottom=u/2,c.top=u/2):d.bottom?c.bottom=u:d.top?c.top=u:d.right?c.right=0:d.left&&(c.left=0)}else if("height"===f){var v=s.width-p*g;d.left&&d.right?(c.left=-v/2,c.right=-v/2):d.left?c.left=-v:d.right?c.right=-v:d.top?c.top=0:d.bottom&&(c.bottom=0)}c=I({directions:c,restrictions:h,coordinates:s,allowedArea:o,preserveAspectRatio:!0,mode:l.compensate&&!l.stopOnBreak?"move":"crop"})}return m=P(s,c),p=L(s,c),g=Y(m,p,a,s,l.preserveAspectRatio),1e-3<N(g-m/p)&&(console.error("Something went wrong and ratio was broken: ".concat(m/p," instead of ").concat(g)),xe.forEach(function(e){d[e]||(c[e]=0)})),X({coordinates:{width:t.width+c.right+c.left,height:t.height+c.top+c.bottom,left:t.left,top:t.top},allowedArea:o,moveEvent:new ee({},{left:-c.left,top:-c.top})})}},moveAlgorithm:{type:Function,default:X},defaultSize:{type:Function,default:function(e){var t,i,o=e.cropper,a=e.image,n=e.minWidth,s=e.minHeight,r=e.maxWidth,l=e.maxHeight,c=e.imageWidth,h=e.imageHeight,d=e.aspectRatio,m=e.props,p=c,g=h,f=c>h?d.maximum:d.minimum;return(c/h>d.maximum||c/h<d.minimum)&&(1>=f?(g=h,p=g*d.maximum):(p=c,g=p/d.minimum)),t=j(l,q(s,.8*g)),i=j(r,q(n,.8*p)),{height:t,width:i}}},defaultPosition:{type:Function,default:function(e){var t=e.cropper,i=e.image,o=e.stencilWidth,a=e.stencilHeight,n=e.imageWidth,s=e.imageHeight,r=e.props;return{left:n/2-o/2,top:s/2-a/2}}},areaSize:{type:Function,default:function(e){var t=e.cropper,i=e.image,o=e.imageWidth,a=e.imageHeight,n=t.clientHeight,s=t.clientWidth,r=n,l=o*n/a;return l>s&&(l=s,r=a*s/o),{width:l,height:r}}},restrictions:{type:Function,default:function(e){var t=e.minWidth,i=e.minHeight,o=e.maxWidth,a=e.maxHeight,n=e.imageWidth,s=e.imageHeight;return{minWidth:t/100*n,minHeight:i/100*s,maxWidth:o/100*n,maxHeight:a/100*s}}},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},stencilComponent:{type:[Object,String],default:function(){return Ye}},stencilProps:{type:Object,default:function(){return{}}},classname:{type:String},imageClassname:{type:String},areaClassname:{type:String},backgroundClassname:{type:String},debounce:{type:Number,default:500},canvas:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},crossOrigin:{type:String,default:"anonymous"},transitionTime:{type:Number,default:300},wheelResize:{type:[Boolean,Object],default:!0},touchResize:{type:[Boolean,Object],default:!0},touchMove:{type:[Boolean,Object],default:!0},mouseMove:{type:[Boolean,Object],default:!0},imageRestriction:{type:String,default:"area",validator:function(e){return-1!==Ce.indexOf(e)}},roundResult:{type:Boolean,default:!0}},data:function(){return{boundarySize:{width:null,height:null},imageLoaded:!1,imageAttributes:{crossOrigin:!1,src:null},basicImageTransforms:{rotate:null,scaleX:null,scaleY:null},imageSize:{width:null,height:null},coordinates:r({},Ee),stencilCoordinates:r({},Ee),frozenDirections:{width:!1,height:!1},worldTransforms:{scale:1,shift:{left:0,top:0}}}},computed:{settings:function e(){var e={touchResize:y(this.touchResize),touchMove:y(this.touchMove),mouseMove:y(this.mouseMove),wheelResize:y(this.wheelResize,{ratio:.1})};return e.touchMove.enabled=e.touchMove.enabled&&(1!==this.worldTransforms.scale||"area"!==this.imageRestriction),e},imageTransforms:function(){return r({},this.basicImageTransforms,{scaleX:(this.basicImageTransforms.scaleX||1)*this.worldTransforms.scale,scaleY:(this.basicImageTransforms.scaleY||1)*this.worldTransforms.scale,translateX:this.worldTransforms.shift.left/this.coefficient+(this.imageSize.width*this.worldTransforms.scale-this.imageSize.width)/2/this.coefficient,translateY:this.worldTransforms.shift.top/this.coefficient+(this.imageSize.height*this.worldTransforms.scale-this.imageSize.height)/2/this.coefficient})},coefficient:function(){return this.imageSize.width?this.imageSize.width/this.boundarySize.width:0},classes:function(){return{cropper:V(Ue(),this.classname),image:V(Ue("image"),this.imageClassname),area:V(Ue("area"),this.areaClassname),stretcher:V(Ue("stretcher")),background:V(Ue("background"),this.backgroundClassname),imageWrapper:V(Ue("image-wrapper")),cropperWrapper:V(Ue("cropper-wrapper"))}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"".concat(this.stencilCoordinates.left,"px"),top:"".concat(this.stencilCoordinates.top,"px")}},areaStyle:function(){return{width:this.boundarySize.width?"".concat(this.boundarySize.width,"px"):"auto",height:this.boundarySize.height?"".concat(this.boundarySize.height,"px"):"auto",opacity:this.imageLoaded?1:0,transition:"opacity ".concat(this.transitionTime,"ms"),pointerEvents:this.imageLoaded?"all":"none"}},imageStyle:function(){var e={left:"calc(50% + ".concat(this.imageTransforms.translateX,"px)"),top:"calc(50% + ".concat(this.imageTransforms.translateY,"px)"),transform:"translate(-50%, -50%)"+E(this.imageTransforms)},t=this.imageTransforms.flipped;return t?(e.width="".concat(this.boundarySize.height,"px"),e.height="".concat(this.boundarySize.width,"px")):(e.width="".concat(this.boundarySize.width,"px"),e.height="".concat(this.boundarySize.height,"px")),e},stencilRestrictions:function(){var e=q(ze*this.imageSize.width/this.coefficient/this.worldTransforms.scale,ze*this.imageSize.height/this.coefficient/this.worldTransforms.scale),t={minWidth:u(this.minWidth)?0:this.minWidth,minHeight:u(this.minHeight)?0:this.minHeight,maxWidth:u(this.maxWidth)?1/0:this.maxWidth,maxHeight:u(this.maxHeight)?1/0:this.maxHeight},i=O(this.restrictions,"restrictions",function(e){return[e.minWidth,e.minHeight,e.maxWidth,e.maxHeight,e.imageWidth,e.imageHeight]})({minWidth:x(t.minWidth),minHeight:x(t.minHeight),maxWidth:x(t.maxWidth),maxHeight:x(t.maxHeight),imageWidth:this.imageSize.width,imageHeight:this.imageSize.height,props:this.$props});return u(i.minWidth)&&(i.minWidth=F(e)),u(i.minHeight)&&(i.minHeight=F(e)),i.minWidth>i.maxWidth&&(console.warn("Warning: maximum width (".concat(i.maxWidth,"px) fewer that the minimum width (").concat(i.minWidth,"px). It is set equal to the minimum width and width resizing was blocked")),i.maxWidth=i.minWidth,i.widthFrozen=!0),i.minHeight>i.maxHeight&&(console.warn("Warning: maximum height (".concat(i.maxHeight,"px) fewer that the minimum height (").concat(i.minHeight,"px). It is set equal to the minimum height and height resizing was blocked")),i.maxHeight=i.minHeight,i.heightFrozen=!0),"none"!==this.imageRestriction&&((!i.maxWidth||i.maxWidth>this.imageSize.width)&&(i.maxWidth=this.imageSize.width),(!i.maxHeight||i.maxHeight>this.imageSize.height)&&(i.maxHeight=this.imageSize.height)),i}},watch:{src:function(){this.onChangeImage()},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.resetCoordinates()},stencilProps:function(e,i){["aspectRatio","minAspectRatio","maxAspectRatio"].find(function(t){return e[t]!==i[t]})&&t.nextTick(this.onPropsChange)}},mounted:function(){var e=this;this.debouncedUpdate=m(this.update,this.debounce),window.addEventListener("resize",this.onResizeWindow),window.addEventListener("orientationchange",this.onResizeWindow),this.$refs.image.addEventListener("load",function(){e.onSuccessLoadImage()}),this.$refs.image.addEventListener("error",function(){e.onFailLoadImage()}),this.onChangeImage()},destroyed:function(){window.removeEventListener("resize",this.refreshImage),window.removeEventListener("orientationchange",this.refreshImage)},methods:{getResult:function(){var e=this.prepareResult(r({},this.coordinates));return this.canvas&&this.src&&this.imageLoaded?(this.updateCanvas(this.coordinates),{coordinates:e,canvas:this.$refs.canvas}):{coordinates:e}},prepareResult:function(e){return this.roundResult?U({coordinates:e,restrictions:this.restrictions,allowedArea:this.getAllowedArea()}):e},getArea:function(){return this.$refs.area},getStencil:function(){return this.$refs.stencil},autoZoom:function(e){var t=k({coordinates:e,stencilCoordinates:this.stencilCoordinates,worldTransforms:this.worldTransforms,coefficient:this.coefficient,imageSize:this.imageSize,allowedArea:this.getAllowedArea(!0)}),i=t.worldTransforms,o=t.stencilCoordinates;this.worldTransforms=i,this.stencilCoordinates=o},updateStencilCoordinates:function(e){var t=e.width,i=e.height,o=e.left,a=e.top;this.stencilCoordinates={width:this.worldTransforms.scale*t/this.coefficient,height:this.worldTransforms.scale*i/this.coefficient,left:(o*this.worldTransforms.scale+this.worldTransforms.shift.left)/this.coefficient,top:(a*this.worldTransforms.scale+this.worldTransforms.shift.top)/this.coefficient}},updateCanvas:function(e){if(this.$refs.canvas){var t=this.$refs.image,i=this.checkOrientation?C(this.$refs.sourceCanvas,t,this.imageTransforms):t,o=this.$refs.canvas;o.width=e.width,o.height=e.height;var a=o.getContext("2d");a.drawImage(i,e.left,e.top,e.width,e.height,0,0,e.width,e.height)}},update:function(){this.$emit("change",this.getResult())},onResizeWindow:function(){var e=this,t=this.$refs.image;this.src&&t&&this.refreshImage().then(function(){e.updateStencilCoordinates(e.coordinates)})},onChangeCoordinates:function(e){var t=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1];this.coordinates=e,this.$listeners&&this.$listeners.change&&(t?this.debouncedUpdate():this.update())},onChangeImage:function(){var e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.imageAttributes.src=null,this.src){var t=f(this.src);t&&this.canvas&&this.checkCrossOrigin&&(this.imageAttributes.crossOrigin=this.crossOrigin),setTimeout(function(){var t=e.bustCache?w(e.src):e.src;e.checkOrientation?S(t).then(e.onParseImage):e.onParseImage({source:t})},this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.clearImage(),this.$emit("error")},onSuccessLoadImage:function(){var e=this;this.$refs.image&&!this.imageLoaded&&(this.imageLoaded=!0,this.refreshImage().then(function(){e.resetCoordinates(),e.$emit("ready")}))},onParseImage:function(e){var i=this,o=e.source,a=e.arrayBuffer,n=e.orientation;this.imageAttributes.src=a&&n&&g(o)?A(a):o,this.basicImageTransforms=z(n),t.nextTick(function(){var e=i.$refs.image;e&&e.complete&&(e.naturalWidth?i.onSuccessLoadImage():i.onFailLoadImage())})},onResize:function(e){var t=this;this.frozenDirections.width&&(e.directions.left=0,e.directions.right=0),this.frozenDirections.height&&(e.directions.top=0,e.directions.bottom=0),xe.forEach(function(i){e.directions[i]/=t.worldTransforms.scale/t.coefficient}),this.onChangeCoordinates(this.resizeAlgorithm({coordinates:this.coordinates,restrictions:this.stencilRestrictions,allowedArea:this.getAllowedArea(),aspectRatio:this.stencilAspectRatios(),resizeEvent:e})),this.updateStencilCoordinates(this.coordinates)},onManipulateImage:function(e){e.move.left&&(e.move.left*=this.coefficient),e.move.top&&(e.move.top*=this.coefficient);var t=B({manipulateImageEvent:e,coordinates:this.coordinates,coefficient:this.coefficient,stencilRestrictions:this.stencilRestrictions,imageSize:this.imageSize,frozenDirections:this.frozenDirections,stencilCoordinates:this.stencilCoordinates,worldTransforms:this.worldTransforms,allowedArea:this.getAllowedArea(!0),minScale:"none"===this.imageRestriction?ze:1,fitImage:"area"===this.imageRestriction}),i=t.worldTransforms,o=t.coordinates;this.worldTransforms=i,this.onChangeCoordinates(o),this.updateStencilCoordinates(o)},onMove:function(e){var t=this;xe.forEach(function(i){e.directions[i]/=t.worldTransforms.scale/t.coefficient}),this.onChangeCoordinates(this.moveAlgorithm({coordinates:this.coordinates,allowedArea:this.getAllowedArea(),moveEvent:e})),this.updateStencilCoordinates(this.coordinates)},defaultCoordinates:function(){var e=this.stencilAspectRatios(),t=this.stencilRestrictions,i=t.minWidth,o=t.minHeight,a=t.maxWidth,n=t.maxHeight,s=this.imageSize,r={};if(!e.minimum&&!e.maximum)r.height=o,r.width=i;else{var l={width:{maximum:e.minimum?j(n,i/e.minimum):n,minimum:e.maximum?q(o,i/e.maximum):o},height:{maximum:e.maximum?j(a,o*e.maximum):a,minimum:e.minimum?q(i,o*e.minimum):i}};if(l.width.maximum>=l.width.minimum)r.width=i,r.height=l.width.minimum;else if(l.height.maximum>=l.height.minimum)r.height=o,r.width=l.height.minimum;else throw"Error: current aspect ratio is incompatible with minimum/maximum height and width settings. Can't setup default coordinates"}return r.left=s.width/2-r.width/2,r.top=s.height/2-r.height/2,r},setCoordinates:function(e){var i=this,o=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},a=o.autoZoom;t.nextTick(function(){return i.imageLoaded?void i.applyTransforms(e,!(void 0!==a)||a):void(i.delayedTransforms=e)})},onPropsChange:function(){this.applyTransforms(this.coordinates,!0)},applyTransforms:function(e){var t=this,i=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],o=this.stencilAspectRatios(),a=this.getAllowedArea(!0),n=function(e,i){return t.moveAlgorithm({coordinates:e,allowedArea:a,moveEvent:new ee(null,{left:i.left-e.left,top:i.top-e.top})})},s=function(e,i){var s=t.defaultCoordinates();return s=t.resizeAlgorithm({coordinates:s,restrictions:t.stencilRestrictions,allowedArea:a,aspectRatio:o,resizeEvent:new Q(null,{left:(i.width-s.width)/2,right:(i.width-s.width)/2,top:(i.height-s.height)/2,bottom:(i.height-s.height)/2})}),n(s,{left:e.left,top:e.top})},l=this.coordinates;return Array.isArray(e)||(e=[e]),e.forEach(function(e){var i={};i="function"==typeof e?e(r({},l),t.imageSize):e,u(i.width)&&u(i.height)||(l=s(l,r({},l,i))),u(i.left)&&u(i.top)||(l=n(l,r({},l,i)))}),i?this.autoZoom(l):(1<this.worldTransforms.scale&&this.resetWorldTransforms(),this.updateStencilCoordinates(l)),this.onChangeCoordinates(l,!1),l},resetWorldTransforms:function(){this.worldTransforms={scale:1,shift:{left:0,top:0}}},resetCoordinates:function(){var e=this;if(this.$refs.image){var t=this.$refs.cropper,i=this.$refs.image,o=this.stencilRestrictions,a=o.minWidth,n=o.minHeight,s=o.maxWidth,c=o.maxHeight,h=o.widthFrozen,d=o.heightFrozen;this.frozenDirections.width=!!h,this.frozenDirections.height=!!d;var m=O(this.defaultSize,"defaultSize",function(e){return[e.cropper,e.image,{minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight},e.imageWidth,e.imageHeight,e.props]})(r({cropper:t,image:i,imageWidth:this.imageSize.width,imageHeight:this.imageSize.height,props:this.$props,aspectRatio:this.stencilAspectRatios()},this.stencilRestrictions));(m.width<a||m.height<n||m.width>s||m.height>c)&&console.warn("Warning: the default size breaks size restrictions. Check your defaultSize function",m,this.stencilRestrictions);var p=[m,function(o){return r({},O(e.defaultPosition,"defaultPosition",function(e){return[e.cropper,e.image,e.stencilWidth,e.stencilHeight,e.imageWidth,e.imageHeight,e.props]})({cropper:t,image:i,stencilWidth:o.width,stencilHeight:o.height,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height,props:e.$props}))}];this.delayedTransforms&&p.push.apply(p,l(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.resetWorldTransforms(),this.applyTransforms(p),this.delayedTransforms=null}},clearImage:function(){var e=this,t=this.$refs.stretcher;this.imageLoaded=!1,setTimeout(function(){t.style.height="auto",t.style.width="auto",e.coordinates=r({},Ee),e.boundarySize={width:0,height:0},e.updateStencilCoordinates(r({},Ee))},this.transitionTime)},refreshImage:function(){var e=this;return new Promise(function(i,o){var a=e.$refs.image,n=e.$refs.cropper;if(e.src&&a){var s=e.$refs.stretcher;e.imageTransforms.flipped?(e.imageSize.height=a.naturalWidth,e.imageSize.width=a.naturalHeight):(e.imageSize.height=a.naturalHeight,e.imageSize.width=a.naturalWidth);var r=e.imageSize.width/e.imageSize.height;e.imageSize.height>e.imageSize.width?(s.style.height="".concat(e.imageSize.height,"px"),s.style.width="".concat(s.clientHeight*r,"px"),s.clientWidth/s.clientHeight!=r&&(s.style.height="".concat(s.clientWidth/r,"px"))):(s.style.width="".concat(e.imageSize.width,"px"),s.style.height="".concat(s.clientWidth/r,"px"),s.clientHeight/s.clientWidth!=r&&(s.style.width="".concat(s.clientHeight*r,"px"))),t.nextTick(function(){var t=O(e.areaSize,"areaSize",function(e){return[e.cropper,e.image,e.imageWidth,e.imageHeight]})({cropper:n,image:a,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height}),o=t.height,s=t.width;o&&(e.boundarySize.height=o),s&&(e.boundarySize.width=s),i()})}else o()})},getAllowedArea:function(e){return this.allowedArea({breakBoundaries:e,imageSize:this.imageSize,worldTransforms:this.worldTransforms,imageRestriction:this.imageRestriction})},stencilAspectRatios:function(){return this.$refs.stencil.aspectRatios?this.$refs.stencil.aspectRatios():{minimum:this.stencilProps.aspectRatio||this.stencilProps.minAspectRatio,maximum:this.stencilProps.aspectRatio||this.stencilProps.maxAspectRatio}}}},Fe=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cropper",class:e.classes.cropper},[i("div",{class:e.classes.background,style:e.areaStyle}),e._v(" "),i("div",{ref:"stretcher",class:e.classes.stretcher}),e._v(" "),i("div",{ref:"area",class:e.classes.area,style:e.areaStyle},[i("CropperWrapper",{class:e.classes.cropperWrapper,attrs:{"wheel-resize":e.settings.wheelResize,"touch-resize":e.settings.touchResize,"touch-move":e.settings.touchMove,"mouse-move":e.settings.touchMove},on:{move:e.onManipulateImage,resize:e.onManipulateImage}},[i("div",{class:e.classes.imageWrapper},[i("img",{ref:"image",class:e.classes.image,style:e.imageStyle,attrs:{crossOrigin:e.imageAttributes.crossOrigin,src:e.imageAttributes.src},on:{mousedown:function(e){e.preventDefault()}}})]),e._v(" "),i(e.stencilComponent,e._b({ref:"stencil",tag:"component",attrs:{img:{src:e.imageAttributes.src,size:e.imageSize,transforms:e.imageTransforms,coefficient:e.coefficient},"result-coordinates":e.coordinates,"stencil-coordinates":e.stencilCoordinates},on:{resize:e.onResize,move:e.onMove}},"component",e.stencilProps,!1)),e._v(" "),e.canvas?i("canvas",{ref:"canvas",style:{display:"none"}}):e._e(),e._v(" "),e.canvas?i("canvas",{ref:"sourceCanvas",style:{display:"none"}}):e._e()],1)],1)])},staticRenderFns:[]},void 0,Oe,void 0,!1,void 0,void 0,void 0),Ne=K("vue-preview-image"),qe={name:"PreviewImage",props:{img:{type:String},classname:{type:String},imageClassname:{type:String},width:{type:Number},height:{type:Number},top:{type:Number},left:{type:Number},previewWidth:{type:Number,required:!0},previewHeight:{type:Number,required:!0}},data:function(){return{imageSize:{width:0,height:0}}},computed:{classnames:function(){return{default:V(Ne(),this.classname),image:V(Ne("image"),this.imageClassname)}},wrapperStyle:function(){return{width:"".concat(this.previewWidth,"px"),height:"".concat(this.previewHeight,"px")}},imageStyle:function(){var e=this.previewHeight/this.height;return{width:"".concat(this.imageSize.width*e,"px"),height:"".concat(this.imageSize.height*e,"px"),left:"".concat(-this.left*e,"px"),top:"".concat(-this.top*e,"px")}}},watch:{img:function(){this.onChangeImage()}},mounted:function(){this.onChangeImage()},methods:{refreshImage:function(){var e=this.$refs.image;this.imageSize.height=e.naturalHeight,this.imageSize.width=e.naturalWidth},onChangeImage:function(){var e=this,t=this.$refs.image;t.complete?this.refreshImage():t.addEventListener("load",function(){e.refreshImage()})}}},je=oe({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img}})])},staticRenderFns:[]},void 0,qe,void 0,!1,void 0,void 0,void 0);t.component("cropper",Fe),t.component("rectangle-stencil",Ye),t.component("circle-stencil",Be),t.component("simple-handler",De),t.component("simple-line",Le),e.BoundingBox=fe,e.CircleStencil=Be,e.Cropper=Fe,e.DragEvent=te,e.DraggableArea=we,e.DraggableElement=ae,e.HandlerWrapper=re,e.LineWrapper=he,e.MoveEvent=ee,e.PreviewImage=je,e.PreviewResult=We,e.RectangleStencil=Ye,e.ResizeEvent=Q,e.SimpleHandler=De,e.SimpleLine=Le,Object.defineProperty(e,"__esModule",{value:!0})});

@@ -31,2 +31,2 @@ function styleInject(id, css) {

};
styleInject("vue-advanced-cropper", ".vue-advanced-cropper{text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;max-height:100%;max-width:100%;direction:ltr}.vue-advanced-cropper__stretcher{pointer-events:none;position:relative;max-width:100%;max-height:100%}.vue-advanced-cropper__image{opacity:.5;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;-webkit-transform-origin:center;transform-origin:center;max-width:unset!important}.vue-advanced-cropper__area{position:absolute;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);top:50%}.vue-advanced-cropper__background{position:absolute;background:#000;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.vue-advanced-cropper__cropper-wrapper{width:100%;height:100%}.vue-advanced-cropper__image-wrapper{overflow:hidden;position:absolute;width:100%;height:100%}.vue-advanced-cropper__stencil-wrapper{position:absolute}.vue-square-handler{display:block;background:#fff;height:10px;width:10px}.vue-rectangle-stencil{position:absolute;height:100%;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.vue-rectangle-stencil--movable{cursor:move}.vue-simple-line{background:0 0;-webkit-transition:border .5s;transition:border .5s;border-color:rgba(255,255,255,.3);border-width:0;border-style:solid}.vue-simple-line--north,.vue-simple-line--south{height:0;width:100%}.vue-simple-line--east,.vue-simple-line--west{height:100%;width:0}.vue-simple-line--east{border-right-width:1px}.vue-simple-line--west{border-left-width:1px}.vue-simple-line--south{border-top-width:1px}.vue-simple-line--north{border-bottom-width:1px}.vue-simple-line--hover{opacity:1;border-color:#fff}.vue-circle-stencil{position:absolute;height:100%;width:100%;-webkit-box-sizing:content-box;box-sizing:content-box;cursor:move}.vue-circle-stencil__preview{border-radius:50%}.vue-preview-image{overflow:hidden;position:relative}.vue-preview-image__image{pointer-events:none;position:absolute;max-width:unset!important}.vue-handler-wrapper{position:absolute;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.vue-handler-wrapper__draggable{width:30px;height:30px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.vue-handler-wrapper--west-north{left:0;top:0;cursor:nw-resize}.vue-handler-wrapper--north{left:50%;top:0;cursor:n-resize}.vue-handler-wrapper--east-north{left:100%;top:0;cursor:ne-resize}.vue-handler-wrapper--east{left:100%;top:50%;cursor:e-resize}.vue-handler-wrapper--east-south{left:100%;top:100%;cursor:se-resize}.vue-handler-wrapper--south{left:50%;top:100%;cursor:s-resize}.vue-handler-wrapper--west-south{left:0;top:100%;cursor:sw-resize}.vue-handler-wrapper--west{left:0;top:50%;cursor:w-resize}.vue-handler-wrapper--disabled{cursor:auto}.vue-line-wrapper{background:0 0;position:absolute;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.vue-line-wrapper--north,.vue-line-wrapper--south{height:12px;width:100%;left:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.vue-line-wrapper--north{top:0;cursor:n-resize}.vue-line-wrapper--south{top:100%;cursor:s-resize}.vue-line-wrapper--east,.vue-line-wrapper--west{width:12px;height:100%;-webkit-transform:translateX(-50%);transform:translateX(-50%);top:0}.vue-line-wrapper--east{left:100%;cursor:e-resize}.vue-line-wrapper--west{left:0;cursor:w-resize}.vue-line-wrapper--disabled{cursor:auto}.vue-bounding-box{position:relative;height:100%;width:100%}.vue-draggable-area{position:relative}.vue-preview-result{overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;height:100%;width:100%}.vue-preview-result__wrapper{position:absolute}.vue-preview-result__image{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform-origin:center;transform-origin:center;max-width:unset!important}");
styleInject("vue-advanced-cropper", ".vue-advanced-cropper{text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;max-height:100%;max-width:100%;direction:ltr}.vue-advanced-cropper__stretcher{pointer-events:none;position:relative;max-width:100%;max-height:100%}.vue-advanced-cropper__image{opacity:.5;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;-webkit-transform-origin:center;transform-origin:center;max-width:unset!important}.vue-advanced-cropper__area{position:absolute;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);top:50%}.vue-advanced-cropper__background{position:absolute;background:#000;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.vue-advanced-cropper__cropper-wrapper{width:100%;height:100%}.vue-advanced-cropper__image-wrapper{overflow:hidden;position:absolute;width:100%;height:100%}.vue-advanced-cropper__stencil-wrapper{position:absolute}.vue-handler-wrapper{position:absolute;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.vue-handler-wrapper__draggable{width:30px;height:30px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.vue-handler-wrapper--west-north{left:0;top:0;cursor:nw-resize}.vue-handler-wrapper--north{left:50%;top:0;cursor:n-resize}.vue-handler-wrapper--east-north{left:100%;top:0;cursor:ne-resize}.vue-handler-wrapper--east{left:100%;top:50%;cursor:e-resize}.vue-handler-wrapper--east-south{left:100%;top:100%;cursor:se-resize}.vue-handler-wrapper--south{left:50%;top:100%;cursor:s-resize}.vue-handler-wrapper--west-south{left:0;top:100%;cursor:sw-resize}.vue-handler-wrapper--west{left:0;top:50%;cursor:w-resize}.vue-handler-wrapper--disabled{cursor:auto}.vue-line-wrapper{background:0 0;position:absolute;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.vue-line-wrapper--north,.vue-line-wrapper--south{height:12px;width:100%;left:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.vue-line-wrapper--north{top:0;cursor:n-resize}.vue-line-wrapper--south{top:100%;cursor:s-resize}.vue-line-wrapper--east,.vue-line-wrapper--west{width:12px;height:100%;-webkit-transform:translateX(-50%);transform:translateX(-50%);top:0}.vue-line-wrapper--east{left:100%;cursor:e-resize}.vue-line-wrapper--west{left:0;cursor:w-resize}.vue-line-wrapper--disabled{cursor:auto}.vue-draggable-area{position:relative}.vue-bounding-box{position:relative;height:100%;width:100%}.vue-rectangle-stencil{position:absolute;height:100%;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.vue-rectangle-stencil--movable{cursor:move}.vue-preview-result{overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;height:100%;width:100%}.vue-preview-result__wrapper{position:absolute}.vue-preview-result__image{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform-origin:center;transform-origin:center;max-width:unset!important}.vue-circle-stencil{position:absolute;height:100%;width:100%;-webkit-box-sizing:content-box;box-sizing:content-box;cursor:move}.vue-circle-stencil__preview{border-radius:50%}.vue-simple-line{background:0 0;-webkit-transition:border .5s;transition:border .5s;border-color:rgba(255,255,255,.3);border-width:0;border-style:solid}.vue-simple-line--north,.vue-simple-line--south{height:0;width:100%}.vue-simple-line--east,.vue-simple-line--west{height:100%;width:0}.vue-simple-line--east{border-right-width:1px}.vue-simple-line--west{border-left-width:1px}.vue-simple-line--south{border-top-width:1px}.vue-simple-line--north{border-bottom-width:1px}.vue-simple-line--hover{opacity:1;border-color:#fff}.vue-preview-image{overflow:hidden;position:relative}.vue-preview-image__image{pointer-events:none;position:absolute;max-width:unset!important}.vue-square-handler{display:block;background:#fff;height:10px;width:10px}");
{
"name": "vue-advanced-cropper",
"version": "0.16.4",
"version": "0.16.5",
"description": "The advanced library to create your own croppers suited for any website design",

@@ -5,0 +5,0 @@ "author": "Norserium",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc