PageSourceSearch

https://fe-static-yuketang.yuketang.cn/fe/static/web/1.2.315/js/16815.f8fe01cb.js

js yuketang.cn collected 2026-09-28 09:25:22 UTC 82,865 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkrainweb=self.webpackChunkrainweb||[]).push([["16815"],{36111:function(t,i,e){e.d(i,{fl:function(){return tk}});var s=e(18108);function n(t,i){(null==i||i>t.length)&&(i=t.length);for(var e=0,s=Array(i);e<i;e++)s[e]=t[e];return s}function o(t,i,e){var s;return(i="symbol"==typeof(s=function(t,i){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,i||"default");if("object"!=typeof s)return s;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===i?String:Number)(t)}(i,"string"))?s:s+"")in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}function r(t,i){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);i&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,s)}return e}function a(t){for(var i=1;i<arguments.length;i++){var e=null!=arguments[i]?arguments[i]:{};i%2?r(Object(e),!0).forEach(function(i){o(t,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):r(Object(e)).forEac
1h(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))})}return t}function h(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,i){if(t){if("string"==typeof t)return n(t,void 0);var e=({}).toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?n(t,void 0):void 0}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var c,l=(function(t){var i={}.hasOwnProperty;function e(){for(var t="",n=0;n<arguments.length;n++){var o=arguments[n];o&&(t=s(t,function(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return e.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var n="";for(var o in t)i.call(t,o)&&t[o]&&(n=s(n,o));return n}(o)))}return t}function s(t,i){return i?t?t+" "+i:t+i:t}t.exports?(e.default=e,t.exports=e):window.classNames=e}(c={path:void 0,exports:{},require:function(t,i){throw null==i&&c.path,Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}},c.exports),c.exports),d=function(t){return function(i,e){if(!i)return t;"string"==typeof i?s=i:e=i;var s,n=t;return s&&(n+="__"+s),n+(e?Object.keys(e).reduce(function(t,i){var s=e[i];return s&&(t+=" "+("boolean"==typeof s?n+"--"+i:n+"--"+i+"_"+s)),t},""):"")}};function u(t,i,e){function s(){var c=Date.now()-a;c<i&&c>=0?n=setTimeout(s,i-c):(n=null,e||(h=t.apply(r,o),r=o=null))}null==i&&(i=100);var n,o,r,a,h,c=function(){r=this,o=arguments,a=Date.now();var c=e&&!n;return n||(n=setTimeout(s,i)),c&&(h=t.apply(r,o),r=o=null),h};return c.clear=function(){n&&(clearTimeout(n),n=null)},c.flush=function(){n&&(h=t.apply(r,o),r=o=null,clearTimeout(n),n=null)},c}u.debounce=u;var m=function(){return(m=Object.assign||function(t){for(var i,e=1,s=arguments.length;e<s;e++)for(var n in i=arguments[e])Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);return t}).apply(this,arguments)};function p(t,i){var e,s;return t&&i?(e="".concat(t).concat(i[0].toUpperCase()).concat(i.slice(1)),s="".concat(t,"-").concat(i)):(e=t||i,s=t||i),{name:e,classname:s}}function g(t){return/^blob:/.test(t)}function f(t){return g(t)||/^data:/.test(t)}function v(t){return!!(t&&t.constructor&&t.call&&t.apply)}function b(t){return void 0===t}function w(t){return"object"==typeof t&&null!==t}function y(t,i,e){var s={};
1return w(t)?(Object.keys(i).forEach(function(n){b(t[n])?s[n]=i[n]:w(i[n])?w(t[n])?s[n]=y(t[n],i[n],e[n]):s[n]=t[n]?i[n]:e[n]:!0===i[n]||!1===i[n]?s[n]=!!t[n]:s[n]=t[n]}),s):t?i:e}function z(t){var i=Number(t);return Number.isNaN(i)?t:i}function R(t){var i;return typeof("number"==t||"object"==typeof t&&null!==t&&"[object Number]"==toString.call(t))&&(i=t)==i}function A(t,i){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}var S=function(t,i){void 0===t&&(t={}),void 0===i&&(i={}),this.type="manipulateImage",this.move=t,this.scale=i},x=function(t,i){void 0===i&&(i={}),this.type="resize",this.directions=t,this.params=i},M=function(t){this.type="move",this.directions=t},C=function(){function t(t,i,e,s,n){this.type="drag",this.nativeEvent=t,this.position=e,this.previousPosition=s,this.element=i,this.anchor=n}return t.prototype.shift=function(){var t=this.element,i=this.anchor,e=this.position,s=t.getBoundingClientRect(),n=s.left,o=s.top;return{left:e.left-n-i.left,top:e.top-o-i.top}},t}();function E(t,i,e,s,n,o,r,a,h,c){let l;"boolean"!=typeof r&&(h=a,a=r,r=!1);let d="function"==typeof e?e.options:e;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,n&&(d.functional=!0)),s&&(d._scopeId=s),o?d._ssrRegister=l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,h(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)}:i&&(l=r?function(t){i.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){i.call(this,a(t))}),l)if(d.functional){let t=d.render;d.render=function(i,e){return l.call(e),t(i,e)}}else{let t=d.beforeCreate;d.beforeCreate=t?[].concat(t,l):[l]}return e}var T=E({render:function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"draggable",class:this.classname,on:{touchstart:this.onTouchStart,mousedown:this.onMouseDown,mouseover:this.onMouseOver,mouseleave:this.onMouseLeave}},[this._t("default")],2)},staticRenderFns:[]},void 0,{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 Error('You should add ref "draggable" to your root element to use draggable mixin');this.touches=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit("enter"))},onMouseLeave:function(){this.hovered&&!this.touches.length&&(this.hovered=!1,this.$emit("leave"))},onTouchStart:function(t){t.cancelable&&!this.disabled&&1===t.touches.length&&(this.touches=h(t.touches),this.hovered||(this.$emit("enter"),this.hovered=!0),t.touches.length&&this.initAnchor(this.touches.reduce(function(i,e){return{clientX:i.clientX+e.clientX/t.touches.length,clientY:i.clientY+e.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&&0===t.button){var i={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[i],this.initAnchor(i),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.processEnd()},initAnchor:function(t){var i=this.$refs.draggable.getBoundingClientRect(),e=i.left,s=i.right,n=i.bottom,o=i.top;this.anchor={left:t.clientX-e,top:t.clientY-o,bottom:n-t.clientY,right:s-t.clientX}},processMove:function(t,i){var e=h(i);if(this.touches.length){if(1===this.touches.length&&1===e.length){var s=this.$refs.draggable;this.$emit("drag",new C(t,s,{left:e[0].clientX,top:e[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=e}},processEnd:function(){this.touches.length&&this.$emit("drag-end"),this.hovered&&(this.$emit("leave"),this.hovered=!1),this.touches=[]}}}],props:{classname:{type:String}}},void 0,!1,void 0,!1,void 0,void 0,void 0),W=d("vue-handler-wrapper"),O=E({render:function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("div",{class:t.classes.root},[e("DraggableElement",{class:t.classes.draggable,on:{drag:function(i){return t.$emit("drag",i)},"drag-end":function(i){return t.$emit("drag-end")},leave:function(i){return t.$emit("leave")},enter:function(i){return t.$emit("enter")}}},[t._t("default")],2)],1)},staticRenderFns:[]},void 0,{name:"HandlerWrapper",components:{DraggableElement:T},props:{horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},computed:{classes:function(){return{root:this.horizontalPosition||this.verticalPosition?W(o(o({},p(this.horizontalPosition,this.verticalPosition).classname,!0),"disabled",this.disabled)):W({disabled:this.disabled}),draggable:W("draggable")}}}},void 0,!1,void 0,!1,void 0,void 0,void 0),$=d("vue-line-wrapper"),H=E({render:function(){var t=this,i=t.$createElement;return(t._self._c||i)("DraggableElement",{class:t.classname,on:{drag:function(i){return t.$emit("drag",i)},"drag-end":function(i){return t.$emit("drag-end")},leave:function(i){return t.$emit("leave")},enter:function(i){return t.$emit("enter")}}},[t._t("default")],2)},staticRenderFns:[]},void 0,{name:"LineWrapper",components:{DraggableElement:T},props:{position:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classname:function(){return $(o(o({},this.position,!0),"disabled",this.disabled))}}},void 0,!1,void 0,!1,void 0,void 0,void 0),j=["left","right","top","bottom"],P=["left","right"],D=["top","bottom"],I=["left","top"],L=["fill-area","fit-area","stencil","none"],_={left:0,top:0,width:0,height:0};function B(t,i,e){return!(e=e||["width","height","left","top"]).some(function(e){return t[e]!==i[e]})}function F(t){return{left:t.left,top:t.top,right:t.left+t.width,bottom:t.top+t.height}}function X(t,i){return{left:t.left-i.left,top:t.top-i.top}}function Y(t){return{left:t.left+t.width/2,top:t.top+t.height/2}}function k(t,i){var e={left:0,top:0,right:0,bottom:0};
vendor: 5,658 bytes, line 1
1return j.forEach(function(s){var n=i[s],o=F(t)[s];e[s]=void 0!==n&&void 0!==o?"left"===s||"top"===s?Math.max(0,n-o):Math.max(0,o-n):0}),e}function U(t,i){return{left:t.left-i.left,top:t.top-i.top,width:t.width+i.left+i.right,height:t.height+i.top+i.bottom}}function N(t){return{left:-t.left,top:-t.top}}function V(t,i){return m(m({},t),{left:t.left+i.left,top:t.top+i.top})}function Z(t,i,e,s){if(1!==i){if(e){var n=Y(t);return{width:t.width*i,height:t.height*i,left:t.left+t.width*(1-i)/2+(e.left-n.left)*(s||1-i),top:t.top+t.height*(1-i)/2+(e.top-n.top)*(s||1-i)}}return{width:t.width*i,height:t.height*i,left:t.left+t.width*(1-i)/2,top:t.top+t.height*(1-i)/2}}return t}function q(t){return t.width/t.height}function G(t,i){return Math.min(void 0!==i.right&&void 0!==i.left?(i.right-i.left)/t.width:1/0,void 0!==i.bottom&&void 0!==i.top?(i.bottom-i.top)/t.height:1/0)}function Q(t,i){var e={left:0,top:0},s=k(t,i);return s.left&&s.left>0?e.left=s.left:s.right&&s.right>0&&(e.left=-s.right),s.top&&s.top>0?e.top=s.top:s.bottom&&s.bottom>0&&(e.top=-s.bottom),e}function K(t,i){var e;return i.minimum&&t<i.minimum?e=i.minimum:i.maximum&&t>i.maximum&&(e=i.maximum),e}function J(t,i){var e=q(t),s=q(i);return i.width<1/0&&i.height<1/0?e>s?{width:i.width,height:i.width/e}:{width:i.height*e,height:i.height}:i.width<1/0?{width:i.width,height:i.width/e}:i.height<1/0?{width:i.height*e,height:i.height}:t}function tt(t,i){var e=i*Math.PI/180;return{width:Math.abs(t.width*Math.cos(e))+Math.abs(t.height*Math.sin(e)),height:Math.abs(t.width*Math.sin(e))+Math.abs(t.height*Math.cos(e))}}function ti(t,i){var e=i*Math.PI/180;return{left:t.left*Math.cos(e)-t.top*Math.sin(e),top:t.left*Math.sin(e)+t.top*Math.cos(e)}}function te(t,i){var e=k(ts(t,i),i);return e.left+e.right+e.top+e.bottom?e.left+e.right>e.top+e.bottom?Math.min((t.width+e.left+e.right)/t.width,G(t,i)):Math.min((t.height+e.top+e.bottom)/t.height,G(t,i)):1}function ts(t,i,e){void 0===e&&(e=!1);var s=Q(t,i);return V(t,e?N(s):s)}function tn(t){return{width:void 0!==t.right&&void 0!==t.left?t.right-t.left:1/0,height:void 0!==t.bottom&&void 0!==t.top?t.bottom-t.top:1/0}}function to(t,i,e){void 0===e&&(e=!0);var s={};return j.forEach(function(n){var o=t[n],r=i[n];void 0!==o&&void 0!==r?s[n]="left"===n||"top"===n?e?Math.max(o,r):Math.min(o,r):e?Math.min(o,r):Math.max(o,r):void 0!==r?s[n]=r:void 0!==o&&(s[n]=o)}),s}function tr(t){var i=t.size,e=t.aspectRatio,s=t.ignoreMinimum,n=t.sizeRestrictions;return!!((i.correctRatio||q(i)>=e.minimum&&q(i)<=e.maximum)&&i.height<=n.maxHeight&&i.width<=n.maxWidth&&i.width&&i.height&&(s||i.height>=n.minHeight&&i.width>=n.minWidth))}function ta(t,i){return Math.pow(t.width-i.width,2)+Math.pow(t.height-i.height,2)}function th(t){var i=t.width,e=t.height,s=t.sizeRestrictions,n={minimum:t.aspectRatio&&t.aspectRatio.minimum||0,maximum:t.aspectRatio&&t.aspectRatio.maximum||1/0},o={width:Math.max(s.minWidth,Math.min(s.maxWidth,i)),height:Math.max(s.minHeight,Math.min(s.maxHeight,e))};function r(t,o){return void 0===o&&(o=!1),t.reduce(function(t,r){return tr({size:r,aspectRatio:n,sizeRestrictions:s,ignoreMinimum:o})&&(!t||ta(r,{width:i,height:e})<ta(t,{width:i,height:e}))?r:t},null)}var a=[];n&&[n.minimum,n.maximum].forEach(function(t){t&&a.push({width:o.width,height:o.width/t,correctRatio:!0},{width:o.height*t,height:o.height,correctRatio:!0})}),tr({size:o,aspectRatio:n,sizeRestrictions:s})&&a.push(o);var h=r(a)||r(a,!0);return h&&{width:h.width,height:h.height}}function tc(t){var i=t.event,e=t.coordinates,s=t.positionRestrictions,n=V(e,i.directions);return V(n,Q(n,void 0===s?{}:s))}function tl(t){t.event;var i=t.getAreaRestrictions,e=t.boundaries,s=t.coordinates,n=t.visibleArea;t.aspectRatio;var o=t.stencilSize,r=t.sizeRestrictions,a=t.positionRestrictions;t.stencilReference;var h,c,l,d=m({},s),u=m({},n),p=m({},o);h=q(p),c=q(d),void 0===l&&(l=.001),(0===h||0===c?Math.abs(c-h)<l:Math.abs(c/h)<1+l&&Math.abs(c/h)>1-l)||(d=m(m({},d),th({sizeRestrictions:r,width:d.width,height:d.height,aspectRatio:{minimum:q(p),maximum:q(p)}})));var g=te(u=Z(u,d.width*e.width/(u.width*p.width)),i({visibleArea:u,type:"resize"}));return 1!==g&&(u=Z(u,g),d=Z(d,g)),u=ts(u=V(u,X(Y(d),Y(u))),i({visibleArea:u,type:"move"})),{coordinates:d=ts(d,to(F(u),a,!0)),visibleArea:u}}function td(t){var i=t.event,e=t.getAreaRestrictions,s=t.boundaries,n=t.coordinates,o=t.visibleArea;t.aspectRatio,t.stencilSize,t.sizeRestrictions;var r=t.positionRestrictions;t.stencilReference;var a=m({},n),h=m({},o);if(n&&o&&"manipulateImage"!==i.type){var c={width:0,height:0};h.width,s.width,q(s)>q(a)?(c.height=.8*s.height,c.width=c.height*q(a)):(c.width=.8*s.width,c.height=c.width*q(a));var l=te(h=Z(h,a.width*s.width/(h.width*c.width)),e({visibleArea:h,type:"resize"}));h=Z(h,l),1!==l&&(c.height/=l,c.width/=l),h=ts(h=V(h,X(Y(a),Y(h))),e({visibleArea:h,type:"move"})),a=ts(a,to(F(h),r,!0))}return{coordinates:a,visibleArea:h}}function tu(t){var i=t.event,e=t.coordinates,s=t.visibleArea,n=t.getAreaRestrictions,o=m({},s),r=m({},e);if("setCoordinates"===i.type){var a=Math.max(0,r.width-o.width),h=Math.max(0,r.height-o.height);a>h?o=Z(o,Math.min(r.width/o.width,G(o,n({visibleArea:o,type:"resize"})))):h>a&&(o=Z(o,Math.min(r.height/o.height,G(o,n({visibleArea:o,type:"resize"}))))),o=ts(o=V(o,N(Q(r,F(o)))),n({visibleArea:o,type:"move"}))}return{visibleArea:o,coordinates:r}}function tm(t){var i=t.imageSize,e=t.visibleArea,s=t.aspectRatio,n=t.sizeRestrictions,o=e||i,r=Math.min(s.maximum||1/0,Math.max(s.minimum||0,q(o))),a=o.width<o.height?{width:.8*o.width,height:.8*o.width/r}:{height:.8*o.height,width:.8*o.height*r};return th(m(m({},a),{aspectRatio:s,sizeRestrictions:n}))}
1function tp(t){var i,e,s=t.imageSize,n=t.visibleArea,o=t.boundaries,r=t.aspectRatio,a=t.sizeRestrictions,h=t.stencilSize,c=n||s;return q(c)>q(o)?e=(i=h.height*c.height/o.height)*q(h):i=(e=h.width*c.width/o.width)/q(h),th({width:e,height:i,aspectRatio:r,sizeRestrictions:a})}function tg(t){var i=t.directions,e=t.coordinates,s=t.positionRestrictions,n=void 0===s?{}:s,o=t.sizeRestrictions,r=t.preserveRatio,a=t.compensate,h=m({},i),c=U(e,h).width,l=U(e,h).height;c<0&&(h.left<0&&h.right<0?(h.left=-(e.width-o.minWidth)/(h.left/h.right),h.right=-(e.width-o.minWidth)/(h.right/h.left)):h.left<0?h.left=-(e.width-o.minWidth):h.right<0&&(h.right=-(e.width-o.minWidth))),l<0&&(h.top<0&&h.bottom<0?(h.top=-(e.height-o.minHeight)/(h.top/h.bottom),h.bottom=-(e.height-o.minHeight)/(h.bottom/h.top)):h.top<0?h.top=-(e.height-o.minHeight):h.bottom<0&&(h.bottom=-(e.height-o.minHeight)));var d=k(U(e,h),n);a&&(d.left&&d.left>0&&0===d.right?(h.right+=d.left,h.left-=d.left):d.right&&d.right>0&&0===d.left&&(h.left+=d.right,h.right-=d.right),d.top&&d.top>0&&0===d.bottom?(h.bottom+=d.top,h.top-=d.top):d.bottom&&d.bottom>0&&0===d.top&&(h.top+=d.bottom,h.bottom-=d.bottom),d=k(U(e,h),n));var u={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(j.forEach(function(t){var i=d[t];i&&h[t]&&(u[t]=Math.max(0,1-i/h[t]))}),r){var p=Math.min.apply(null,j.map(function(t){return u[t]}));p!==1/0&&j.forEach(function(t){h[t]*=p})}else j.forEach(function(t){u[t]!==1/0&&(h[t]*=u[t])});if(c=U(e,h).width,l=U(e,h).height,h.right+h.left&&(c>o.maxWidth?u.width=(o.maxWidth-e.width)/(h.right+h.left):c<o.minWidth&&(u.width=(o.minWidth-e.width)/(h.right+h.left))),h.bottom+h.top&&(l>o.maxHeight?u.height=(o.maxHeight-e.height)/(h.bottom+h.top):l<o.minHeight&&(u.height=(o.minHeight-e.height)/(h.bottom+h.top))),r){var g=Math.min(u.width,u.height);g!==1/0&&j.forEach(function(t){h[t]*=g})}else u.width!==1/0&&P.forEach(function(t){h[t]*=u.width}),u.height!==1/0&&D.forEach(function(t){h[t]*=u.height});return h}function tf(t,i,e){return 0==i&&0==e?t/2:0==i?0:0==e?t:t*Math.abs(i/(i+e))}var tv=d("vue-simple-handler"),tb=d("vue-simple-handler-wrapper"),tw=E({render:function(){var t=this.$createElement,i=this._self._c||t;return i("HandlerWrapper",{class:this.classes.wrapper,attrs:{"vertical-position":this.verticalPosition,"horizontal-position":this.horizontalPosition,disabled:this.disabled},on:{drag:this.onDrag,"drag-end":this.onDragEnd,enter:this.onEnter,leave:this.onLeave}},[i("div",{class:this.classes.default})])},staticRenderFns:[]},void 0,{name:"SimpleHandler",components:{HandlerWrapper:O},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){var t=o(o(o(o({},this.horizontalPosition,!!this.horizontalPosition),this.verticalPosition,!!this.verticalPosition),"".concat(this.horizontalPosition,"-").concat(this.verticalPosition),!!(this.verticalPosition&&this.horizontalPosition)),"hover",this.hover);return{default:l(tv(t),this.defaultClass,this.hover&&this.hoverClass),wrapper:l(tb(t),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}}},void 0,!1,void 0,!1,void 0,void 0,void 0),ty=d("vue-simple-line"),tz=d("vue-simple-line-wrapper"),tR=E({render:function(){var t=this.$createElement,i=this._self._c||t;return i("LineWrapper",{class:this.classes.wrapper,attrs:{position:this.position,disabled:this.disabled},on:{drag:this.onDrag,"drag-end":this.onDragEnd,enter:this.onEnter,leave:this.onLeave}},[i("div",{class:this.classes.root})])},staticRenderFns:[]},void 0,{name:"SimpleLine",components:{LineWrapper:H},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},position:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){return{root:l(ty(o({},this.position,!0)),this.defaultClass,this.hover&&this.hoverClass),wrapper:l(tz(o({},this.position,!0)),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}}},void 0,!1,void 0,!1,void 0,void 0,void 0),tA=d("vue-bounding-box"),tS=["east","west",null],tx=["south","north",null],tM=E({render:function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("div",{ref:"box",class:t.classes.root,style:t.style},[t._t("default"),t._v(" "),e("div",t._l(t.lineNodes,function(i){return e(i.component,{key:i.name,tag:"component",attrs:{"default-class":i.class,"hover-class":i.hoverClass,"wrapper-class":i.wrapperClass,position:i.name,disabled:i.disabled},on:{drag:function(e){return t.onHandlerDrag(e,i.horizontalDirection,i.verticalDirection)},"drag-end":function(i){return t.onEnd()}}})}),1),t._v(" "),t._l(t.handlerNodes,function(i){return e("div",{key:i.name,class:i.wrapperClass,style:i.wrapperStyle},[e(i.component,{tag:"component",attrs:{"default-class":i.class,"hover-class":i.hoverClass,"wrapper-class":i.wrapperClass,"horizontal-position":i.horizontalDirection,"vertical-position":i.verticalDirection,disabled:i.disabled},on:{drag:function(e){return t.onHandlerDrag(e,i.horizontalDirection,i.verticalDirection)},"drag-end":function(i){return t.onEnd()}}}
1)],1)})],2)},staticRenderFns:[]},void 0,{name:"BoundingBox",props:{width:{type:Number},height:{type:Number},transitions:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlersComponent:{type:[Object,String],default:function(){return tw}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},linesComponent:{type:[Object,String],default:function(){return tR}},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},resizable:{type:Boolean,default:!0}},data:function(){var t=[];return tS.forEach(function(i){tx.forEach(function(e){if(i!==e){var s=p(i,e),n=s.name,o=s.classname;t.push({name:n,classname:o,verticalDirection:e,horizontalDirection:i})}})}),{points:t}},computed:{style:function(){var t={};return this.width&&this.height&&(t.width="".concat(this.width,"px"),t.height="".concat(this.height,"px"),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction))),t},classes:function(){var t=this.handlersClasses,i=this.handlersWrappersClasses,e=this.linesClasses,s=this.linesWrappersClasses;return{root:tA(),handlers:t,handlersWrappers:i,lines:e,linesWrappers:s}},lineNodes:function(){var t=this,i=[];return this.points.forEach(function(e){e.horizontalDirection&&e.verticalDirection||!t.lines[e.name]||i.push({name:e.name,component:t.linesComponent,class:l(t.classes.lines.default,t.classes.lines[e.name],!t.resizable&&t.classes.lines.disabled),wrapperClass:l(t.classes.linesWrappers.default,t.classes.linesWrappers[e.name],!t.resizable&&t.classes.linesWrappers.disabled),hoverClass:t.classes.lines.hover,verticalDirection:e.verticalDirection,horizontalDirection:e.horizontalDirection,disabled:!t.resizable})}),i},handlerNodes:function(){var t=this,i=[],e=this.width,s=this.height;return this.points.forEach(function(n){if(t.handlers[n.name]){var r={name:n.name,component:t.handlersComponent,class:l(t.classes.handlers.default,t.classes.handlers[n.name]),wrapperClass:l(t.classes.handlersWrappers.default,t.classes.handlersWrappers[n.name]),hoverClass:t.classes.handlers.hover,verticalDirection:n.verticalDirection,horizontalDirection:n.horizontalDirection,disabled:!t.resizable};if(e&&s){var a=n.horizontalDirection,h=n.verticalDirection;r.wrapperClass=tA("handler"),r.wrapperStyle={transform:"translate(".concat("east"===a?e:"west"===a?0:e/2,"px, ").concat("south"===h?s:"north"===h?0:s/2,"px)")},t.transitions&&t.transitions.enabled&&(r.wrapperStyle.transition="".concat(t.transitions.time,"ms ").concat(t.transitions.timingFunction))}else r.wrapperClass=tA("handler",o({},n.classname,!0));i.push(r)}}),i}},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:{onEnd:function(){this.$emit("resize-end")},onHandlerDrag:function(t,i,e){var s,n=t.shift(),o=n.left,r=n.top,a={left:0,right:0,top:0,bottom:0};"west"===i?a.left-=o:"east"===i&&(a.right+=o),"north"===e?a.top-=r:"south"===e&&(a.bottom+=r),!e&&i?s="width":e&&!i&&(s="height"),this.resizable&&this.$emit("resize",new x(a,{allowedDirections:{left:"west"===i||!i,right:"east"===i||!i,bottom:"south"===e||!e,top:"north"===e||!e},preserveAspectRatio:t.nativeEvent&&t.nativeEvent.shiftKey,respectDirection:s}))}}},void 0,!1,void 0,!1,void 0,void 0,void 0),tC=d("vue-draggable-area"),tE=E({render:function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"container",on:{touchstart:this.onTouchStart,mousedown:this.onMouseDown}},[this._t("default")],2)},staticRenderFns:[]},void 0,{name:"DraggableArea",props:{movable:{type:Boolean,default:!0},activationDistance:{type:Number,default:20}},computed:{classnames:function(){return{default:tC()}}},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 i=this.movable&&1===t.touches.length;i&&(this.touches=h(t.touches)),(this.touchStarted||i)&&(t.preventDefault(),t.stopPropagation())}},onTouchEnd:function(){this.touchStarted=!1,this.processEnd()},onTouchMove:function(t){this.touches.length>=1&&(this.touchStarted?(this.processMove(t,t.touches),t.preventDefault(),t.stopPropagation()):A({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&&0===t.button){var i={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[i],this.initAnchor(i),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.processEnd()},initAnchor:function(t){var i=this.$refs.container.getBoundingClientRect(),e=i.left,s=i.top;this.anchor={x:t.clientX-e,y:t.clientY-s}},processMove:function(t,i){var e=h(i);if(this.touches.length){var s=this.$refs.container.getBoundingClientRect(),n=s.left,o=s.top;1===this.touches.length&&1===e.length&&this.$emit("move",new M({left:e[0].clientX-(n+this.anchor.x),top:e[0].clientY-(o+this.anchor.y)}))}},processEnd:function(){this.touches.length&&this.$emit("move-end"),this.touches=[]}}},void 0,!1,void 0,!1,void 0,void 0,void 0);function tT(t){var i,e;return{rotate:t.rotate||0,flip:{horizontal:(null==(i=null==t?void 0:t.flip)?void 0:i.horizontal)||!1,vertical:(null==(e=null==t?void 0:t.flip)?void 0:e.vertical)||!1}}}function tW(t){var i=t.rotate,e=t.flip,s=t.scaleX,n=t.scaleY,o="";return o+=" rotate(".concat(i,"deg) "),o+=" scaleX(".concat(s*(e.horizontal?-1:1),") "),o+=" scaleY(".concat(n*(e.vertical?-1:1),") ")}var tO=d("vue-preview-result");function t$(t,i){var e=i.getBoundingClientRect(),s=e.left,n=e.top,o={left:0,top:0},r=0;return t.forEach(function(i){o.left+=(i.clientX-s)/t.length,o.top+=(i.clientY-n)/t.length}),t.forEach(function(t){r+=A({x:o.left,y:o.top},{x:t.clientX-s,y:t.clientY-n})}),{centerMass:o,spread:r,count:t.length}}E({render:function(){var t=this.$createElement,i=this._self._c||t;return i("div",{class:this.classes.root},[i("div",{ref:"wrapper",class:this.classes.wrapper,style:this.wrapperStyle},[i("img",{ref:"image",class:this.classes.image,style:this.imageStyle,attrs:{src:this.image.src}})])])},staticRenderFns:[]},void 0,{name:"PreviewResult",props:{image:{type:Object},transitions:{type:Object},stencilCoordinates:{type:Object,default:function(){return{width:0,height:0,left:0,top:0}}},imageClass:{type:String}},computed:{classes:function(){return{root:tO(),wrapper:tO("wrapper"),imageWrapper:tO("image-wrapper"),image:l(tO("image"),this.imageClass)}},wrapperStyle:function(){var t={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)")};return this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},imageStyle:function(){var t=this.image.transforms,i=tt({width:this.image.width,height:this.image.height},t.rotate),e={width:"".concat(this.image.width,"px"),height:"".concat(this.image.height,"px"),left:"0px",top:"0px"}
1,s={left:(this.image.width-i.width)*t.scaleX/2,top:(this.image.height-i.height)*t.scaleY/2},n={left:(1-t.scaleX)*this.image.width/2,top:(1-t.scaleY)*this.image.height/2};return e.transform="translate(\n				".concat(-this.stencilCoordinates.left-t.translateX-s.left-n.left,"px,").concat(-this.stencilCoordinates.top-t.translateY-s.top-n.top,"px) ")+tW(t),this.transitions&&this.transitions.enabled&&(e.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),e}}},void 0,!1,void 0,!1,void 0,void 0,void 0);var tH=E({render:function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"container",on:{touchstart:this.onTouchStart,mousedown:this.onMouseDown,wheel:this.onWheel}},[this._t("default")],2)},staticRenderFns:[]},void 0,{props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0},eventsFilter:{type:Function,required:!1}},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)},created:function(){this.transforming=!1,this.debouncedProcessEnd=u(this.processEnd),this.touches=[]},methods:{processMove:function(t,i){if(this.touches.length){if(1===this.touches.length&&1===i.length)this.$emit("move",new S({left:this.touches[0].clientX-i[0].clientX,top:this.touches[0].clientY-i[0].clientY}));else if(this.touches.length>1&&this.touchResize){var e=t$(i,this.$refs.container),s=this.oldGeometricProperties;s.count===e.count&&s.count>1&&this.$emit("resize",new S({left:s.centerMass.left-e.centerMass.left,top:s.centerMass.top-e.centerMass.top},{factor:s.spread/e.spread,center:e.centerMass})),this.oldGeometricProperties=e}this.touches=i}},processEnd:function(){this.transforming&&(this.transforming=!1,this.$emit("transform-end"))},processStart:function(){this.transforming=!0,this.debouncedProcessEnd.clear()},processEvent:function(t){return this.eventsFilter?!1!==this.eventsFilter(t,this.transforming):(t.preventDefault(),t.stopPropagation(),!0)},onTouchStart:function(t){if(t.cancelable&&(this.touchMove||this.touchResize&&t.touches.length>1)&&this.processEvent(t)){var i=this.$refs.container,e=i.getBoundingClientRect(),s=e.left,n=e.top,o=e.bottom,r=e.right;this.touches=h(t.touches).filter(function(t){return t.clientX>s&&t.clientX<r&&t.clientY>n&&t.clientY<o}),this.oldGeometricProperties=t$(this.touches,i)}},onTouchEnd:function(t){0===t.touches.length&&(this.touches=[],this.processEnd())},onTouchMove:function(t){var i=this;if(this.touches.length){var e=h(t.touches).filter(function(t){return!t.identifier||i.touches.find(function(i){return i.identifier===t.identifier})});this.processEvent(t)&&(this.processMove(t,e),this.processStart())}},onMouseDown:function(t){if(this.mouseMove&&"buttons"in t&&1===t.buttons&&this.processEvent(t)){var i={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[i],this.processStart()}},onMouseMove:function(t){this.touches.length&&this.processEvent(t)&&this.processMove(t,[{clientX:t.clientX,clientY:t.clientY}])},onMouseUp:function(){this.touches=[],this.processEnd()},onWheel:function(t){if(this.wheelResize&&this.processEvent(t)){var i,e=this.$refs.container.getBoundingClientRect(),s=e.left,n=e.top,o=1+this.wheelResize.ratio*(0==(i=+(t.deltaY||t.detail||t.wheelDelta))||i!=i?i:i>0?1:-1),r={left:t.clientX-s,top:t.clientY-n};this.$emit("resize",new S({},{factor:o,center:r})),this.touches.length||this.debouncedProcessEnd()}}}},void 0,!1,void 0,!1,void 0,void 0,void 0),tj=E({render:function(){var t=this,i=t.$createElement;return(t._self._c||i)("transformable-image",{attrs:{"touch-move":t.touchMove,"touch-resize":t.touchResize,"mouse-move":t.mouseMove,"wheel-resize":t.wheelResize},on:{move:function(i){return t.$emit("move",i)},resize:function(i){return t.$emit("resize",i)}}},[t._t("default")],2)},staticRenderFns:[]},void 0,{components:{TransformableImage:tH},props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0}}},void 0,!1,void 0,!1,void 0,void 0,void 0),tP=d("vue-preview"),tD=E({render:function(){var t=this.$createElement,i=this._self._c||t;return i("div",{ref:"root",class:this.classes.root,style:this.style},[i("div",{ref:"wrapper",class:this.classes.wrapper,style:this.wrapperStyle},[i("img",{directives:[{name:"show",rawName:"v-show",value:this.image&&this.image.src,expression:"image && image.src"}],ref:"image",class:this.classes.image,style:this.imageStyle,attrs:{src:this.image&&this.image.src}})])])},staticRenderFns:[]},void 0,{props:{coordinates:{type:Object},transitions:{type:Object},image:{type:Object,default:function(){return{}}},imageClass:{type:String},width:{type:Number},height:{type:Number},fill:{type:Boolean}},data:function(){return{calculatedImageSize:{width:0,height:0},calculatedSize:{width:0,height:0}}},computed:{classes:function(){return{root:tP({fill:this.fill}),wrapper:tP("wrapper"),imageWrapper:tP("image-wrapper"),image:l(tP("image"),this.imageClass)}},style:function(){if(this.fill)return{};var t={};return this.width&&(t.width="".concat(this.size.width,"px")),this.height&&(t.height="".concat(this.size.height,"px")),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},wrapperStyle:function(){var t={width:"".concat(this.size.width,"px"),height:"".concat(this.size.height,"px"),left:"calc(50% - ".concat(this.size.width/2,"px)"),top:"calc(50% - ".concat(this.size.height/2,"px)")};return this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},imageStyle:function(){if(this.coordinates&&this.image){var t=this.coordinates.width/this.size.width,i=a(a({rotate:0,flip:{horizontal:!1,vertical:!1}},this.image.transforms),{},{scaleX:1/t,scaleY:1/t}),e=this.imageSize.width,s=this.imageSize.height,n=tt({width:e,height:s},i.rotate),o={width:"".concat(e,"px"),height:"".concat(s,"px"),left:"0px",top:"0px"},r={rotate:{left:(e-n.width)*i.scaleX/2,top:(s-n.height)*i.scaleY/2},scale:{left:(1-i.scaleX)*e/2,top:(1-i.scaleY)*s/2}};return o.transform="translate(\n				".concat(-this.coordinates.left/t-r.rotate.left-r.scale.left,"px,").concat(-this.coordinates.top/t-r.rotate.top-r.scale.top,"px) ")+tW(i),this.transitions&&this.transitions.enabled&&(o.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),o}return{}},size:function(){return{width:this.width||this.calculatedSize.width,height:this.height||this.calculatedSize.height}},imageSize:function(){return{width:this.image.width||this.calculatedImageSize.width,height:this.image.height||this.calculatedImageSize.height}}},watch:{image:function(t){(t.width||t.height)&&this.onChangeImage()}},mounted:function(){var t=this;this.onChangeImage(),this.$refs.image.addEventListener("load",function(){t.refreshImage()}),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},destroyed:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh)},methods:{refreshImage:function(){var t=this.$refs.image;this.calculatedImageSize.height=t.naturalHeight,this.calculatedImageSize.width=t.naturalWi
1dth},refresh:function(){var t=this.$refs.root;this.width||(this.calculatedSize.width=t.clientWidth),this.height||(this.calculatedSize.height=t.clientHeight)},onChangeImage:function(){var t=this.$refs.image;t&&t.complete&&this.refreshImage(),this.refresh()}}},void 0,!1,void 0,!1,void 0,void 0,void 0),tI=E({render:function(){var t=this.$createElement;return(this._self._c||t)("preview",this._b({attrs:{fill:!0}},"preview",this.$attrs,!1))},staticRenderFns:[]},void 0,{components:{Preview:tD},inheritAttrs:!1},void 0,!1,void 0,!1,void 0,void 0,void 0),tL=d("vue-rectangle-stencil"),t_=E({render:function(){var t=this.$createElement,i=this._self._c||t;return i("div",{class:this.classes.stencil,style:this.style},[i("bounding-box",{class:this.classes.boundingBox,attrs:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height,transitions:this.transitions,handlers:this.handlers,"handlers-component":this.handlersComponent,"handlers-classes":this.handlersClasses,"handlers-wrappers-classes":this.handlersWrappersClasses,lines:this.lines,"lines-component":this.linesComponent,"lines-classes":this.linesClasses,"lines-wrappers-classes":this.linesWrappersClasses,resizable:this.resizable},on:{resize:this.onResize,"resize-end":this.onResizeEnd}},[i("draggable-area",{attrs:{movable:this.movable},on:{move:this.onMove,"move-end":this.onMoveEnd}},[i("stencil-preview",{class:this.classes.preview,attrs:{image:this.image,coordinates:this.coordinates,width:this.stencilCoordinates.width,height:this.stencilCoordinates.height,transitions:this.transitions}})],1)],1)],1)},staticRenderFns:[]},void 0,{name:"RectangleStencil",components:{StencilPreview:tI,BoundingBox:tM,DraggableArea:tE},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return tw}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return tR}},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:l(tL({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:l(tL("preview"),this.previewClass),boundingBox:l(tL("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,i=t.height,e=t.width,s=t.left,n=t.top,o={width:"".concat(e,"px"),height:"".concat(i,"px"),transform:"translate(".concat(s,"px, ").concat(n,"px)")};return this.transitions&&this.transitions.enabled&&(o.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),o}},methods:{onMove:function(t){this.$emit("move",t),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(t){this.$emit("resize",t),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}}},void 0,!1,void 0,!1,void 0,void 0,void 0),tB=d("vue-circle-stencil"),tF=E({render:function(){var t=this.$createElement,i=this._self._c||t;return i("div",{class:this.classes.stencil,style:this.style},[i("bounding-box",{class:this.classes.boundingBox,attrs:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height,transitions:this.transitions,handlers:this.handlers,"handlers-component":this.handlersComponent,"handlers-classe
1s":this.handlersClasses,"handlers-wrappers-classes":this.handlersWrappersClasses,lines:this.lines,"lines-component":this.linesComponent,"lines-classes":this.linesClasses,"lines-wrappers-classes":this.linesWrappersClasses,resizable:this.resizable},on:{resize:this.onResize,"resize-end":this.onResizeEnd}},[i("draggable-area",{attrs:{movable:this.movable},on:{move:this.onMove,"move-end":this.onMoveEnd}},[i("stencil-preview",{class:this.classes.preview,attrs:{image:this.image,coordinates:this.coordinates,width:this.stencilCoordinates.width,height:this.stencilCoordinates.height,transitions:this.transitions}})],1)],1)],1)},staticRenderFns:[]},void 0,{components:{StencilPreview:tI,BoundingBox:tM,DraggableArea:tE},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,westNorth:!0,westSouth:!0,eastSouth:!0}}},handlersComponent:{type:[Object,String],default:function(){return tw}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return tR}},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:l(tB({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:l(tB("preview"),this.previewClass),boundingBox:l(tB("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,i=t.height,e=t.width,s=t.left,n=t.top,o={width:"".concat(e,"px"),height:"".concat(i,"px"),transform:"translate(".concat(s,"px, ").concat(n,"px)")};return this.transitions&&this.transitions.enabled&&(o.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),o}},methods:{onMove:function(t){this.$emit("move",t),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(t){this.$emit("resize",t),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:1,maximum:1}}}},void 0,!1,void 0,!1,void 0,void 0,void 0),tX=["transitions"],tY=d("vue-advanced-cropper"),tk=E({render:function(){var t=this.$createElement,i=this._self._c||t;return i("div",{ref:"cropper",class:this.classes.cropper},[i("div",{ref:"stretcher",class:this.classes.stretcher}),this._v(" "),i("div",{class:this.classes.boundaries,style:this.boundariesStyle},[i(this.backgroundWrapperComponent,{tag:"component",class:this.classes.cropperWrapper,attrs:{"wheel-resize":this.settings.resizeImage.wheel,"touch-resize":this.settings.resizeImage.touch,"touch-move":this.settings.moveImage.touch,"mouse-move":this.settings.moveImage.mouse},on:{move:this.onManipulateImage,resize:this.onManipulateImage}},[i("div",{class:this.classes.background,style:this.boundariesStyle}),this._v(" "),i("div",{class:this.classes.imageWrapper},[i("img",{ref:"image",class:this.classes.image,style:this.imageStyle,attrs:{crossorigin:this.imageAttributes.crossOrigin,src:this.imageAttributes.src},on:{mousedown:function(t){t.preventDefault()}}})]),this._v(" "),i("div",{class:this.classes.foreground,style:this.boundariesStyle}),this._v(" "),i(this.stencilComponent,this._b({directives:[{name:"show",rawName:"v-show",value:this.imageLoaded,expression:"imageLoaded"}],ref:"stencil",tag:"component",attrs:{image:this.image,coordinates:this.coordinates,"stencil-coordinates":this.stencilCoordinates,transitions:this.transitionsOptions},on:{resize:this.onResize,"resize-end":this.onResizeEnd,move:this.onMove,"move-end":this.onMoveEnd}},"component",this.stencilProps,!1)),this._v(" "),this.canvas?i("canvas",{ref:"canvas",style:{display:"none"}}):this._e(),this._v(" "),this.canvas?i("canvas",{ref:"sourceCanvas",style:{display:"none"}}):this._e()],1)],1)])},staticRenderFns:[]}
1,void 0,{name:"Cropper",components:{BackgroundWrapper:tj},props:{src:{type:String,default:null},stencilComponent:{type:[Object,String],default:function(){return t_}},backgroundWrapperComponent:{type:[Object,String],default:function(){return tj}},stencilProps:{type:Object,default:function(){return{}}},autoZoom:{type:Boolean,default:!1},imageClass:{type:String},boundariesClass:{type:String},backgroundClass:{type:String},foregroundClass:{type:String},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},debounce:{type:[Boolean,Number],default:500},transitions:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},canvas:{type:[Object,Boolean],default:!0},crossOrigin:{type:[Boolean,String],default:void 0},transitionTime:{type:Number,default:300},imageRestriction:{type:String,default:"fit-area",validator:function(t){return -1!==L.indexOf(t)}},roundResult:{type:Boolean,default:!0},defaultSize:{type:[Function,Object]},defaultPosition:{type:[Function,Object],default:function(t){var i=t.imageSize,e=t.visibleArea,s=t.coordinates,n=e||i;return{left:(e?e.left:0)+n.width/2-s.width/2,top:(e?e.top:0)+n.height/2-s.height/2}}},defaultVisibleArea:{type:[Function,Object],default:function(t){var i=t.getAreaRestrictions,e=t.coordinates,s=t.imageSize,n=q(t.boundaries);if(e){var o={height:Math.max(e.height,s.height),width:Math.max(e.width,s.width)},r=J({width:q(o)>n?o.width:o.height*n,height:q(o)>n?o.width/n:o.height},tn(i())),a={left:e.left+e.width/2-r.width/2,top:e.top+e.height/2-r.height/2,width:r.width,height:r.height},h=k(e,F(m({left:0,top:0},s))),c={};return h.left||h.right||!(a.width<=s.width)||(c.left=0,c.right=s.width),h.top||h.bottom||!(a.height<=s.height)||(c.top=0,c.bottom=s.height),ts(a,c)}var l=q(s);return r={height:l>n?s.height:s.width/n,width:l>n?s.height*n:s.width},{left:s.width/2-r.width/2,top:s.height/2-r.height/2,width:r.width,height:r.height}}},defaultTransforms:{type:[Function,Object]},defaultBoundaries:{type:[Function,String],validator:function(t){return"string"!=typeof t||"fill"===t||"fit"===t}},priority:{type:String,default:"coordinates"},stencilSize:{type:[Object,Function]},resizeImage:{type:[Boolean,Object],default:!0},moveImage:{type:[Boolean,Object],default:!0},autoZoomAlgorithm:{type:Function},resizeAlgorithm:{type:Function,default:function(t){var i=t.event,e=t.coordinates,s=t.aspectRatio,n=t.positionRestrictions,o=t.sizeRestrictions,r=m(m({},e),{right:e.left+e.width,bottom:e.top+e.height}),a=i.params||{},h=m({},i.directions),c=a.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};o.widthFrozen&&(h.left=0,h.right=0),o.heightFrozen&&(h.top=0,h.bottom=0),j.forEac
1h(function(t){c[t]||(h[t]=0)});var l=U(r,h=tg({coordinates:r,directions:h,sizeRestrictions:o,positionRestrictions:n})).width,d=U(r,h).height,u=a.preserveRatio?q(r):K(l/d,s);if(u){var p=a.respectDirection;if(p||(p=r.width>=r.height||1===u?"width":"height"),"width"===p){var g=l/u-r.height;if(c.top&&c.bottom){var f=h.top,v=h.bottom;h.bottom=tf(g,v,f),h.top=tf(g,f,v)}else c.bottom?h.bottom=g:c.top?h.top=g:c.right?h.right=0:c.left&&(h.left=0)}else if("height"===p){var b=r.width-d*u;if(c.left&&c.right){var w=h.left,y=h.right;h.left=-tf(b,w,y),h.right=-tf(b,y,w)}else c.left?h.left=-b:c.right?h.right=-b:c.top?h.top=0:c.bottom&&(h.bottom=0)}h=tg({directions:h,coordinates:r,sizeRestrictions:o,positionRestrictions:n,preserveRatio:!0,compensate:a.compensate})}return l=U(r,h).width,d=U(r,h).height,(u=a.preserveRatio?q(r):K(l/d,s))&&Math.abs(u-l/d)>.001&&j.forEach(function(t){c[t]||(h[t]=0)}),tc({event:new M({left:-h.left,top:-h.top}),coordinates:{width:e.width+h.right+h.left,height:e.height+h.top+h.bottom,left:e.left,top:e.top},positionRestrictions:n})}},moveAlgorithm:{type:Function,default:tc},initStretcher:{type:Function,default:function(t){var i=t.stretcher,e=t.imageSize,s=q(e);i.style.width="".concat(e.width,"px"),i.style.height="".concat(i.clientWidth/s,"px"),i.style.width="".concat(i.clientWidth,"px")}},fitCoordinates:{type:Function,default:function(t){var i=t.visibleArea,e=t.coordinates,s=t.aspectRatio,n=t.sizeRestrictions,o=t.positionRestrictions,r=m(m({},e),th({width:e.width,height:e.height,aspectRatio:s,sizeRestrictions:{maxWidth:i.width,maxHeight:i.height,minHeight:Math.min(i.height,n.minHeight),minWidth:Math.min(i.width,n.minWidth)}}));return ts(r=V(r,X(Y(e),Y(r))),to(F(i),o,!0))}},fitVisibleArea:{type:Function,default:function(t){var i=t.visibleArea,e=t.boundaries,s=t.getAreaRestrictions,n=t.coordinates,o=m({},i);o.height=o.width/q(e),o.top+=(i.height-o.height)/2,(n.height-o.height>0||n.width-o.width>0)&&(o=Z(o,Math.max(n.height/o.height,n.width/o.width)));var r=N(Q(n,F(o=Z(o,te(o,s({visibleArea:o,type:"resize"}))))));return o.width<n.width&&(r.left=0),o.height<n.height&&(r.top=0),o=ts(o=V(o,r),s({visibleArea:o,type:"move"}))}},areaRestrictionsAlgorithm:{type:Function,default:function(t){var i=t.visibleArea,e=t.boundaries,s=t.imageSize,n=t.imageRestriction,o=t.type,r={};return"fill-area"===n?r={left:0,top:0,right:s.width,bottom:s.height}:"fit-area"===n&&(q(e)>q(s)?(r={top:0,bottom:s.height},i&&"move"===o&&(i.width>s.width?(r.left=-(i.width-s.width)/2,r.right=s.width-r.left):(r.left=0,r.right=s.width))):(r={left:0,right:s.width},i&&"move"===o&&(i.height>s.height?(r.top=-(i.height-s.height)/2,r.bottom=s.height-r.top):(r.top=0,r.bottom=s.height)))),r}},sizeRestrictionsAlgorithm:{type:Function,default:function(t){return{minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight}}},positionRestrictionsAlgorithm:{type:Function,default:function(t){var i=t.imageSize,e={};return"none"!==t.imageRestriction&&(e={left:0,top:0,right:i.width,bottom:i.height}),e}}},data:function(){return{transitionsActive:!1,imageLoaded:!1,imageAttributes:{width:null,height:null,crossOrigin:!1,src:null},defaultImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},appliedImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},boundaries:{width:0,height:0},visibleArea:null,coordinates:a({},_)}},computed:{image:function(){return{src:this.imageAttributes.src,width:this.imageAttributes.width,height:this.imageAttributes.height,transforms:this.imageTransforms}},imageTransforms:function(){return{rotate:this.appliedImageTransforms.rotate,flip:{horizontal:this.appliedImageTransforms.flip.horizontal,vertical:this.appliedImageTransforms.flip.vertical},translateX:this.visibleArea?this.visibleArea.left/this.coefficient:0,translateY:this.visibleArea?this.visibleArea.top/this.coefficient:0,scaleX:1/this.coefficient,scaleY:1/this.coefficient}},imageSize:function(){var t=this.imageTransforms.rotate*Math.PI/180;return{width:Math.abs(this.imageAttributes.width*Math.cos(t))+Math.abs(this.imageAttributes.height*Math.sin(t)),height:Math.abs(this.imageAttributes.width*Math.sin(t))+Math.abs(this.imageAttributes.height*Math.cos(t))}},initialized:function(){return!!(this.visibleArea&&this.imageLoaded)},settings:function(){var t=y(this.resizeImage,{touch:!0,wheel:{ratio:.1},adjustStencil:!0},{touch:!1,wheel:!1,adjustStencil:!1});return{moveImage:y(this.moveImage,{touch:!0,mouse:!0},{touch:!1,mouse:!1}),resizeImage:t}},coefficient:function(){return this.visibleArea?this.visibleArea.width/this.boundaries.width:0},areaRestrictions:function(){return this.imageLoaded?this.areaRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction,boundaries:this.boundaries}):{}},transitionsOptions:function(){return{enabled:this.transitionsActive,timingFunction:"ease-in-out",time:350}},sizeRestrictions:function(){if(this.boundaries.width&&this.boundaries.height&&this.imageSize.width&&this.imageSize.height){var t,i,e,s,n,o,r,a,h=this.sizeRestrictionsAlgorithm({imageSize:this.imageSize,minWidth:b(this.minWidth)?0:z(this.minWidth),minHeight:b(this.minHeight)?0:z(this.minHeight),maxWidth:b(this.maxWidth)?1/0:z(this.maxWidth),maxHeight:b(this.maxHeight)?1/0:z(this.maxHeight)});if(i=(t={sizeRestrictions:h,areaRestrictions:this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}
1),imageSize:this.imageSize,boundaries:this.boundaries,positionRestrictions:this.positionRestrictions,imageRestriction:this.imageRestriction,visibleArea:this.visibleArea,stencilSize:this.getStencilSize()}).areaRestrictions,e=t.sizeRestrictions,t.imageSize,s=t.boundaries,n=t.positionRestrictions,t.imageRestriction,o=m(m({},e),{minWidth:void 0!==e.minWidth?e.minWidth:0,minHeight:void 0!==e.minHeight?e.minHeight:0,maxWidth:void 0!==e.maxWidth?e.maxWidth:1/0,maxHeight:void 0!==e.maxHeight?e.maxHeight:1/0}),void 0!==n.left&&void 0!==n.right&&(o.maxWidth=Math.min(o.maxWidth,n.right-n.left)),void 0!==n.bottom&&void 0!==n.top&&(o.maxHeight=Math.min(o.maxHeight,n.bottom-n.top)),a=J(s,r=tn(i)),r.width<1/0&&(!o.maxWidth||o.maxWidth>a.width)&&(o.maxWidth=Math.min(o.maxWidth,a.width)),r.height<1/0&&(!o.maxHeight||o.maxHeight>a.height)&&(o.maxHeight=Math.min(o.maxHeight,a.height)),o.minWidth>o.maxWidth&&(o.minWidth=o.maxWidth,o.widthFrozen=!0),o.minHeight>o.maxHeight&&(o.minHeight=o.maxHeight,o.heightFrozen=!0),h=o,this.visibleArea&&this.stencilSize){var c=this.getStencilSize(),l=tn(this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}));h.maxWidth=Math.min(h.maxWidth,l.width*c.width/this.boundaries.width),h.maxHeight=Math.min(h.maxHeight,l.height*c.height/this.boundaries.height),h.maxWidth<h.minWidth&&(h.minWidth=h.maxWidth),h.maxHeight<h.minHeight&&(h.minHeight=h.maxHeight)}return h}return{minWidth:0,minHeight:0,maxWidth:0,maxHeight:0}},positionRestrictions:function(){return this.positionRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction})},classes:function(){return{cropper:tY(),image:l(tY("image"),this.imageClass),stencil:tY("stencil"),boundaries:l(tY("boundaries"),this.boundariesClass),stretcher:l(tY("stretcher")),background:l(tY("background"),this.backgroundClass),foreground:l(tY("foreground"),this.foregroundClass),imageWrapper:l(tY("image-wrapper")),cropperWrapper:l(tY("cropper-wrapper"))}},stencilCoordinates:function(){if(this.initialized){var t=this.coordinates,i=t.width,e=t.height,s=t.left,n=t.top;return{width:i/this.coefficient,height:e/this.coefficient,left:(s-this.visibleArea.left)/this.coefficient,top:(n-this.visibleArea.top)/this.coefficient}}return this.defaultCoordinates()},boundariesStyle:function(){var t={width:this.boundaries.width?"".concat(Math.round(this.boundaries.width),"px"):"auto",height:this.boundaries.height?"".concat(Math.round(this.boundaries.height),"px"):"auto",transition:"opacity ".concat(this.transitionTime,"ms"),pointerEvents:this.imageLoaded?"all":"none"};return this.imageLoaded||(t.opacity="0"),t},imageStyle:function(){var t=this.imageAttributes.width>this.imageAttributes.height?{width:Math.min(1024,this.imageAttributes.width),height:Math.min(1024,this.imageAttributes.width)/(this.imageAttributes.width/this.imageAttributes.height)}:{height:Math.min(1024,this.imageAttributes.height),width:Math.min(1024,this.imageAttributes.height)*(this.imageAttributes.width/this.imageAttributes.height)},i={left:(t.width-this.imageSize.width)/(2*this.coefficient),top:(t.height-this.imageSize.height)/(2*this.coefficient)},e={left:(1-1/this.coefficient)*t.width/2,top:(1-1/this.coefficient)*t.height/2},s=a(a({},this.imageTransforms),{},{scaleX:this.imageTransforms.scaleX*(this.imageAttributes.width/t.width),scaleY:this.imageTransforms.scaleY*(this.imageAttributes.height/t.height)}),n={width:"".concat(t.width,"px"),height:"".concat(t.height,"px"),left:"0px",top:"0px",transform:"translate(".concat(-i.left-e.left-this.imageTransforms.translateX,"px, ").concat(-i.top-e.top-this.imageTransforms.translateY,"px)")+tW(s)};return this.transitionsOptions.enabled&&(n.transition="".concat(this.transitionsOptions.time,"ms ").concat(this.transitionsOptions.timingFunction)),n}},watch:{src:function(){this.onChangeImage()},stencilComponent:function(){var t=this;this.$nextTick(function(){t.resetCoordinates(),t.runAutoZoom("setCoordinates"),t.onChange()})},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.reset()},stencilProps:function(t,i){["aspectRatio","minAspectRatio","maxAspectRatio"].find(function(e){return t[e]!==i[e]})&&this.$nextTick(this.onPropsChange)}},created:function(){this.debouncedUpdate=u(this.update,this.debounce),this.debouncedDisableTransitions=u(this.disableTransitions,this.transitionsOptions.time),this.awaiting=!1},mounted:function(){this.$refs.image.addEventListener("load",this.onSuccessLoadImage),this.$refs.image.addEventListener("error",this.onFailLoadImage),this.onChangeImage(),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},destroyed:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh),this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.debouncedUpdate.clear(),this.debouncedDisableTransitions.clear()},methods:{getResult:function(){var t=this.initialized?this.prepareResult(a({},this.coordinates)):this.defaultCoordinates(),i={rotate:this.imageTransforms.rotate%360,flip:a({},this.imageTransforms.flip)};if(this.src&&this.imageLoaded){var e=this;return{image:this.image,coordinates:t,visibleArea:this.visibleArea?a({},this.visibleArea):null,imageTransforms:i,get canvas(){return e.canvas?e.getCanvas():void 0}}}return{image:this.image,coordinates:t,visibleArea:this.visibleArea?a({},this.visibleArea):null,canvas:void 0,imageTransforms:i}},zoom:function(t,i){var e=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).transitions;this.onManipulateImage(new S({},{factor:1/t,center:i}),{normalize:!1,transitions:void 0===e||e})},move:function(t,i){var e=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).transitions;this.onManipulateImage(new S({left:t||0,top:i||0}),{normalize:!1,transitions:void 0===e||e})}
1,setCoordinates:function(t){var i=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=e.autoZoom,n=void 0===s||s,o=e.transitions,r=void 0===o||o;this.$nextTick(function(){i.imageLoaded?(i.transitionsActive||(r&&i.enableTransitions(),i.coordinates=i.applyTransform(t),n&&i.runAutoZoom("setCoordinates"),r&&i.debouncedDisableTransitions()),i.onChange()):i.delayedTransforms=t})},refresh:function(){var t=this,i=this.$refs.image;if(this.src&&i)return this.initialized?this.updateVisibleArea().then(function(){t.onChange()}):this.resetVisibleArea().then(function(){t.onChange()})},reset:function(){var t=this;return this.resetVisibleArea().then(function(){t.onChange(!1)})},awaitRender:function(t){var i=this;this.awaiting||(this.awaiting=!0,this.$nextTick(function(){t(),i.awaiting=!1}))},prepareResult:function(t){var i,e,s,n,o;return this.roundResult?(e=(i=a(a({},this.getPublicProperties()),{},{positionRestrictions:to(this.positionRestrictions,F(this.visibleArea)),coordinates:t})).coordinates,s=i.sizeRestrictions,n=i.positionRestrictions,(o={width:Math.round(e.width),height:Math.round(e.height),left:Math.round(e.left),top:Math.round(e.top)}).width>s.maxWidth?o.width=Math.floor(e.width):o.width<s.minWidth&&(o.width=Math.ceil(e.width)),o.height>s.maxHeight?o.height=Math.floor(e.height):o.height<s.minHeight&&(o.height=Math.ceil(e.height)),ts(o,n)):t},processAutoZoom:function(t,i,e,s){var n=this.autoZoomAlgorithm;n||(n=this.stencilSize?tl:this.autoZoom?td:tu);var o=n({event:{type:t,params:s},visibleArea:i,coordinates:e,boundaries:this.boundaries,aspectRatio:this.getAspectRatio(),positionRestrictions:this.positionRestrictions,getAreaRestrictions:this.getAreaRestrictions,sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize()});return a(a({},o),{},{changed:!B(o.visibleArea,i)||!B(o.coordinates,e)})},runAutoZoom:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=i.transitions,s=void 0!==e&&e,n=function(t,i){if(null==t)return{};var e,s,n=function(t,i){if(null==t)return{};var e={};for(var s in t)if(({}).hasOwnProperty.call(t,s)){if(i.indexOf(s)>=0)continue;e[s]=t[s]}return e}(t,i);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(s=0;s<o.length;s++)e=o[s],i.indexOf(e)>=0||({}).propertyIsEnumerable.call(t,e)&&(n[e]=t[e])}return n}(i,tX),o=this.processAutoZoom(t,this.visibleArea,this.coordinates,n),r=o.visibleArea,a=o.coordinates,h=o.changed;s&&h&&this.enableTransitions(),this.visibleArea=r,this.coordinates=a,s&&h&&this.debouncedDisableTransitions()},normalizeEvent:function(t){return function(t){var i=t.event,e=t.visibleArea,s=t.coefficient;if("manipulateImage"===i.type)return m(m({},i),{move:{left:i.move&&i.move.left?s*i.move.left:0,top:i.move&&i.move.top?s*i.move.top:0},scale:{factor:i.scale&&i.scale.factor?i.scale.factor:1,center:i.scale&&i.scale.center?{left:i.scale.center.left*s+e.left,top:i.scale.center.top*s+e.top}:null}});if("resize"===i.type){var n=m(m({},i),{directions:m({},i.directions)});return j.forEach(function(t){n.directions[t]*=s}),n}if("move"===i.type){var o=m(m({},i),{directions:m({},i.directions)});return I.forEach(function(t){o.directions[t]*=s}),o}return i}(a(a({},this.getPublicProperties()),{},{event:t}))},getCanvas:function(){if(this.$refs.canvas){var t,i,e,s,n,o,r,h,c,l,d,u,p,g=this.$refs.canvas,f=this.$refs.image,v=0!==this.imageTransforms.rotate||this.imageTransforms.flip.horizontal||this.imageTransforms.flip.vertical?(t=this.$refs.sourceCanvas,e=(i=this.imageTransforms).rotate,s=i.flip,o=tt(n={width:f.naturalWidth,height:f.naturalHeight},e),r=t.getContext("2d"),t.height=o.height,t.width=o.width,r.save(),h=ti(Y(m({left:0,top:0},n)),e),r.translate(-(h.left-o.width/2),-(h.top-o.height/2)),r.rotate(e*Math.PI/180),r.translate(s.horizontal?n.width:0,s.vertical?n.height:0),r.scale(s.horizontal?-1:1,s.vertical?-1:1),r.drawImage(f,0,0,n.width,n.height),r.restore(),t):f,b=a({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:this.maxCanvasSize,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},this.canvas),w=function(t){return t.find(function(t){return!Number.isNaN(parseFloat(t))&&isFinite(t)}
1)},y=th({sizeRestrictions:{minWidth:w([b.width,b.minWidth])||0,minHeight:w([b.height,b.minHeight])||0,maxWidth:w([b.width,b.maxWidth])||1/0,maxHeight:w([b.height,b.maxHeight])||1/0},width:this.coordinates.width,height:this.coordinates.height,aspectRatio:{minimum:this.coordinates.width/this.coordinates.height,maximum:this.coordinates.width/this.coordinates.height}});if(b.maxArea&&y.width*y.height>b.maxArea){var z=Math.sqrt(b.maxArea/(y.width*y.height));y={width:Math.round(z*y.width),height:Math.round(z*y.height)}}return c=this.coordinates,g.width=(l=y)?l.width:c.width,g.height=l?l.height:c.height,(d=g.getContext("2d")).clearRect(0,0,g.width,g.height),b&&(b.imageSmoothingEnabled&&(d.imageSmoothingEnabled=b.imageSmoothingEnabled),b.imageSmoothingQuality&&(d.imageSmoothingQuality=b.imageSmoothingQuality),b.fillColor&&(d.fillStyle=b.fillColor,d.fillRect(0,0,g.width,g.height),d.save())),u=c.left<0?-c.left:0,p=c.top<0?-c.top:0,d.drawImage(v,c.left+u,c.top+p,c.width,c.height,u*(g.width/c.width),p*(g.height/c.height),g.width,g.height),g}},update:function(){this.$emit("change",this.getResult())},applyTransform:function(t){var i,e,s,n,o,r,a,h,c,l,d,u,p=arguments.length>1&&void 0!==arguments[1]&&arguments[1],g=this.visibleArea&&p?(i=this.sizeRestrictions,e=this.visibleArea,m(m({},i),{minWidth:Math.min(e.width,i.minWidth),minHeight:Math.min(e.height,i.minHeight),maxWidth:Math.min(e.width,i.maxWidth),maxHeight:Math.min(e.height,i.maxHeight)})):this.sizeRestrictions,f=this.visibleArea&&p?to(this.positionRestrictions,F(this.visibleArea)):this.positionRestrictions;return n=(s={transform:t,coordinates:this.coordinates,imageSize:this.imageSize,sizeRestrictions:g,positionRestrictions:f,aspectRatio:this.getAspectRatio(),visibleArea:this.visibleArea}).coordinates,o=s.transform,r=s.imageSize,a=s.sizeRestrictions,h=s.positionRestrictions,c=s.aspectRatio,l=s.visibleArea,d=function(t,i){return tc({coordinates:t,positionRestrictions:h,event:new M({left:i.left-t.left,top:i.top-t.top})})},u=m({},n),(Array.isArray(o)?o:[o]).forEach(function(t){var i,e,s={};b((s="function"==typeof t?t({coordinates:u,imageSize:r,visibleArea:l}):t).width)&&b(s.height)||(i=u,e=m(m({},u),s),u=d(m(m(m({},i),th({width:e.width,height:e.height,sizeRestrictions:a,aspectRatio:c})),{left:0,top:0}),{left:i.left,top:i.top}
1)),b(s.left)&&b(s.top)||(u=d(u,m(m({},u),s)))}),u},resetCoordinates:function(){var t=this;if(this.$refs.image){this.$refs.cropper,this.$refs.image;var i=this.defaultSize;i||(i=this.stencilSize?tp:tm);var e=this.sizeRestrictions;e.minWidth,e.minHeight,e.maxWidth,e.maxHeight;var s=[v(i)?i({boundaries:this.boundaries,imageSize:this.imageSize,aspectRatio:this.getAspectRatio(),sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize(),visibleArea:this.visibleArea}):i,function(i){var e=i.coordinates;return a({},v(t.defaultPosition)?t.defaultPosition({coordinates:e,imageSize:t.imageSize,visibleArea:t.visibleArea}):t.defaultPosition)}];this.delayedTransforms&&s.push.apply(s,h(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.coordinates=this.applyTransform(s,!0),this.delayedTransforms=null}},clearImage:function(){var t=this;this.imageLoaded=!1,setTimeout(function(){var i=t.$refs.stretcher;i&&(i.style.height="auto",i.style.width="auto"),t.coordinates=t.defaultCoordinates(),t.boundaries={width:0,height:0}},this.transitionTime)},enableTransitions:function(){this.transitions&&(this.transitionsActive=!0)},disableTransitions:function(){this.transitionsActive=!1},updateBoundaries:function(){var t=this,i=this.$refs.stretcher,e=this.$refs.cropper;return this.initStretcher({cropper:e,stretcher:i,imageSize:this.imageSize}),this.$nextTick().then(function(){var i,s,n,o,r,a,h,c={cropper:e,imageSize:t.imageSize};if(v(t.defaultBoundaries)?t.boundaries=t.defaultBoundaries(c):"fit"===t.defaultBoundaries?(i=c.cropper,s=c.imageSize,n=i.clientHeight,o=i.clientWidth,r=n,(a=s.width*n/s.height)>o&&(a=o,r=s.height*o/s.width),t.boundaries={width:a,height:r}):t.boundaries={width:(h=c.cropper).clientWidth,height:h.clientHeight}
1,!t.boundaries.width||!t.boundaries.height)throw Error("It's impossible to fit the cropper in the current container")})},resetVisibleArea:function(){var t=this;return this.appliedImageTransforms=a(a({},this.defaultImageTransforms),{},{flip:a({},this.defaultImageTransforms.flip)}),this.updateBoundaries().then(function(){var i,e,s,n,o,r;"visible-area"!==t.priority&&(t.visibleArea=null,t.resetCoordinates()),t.visibleArea=v(t.defaultVisibleArea)?t.defaultVisibleArea({imageSize:t.imageSize,boundaries:t.boundaries,coordinates:"visible-area"!==t.priority?t.coordinates:null,getAreaRestrictions:t.getAreaRestrictions,stencilSize:t.getStencilSize()}):t.defaultVisibleArea,e=(i={visibleArea:t.visibleArea,boundaries:t.boundaries,getAreaRestrictions:t.getAreaRestrictions}).visibleArea,s=i.boundaries,n=i.getAreaRestrictions,o=m({},e),r=q(s),o.width/o.height!==r&&(o.height=o.width/r),t.visibleArea=ts(o,n({visibleArea:o,type:"move"})),"visible-area"===t.priority?t.resetCoordinates():t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("resetVisibleArea")}).catch(function(){t.visibleArea=null})},updateVisibleArea:function(){var t=this;return this.updateBoundaries().then(function(){t.visibleArea=t.fitVisibleArea({imageSize:t.imageSize,boundaries:t.boundaries,visibleArea:t.visibleArea,coordinates:t.coordinates,getAreaRestrictions:t.getAreaRestrictions}),t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("updateVisibleArea")}).catch(function(){t.visibleArea=null})},onChange:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.$listeners&&this.$listeners.change&&(t&&this.debounce?this.debouncedUpdate():this.update())},onChangeImage:function(){var t,i=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){if(function(t){if(f(t))return!1;var i=window.location,e=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(t)||[],s={protocol:e[1]||"",host:e[2]||"",port:e[3]||""},n=function(t){return t.port||("http"===(t.protocol||i.protocol)?80:433)};return!(!s.protocol&&!s.host&&!s.port||s.protocol&&s.protocol==i.protocol&&s.host&&s.host==i.host&&s.host&&n(s)==n(i))}(this.src)){var e=b(this.crossOrigin)?this.canvas:this.crossOrigin;!0===e&&(e="anonymous"),this.imageAttributes.crossOrigin=e}if(this.checkOrientation){var s=(t=this.src,new Promise(function(i){new Promise(function(i,e){try{if(t)if(/^data:/i.test(t))i(function(t){t=t.replace(/^data:([^;]+);base64,/gim,"");for(var i=atob(t),e=i.length,s=new ArrayBuffer(e),n=new Uint8Array(s),o=0;o<e;o++)n[o]=i.charCodeAt(o);return s}(t));else if(/^blob:/i.test(t)){var s,n,o=new FileReader;o.onload=function(t){i(t.target.result)},s=function(t){o.readAsArrayBuffer(t)},(n=new XMLHttpRequest).open("GET",t,!0),n.responseType="blob",n.onload=function(){200!=this.status&&0!==this.status||s(this.response)},n.send()}else{var r=new XMLHttpRequest;r.onreadystatechange=function(){4===r.readyState&&(200===r.status||0===r.status?i(r.response):e("Warning: could not load an image to parse its orientation"),r=null)},r.onprogress=function(){"image/jpeg"!==r.getResponseHeader("content-type")&&r.abort()},r.withCredentials=!1,r.open("GET",t,!0),r.responseType="arraybuffer",r.send(null)}else e("Error: the image is empty")}catch(t){e(t)}}).then(function(e){var s=function(t){try{var i,e=new DataView(t),s=void 0,n=void 0,o=void 0,r=void 0;if(255===e.getUint8(0)&&216===e.getUint8(1))for(var a=e.byteLength,h=2;h+1<a;){if(255===e.getUint8(h)&&225===e.getUint8(h+1)){o=h;break}h++}if(o&&(s=o+10,"Exif"===function(t,i,e){var s,n="";for(s=i,e+=i;s<e;s++)n+=String.fromCharCode(t.getUint8(s));return n}(e,o+4,4))){var c=e.getUint16(s);if(((n=18761===c)||19789===c)&&42===e.getUint16(s+2,n)){var l=e.getUint32(s+4,n);l>=8&&(r=s+l)}}if(r){for(var d=e.getUint16(r,n),u=0;u<d;u++)if(h=r+12*u+2,274===e.getUint16(h,n)){h+=8,i=e.getUint16(h,n),e.setUint16(h,1,n);break}}return i}catch(t){return null}}(e);i(e?{source:t,arrayBuffer:e,orientation:s}:{source:t,arrayBuffer:null,orientation:null})}).catch(function(e){console.warn(e),i({source:t,arrayBuffer:null,orientation:null})})}));setTimeout(function(){s.then(i.onParseImage)},this.transitionTime)}else setTimeout(function(){i.onParseImage({source:i.src})},this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.imageAttributes.src&&(this.clearImage(),this.$emit("error"))},onSuccessLoadImage:function(){var t=this,i=this.$refs.image;i&&!this.imageLoaded&&(this.imageAttributes.height=i.naturalHeight,this.imageAttributes.width=i.naturalWi
1dth,this.imageLoaded=!0,this.resetVisibleArea().then(function(){t.$emit("ready"),t.onChange(!1)}))},onParseImage:function(t){var i=this,e=t.source,s=t.arrayBuffer,n=t.orientation;this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.imageAttributes.revoke=!1,s&&n&&n>1?g(e)||!f(e)?(this.imageAttributes.src=URL.createObjectURL(new Blob([s])),this.imageAttributes.revoke=!0):this.imageAttributes.src=function(t){for(var i=[],e=new Uint8Array(t);e.length>0;){var s=e.subarray(0,8192);i.push(String.fromCharCode.apply(null,Array.from?Array.from(s):s.slice())),e=e.subarray(8192)}return"data:image/jpeg;base64,".concat(btoa(i.join("")))}(s):this.imageAttributes.src=e,v(this.defaultTransforms)?this.appliedImageTransforms=tT(this.defaultTransforms()):w(this.defaultTransforms)?this.appliedImageTransforms=tT(this.defaultTransforms):this.appliedImageTransforms=function(t){var i=tT({});if(t)switch(t){case 2:i.flip.horizontal=!0;break;case 3:i.rotate=-180;break;case 4:i.flip.vertical=!0;break;case 5:i.rotate=90,i.flip.vertical=!0;break;case 6:i.rotate=90;break;case 7:i.rotate=90,i.flip.horizontal=!0;break;case 8:i.rotate=-90}return i}(n),this.defaultImageTransforms=a(a({},this.appliedImageTransforms),{},{flip:a({},this.appliedImageTransforms.flip)}),this.$nextTick(function(){var t=i.$refs.image;t&&t.complete&&(t.naturalWidth?i.onSuccessLoadImage():i.onFailLoadImage())})},onResizeEnd:function(){this.runAutoZoom("resize",{transitions:!0})},onMoveEnd:function(){this.runAutoZoom("move",{transitions:!0})},onMove:function(t){var i=this;this.transitionsOptions.enabled||this.awaitRender(function(){i.coordinates=i.moveAlgorithm(a(a({},i.getPublicProperties()),{},{positionRestrictions:to(i.positionRestrictions,F(i.visibleArea)),coordinates:i.coordinates,event:i.normalizeEvent(t)})),i.onChange()})},onResize:function(t){var i=this;this.transitionsOptions.enabled||this.stencilSize&&!this.autoZoom||this.awaitRender(function(){var e=i.sizeRestrictions,s=Math.min(i.coordinates.width,i.coordinates.height,20*i.coefficient);i.coordinates=i.resizeAlgorithm(a(a({},i.getPublicProperties()),{},{positionRestrictions:to(i.positionRestrictions,F(i.visibleArea)),sizeRestrictions:{maxWidth:Math.min(e.maxWidth,i.visibleArea.width),maxHeight:Math.min(e.maxHeight,i.visibleArea.height),minWidth:Math.max(e.minWidth,s),minHeight:Math.max(e.minHeight,s)},event:i.normalizeEvent(t)})),i.onChange(),i.ticking=!1})},onManipulateImage:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.transitionsOptions.enabled){var e,s,n,o,r,h,c,l,d,u,p,g,f,v,b,w,y,z,R,A,S=i.transitions,x=void 0!==S&&S,M=i.normalize;x&&this.enableTransitions();var C=(s=(e=a(a({},this.getPublicProperties()),{},{event:void 0===M||M?this.normalizeEvent(t):t,getAreaRestrictions:this.getAreaRestrictions,imageRestriction:this.imageRestriction,adjustStencil:!this.stencilSize&&this.settings.resizeImage.adjustStencil})).event,n=e.coordinates,o=e.visibleArea,r=e.sizeRestrictions,h=e.getAreaRestrictions,c=e.positionRestrictions,l=e.adjustStencil,d=s.scale,u=s.move,p=m({},o),g=m({},n),f=1,v=1,b=d.factor&&Math.abs(d.factor-1)>.001,p=V(p,{left:u.left||0,top:u.top||0}),w={stencil:{minimum:Math.max(r.minWidth?r.minWidth/g.width:0,r.minHeight?r.minHeight/g.height:0),maximum:Math.min(r.maxWidth?r.maxWidth/g.width:1/0,r.maxHeight?r.maxHeight/g.height:1/0,G(g,c))},area:{maximum:G(p,h({visibleArea:p,type:"resize"}))}},d.factor&&b&&(d.factor<1?(v=Math.max(d.factor,w.stencil.minimum))>1&&(v=1):d.factor>1&&(v=Math.min(d.factor,Math.min(w.area.maximum,w.stencil.maximum)))<1&&(v=1)),v&&(p=Z(p,v,d.center)),y=n.left-o.left,z=o.width+o.left-(n.width+n.left),R=n.top-o.top,A=o.height+o.top-(n.height+n.top),p=ts(p=V(p,Q(p,{left:void 0!==c.left?c.left-y*v:void 0,top:void 0!==c.top?c.top-R*v:void 0,bottom:void 0!==c.bottom?c.bottom+A*v:void 0,right:void 0!==c.right?c.right+z*v:void 0})),h({visibleArea:p,type:"move"})),g.width=g.width*v,g.height=g.height*v,g.left=p.left+y*v,g.top=p.top+R*v,g=ts(g,to(F(p),c,!0)),d.factor&&b&&l&&(d.factor>1?f=Math.min(w.area.maximum,d.factor)/v:d.factor<1&&(f=Math.max(g.height/p.height,g.width/p.width,d.factor/v)),1!==f&&(p=V(p=ts(p=Z(p,f,d.factor>1?d.center:Y(g)),h({visibleArea:p,type:"move"}
1)),N(Q(g,F(p)))))),{coordinates:g,visibleArea:p}),E=C.visibleArea,T=C.coordinates;this.visibleArea=E,this.coordinates=T,this.runAutoZoom("manipulateImage"),this.onChange(),x&&this.debouncedDisableTransitions()}},onPropsChange:function(){this.coordinates=this.applyTransform(this.coordinates,!0),this.onChange(!1)},getAreaRestrictions:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.visibleArea,e=t.type;return this.areaRestrictionsAlgorithm({boundaries:this.boundaries,imageSize:this.imageSize,imageRestriction:this.imageRestriction,visibleArea:i,type:void 0===e?"move":e})},getAspectRatio:function(t){var i,e,s=this.stencilProps,n=s.aspectRatio,o=s.minAspectRatio,r=s.maxAspectRatio;if(this.$refs.stencil&&this.$refs.stencil.aspectRatios){var a=this.$refs.stencil.aspectRatios();i=a.minimum,e=a.maximum}if(b(i)&&(i=b(n)?o:n),b(e)&&(e=b(n)?r:n),!t&&(b(i)||b(e))){var h=this.getStencilSize(),c=h?q(h):null;b(i)&&(i=R(c)?c:void 0),b(e)&&(e=R(c)?c:void 0)}return{minimum:i,maximum:e}},getStencilSize:function(){var t,i,e,s,n;if(this.stencilSize)return i=(t={currentStencilSize:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height},stencilSize:this.stencilSize,boundaries:this.boundaries,coefficient:this.coefficient,coordinates:this.coordinates,aspectRatio:this.getAspectRatio(!0)}).boundaries,e=t.stencilSize,s=t.aspectRatio,K(q(n=v(e)?e({boundaries:i,aspectRatio:s}):e),s)&&(n=th({sizeRestrictions:{maxWidth:i.width,maxHeight:i.height,minWidth:0,minHeight:0},width:n.width,height:n.height,aspectRatio:{minimum:s.minimum,maximum:s.maximum}})),(n.width>i.width||n.height>i.height)&&(n=th({sizeRestrictions:{maxWidth:i.width,maxHeight:i.height,minWidth:0,minHeight:0},width:n.width,height:n.height,aspectRatio:{minimum:q(n),maximum:q(n)}})),n},getPublicProperties:function(){return{coefficient:this.coefficient,visibleArea:this.visibleArea,coordinates:this.coordinates,boundaries:this.boundaries,sizeRestrictions:this.sizeRestrictions,positionRestrictions:this.positionRestrictions,aspectRatio:this.getAspectRatio(),imageRestriction:this.imageRestriction}},defaultCoordinates:function(){return a({},_)},flip:function(t,i){var e=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).transitions,s=void 0===e||e;if(!this.transitionsActive){s&&this.enableTransitions();var n=a({},this.imageTransforms.flip),o=function(t){var i=t.flip,e=t.previousFlip,s=t.rotate;t.aspectRatio;var n=t.getAreaRestrictions,o=t.coordinates,r=t.visibleArea,a=t.imageSize,h=m({},o),c=m({},r),l=e.horizontal!==i.horizontal,d=e.vertical!==i.vertical;if(l||d){var u=ti({left:a.width/2,top:a.height/2},-s),p=ti(Y(h),-s),g=ti({left:l?u.left-(p.left-u.left):p.left,top:d?u.top-(p.top-u.top):p.top},s);h=V(h,X(g,Y(h))),p=ti(Y(c),-s),c=ts(c=V(c,X(g=ti({left:l?u.left-(p.left-u.left):p.left,top:d?u.top-(p.top-u.top):p.top},s),Y(c))),n({visibleArea:c,type:"move"}))}return{coordinates:h,visibleArea:c}}({flip:{horizontal:t?!n.horizontal:n.horizontal,vertical:i?!n.vertical:n.vertical},previousFlip:n,rotate:this.imageTransforms.rotate,visibleArea:this.visibleArea,coordinates:this.coordinates,imageSize:this.imageSize,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),r=o.visibleArea,h=o.coordinates;t&&(this.appliedImageTransforms.flip.horizontal=!this.appliedImageTransforms.flip.horizontal),i&&(this.appliedImageTransforms.flip.vertical=!this.appliedImageTransforms.flip.vertical),this.visibleArea=r,this.coordinates=h,this.onChange(),s&&this.debouncedDisableTransitions()}},rotate:function(t){var i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).transitions,e=void 0===i||i;if(!this.transitionsActive){e&&this.enableTransitions();var s,n,o,r,h,c,l,d,u,p,g,f,v,b=a({},this.imageSize);this.appliedImageTransforms.rotate+=t;var w=(n=(s={visibleArea:this.visibleArea,coordinates:this.coordinates,previousImageSize:b,imageSize:this.imageSize,angle:t,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}).aspectRatio,o=s.getAreaRestrictions,r=s.coordinates,h=s.visibleArea,c=s.sizeRestrictions,l=s.positionRestrictions,d=s.imageSize,u=s.previousImageSize,p=s.angle,g=m({},r),f=m({},h),v=ti(Y(m({left:0,top:0},u)),p),(g=m(m({},th({sizeRestrictions:c,aspectRatio:n,width:g.width,height:g.height})),ti(Y(g),p))).left-=v.left-d.width/2+g.width/2,g.top-=v.top-d.height/2+g.height/2,f=Z(f,te(f,o({visibleArea:f,type:"resize"}))),{coordinates:g=ts(g,l),visibleArea:f=ts(f=V(f,X(Y(g),Y(r))),o({visibleArea:f,type:"move"}))}),y=w.visibleArea,z=w.coordinates,R=this.processAutoZoom("rotateImage",y,z);y=R.visibleArea,z=R.coordinates,this.visibleArea=y,this.coordinates=z,this.onChange(),e&&this.debouncedDisableTransitions()}}}},void 0,!1,void 0,!1,void 0,void 0,void 0);s.default.component("cropper",tk),s.default.component("rectangle-stencil",t_),s.default.component("circle-stencil",tF),s.default.component("simple-handler",tw),s.default.component("simple-line",tR)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.