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

@pixi/graphics

Package Overview
Dependencies
Maintainers
1
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/graphics - npm Package Compare versions

Comparing version 5.3.4 to 5.3.5

6

dist/graphics.min.js
/*!
* @pixi/graphics - v5.3.4
* Compiled Mon, 14 Dec 2020 19:48:09 UTC
* @pixi/graphics - v5.3.5
* Compiled Thu, 17 Dec 2020 18:23:23 UTC
*

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

*/
this.PIXI=this.PIXI||{};var _pixi_graphics=function(t,e,i,r,n,s){"use strict";var a,h;(a=t.LINE_JOIN||(t.LINE_JOIN={})).MITER="miter",a.BEVEL="bevel",a.ROUND="round",(h=t.LINE_CAP||(t.LINE_CAP={})).BUTT="butt",h.ROUND="round",h.SQUARE="square";var o={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||isNaN(t))return e;var i=Math.ceil(t/this.maxLength);return i<this.minSegments?i=this.minSegments:i>this.maxSegments&&(i=this.maxSegments),i}},l=function(){function t(){this.color=16777215,this.alpha=1,this.texture=e.Texture.WHITE,this.matrix=null,this.visible=!1,this.reset()}return t.prototype.clone=function(){var e=new t;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},t.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=e.Texture.WHITE,this.matrix=null,this.visible=!1},t.prototype.destroy=function(){this.texture=null,this.matrix=null},t}(),u=function(t,e){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function c(t,e){function i(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var p={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var i=t.points,n=t.holes,s=e.points,a=e.indices;if(i.length>=6){for(var h=[],o=0;o<n.length;o++){var l=n[o];h.push(i.length/2),i=i.concat(l.points)}var u=r.earcut(i,h,2);if(!u)return;var c=s.length/2;for(o=0;o<u.length;o+=3)a.push(u[o]+c),a.push(u[o+1]+c),a.push(u[o+2]+c);for(o=0;o<i.length;o++)s.push(i[o])}}},d={build:function(t){var e,r,n=t.shape,s=t.points,a=n.x,h=n.y;if(s.length=0,t.type===i.SHAPES.CIRC)e=n.radius,r=n.radius;else{var o=t.shape;e=o.width,r=o.height}if(0!==e&&0!==r){var l=Math.floor(30*Math.sqrt(n.radius))||Math.floor(15*Math.sqrt(e+r));l/=2.3;for(var u=2*Math.PI/l,c=0;c<l-.5;c++)s.push(a+Math.sin(-u*c)*e,h+Math.cos(-u*c)*r);s.push(s[0],s[1])}},triangulate:function(t,e){var i=t.points,r=e.points,n=e.indices,s=r.length/2,a=s,h=t.shape,o=t.matrix,l=h.x,u=h.y;r.push(t.matrix?o.a*l+o.c*u+o.tx:l,t.matrix?o.b*l+o.d*u+o.ty:u);for(var c=0;c<i.length;c+=2)r.push(i[c],i[c+1]),n.push(s++,a,s)}},f={build:function(t){var e=t.shape,i=e.x,r=e.y,n=e.width,s=e.height,a=t.points;a.length=0,a.push(i,r,i+n,r,i+n,r+s,i,r+s)},triangulate:function(t,e){var i=t.points,r=e.points,n=r.length/2;r.push(i[0],i[1],i[2],i[3],i[6],i[7],i[4],i[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}};function y(t,e,i){return t+(e-t)*i}function g(t,e,i,r,n,s,a){void 0===a&&(a=[]);for(var h=a,o=0,l=0,u=0,c=0,p=0,d=0,f=0,g=0;f<=20;++f)o=y(t,i,g=f/20),l=y(e,r,g),u=y(i,n,g),c=y(r,s,g),p=y(o,u,g),d=y(l,c,g),h.push(p,d);return h}var v={build:function(t){var e=t.shape,i=t.points,r=e.x,n=e.y,s=e.width,a=e.height,h=Math.max(0,Math.min(e.radius,Math.min(s,a)/2));i.length=0,h?(g(r,n+h,r,n,r+h,n,i),g(r+s-h,n,r+s,n,r+s,n+h,i),g(r+s,n+a-h,r+s,n+a,r+s-h,n+a,i),g(r+h,n+a,r,n+a,r,n+a-h,i)):i.push(r,n,r+s,n,r+s,n+a,r,n+a)},triangulate:function(t,e){for(var i=t.points,n=e.points,s=e.indices,a=n.length/2,h=r.earcut(i,null,2),o=0,l=h.length;o<l;o+=3)s.push(h[o]+a),s.push(h[o+1]+a),s.push(h[o+2]+a);for(o=0,l=i.length;o<l;o++)n.push(i[o],i[++o])}};function b(t,e,i,r,n,s,a,h){var o,l;a?(o=r,l=-i):(o=-r,l=i);var u=t-i*n+o,c=e-r*n+l,p=t+i*s+o,d=e+r*s+l;return h.push(u,c),h.push(p,d),2}function m(t,e,i,r,n,s,a,h){var o=i-t,l=r-e,u=Math.atan2(o,l),c=Math.atan2(n-t,s-e);h&&u<c?u+=2*Math.PI:!h&&u>c&&(c+=2*Math.PI);var p=u,d=c-u,f=Math.abs(d),y=Math.sqrt(o*o+l*l),g=1+(15*f*Math.sqrt(y)/Math.PI>>0),v=d/g;if(p+=v,h){a.push(t,e),a.push(i,r);for(var b=1,m=p;b<g;b++,m+=v)a.push(t,e),a.push(t+Math.sin(m)*y,e+Math.cos(m)*y);a.push(t,e),a.push(n,s)}else{a.push(i,r),a.push(t,e);for(b=1,m=p;b<g;b++,m+=v)a.push(t+Math.sin(m)*y,e+Math.cos(m)*y),a.push(t,e);a.push(n,s),a.push(t,e)}return 2*g}function x(e,r){e.lineStyle.native?function(t,e){var r=0,n=t.shape,s=t.points||n.points,a=n.type!==i.SHAPES.POLY||n.closeStroke;if(0!==s.length){var h=e.points,o=e.indices,l=s.length/2,u=h.length/2,c=u;for(h.push(s[0],s[1]),r=1;r<l;r++)h.push(s[2*r],s[2*r+1]),o.push(c,c+1),c++;a&&o.push(c,u)}}(e,r):function(e,r){var n=e.shape,s=e.points||n.points.slice(),a=r.closePointEps;if(0!==s.length){var h=e.lineStyle,l=new i.Point(s[0],s[1]),u=new i.Point(s[s.length-2],s[s.length-1]),c=n.type!==i.SHAPES.POLY||n.closeStroke,p=Math.abs(l.x-u.x)<a&&Math.abs(l.y-u.y)<a;if(c){s=s.slice(),p&&(s.pop(),s.pop(),u.set(s[s.length-2],s[s.length-1]));var d=.5*(l.x+u.x),f=.5*(u.y+l.y);s.unshift(d,f),s.push(d,f)}var y=r.points,g=s.length/2,v=s.length,x=y.length/2,_=h.width/2,P=_*_,S=h.miterLimit*h.miterLimit,w=s[0],M=s[1],I=s[2],T=s[3],E=0,D=0,A=-(M-T),C=w-I,L=0,B=0,R=Math.sqrt(A*A+C*C);A/=R,C/=R,A*=_,C*=_;var O=h.alignment,N=2*(1-O),U=2*O;c||(h.cap===t.LINE_CAP.ROUND?v+=m(w-A*(N-U)*.5,M-C*(N-U)*.5,w-A*N,M-C*N,w+A*U,M+C*U,y,!0)+2:h.cap===t.LINE_CAP.SQUARE&&(v+=b(w,M,A,C,N,U,!0,y))),y.push(w-A*N,M-C*N),y.push(w+A*U,M+C*U);for(var H=1;H<g-1;++H){w=s[2*(H-1)],M=s[2*(H-1)+1],I=s[2*H],T=s[2*H+1],E=s[2*(H+1)],D=s[2*(H+1)+1],A=-(M-T),C=w-I,A/=R=Math.sqrt(A*A+C*C),C/=R,A*=_,C*=_,L=-(T-D),B=I-E,L/=R=Math.sqrt(L*L+B*B),B/=R,L*=_,B*=_;var j=I-w,F=M-T,z=I-E,k=D-T,q=F*z-k*j,G=q<0;if(Math.abs(q)<.1)y.push(I-A*N,T-C*N),y.push(I+A*U,T+C*U);else{var W=(-A+w)*(-C+T)-(-A+I)*(-C+M),X=(-L+E)*(-B+T)-(-L+I)*(-B+D),Y=(j*X-z*W)/q,J=(k*W-F*X)/q,V=(Y-I)*(Y-I)+(J-T)*(J-T),Q=I+(Y-I)*N,Z=T+(J-T)*N,K=I-(Y-I)*U,$=T-(J-T)*U;h.join===t.LINE_JOIN.BEVEL||V/P>S?(G?(y.push(Q,Z),y.push(I+A*U,T+C*U),y.push(Q,Z),y.push(I+L*U,T+B*U)):(y.push(I-A*N,T-C*N),y.push(K,$),y.push(I-L*N,T-B*N),y.push(K,$)),v+=2):h.join===t.LINE_JOIN.ROUND?G?(y.push(Q,Z),y.push(I+A*U,T+C*U),v+=m(I,T,I+A*U,T+C*U,I+L*U,T+B*U,y,!0)+4,y.push(Q,Z),y.push(I+L*U,T+B*U)):(y.push(I-A*N,T-C*N),y.push(K,$),v+=m(I,T,I-A*N,T-C*N,I-L*N,T-B*N,y,!1)+4,y.push(I-L*N,T-B*N),y.push(K,$)):(y.push(Q,Z),y.push(K,$))}}w=s[2*(g-2)],M=s[2*(g-2)+1],I=s[2*(g-1)],A=-(M-(T=s[2*(g-1)+1])),C=w-I,A/=R=Math.sqrt(A*A+C*C),C/=R,A*=_,C*=_,y.push(I-A*N,T-C*N),y.push(I+A*U,T+C*U),c||(h.cap===t.LINE_CAP.ROUND?v+=m(I-A*(N-U)*.5,T-C*(N-U)*.5,I-A*N,T-C*N,I+A*U,T+C*U,y,!1)+2:h.cap===t.LINE_CAP.SQUARE&&(v+=b(I,T,A,C,N,U,!1,y)));var tt=r.indices,et=o.epsilon*o.epsilon;for(H=x;H<v+x-2;++H)w=y[2*H],M=y[2*H+1],I=y[2*(H+1)],T=y[2*(H+1)+1],E=y[2*(H+2)],D=y[2*(H+2)+1],Math.abs(w*(T-D)+I*(D-M)+E*(M-T))<et||tt.push(H,H+1,H+2)}}(e,r)}var _,P=function(t){function e(e,r,n,s,a,h){void 0===h&&(h=0);a=a||s/2;for(var o=-1*Math.PI/2+h,l=2*n,u=i.PI_2/l,c=[],p=0;p<l;p++){var d=p%2?a:s,f=p*u+o;c.push(e+d*Math.cos(f),r+d*Math.sin(f))}return t.call(this,c)||this}return c(e,t),e}(i.Polygon),S=function(){function t(){}return t.curveTo=function(t,e,i,r,n,s){var a=s[s.length-2],h=s[s.length-1]-e,o=a-t,l=r-e,u=i-t,c=Math.abs(h*u-o*l);if(c<1e-8||0===n)return s[s.length-2]===t&&s[s.length-1]===e||s.push(t,e),null;var p=h*h+o*o,d=l*l+u*u,f=h*l+o*u,y=n*Math.sqrt(p)/c,g=n*Math.sqrt(d)/c,v=y*f/p,b=g*f/d,m=y*u+g*o,x=y*l+g*h,_=o*(g+v),P=h*(g+v),S=u*(y+b),w=l*(y+b);return{cx:m+t,cy:x+e,radius:n,startAngle:Math.atan2(P-x,_-m),endAngle:Math.atan2(w-x,S-m),anticlockwise:o*l>u*h}},t.arc=function(t,e,r,n,s,a,h,l,u){for(var c=h-a,p=o._segmentsCount(Math.abs(c)*s,40*Math.ceil(Math.abs(c)/i.PI_2)),d=c/(2*p),f=2*d,y=Math.cos(d),g=Math.sin(d),v=p-1,b=v%1/v,m=0;m<=v;++m){var x=d+a+f*(m+b*m),_=Math.cos(x),P=-Math.sin(x);u.push((y*_+g*P)*s+r,(y*-P+g*_)*s+n)}},t}(),w=function(){function t(){}return t.curveLength=function(t,e,i,r,n,s,a,h){for(var o=0,l=0,u=0,c=0,p=0,d=0,f=0,y=0,g=0,v=0,b=0,m=t,x=e,_=1;_<=10;++_)v=m-(y=(f=(d=(p=1-(l=_/10))*p)*p)*t+3*d*l*i+3*p*(u=l*l)*n+(c=u*l)*a),b=x-(g=f*e+3*d*l*r+3*p*u*s+c*h),m=y,x=g,o+=Math.sqrt(v*v+b*b);return o},t.curveTo=function(e,i,r,n,s,a,h){var l=h[h.length-2],u=h[h.length-1];h.length-=2;var c=o._segmentsCount(t.curveLength(l,u,e,i,r,n,s,a)),p=0,d=0,f=0,y=0,g=0;h.push(l,u);for(var v=1,b=0;v<=c;++v)f=(d=(p=1-(b=v/c))*p)*p,g=(y=b*b)*b,h.push(f*l+3*d*b*e+3*p*y*r+g*s,f*u+3*d*b*i+3*p*y*n+g*a)},t}(),M=function(){function t(){}return t.curveLength=function(t,e,i,r,n,s){var a=t-2*i+n,h=e-2*r+s,o=2*i-2*t,l=2*r-2*e,u=4*(a*a+h*h),c=4*(a*o+h*l),p=o*o+l*l,d=2*Math.sqrt(u+c+p),f=Math.sqrt(u),y=2*u*f,g=2*Math.sqrt(p),v=c/f;return(y*d+f*c*(d-g)+(4*p*u-c*c)*Math.log((2*f+v+d)/(v+g)))/(4*y)},t.curveTo=function(e,i,r,n,s){for(var a=s[s.length-2],h=s[s.length-1],l=o._segmentsCount(t.curveLength(a,h,e,i,r,n)),u=0,c=0,p=1;p<=l;++p){var d=p/l;u=a+(e-a)*d,c=h+(i-h)*d,s.push(u+(e+(r-e)*d-u)*d,c+(i+(n-i)*d-c)*d)}},t}(),I=function(){function t(){this.reset()}return t.prototype.begin=function(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i},t.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},t.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},t}(),T=((_={})[i.SHAPES.POLY]=p,_[i.SHAPES.CIRC]=d,_[i.SHAPES.ELIP]=d,_[i.SHAPES.RECT]=f,_[i.SHAPES.RREC]=v,_),E=[],D=[],A={buildPoly:p,buildCircle:d,buildRectangle:f,buildRoundedRectangle:v,FILL_COMMANDS:T,BATCH_POOL:E,DRAW_CALL_POOL:D,buildLine:x,Star:P,ArcUtils:S,BezierUtils:w,QuadraticUtils:M,BatchPart:I},C=function(){function t(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type,this.points=[],this.holes=[]}return t.prototype.clone=function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)},t.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},t}(),L=new i.Point,B=new s.Bounds,R=function(t){function a(){var e=t.call(this)||this;return e.uvsFloat32=null,e.indicesUint16=null,e.points=[],e.colors=[],e.uvs=[],e.indices=[],e.textureIds=[],e.graphicsData=[],e.dirty=0,e.batchDirty=-1,e.cacheDirty=-1,e.clearDirty=0,e.drawCalls=[],e.batches=[],e.shapeIndex=0,e._bounds=new s.Bounds,e.boundsDirty=-1,e.boundsPadding=0,e.batchable=!1,e.indicesUint16=null,e.uvsFloat32=null,e.closePointEps=1e-4,e}return c(a,t),Object.defineProperty(a.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),a.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),D.push(this.drawCalls[t]);this.drawCalls.length=0;for(t=0;t<this.batches.length;t++){var e=this.batches[t];e.reset(),E.push(e)}this.batches.length=0},a.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},a.prototype.drawShape=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null);var n=new C(t,e,i,r);return this.graphicsData.push(n),this.dirty++,this},a.prototype.drawHole=function(t,e){if(void 0===e&&(e=null),!this.graphicsData.length)return null;var i=new C(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=r.lineStyle,r.holes.push(i),this.dirty++,this},a.prototype.destroy=function(){t.prototype.destroy.call(this);for(var e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},a.prototype.containsPoint=function(t){for(var e=this.graphicsData,i=0;i<e.length;++i){var r=e[i];if(r.fillStyle.visible&&(r.shape&&(r.matrix?r.matrix.applyInverse(t,L):L.copyFrom(t),r.shape.contains(L.x,L.y)))){var n=!1;if(r.holes)for(var s=0;s<r.holes.length;s++){if(r.holes[s].shape.contains(L.x,L.y)){n=!0;break}}if(!n)return!0}}return!1},a.prototype.updateBatches=function(t){if(this.graphicsData.length){if(this.validateBatching()){this.cacheDirty=this.dirty;var e=this.uvs,i=this.graphicsData,r=null,s=null;this.batches.length>0&&(s=(r=this.batches[this.batches.length-1]).style);for(var a=this.shapeIndex;a<i.length;a++){this.shapeIndex++;var h=i[a],o=h.fillStyle,l=h.lineStyle;T[h.type].build(h),h.matrix&&this.transformPoints(h.points,h.matrix);for(var u=0;u<2;u++){var c=0===u?o:l;if(c.visible){var p=c.texture.baseTexture,d=this.indices.length,f=this.points.length/2;p.wrapMode=n.WRAP_MODES.REPEAT,0===u?this.processFill(h):this.processLine(h);var y=this.points.length/2-f;0!==y&&(r&&!this._compareStyles(s,c)&&(r.end(d,f),r=null),r||((r=E.pop()||new I).begin(c,d,f),this.batches.push(r),s=c),this.addUvs(this.points,e,c.texture,f,y,c.matrix))}}}var g=this.indices.length,v=this.points.length/2;if(r&&r.end(g,v),0!==this.batches.length){if(this.indicesUint16&&this.indices.length===this.indicesUint16.length)this.indicesUint16.set(this.indices);else{var b=v>65535&&t;this.indicesUint16=b?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},a.prototype._compareStyles=function(t,e){return!(!t||!e)&&(t.texture.baseTexture===e.texture.baseTexture&&(t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native))},a.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t<e;t++){var i=this.graphicsData[t],r=i.fillStyle,n=i.lineStyle;if(r&&!r.texture.baseTexture.valid)return!1;if(n&&!n.texture.baseTexture.valid)return!1}return!0},a.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var t=this.batches,e=0,i=t.length;e<i;e++)for(var r=t[e],n=0;n<r.size;n++){var s=r.start+n;this.indicesUint16[s]=this.indicesUint16[s]-r.attribStart}},a.prototype.isBatchable=function(){if(this.points.length>131070)return!1;for(var t=this.batches,e=0;e<t.length;e++)if(t[e].style.native)return!1;return this.points.length<2*a.BATCHABLE_SIZE},a.prototype.buildDrawCalls=function(){for(var t=++e.BaseTexture._globalBatch,i=0;i<this.drawCalls.length;i++)this.drawCalls[i].texArray.clear(),D.push(this.drawCalls[i]);this.drawCalls.length=0;var r=this.colors,s=this.textureIds,a=D.pop();a||((a=new e.BatchDrawCall).texArray=new e.BatchTextureArray),a.texArray.count=0,a.start=0,a.size=0,a.type=n.DRAW_MODES.TRIANGLES;var h=0,o=null,l=0,u=!1,c=n.DRAW_MODES.TRIANGLES,p=0;this.drawCalls.push(a);for(i=0;i<this.batches.length;i++){var d=this.batches[i],f=d.style,y=f.texture.baseTexture;u!==!!f.native&&(c=(u=!!f.native)?n.DRAW_MODES.LINES:n.DRAW_MODES.TRIANGLES,o=null,h=8,t++),o!==y&&(o=y,y._batchEnabled!==t&&(8===h&&(t++,h=0,a.size>0&&((a=D.pop())||((a=new e.BatchDrawCall).texArray=new e.BatchTextureArray),this.drawCalls.push(a)),a.start=p,a.size=0,a.texArray.count=0,a.type=c),y.touched=1,y._batchEnabled=t,y._batchLocation=h,y.wrapMode=10497,a.texArray.elements[a.texArray.count++]=y,h++)),a.size+=d.size,p+=d.size,l=y._batchLocation,this.addColors(r,f.color,f.alpha,d.attribSize),this.addTextureIds(s,l,d.attribSize)}e.BaseTexture._globalBatch=t,this.packAttributes()},a.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,i=this.colors,r=this.textureIds,n=new ArrayBuffer(3*t.length*4),s=new Float32Array(n),a=new Uint32Array(n),h=0,o=0;o<t.length/2;o++)s[h++]=t[2*o],s[h++]=t[2*o+1],s[h++]=e[2*o],s[h++]=e[2*o+1],a[h++]=i[o],s[h++]=r[o];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)},a.prototype.processFill=function(t){t.holes.length?(this.processHoles(t.holes),p.triangulate(t,this)):T[t.type].triangulate(t,this)},a.prototype.processLine=function(t){x(t,this);for(var e=0;e<t.holes.length;e++)x(t.holes[e],this)},a.prototype.processHoles=function(t){for(var e=0;e<t.length;e++){var i=t[e];T[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}},a.prototype.calculateBounds=function(){var t=this._bounds,e=B,r=i.Matrix.IDENTITY;this._bounds.clear(),e.clear();for(var n=0;n<this.graphicsData.length;n++){var s=this.graphicsData[n],a=s.shape,h=s.type,o=s.lineStyle,l=s.matrix||i.Matrix.IDENTITY,u=0;if(o&&o.visible){var c=o.alignment;u=o.width,h===i.SHAPES.POLY?u*=.5+Math.abs(.5-c):u*=Math.max(0,c)}if(r!==l&&(e.isEmpty()||(t.addBoundsMatrix(e,r),e.clear()),r=l),h===i.SHAPES.RECT||h===i.SHAPES.RREC){var p=a;e.addFramePad(p.x,p.y,p.x+p.width,p.y+p.height,u,u)}else if(h===i.SHAPES.CIRC){var d=a;e.addFramePad(d.x,d.y,d.x,d.y,d.radius+u,d.radius+u)}else if(h===i.SHAPES.ELIP){var f=a;e.addFramePad(f.x,f.y,f.x,f.y,f.width+u,f.height+u)}else{var y=a;t.addVerticesMatrix(r,y.points,0,y.points.length,u,u)}}e.isEmpty()||t.addBoundsMatrix(e,r),t.pad(this.boundsPadding,this.boundsPadding)},a.prototype.transformPoints=function(t,e){for(var i=0;i<t.length/2;i++){var r=t[2*i],n=t[2*i+1];t[2*i]=e.a*r+e.c*n+e.tx,t[2*i+1]=e.b*r+e.d*n+e.ty}},a.prototype.addColors=function(t,e,i,n){for(var s=(e>>16)+(65280&e)+((255&e)<<16),a=r.premultiplyTint(s,i);n-- >0;)t.push(a)},a.prototype.addTextureIds=function(t,e,i){for(;i-- >0;)t.push(e)},a.prototype.addUvs=function(t,e,i,r,n,s){void 0===s&&(s=null);for(var a=0,h=e.length,o=i.frame;a<n;){var l=t[2*(r+a)],u=t[2*(r+a)+1];if(s){var c=s.a*l+s.c*u+s.tx;u=s.b*l+s.d*u+s.ty,l=c}a++,e.push(l/o.width,u/o.height)}var p=i.baseTexture;(o.width<p.width||o.height<p.height)&&this.adjustUvs(e,i,h,n)},a.prototype.adjustUvs=function(t,e,i,r){for(var n=e.baseTexture,s=i+2*r,a=e.frame,h=a.width/n.width,o=a.height/n.height,l=a.x/a.width,u=a.y/a.height,c=Math.floor(t[i]+1e-6),p=Math.floor(t[i+1]+1e-6),d=i+2;d<s;d+=2)c=Math.min(c,Math.floor(t[d]+1e-6)),p=Math.min(p,Math.floor(t[d+1]+1e-6));l-=c,u-=p;for(d=i;d<s;d+=2)t[d]=(t[d]+l)*h,t[d+1]=(t[d+1]+u)*o},a.BATCHABLE_SIZE=100,a}(e.BatchGeometry),O=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.width=0,i.alignment=.5,i.native=!1,i.cap=t.LINE_CAP.BUTT,i.join=t.LINE_JOIN.MITER,i.miterLimit=10,i}return c(i,e),i.prototype.clone=function(){var t=new i;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t},i.prototype.reset=function(){e.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},i}(l),N=new Float32Array(3),U={},H=function(s){function a(t){void 0===t&&(t=null);var i=s.call(this)||this;return i._geometry=t||new R,i._geometry.refCount++,i.shader=null,i.state=e.State.for2d(),i._fillStyle=new l,i._lineStyle=new O,i._matrix=null,i._holeMode=!1,i.currentPath=null,i.batches=[],i.batchTint=-1,i.batchDirty=-1,i.vertexData=null,i.pluginName="batch",i._transformID=-1,i.tint=16777215,i.blendMode=n.BLEND_MODES.NORMAL,i}return c(a,s),Object.defineProperty(a.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),a.prototype.clone=function(){return this.finishPoly(),new a(this._geometry)},Object.defineProperty(a.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),a.prototype.lineStyle=function(t){if(void 0===t&&(t=null),"number"==typeof t){var e=arguments;t={width:e[0]||0,color:e[1]||0,alpha:void 0!==e[2]?e[2]:1,alignment:void 0!==e[3]?e[3]:.5,native:!!e[4]}}return this.lineTextureStyle(t)},a.prototype.lineTextureStyle=function(i){if("number"==typeof i){r.deprecation("v5.2.0","Please use object-based options for Graphics#lineTextureStyle");var n=arguments,s=n[0],a=n[1],h=n[2],o=n[3],l=n[4],u=n[5],c=n[6];i={width:s,texture:a,color:h,alpha:o,matrix:l,alignment:u,native:c},Object.keys(i).forEach(function(t){return void 0===i[t]&&delete i[t]})}i=Object.assign({width:0,texture:e.Texture.WHITE,color:i&&i.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:t.LINE_CAP.BUTT,join:t.LINE_JOIN.MITER,miterLimit:10},i),this.currentPath&&this.startPoly();var p=i.width>0&&i.alpha>0;return p?(i.matrix&&(i.matrix=i.matrix.clone(),i.matrix.invert()),Object.assign(this._lineStyle,{visible:p},i)):this._lineStyle.reset(),this},a.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new i.Polygon,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new i.Polygon,this.currentPath.closeStroke=!1},a.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},a.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},a.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return r===t&&n===e||i.push(t,e),this},a.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},a.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),M.curveTo(t,e,i,r,n),this},a.prototype.bezierCurveTo=function(t,e,i,r,n,s){return this._initCurve(),w.curveTo(t,e,i,r,n,s,this.currentPath.points),this},a.prototype.arcTo=function(t,e,i,r,n){this._initCurve(t,e);var s=this.currentPath.points,a=S.curveTo(t,e,i,r,n,s);if(a){var h=a.cx,o=a.cy,l=a.radius,u=a.startAngle,c=a.endAngle,p=a.anticlockwise;this.arc(h,o,l,u,c,p)}return this},a.prototype.arc=function(t,e,r,n,s,a){if(void 0===a&&(a=!1),n===s)return this;if(!a&&s<=n?s+=i.PI_2:a&&n<=s&&(n+=i.PI_2),0===s-n)return this;var h=t+Math.cos(n)*r,o=e+Math.sin(n)*r,l=this._geometry.closePointEps,u=this.currentPath?this.currentPath.points:null;if(u){var c=Math.abs(u[u.length-2]-h),p=Math.abs(u[u.length-1]-o);c<l&&p<l||u.push(h,o)}else this.moveTo(h,o),u=this.currentPath.points;return S.arc(h,o,t,e,r,n,s,a,u),this},a.prototype.beginFill=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=1),this.beginTextureFill({texture:e.Texture.WHITE,color:t,alpha:i})},a.prototype.beginTextureFill=function(t){if(t instanceof e.Texture){r.deprecation("v5.2.0","Please use object-based options for Graphics#beginTextureFill");var i=arguments,n=i[0],s=i[1],a=i[2],h=i[3];t={texture:n,color:s,alpha:a,matrix:h},Object.keys(t).forEach(function(e){return void 0===t[e]&&delete t[e]})}t=Object.assign({texture:e.Texture.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var o=t.alpha>0;return o?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:o},t)):this._fillStyle.reset(),this},a.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},a.prototype.drawRect=function(t,e,r,n){return this.drawShape(new i.Rectangle(t,e,r,n))},a.prototype.drawRoundedRect=function(t,e,r,n,s){return this.drawShape(new i.RoundedRectangle(t,e,r,n,s))},a.prototype.drawCircle=function(t,e,r){return this.drawShape(new i.Circle(t,e,r))},a.prototype.drawEllipse=function(t,e,r,n){return this.drawShape(new i.Ellipse(t,e,r,n))},a.prototype.drawPolygon=function(){for(var t,e=arguments,r=[],n=0;n<arguments.length;n++)r[n]=e[n];var s=!0,a=r[0];a.points?(s=a.closeStroke,t=a.points):t=Array.isArray(r[0])?r[0]:r;var h=new i.Polygon(t);return h.closeStroke=s,this.drawShape(h),this},a.prototype.drawShape=function(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},a.prototype.drawStar=function(t,e,i,r,n,s){return void 0===s&&(s=0),this.drawPolygon(new P(t,e,i,r,n,s))},a.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},a.prototype.isFastRect=function(){var t=this._geometry.graphicsData;return 1===t.length&&t[0].shape.type===i.SHAPES.RECT&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)},a.prototype._render=function(t){this.finishPoly();var e=this._geometry,i=t.context.supports.uint32Indices;e.updateBatches(i),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))},a.prototype._populateBatches=function(){var t=this._geometry,e=this.blendMode,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(var n=0;n<i;n++){var s=t.batches[n],a=s.style.color,h=new Float32Array(this.vertexData.buffer,4*s.attribStart*2,2*s.attribSize),o=new Float32Array(t.uvsFloat32.buffer,4*s.attribStart*2,2*s.attribSize),l={vertexData:h,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*s.start,s.size),uvs:o,_batchRGB:r.hex2rgb(a),_tintRGB:a,_texture:s.style.texture,alpha:s.style.alpha,worldAlpha:1};this.batches[n]=l}},a.prototype._renderBatched=function(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var e=0,i=this.batches.length;e<i;e++){var r=this.batches[e];r.worldAlpha=this.worldAlpha*r.alpha,t.plugins[this.pluginName].render(r)}}},a.prototype._renderDirect=function(t){var e=this._resolveDirectShader(t),i=this._geometry,r=this.tint,n=this.worldAlpha,s=e.uniforms,a=i.drawCalls;s.translationMatrix=this.transform.worldTransform,s.tint[0]=(r>>16&255)/255*n,s.tint[1]=(r>>8&255)/255*n,s.tint[2]=(255&r)/255*n,s.tint[3]=n,t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(var h=0,o=a.length;h<o;h++)this._renderDrawCallDirect(t,i.drawCalls[h])},a.prototype._renderDrawCallDirect=function(t,e){for(var i=e.texArray,r=e.type,n=e.size,s=e.start,a=i.count,h=0;h<a;h++)t.texture.bind(i.elements[h],h);t.geometry.draw(r,n,s)},a.prototype._resolveDirectShader=function(t){var r=this.shader,n=this.pluginName;if(!r){if(!U[n]){for(var s=new Int32Array(16),a=0;a<16;a++)s[a]=a;var h={tint:new Float32Array([1,1,1,1]),translationMatrix:new i.Matrix,default:e.UniformGroup.from({uSamplers:s},!0)},o=t.plugins[n]._shader.program;U[n]=new e.Shader(o,h)}r=U[n]}return r},a.prototype._calculateBounds=function(){this.finishPoly();var t=this._geometry;if(t.graphicsData.length){var e=t.bounds,i=e.minX,r=e.minY,n=e.maxX,s=e.maxY;this._bounds.addFrame(this.transform,i,r,n,s)}},a.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,a._TEMP_POINT),this._geometry.containsPoint(a._TEMP_POINT)},a.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=r.hex2rgb(this.tint,N),e=0;e<this.batches.length;e++){var i=this.batches[e],n=i._batchRGB,s=(t[0]*n[0]*255<<16)+(t[1]*n[1]*255<<8)+(0|t[2]*n[2]*255);i._tintRGB=(s>>16)+(65280&s)+((255&s)<<16)}}},a.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var e=this.transform.worldTransform,i=e.a,r=e.b,n=e.c,s=e.d,a=e.tx,h=e.ty,o=this._geometry.points,l=this.vertexData,u=0,c=0;c<o.length;c+=2){var p=o[c],d=o[c+1];l[u++]=i*p+n*d+a,l[u++]=s*d+r*p+h}}},a.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0),this},a.prototype.setMatrix=function(t){return this._matrix=t,this},a.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},a.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},a.prototype.destroy=function(t){s.prototype.destroy.call(this,t),this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,s.prototype.destroy.call(this,t)},a._TEMP_POINT=new i.Point,a}(s.Container);return t.FillStyle=l,t.GRAPHICS_CURVES=o,t.Graphics=H,t.GraphicsData=C,t.GraphicsGeometry=R,t.LineStyle=O,t.graphicsUtils=A,t}({},PIXI,PIXI,PIXI.utils,PIXI,PIXI);Object.assign(this.PIXI,_pixi_graphics);
this.PIXI=this.PIXI||{};var _pixi_graphics=function(t,e,i,r,n,s){"use strict";var a,h;(a=t.LINE_JOIN||(t.LINE_JOIN={})).MITER="miter",a.BEVEL="bevel",a.ROUND="round",(h=t.LINE_CAP||(t.LINE_CAP={})).BUTT="butt",h.ROUND="round",h.SQUARE="square";var o={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||isNaN(t))return e;var i=Math.ceil(t/this.maxLength);return i<this.minSegments?i=this.minSegments:i>this.maxSegments&&(i=this.maxSegments),i}},l=function(){function t(){this.color=16777215,this.alpha=1,this.texture=e.Texture.WHITE,this.matrix=null,this.visible=!1,this.reset()}return t.prototype.clone=function(){var e=new t;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},t.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=e.Texture.WHITE,this.matrix=null,this.visible=!1},t.prototype.destroy=function(){this.texture=null,this.matrix=null},t}(),u=function(t,e){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function c(t,e){function i(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var p={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var i=t.points,n=t.holes,s=e.points,a=e.indices;if(i.length>=6){for(var h=[],o=0;o<n.length;o++){var l=n[o];h.push(i.length/2),i=i.concat(l.points)}var u=r.earcut(i,h,2);if(!u)return;var c=s.length/2;for(o=0;o<u.length;o+=3)a.push(u[o]+c),a.push(u[o+1]+c),a.push(u[o+2]+c);for(o=0;o<i.length;o++)s.push(i[o])}}},d={build:function(t){var e,r,n=t.shape,s=t.points,a=n.x,h=n.y;if(s.length=0,t.type===i.SHAPES.CIRC)e=n.radius,r=n.radius;else{var o=t.shape;e=o.width,r=o.height}if(0!==e&&0!==r){var l=Math.floor(30*Math.sqrt(n.radius))||Math.floor(15*Math.sqrt(e+r));l/=2.3;for(var u=2*Math.PI/l,c=0;c<l-.5;c++)s.push(a+Math.sin(-u*c)*e,h+Math.cos(-u*c)*r);s.push(s[0],s[1])}},triangulate:function(t,e){var i=t.points,r=e.points,n=e.indices,s=r.length/2,a=s,h=t.shape,o=t.matrix,l=h.x,u=h.y;r.push(t.matrix?o.a*l+o.c*u+o.tx:l,t.matrix?o.b*l+o.d*u+o.ty:u);for(var c=0;c<i.length;c+=2)r.push(i[c],i[c+1]),n.push(s++,a,s)}},f={build:function(t){var e=t.shape,i=e.x,r=e.y,n=e.width,s=e.height,a=t.points;a.length=0,a.push(i,r,i+n,r,i+n,r+s,i,r+s)},triangulate:function(t,e){var i=t.points,r=e.points,n=r.length/2;r.push(i[0],i[1],i[2],i[3],i[6],i[7],i[4],i[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}};function y(t,e,i){return t+(e-t)*i}function g(t,e,i,r,n,s,a){void 0===a&&(a=[]);for(var h=a,o=0,l=0,u=0,c=0,p=0,d=0,f=0,g=0;f<=20;++f)o=y(t,i,g=f/20),l=y(e,r,g),u=y(i,n,g),c=y(r,s,g),p=y(o,u,g),d=y(l,c,g),h.push(p,d);return h}var v={build:function(t){var e=t.shape,i=t.points,r=e.x,n=e.y,s=e.width,a=e.height,h=Math.max(0,Math.min(e.radius,Math.min(s,a)/2));i.length=0,h?(g(r,n+h,r,n,r+h,n,i),g(r+s-h,n,r+s,n,r+s,n+h,i),g(r+s,n+a-h,r+s,n+a,r+s-h,n+a,i),g(r+h,n+a,r,n+a,r,n+a-h,i)):i.push(r,n,r+s,n,r+s,n+a,r,n+a)},triangulate:function(t,e){for(var i=t.points,n=e.points,s=e.indices,a=n.length/2,h=r.earcut(i,null,2),o=0,l=h.length;o<l;o+=3)s.push(h[o]+a),s.push(h[o+1]+a),s.push(h[o+2]+a);for(o=0,l=i.length;o<l;o++)n.push(i[o],i[++o])}};function b(t,e,i,r,n,s,a,h){var o,l;a?(o=r,l=-i):(o=-r,l=i);var u=t-i*n+o,c=e-r*n+l,p=t+i*s+o,d=e+r*s+l;return h.push(u,c),h.push(p,d),2}function m(t,e,i,r,n,s,a,h){var o=i-t,l=r-e,u=Math.atan2(o,l),c=Math.atan2(n-t,s-e);h&&u<c?u+=2*Math.PI:!h&&u>c&&(c+=2*Math.PI);var p=u,d=c-u,f=Math.abs(d),y=Math.sqrt(o*o+l*l),g=1+(15*f*Math.sqrt(y)/Math.PI>>0),v=d/g;if(p+=v,h){a.push(t,e),a.push(i,r);for(var b=1,m=p;b<g;b++,m+=v)a.push(t,e),a.push(t+Math.sin(m)*y,e+Math.cos(m)*y);a.push(t,e),a.push(n,s)}else{a.push(i,r),a.push(t,e);for(b=1,m=p;b<g;b++,m+=v)a.push(t+Math.sin(m)*y,e+Math.cos(m)*y),a.push(t,e);a.push(n,s),a.push(t,e)}return 2*g}function x(e,r){e.lineStyle.native?function(t,e){var r=0,n=t.shape,s=t.points||n.points,a=n.type!==i.SHAPES.POLY||n.closeStroke;if(0!==s.length){var h=e.points,o=e.indices,l=s.length/2,u=h.length/2,c=u;for(h.push(s[0],s[1]),r=1;r<l;r++)h.push(s[2*r],s[2*r+1]),o.push(c,c+1),c++;a&&o.push(c,u)}}(e,r):function(e,r){var n=e.shape,s=e.points||n.points.slice(),a=r.closePointEps;if(0!==s.length){var h=e.lineStyle,l=new i.Point(s[0],s[1]),u=new i.Point(s[s.length-2],s[s.length-1]),c=n.type!==i.SHAPES.POLY||n.closeStroke,p=Math.abs(l.x-u.x)<a&&Math.abs(l.y-u.y)<a;if(c){s=s.slice(),p&&(s.pop(),s.pop(),u.set(s[s.length-2],s[s.length-1]));var d=.5*(l.x+u.x),f=.5*(u.y+l.y);s.unshift(d,f),s.push(d,f)}var y=r.points,g=s.length/2,v=s.length,x=y.length/2,_=h.width/2,P=_*_,S=h.miterLimit*h.miterLimit,w=s[0],M=s[1],I=s[2],E=s[3],T=0,D=0,A=-(M-E),C=w-I,L=0,O=0,R=Math.sqrt(A*A+C*C);A/=R,C/=R,A*=_,C*=_;var B=h.alignment,N=2*(1-B),U=2*B;c||(h.cap===t.LINE_CAP.ROUND?v+=m(w-A*(N-U)*.5,M-C*(N-U)*.5,w-A*N,M-C*N,w+A*U,M+C*U,y,!0)+2:h.cap===t.LINE_CAP.SQUARE&&(v+=b(w,M,A,C,N,U,!0,y))),y.push(w-A*N,M-C*N),y.push(w+A*U,M+C*U);for(var H=1;H<g-1;++H){w=s[2*(H-1)],M=s[2*(H-1)+1],I=s[2*H],E=s[2*H+1],T=s[2*(H+1)],D=s[2*(H+1)+1],A=-(M-E),C=w-I,A/=R=Math.sqrt(A*A+C*C),C/=R,A*=_,C*=_,L=-(E-D),O=I-T,L/=R=Math.sqrt(L*L+O*O),O/=R,L*=_,O*=_;var j=I-w,F=M-E,z=I-T,k=D-E,q=F*z-k*j,G=q<0;if(Math.abs(q)<.1)y.push(I-A*N,E-C*N),y.push(I+A*U,E+C*U);else{var X=(-A+w)*(-C+E)-(-A+I)*(-C+M),W=(-L+T)*(-O+E)-(-L+I)*(-O+D),J=(j*W-z*X)/q,Y=(k*X-F*W)/q,V=(J-I)*(J-I)+(Y-E)*(Y-E),Q=I+(J-I)*N,Z=E+(Y-E)*N,K=I-(J-I)*U,$=E-(Y-E)*U,tt=G?N:U;V<=Math.min(j*j+F*F,z*z+k*k)+tt*tt*P?h.join===t.LINE_JOIN.BEVEL||V/P>S?(G?(y.push(Q,Z),y.push(I+A*U,E+C*U),y.push(Q,Z),y.push(I+L*U,E+O*U)):(y.push(I-A*N,E-C*N),y.push(K,$),y.push(I-L*N,E-O*N),y.push(K,$)),v+=2):h.join===t.LINE_JOIN.ROUND?G?(y.push(Q,Z),y.push(I+A*U,E+C*U),v+=m(I,E,I+A*U,E+C*U,I+L*U,E+O*U,y,!0)+4,y.push(Q,Z),y.push(I+L*U,E+O*U)):(y.push(I-A*N,E-C*N),y.push(K,$),v+=m(I,E,I-A*N,E-C*N,I-L*N,E-O*N,y,!1)+4,y.push(I-L*N,E-O*N),y.push(K,$)):(y.push(Q,Z),y.push(K,$)):(y.push(I-A*N,E-C*N),y.push(I+A*U,E+C*U),h.join===t.LINE_JOIN.BEVEL||V/P>S||(h.join===t.LINE_JOIN.ROUND?v+=G?m(I,E,I+A*U,E+C*U,I+L*U,E+O*U,y,!0)+2:m(I,E,I-A*N,E-C*N,I-L*N,E-O*N,y,!1)+2:(G?(y.push(K,$),y.push(K,$)):(y.push(Q,Z),y.push(Q,Z)),v+=2)),y.push(I-L*N,E-O*N),y.push(I+L*U,E+O*U),v+=2)}}w=s[2*(g-2)],M=s[2*(g-2)+1],I=s[2*(g-1)],A=-(M-(E=s[2*(g-1)+1])),C=w-I,A/=R=Math.sqrt(A*A+C*C),C/=R,A*=_,C*=_,y.push(I-A*N,E-C*N),y.push(I+A*U,E+C*U),c||(h.cap===t.LINE_CAP.ROUND?v+=m(I-A*(N-U)*.5,E-C*(N-U)*.5,I-A*N,E-C*N,I+A*U,E+C*U,y,!1)+2:h.cap===t.LINE_CAP.SQUARE&&(v+=b(I,E,A,C,N,U,!1,y)));var et=r.indices,it=o.epsilon*o.epsilon;for(H=x;H<v+x-2;++H)w=y[2*H],M=y[2*H+1],I=y[2*(H+1)],E=y[2*(H+1)+1],T=y[2*(H+2)],D=y[2*(H+2)+1],Math.abs(w*(E-D)+I*(D-M)+T*(M-E))<it||et.push(H,H+1,H+2)}}(e,r)}var _,P=function(t){function e(e,r,n,s,a,h){void 0===h&&(h=0);a=a||s/2;for(var o=-1*Math.PI/2+h,l=2*n,u=i.PI_2/l,c=[],p=0;p<l;p++){var d=p%2?a:s,f=p*u+o;c.push(e+d*Math.cos(f),r+d*Math.sin(f))}return t.call(this,c)||this}return c(e,t),e}(i.Polygon),S=function(){function t(){}return t.curveTo=function(t,e,i,r,n,s){var a=s[s.length-2],h=s[s.length-1]-e,o=a-t,l=r-e,u=i-t,c=Math.abs(h*u-o*l);if(c<1e-8||0===n)return s[s.length-2]===t&&s[s.length-1]===e||s.push(t,e),null;var p=h*h+o*o,d=l*l+u*u,f=h*l+o*u,y=n*Math.sqrt(p)/c,g=n*Math.sqrt(d)/c,v=y*f/p,b=g*f/d,m=y*u+g*o,x=y*l+g*h,_=o*(g+v),P=h*(g+v),S=u*(y+b),w=l*(y+b);return{cx:m+t,cy:x+e,radius:n,startAngle:Math.atan2(P-x,_-m),endAngle:Math.atan2(w-x,S-m),anticlockwise:o*l>u*h}},t.arc=function(t,e,r,n,s,a,h,l,u){for(var c=h-a,p=o._segmentsCount(Math.abs(c)*s,40*Math.ceil(Math.abs(c)/i.PI_2)),d=c/(2*p),f=2*d,y=Math.cos(d),g=Math.sin(d),v=p-1,b=v%1/v,m=0;m<=v;++m){var x=d+a+f*(m+b*m),_=Math.cos(x),P=-Math.sin(x);u.push((y*_+g*P)*s+r,(y*-P+g*_)*s+n)}},t}(),w=function(){function t(){}return t.curveLength=function(t,e,i,r,n,s,a,h){for(var o=0,l=0,u=0,c=0,p=0,d=0,f=0,y=0,g=0,v=0,b=0,m=t,x=e,_=1;_<=10;++_)v=m-(y=(f=(d=(p=1-(l=_/10))*p)*p)*t+3*d*l*i+3*p*(u=l*l)*n+(c=u*l)*a),b=x-(g=f*e+3*d*l*r+3*p*u*s+c*h),m=y,x=g,o+=Math.sqrt(v*v+b*b);return o},t.curveTo=function(e,i,r,n,s,a,h){var l=h[h.length-2],u=h[h.length-1];h.length-=2;var c=o._segmentsCount(t.curveLength(l,u,e,i,r,n,s,a)),p=0,d=0,f=0,y=0,g=0;h.push(l,u);for(var v=1,b=0;v<=c;++v)f=(d=(p=1-(b=v/c))*p)*p,g=(y=b*b)*b,h.push(f*l+3*d*b*e+3*p*y*r+g*s,f*u+3*d*b*i+3*p*y*n+g*a)},t}(),M=function(){function t(){}return t.curveLength=function(t,e,i,r,n,s){var a=t-2*i+n,h=e-2*r+s,o=2*i-2*t,l=2*r-2*e,u=4*(a*a+h*h),c=4*(a*o+h*l),p=o*o+l*l,d=2*Math.sqrt(u+c+p),f=Math.sqrt(u),y=2*u*f,g=2*Math.sqrt(p),v=c/f;return(y*d+f*c*(d-g)+(4*p*u-c*c)*Math.log((2*f+v+d)/(v+g)))/(4*y)},t.curveTo=function(e,i,r,n,s){for(var a=s[s.length-2],h=s[s.length-1],l=o._segmentsCount(t.curveLength(a,h,e,i,r,n)),u=0,c=0,p=1;p<=l;++p){var d=p/l;u=a+(e-a)*d,c=h+(i-h)*d,s.push(u+(e+(r-e)*d-u)*d,c+(i+(n-i)*d-c)*d)}},t}(),I=function(){function t(){this.reset()}return t.prototype.begin=function(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i},t.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},t.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},t}(),E=((_={})[i.SHAPES.POLY]=p,_[i.SHAPES.CIRC]=d,_[i.SHAPES.ELIP]=d,_[i.SHAPES.RECT]=f,_[i.SHAPES.RREC]=v,_),T=[],D=[],A={buildPoly:p,buildCircle:d,buildRectangle:f,buildRoundedRectangle:v,FILL_COMMANDS:E,BATCH_POOL:T,DRAW_CALL_POOL:D,buildLine:x,Star:P,ArcUtils:S,BezierUtils:w,QuadraticUtils:M,BatchPart:I},C=function(){function t(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type,this.points=[],this.holes=[]}return t.prototype.clone=function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)},t.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},t}(),L=new i.Point,O=new s.Bounds,R=function(t){function a(){var e=t.call(this)||this;return e.uvsFloat32=null,e.indicesUint16=null,e.points=[],e.colors=[],e.uvs=[],e.indices=[],e.textureIds=[],e.graphicsData=[],e.dirty=0,e.batchDirty=-1,e.cacheDirty=-1,e.clearDirty=0,e.drawCalls=[],e.batches=[],e.shapeIndex=0,e._bounds=new s.Bounds,e.boundsDirty=-1,e.boundsPadding=0,e.batchable=!1,e.indicesUint16=null,e.uvsFloat32=null,e.closePointEps=1e-4,e}return c(a,t),Object.defineProperty(a.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),a.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),D.push(this.drawCalls[t]);this.drawCalls.length=0;for(t=0;t<this.batches.length;t++){var e=this.batches[t];e.reset(),T.push(e)}this.batches.length=0},a.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},a.prototype.drawShape=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null);var n=new C(t,e,i,r);return this.graphicsData.push(n),this.dirty++,this},a.prototype.drawHole=function(t,e){if(void 0===e&&(e=null),!this.graphicsData.length)return null;var i=new C(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=r.lineStyle,r.holes.push(i),this.dirty++,this},a.prototype.destroy=function(){t.prototype.destroy.call(this);for(var e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},a.prototype.containsPoint=function(t){for(var e=this.graphicsData,i=0;i<e.length;++i){var r=e[i];if(r.fillStyle.visible&&(r.shape&&(r.matrix?r.matrix.applyInverse(t,L):L.copyFrom(t),r.shape.contains(L.x,L.y)))){var n=!1;if(r.holes)for(var s=0;s<r.holes.length;s++){if(r.holes[s].shape.contains(L.x,L.y)){n=!0;break}}if(!n)return!0}}return!1},a.prototype.updateBatches=function(t){if(this.graphicsData.length){if(this.validateBatching()){this.cacheDirty=this.dirty;var e=this.uvs,i=this.graphicsData,r=null,s=null;this.batches.length>0&&(s=(r=this.batches[this.batches.length-1]).style);for(var a=this.shapeIndex;a<i.length;a++){this.shapeIndex++;var h=i[a],o=h.fillStyle,l=h.lineStyle;E[h.type].build(h),h.matrix&&this.transformPoints(h.points,h.matrix);for(var u=0;u<2;u++){var c=0===u?o:l;if(c.visible){var p=c.texture.baseTexture,d=this.indices.length,f=this.points.length/2;p.wrapMode=n.WRAP_MODES.REPEAT,0===u?this.processFill(h):this.processLine(h);var y=this.points.length/2-f;0!==y&&(r&&!this._compareStyles(s,c)&&(r.end(d,f),r=null),r||((r=T.pop()||new I).begin(c,d,f),this.batches.push(r),s=c),this.addUvs(this.points,e,c.texture,f,y,c.matrix))}}}var g=this.indices.length,v=this.points.length/2;if(r&&r.end(g,v),0!==this.batches.length){if(this.indicesUint16&&this.indices.length===this.indicesUint16.length)this.indicesUint16.set(this.indices);else{var b=v>65535&&t;this.indicesUint16=b?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},a.prototype._compareStyles=function(t,e){return!(!t||!e)&&(t.texture.baseTexture===e.texture.baseTexture&&(t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native))},a.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t<e;t++){var i=this.graphicsData[t],r=i.fillStyle,n=i.lineStyle;if(r&&!r.texture.baseTexture.valid)return!1;if(n&&!n.texture.baseTexture.valid)return!1}return!0},a.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var t=this.batches,e=0,i=t.length;e<i;e++)for(var r=t[e],n=0;n<r.size;n++){var s=r.start+n;this.indicesUint16[s]=this.indicesUint16[s]-r.attribStart}},a.prototype.isBatchable=function(){if(this.points.length>131070)return!1;for(var t=this.batches,e=0;e<t.length;e++)if(t[e].style.native)return!1;return this.points.length<2*a.BATCHABLE_SIZE},a.prototype.buildDrawCalls=function(){for(var t=++e.BaseTexture._globalBatch,i=0;i<this.drawCalls.length;i++)this.drawCalls[i].texArray.clear(),D.push(this.drawCalls[i]);this.drawCalls.length=0;var r=this.colors,s=this.textureIds,a=D.pop();a||((a=new e.BatchDrawCall).texArray=new e.BatchTextureArray),a.texArray.count=0,a.start=0,a.size=0,a.type=n.DRAW_MODES.TRIANGLES;var h=0,o=null,l=0,u=!1,c=n.DRAW_MODES.TRIANGLES,p=0;this.drawCalls.push(a);for(i=0;i<this.batches.length;i++){var d=this.batches[i],f=d.style,y=f.texture.baseTexture;u!==!!f.native&&(c=(u=!!f.native)?n.DRAW_MODES.LINES:n.DRAW_MODES.TRIANGLES,o=null,h=8,t++),o!==y&&(o=y,y._batchEnabled!==t&&(8===h&&(t++,h=0,a.size>0&&((a=D.pop())||((a=new e.BatchDrawCall).texArray=new e.BatchTextureArray),this.drawCalls.push(a)),a.start=p,a.size=0,a.texArray.count=0,a.type=c),y.touched=1,y._batchEnabled=t,y._batchLocation=h,y.wrapMode=10497,a.texArray.elements[a.texArray.count++]=y,h++)),a.size+=d.size,p+=d.size,l=y._batchLocation,this.addColors(r,f.color,f.alpha,d.attribSize),this.addTextureIds(s,l,d.attribSize)}e.BaseTexture._globalBatch=t,this.packAttributes()},a.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,i=this.colors,r=this.textureIds,n=new ArrayBuffer(3*t.length*4),s=new Float32Array(n),a=new Uint32Array(n),h=0,o=0;o<t.length/2;o++)s[h++]=t[2*o],s[h++]=t[2*o+1],s[h++]=e[2*o],s[h++]=e[2*o+1],a[h++]=i[o],s[h++]=r[o];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)},a.prototype.processFill=function(t){t.holes.length?(this.processHoles(t.holes),p.triangulate(t,this)):E[t.type].triangulate(t,this)},a.prototype.processLine=function(t){x(t,this);for(var e=0;e<t.holes.length;e++)x(t.holes[e],this)},a.prototype.processHoles=function(t){for(var e=0;e<t.length;e++){var i=t[e];E[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}},a.prototype.calculateBounds=function(){var t=this._bounds,e=O,r=i.Matrix.IDENTITY;this._bounds.clear(),e.clear();for(var n=0;n<this.graphicsData.length;n++){var s=this.graphicsData[n],a=s.shape,h=s.type,o=s.lineStyle,l=s.matrix||i.Matrix.IDENTITY,u=0;if(o&&o.visible){var c=o.alignment;u=o.width,h===i.SHAPES.POLY?u*=.5+Math.abs(.5-c):u*=Math.max(0,c)}if(r!==l&&(e.isEmpty()||(t.addBoundsMatrix(e,r),e.clear()),r=l),h===i.SHAPES.RECT||h===i.SHAPES.RREC){var p=a;e.addFramePad(p.x,p.y,p.x+p.width,p.y+p.height,u,u)}else if(h===i.SHAPES.CIRC){var d=a;e.addFramePad(d.x,d.y,d.x,d.y,d.radius+u,d.radius+u)}else if(h===i.SHAPES.ELIP){var f=a;e.addFramePad(f.x,f.y,f.x,f.y,f.width+u,f.height+u)}else{var y=a;t.addVerticesMatrix(r,y.points,0,y.points.length,u,u)}}e.isEmpty()||t.addBoundsMatrix(e,r),t.pad(this.boundsPadding,this.boundsPadding)},a.prototype.transformPoints=function(t,e){for(var i=0;i<t.length/2;i++){var r=t[2*i],n=t[2*i+1];t[2*i]=e.a*r+e.c*n+e.tx,t[2*i+1]=e.b*r+e.d*n+e.ty}},a.prototype.addColors=function(t,e,i,n){for(var s=(e>>16)+(65280&e)+((255&e)<<16),a=r.premultiplyTint(s,i);n-- >0;)t.push(a)},a.prototype.addTextureIds=function(t,e,i){for(;i-- >0;)t.push(e)},a.prototype.addUvs=function(t,e,i,r,n,s){void 0===s&&(s=null);for(var a=0,h=e.length,o=i.frame;a<n;){var l=t[2*(r+a)],u=t[2*(r+a)+1];if(s){var c=s.a*l+s.c*u+s.tx;u=s.b*l+s.d*u+s.ty,l=c}a++,e.push(l/o.width,u/o.height)}var p=i.baseTexture;(o.width<p.width||o.height<p.height)&&this.adjustUvs(e,i,h,n)},a.prototype.adjustUvs=function(t,e,i,r){for(var n=e.baseTexture,s=i+2*r,a=e.frame,h=a.width/n.width,o=a.height/n.height,l=a.x/a.width,u=a.y/a.height,c=Math.floor(t[i]+1e-6),p=Math.floor(t[i+1]+1e-6),d=i+2;d<s;d+=2)c=Math.min(c,Math.floor(t[d]+1e-6)),p=Math.min(p,Math.floor(t[d+1]+1e-6));l-=c,u-=p;for(d=i;d<s;d+=2)t[d]=(t[d]+l)*h,t[d+1]=(t[d+1]+u)*o},a.BATCHABLE_SIZE=100,a}(e.BatchGeometry),B=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.width=0,i.alignment=.5,i.native=!1,i.cap=t.LINE_CAP.BUTT,i.join=t.LINE_JOIN.MITER,i.miterLimit=10,i}return c(i,e),i.prototype.clone=function(){var t=new i;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t},i.prototype.reset=function(){e.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},i}(l),N=new Float32Array(3),U={},H=function(s){function a(t){void 0===t&&(t=null);var i=s.call(this)||this;return i._geometry=t||new R,i._geometry.refCount++,i.shader=null,i.state=e.State.for2d(),i._fillStyle=new l,i._lineStyle=new B,i._matrix=null,i._holeMode=!1,i.currentPath=null,i.batches=[],i.batchTint=-1,i.batchDirty=-1,i.vertexData=null,i.pluginName="batch",i._transformID=-1,i.tint=16777215,i.blendMode=n.BLEND_MODES.NORMAL,i}return c(a,s),Object.defineProperty(a.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),a.prototype.clone=function(){return this.finishPoly(),new a(this._geometry)},Object.defineProperty(a.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),a.prototype.lineStyle=function(t){if(void 0===t&&(t=null),"number"==typeof t){var e=arguments;t={width:e[0]||0,color:e[1]||0,alpha:void 0!==e[2]?e[2]:1,alignment:void 0!==e[3]?e[3]:.5,native:!!e[4]}}return this.lineTextureStyle(t)},a.prototype.lineTextureStyle=function(i){if("number"==typeof i){r.deprecation("v5.2.0","Please use object-based options for Graphics#lineTextureStyle");var n=arguments,s=n[0],a=n[1],h=n[2],o=n[3],l=n[4],u=n[5],c=n[6];i={width:s,texture:a,color:h,alpha:o,matrix:l,alignment:u,native:c},Object.keys(i).forEach(function(t){return void 0===i[t]&&delete i[t]})}i=Object.assign({width:0,texture:e.Texture.WHITE,color:i&&i.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:t.LINE_CAP.BUTT,join:t.LINE_JOIN.MITER,miterLimit:10},i),this.currentPath&&this.startPoly();var p=i.width>0&&i.alpha>0;return p?(i.matrix&&(i.matrix=i.matrix.clone(),i.matrix.invert()),Object.assign(this._lineStyle,{visible:p},i)):this._lineStyle.reset(),this},a.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new i.Polygon,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new i.Polygon,this.currentPath.closeStroke=!1},a.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},a.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},a.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return r===t&&n===e||i.push(t,e),this},a.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},a.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),M.curveTo(t,e,i,r,n),this},a.prototype.bezierCurveTo=function(t,e,i,r,n,s){return this._initCurve(),w.curveTo(t,e,i,r,n,s,this.currentPath.points),this},a.prototype.arcTo=function(t,e,i,r,n){this._initCurve(t,e);var s=this.currentPath.points,a=S.curveTo(t,e,i,r,n,s);if(a){var h=a.cx,o=a.cy,l=a.radius,u=a.startAngle,c=a.endAngle,p=a.anticlockwise;this.arc(h,o,l,u,c,p)}return this},a.prototype.arc=function(t,e,r,n,s,a){if(void 0===a&&(a=!1),n===s)return this;if(!a&&s<=n?s+=i.PI_2:a&&n<=s&&(n+=i.PI_2),0===s-n)return this;var h=t+Math.cos(n)*r,o=e+Math.sin(n)*r,l=this._geometry.closePointEps,u=this.currentPath?this.currentPath.points:null;if(u){var c=Math.abs(u[u.length-2]-h),p=Math.abs(u[u.length-1]-o);c<l&&p<l||u.push(h,o)}else this.moveTo(h,o),u=this.currentPath.points;return S.arc(h,o,t,e,r,n,s,a,u),this},a.prototype.beginFill=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=1),this.beginTextureFill({texture:e.Texture.WHITE,color:t,alpha:i})},a.prototype.beginTextureFill=function(t){if(t instanceof e.Texture){r.deprecation("v5.2.0","Please use object-based options for Graphics#beginTextureFill");var i=arguments,n=i[0],s=i[1],a=i[2],h=i[3];t={texture:n,color:s,alpha:a,matrix:h},Object.keys(t).forEach(function(e){return void 0===t[e]&&delete t[e]})}t=Object.assign({texture:e.Texture.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var o=t.alpha>0;return o?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:o},t)):this._fillStyle.reset(),this},a.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},a.prototype.drawRect=function(t,e,r,n){return this.drawShape(new i.Rectangle(t,e,r,n))},a.prototype.drawRoundedRect=function(t,e,r,n,s){return this.drawShape(new i.RoundedRectangle(t,e,r,n,s))},a.prototype.drawCircle=function(t,e,r){return this.drawShape(new i.Circle(t,e,r))},a.prototype.drawEllipse=function(t,e,r,n){return this.drawShape(new i.Ellipse(t,e,r,n))},a.prototype.drawPolygon=function(){for(var t,e=arguments,r=[],n=0;n<arguments.length;n++)r[n]=e[n];var s=!0,a=r[0];a.points?(s=a.closeStroke,t=a.points):t=Array.isArray(r[0])?r[0]:r;var h=new i.Polygon(t);return h.closeStroke=s,this.drawShape(h),this},a.prototype.drawShape=function(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},a.prototype.drawStar=function(t,e,i,r,n,s){return void 0===s&&(s=0),this.drawPolygon(new P(t,e,i,r,n,s))},a.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},a.prototype.isFastRect=function(){var t=this._geometry.graphicsData;return 1===t.length&&t[0].shape.type===i.SHAPES.RECT&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)},a.prototype._render=function(t){this.finishPoly();var e=this._geometry,i=t.context.supports.uint32Indices;e.updateBatches(i),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))},a.prototype._populateBatches=function(){var t=this._geometry,e=this.blendMode,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(var n=0;n<i;n++){var s=t.batches[n],a=s.style.color,h=new Float32Array(this.vertexData.buffer,4*s.attribStart*2,2*s.attribSize),o=new Float32Array(t.uvsFloat32.buffer,4*s.attribStart*2,2*s.attribSize),l={vertexData:h,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*s.start,s.size),uvs:o,_batchRGB:r.hex2rgb(a),_tintRGB:a,_texture:s.style.texture,alpha:s.style.alpha,worldAlpha:1};this.batches[n]=l}},a.prototype._renderBatched=function(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var e=0,i=this.batches.length;e<i;e++){var r=this.batches[e];r.worldAlpha=this.worldAlpha*r.alpha,t.plugins[this.pluginName].render(r)}}},a.prototype._renderDirect=function(t){var e=this._resolveDirectShader(t),i=this._geometry,r=this.tint,n=this.worldAlpha,s=e.uniforms,a=i.drawCalls;s.translationMatrix=this.transform.worldTransform,s.tint[0]=(r>>16&255)/255*n,s.tint[1]=(r>>8&255)/255*n,s.tint[2]=(255&r)/255*n,s.tint[3]=n,t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(var h=0,o=a.length;h<o;h++)this._renderDrawCallDirect(t,i.drawCalls[h])},a.prototype._renderDrawCallDirect=function(t,e){for(var i=e.texArray,r=e.type,n=e.size,s=e.start,a=i.count,h=0;h<a;h++)t.texture.bind(i.elements[h],h);t.geometry.draw(r,n,s)},a.prototype._resolveDirectShader=function(t){var r=this.shader,n=this.pluginName;if(!r){if(!U[n]){for(var s=t.plugins.batch.MAX_TEXTURES,a=new Int32Array(s),h=0;h<s;h++)a[h]=h;var o={tint:new Float32Array([1,1,1,1]),translationMatrix:new i.Matrix,default:e.UniformGroup.from({uSamplers:a},!0)},l=t.plugins[n]._shader.program;U[n]=new e.Shader(l,o)}r=U[n]}return r},a.prototype._calculateBounds=function(){this.finishPoly();var t=this._geometry;if(t.graphicsData.length){var e=t.bounds,i=e.minX,r=e.minY,n=e.maxX,s=e.maxY;this._bounds.addFrame(this.transform,i,r,n,s)}},a.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,a._TEMP_POINT),this._geometry.containsPoint(a._TEMP_POINT)},a.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=r.hex2rgb(this.tint,N),e=0;e<this.batches.length;e++){var i=this.batches[e],n=i._batchRGB,s=(t[0]*n[0]*255<<16)+(t[1]*n[1]*255<<8)+(0|t[2]*n[2]*255);i._tintRGB=(s>>16)+(65280&s)+((255&s)<<16)}}},a.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var e=this.transform.worldTransform,i=e.a,r=e.b,n=e.c,s=e.d,a=e.tx,h=e.ty,o=this._geometry.points,l=this.vertexData,u=0,c=0;c<o.length;c+=2){var p=o[c],d=o[c+1];l[u++]=i*p+n*d+a,l[u++]=s*d+r*p+h}}},a.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0),this},a.prototype.setMatrix=function(t){return this._matrix=t,this},a.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},a.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},a.prototype.destroy=function(t){this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,s.prototype.destroy.call(this,t)},a._TEMP_POINT=new i.Point,a}(s.Container);return t.FillStyle=l,t.GRAPHICS_CURVES=o,t.Graphics=H,t.GraphicsData=C,t.GraphicsGeometry=R,t.LineStyle=B,t.graphicsUtils=A,t}({},PIXI,PIXI,PIXI.utils,PIXI,PIXI);Object.assign(this.PIXI,_pixi_graphics);
//# sourceMappingURL=graphics.min.js.map
{
"name": "@pixi/graphics",
"version": "5.3.4",
"version": "5.3.5",
"main": "lib/graphics.js",

@@ -27,10 +27,10 @@ "module": "lib/graphics.es.js",

"dependencies": {
"@pixi/constants": "5.3.4",
"@pixi/core": "5.3.4",
"@pixi/display": "5.3.4",
"@pixi/math": "5.3.4",
"@pixi/sprite": "5.3.4",
"@pixi/utils": "5.3.4"
"@pixi/constants": "5.3.5",
"@pixi/core": "5.3.5",
"@pixi/display": "5.3.5",
"@pixi/math": "5.3.5",
"@pixi/sprite": "5.3.5",
"@pixi/utils": "5.3.5"
},
"gitHead": "f6a5f18e9d5a9b6e57d7bdcb0c369f88cd83530c"
"gitHead": "b5353da2693f0112230cd2b1be581f9bff0ce2a1"
}

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 too big to display

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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