(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-76528b00"],{"2b3d":function(t,e,i){"use strict";i("3ca3");var n,o=i("23e7"),s=i("83ab"),r=i("0d3b"),a=i("da84"),h=i("0366"),c=i("e330"),l=i("37e8").f,u=i("6eeb"),d=i("19aa"),f=i("1a2d"),p=i("60da"),m=i("4df4"),g=i("4dae"),v=i("6547").codeAt,b=i("5fb2"),w=i("577e"),y=i("d44e"),z=i("d6d6"),R=i("9861"),A=i("69f3"),S=A.set,M=A.getterFor("URL"),x=R.URLSearchParams,O=R.getState,j=a.URL,C=a.TypeError,E=a.parseInt,B=Math.floor,P=Math.pow,W=c("".charAt),H=c(/./.exec),T=c([].join),k=c(1..toString),L=c([].pop),D=c([].push),$=c("".replace),I=c([].shift),U=c("".split),N=c("".slice),F=c("".toLowerCase),X=c([].unshift),Y="Invalid authority",q="Invalid scheme",V="Invalid host",Z="Invalid port",_=/[a-z]/i,G=/[\d+-.a-z]/i,Q=/\d/,J=/^0x/i,K=/^[0-7]+$/,tt=/^\d+$/,et=/^[\da-f]+$/i,it=/[\0\t\n\r #%/:<>?@[\\\]^|]/,nt=/[\0\t\n\r #/:<>?@[\\\]^|]/,ot=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,st=/[\t\n\r]/g,rt=function(t){var e,i,n,o,s,r,a,h=U(t,".");if(h.length&&""==h[h.length-1]&&h.length--,e=h.length,e>4)return t;for(i=[],n=0;n1&&"0"==W(o,0)&&(s=H(J,o)?16:8,o=N(o,8==s?1:2)),""===o)r=0;else{if(!H(10==s?tt:8==s?K:et,o))return t;r=E(o,s)}D(i,r)}for(n=0;n=P(256,5-e))return null}else if(r>255)return null;for(a=L(i),n=0;n6)return;n=0;while(d()){if(o=null,n>0){if(!("."==d()&&n<4))return;u++}if(!H(Q,d()))return;while(H(Q,d())){if(s=E(d(),10),null===o)o=s;else{if(0==o)return;o=10*o+s}if(o>255)return;u++}h[c]=256*h[c]+o,n++,2!=n&&4!=n||c++}if(4!=n)return;break}if(":"==d()){if(u++,!d())return}else if(d())return;h[c++]=e}else{if(null!==l)return;u++,c++,l=c}}if(null!==l){r=c-l,c=7;while(0!=c&&r>0)a=h[c],h[c--]=h[l+r-1],h[l+--r]=a}else if(8!=c)return;return h},ht=function(t){for(var e=null,i=1,n=null,o=0,s=0;s<8;s++)0!==t[s]?(o>i&&(e=n,i=o),n=null,o=0):(null===n&&(n=s),++o);return o>i&&(e=n,i=o),e},ct=function(t){var e,i,n,o;if("number"==typeof t){for(e=[],i=0;i<4;i++)X(e,t%256),t=B(t/256);return T(e,".")}if("object"==typeof t){for(e="",n=ht(t),i=0;i<8;i++)o&&0===t[i]||(o&&(o=!1),n===i?(e+=i?":":"::",o=!0):(e+=k(t[i],16),i<7&&(e+=":")));return"["+e+"]"}return t},lt={},ut=p({},lt,{" ":1,'"':1,"<":1,">":1,"`":1}),dt=p({},ut,{"#":1,"?":1,"{":1,"}":1}),ft=p({},dt,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),pt=function(t,e){var i=v(t,0);return i>32&&i<127&&!f(e,t)?t:encodeURIComponent(t)},mt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},gt=function(t,e){var i;return 2==t.length&&H(_,W(t,0))&&(":"==(i=W(t,1))||!e&&"|"==i)},vt=function(t){var e;return t.length>1&>(N(t,0,2))&&(2==t.length||"/"===(e=W(t,2))||"\\"===e||"?"===e||"#"===e)},bt=function(t){return"."===t||"%2e"===F(t)},wt=function(t){return t=F(t),".."===t||"%2e."===t||".%2e"===t||"%2e%2e"===t},yt={},zt={},Rt={},At={},St={},Mt={},xt={},Ot={},jt={},Ct={},Et={},Bt={},Pt={},Wt={},Ht={},Tt={},kt={},Lt={},Dt={},$t={},It={},Ut=function(t,e,i){var n,o,s,r=w(t);if(e){if(o=this.parse(r),o)throw C(o);this.searchParams=null}else{if(void 0!==i&&(n=new Ut(i,!0)),o=this.parse(r,null,n),o)throw C(o);s=O(new x),s.bindURL(this),this.searchParams=s}};Ut.prototype={type:"URL",parse:function(t,e,i){var o,s,r,a,h=this,c=e||yt,l=0,u="",d=!1,p=!1,v=!1;t=w(t),e||(h.scheme="",h.username="",h.password="",h.host=null,h.port=null,h.path=[],h.query=null,h.fragment=null,h.cannotBeABaseURL=!1,t=$(t,ot,"")),t=$(t,st,""),o=m(t);while(l<=o.length){switch(s=o[l],c){case yt:if(!s||!H(_,s)){if(e)return q;c=Rt;continue}u+=F(s),c=zt;break;case zt:if(s&&(H(G,s)||"+"==s||"-"==s||"."==s))u+=F(s);else{if(":"!=s){if(e)return q;u="",c=Rt,l=0;continue}if(e&&(h.isSpecial()!=f(mt,u)||"file"==u&&(h.includesCredentials()||null!==h.port)||"file"==h.scheme&&!h.host))return;if(h.scheme=u,e)return void(h.isSpecial()&&mt[h.scheme]==h.port&&(h.port=null));u="","file"==h.scheme?c=Wt:h.isSpecial()&&i&&i.scheme==h.scheme?c=At:h.isSpecial()?c=Ot:"/"==o[l+1]?(c=St,l++):(h.cannotBeABaseURL=!0,D(h.path,""),c=Dt)}break;case Rt:if(!i||i.cannotBeABaseURL&&"#"!=s)return q;if(i.cannotBeABaseURL&&"#"==s){h.scheme=i.scheme,h.path=g(i.path),h.query=i.query,h.fragment="",h.cannotBeABaseURL=!0,c=It;break}c="file"==i.scheme?Wt:Mt;continue;case At:if("/"!=s||"/"!=o[l+1]){c=Mt;continue}c=jt,l++;break;case St:if("/"==s){c=Ct;break}c=Lt;continue;case Mt:if(h.scheme=i.scheme,s==n)h.username=i.username,h.password=i.password,h.host=i.host,h.port=i.port,h.path=g(i.path),h.query=i.query;else if("/"==s||"\\"==s&&h.isSpecial())c=xt;else if("?"==s)h.username=i.username,h.password=i.password,h.host=i.host,h.port=i.port,h.path=g(i.path),h.query="",c=$t;else{if("#"!=s){h.username=i.username,h.password=i.password,h.host=i.host,h.port=i.port,h.path=g(i.path),h.path.length--,c=Lt;continue}h.username=i.username,h.password=i.password,h.host=i.host,h.port=i.port,h.path=g(i.path),h.query=i.query,h.fragment="",c=It}break;case xt:if(!h.isSpecial()||"/"!=s&&"\\"!=s){if("/"!=s){h.username=i.username,h.password=i.password,h.host=i.host,h.port=i.port,c=Lt;continue}c=Ct}else c=jt;break;case Ot:if(c=jt,"/"!=s||"/"!=W(u,l+1))continue;l++;break;case jt:if("/"!=s&&"\\"!=s){c=Ct;continue}break;case Ct:if("@"==s){d&&(u="%40"+u),d=!0,r=m(u);for(var b=0;b65535)return Z;h.port=h.isSpecial()&&R===mt[h.scheme]?null:R,u=""}if(e)return;c=kt;continue}return Z}u+=s;break;case Wt:if(h.scheme="file","/"==s||"\\"==s)c=Ht;else{if(!i||"file"!=i.scheme){c=Lt;continue}if(s==n)h.host=i.host,h.path=g(i.path),h.query=i.query;else if("?"==s)h.host=i.host,h.path=g(i.path),h.query="",c=$t;else{if("#"!=s){vt(T(g(o,l),""))||(h.host=i.host,h.path=g(i.path),h.shortenPath()),c=Lt;continue}h.host=i.host,h.path=g(i.path),h.query=i.query,h.fragment="",c=It}}break;case Ht:if("/"==s||"\\"==s){c=Tt;break}i&&"file"==i.scheme&&!vt(T(g(o,l),""))&&(gt(i.path[0],!0)?D(h.path,i.path[0]):h.host=i.host),c=Lt;continue;case Tt:if(s==n||"/"==s||"\\"==s||"?"==s||"#"==s){if(!e&>(u))c=Lt;else if(""==u){if(h.host="",e)return;c=kt}else{if(a=h.parseHost(u),a)return a;if("localhost"==h.host&&(h.host=""),e)return;u="",c=kt}continue}u+=s;break;case kt:if(h.isSpecial()){if(c=Lt,"/"!=s&&"\\"!=s)continue}else if(e||"?"!=s)if(e||"#"!=s){if(s!=n&&(c=Lt,"/"!=s))continue}else h.fragment="",c=It;else h.query="",c=$t;break;case Lt:if(s==n||"/"==s||"\\"==s&&h.isSpecial()||!e&&("?"==s||"#"==s)){if(wt(u)?(h.shortenPath(),"/"==s||"\\"==s&&h.isSpecial()||D(h.path,"")):bt(u)?"/"==s||"\\"==s&&h.isSpecial()||D(h.path,""):("file"==h.scheme&&!h.path.length&>(u)&&(h.host&&(h.host=""),u=W(u,0)+":"),D(h.path,u)),u="","file"==h.scheme&&(s==n||"?"==s||"#"==s))while(h.path.length>1&&""===h.path[0])I(h.path);"?"==s?(h.query="",c=$t):"#"==s&&(h.fragment="",c=It)}else u+=pt(s,dt);break;case Dt:"?"==s?(h.query="",c=$t):"#"==s?(h.fragment="",c=It):s!=n&&(h.path[0]+=pt(s,lt));break;case $t:e||"#"!=s?s!=n&&("'"==s&&h.isSpecial()?h.query+="%27":h.query+="#"==s?"%23":pt(s,lt)):(h.fragment="",c=It);break;case It:s!=n&&(h.fragment+=pt(s,ut));break}l++}},parseHost:function(t){var e,i,n;if("["==W(t,0)){if("]"!=W(t,t.length-1))return V;if(e=at(N(t,1,-1)),!e)return V;this.host=e}else if(this.isSpecial()){if(t=b(t),H(it,t))return V;if(e=rt(t),null===e)return V;this.host=e}else{if(H(nt,t))return V;for(e="",i=m(t),n=0;n1?arguments[1]:void 0,n=S(e,new Ut(t,!1,i));s||(e.href=n.serialize(),e.origin=n.getOrigin(),e.protocol=n.getProtocol(),e.username=n.getUsername(),e.password=n.getPassword(),e.host=n.getHost(),e.hostname=n.getHostname(),e.port=n.getPort(),e.pathname=n.getPathname(),e.search=n.getSearch(),e.searchParams=n.getSearchParams(),e.hash=n.getHash())},Ft=Nt.prototype,Xt=function(t,e){return{get:function(){return M(this)[t]()},set:e&&function(t){return M(this)[e](t)},configurable:!0,enumerable:!0}};if(s&&l(Ft,{href:Xt("serialize","setHref"),origin:Xt("getOrigin"),protocol:Xt("getProtocol","setProtocol"),username:Xt("getUsername","setUsername"),password:Xt("getPassword","setPassword"),host:Xt("getHost","setHost"),hostname:Xt("getHostname","setHostname"),port:Xt("getPort","setPort"),pathname:Xt("getPathname","setPathname"),search:Xt("getSearch","setSearch"),searchParams:Xt("getSearchParams"),hash:Xt("getHash","setHash")}),u(Ft,"toJSON",(function(){return M(this).serialize()}),{enumerable:!0}),u(Ft,"toString",(function(){return M(this).serialize()}),{enumerable:!0}),j){var Yt=j.createObjectURL,qt=j.revokeObjectURL;Yt&&u(Nt,"createObjectURL",h(Yt,j)),qt&&u(Nt,"revokeObjectURL",h(qt,j))}y(Nt,"URL"),o({global:!0,forced:!r,sham:!s},{URL:Nt})},"4df4":function(t,e,i){"use strict";var n=i("da84"),o=i("0366"),s=i("c65b"),r=i("7b0b"),a=i("9bdd"),h=i("e95a"),c=i("68ee"),l=i("07fa"),u=i("8418"),d=i("9a1f"),f=i("35a1"),p=n.Array;t.exports=function(t){var e=r(t),i=c(this),n=arguments.length,m=n>1?arguments[1]:void 0,g=void 0!==m;g&&(m=o(m,n>2?arguments[2]:void 0));var v,b,w,y,z,R,A=f(e),S=0;if(!A||this==p&&h(A))for(v=l(e),b=i?new this(v):p(v);v>S;S++)R=g?m(e[S],S):e[S],u(b,S,R);else for(y=d(e,A),z=y.next,b=i?new this:[];!(w=s(z,y)).done;S++)R=g?a(y,m,[w.value,S],!0):w.value,u(b,S,R);return b.length=S,b}},"5fb2":function(t,e,i){"use strict";var n=i("da84"),o=i("e330"),s=2147483647,r=36,a=1,h=26,c=38,l=700,u=72,d=128,f="-",p=/[^\0-\u007E]/,m=/[.\u3002\uFF0E\uFF61]/g,g="Overflow: input needs wider integers to process",v=r-a,b=n.RangeError,w=o(m.exec),y=Math.floor,z=String.fromCharCode,R=o("".charCodeAt),A=o([].join),S=o([].push),M=o("".replace),x=o("".split),O=o("".toLowerCase),j=function(t){var e=[],i=0,n=t.length;while(i=55296&&o<=56319&&i>1,t+=y(t/e);while(t>v*h>>1)t=y(t/v),n+=r;return y(n+(v+1)*t/(t+c))},B=function(t){var e=[];t=j(t);var i,n,o=t.length,c=d,l=0,p=u;for(i=0;i=c&&ny((s-l)/R))throw b(g);for(l+=(w-c)*R,c=w,i=0;is)throw b(g);if(n==c){var M=l,x=r;while(1){var O=x<=p?a:x>=p+h?h:x-p;if(M=0||(o[i]=t[i]);return o}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(o[i]=t[i])}return o}function h(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return c(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?c(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=0?n=setTimeout(h,e-c):(n=null,i||(a=t.apply(s,o),s=o=null))}null==e&&(e=100);var c=function(){s=this,o=arguments,r=Date.now();var c=i&&!n;return n||(n=setTimeout(h,e)),c&&(a=t.apply(s,o),s=o=null),a};return c.clear=function(){n&&(clearTimeout(n),n=null)},c.flush=function(){n&&(a=t.apply(s,o),s=o=null,clearTimeout(n),n=null)},c}m.debounce=m;var g=m,v=function(){return v=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0?i.left=n.left:n.right&&n.right>0&&(i.left=-n.right),n.top&&n.top>0?i.top=n.top:n.bottom&&n.bottom>0&&(i.top=-n.bottom),i}function it(t,e){var i;return e.minimum&&te.maximum&&(i=e.maximum),i}function nt(t,e){var i=K(t),n=K(e);return e.width<1/0&&e.height<1/0?i>n?{width:e.width,height:e.width/i}:{width:e.height*i,height:e.height}:e.width<1/0?{width:e.width,height:e.width/i}:e.height<1/0?{width:e.height*i,height:e.height}:t}function ot(t,e){var i=e*Math.PI/180;return{width:Math.abs(t.width*Math.cos(i))+Math.abs(t.height*Math.sin(i)),height:Math.abs(t.width*Math.sin(i))+Math.abs(t.height*Math.cos(i))}}function st(t,e){var i=e*Math.PI/180;return{left:t.left*Math.cos(i)-t.top*Math.sin(i),top:t.left*Math.sin(i)+t.top*Math.cos(i)}}function rt(t,e){var i=Z(at(t,e),e);return i.left+i.right+i.top+i.bottom?i.left+i.right>i.top+i.bottom?Math.min((t.width+i.left+i.right)/t.width,tt(t,e)):Math.min((t.height+i.top+i.bottom)/t.height,tt(t,e)):1}function at(t,e,i){void 0===i&&(i=!1);var n=et(t,e);return Q(t,i?G(n):n)}function ht(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 ct(t,e){return v(v({},t),{minWidth:Math.min(e.width,t.minWidth),minHeight:Math.min(e.height,t.minHeight),maxWidth:Math.min(e.width,t.maxWidth),maxHeight:Math.min(e.height,t.maxHeight)})}function lt(t,e,i){void 0===i&&(i=!0);var n={};return D.forEach((function(o){var s=t[o],r=e[o];void 0!==s&&void 0!==r?n[o]="left"===o||"top"===o?i?Math.max(s,r):Math.min(s,r):i?Math.min(s,r):Math.max(s,r):void 0!==r?n[o]=r:void 0!==s&&(n[o]=s)})),n}function ut(t,e){return lt(t,e,!0)}function dt(t){var e=t.size,i=t.aspectRatio,n=t.ignoreMinimum,o=t.sizeRestrictions;return Boolean((e.correctRatio||K(e)>=i.minimum&&K(e)<=i.maximum)&&e.height<=o.maxHeight&&e.width<=o.maxWidth&&e.width&&e.height&&(n||e.height>=o.minHeight&&e.width>=o.minWidth))}function ft(t,e){return Math.pow(t.width-e.width,2)+Math.pow(t.height-e.height,2)}function pt(t){var e=t.width,i=t.height,n=t.sizeRestrictions,o={minimum:t.aspectRatio&&t.aspectRatio.minimum||0,maximum:t.aspectRatio&&t.aspectRatio.maximum||1/0},s={width:Math.max(n.minWidth,Math.min(n.maxWidth,e)),height:Math.max(n.minHeight,Math.min(n.maxHeight,i))};function r(t,s){return void 0===s&&(s=!1),t.reduce((function(t,r){return dt({size:r,aspectRatio:o,sizeRestrictions:n,ignoreMinimum:s})&&(!t||ft(r,{width:e,height:i})1-l)||(u=v(v({},u),pt({sizeRestrictions:r,width:u.width,height:u.height,aspectRatio:{minimum:K(f),maximum:K(f)}})));var p=rt(d=J(d,u.width*i.width/(d.width*f.width)),e({visibleArea:d,type:"resize"}));return 1!==p&&(d=J(d,p),u=J(u,p)),d=at(d=Q(d,q(V(u),V(d))),e({visibleArea:d,type:"move"})),{coordinates:u=at(u,ut(Y(d),a)),visibleArea:d}}function bt(t){var e=t.event,i=t.getAreaRestrictions,n=t.boundaries,o=t.coordinates,s=t.visibleArea;t.aspectRatio,t.stencilSize,t.sizeRestrictions;var r=t.positionRestrictions;t.stencilReference;var a=v({},o),h=v({},s);if(o&&s&&"manipulateImage"!==e.type){var c={width:0,height:0};h.width,n.width,K(n)>K(a)?(c.height=.8*n.height,c.width=c.height*K(a)):(c.width=.8*n.width,c.height=c.width*K(a));var l=rt(h=J(h,a.width*n.width/(h.width*c.width)),i({visibleArea:h,type:"resize"}));h=J(h,l),1!==l&&(c.height/=l,c.width/=l),h=at(h=Q(h,q(V(a),V(h))),i({visibleArea:h,type:"move"})),a=at(a,ut(Y(h),r))}return{coordinates:a,visibleArea:h}}function wt(t){var e=t.event,i=t.coordinates,n=t.visibleArea,o=t.getAreaRestrictions,s=v({},n),r=v({},i);if("setCoordinates"===e.type){var a=Math.max(0,r.width-s.width),h=Math.max(0,r.height-s.height);a>h?s=J(s,Math.min(r.width/s.width,tt(s,o({visibleArea:s,type:"resize"})))):h>a&&(s=J(s,Math.min(r.height/s.height,tt(s,o({visibleArea:s,type:"resize"}))))),s=at(s=Q(s,G(et(r,Y(s)))),o({visibleArea:s,type:"move"}))}return{visibleArea:s,coordinates:r}}function yt(t){var e=t.imageSize,i=t.visibleArea,n=t.coordinates,o=i||e;return{left:(i?i.left:0)+o.width/2-n.width/2,top:(i?i.top:0)+o.height/2-n.height/2}}function zt(t){var e=t.imageSize,i=t.visibleArea,n=t.aspectRatio,o=t.sizeRestrictions,s=i||e,r=Math.min(n.maximum||1/0,Math.max(n.minimum||0,K(s))),a=s.widthK(s)?i=(e=h.height*c.height/s.height)*K(h):e=(i=h.width*c.width/s.width)/K(h),pt({width:i,height:e,aspectRatio:r,sizeRestrictions:a})}function At(t){var e=t.getAreaRestrictions,i=t.coordinates,n=t.imageSize,o=K(t.boundaries);if(i){var s={height:Math.max(i.height,n.height),width:Math.max(i.width,n.width)},r=nt({width:K(s)>o?s.width:s.height*o,height:K(s)>o?s.width/o:s.height},ht(e())),a={left:i.left+i.width/2-r.width/2,top:i.top+i.height/2-r.height/2,width:r.width,height:r.height},h=Z(i,Y(v({left:0,top:0},n))),c={};return!h.left&&!h.right&&a.width<=n.width&&(c.left=0,c.right=n.width),!h.top&&!h.bottom&&a.height<=n.height&&(c.top=0,c.bottom=n.height),at(a,c)}var l=K(n);return r={height:l>o?n.height:n.width/o,width:l>o?n.height*o:n.width},{left:n.width/2-r.width/2,top:n.height/2-r.height/2,width:r.width,height:r.height}}function St(t,e){return lt(t,Y(e))}function Mt(t){var e=t.event,i=t.coordinates,n=t.visibleArea,o=t.sizeRestrictions,s=t.getAreaRestrictions,r=t.positionRestrictions,a=t.adjustStencil,h=e.scale,c=e.move,l=v({},n),u=v({},i),d=1,f=1,p=h.factor&&Math.abs(h.factor-1)>.001;l=Q(l,{left:c.left||0,top:c.top||0});var m={stencil:{minimum:Math.max(o.minWidth?o.minWidth/u.width:0,o.minHeight?o.minHeight/u.height:0),maximum:Math.min(o.maxWidth?o.maxWidth/u.width:1/0,o.maxHeight?o.maxHeight/u.height:1/0,tt(u,r))},area:{maximum:tt(l,s({visibleArea:l,type:"resize"}))}};h.factor&&p&&(h.factor<1?(f=Math.max(h.factor,m.stencil.minimum))>1&&(f=1):h.factor>1&&(f=Math.min(h.factor,Math.min(m.area.maximum,m.stencil.maximum)))<1&&(f=1)),f&&(l=J(l,f,h.center));var g=i.left-n.left,b=n.width+n.left-(i.width+i.left),w=i.top-n.top,y=n.height+n.top-(i.height+i.top);return l=at(l=Q(l,et(l,{left:void 0!==r.left?r.left-g*f:void 0,top:void 0!==r.top?r.top-w*f:void 0,bottom:void 0!==r.bottom?r.bottom+y*f:void 0,right:void 0!==r.right?r.right+b*f:void 0})),s({visibleArea:l,type:"move"})),u.width=u.width*f,u.height=u.height*f,u.left=l.left+g*f,u.top=l.top+w*f,u=at(u,ut(Y(l),r)),h.factor&&p&&a&&(h.factor>1?d=Math.min(m.area.maximum,h.factor)/f:h.factor<1&&(d=Math.max(u.height/l.height,u.width/l.width,h.factor/f)),1!==d&&(l=Q(l=at(l=J(l,d,h.factor>1?h.center:V(u)),s({visibleArea:l,type:"move"})),G(et(u,Y(l)))))),{coordinates:u,visibleArea:l}}function xt(t){var e=t.aspectRatio,i=t.getAreaRestrictions,n=t.coordinates,o=t.visibleArea,s=t.sizeRestrictions,r=t.positionRestrictions,a=t.imageSize,h=t.previousImageSize,c=t.angle,l=v({},n),u=v({},o),d=st(V(v({left:0,top:0},h)),c);return(l=v(v({},pt({sizeRestrictions:s,aspectRatio:e,width:l.width,height:l.height})),st(V(l),c))).left-=d.left-a.width/2+l.width/2,l.top-=d.top-a.height/2+l.height/2,u=J(u,rt(u,i({visibleArea:u,type:"resize"}))),{coordinates:l=at(l,r),visibleArea:u=at(u=Q(u,q(V(l),V(n))),i({visibleArea:u,type:"move"}))}}function Ot(t){var e=t.flip,i=t.previousFlip,n=t.rotate;t.aspectRatio;var o=t.getAreaRestrictions,s=t.coordinates,r=t.visibleArea,a=t.imageSize,h=v({},s),c=v({},r),l=i.horizontal!==e.horizontal,u=i.vertical!==e.vertical;if(l||u){var d=st({left:a.width/2,top:a.height/2},-n),f=st(V(h),-n),p=st({left:l?d.left-(f.left-d.left):f.left,top:u?d.top-(f.top-d.top):f.top},n);h=Q(h,q(p,V(h))),f=st(V(c),-n),c=at(c=Q(c,q(p=st({left:l?d.left-(f.left-d.left):f.left,top:u?d.top-(f.top-d.top):f.top},n),V(c))),o({visibleArea:c,type:"move"}))}return{coordinates:h,visibleArea:c}}function jt(t){var e=t.directions,i=t.coordinates,n=t.positionRestrictions,o=void 0===n?{}:n,s=t.sizeRestrictions,r=t.preserveRatio,a=t.compensate,h=v({},e),c=_(i,h).width,l=_(i,h).height;c<0&&(h.left<0&&h.right<0?(h.left=-(i.width-s.minWidth)/(h.left/h.right),h.right=-(i.width-s.minWidth)/(h.right/h.left)):h.left<0?h.left=-(i.width-s.minWidth):h.right<0&&(h.right=-(i.width-s.minWidth))),l<0&&(h.top<0&&h.bottom<0?(h.top=-(i.height-s.minHeight)/(h.top/h.bottom),h.bottom=-(i.height-s.minHeight)/(h.bottom/h.top)):h.top<0?h.top=-(i.height-s.minHeight):h.bottom<0&&(h.bottom=-(i.height-s.minHeight)));var u=Z(_(i,h),o);a&&(u.left&&u.left>0&&0===u.right?(h.right+=u.left,h.left-=u.left):u.right&&u.right>0&&0===u.left&&(h.left+=u.right,h.right-=u.right),u.top&&u.top>0&&0===u.bottom?(h.bottom+=u.top,h.top-=u.top):u.bottom&&u.bottom>0&&0===u.top&&(h.top+=u.bottom,h.bottom-=u.bottom),u=Z(_(i,h),o));var d={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(D.forEach((function(t){var e=u[t];e&&h[t]&&(d[t]=Math.max(0,1-e/h[t]))})),r){var f=Math.min.apply(null,D.map((function(t){return d[t]})));f!==1/0&&D.forEach((function(t){h[t]*=f}))}else D.forEach((function(t){d[t]!==1/0&&(h[t]*=d[t])}));if(c=_(i,h).width,l=_(i,h).height,h.right+h.left&&(c>s.maxWidth?d.width=(s.maxWidth-i.width)/(h.right+h.left):cs.maxHeight?d.height=(s.maxHeight-i.height)/(h.bottom+h.top):l=1&&(this.touchStarted?(this.processMove(t,t.touches),t.preventDefault(),t.stopPropagation()):j({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 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.processEnd()},initAnchor:function(t){var e=this.$refs.container.getBoundingClientRect(),i=e.left,n=e.top;this.anchor={x:t.clientX-i,y:t.clientY-n}},processMove:function(t,e){var i=h(e);if(this.touches.length){var n=this.$refs.container.getBoundingClientRect(),o=n.left,s=n.top;1===this.touches.length&&1===i.length&&this.$emit("move",new Ut({left:i[0].clientX-(o+this.anchor.x),top:i[0].clientY-(s+this.anchor.y)}))}},processEnd:function(){this.touches.length&&this.$emit("move-end"),this.touches=[]}},emits:["move","move-end"]};function Xt(t){var e,i;return{rotate:t.rotate||0,flip:{horizontal:(null===(e=null==t?void 0:t.flip)||void 0===e?void 0:e.horizontal)||!1,vertical:(null===(i=null==t?void 0:t.flip)||void 0===i?void 0:i.vertical)||!1}}}function Yt(t){return new Promise((function(e,i){try{if(t)if(/^data:/i.test(t))e(function(t){t=t.replace(/^data:([^;]+);base64,/gim,"");for(var e=atob(t),i=e.length,n=new ArrayBuffer(i),o=new Uint8Array(n),s=0;s=8&&(r=n+l)}}if(r)for(var u=i.getUint16(r,o),d=0;d1&&this.touchResize){var i=Gt(e,this.$refs.container),n=this.oldGeometricProperties;n.count===i.count&&n.count>1&&this.$emit("resize",new It({left:n.centerMass.left-i.centerMass.left,top:n.centerMass.top-i.centerMass.top},{factor:n.spread/i.spread,center:i.centerMass})),this.oldGeometricProperties=i}this.touches=e}},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 e=this.$refs.container,i=e.getBoundingClientRect(),n=i.left,o=i.top,s=i.bottom,r=i.right;this.touches=h(t.touches).filter((function(t){return t.clientX>n&&t.clientXo&&t.clientY0?1:-1),s={left:t.clientX-i,top:t.clientY-n};this.$emit("resize",new It({},{factor:o,center:s})),this.touches.length||this.debouncedProcessEnd()}var r,a}},emits:["resize","move","transform-end"],render:function(t,e,i,o,s,r){return Object(n["openBlock"])(),Object(n["createBlock"])("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)}),onWheel:e[3]||(e[3]=function(){return r.onWheel&&r.onWheel.apply(r,arguments)})},[Object(n["renderSlot"])(t.$slots,"default")],544)}},Jt={components:{TransformableImage:Qt},props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0}},emits:["resize","move"],render:function(t,e,i,o,s,r){var a=Object(n["resolveComponent"])("transformable-image");return Object(n["openBlock"])(),Object(n["createBlock"])(a,{"touch-move":i.touchMove,"touch-resize":i.touchResize,"mouse-move":i.mouseMove,"wheel-resize":i.wheelResize,onMove:e[1]||(e[1]=function(e){return t.$emit("move",e)}),onResize:e[2]||(e[2]=function(e){return t.$emit("resize",e)})},{default:Object(n["withCtx"])((function(){return[Object(n["renderSlot"])(t.$slots,"default")]})),_:3},8,["touch-move","touch-resize","mouse-move","wheel-resize"])}},Kt=p("vue-preview"),te={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:Kt({fill:this.fill}),wrapper:Kt("wrapper"),imageWrapper:Kt("image-wrapper"),image:f(Kt("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,e=s(s({rotate:0,flip:{horizontal:!1,vertical:!1}},this.image.transforms),{},{scaleX:1/t,scaleY:1/t}),i=this.imageSize.width,n=this.imageSize.height,o=ot({width:i,height:n},e.rotate),r={width:"".concat(i,"px"),height:"".concat(n,"px"),left:"0px",top:"0px"},a={rotate:{left:(i-o.width)*e.scaleX/2,top:(n-o.height)*e.scaleY/2},scale:{left:(1-e.scaleX)*i/2,top:(1-e.scaleY)*n/2}};return r.transform="translate(\n\t\t\t\t".concat(-this.coordinates.left/t-a.rotate.left-a.scale.left,"px,").concat(-this.coordinates.top/t-a.rotate.top-a.scale.top,"px) ")+qt(e),this.transitions&&this.transitions.enabled&&(r.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),r}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)},unmounted: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.naturalWidth},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()}},render:function(t,e,i,o,s,r){return Object(n["openBlock"])(),Object(n["createBlock"])("div",{ref:"root",class:r.classes.root,style:r.style},[Object(n["createVNode"])("div",{ref:"wrapper",class:r.classes.wrapper,style:r.wrapperStyle},[Object(n["withDirectives"])(Object(n["createVNode"])("img",{ref:"image",src:i.image&&i.image.src,class:r.classes.image,style:r.imageStyle},null,14,["src"]),[[n["vShow"],i.image&&i.image.src]])],6)],6)}},ee={components:{Preview:te},inheritAttrs:!1,render:function(t,e,i,o,s,r){var a=Object(n["resolveComponent"])("preview");return Object(n["openBlock"])(),Object(n["createBlock"])(a,Object(n["mergeProps"])(t.$attrs,{fill:!0}),null,16)}},ie=p("vue-rectangle-stencil"),ne={name:"RectangleStencil",components:{StencilPreview:ee,BoundingBox:$t,DraggableArea:Ft},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return Pt}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return Tt}},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:f(ie({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:f(ie("preview"),this.previewClass),boundingBox:f(ie("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,e=t.height,i=t.width,n=t.left,o=t.top,s={width:"".concat(i,"px"),height:"".concat(e,"px"),transform:"translate(".concat(n,"px, ").concat(o,"px)")};return this.transitions&&this.transitions.enabled&&(s.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),s}},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}}},emits:["resize","resize-end","move","move-end"],render:function(t,e,i,o,s,r){var a=Object(n["resolveComponent"])("stencil-preview"),h=Object(n["resolveComponent"])("draggable-area"),c=Object(n["resolveComponent"])("bounding-box");return Object(n["openBlock"])(),Object(n["createBlock"])("div",{class:r.classes.stencil,style:r.style},[Object(n["createVNode"])(c,{width:i.stencilCoordinates.width,height:i.stencilCoordinates.height,transitions:i.transitions,class:r.classes.boundingBox,handlers:i.handlers,"handlers-component":i.handlersComponent,"handlers-classes":i.handlersClasses,"handlers-wrappers-classes":i.handlersWrappersClasses,lines:i.lines,"lines-component":i.linesComponent,"lines-classes":i.linesClasses,"lines-wrappers-classes":i.linesWrappersClasses,resizable:i.resizable,onResize:r.onResize,onResizeEnd:r.onResizeEnd},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(h,{movable:i.movable,onMove:r.onMove,onMoveEnd:r.onMoveEnd},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(a,{image:i.image,coordinates:i.coordinates,width:i.stencilCoordinates.width,height:i.stencilCoordinates.height,class:r.classes.preview,transitions:i.transitions},null,8,["image","coordinates","width","height","class","transitions"])]})),_:1},8,["movable","onMove","onMoveEnd"])]})),_:1},8,["width","height","transitions","class","handlers","handlers-component","handlers-classes","handlers-wrappers-classes","lines","lines-component","lines-classes","lines-wrappers-classes","resizable","onResize","onResizeEnd"])],6)}},oe=p("vue-circle-stencil"),se=(Boolean,Boolean,["transitions"]),re=p("vue-advanced-cropper"),ae={name:"Cropper",components:{BackgroundWrapper:Jt},props:{src:{type:String,default:null},stencilComponent:{type:[Object,String],default:function(){return ne}},backgroundWrapperComponent:{type:[Object,String],default:function(){return Jt}},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!==N.indexOf(t)}},roundResult:{type:Boolean,default:!0},defaultSize:{type:[Function,Object]},defaultPosition:{type:[Function,Object]},defaultVisibleArea:{type:[Function,Object]},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 e=t.event,i=t.coordinates,n=t.aspectRatio,o=t.positionRestrictions,s=t.sizeRestrictions,r=v(v({},i),{right:i.left+i.width,bottom:i.top+i.height}),a=e.params||{},h=v({},e.directions),c=a.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};s.widthFrozen&&(h.left=0,h.right=0),s.heightFrozen&&(h.top=0,h.bottom=0),D.forEach((function(t){c[t]||(h[t]=0)}));var l=_(r,h=jt({coordinates:r,directions:h,sizeRestrictions:s,positionRestrictions:o})).width,u=_(r,h).height,d=a.preserveRatio?K(r):it(l/u,n);if(d){var f=a.respectDirection;if(f||(f=r.width>=r.height||1===d?"width":"height"),"width"===f){var p=l/d-r.height;if(c.top&&c.bottom){var m=h.top,g=h.bottom;h.bottom=Ct(p,g,m),h.top=Ct(p,m,g)}else c.bottom?h.bottom=p:c.top?h.top=p:c.right?h.right=0:c.left&&(h.left=0)}else if("height"===f){var b=r.width-u*d;if(c.left&&c.right){var w=h.left,y=h.right;h.left=-Ct(b,w,y),h.right=-Ct(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=jt({directions:h,coordinates:r,sizeRestrictions:s,positionRestrictions:o,preserveRatio:!0,compensate:a.compensate})}return l=_(r,h).width,u=_(r,h).height,(d=a.preserveRatio?K(r):it(l/u,n))&&Math.abs(d-l/u)>.001&&D.forEach((function(t){c[t]||(h[t]=0)})),mt({event:new B({left:-h.left,top:-h.top}),coordinates:{width:i.width+h.right+h.left,height:i.height+h.top+h.bottom,left:i.left,top:i.top},positionRestrictions:o})}},moveAlgorithm:{type:Function,default:mt},initStretcher:{type:Function,default:function(t){var e=t.stretcher,i=t.imageSize,n=K(i);e.style.width=i.width+"px",e.style.height=e.clientWidth/n+"px",e.style.width=e.clientWidth+"px"}},fitCoordinates:{type:Function,default:function(t){var e=t.visibleArea,i=t.coordinates,n=t.aspectRatio,o=t.sizeRestrictions,s=t.positionRestrictions,r=v(v({},i),pt({width:i.width,height:i.height,aspectRatio:n,sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minHeight:Math.min(e.height,o.minHeight),minWidth:Math.min(e.width,o.minWidth)}}));return at(r=Q(r,q(V(i),V(r))),ut(Y(e),s))}},fitVisibleArea:{type:Function,default:function(t){var e=t.visibleArea,i=t.boundaries,n=t.getAreaRestrictions,o=t.coordinates,s=v({},e);s.height=s.width/K(i),s.top+=(e.height-s.height)/2,(o.height-s.height>0||o.width-s.width>0)&&(s=J(s,Math.max(o.height/s.height,o.width/s.width)));var r=G(et(o,Y(s=J(s,rt(s,n({visibleArea:s,type:"resize"}))))));return s.widthK(n)?(r={top:0,bottom:n.height},e&&"move"===s&&(e.width>n.width?(r.left=-(e.width-n.width)/2,r.right=n.width-r.left):(r.left=0,r.right=n.width))):(r={left:0,right:n.width},e&&"move"===s&&(e.height>n.height?(r.top=-(e.height-n.height)/2,r.bottom=n.height-r.top):(r.top=0,r.bottom=n.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 e=t.imageSize,i={};return"none"!==t.imageRestriction&&(i={left:0,top:0,right:e.width,bottom:e.height}),i}}},data:function(){return{transitionsActive:!1,imageLoaded:!1,imageAttributes:{width:null,height:null,crossOrigin:null,src:null},appliedImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},boundaries:{width:0,height:0},visibleArea:null,coordinates:s({},F)}},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=function(t){return t*Math.PI/180}(this.imageTransforms.rotate);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 Boolean(this.visibleArea&&this.imageLoaded)},settings:function(){var t=S(this.resizeImage,{touch:!0,wheel:{ratio:.1},adjustStencil:!0},{touch:!1,wheel:!1,adjustStencil:!1});return{moveImage:S(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=this.sizeRestrictionsAlgorithm({imageSize:this.imageSize,minWidth:R(this.minWidth)?0:M(this.minWidth),minHeight:R(this.minHeight)?0:M(this.minHeight),maxWidth:R(this.maxWidth)?1/0:M(this.maxWidth),maxHeight:R(this.maxHeight)?1/0:M(this.maxHeight)});if(t=function(t){var e=t.areaRestrictions,i=t.sizeRestrictions;t.imageSize;var n=t.boundaries,o=t.positionRestrictions;t.imageRestriction;var s=v(v({},i),{minWidth:void 0!==i.minWidth?i.minWidth:0,minHeight:void 0!==i.minHeight?i.minHeight:0,maxWidth:void 0!==i.maxWidth?i.maxWidth:1/0,maxHeight:void 0!==i.maxHeight?i.maxHeight:1/0});void 0!==o.left&&void 0!==o.right&&(s.maxWidth=Math.min(s.maxWidth,o.right-o.left)),void 0!==o.bottom&&void 0!==o.top&&(s.maxHeight=Math.min(s.maxHeight,o.bottom-o.top));var r=ht(e),a=nt(n,r);return r.width<1/0&&(!s.maxWidth||s.maxWidth>a.width)&&(s.maxWidth=Math.min(s.maxWidth,a.width)),r.height<1/0&&(!s.maxHeight||s.maxHeight>a.height)&&(s.maxHeight=Math.min(s.maxHeight,a.height)),s.minWidth>s.maxWidth&&(s.minWidth=s.maxWidth,s.widthFrozen=!0),s.minHeight>s.maxHeight&&(s.minHeight=s.maxHeight,s.heightFrozen=!0),s}({sizeRestrictions:t,areaRestrictions:this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}),imageSize:this.imageSize,boundaries:this.boundaries,positionRestrictions:this.positionRestrictions,imageRestriction:this.imageRestriction,visibleArea:this.visibleArea,stencilSize:this.getStencilSize()}),this.visibleArea&&this.stencilSize){var e=this.getStencilSize(),i=ht(this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}));t.maxWidth=Math.min(t.maxWidth,i.width*e.width/this.boundaries.width),t.maxHeight=Math.min(t.maxHeight,i.height*e.height/this.boundaries.height),t.maxWidththis.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)},e={left:(t.width-this.imageSize.width)/(2*this.coefficient),top:(t.height-this.imageSize.height)/(2*this.coefficient)},i={left:(1-1/this.coefficient)*t.width/2,top:(1-1/this.coefficient)*t.height/2},n=s(s({},this.imageTransforms),{},{scaleX:this.imageTransforms.scaleX*(this.imageAttributes.width/t.width),scaleY:this.imageTransforms.scaleY*(this.imageAttributes.height/t.height)}),o={width:"".concat(t.width,"px"),height:"".concat(t.height,"px"),left:"0px",top:"0px",transform:"translate(".concat(-e.left-i.left-this.imageTransforms.translateX,"px, ").concat(-e.top-i.top-this.imageTransforms.translateY,"px)")+qt(n)};return this.transitionsOptions.enabled&&(o.transition="".concat(this.transitionsOptions.time,"ms ").concat(this.transitionsOptions.timingFunction)),o}},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,e){["aspectRatio","minAspectRatio","maxAspectRatio"].find((function(i){return t[i]!==e[i]}))&&this.$nextTick(this.onPropsChange)}},created:function(){this.debouncedUpdate=g(this.update,this.debounce),this.debouncedDisableTransitions=g(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)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh),this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src)},methods:{getResult:function(){var t=this.initialized?this.prepareResult(s({},this.coordinates)):this.defaultCoordinates(),e={rotate:this.imageTransforms.rotate%360,flip:s({},this.imageTransforms.flip)};if(this.src&&this.imageLoaded){var i=this;return{image:this.image,coordinates:t,visibleArea:this.visibleArea?s({},this.visibleArea):null,imageTransforms:e,get canvas(){return i.canvas?i.getCanvas():void 0}}}return{image:this.image,coordinates:t,visibleArea:this.visibleArea?s({},this.visibleArea):null,canvas:void 0,imageTransforms:e}},zoom:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.transitions,o=void 0===n||n;this.onManipulateImage(new C({},{factor:1/t,center:e}),{normalize:!1,transitions:o})},move:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.transitions,o=void 0===n||n;this.onManipulateImage(new C({left:t||0,top:e||0}),{normalize:!1,transitions:o})},setCoordinates:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.autoZoom,o=void 0===n||n,s=i.transitions,r=void 0===s||s;this.$nextTick((function(){e.imageLoaded?(e.transitionsActive||(r&&e.enableTransitions(),e.coordinates=e.applyTransform(t),o&&e.runAutoZoom("setCoordinates"),r&&e.debouncedDisableTransitions()),e.onChange()):e.delayedTransforms=t}))},refresh:function(){var t=this,e=this.$refs.image;if(this.src&&e)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()}))},awaitRender:function(t){var e=this;this.awaiting||(this.awaiting=!0,this.$nextTick((function(){t(),e.awaiting=!1})))},prepareResult:function(t){return this.roundResult?function(t){var e=t.coordinates,i=t.sizeRestrictions,n=t.positionRestrictions,o={width:Math.round(e.width),height:Math.round(e.height),left:Math.round(e.left),top:Math.round(e.top)};return o.width>i.maxWidth?o.width=Math.floor(e.width):o.widthi.maxHeight?o.height=Math.floor(e.height):o.height1&&void 0!==arguments[1]?arguments[1]:{},i=e.transitions,n=void 0!==i&&i,o=a(e,se),s=this.processAutoZoom(t,this.visibleArea,this.coordinates,o),r=s.visibleArea,h=s.coordinates,c=s.changed;n&&c&&this.enableTransitions(),this.visibleArea=r,this.coordinates=h,n&&c&&this.debouncedDisableTransitions()},normalizeEvent:function(t){return function(t){var e=t.event,i=t.visibleArea,n=t.coefficient;if("manipulateImage"===e.type)return v(v({},e),{move:{left:e.move&&e.move.left?n*e.move.left:0,top:e.move&&e.move.top?n*e.move.top:0},scale:{factor:e.scale&&e.scale.factor?e.scale.factor:1,center:e.scale&&e.scale.center?{left:e.scale.center.left*n+i.left,top:e.scale.center.top*n+i.top}:null}});if("resize"===e.type){var o=v(v({},e),{directions:v({},e.directions)});return D.forEach((function(t){o.directions[t]*=n})),o}if("move"===e.type){var s=v(v({},e),{directions:v({},e.directions)});return U.forEach((function(t){s.directions[t]*=n})),s}return e}(s(s({},this.getPublicProperties()),{},{event:t}))},getCanvas:function(){if(this.$refs.canvas){var t=this.$refs.canvas,e=this.$refs.image,i=0!==this.imageTransforms.rotate||this.imageTransforms.flip.horizontal||this.imageTransforms.flip.vertical?function(t,e,i){var n=i.rotate,o=i.flip,s={width:e.naturalWidth,height:e.naturalHeight},r=ot(s,n),a=t.getContext("2d");t.height=r.height,t.width=r.width,a.save();var h=st(V(v({left:0,top:0},s)),n);return a.translate(-(h.left-r.width/2),-(h.top-r.height/2)),a.rotate(n*Math.PI/180),a.translate(o.horizontal?s.width:0,o.vertical?s.height:0),a.scale(o.horizontal?-1:1,o.vertical?-1:1),a.drawImage(e,0,0,s.width,s.height),a.restore(),t}(this.$refs.sourceCanvas,e,this.imageTransforms):e,n=s({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:this.maxCanvasSize,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},this.canvas),o=function(t){return t.find((function(t){return e=t,!Number.isNaN(parseFloat(e))&&isFinite(e);var e}))},r=pt({sizeRestrictions:{minWidth:o([n.width,n.minWidth])||0,minHeight:o([n.height,n.minHeight])||0,maxWidth:o([n.width,n.maxWidth])||1/0,maxHeight:o([n.height,n.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(n.maxArea&&r.width*r.height>n.maxArea){var a=Math.sqrt(n.maxArea/(r.width*r.height));r={width:Math.round(a*r.width),height:Math.round(a*r.height)}}return function(t,e,i,n,o){t.width=n?n.width:i.width,t.height=n?n.height:i.height;var s=t.getContext("2d");s.clearRect(0,0,t.width,t.height),o&&(o.imageSmoothingEnabled&&(s.imageSmoothingEnabled=o.imageSmoothingEnabled),o.imageSmoothingQuality&&(s.imageSmoothingQuality=o.imageSmoothingQuality),o.fillColor&&(s.fillStyle=o.fillColor,s.fillRect(0,0,t.width,t.height),s.save())),s.drawImage(e,i.left,i.top,i.width,i.height,0,0,t.width,t.height)}(t,i,this.coordinates,r,n),t}},update:function(){this.$emit("change",this.getResult())},applyTransform:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.visibleArea&&e?ct(this.sizeRestrictions,this.visibleArea):this.sizeRestrictions,n=this.visibleArea&&e?St(this.positionRestrictions,this.visibleArea):this.positionRestrictions;return gt({transform:t,coordinates:this.coordinates,imageSize:this.imageSize,sizeRestrictions:i,positionRestrictions:n,aspectRatio:this.getAspectRatio(),visibleArea:this.visibleArea})},resetCoordinates:function(){var t=this;if(this.$refs.image){this.$refs.cropper,this.$refs.image;var e=this.defaultSize;e||(e=this.stencilSize?Rt:zt);var i=this.sizeRestrictions;i.minWidth,i.minHeight,i.maxWidth,i.maxHeight;var n=z(e)?e({boundaries:this.boundaries,imageSize:this.imageSize,aspectRatio:this.getAspectRatio(),sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize(),visibleArea:this.visibleArea}):e,o=this.defaultPosition||yt,r=[n,function(e){var i=e.coordinates;return s({},z(o)?o({coordinates:i,imageSize:t.imageSize,visibleArea:t.visibleArea}):t.defaultPosition)}];this.delayedTransforms&&r.push.apply(r,h(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.coordinates=this.applyTransform(r,!0),this.delayedTransforms=null}},clearImage:function(){var t=this;this.imageLoaded=!1,setTimeout((function(){var e=t.$refs.stretcher;e&&(e.style.height="auto",e.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,e=this.$refs.stretcher,i=this.$refs.cropper;return this.initStretcher({cropper:i,stretcher:e,imageSize:this.imageSize}),this.$nextTick().then((function(){var e={cropper:i,imageSize:t.imageSize};if(z(t.defaultBoundaries)?t.boundaries=t.defaultBoundaries(e):"fit"===t.defaultBoundaries?t.boundaries=function(t){var e=t.cropper,i=t.imageSize,n=e.clientHeight,o=e.clientWidth,s=n,r=i.width*n/i.height;return r>o&&(r=o,s=i.height*o/i.width),{width:r,height:s}}(e):t.boundaries=function(t){var e=t.cropper;return{width:e.clientWidth,height:e.clientHeight}}(e),!t.boundaries.width||!t.boundaries.height)throw new Error("It's impossible to fit the cropper in the current container")}))},resetVisibleArea:function(){var t=this;return this.updateBoundaries().then((function(){"visible-area"!==t.priority&&(t.visibleArea=null,t.resetCoordinates());var e,i,n,o,s,r,a=t.defaultVisibleArea||At;t.visibleArea=z(a)?a({imageSize:t.imageSize,boundaries:t.boundaries,coordinates:"visible-area"!==t.priority?t.coordinates:null,getAreaRestrictions:t.getAreaRestrictions,stencilSize:t.getStencilSize()}):t.defaultVisibleArea,t.visibleArea=(e={visibleArea:t.visibleArea,boundaries:t.boundaries,getAreaRestrictions:t.getAreaRestrictions},i=e.visibleArea,n=e.boundaries,o=e.getAreaRestrictions,s=v({},i),r=K(n),s.width/s.height!==r&&(s.height=s.width/r),at(s,o({visibleArea:s,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];t&&this.debounce?this.debouncedUpdate():this.update()},onChangeImage:function(){var t,e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){if(function(t){if(y(t))return!1;var e=window.location,i=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(t)||[],n={protocol:i[1]||"",host:i[2]||"",port:i[3]||""},o=function(t){return t.port||("http"===(t.protocol||e.protocol)?80:433)};return!(!n.protocol&&!n.host&&!n.port||Boolean(n.protocol&&n.protocol==e.protocol&&n.host&&n.host==e.host&&n.host&&o(n)==o(e)))}(this.src)){var i=R(this.crossOrigin)?this.canvas:this.crossOrigin;!0===i&&(i="anonymous"),this.imageAttributes.crossOrigin=i||null}if(this.checkOrientation){var n=(t=this.src,new Promise((function(e){Yt(t).then((function(i){var n=Vt(i);e(i?{source:t,arrayBuffer:i,orientation:n}:{source:t,arrayBuffer:null,orientation:null})})).catch((function(i){console.warn(i),e({source:t,arrayBuffer:null,orientation:null})}))})));setTimeout((function(){n.then(e.onParseImage)}),this.transitionTime)}else setTimeout((function(){e.onParseImage({source:e.src})}),this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.imageAttributes.src&&(this.clearImage(),this.$emit("error"))},onSuccessLoadImage:function(){var t=this,e=this.$refs.image;e&&!this.imageLoaded&&(this.imageAttributes.height=e.naturalHeight,this.imageAttributes.width=e.naturalWidth,this.imageLoaded=!0,this.reset().then((function(){t.$emit("ready"),t.onChange(!1)})))},onParseImage:function(t){var e=this,i=t.source,n=t.arrayBuffer,o=t.orientation;this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.imageAttributes.revoke=!1,n&&o&&o>1?w(i)||!y(i)?(this.imageAttributes.src=URL.createObjectURL(new Blob([n])),this.imageAttributes.revoke=!0):this.imageAttributes.src=function(t){for(var e=[],i=new Uint8Array(t);i.length>0;){var n=i.subarray(0,8192);e.push(String.fromCharCode.apply(null,Array.from?Array.from(n):n.slice())),i=i.subarray(8192)}return"data:image/jpeg;base64,"+btoa(e.join(""))}(n):this.imageAttributes.src=i,z(this.defaultTransforms)?this.appliedImageTransforms=Xt(this.defaultTransforms()):A(this.defaultTransforms)?this.appliedImageTransforms=Xt(this.defaultTransforms):this.appliedImageTransforms=function(t){var e=Xt({});if(t)switch(t){case 2:e.flip.horizontal=!0;break;case 3:e.rotate=-180;break;case 4:e.flip.vertical=!0;break;case 5:e.rotate=90,e.flip.vertical=!0;break;case 6:e.rotate=90;break;case 7:e.rotate=90,e.flip.horizontal=!0;break;case 8:e.rotate=-90}return e}(o),this.$nextTick((function(){var t=e.$refs.image;t&&t.complete&&(function(t){return Boolean(t.naturalWidth)}(t)?e.onSuccessLoadImage():e.onFailLoadImage())}))},onResizeEnd:function(){this.runAutoZoom("resize",{transitions:!0})},onMoveEnd:function(){this.runAutoZoom("move",{transitions:!0})},onMove:function(t){var e=this;this.transitionsOptions.enabled||this.awaitRender((function(){e.coordinates=e.moveAlgorithm(s(s({},e.getPublicProperties()),{},{positionRestrictions:St(e.positionRestrictions,e.visibleArea),coordinates:e.coordinates,event:e.normalizeEvent(t)})),e.onChange()}))},onResize:function(t){var e=this;this.transitionsOptions.enabled||this.stencilSize&&!this.autoZoom||this.awaitRender((function(){var i=e.sizeRestrictions,n=Math.min(e.coordinates.width,e.coordinates.height,20*e.coefficient);e.coordinates=e.resizeAlgorithm(s(s({},e.getPublicProperties()),{},{positionRestrictions:St(e.positionRestrictions,e.visibleArea),sizeRestrictions:{maxWidth:Math.min(i.maxWidth,e.visibleArea.width),maxHeight:Math.min(i.maxHeight,e.visibleArea.height),minWidth:Math.max(i.minWidth,n),minHeight:Math.max(i.minHeight,n)},event:e.normalizeEvent(t)})),e.onChange(),e.ticking=!1}))},onManipulateImage:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.transitionsOptions.enabled){var i=e.transitions,n=void 0!==i&&i,o=e.normalize,r=void 0===o||o;n&&this.enableTransitions();var a=Mt(s(s({},this.getPublicProperties()),{},{event:r?this.normalizeEvent(t):t,getAreaRestrictions:this.getAreaRestrictions,imageRestriction:this.imageRestriction,adjustStencil:!this.stencilSize&&this.settings.resizeImage.adjustStencil})),h=a.visibleArea,c=a.coordinates;this.visibleArea=h,this.coordinates=c,this.runAutoZoom("manipulateImage"),this.onChange(),n&&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]:{},e=t.visibleArea,i=t.type,n=void 0===i?"move":i;return this.areaRestrictionsAlgorithm({boundaries:this.boundaries,imageSize:this.imageSize,imageRestriction:this.imageRestriction,visibleArea:e,type:n})},getAspectRatio:function(t){var e,i,n=this.stencilProps,o=n.aspectRatio,s=n.minAspectRatio,r=n.maxAspectRatio;if(this.$refs.stencil.aspectRatios){var a=this.$refs.stencil.aspectRatios();e=a.minimum,i=a.maximum}if(R(e)&&(e=R(o)?s:o),R(i)&&(i=R(o)?r:o),!t&&(R(e)||R(i))){var h=this.getStencilSize(),c=h?K(h):null;R(e)&&(e=x(c)?c:void 0),R(i)&&(i=x(c)?c:void 0)}return{minimum:e,maximum:i}},getStencilSize:function(){if(this.stencilSize)return 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)},e=t.boundaries,i=t.stencilSize,n=t.aspectRatio,it(K(o=z(i)?i({boundaries:e,aspectRatio:n}):i),n)&&(o=pt({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:n.minimum,maximum:n.maximum}})),(o.width>e.width||o.height>e.height)&&(o=pt({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:K(o),maximum:K(o)}})),o;var t,e,i,n,o},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 s({},F)},flip:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.transitions,o=void 0===n||n;if(!this.transitionsActive){o&&this.enableTransitions();var r=s({},this.imageTransforms.flip),a=Ot({flip:{horizontal:t?!r.horizontal:r.horizontal,vertical:e?!r.vertical:r.vertical},previousFlip:r,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()}),h=a.visibleArea,c=a.coordinates;t&&(this.appliedImageTransforms.flip.horizontal=!this.appliedImageTransforms.flip.horizontal),e&&(this.appliedImageTransforms.flip.vertical=!this.appliedImageTransforms.flip.vertical),this.visibleArea=h,this.coordinates=c,this.onChange(),o&&this.debouncedDisableTransitions()}},rotate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.transitions,n=void 0===i||i;if(!this.transitionsActive){n&&this.enableTransitions();var o=s({},this.imageSize);this.appliedImageTransforms.rotate+=t;var r=xt({visibleArea:this.visibleArea,coordinates:this.coordinates,previousImageSize:o,imageSize:this.imageSize,angle:t,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),a=r.visibleArea,h=r.coordinates,c=this.processAutoZoom("rotateImage",a,h);a=c.visibleArea,h=c.coordinates,this.visibleArea=a,this.coordinates=h,this.onChange(),n&&this.debouncedDisableTransitions()}}},emits:["change","error","ready"]},he={key:0,ref:"canvas",style:{display:"none"}},ce={key:1,ref:"sourceCanvas",style:{display:"none"}};ae.render=function(t,e,i,o,s,r){return Object(n["openBlock"])(),Object(n["createBlock"])("div",{ref:"cropper",class:r.classes.cropper},[Object(n["createVNode"])("div",{ref:"stretcher",class:r.classes.stretcher},null,2),Object(n["createVNode"])("div",{class:r.classes.boundaries,style:r.boundariesStyle},[(Object(n["openBlock"])(),Object(n["createBlock"])(Object(n["resolveDynamicComponent"])(i.backgroundWrapperComponent),{class:r.classes.cropperWrapper,"wheel-resize":r.settings.resizeImage.wheel,"touch-resize":r.settings.resizeImage.touch,"touch-move":r.settings.moveImage.touch,"mouse-move":r.settings.moveImage.mouse,onMove:r.onManipulateImage,onResize:r.onManipulateImage},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])("div",{class:r.classes.background,style:r.boundariesStyle},null,6),Object(n["createVNode"])("div",{class:r.classes.imageWrapper},[Object(n["createVNode"])("img",{ref:"image",crossorigin:s.imageAttributes.crossOrigin,src:s.imageAttributes.src,class:r.classes.image,style:r.imageStyle,onMousedown:e[1]||(e[1]=Object(n["withModifiers"])((function(){}),["prevent"]))},null,46,["crossorigin","src"])],2),Object(n["createVNode"])("div",{class:r.classes.foreground,style:r.boundariesStyle},null,6),Object(n["withDirectives"])((Object(n["openBlock"])(),Object(n["createBlock"])(Object(n["resolveDynamicComponent"])(i.stencilComponent),Object(n["mergeProps"])({ref:"stencil",image:r.image,coordinates:s.coordinates,"stencil-coordinates":r.stencilCoordinates,transitions:r.transitionsOptions},i.stencilProps,{onResize:r.onResize,onResizeEnd:r.onResizeEnd,onMove:r.onMove,onMoveEnd:r.onMoveEnd}),null,16,["image","coordinates","stencil-coordinates","transitions","onResize","onResizeEnd","onMove","onMoveEnd"])),[[n["vShow"],s.imageLoaded]]),i.canvas?(Object(n["openBlock"])(),Object(n["createBlock"])("canvas",he,null,512)):Object(n["createCommentVNode"])("",!0),i.canvas?(Object(n["openBlock"])(),Object(n["createBlock"])("canvas",ce,null,512)):Object(n["createCommentVNode"])("",!0)]})),_:1},8,["class","wheel-resize","touch-resize","touch-move","mouse-move","onMove","onResize"]))],6)],2)}},"9bdd":function(t,e,i){var n=i("825a"),o=i("2a62");t.exports=function(t,e,i,s){try{return s?e(n(i)[0],i[1]):e(i)}catch(r){o(t,"throw",r)}}},f7aa:function(t,e,i){}}]); //# sourceMappingURL=chunk-76528b00.3b181c68.js.map