Socket
Socket
Sign inDemoInstall

@pixi/math

Package Overview
Dependencies
Maintainers
2
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/math - npm Package Compare versions

Comparing version 6.2.0 to 6.2.1

6

dist/browser/math.min.js
/*!
* @pixi/math - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
* @pixi/math - v6.2.1
* Compiled Tue, 21 Dec 2021 19:56:15 UTC
*

@@ -8,3 +8,3 @@ * @pixi/math is licensed under the MIT License.

*/
this.PIXI=this.PIXI||{};var _pixi_math=function(t){"use strict";var i,h=2*Math.PI,s=180/Math.PI,o=Math.PI/180;(i=t.SHAPES||(t.SHAPES={}))[i.POLY=0]="POLY",i[i.RECT=1]="RECT",i[i.CIRC=2]="CIRC",i[i.ELIP=3]="ELIP",i[i.RREC=4]="RREC";var n=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=Number(i),this.y=Number(h),this.width=Number(s),this.height=Number(o),this.type=t.SHAPES.RECT}return Object.defineProperty(i.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(i,"EMPTY",{get:function(){return new i(0,0,0,0)},enumerable:!1,configurable:!0}),i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},i.prototype.contains=function(t,i){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height)},i.prototype.pad=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x-=t,this.y-=i,this.width+=2*t,this.height+=2*i,this},i.prototype.fit=function(t){var i=Math.max(this.x,t.x),h=Math.min(this.x+this.width,t.x+t.width),s=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=i,this.width=Math.max(h-i,0),this.y=s,this.height=Math.max(o-s,0),this},i.prototype.ceil=function(t,i){void 0===t&&(t=1),void 0===i&&(i=.001);var h=Math.ceil((this.x+this.width-i)*t)/t,s=Math.ceil((this.y+this.height-i)*t)/t;return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=h-this.x,this.height=s-this.y,this},i.prototype.enlarge=function(t){var i=Math.min(this.x,t.x),h=Math.max(this.x+this.width,t.x+t.width),s=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=i,this.width=h-i,this.y=s,this.height=o-s,this},i}(),r=function(){function i(i,h,s){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),this.x=i,this.y=h,this.radius=s,this.type=t.SHAPES.CIRC}return i.prototype.clone=function(){return new i(this.x,this.y,this.radius)},i.prototype.contains=function(t,i){if(this.radius<=0)return!1;var h=this.radius*this.radius,s=this.x-t,o=this.y-i;return(s*=s)+(o*=o)<=h},i.prototype.getBounds=function(){return new n(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},i}(),e=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=i,this.y=h,this.width=s,this.height=o,this.type=t.SHAPES.ELIP}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;var h=(t-this.x)/this.width,s=(i-this.y)/this.height;return(h*=h)+(s*=s)<=1},i.prototype.getBounds=function(){return new n(this.x-this.width,this.y-this.height,this.width,this.height)},i}(),a=function(){function i(){for(var i=arguments,h=[],s=0;s<arguments.length;s++)h[s]=i[s];var o=Array.isArray(h[0])?h[0]:h;if("number"!=typeof o[0]){for(var n=[],r=0,e=o.length;r<e;r++)n.push(o[r].x,o[r].y);o=n}this.points=o,this.type=t.SHAPES.POLY,this.closeStroke=!0}return i.prototype.clone=function(){var t=new i(this.points.slice());return t.closeStroke=this.closeStroke,t},i.prototype.contains=function(t,i){for(var h=!1,s=this.points.length/2,o=0,n=s-1;o<s;n=o++){var r=this.points[2*o],e=this.points[2*o+1],a=this.points[2*n],c=this.points[2*n+1];e>i!=c>i&&t<(i-e)/(c-e)*(a-r)+r&&(h=!h)}return h},i}(),c=function(){function i(i,h,s,o,n){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===n&&(n=20),this.x=i,this.y=h,this.width=s,this.height=o,this.radius=n,this.type=t.SHAPES.RREC}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.radius)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){if(i>=this.y+this.radius&&i<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var h=t-(this.x+this.radius),s=i-(this.y+this.radius),o=this.radius*this.radius;if(h*h+s*s<=o)return!0;if((h=t-(this.x+this.width-this.radius))*h+s*s<=o)return!0;if(h*h+(s=i-(this.y+this.height-this.radius))*s<=o)return!0;if((h=t-(this.x+this.radius))*h+s*s<=o)return!0}return!1},i}(),u=function(){function t(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.x=0,this.y=0,this.x=t,this.y=i}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x=t,this.y=i,this},t}(),y=function(){function t(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0),this._x=h,this._y=s,this.cb=t,this.scope=i}return t.prototype.clone=function(i,h){return void 0===i&&(i=this.cb),void 0===h&&(h=this.scope),new t(i,h,this._x,this._y)},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this._x===t&&this._y===i||(this._x=t,this._y=i,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),p=function(){function t(t,i,h,s,o,n){void 0===t&&(t=1),void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=1),void 0===o&&(o=0),void 0===n&&(n=0),this.array=null,this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,i,h,s,o,n){return this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n,this},t.prototype.toArray=function(t,i){this.array||(this.array=new Float32Array(9));var h=i||this.array;return t?(h[0]=this.a,h[1]=this.b,h[2]=0,h[3]=this.c,h[4]=this.d,h[5]=0,h[6]=this.tx,h[7]=this.ty,h[8]=1):(h[0]=this.a,h[1]=this.c,h[2]=this.tx,h[3]=this.b,h[4]=this.d,h[5]=this.ty,h[6]=0,h[7]=0,h[8]=1),h},t.prototype.apply=function(t,i){i=i||new u;var h=t.x,s=t.y;return i.x=this.a*h+this.c*s+this.tx,i.y=this.b*h+this.d*s+this.ty,i},t.prototype.applyInverse=function(t,i){i=i||new u;var h=1/(this.a*this.d+this.c*-this.b),s=t.x,o=t.y;return i.x=this.d*h*s+-this.c*h*o+(this.ty*this.c-this.tx*this.d)*h,i.y=this.a*h*o+-this.b*h*s+(-this.ty*this.a+this.tx*this.b)*h,i},t.prototype.translate=function(t,i){return this.tx+=t,this.ty+=i,this},t.prototype.scale=function(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this},t.prototype.rotate=function(t){var i=Math.cos(t),h=Math.sin(t),s=this.a,o=this.c,n=this.tx;return this.a=s*i-this.b*h,this.b=s*h+this.b*i,this.c=o*i-this.d*h,this.d=o*h+this.d*i,this.tx=n*i-this.ty*h,this.ty=n*h+this.ty*i,this},t.prototype.append=function(t){var i=this.a,h=this.b,s=this.c,o=this.d;return this.a=t.a*i+t.b*s,this.b=t.a*h+t.b*o,this.c=t.c*i+t.d*s,this.d=t.c*h+t.d*o,this.tx=t.tx*i+t.ty*s+this.tx,this.ty=t.tx*h+t.ty*o+this.ty,this},t.prototype.setTransform=function(t,i,h,s,o,n,r,e,a){return this.a=Math.cos(r+a)*o,this.b=Math.sin(r+a)*o,this.c=-Math.sin(r-e)*n,this.d=Math.cos(r-e)*n,this.tx=t-(h*this.a+s*this.c),this.ty=i-(h*this.b+s*this.d),this},t.prototype.prepend=function(t){var i=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var h=this.a,s=this.c;this.a=h*t.a+this.b*t.c,this.b=h*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var i=this.a,s=this.b,o=this.c,n=this.d,r=t.pivot,e=-Math.atan2(-o,n),a=Math.atan2(s,i),c=Math.abs(e+a);return c<1e-5||Math.abs(h-c)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=e,t.skew.y=a),t.scale.x=Math.sqrt(i*i+s*s),t.scale.y=Math.sqrt(o*o+n*n),t.position.x=this.tx+(r.x*i+r.y*o),t.position.y=this.ty+(r.x*s+r.y*n),t},t.prototype.invert=function(){var t=this.a,i=this.b,h=this.c,s=this.d,o=this.tx,n=t*s-i*h;return this.a=s/n,this.b=-i/n,this.c=-h/n,this.d=t/n,this.tx=(h*this.ty-s*o)/n,this.ty=-(t*this.ty-i*o)/n,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var i=new t;return i.a=this.a,i.b=this.b,i.c=this.c,i.d=this.d,i.tx=this.tx,i.ty=this.ty,i},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),d=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],f=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],x=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],l=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],b=[],v=[],_=Math.sign;!function(){for(var t=0;t<16;t++){var i=[];b.push(i);for(var h=0;h<16;h++)for(var s=_(d[t]*d[h]+x[t]*f[h]),o=_(f[t]*d[h]+l[t]*f[h]),n=_(d[t]*x[h]+x[t]*l[h]),r=_(f[t]*x[h]+l[t]*l[h]),e=0;e<16;e++)if(d[e]===s&&f[e]===o&&x[e]===n&&l[e]===r){i.push(e);break}}for(t=0;t<16;t++){var a=new p;a.set(d[t],f[t],x[t],l[t],0,0),v.push(a)}}();var w={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return d[t]},uY:function(t){return f[t]},vX:function(t){return x[t]},vY:function(t){return l[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,i){return b[t][i]},sub:function(t,i){return b[t][w.inv(i)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,i){return 2*Math.abs(t)<=Math.abs(i)?i>=0?w.S:w.N:2*Math.abs(i)<=Math.abs(t)?t>0?w.E:w.W:i>0?t>0?w.SE:w.SW:t>0?w.NE:w.NW},matrixAppendRotationInv:function(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0);var o=v[w.inv(i)];o.tx=h,o.ty=s,t.append(o)}},g=function(){function t(){this.worldTransform=new p,this.localTransform=new p,this.position=new y(this.onChange,this,0,0),this.scale=new y(this.onChange,this,1,1),this.pivot=new y(this.onChange,this,0,0),this.skew=new y(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var i=this.localTransform;if(this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var h=t.worldTransform,s=this.worldTransform;s.a=i.a*h.a+i.b*h.c,s.b=i.a*h.b+i.b*h.d,s.c=i.c*h.a+i.d*h.c,s.d=i.c*h.b+i.d*h.d,s.tx=i.tx*h.a+i.ty*h.c+h.tx,s.ty=i.tx*h.b+i.ty*h.d+h.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();return t.Circle=r,t.DEG_TO_RAD=o,t.Ellipse=e,t.Matrix=p,t.ObservablePoint=y,t.PI_2=h,t.Point=u,t.Polygon=a,t.RAD_TO_DEG=s,t.Rectangle=n,t.RoundedRectangle=c,t.Transform=g,t.groupD8=w,t}({});Object.assign(this.PIXI,_pixi_math);
this.PIXI=this.PIXI||{};var _pixi_math=function(t){"use strict";var i,h=2*Math.PI,s=180/Math.PI,o=Math.PI/180;(i=t.SHAPES||(t.SHAPES={}))[i.POLY=0]="POLY",i[i.RECT=1]="RECT",i[i.CIRC=2]="CIRC",i[i.ELIP=3]="ELIP",i[i.RREC=4]="RREC";var n=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=Number(i),this.y=Number(h),this.width=Number(s),this.height=Number(o),this.type=t.SHAPES.RECT}return Object.defineProperty(i.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(i,"EMPTY",{get:function(){return new i(0,0,0,0)},enumerable:!1,configurable:!0}),i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},i.prototype.contains=function(t,i){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height)},i.prototype.pad=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x-=t,this.y-=i,this.width+=2*t,this.height+=2*i,this},i.prototype.fit=function(t){var i=Math.max(this.x,t.x),h=Math.min(this.x+this.width,t.x+t.width),s=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=i,this.width=Math.max(h-i,0),this.y=s,this.height=Math.max(o-s,0),this},i.prototype.ceil=function(t,i){void 0===t&&(t=1),void 0===i&&(i=.001);var h=Math.ceil((this.x+this.width-i)*t)/t,s=Math.ceil((this.y+this.height-i)*t)/t;return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=h-this.x,this.height=s-this.y,this},i.prototype.enlarge=function(t){var i=Math.min(this.x,t.x),h=Math.max(this.x+this.width,t.x+t.width),s=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=i,this.width=h-i,this.y=s,this.height=o-s,this},i}(),r=function(){function i(i,h,s){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),this.x=i,this.y=h,this.radius=s,this.type=t.SHAPES.CIRC}return i.prototype.clone=function(){return new i(this.x,this.y,this.radius)},i.prototype.contains=function(t,i){if(this.radius<=0)return!1;var h=this.radius*this.radius,s=this.x-t,o=this.y-i;return(s*=s)+(o*=o)<=h},i.prototype.getBounds=function(){return new n(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},i}(),e=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=i,this.y=h,this.width=s,this.height=o,this.type=t.SHAPES.ELIP}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;var h=(t-this.x)/this.width,s=(i-this.y)/this.height;return(h*=h)+(s*=s)<=1},i.prototype.getBounds=function(){return new n(this.x-this.width,this.y-this.height,this.width,this.height)},i}(),a=function(){function i(){for(var i=arguments,h=[],s=0;s<arguments.length;s++)h[s]=i[s];var o=Array.isArray(h[0])?h[0]:h;if("number"!=typeof o[0]){for(var n=[],r=0,e=o.length;r<e;r++)n.push(o[r].x,o[r].y);o=n}this.points=o,this.type=t.SHAPES.POLY,this.closeStroke=!0}return i.prototype.clone=function(){var t=new i(this.points.slice());return t.closeStroke=this.closeStroke,t},i.prototype.contains=function(t,i){for(var h=!1,s=this.points.length/2,o=0,n=s-1;o<s;n=o++){var r=this.points[2*o],e=this.points[2*o+1],a=this.points[2*n],c=this.points[2*n+1];e>i!=c>i&&t<(i-e)/(c-e)*(a-r)+r&&(h=!h)}return h},i}(),c=function(){function i(i,h,s,o,n){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===n&&(n=20),this.x=i,this.y=h,this.width=s,this.height=o,this.radius=n,this.type=t.SHAPES.RREC}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.radius)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){var h=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(i>=this.y+h&&i<=this.y+this.height-h||t>=this.x+h&&t<=this.x+this.width-h)return!0;var s=t-(this.x+h),o=i-(this.y+h),n=h*h;if(s*s+o*o<=n)return!0;if((s=t-(this.x+this.width-h))*s+o*o<=n)return!0;if(s*s+(o=i-(this.y+this.height-h))*o<=n)return!0;if((s=t-(this.x+h))*s+o*o<=n)return!0}return!1},i}(),u=function(){function t(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.x=0,this.y=0,this.x=t,this.y=i}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x=t,this.y=i,this},t}(),y=function(){function t(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0),this._x=h,this._y=s,this.cb=t,this.scope=i}return t.prototype.clone=function(i,h){return void 0===i&&(i=this.cb),void 0===h&&(h=this.scope),new t(i,h,this._x,this._y)},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this._x===t&&this._y===i||(this._x=t,this._y=i,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),p=function(){function t(t,i,h,s,o,n){void 0===t&&(t=1),void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=1),void 0===o&&(o=0),void 0===n&&(n=0),this.array=null,this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,i,h,s,o,n){return this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n,this},t.prototype.toArray=function(t,i){this.array||(this.array=new Float32Array(9));var h=i||this.array;return t?(h[0]=this.a,h[1]=this.b,h[2]=0,h[3]=this.c,h[4]=this.d,h[5]=0,h[6]=this.tx,h[7]=this.ty,h[8]=1):(h[0]=this.a,h[1]=this.c,h[2]=this.tx,h[3]=this.b,h[4]=this.d,h[5]=this.ty,h[6]=0,h[7]=0,h[8]=1),h},t.prototype.apply=function(t,i){i=i||new u;var h=t.x,s=t.y;return i.x=this.a*h+this.c*s+this.tx,i.y=this.b*h+this.d*s+this.ty,i},t.prototype.applyInverse=function(t,i){i=i||new u;var h=1/(this.a*this.d+this.c*-this.b),s=t.x,o=t.y;return i.x=this.d*h*s+-this.c*h*o+(this.ty*this.c-this.tx*this.d)*h,i.y=this.a*h*o+-this.b*h*s+(-this.ty*this.a+this.tx*this.b)*h,i},t.prototype.translate=function(t,i){return this.tx+=t,this.ty+=i,this},t.prototype.scale=function(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this},t.prototype.rotate=function(t){var i=Math.cos(t),h=Math.sin(t),s=this.a,o=this.c,n=this.tx;return this.a=s*i-this.b*h,this.b=s*h+this.b*i,this.c=o*i-this.d*h,this.d=o*h+this.d*i,this.tx=n*i-this.ty*h,this.ty=n*h+this.ty*i,this},t.prototype.append=function(t){var i=this.a,h=this.b,s=this.c,o=this.d;return this.a=t.a*i+t.b*s,this.b=t.a*h+t.b*o,this.c=t.c*i+t.d*s,this.d=t.c*h+t.d*o,this.tx=t.tx*i+t.ty*s+this.tx,this.ty=t.tx*h+t.ty*o+this.ty,this},t.prototype.setTransform=function(t,i,h,s,o,n,r,e,a){return this.a=Math.cos(r+a)*o,this.b=Math.sin(r+a)*o,this.c=-Math.sin(r-e)*n,this.d=Math.cos(r-e)*n,this.tx=t-(h*this.a+s*this.c),this.ty=i-(h*this.b+s*this.d),this},t.prototype.prepend=function(t){var i=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var h=this.a,s=this.c;this.a=h*t.a+this.b*t.c,this.b=h*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var i=this.a,s=this.b,o=this.c,n=this.d,r=t.pivot,e=-Math.atan2(-o,n),a=Math.atan2(s,i),c=Math.abs(e+a);return c<1e-5||Math.abs(h-c)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=e,t.skew.y=a),t.scale.x=Math.sqrt(i*i+s*s),t.scale.y=Math.sqrt(o*o+n*n),t.position.x=this.tx+(r.x*i+r.y*o),t.position.y=this.ty+(r.x*s+r.y*n),t},t.prototype.invert=function(){var t=this.a,i=this.b,h=this.c,s=this.d,o=this.tx,n=t*s-i*h;return this.a=s/n,this.b=-i/n,this.c=-h/n,this.d=t/n,this.tx=(h*this.ty-s*o)/n,this.ty=-(t*this.ty-i*o)/n,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var i=new t;return i.a=this.a,i.b=this.b,i.c=this.c,i.d=this.d,i.tx=this.tx,i.ty=this.ty,i},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),d=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],f=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],x=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],l=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],b=[],v=[],_=Math.sign;!function(){for(var t=0;t<16;t++){var i=[];b.push(i);for(var h=0;h<16;h++)for(var s=_(d[t]*d[h]+x[t]*f[h]),o=_(f[t]*d[h]+l[t]*f[h]),n=_(d[t]*x[h]+x[t]*l[h]),r=_(f[t]*x[h]+l[t]*l[h]),e=0;e<16;e++)if(d[e]===s&&f[e]===o&&x[e]===n&&l[e]===r){i.push(e);break}}for(t=0;t<16;t++){var a=new p;a.set(d[t],f[t],x[t],l[t],0,0),v.push(a)}}();var w={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return d[t]},uY:function(t){return f[t]},vX:function(t){return x[t]},vY:function(t){return l[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,i){return b[t][i]},sub:function(t,i){return b[t][w.inv(i)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,i){return 2*Math.abs(t)<=Math.abs(i)?i>=0?w.S:w.N:2*Math.abs(i)<=Math.abs(t)?t>0?w.E:w.W:i>0?t>0?w.SE:w.SW:t>0?w.NE:w.NW},matrixAppendRotationInv:function(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0);var o=v[w.inv(i)];o.tx=h,o.ty=s,t.append(o)}},g=function(){function t(){this.worldTransform=new p,this.localTransform=new p,this.position=new y(this.onChange,this,0,0),this.scale=new y(this.onChange,this,1,1),this.pivot=new y(this.onChange,this,0,0),this.skew=new y(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var i=this.localTransform;if(this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var h=t.worldTransform,s=this.worldTransform;s.a=i.a*h.a+i.b*h.c,s.b=i.a*h.b+i.b*h.d,s.c=i.c*h.a+i.d*h.c,s.d=i.c*h.b+i.d*h.d,s.tx=i.tx*h.a+i.ty*h.c+h.tx,s.ty=i.tx*h.b+i.ty*h.d+h.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();return t.Circle=r,t.DEG_TO_RAD=o,t.Ellipse=e,t.Matrix=p,t.ObservablePoint=y,t.PI_2=h,t.Point=u,t.Polygon=a,t.RAD_TO_DEG=s,t.Rectangle=n,t.RoundedRectangle=c,t.Transform=g,t.groupD8=w,t}({});Object.assign(this.PIXI,_pixi_math);
//# sourceMappingURL=math.min.js.map
/*!
* @pixi/math - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
* @pixi/math - v6.2.1
* Compiled Tue, 21 Dec 2021 19:56:15 UTC
*

@@ -49,4 +49,2 @@ * @pixi/math is licensed under the MIT License.

* @typedef {object} ISize
* @property {number} width - Width component
* @property {number} height - Height component
*/

@@ -57,3 +55,2 @@ /**

*
* @class
* @memberof PIXI

@@ -63,6 +60,6 @@ */

/**
* @param {number} [x=0] - The X coordinate of the upper-left corner of the rectangle
* @param {number} [y=0] - The Y coordinate of the upper-left corner of the rectangle
* @param {number} [width=0] - The overall width of this rectangle
* @param {number} [height=0] - The overall height of this rectangle
* @param x - The X coordinate of the upper-left corner of the rectangle
* @param y - The Y coordinate of the upper-left corner of the rectangle
* @param width - The overall width of the rectangle
* @param height - The overall height of the rectangle
*/

@@ -74,38 +71,10 @@ function Rectangle(x, y, width, height) {

if (height === void 0) { height = 0; }
/**
* @member {number}
* @default 0
*/
this.x = Number(x);
/**
* @member {number}
* @default 0
*/
this.y = Number(y);
/**
* @member {number}
* @default 0
*/
this.width = Number(width);
/**
* @member {number}
* @default 0
*/
this.height = Number(height);
/**
* The type of the object, mainly used to avoid `instanceof` checks
*
* @member {number}
* @readOnly
* @default PIXI.SHAPES.RECT
* @see PIXI.SHAPES
*/
this.type = exports.SHAPES.RECT;
}
Object.defineProperty(Rectangle.prototype, "left", {
/**
* returns the left edge of the rectangle
*
* @member {number}
*/
/** Returns the left edge of the rectangle. */
get: function () {

@@ -118,7 +87,3 @@ return this.x;

Object.defineProperty(Rectangle.prototype, "right", {
/**
* returns the right edge of the rectangle
*
* @member {number}
*/
/** Returns the right edge of the rectangle. */
get: function () {

@@ -131,7 +96,3 @@ return this.x + this.width;

Object.defineProperty(Rectangle.prototype, "top", {
/**
* returns the top edge of the rectangle
*
* @member {number}
*/
/** Returns the top edge of the rectangle. */
get: function () {

@@ -144,7 +105,3 @@ return this.y;

Object.defineProperty(Rectangle.prototype, "bottom", {
/**
* returns the bottom edge of the rectangle
*
* @member {number}
*/
/** Returns the bottom edge of the rectangle. */
get: function () {

@@ -157,10 +114,3 @@ return this.y + this.height;

Object.defineProperty(Rectangle, "EMPTY", {
/**
* A constant empty rectangle.
*
* @static
* @constant
* @member {PIXI.Rectangle}
* @return {PIXI.Rectangle} An empty rectangle
*/
/** A constant empty rectangle. */
get: function () {

@@ -175,3 +125,3 @@ return new Rectangle(0, 0, 0, 0);

*
* @return {PIXI.Rectangle} a copy of the rectangle
* @return a copy of the rectangle
*/

@@ -184,4 +134,4 @@ Rectangle.prototype.clone = function () {

*
* @param {PIXI.Rectangle} rectangle - The rectangle to copy from.
* @return {PIXI.Rectangle} Returns itself.
* @param rectangle - The rectangle to copy from.
* @return Returns itself.
*/

@@ -198,4 +148,4 @@ Rectangle.prototype.copyFrom = function (rectangle) {

*
* @param {PIXI.Rectangle} rectangle - The rectangle to copy to.
* @return {PIXI.Rectangle} Returns given parameter.
* @param rectangle - The rectangle to copy to.
* @return Returns given parameter.
*/

@@ -212,5 +162,5 @@ Rectangle.prototype.copyTo = function (rectangle) {

*
* @param {number} x - The X coordinate of the point to test
* @param {number} y - The Y coordinate of the point to test
* @return {boolean} Whether the x/y coordinates are within this Rectangle
* @param x - The X coordinate of the point to test
* @param y - The Y coordinate of the point to test
* @return Whether the x/y coordinates are within this Rectangle
*/

@@ -232,5 +182,5 @@ Rectangle.prototype.contains = function (x, y) {

*
* @param {number} [paddingX=0] - The horizontal padding amount.
* @param {number} [paddingY=0] - The vertical padding amount.
* @return {PIXI.Rectangle} Returns itself.
* @param paddingX - The horizontal padding amount.
* @param paddingY - The vertical padding amount.
* @return Returns itself.
*/

@@ -249,4 +199,4 @@ Rectangle.prototype.pad = function (paddingX, paddingY) {

*
* @param {PIXI.Rectangle} rectangle - The rectangle to fit.
* @return {PIXI.Rectangle} Returns itself.
* @param rectangle - The rectangle to fit.
* @return Returns itself.
*/

@@ -267,5 +217,5 @@ Rectangle.prototype.fit = function (rectangle) {

*
* @param {number} [resolution=1] - resolution
* @param {number} [eps=0.001] - precision
* @return {PIXI.Rectangle} Returns itself.
* @param resolution - resolution
* @param eps - precision
* @return Returns itself.
*/

@@ -286,4 +236,4 @@ Rectangle.prototype.ceil = function (resolution, eps) {

*
* @param {PIXI.Rectangle} rectangle - The rectangle to include.
* @return {PIXI.Rectangle} Returns itself.
* @param rectangle - The rectangle to include.
* @return Returns itself.
*/

@@ -433,3 +383,2 @@ Rectangle.prototype.enlarge = function (rectangle) {

*
* @class
* @memberof PIXI

@@ -461,28 +410,10 @@ */

}
/**
* An array of the points of this polygon
*
* @member {number[]}
*/
this.points = flat;
/**
* The type of the object, mainly used to avoid `instanceof` checks
*
* @member {number}
* @readOnly
* @default PIXI.SHAPES.POLY
* @see PIXI.SHAPES
*/
this.type = exports.SHAPES.POLY;
/**
* `false` after moveTo, `true` after `closePath`. In all other cases it is `true`.
* @member {boolean}
* @default true
*/
this.closeStroke = true;
}
/**
* Creates a clone of this polygon
* Creates a clone of this polygon.
*
* @return {PIXI.Polygon} a copy of the polygon
* @return - A copy of the polygon.
*/

@@ -496,7 +427,7 @@ Polygon.prototype.clone = function () {

/**
* Checks whether the x and y coordinates passed to this function are contained within this polygon
* Checks whether the x and y coordinates passed to this function are contained within this polygon.
*
* @param {number} x - The X coordinate of the point to test
* @param {number} y - The Y coordinate of the point to test
* @return {boolean} Whether the x/y coordinates are within this polygon
* @param x - The X coordinate of the point to test.
* @param y - The Y coordinate of the point to test.
* @return - Whether the x/y coordinates are within this polygon.
*/

@@ -605,21 +536,22 @@ Polygon.prototype.contains = function (x, y) {

if (y >= this.y && y <= this.y + this.height) {
if ((y >= this.y + this.radius && y <= this.y + this.height - this.radius)
|| (x >= this.x + this.radius && x <= this.x + this.width - this.radius)) {
var radius = Math.max(0, Math.min(this.radius, Math.min(this.width, this.height) / 2));
if ((y >= this.y + radius && y <= this.y + this.height - radius)
|| (x >= this.x + radius && x <= this.x + this.width - radius)) {
return true;
}
var dx = x - (this.x + this.radius);
var dy = y - (this.y + this.radius);
var radius2 = this.radius * this.radius;
var dx = x - (this.x + radius);
var dy = y - (this.y + radius);
var radius2 = radius * radius;
if ((dx * dx) + (dy * dy) <= radius2) {
return true;
}
dx = x - (this.x + this.width - this.radius);
dx = x - (this.x + this.width - radius);
if ((dx * dx) + (dy * dy) <= radius2) {
return true;
}
dy = y - (this.y + this.height - this.radius);
dy = y - (this.y + this.height - radius);
if ((dx * dx) + (dy * dy) <= radius2) {
return true;
}
dx = x - (this.x + this.radius);
dx = x - (this.x + radius);
if ((dx * dx) + (dy * dy) <= radius2) {

@@ -626,0 +558,0 @@ return true;

/*!
* @pixi/math - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
* @pixi/math - v6.2.1
* Compiled Tue, 21 Dec 2021 19:56:15 UTC
*

@@ -8,3 +8,3 @@ * @pixi/math is licensed under the MIT License.

*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PI_2=2*Math.PI,RAD_TO_DEG=180/Math.PI,DEG_TO_RAD=Math.PI/180;!function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"}(exports.SHAPES||(exports.SHAPES={}));var Rectangle=function(){function t(t,i,s,h){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=0),this.x=Number(t),this.y=Number(i),this.width=Number(s),this.height=Number(h),this.type=exports.SHAPES.RECT}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t,"EMPTY",{get:function(){return new t(0,0,0,0)},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},t.prototype.contains=function(t,i){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height)},t.prototype.pad=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x-=t,this.y-=i,this.width+=2*t,this.height+=2*i,this},t.prototype.fit=function(t){var i=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),h=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=i,this.width=Math.max(s-i,0),this.y=h,this.height=Math.max(o-h,0),this},t.prototype.ceil=function(t,i){void 0===t&&(t=1),void 0===i&&(i=.001);var s=Math.ceil((this.x+this.width-i)*t)/t,h=Math.ceil((this.y+this.height-i)*t)/t;return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=s-this.x,this.height=h-this.y,this},t.prototype.enlarge=function(t){var i=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),h=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=i,this.width=s-i,this.y=h,this.height=o-h,this},t}(),Circle=function(){function t(t,i,s){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=i,this.radius=s,this.type=exports.SHAPES.CIRC}return t.prototype.clone=function(){return new t(this.x,this.y,this.radius)},t.prototype.contains=function(t,i){if(this.radius<=0)return!1;var s=this.radius*this.radius,h=this.x-t,o=this.y-i;return(h*=h)+(o*=o)<=s},t.prototype.getBounds=function(){return new Rectangle(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},t}(),Ellipse=function(){function t(t,i,s,h){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=0),this.x=t,this.y=i,this.width=s,this.height=h,this.type=exports.SHAPES.ELIP}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;var s=(t-this.x)/this.width,h=(i-this.y)/this.height;return(s*=s)+(h*=h)<=1},t.prototype.getBounds=function(){return new Rectangle(this.x-this.width,this.y-this.height,this.width,this.height)},t}(),Polygon=function(){function t(){for(var t=arguments,i=[],s=0;s<arguments.length;s++)i[s]=t[s];var h=Array.isArray(i[0])?i[0]:i;if("number"!=typeof h[0]){for(var o=[],r=0,e=h.length;r<e;r++)o.push(h[r].x,h[r].y);h=o}this.points=h,this.type=exports.SHAPES.POLY,this.closeStroke=!0}return t.prototype.clone=function(){var i=new t(this.points.slice());return i.closeStroke=this.closeStroke,i},t.prototype.contains=function(t,i){for(var s=!1,h=this.points.length/2,o=0,r=h-1;o<h;r=o++){var e=this.points[2*o],n=this.points[2*o+1],a=this.points[2*r],u=this.points[2*r+1];n>i!=u>i&&t<(i-n)/(u-n)*(a-e)+e&&(s=!s)}return s},t}(),RoundedRectangle=function(){function t(t,i,s,h,o){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=0),void 0===o&&(o=20),this.x=t,this.y=i,this.width=s,this.height=h,this.radius=o,this.type=exports.SHAPES.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){if(i>=this.y+this.radius&&i<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var s=t-(this.x+this.radius),h=i-(this.y+this.radius),o=this.radius*this.radius;if(s*s+h*h<=o)return!0;if((s=t-(this.x+this.width-this.radius))*s+h*h<=o)return!0;if(s*s+(h=i-(this.y+this.height-this.radius))*h<=o)return!0;if((s=t-(this.x+this.radius))*s+h*h<=o)return!0}return!1},t}(),Point=function(){function t(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.x=0,this.y=0,this.x=t,this.y=i}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x=t,this.y=i,this},t}(),ObservablePoint=function(){function t(t,i,s,h){void 0===s&&(s=0),void 0===h&&(h=0),this._x=s,this._y=h,this.cb=t,this.scope=i}return t.prototype.clone=function(i,s){return void 0===i&&(i=this.cb),void 0===s&&(s=this.scope),new t(i,s,this._x,this._y)},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this._x===t&&this._y===i||(this._x=t,this._y=i,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),Matrix=function(){function t(t,i,s,h,o,r){void 0===t&&(t=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=1),void 0===o&&(o=0),void 0===r&&(r=0),this.array=null,this.a=t,this.b=i,this.c=s,this.d=h,this.tx=o,this.ty=r}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,i,s,h,o,r){return this.a=t,this.b=i,this.c=s,this.d=h,this.tx=o,this.ty=r,this},t.prototype.toArray=function(t,i){this.array||(this.array=new Float32Array(9));var s=i||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s},t.prototype.apply=function(t,i){i=i||new Point;var s=t.x,h=t.y;return i.x=this.a*s+this.c*h+this.tx,i.y=this.b*s+this.d*h+this.ty,i},t.prototype.applyInverse=function(t,i){i=i||new Point;var s=1/(this.a*this.d+this.c*-this.b),h=t.x,o=t.y;return i.x=this.d*s*h+-this.c*s*o+(this.ty*this.c-this.tx*this.d)*s,i.y=this.a*s*o+-this.b*s*h+(-this.ty*this.a+this.tx*this.b)*s,i},t.prototype.translate=function(t,i){return this.tx+=t,this.ty+=i,this},t.prototype.scale=function(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this},t.prototype.rotate=function(t){var i=Math.cos(t),s=Math.sin(t),h=this.a,o=this.c,r=this.tx;return this.a=h*i-this.b*s,this.b=h*s+this.b*i,this.c=o*i-this.d*s,this.d=o*s+this.d*i,this.tx=r*i-this.ty*s,this.ty=r*s+this.ty*i,this},t.prototype.append=function(t){var i=this.a,s=this.b,h=this.c,o=this.d;return this.a=t.a*i+t.b*h,this.b=t.a*s+t.b*o,this.c=t.c*i+t.d*h,this.d=t.c*s+t.d*o,this.tx=t.tx*i+t.ty*h+this.tx,this.ty=t.tx*s+t.ty*o+this.ty,this},t.prototype.setTransform=function(t,i,s,h,o,r,e,n,a){return this.a=Math.cos(e+a)*o,this.b=Math.sin(e+a)*o,this.c=-Math.sin(e-n)*r,this.d=Math.cos(e-n)*r,this.tx=t-(s*this.a+h*this.c),this.ty=i-(s*this.b+h*this.d),this},t.prototype.prepend=function(t){var i=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var s=this.a,h=this.c;this.a=s*t.a+this.b*t.c,this.b=s*t.b+this.b*t.d,this.c=h*t.a+this.d*t.c,this.d=h*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var i=this.a,s=this.b,h=this.c,o=this.d,r=t.pivot,e=-Math.atan2(-h,o),n=Math.atan2(s,i),a=Math.abs(e+n);return a<1e-5||Math.abs(PI_2-a)<1e-5?(t.rotation=n,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=e,t.skew.y=n),t.scale.x=Math.sqrt(i*i+s*s),t.scale.y=Math.sqrt(h*h+o*o),t.position.x=this.tx+(r.x*i+r.y*h),t.position.y=this.ty+(r.x*s+r.y*o),t},t.prototype.invert=function(){var t=this.a,i=this.b,s=this.c,h=this.d,o=this.tx,r=t*h-i*s;return this.a=h/r,this.b=-i/r,this.c=-s/r,this.d=t/r,this.tx=(s*this.ty-h*o)/r,this.ty=-(t*this.ty-i*o)/r,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var i=new t;return i.a=this.a,i.b=this.b,i.c=this.c,i.d=this.d,i.tx=this.tx,i.ty=this.ty,i},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),ux=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],uy=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],vx=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],vy=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],rotationCayley=[],rotationMatrices=[],signum=Math.sign;function init(){for(var t=0;t<16;t++){var i=[];rotationCayley.push(i);for(var s=0;s<16;s++)for(var h=signum(ux[t]*ux[s]+vx[t]*uy[s]),o=signum(uy[t]*ux[s]+vy[t]*uy[s]),r=signum(ux[t]*vx[s]+vx[t]*vy[s]),e=signum(uy[t]*vx[s]+vy[t]*vy[s]),n=0;n<16;n++)if(ux[n]===h&&uy[n]===o&&vx[n]===r&&vy[n]===e){i.push(n);break}}for(t=0;t<16;t++){var a=new Matrix;a.set(ux[t],uy[t],vx[t],vy[t],0,0),rotationMatrices.push(a)}}init();var groupD8={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return ux[t]},uY:function(t){return uy[t]},vX:function(t){return vx[t]},vY:function(t){return vy[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,i){return rotationCayley[t][i]},sub:function(t,i){return rotationCayley[t][groupD8.inv(i)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,i){return 2*Math.abs(t)<=Math.abs(i)?i>=0?groupD8.S:groupD8.N:2*Math.abs(i)<=Math.abs(t)?t>0?groupD8.E:groupD8.W:i>0?t>0?groupD8.SE:groupD8.SW:t>0?groupD8.NE:groupD8.NW},matrixAppendRotationInv:function(t,i,s,h){void 0===s&&(s=0),void 0===h&&(h=0);var o=rotationMatrices[groupD8.inv(i)];o.tx=s,o.ty=h,t.append(o)}},Transform=function(){function t(){this.worldTransform=new Matrix,this.localTransform=new Matrix,this.position=new ObservablePoint(this.onChange,this,0,0),this.scale=new ObservablePoint(this.onChange,this,1,1),this.pivot=new ObservablePoint(this.onChange,this,0,0),this.skew=new ObservablePoint(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var i=this.localTransform;if(this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var s=t.worldTransform,h=this.worldTransform;h.a=i.a*s.a+i.b*s.c,h.b=i.a*s.b+i.b*s.d,h.c=i.c*s.a+i.d*s.c,h.d=i.c*s.b+i.d*s.d,h.tx=i.tx*s.a+i.ty*s.c+s.tx,h.ty=i.tx*s.b+i.ty*s.d+s.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();exports.Circle=Circle,exports.DEG_TO_RAD=DEG_TO_RAD,exports.Ellipse=Ellipse,exports.Matrix=Matrix,exports.ObservablePoint=ObservablePoint,exports.PI_2=PI_2,exports.Point=Point,exports.Polygon=Polygon,exports.RAD_TO_DEG=RAD_TO_DEG,exports.Rectangle=Rectangle,exports.RoundedRectangle=RoundedRectangle,exports.Transform=Transform,exports.groupD8=groupD8;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PI_2=2*Math.PI,RAD_TO_DEG=180/Math.PI,DEG_TO_RAD=Math.PI/180;!function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"}(exports.SHAPES||(exports.SHAPES={}));var Rectangle=function(){function t(t,i,s,h){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=0),this.x=Number(t),this.y=Number(i),this.width=Number(s),this.height=Number(h),this.type=exports.SHAPES.RECT}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t,"EMPTY",{get:function(){return new t(0,0,0,0)},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},t.prototype.contains=function(t,i){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height)},t.prototype.pad=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x-=t,this.y-=i,this.width+=2*t,this.height+=2*i,this},t.prototype.fit=function(t){var i=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),h=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=i,this.width=Math.max(s-i,0),this.y=h,this.height=Math.max(o-h,0),this},t.prototype.ceil=function(t,i){void 0===t&&(t=1),void 0===i&&(i=.001);var s=Math.ceil((this.x+this.width-i)*t)/t,h=Math.ceil((this.y+this.height-i)*t)/t;return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=s-this.x,this.height=h-this.y,this},t.prototype.enlarge=function(t){var i=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),h=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=i,this.width=s-i,this.y=h,this.height=o-h,this},t}(),Circle=function(){function t(t,i,s){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=i,this.radius=s,this.type=exports.SHAPES.CIRC}return t.prototype.clone=function(){return new t(this.x,this.y,this.radius)},t.prototype.contains=function(t,i){if(this.radius<=0)return!1;var s=this.radius*this.radius,h=this.x-t,o=this.y-i;return(h*=h)+(o*=o)<=s},t.prototype.getBounds=function(){return new Rectangle(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},t}(),Ellipse=function(){function t(t,i,s,h){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=0),this.x=t,this.y=i,this.width=s,this.height=h,this.type=exports.SHAPES.ELIP}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;var s=(t-this.x)/this.width,h=(i-this.y)/this.height;return(s*=s)+(h*=h)<=1},t.prototype.getBounds=function(){return new Rectangle(this.x-this.width,this.y-this.height,this.width,this.height)},t}(),Polygon=function(){function t(){for(var t=arguments,i=[],s=0;s<arguments.length;s++)i[s]=t[s];var h=Array.isArray(i[0])?i[0]:i;if("number"!=typeof h[0]){for(var o=[],r=0,e=h.length;r<e;r++)o.push(h[r].x,h[r].y);h=o}this.points=h,this.type=exports.SHAPES.POLY,this.closeStroke=!0}return t.prototype.clone=function(){var i=new t(this.points.slice());return i.closeStroke=this.closeStroke,i},t.prototype.contains=function(t,i){for(var s=!1,h=this.points.length/2,o=0,r=h-1;o<h;r=o++){var e=this.points[2*o],n=this.points[2*o+1],a=this.points[2*r],u=this.points[2*r+1];n>i!=u>i&&t<(i-n)/(u-n)*(a-e)+e&&(s=!s)}return s},t}(),RoundedRectangle=function(){function t(t,i,s,h,o){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=0),void 0===o&&(o=20),this.x=t,this.y=i,this.width=s,this.height=h,this.radius=o,this.type=exports.SHAPES.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){var s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(i>=this.y+s&&i<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;var h=t-(this.x+s),o=i-(this.y+s),r=s*s;if(h*h+o*o<=r)return!0;if((h=t-(this.x+this.width-s))*h+o*o<=r)return!0;if(h*h+(o=i-(this.y+this.height-s))*o<=r)return!0;if((h=t-(this.x+s))*h+o*o<=r)return!0}return!1},t}(),Point=function(){function t(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.x=0,this.y=0,this.x=t,this.y=i}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x=t,this.y=i,this},t}(),ObservablePoint=function(){function t(t,i,s,h){void 0===s&&(s=0),void 0===h&&(h=0),this._x=s,this._y=h,this.cb=t,this.scope=i}return t.prototype.clone=function(i,s){return void 0===i&&(i=this.cb),void 0===s&&(s=this.scope),new t(i,s,this._x,this._y)},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this._x===t&&this._y===i||(this._x=t,this._y=i,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),Matrix=function(){function t(t,i,s,h,o,r){void 0===t&&(t=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=1),void 0===o&&(o=0),void 0===r&&(r=0),this.array=null,this.a=t,this.b=i,this.c=s,this.d=h,this.tx=o,this.ty=r}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,i,s,h,o,r){return this.a=t,this.b=i,this.c=s,this.d=h,this.tx=o,this.ty=r,this},t.prototype.toArray=function(t,i){this.array||(this.array=new Float32Array(9));var s=i||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s},t.prototype.apply=function(t,i){i=i||new Point;var s=t.x,h=t.y;return i.x=this.a*s+this.c*h+this.tx,i.y=this.b*s+this.d*h+this.ty,i},t.prototype.applyInverse=function(t,i){i=i||new Point;var s=1/(this.a*this.d+this.c*-this.b),h=t.x,o=t.y;return i.x=this.d*s*h+-this.c*s*o+(this.ty*this.c-this.tx*this.d)*s,i.y=this.a*s*o+-this.b*s*h+(-this.ty*this.a+this.tx*this.b)*s,i},t.prototype.translate=function(t,i){return this.tx+=t,this.ty+=i,this},t.prototype.scale=function(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this},t.prototype.rotate=function(t){var i=Math.cos(t),s=Math.sin(t),h=this.a,o=this.c,r=this.tx;return this.a=h*i-this.b*s,this.b=h*s+this.b*i,this.c=o*i-this.d*s,this.d=o*s+this.d*i,this.tx=r*i-this.ty*s,this.ty=r*s+this.ty*i,this},t.prototype.append=function(t){var i=this.a,s=this.b,h=this.c,o=this.d;return this.a=t.a*i+t.b*h,this.b=t.a*s+t.b*o,this.c=t.c*i+t.d*h,this.d=t.c*s+t.d*o,this.tx=t.tx*i+t.ty*h+this.tx,this.ty=t.tx*s+t.ty*o+this.ty,this},t.prototype.setTransform=function(t,i,s,h,o,r,e,n,a){return this.a=Math.cos(e+a)*o,this.b=Math.sin(e+a)*o,this.c=-Math.sin(e-n)*r,this.d=Math.cos(e-n)*r,this.tx=t-(s*this.a+h*this.c),this.ty=i-(s*this.b+h*this.d),this},t.prototype.prepend=function(t){var i=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var s=this.a,h=this.c;this.a=s*t.a+this.b*t.c,this.b=s*t.b+this.b*t.d,this.c=h*t.a+this.d*t.c,this.d=h*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var i=this.a,s=this.b,h=this.c,o=this.d,r=t.pivot,e=-Math.atan2(-h,o),n=Math.atan2(s,i),a=Math.abs(e+n);return a<1e-5||Math.abs(PI_2-a)<1e-5?(t.rotation=n,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=e,t.skew.y=n),t.scale.x=Math.sqrt(i*i+s*s),t.scale.y=Math.sqrt(h*h+o*o),t.position.x=this.tx+(r.x*i+r.y*h),t.position.y=this.ty+(r.x*s+r.y*o),t},t.prototype.invert=function(){var t=this.a,i=this.b,s=this.c,h=this.d,o=this.tx,r=t*h-i*s;return this.a=h/r,this.b=-i/r,this.c=-s/r,this.d=t/r,this.tx=(s*this.ty-h*o)/r,this.ty=-(t*this.ty-i*o)/r,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var i=new t;return i.a=this.a,i.b=this.b,i.c=this.c,i.d=this.d,i.tx=this.tx,i.ty=this.ty,i},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),ux=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],uy=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],vx=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],vy=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],rotationCayley=[],rotationMatrices=[],signum=Math.sign;function init(){for(var t=0;t<16;t++){var i=[];rotationCayley.push(i);for(var s=0;s<16;s++)for(var h=signum(ux[t]*ux[s]+vx[t]*uy[s]),o=signum(uy[t]*ux[s]+vy[t]*uy[s]),r=signum(ux[t]*vx[s]+vx[t]*vy[s]),e=signum(uy[t]*vx[s]+vy[t]*vy[s]),n=0;n<16;n++)if(ux[n]===h&&uy[n]===o&&vx[n]===r&&vy[n]===e){i.push(n);break}}for(t=0;t<16;t++){var a=new Matrix;a.set(ux[t],uy[t],vx[t],vy[t],0,0),rotationMatrices.push(a)}}init();var groupD8={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return ux[t]},uY:function(t){return uy[t]},vX:function(t){return vx[t]},vY:function(t){return vy[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,i){return rotationCayley[t][i]},sub:function(t,i){return rotationCayley[t][groupD8.inv(i)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,i){return 2*Math.abs(t)<=Math.abs(i)?i>=0?groupD8.S:groupD8.N:2*Math.abs(i)<=Math.abs(t)?t>0?groupD8.E:groupD8.W:i>0?t>0?groupD8.SE:groupD8.SW:t>0?groupD8.NE:groupD8.NW},matrixAppendRotationInv:function(t,i,s,h){void 0===s&&(s=0),void 0===h&&(h=0);var o=rotationMatrices[groupD8.inv(i)];o.tx=s,o.ty=h,t.append(o)}},Transform=function(){function t(){this.worldTransform=new Matrix,this.localTransform=new Matrix,this.position=new ObservablePoint(this.onChange,this,0,0),this.scale=new ObservablePoint(this.onChange,this,1,1),this.pivot=new ObservablePoint(this.onChange,this,0,0),this.skew=new ObservablePoint(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var i=this.localTransform;if(this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var s=t.worldTransform,h=this.worldTransform;h.a=i.a*s.a+i.b*s.c,h.b=i.a*s.b+i.b*s.d,h.c=i.c*s.a+i.d*s.c,h.d=i.c*s.b+i.d*s.d,h.tx=i.tx*s.a+i.ty*s.c+s.tx,h.ty=i.tx*s.b+i.ty*s.d+s.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();exports.Circle=Circle,exports.DEG_TO_RAD=DEG_TO_RAD,exports.Ellipse=Ellipse,exports.Matrix=Matrix,exports.ObservablePoint=ObservablePoint,exports.PI_2=PI_2,exports.Point=Point,exports.Polygon=Polygon,exports.RAD_TO_DEG=RAD_TO_DEG,exports.Rectangle=Rectangle,exports.RoundedRectangle=RoundedRectangle,exports.Transform=Transform,exports.groupD8=groupD8;
//# sourceMappingURL=math.min.js.map
/*!
* @pixi/math - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
* @pixi/math - v6.2.1
* Compiled Tue, 21 Dec 2021 19:56:15 UTC
*

@@ -58,4 +58,2 @@ * @pixi/math is licensed under the MIT License.

* @typedef {object} ISize
* @property {number} width - Width component
* @property {number} height - Height component
*/

@@ -66,3 +64,2 @@ /**

*
* @class
* @memberof PIXI

@@ -72,6 +69,6 @@ */

/**
* @param {number} [x=0] - The X coordinate of the upper-left corner of the rectangle
* @param {number} [y=0] - The Y coordinate of the upper-left corner of the rectangle
* @param {number} [width=0] - The overall width of this rectangle
* @param {number} [height=0] - The overall height of this rectangle
* @param x - The X coordinate of the upper-left corner of the rectangle
* @param y - The Y coordinate of the upper-left corner of the rectangle
* @param width - The overall width of the rectangle
* @param height - The overall height of the rectangle
*/

@@ -83,38 +80,10 @@ function Rectangle(x, y, width, height) {

if (height === void 0) { height = 0; }
/**
* @member {number}
* @default 0
*/
this.x = Number(x);
/**
* @member {number}
* @default 0
*/
this.y = Number(y);
/**
* @member {number}
* @default 0
*/
this.width = Number(width);
/**
* @member {number}
* @default 0
*/
this.height = Number(height);
/**
* The type of the object, mainly used to avoid `instanceof` checks
*
* @member {number}
* @readOnly
* @default PIXI.SHAPES.RECT
* @see PIXI.SHAPES
*/
this.type = SHAPES.RECT;
}
Object.defineProperty(Rectangle.prototype, "left", {
/**
* returns the left edge of the rectangle
*
* @member {number}
*/
/** Returns the left edge of the rectangle. */
get: function () {

@@ -127,7 +96,3 @@ return this.x;

Object.defineProperty(Rectangle.prototype, "right", {
/**
* returns the right edge of the rectangle
*
* @member {number}
*/
/** Returns the right edge of the rectangle. */
get: function () {

@@ -140,7 +105,3 @@ return this.x + this.width;

Object.defineProperty(Rectangle.prototype, "top", {
/**
* returns the top edge of the rectangle
*
* @member {number}
*/
/** Returns the top edge of the rectangle. */
get: function () {

@@ -153,7 +114,3 @@ return this.y;

Object.defineProperty(Rectangle.prototype, "bottom", {
/**
* returns the bottom edge of the rectangle
*
* @member {number}
*/
/** Returns the bottom edge of the rectangle. */
get: function () {

@@ -166,10 +123,3 @@ return this.y + this.height;

Object.defineProperty(Rectangle, "EMPTY", {
/**
* A constant empty rectangle.
*
* @static
* @constant
* @member {PIXI.Rectangle}
* @return {PIXI.Rectangle} An empty rectangle
*/
/** A constant empty rectangle. */
get: function () {

@@ -184,3 +134,3 @@ return new Rectangle(0, 0, 0, 0);

*
* @return {PIXI.Rectangle} a copy of the rectangle
* @return a copy of the rectangle
*/

@@ -193,4 +143,4 @@ Rectangle.prototype.clone = function () {

*
* @param {PIXI.Rectangle} rectangle - The rectangle to copy from.
* @return {PIXI.Rectangle} Returns itself.
* @param rectangle - The rectangle to copy from.
* @return Returns itself.
*/

@@ -207,4 +157,4 @@ Rectangle.prototype.copyFrom = function (rectangle) {

*
* @param {PIXI.Rectangle} rectangle - The rectangle to copy to.
* @return {PIXI.Rectangle} Returns given parameter.
* @param rectangle - The rectangle to copy to.
* @return Returns given parameter.
*/

@@ -221,5 +171,5 @@ Rectangle.prototype.copyTo = function (rectangle) {

*
* @param {number} x - The X coordinate of the point to test
* @param {number} y - The Y coordinate of the point to test
* @return {boolean} Whether the x/y coordinates are within this Rectangle
* @param x - The X coordinate of the point to test
* @param y - The Y coordinate of the point to test
* @return Whether the x/y coordinates are within this Rectangle
*/

@@ -241,5 +191,5 @@ Rectangle.prototype.contains = function (x, y) {

*
* @param {number} [paddingX=0] - The horizontal padding amount.
* @param {number} [paddingY=0] - The vertical padding amount.
* @return {PIXI.Rectangle} Returns itself.
* @param paddingX - The horizontal padding amount.
* @param paddingY - The vertical padding amount.
* @return Returns itself.
*/

@@ -258,4 +208,4 @@ Rectangle.prototype.pad = function (paddingX, paddingY) {

*
* @param {PIXI.Rectangle} rectangle - The rectangle to fit.
* @return {PIXI.Rectangle} Returns itself.
* @param rectangle - The rectangle to fit.
* @return Returns itself.
*/

@@ -276,5 +226,5 @@ Rectangle.prototype.fit = function (rectangle) {

*
* @param {number} [resolution=1] - resolution
* @param {number} [eps=0.001] - precision
* @return {PIXI.Rectangle} Returns itself.
* @param resolution - resolution
* @param eps - precision
* @return Returns itself.
*/

@@ -295,4 +245,4 @@ Rectangle.prototype.ceil = function (resolution, eps) {

*
* @param {PIXI.Rectangle} rectangle - The rectangle to include.
* @return {PIXI.Rectangle} Returns itself.
* @param rectangle - The rectangle to include.
* @return Returns itself.
*/

@@ -442,3 +392,2 @@ Rectangle.prototype.enlarge = function (rectangle) {

*
* @class
* @memberof PIXI

@@ -470,28 +419,10 @@ */

}
/**
* An array of the points of this polygon
*
* @member {number[]}
*/
this.points = flat;
/**
* The type of the object, mainly used to avoid `instanceof` checks
*
* @member {number}
* @readOnly
* @default PIXI.SHAPES.POLY
* @see PIXI.SHAPES
*/
this.type = SHAPES.POLY;
/**
* `false` after moveTo, `true` after `closePath`. In all other cases it is `true`.
* @member {boolean}
* @default true
*/
this.closeStroke = true;
}
/**
* Creates a clone of this polygon
* Creates a clone of this polygon.
*
* @return {PIXI.Polygon} a copy of the polygon
* @return - A copy of the polygon.
*/

@@ -505,7 +436,7 @@ Polygon.prototype.clone = function () {

/**
* Checks whether the x and y coordinates passed to this function are contained within this polygon
* Checks whether the x and y coordinates passed to this function are contained within this polygon.
*
* @param {number} x - The X coordinate of the point to test
* @param {number} y - The Y coordinate of the point to test
* @return {boolean} Whether the x/y coordinates are within this polygon
* @param x - The X coordinate of the point to test.
* @param y - The Y coordinate of the point to test.
* @return - Whether the x/y coordinates are within this polygon.
*/

@@ -614,21 +545,22 @@ Polygon.prototype.contains = function (x, y) {

if (y >= this.y && y <= this.y + this.height) {
if ((y >= this.y + this.radius && y <= this.y + this.height - this.radius)
|| (x >= this.x + this.radius && x <= this.x + this.width - this.radius)) {
var radius = Math.max(0, Math.min(this.radius, Math.min(this.width, this.height) / 2));
if ((y >= this.y + radius && y <= this.y + this.height - radius)
|| (x >= this.x + radius && x <= this.x + this.width - radius)) {
return true;
}
var dx = x - (this.x + this.radius);
var dy = y - (this.y + this.radius);
var radius2 = this.radius * this.radius;
var dx = x - (this.x + radius);
var dy = y - (this.y + radius);
var radius2 = radius * radius;
if ((dx * dx) + (dy * dy) <= radius2) {
return true;
}
dx = x - (this.x + this.width - this.radius);
dx = x - (this.x + this.width - radius);
if ((dx * dx) + (dy * dy) <= radius2) {
return true;
}
dy = y - (this.y + this.height - this.radius);
dy = y - (this.y + this.height - radius);
if ((dx * dx) + (dy * dy) <= radius2) {
return true;
}
dx = x - (this.x + this.radius);
dx = x - (this.x + radius);
if ((dx * dx) + (dy * dy) <= radius2) {

@@ -635,0 +567,0 @@ return true;

/*!
* @pixi/math - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
* @pixi/math - v6.2.1
* Compiled Tue, 21 Dec 2021 19:56:15 UTC
*

@@ -8,3 +8,3 @@ * @pixi/math is licensed under the MIT License.

*/
var t,i=2*Math.PI,h=180/Math.PI,s=Math.PI/180;!function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"}(t||(t={}));var o=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=Number(i),this.y=Number(h),this.width=Number(s),this.height=Number(o),this.type=t.RECT}return Object.defineProperty(i.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(i,"EMPTY",{get:function(){return new i(0,0,0,0)},enumerable:!1,configurable:!0}),i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},i.prototype.contains=function(t,i){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height)},i.prototype.pad=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x-=t,this.y-=i,this.width+=2*t,this.height+=2*i,this},i.prototype.fit=function(t){var i=Math.max(this.x,t.x),h=Math.min(this.x+this.width,t.x+t.width),s=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=i,this.width=Math.max(h-i,0),this.y=s,this.height=Math.max(o-s,0),this},i.prototype.ceil=function(t,i){void 0===t&&(t=1),void 0===i&&(i=.001);var h=Math.ceil((this.x+this.width-i)*t)/t,s=Math.ceil((this.y+this.height-i)*t)/t;return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=h-this.x,this.height=s-this.y,this},i.prototype.enlarge=function(t){var i=Math.min(this.x,t.x),h=Math.max(this.x+this.width,t.x+t.width),s=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=i,this.width=h-i,this.y=s,this.height=o-s,this},i}(),n=function(){function i(i,h,s){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),this.x=i,this.y=h,this.radius=s,this.type=t.CIRC}return i.prototype.clone=function(){return new i(this.x,this.y,this.radius)},i.prototype.contains=function(t,i){if(this.radius<=0)return!1;var h=this.radius*this.radius,s=this.x-t,o=this.y-i;return(s*=s)+(o*=o)<=h},i.prototype.getBounds=function(){return new o(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},i}(),r=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=i,this.y=h,this.width=s,this.height=o,this.type=t.ELIP}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;var h=(t-this.x)/this.width,s=(i-this.y)/this.height;return(h*=h)+(s*=s)<=1},i.prototype.getBounds=function(){return new o(this.x-this.width,this.y-this.height,this.width,this.height)},i}(),e=function(){function i(){for(var i=arguments,h=[],s=0;s<arguments.length;s++)h[s]=i[s];var o=Array.isArray(h[0])?h[0]:h;if("number"!=typeof o[0]){for(var n=[],r=0,e=o.length;r<e;r++)n.push(o[r].x,o[r].y);o=n}this.points=o,this.type=t.POLY,this.closeStroke=!0}return i.prototype.clone=function(){var t=new i(this.points.slice());return t.closeStroke=this.closeStroke,t},i.prototype.contains=function(t,i){for(var h=!1,s=this.points.length/2,o=0,n=s-1;o<s;n=o++){var r=this.points[2*o],e=this.points[2*o+1],a=this.points[2*n],c=this.points[2*n+1];e>i!=c>i&&t<(i-e)/(c-e)*(a-r)+r&&(h=!h)}return h},i}(),a=function(){function i(i,h,s,o,n){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===n&&(n=20),this.x=i,this.y=h,this.width=s,this.height=o,this.radius=n,this.type=t.RREC}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.radius)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){if(i>=this.y+this.radius&&i<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var h=t-(this.x+this.radius),s=i-(this.y+this.radius),o=this.radius*this.radius;if(h*h+s*s<=o)return!0;if((h=t-(this.x+this.width-this.radius))*h+s*s<=o)return!0;if(h*h+(s=i-(this.y+this.height-this.radius))*s<=o)return!0;if((h=t-(this.x+this.radius))*h+s*s<=o)return!0}return!1},i}(),c=function(){function t(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.x=0,this.y=0,this.x=t,this.y=i}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x=t,this.y=i,this},t}(),u=function(){function t(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0),this._x=h,this._y=s,this.cb=t,this.scope=i}return t.prototype.clone=function(i,h){return void 0===i&&(i=this.cb),void 0===h&&(h=this.scope),new t(i,h,this._x,this._y)},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this._x===t&&this._y===i||(this._x=t,this._y=i,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),y=function(){function t(t,i,h,s,o,n){void 0===t&&(t=1),void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=1),void 0===o&&(o=0),void 0===n&&(n=0),this.array=null,this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,i,h,s,o,n){return this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n,this},t.prototype.toArray=function(t,i){this.array||(this.array=new Float32Array(9));var h=i||this.array;return t?(h[0]=this.a,h[1]=this.b,h[2]=0,h[3]=this.c,h[4]=this.d,h[5]=0,h[6]=this.tx,h[7]=this.ty,h[8]=1):(h[0]=this.a,h[1]=this.c,h[2]=this.tx,h[3]=this.b,h[4]=this.d,h[5]=this.ty,h[6]=0,h[7]=0,h[8]=1),h},t.prototype.apply=function(t,i){i=i||new c;var h=t.x,s=t.y;return i.x=this.a*h+this.c*s+this.tx,i.y=this.b*h+this.d*s+this.ty,i},t.prototype.applyInverse=function(t,i){i=i||new c;var h=1/(this.a*this.d+this.c*-this.b),s=t.x,o=t.y;return i.x=this.d*h*s+-this.c*h*o+(this.ty*this.c-this.tx*this.d)*h,i.y=this.a*h*o+-this.b*h*s+(-this.ty*this.a+this.tx*this.b)*h,i},t.prototype.translate=function(t,i){return this.tx+=t,this.ty+=i,this},t.prototype.scale=function(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this},t.prototype.rotate=function(t){var i=Math.cos(t),h=Math.sin(t),s=this.a,o=this.c,n=this.tx;return this.a=s*i-this.b*h,this.b=s*h+this.b*i,this.c=o*i-this.d*h,this.d=o*h+this.d*i,this.tx=n*i-this.ty*h,this.ty=n*h+this.ty*i,this},t.prototype.append=function(t){var i=this.a,h=this.b,s=this.c,o=this.d;return this.a=t.a*i+t.b*s,this.b=t.a*h+t.b*o,this.c=t.c*i+t.d*s,this.d=t.c*h+t.d*o,this.tx=t.tx*i+t.ty*s+this.tx,this.ty=t.tx*h+t.ty*o+this.ty,this},t.prototype.setTransform=function(t,i,h,s,o,n,r,e,a){return this.a=Math.cos(r+a)*o,this.b=Math.sin(r+a)*o,this.c=-Math.sin(r-e)*n,this.d=Math.cos(r-e)*n,this.tx=t-(h*this.a+s*this.c),this.ty=i-(h*this.b+s*this.d),this},t.prototype.prepend=function(t){var i=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var h=this.a,s=this.c;this.a=h*t.a+this.b*t.c,this.b=h*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var h=this.a,s=this.b,o=this.c,n=this.d,r=t.pivot,e=-Math.atan2(-o,n),a=Math.atan2(s,h),c=Math.abs(e+a);return c<1e-5||Math.abs(i-c)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=e,t.skew.y=a),t.scale.x=Math.sqrt(h*h+s*s),t.scale.y=Math.sqrt(o*o+n*n),t.position.x=this.tx+(r.x*h+r.y*o),t.position.y=this.ty+(r.x*s+r.y*n),t},t.prototype.invert=function(){var t=this.a,i=this.b,h=this.c,s=this.d,o=this.tx,n=t*s-i*h;return this.a=s/n,this.b=-i/n,this.c=-h/n,this.d=t/n,this.tx=(h*this.ty-s*o)/n,this.ty=-(t*this.ty-i*o)/n,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var i=new t;return i.a=this.a,i.b=this.b,i.c=this.c,i.d=this.d,i.tx=this.tx,i.ty=this.ty,i},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),p=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],d=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],f=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],x=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],l=[],b=[],v=Math.sign;!function(){for(var t=0;t<16;t++){var i=[];l.push(i);for(var h=0;h<16;h++)for(var s=v(p[t]*p[h]+f[t]*d[h]),o=v(d[t]*p[h]+x[t]*d[h]),n=v(p[t]*f[h]+f[t]*x[h]),r=v(d[t]*f[h]+x[t]*x[h]),e=0;e<16;e++)if(p[e]===s&&d[e]===o&&f[e]===n&&x[e]===r){i.push(e);break}}for(t=0;t<16;t++){var a=new y;a.set(p[t],d[t],f[t],x[t],0,0),b.push(a)}}();var w={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return p[t]},uY:function(t){return d[t]},vX:function(t){return f[t]},vY:function(t){return x[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,i){return l[t][i]},sub:function(t,i){return l[t][w.inv(i)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,i){return 2*Math.abs(t)<=Math.abs(i)?i>=0?w.S:w.N:2*Math.abs(i)<=Math.abs(t)?t>0?w.E:w.W:i>0?t>0?w.SE:w.SW:t>0?w.NE:w.NW},matrixAppendRotationInv:function(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0);var o=b[w.inv(i)];o.tx=h,o.ty=s,t.append(o)}},_=function(){function t(){this.worldTransform=new y,this.localTransform=new y,this.position=new u(this.onChange,this,0,0),this.scale=new u(this.onChange,this,1,1),this.pivot=new u(this.onChange,this,0,0),this.skew=new u(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var i=this.localTransform;if(this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var h=t.worldTransform,s=this.worldTransform;s.a=i.a*h.a+i.b*h.c,s.b=i.a*h.b+i.b*h.d,s.c=i.c*h.a+i.d*h.c,s.d=i.c*h.b+i.d*h.d,s.tx=i.tx*h.a+i.ty*h.c+h.tx,s.ty=i.tx*h.b+i.ty*h.d+h.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();export{n as Circle,s as DEG_TO_RAD,r as Ellipse,y as Matrix,u as ObservablePoint,i as PI_2,c as Point,e as Polygon,h as RAD_TO_DEG,o as Rectangle,a as RoundedRectangle,t as SHAPES,_ as Transform,w as groupD8};
var t,i=2*Math.PI,h=180/Math.PI,s=Math.PI/180;!function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"}(t||(t={}));var o=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=Number(i),this.y=Number(h),this.width=Number(s),this.height=Number(o),this.type=t.RECT}return Object.defineProperty(i.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(i,"EMPTY",{get:function(){return new i(0,0,0,0)},enumerable:!1,configurable:!0}),i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},i.prototype.contains=function(t,i){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height)},i.prototype.pad=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x-=t,this.y-=i,this.width+=2*t,this.height+=2*i,this},i.prototype.fit=function(t){var i=Math.max(this.x,t.x),h=Math.min(this.x+this.width,t.x+t.width),s=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=i,this.width=Math.max(h-i,0),this.y=s,this.height=Math.max(o-s,0),this},i.prototype.ceil=function(t,i){void 0===t&&(t=1),void 0===i&&(i=.001);var h=Math.ceil((this.x+this.width-i)*t)/t,s=Math.ceil((this.y+this.height-i)*t)/t;return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=h-this.x,this.height=s-this.y,this},i.prototype.enlarge=function(t){var i=Math.min(this.x,t.x),h=Math.max(this.x+this.width,t.x+t.width),s=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=i,this.width=h-i,this.y=s,this.height=o-s,this},i}(),n=function(){function i(i,h,s){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),this.x=i,this.y=h,this.radius=s,this.type=t.CIRC}return i.prototype.clone=function(){return new i(this.x,this.y,this.radius)},i.prototype.contains=function(t,i){if(this.radius<=0)return!1;var h=this.radius*this.radius,s=this.x-t,o=this.y-i;return(s*=s)+(o*=o)<=h},i.prototype.getBounds=function(){return new o(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},i}(),r=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=i,this.y=h,this.width=s,this.height=o,this.type=t.ELIP}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;var h=(t-this.x)/this.width,s=(i-this.y)/this.height;return(h*=h)+(s*=s)<=1},i.prototype.getBounds=function(){return new o(this.x-this.width,this.y-this.height,this.width,this.height)},i}(),e=function(){function i(){for(var i=arguments,h=[],s=0;s<arguments.length;s++)h[s]=i[s];var o=Array.isArray(h[0])?h[0]:h;if("number"!=typeof o[0]){for(var n=[],r=0,e=o.length;r<e;r++)n.push(o[r].x,o[r].y);o=n}this.points=o,this.type=t.POLY,this.closeStroke=!0}return i.prototype.clone=function(){var t=new i(this.points.slice());return t.closeStroke=this.closeStroke,t},i.prototype.contains=function(t,i){for(var h=!1,s=this.points.length/2,o=0,n=s-1;o<s;n=o++){var r=this.points[2*o],e=this.points[2*o+1],a=this.points[2*n],c=this.points[2*n+1];e>i!=c>i&&t<(i-e)/(c-e)*(a-r)+r&&(h=!h)}return h},i}(),a=function(){function i(i,h,s,o,n){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===n&&(n=20),this.x=i,this.y=h,this.width=s,this.height=o,this.radius=n,this.type=t.RREC}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.radius)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){var h=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(i>=this.y+h&&i<=this.y+this.height-h||t>=this.x+h&&t<=this.x+this.width-h)return!0;var s=t-(this.x+h),o=i-(this.y+h),n=h*h;if(s*s+o*o<=n)return!0;if((s=t-(this.x+this.width-h))*s+o*o<=n)return!0;if(s*s+(o=i-(this.y+this.height-h))*o<=n)return!0;if((s=t-(this.x+h))*s+o*o<=n)return!0}return!1},i}(),c=function(){function t(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.x=0,this.y=0,this.x=t,this.y=i}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x=t,this.y=i,this},t}(),u=function(){function t(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0),this._x=h,this._y=s,this.cb=t,this.scope=i}return t.prototype.clone=function(i,h){return void 0===i&&(i=this.cb),void 0===h&&(h=this.scope),new t(i,h,this._x,this._y)},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this._x===t&&this._y===i||(this._x=t,this._y=i,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),y=function(){function t(t,i,h,s,o,n){void 0===t&&(t=1),void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=1),void 0===o&&(o=0),void 0===n&&(n=0),this.array=null,this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,i,h,s,o,n){return this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n,this},t.prototype.toArray=function(t,i){this.array||(this.array=new Float32Array(9));var h=i||this.array;return t?(h[0]=this.a,h[1]=this.b,h[2]=0,h[3]=this.c,h[4]=this.d,h[5]=0,h[6]=this.tx,h[7]=this.ty,h[8]=1):(h[0]=this.a,h[1]=this.c,h[2]=this.tx,h[3]=this.b,h[4]=this.d,h[5]=this.ty,h[6]=0,h[7]=0,h[8]=1),h},t.prototype.apply=function(t,i){i=i||new c;var h=t.x,s=t.y;return i.x=this.a*h+this.c*s+this.tx,i.y=this.b*h+this.d*s+this.ty,i},t.prototype.applyInverse=function(t,i){i=i||new c;var h=1/(this.a*this.d+this.c*-this.b),s=t.x,o=t.y;return i.x=this.d*h*s+-this.c*h*o+(this.ty*this.c-this.tx*this.d)*h,i.y=this.a*h*o+-this.b*h*s+(-this.ty*this.a+this.tx*this.b)*h,i},t.prototype.translate=function(t,i){return this.tx+=t,this.ty+=i,this},t.prototype.scale=function(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this},t.prototype.rotate=function(t){var i=Math.cos(t),h=Math.sin(t),s=this.a,o=this.c,n=this.tx;return this.a=s*i-this.b*h,this.b=s*h+this.b*i,this.c=o*i-this.d*h,this.d=o*h+this.d*i,this.tx=n*i-this.ty*h,this.ty=n*h+this.ty*i,this},t.prototype.append=function(t){var i=this.a,h=this.b,s=this.c,o=this.d;return this.a=t.a*i+t.b*s,this.b=t.a*h+t.b*o,this.c=t.c*i+t.d*s,this.d=t.c*h+t.d*o,this.tx=t.tx*i+t.ty*s+this.tx,this.ty=t.tx*h+t.ty*o+this.ty,this},t.prototype.setTransform=function(t,i,h,s,o,n,r,e,a){return this.a=Math.cos(r+a)*o,this.b=Math.sin(r+a)*o,this.c=-Math.sin(r-e)*n,this.d=Math.cos(r-e)*n,this.tx=t-(h*this.a+s*this.c),this.ty=i-(h*this.b+s*this.d),this},t.prototype.prepend=function(t){var i=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var h=this.a,s=this.c;this.a=h*t.a+this.b*t.c,this.b=h*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var h=this.a,s=this.b,o=this.c,n=this.d,r=t.pivot,e=-Math.atan2(-o,n),a=Math.atan2(s,h),c=Math.abs(e+a);return c<1e-5||Math.abs(i-c)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=e,t.skew.y=a),t.scale.x=Math.sqrt(h*h+s*s),t.scale.y=Math.sqrt(o*o+n*n),t.position.x=this.tx+(r.x*h+r.y*o),t.position.y=this.ty+(r.x*s+r.y*n),t},t.prototype.invert=function(){var t=this.a,i=this.b,h=this.c,s=this.d,o=this.tx,n=t*s-i*h;return this.a=s/n,this.b=-i/n,this.c=-h/n,this.d=t/n,this.tx=(h*this.ty-s*o)/n,this.ty=-(t*this.ty-i*o)/n,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var i=new t;return i.a=this.a,i.b=this.b,i.c=this.c,i.d=this.d,i.tx=this.tx,i.ty=this.ty,i},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),p=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],d=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],f=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],x=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],l=[],b=[],v=Math.sign;!function(){for(var t=0;t<16;t++){var i=[];l.push(i);for(var h=0;h<16;h++)for(var s=v(p[t]*p[h]+f[t]*d[h]),o=v(d[t]*p[h]+x[t]*d[h]),n=v(p[t]*f[h]+f[t]*x[h]),r=v(d[t]*f[h]+x[t]*x[h]),e=0;e<16;e++)if(p[e]===s&&d[e]===o&&f[e]===n&&x[e]===r){i.push(e);break}}for(t=0;t<16;t++){var a=new y;a.set(p[t],d[t],f[t],x[t],0,0),b.push(a)}}();var w={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return p[t]},uY:function(t){return d[t]},vX:function(t){return f[t]},vY:function(t){return x[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,i){return l[t][i]},sub:function(t,i){return l[t][w.inv(i)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,i){return 2*Math.abs(t)<=Math.abs(i)?i>=0?w.S:w.N:2*Math.abs(i)<=Math.abs(t)?t>0?w.E:w.W:i>0?t>0?w.SE:w.SW:t>0?w.NE:w.NW},matrixAppendRotationInv:function(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0);var o=b[w.inv(i)];o.tx=h,o.ty=s,t.append(o)}},_=function(){function t(){this.worldTransform=new y,this.localTransform=new y,this.position=new u(this.onChange,this,0,0),this.scale=new u(this.onChange,this,1,1),this.pivot=new u(this.onChange,this,0,0),this.skew=new u(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var i=this.localTransform;if(this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var h=t.worldTransform,s=this.worldTransform;s.a=i.a*h.a+i.b*h.c,s.b=i.a*h.b+i.b*h.d,s.c=i.c*h.a+i.d*h.c,s.d=i.c*h.b+i.d*h.d,s.tx=i.tx*h.a+i.ty*h.c+h.tx,s.ty=i.tx*h.b+i.ty*h.d+h.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();export{n as Circle,s as DEG_TO_RAD,r as Ellipse,y as Matrix,u as ObservablePoint,i as PI_2,c as Point,e as Polygon,h as RAD_TO_DEG,o as Rectangle,a as RoundedRectangle,t as SHAPES,_ as Transform,w as groupD8};
//# sourceMappingURL=math.min.js.map

@@ -14,3 +14,3 @@ /// <reference path="./global.d.ts" />

y: number;
/** @default 1 */
/** @default 0 */
radius: number;

@@ -710,8 +710,15 @@ /**

*
* @class
* @memberof PIXI
*/
export declare class Polygon {
/** An array of the points of this polygon. */
points: number[];
/** `false` after moveTo, `true` after `closePath`. In all other cases it is `true`. */
closeStroke: boolean;
/**
* The type of the object, mainly used to avoid `instanceof` checks
*
* @default PIXI.SHAPES.POLY
* @see PIXI.SHAPES
*/
readonly type: SHAPES.POLY;

@@ -721,13 +728,13 @@ constructor(points: IPointData[] | number[]);

/**
* Creates a clone of this polygon
* Creates a clone of this polygon.
*
* @return {PIXI.Polygon} a copy of the polygon
* @return - A copy of the polygon.
*/
clone(): Polygon;
/**
* Checks whether the x and y coordinates passed to this function are contained within this polygon
* Checks whether the x and y coordinates passed to this function are contained within this polygon.
*
* @param {number} x - The X coordinate of the point to test
* @param {number} y - The Y coordinate of the point to test
* @return {boolean} Whether the x/y coordinates are within this polygon
* @param x - The X coordinate of the point to test.
* @param y - The Y coordinate of the point to test.
* @return - Whether the x/y coordinates are within this polygon.
*/

@@ -754,5 +761,3 @@ contains(x: number, y: number): boolean;

* @memberof PIXI
* @typedef {object} ISize@typedef {object} ISize
* @property {number} width - Width component
* @property {number} height - Height component
* @typedef {object} ISize
*/

@@ -763,50 +768,35 @@ /**

*
* @class
* @memberof PIXI
*/
export declare class Rectangle {
/** @default 0 */
x: number;
/** @default 0 */
y: number;
/** @default 0 */
width: number;
/** @default 0 */
height: number;
/**
* The type of the object, mainly used to avoid `instanceof` checks
* @default PIXI.SHAPES.RECT
* @see PIXI.SHAPES
*/
readonly type: SHAPES.RECT;
/**
* @param {number} [x=0] - The X coordinate of the upper-left corner of the rectangle
* @param {number} [y=0] - The Y coordinate of the upper-left corner of the rectangle
* @param {number} [width=0] - The overall width of this rectangle
* @param {number} [height=0] - The overall height of this rectangle
* @param x - The X coordinate of the upper-left corner of the rectangle
* @param y - The Y coordinate of the upper-left corner of the rectangle
* @param width - The overall width of the rectangle
* @param height - The overall height of the rectangle
*/
constructor(x?: number, y?: number, width?: number, height?: number);
/**
* returns the left edge of the rectangle
*
* @member {number}
*/
/** Returns the left edge of the rectangle. */
get left(): number;
/**
* returns the right edge of the rectangle
*
* @member {number}
*/
/** Returns the right edge of the rectangle. */
get right(): number;
/**
* returns the top edge of the rectangle
*
* @member {number}
*/
/** Returns the top edge of the rectangle. */
get top(): number;
/**
* returns the bottom edge of the rectangle
*
* @member {number}
*/
/** Returns the bottom edge of the rectangle. */
get bottom(): number;
/**
* A constant empty rectangle.
*
* @static
* @constant
* @member {PIXI.Rectangle}
* @return {PIXI.Rectangle} An empty rectangle
*/
/** A constant empty rectangle. */
static get EMPTY(): Rectangle;

@@ -816,3 +806,3 @@ /**

*
* @return {PIXI.Rectangle} a copy of the rectangle
* @return a copy of the rectangle
*/

@@ -823,4 +813,4 @@ clone(): Rectangle;

*
* @param {PIXI.Rectangle} rectangle - The rectangle to copy from.
* @return {PIXI.Rectangle} Returns itself.
* @param rectangle - The rectangle to copy from.
* @return Returns itself.
*/

@@ -831,4 +821,4 @@ copyFrom(rectangle: Rectangle): Rectangle;

*
* @param {PIXI.Rectangle} rectangle - The rectangle to copy to.
* @return {PIXI.Rectangle} Returns given parameter.
* @param rectangle - The rectangle to copy to.
* @return Returns given parameter.
*/

@@ -839,5 +829,5 @@ copyTo(rectangle: Rectangle): Rectangle;

*
* @param {number} x - The X coordinate of the point to test
* @param {number} y - The Y coordinate of the point to test
* @return {boolean} Whether the x/y coordinates are within this Rectangle
* @param x - The X coordinate of the point to test
* @param y - The Y coordinate of the point to test
* @return Whether the x/y coordinates are within this Rectangle
*/

@@ -849,5 +839,5 @@ contains(x: number, y: number): boolean;

*
* @param {number} [paddingX=0] - The horizontal padding amount.
* @param {number} [paddingY=0] - The vertical padding amount.
* @return {PIXI.Rectangle} Returns itself.
* @param paddingX - The horizontal padding amount.
* @param paddingY - The vertical padding amount.
* @return Returns itself.
*/

@@ -858,4 +848,4 @@ pad(paddingX?: number, paddingY?: number): this;

*
* @param {PIXI.Rectangle} rectangle - The rectangle to fit.
* @return {PIXI.Rectangle} Returns itself.
* @param rectangle - The rectangle to fit.
* @return Returns itself.
*/

@@ -866,5 +856,5 @@ fit(rectangle: Rectangle): this;

*
* @param {number} [resolution=1] - resolution
* @param {number} [eps=0.001] - precision
* @return {PIXI.Rectangle} Returns itself.
* @param resolution - resolution
* @param eps - precision
* @return Returns itself.
*/

@@ -875,4 +865,4 @@ ceil(resolution?: number, eps?: number): this;

*
* @param {PIXI.Rectangle} rectangle - The rectangle to include.
* @return {PIXI.Rectangle} Returns itself.
* @param rectangle - The rectangle to include.
* @return Returns itself.
*/

@@ -879,0 +869,0 @@ enlarge(rectangle: Rectangle): this;

{
"name": "@pixi/math",
"version": "6.2.0",
"version": "6.2.1",
"main": "dist/cjs/math.js",

@@ -27,3 +27,3 @@ "module": "dist/esm/math.js",

],
"gitHead": "793f21c0d0f2d2a423bd4339f40a569e1ea68711"
"gitHead": "f5d077993ddf17b6381b876edf012d72e2e5123f"
}

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc