From 425f33cd5058f0fa66d7e1b33259bd0e59a9f1f5 Mon Sep 17 00:00:00 2001 From: Martin Valigursky Date: Tue, 9 Jul 2024 15:44:29 +0100 Subject: [PATCH] rebuilt 4.2 build with emissive changes like the other builds --- build/playcanvas-spine.4.2.js | 1 + build/playcanvas-spine.4.2.min.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/playcanvas-spine.4.2.js b/build/playcanvas-spine.4.2.js index 9f50581..f3aa938 100644 --- a/build/playcanvas-spine.4.2.js +++ b/build/playcanvas-spine.4.2.js @@ -12862,6 +12862,7 @@ var spine = (function (pc) { var material = new pc__namespace.StandardMaterial(); material.emissiveMap = texture; material.emissiveVertexColor = true; + material.emissive = pc__namespace.Color.WHITE; material.opacityMap = texture; material.opacityVertexColor = true; material.depthWrite = false; diff --git a/build/playcanvas-spine.4.2.min.js b/build/playcanvas-spine.4.2.min.js index 8b26867..4c9dfbb 100644 --- a/build/playcanvas-spine.4.2.min.js +++ b/build/playcanvas-spine.4.2.min.js @@ -1 +1 @@ -var spine=function(t){"use strict";function e(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var n,a,r=e(t);function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,a=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){o=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function w(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,e||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function b(t,e,n){return e=u(e),d(t,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(e,n||[],u(t).constructor):e.apply(t,n))}var x=h((function t(){s(this,t),l(this,"array",new Array)}),[{key:"add",value:function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e}},{key:"contains",value:function(t){return null!=this.array[0|t]}},{key:"remove",value:function(t){this.array[0|t]=void 0}},{key:"clear",value:function(){this.array.length=0}}]),I=h((function t(){s(this,t),l(this,"entries",{}),l(this,"size",0)}),[{key:"add",value:function(t){var e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}},{key:"addAll",value:function(t){for(var e=this.size,n=0,a=t.length;n0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;s(this,t),l(this,"r",void 0),l(this,"g",void 0),l(this,"b",void 0),l(this,"a",void 0),this.r=e,this.g=n,this.b=a,this.a=r}return h(t,[{key:"set",value:function(t,e,n,a){return this.r=t,this.g=e,this.b=n,this.a=a,this.clamp()}},{key:"setFromColor",value:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}},{key:"setFromString",value:function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=8!=t.length?1:parseInt(t.substr(6,2),16)/255,this}},{key:"add",value:function(t,e,n,a){return this.r+=t,this.g+=e,this.b+=n,this.a+=a,this.clamp()}},{key:"clamp",value:function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}},{key:"toRgb888",value:function(){var t=function(t){return("0"+(255*t).toString(16)).slice(-2)};return Number("0x"+t(this.r)+t(this.g)+t(this.b))}}],[{key:"rgba8888ToColor",value:function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}},{key:"rgb888ToColor",value:function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}},{key:"fromString",value:function(e){return(new t).setFromString(e)}}])}();l(E,"WHITE",new(n=E)(1,1,1,1)),l(E,"RED",new n(1,0,0,1)),l(E,"GREEN",new n(0,1,0,1)),l(E,"BLUE",new n(0,0,1,1)),l(E,"MAGENTA",new n(1,0,1,1));var A=function(){function t(){s(this,t)}return h(t,null,[{key:"clamp",value:function(t,e,n){return tn?n:t}},{key:"cosDeg",value:function(e){return Math.cos(e*t.degRad)}},{key:"sinDeg",value:function(e){return Math.sin(e*t.degRad)}},{key:"atan2Deg",value:function(e,n){return Math.atan2(e,n)*t.degRad}},{key:"signum",value:function(t){return t>0?1:t<0?-1:0}},{key:"toInt",value:function(t){return t>0?Math.floor(t):Math.ceil(t)}},{key:"cbrt",value:function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}},{key:"randomTriangular",value:function(e,n){return t.randomTriangularWith(e,n,.5*(e+n))}},{key:"randomTriangularWith",value:function(t,e,n){var a=Math.random(),r=e-t;return a<=(n-t)/r?t+Math.sqrt(a*r*(n-t)):e-Math.sqrt((1-a)*r*(e-n))}},{key:"isPowerOfTwo",value:function(t){return t&&0==(t&t-1)}}])}();a=A,l(A,"PI",3.1415927),l(A,"PI2",2*a.PI),l(A,"invPI2",1/a.PI2),l(A,"radiansToDegrees",180/a.PI),l(A,"radDeg",a.radiansToDegrees),l(A,"degreesToRadians",a.PI/180),l(A,"degRad",a.degreesToRadians);var S=h((function t(){s(this,t)}),[{key:"apply",value:function(t,e,n){return t+(e-t)*this.applyInternal(n)}}]),R=function(t){function e(t){var n;return s(this,e),l(n=b(this,e),"power",2),n.power=t,n}return c(e,t),h(e,[{key:"applyInternal",value:function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}}])}(S),T=function(t){function e(t){return s(this,e),b(this,e,[t])}return c(e,t),h(e,[{key:"applyInternal",value:function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}])}(R),C=function(){function t(){s(this,t)}return h(t,null,[{key:"arrayCopy",value:function(t,e,n,a,r){for(var i=e,s=a;i2&&void 0!==arguments[2]?arguments[2]:0,a=t.length;if(a==e)return t;if(t.length=e,a2&&void 0!==arguments[2]?arguments[2]:0;return e.length>=n?e:t.setArraySize(e,n,a)}},{key:"newArray",value:function(t,e){for(var n=new Array(t),a=0;a0?this.items.pop():this.instantiator()}},{key:"free",value:function(t){t.reset&&t.reset(),this.items.push(t)}},{key:"freeAll",value:function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s(this,t),l(this,"x",void 0),l(this,"y",void 0),this.x=e,this.y=n}),[{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"length",value:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}},{key:"normalize",value:function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}}]),Y=h((function t(){s(this,t),l(this,"maxDelta",.064),l(this,"framesPerSecond",0),l(this,"delta",0),l(this,"totalTime",0),l(this,"lastTime",Date.now()/1e3),l(this,"frameCount",0),l(this,"frameTime",0)}),[{key:"update",value:function(){var t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}]),X=h((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;s(this,t),l(this,"values",void 0),l(this,"addedValues",0),l(this,"lastValue",0),l(this,"mean",0),l(this,"dirty",!0),this.values=new Array(e)}),[{key:"hasEnoughData",value:function(){return this.addedValues>=this.values.length}},{key:"addValue",value:function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}},{key:"getMean",value:function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*i;var s=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(l){for(var c=0,u=0,f=0;f0&&(h=o);for(var O=t.bone,N=O.worldX,L=O.worldY,_=O.a,B=O.b,D=O.c,V=O.d,U=e,q=r;q=this.regions.length&&(n=this.regions.length-1);var a=this.regions[n];e.region!=a&&(e.region=a,e.updateRegion())}},{key:"getPath",value:function(t,e){for(var n=t,a=(this.start+e).toString(),r=this.digits-a.length;r>0;r--)n+="0";return n+=a}}],[{key:"nextID",value:function(){return t._nextID++}}])}();l(_,"_nextID",0),function(t){t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse"}(L||(L={}));var B=[L.hold,L.once,L.loop,L.pingpong,L.onceReverse,L.loopReverse,L.pingpongReverse];function D(t,e,n){return e=u(e),d(t,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(e,n||[],u(t).constructor):e.apply(t,n))}var V,U,q=h((function t(e,n,a){if(s(this,t),l(this,"name",void 0),l(this,"timelines",[]),l(this,"timelineIds",new I),l(this,"duration",void 0),!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(n),this.duration=a}),[{key:"setTimelines",value:function(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e0&&(e%=this.duration));for(var h=this.timelines,l=0,c=h.length;le)return a-1;return n-1}},{key:"search",value:function(t,e,n){for(var a=t.length,r=n;re)return r-n;return a-n}}]),z=function(t){function e(t,n,a){var r;return s(this,e),l(r=D(this,e,[t,a]),"curves",void 0),r.curves=C.newFloatArray(t+18*n),r.curves[t-1]=1,r}return c(e,t),h(e,[{key:"setLinear",value:function(t){this.curves[t]=0}},{key:"setStepped",value:function(t){this.curves[t]=1}},{key:"shrink",value:function(t){var e=this.getFrameCount()+18*t;if(this.curves.length>e){var n=C.newFloatArray(e);C.arrayCopy(this.curves,0,n,0,e),this.curves=n}}},{key:"setBezier",value:function(t,e,n,a,r,i,s,o,h,l,c){var u=this.curves,f=this.getFrameCount()+18*t;0==n&&(u[e]=2+f);for(var d=.03*(a-2*i+o),v=.03*(r-2*s+h),m=.006*(3*(i-o)-a+l),p=.006*(3*(s-h)-r+c),g=2*d+m,y=2*v+p,k=.3*(i-a)+d+.16666667*m,w=.3*(s-r)+v+.16666667*p,b=a+k,x=r+w,I=f+18;ft){var i=this.frames[e],s=this.frames[e+n];return s+(t-i)/(r[a]-i)*(r[a+1]-s)}var o=a+18;for(a+=2;a=t){var h=r[a-2],l=r[a-1];return l+(t-h)/(r[a]-h)*(r[a+1]-l)}e+=this.getFrameEntries();var c=r[o-2],u=r[o-1];return u+(t-c)/(this.frames[e]-c)*(this.frames[e+n]-u)}}])}(G),j=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,[a]])}return c(e,t),h(e,[{key:"getFrameEntries",value:function(){return 2}},{key:"setFrame",value:function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+1]=n}},{key:"getCurveValue",value:function(t){for(var e=this.frames,n=e.length-2,a=2;a<=n;a+=2)if(e[a]>t){n=a-2;break}var r=this.curves[n>>1];switch(r){case 0:var i=e[n],s=e[n+1];return s+(t-i)/(e[n+2]-i)*(e[n+2+1]-s);case 1:return e[n+1]}return this.getBezierValue(t,n,1,r-2)}},{key:"getRelativeValue",value:function(t,e,n,a,r){if(t>2];switch(m){case 0:var p=h[v];u=h[v+1],f=h[v+2],d=h[v+3];var g=(n-p)/(h[v+4]-p);u+=(h[v+4+1]-u)*g,f+=(h[v+4+2]-f)*g,d+=(h[v+4+3]-d)*g;break;case 1:u=h[v+1],f=h[v+2],d=h[v+3];break;default:u=this.getBezierValue(n,v,1,m-2),f=this.getBezierValue(n,v,2,m+18-2),d=this.getBezierValue(n,v,3,m+36-2)}if(1==r)l.r=u,l.g=f,l.b=d;else{if(i==V.setup){var y=o.data.color;l.r=y.r,l.g=y.g,l.b=y.b}l.r+=(u-l.r)*r,l.g+=(f-l.g)*r,l.b+=(d-l.b)*r}}}}}])}(z),ht=function(t){function e(t,n,a){var r;return s(this,e),l(r=D(this,e,[t,n,W.alpha+"|"+a]),"slotIndex",0),r.slotIndex=a,r}return c(e,t),h(e,[{key:"apply",value:function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.color;if(n>3];switch(b){case 0:var x=h[w];d=h[w+1],v=h[w+2],m=h[w+3],p=h[w+4],g=h[w+5],y=h[w+6],k=h[w+7];var I=(n-x)/(h[w+8]-x);d+=(h[w+8+1]-d)*I,v+=(h[w+8+2]-v)*I,m+=(h[w+8+3]-m)*I,p+=(h[w+8+4]-p)*I,g+=(h[w+8+5]-g)*I,y+=(h[w+8+6]-y)*I,k+=(h[w+8+7]-k)*I;break;case 1:d=h[w+1],v=h[w+2],m=h[w+3],p=h[w+4],g=h[w+5],y=h[w+6],k=h[w+7];break;default:d=this.getBezierValue(n,w,1,b-2),v=this.getBezierValue(n,w,2,b+18-2),m=this.getBezierValue(n,w,3,b+36-2),p=this.getBezierValue(n,w,4,b+54-2),g=this.getBezierValue(n,w,5,b+72-2),y=this.getBezierValue(n,w,6,b+90-2),k=this.getBezierValue(n,w,7,b+108-2)}if(1==r)l.set(d,v,m,p),c.r=g,c.g=y,c.b=k;else{if(i==V.setup){l.setFromColor(o.data.color);var E=o.data.darkColor;c.r=E.r,c.g=E.g,c.b=E.b}l.add((d-l.r)*r,(v-l.g)*r,(m-l.b)*r,(p-l.a)*r),c.r+=(g-c.r)*r,c.g+=(y-c.g)*r,c.b+=(k-c.b)*r}}}}}])}(z),ct=function(t){function e(t,n,a){var r;return s(this,e),l(r=D(this,e,[t,n,[W.rgb+"|"+a,W.rgb2+"|"+a]]),"slotIndex",0),r.slotIndex=a,r}return c(e,t),h(e,[{key:"getFrameEntries",value:function(){return 7}},{key:"setFrame",value:function(t,e,n,a,r,i,s,o){t*=7,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=a,this.frames[t+3]=r,this.frames[t+4]=i,this.frames[t+5]=s,this.frames[t+6]=o}},{key:"apply",value:function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames,l=o.color,c=o.darkColor;if(nt){var i=this.frames[e];return n[a+1]*(t-i)/(n[a]-i)}var s=a+18;for(a+=2;a=t){var o=n[a-2],h=n[a-1];return h+(t-o)/(n[a]-o)*(n[a+1]-h)}var l=n[s-2],c=n[s-1];return c+(1-c)*(t-l)/(this.frames[e+this.getFrameEntries()]-l)}},{key:"apply",value:function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h&&h instanceof N&&h.timelineAttachment==this.attachment){var l=o.deform;0==l.length&&(i=V.setup);var c=this.vertices,u=c[0].length,f=this.frames;if(n=f[f.length-1]){var p=c[f.length-1];if(1==r)if(i==V.add){var g=h;if(g.bones)for(var y=0;yn)this.apply(t,e,Number.MAX_VALUE,a,r,i,s),e=-1;else if(e>=o[h-1])return;if(!(n0&&o[l-1]==c;)l--;for(;l=o[l];l++)a.push(this.events[l])}}}}])}(G);l(dt,"propertyIds",[""+W.event]);var vt=function(t){function e(t){var n;return s(this,e),l(n=D(this,e,[t,e.propertyIds]),"drawOrders",void 0),n.drawOrders=new Array(t),n}return c(e,t),h(e,[{key:"getFrameCount",value:function(){return this.frames.length}},{key:"setFrame",value:function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n}},{key:"apply",value:function(t,e,n,a,r,i,s){if(s!=U.mixOut)if(n>2];switch(d){case 0:var v=h[f];l=h[f+1],c=h[f+2],u=h[f+3];var m=(n-v)/(h[f+4]-v);l+=(h[f+4+1]-l)*m,c+=(h[f+4+2]-c)*m,u+=(h[f+4+3]-u)*m;break;case 1:l=h[f+1],c=h[f+2],u=h[f+3];break;default:l=this.getBezierValue(n,f,1,d-2),c=this.getBezierValue(n,f,2,d+18-2),u=this.getBezierValue(n,f,3,d+36-2)}if(i==V.setup){var p=o.data;o.mixRotate=p.mixRotate+(l-p.mixRotate)*r,o.mixX=p.mixX+(c-p.mixX)*r,o.mixY=p.mixY+(u-p.mixY)*r}else o.mixRotate+=(l-o.mixRotate)*r,o.mixX+=(c-o.mixX)*r,o.mixY+=(u-o.mixY)*r}}}}])}(z),wt=function(t){function e(t,n,a,r){var i;return s(this,e),l(i=D(this,e,[t,n,r+"|"+a]),"constraintIndex",0),i.constraintIndex=a,i}return c(e,t),h(e,[{key:"apply",value:function(t,e,n,a,r,i,s){var o;if(-1==this.constraintIndex){var h,l=n>=this.frames[0]?this.getCurveValue(n):0,c=k(t.physicsConstraints);try{for(c.s();!(h=c.n()).done;){var u=h.value;u.active&&this.global(u.data)&&this.set(u,this.getAbsoluteValue2(n,r,i,this.get(u),this.setup(u),l))}}catch(t){c.e(t)}finally{c.f()}}else(o=t.physicsConstraints[this.constraintIndex]).active&&this.set(o,this.getAbsoluteValue(n,r,i,this.get(o),this.setup(o)))}}])}(j),bt=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,a,W.physicsConstraintInertia])}return c(e,t),h(e,[{key:"setup",value:function(t){return t.data.inertia}},{key:"get",value:function(t){return t.inertia}},{key:"set",value:function(t,e){t.inertia=e}},{key:"global",value:function(t){return t.inertiaGlobal}}])}(wt),xt=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,a,W.physicsConstraintStrength])}return c(e,t),h(e,[{key:"setup",value:function(t){return t.data.strength}},{key:"get",value:function(t){return t.strength}},{key:"set",value:function(t,e){t.strength=e}},{key:"global",value:function(t){return t.strengthGlobal}}])}(wt),It=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,a,W.physicsConstraintDamping])}return c(e,t),h(e,[{key:"setup",value:function(t){return t.data.damping}},{key:"get",value:function(t){return t.damping}},{key:"set",value:function(t,e){t.damping=e}},{key:"global",value:function(t){return t.dampingGlobal}}])}(wt),Et=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,a,W.physicsConstraintMass])}return c(e,t),h(e,[{key:"setup",value:function(t){return 1/t.data.massInverse}},{key:"get",value:function(t){return 1/t.massInverse}},{key:"set",value:function(t,e){t.massInverse=1/e}},{key:"global",value:function(t){return t.massGlobal}}])}(wt),At=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,a,W.physicsConstraintWind])}return c(e,t),h(e,[{key:"setup",value:function(t){return t.data.wind}},{key:"get",value:function(t){return t.wind}},{key:"set",value:function(t,e){t.wind=e}},{key:"global",value:function(t){return t.windGlobal}}])}(wt),St=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,a,W.physicsConstraintGravity])}return c(e,t),h(e,[{key:"setup",value:function(t){return t.data.gravity}},{key:"get",value:function(t){return t.gravity}},{key:"set",value:function(t,e){t.gravity=e}},{key:"global",value:function(t){return t.gravityGlobal}}])}(wt),Rt=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,a,W.physicsConstraintMix])}return c(e,t),h(e,[{key:"setup",value:function(t){return t.data.mix}},{key:"get",value:function(t){return t.mix}},{key:"set",value:function(t,e){t.mix=e}},{key:"global",value:function(t){return t.mixGlobal}}])}(wt),Tt=function(t){function e(t,n){var a;return s(this,e),l(a=D(this,e,[t,e.propertyIds]),"constraintIndex",void 0),a.constraintIndex=n,a}return c(e,t),h(e,[{key:"getFrameCount",value:function(){return this.frames.length}},{key:"setFrame",value:function(t,e){this.frames[t]=e}},{key:"apply",value:function(t,e,n,a,r,i,s){var o;if(-1==this.constraintIndex||(o=t.physicsConstraints[this.constraintIndex]).active){var h=this.frames;if(e>n)this.apply(t,e,Number.MAX_VALUE,[],r,i,s),e=-1;else if(e>=h[h.length-1])return;if(!(n=h[G.search1(h,e)+1]))if(null!=o)o.reset();else{var l,c=k(t.physicsConstraints);try{for(c.s();!(l=c.n()).done;){var u=l.value;u.active&&u.reset()}}catch(t){c.e(t)}finally{c.f()}}}}}])}(G);l(Tt,"propertyIds",[W.physicsConstraintReset.toString()]);var Ct=function(t){function e(t,n,a){var r;return s(this,e),l(r=D(this,e,[t,[W.sequence+"|"+n+"|"+a.sequence.id]]),"slotIndex",void 0),l(r,"attachment",void 0),r.slotIndex=n,r.attachment=a,r}return c(e,t),h(e,[{key:"getFrameEntries",value:function(){return e.ENTRIES}},{key:"getSlotIndex",value:function(){return this.slotIndex}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setFrame",value:function(t,n,a,r,i){var s=this.frames;s[t*=e.ENTRIES]=n,s[t+e.MODE]=a|r<<4,s[t+e.DELAY]=i}},{key:"apply",value:function(t,n,a,r,i,s,o){var h=t.slots[this.slotIndex];if(h.bone.active){var l=h.attachment,c=this.attachment;if(l==c||l instanceof N&&l.timelineAttachment==c){var u=this.frames;if(a>4,g=this.attachment.sequence.regions.length,y=B[15&v];if(y!=L.hold)switch(p+=(a-d)/m+1e-5|0,y){case L.once:p=Math.min(g-1,p);break;case L.loop:p%=g;break;case L.pingpong:var k=(g<<1)-2;(p=0==k?0:p%k)>=g&&(p=k-p);break;case L.onceReverse:p=Math.max(g-1-p,0);break;case L.loopReverse:p=g-1-p%g;break;case L.pingpongReverse:var w=(g<<1)-2;(p=0==w?0:(p+g-1)%w)>=g&&(p=w-p)}h.sequenceIndex=p}}}}}}])}(G);l(Ct,"ENTRIES",3),l(Ct,"MODE",1),l(Ct,"DELAY",2);var Mt=function(){function t(e){s(this,t),l(this,"data",void 0),l(this,"tracks",new Array),l(this,"timeScale",1),l(this,"unkeyedState",0),l(this,"events",new Array),l(this,"listeners",new Array),l(this,"queue",new Yt(this)),l(this,"propertyIDs",new I),l(this,"animationsChanged",!1),l(this,"trackEntryPool",new F((function(){return new Pt}))),this.data=e}return h(t,[{key:"update",value:function(t){t*=this.timeScale;for(var e=this.tracks,n=0,a=e.length;n0){if(r.delay-=i,r.delay>0)continue;i=-r.delay,r.delay=0}var s=r.next;if(s){var o=r.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*s.timeScale,r.trackTime+=i,this.setCurrent(n,s,!0);s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){e[n]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=i}}this.queue.drain()}},{key:"updateMixingFrom",value:function(t,e){var n=t.mixingFrom;if(!n)return!0;var a=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),a):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)}},{key:"apply",value:function(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,n=this.tracks,a=!1,r=0,i=n.length;r0)){a=!0;var o=0==r?V.first:s.mixBlend,h=s.alpha;s.mixingFrom?h*=this.applyMixingFrom(s,t,o):s.trackTime>=s.trackEnd&&!s.next&&(h=0);var l=h>=s.alphaAttachmentThreshold,c=s.animationLast,u=s.getAnimationTime(),f=u,d=e;s.reverse&&(f=s.animation.duration-f,d=null);var v=s.animation.timelines,m=v.length;if(0==r&&1==h||o==V.add){0==r&&(l=!0);for(var p=0;p1&&(r=1),n!=V.first&&(n=a.mixBlend));var i=r=a.alphaAttachmentThreshold):(C.webkit602BugfixHelper(E,n),s&&b instanceof vt&&I==V.setup&&(x=U.mixIn),b.apply(e,u,d,v,E,I,x))}}return t.mixDuration>0&&this.queueEvents(a,f),this.events.length=0,a.nextAnimationLast=f,a.nextTrackLast=a.trackTime,r}},{key:"applyAttachmentTimeline",value:function(t,e,n,a,r){var i=e.slots[t.slotIndex];i.bone.active&&(n=0,g=d>=0;Math.abs(v)<=90&&A.signum(v)!=A.signum(f)&&(Math.abs(d-m)>180?(u+=360*A.signum(d),g=p):0!=m?u-=360*A.signum(d):g=p),g!=p&&(u+=360*A.signum(d)),i[s]=u}i[s+1]=f,h.rotation=l+u*a}}else t.apply(e,0,n,null,1,r,U.mixIn)}},{key:"queueEvents",value:function(t,e){for(var n=t.animationStart,a=t.animationEnd,r=a-n,i=t.trackLast%r,s=this.events,o=0,h=s.length;oa||this.queue.event(t,l)}var c=!1;if(t.loop)if(0==r)c=!0;else{var u=Math.floor(t.trackTime/r);c=u>0&&u>Math.floor(t.trackLast/r)}else c=e>=a&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(e){this.queue.end(e),this.clearNext(e);for(var n=e;;){var a=n.mixingFrom;if(!a)break;this.queue.end(a),n.mixingFrom=null,n.mixingTo=null,n=a}this.tracks[e.trackIndex]=null,this.queue.drain()}}}},{key:"setCurrent",value:function(t,e,n){var a=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,a&&(n&&this.queue.interrupt(a),e.mixingFrom=a,a.mixingTo=e,e.mixTime=0,a.mixingFrom&&a.mixDuration>0&&(e.interruptAlpha*=Math.min(1,a.mixTime/a.mixDuration)),a.timelinesRotation.length=0),this.queue.start(e)}},{key:"setAnimation",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=this.data.skeletonData.findAnimation(e);if(!a)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,a,n)}},{key:"setAnimationWith",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)throw new Error("animation cannot be null.");var a=!0,r=this.expandToIndex(t);r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,a=!1):this.clearNext(r));var i=this.trackEntry(t,e,n,r);return this.setCurrent(t,i,a),this.queue.drain(),i}},{key:"addAnimation",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,n,a)}},{key:"addAnimationWith",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;var i=this.trackEntry(t,e,n,r);return r?(r.next=i,i.previous=r,a<=0&&(a+=r.getTrackComplete()-i.mixDuration)):(this.setCurrent(t,i,!0),this.queue.drain()),i.delay=a,i}},{key:"setEmptyAnimation",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=this.setAnimationWith(e,t.emptyAnimation(),!1);return a.mixDuration=n,a.trackEnd=n,a}},{key:"addEmptyAnimation",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.addAnimationWith(e,t.emptyAnimation(),!1,a);return a<=0&&(r.delay+=r.mixDuration-n),r.mixDuration=n,r.trackEnd=n,r}},{key:"setEmptyAnimations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,a=this.tracks.length;n0){r[h]=Bt,i[h]=u;continue t}break}r[h]=_t}else r[h]=Ot}}},{key:"getCurrent",value:function(t){return t>=this.tracks.length?null:this.tracks[t]}},{key:"addListener",value:function(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}},{key:"removeListener",value:function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}},{key:"clearListeners",value:function(){this.listeners.length=0}},{key:"clearListenerNotifications",value:function(){this.queue.clear()}}],[{key:"emptyAnimation",value:function(){return t._emptyAnimation}}])}();l(Mt,"_emptyAnimation",new q("",[],0));var Ft,Pt=h((function t(){s(this,t),l(this,"animation",null),l(this,"previous",null),l(this,"next",null),l(this,"mixingFrom",null),l(this,"mixingTo",null),l(this,"listener",null),l(this,"trackIndex",0),l(this,"loop",!1),l(this,"holdPrevious",!1),l(this,"reverse",!1),l(this,"shortestRotation",!1),l(this,"eventThreshold",0),l(this,"mixAttachmentThreshold",0),l(this,"alphaAttachmentThreshold",0),l(this,"mixDrawOrderThreshold",0),l(this,"animationStart",0),l(this,"animationEnd",0),l(this,"animationLast",0),l(this,"nextAnimationLast",0),l(this,"delay",0),l(this,"trackTime",0),l(this,"trackLast",0),l(this,"nextTrackLast",0),l(this,"trackEnd",0),l(this,"timeScale",0),l(this,"alpha",0),l(this,"mixTime",0),l(this,"_mixDuration",0),l(this,"interruptAlpha",0),l(this,"totalAlpha",0),l(this,"mixBlend",V.replace),l(this,"timelineMode",new Array),l(this,"timelineHoldMix",new Array),l(this,"timelinesRotation",new Array)}),[{key:"mixDuration",get:function(){return this._mixDuration},set:function(t){this._mixDuration=t}},{key:"setMixDurationWithDelay",value:function(t,e){this._mixDuration=t,null!=this.previous&&e<=0&&(e+=this.previous.getTrackComplete()-t),this.delay=e}},{key:"reset",value:function(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}},{key:"getAnimationTime",value:function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}},{key:"setAnimationLast",value:function(t){this.animationLast=t,this.nextAnimationLast=t}},{key:"isComplete",value:function(){return this.trackTime>=this.animationEnd-this.animationStart}},{key:"resetRotationDirections",value:function(){this.timelinesRotation.length=0}},{key:"getTrackComplete",value:function(){var t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime=0}}]),Yt=h((function t(e){s(this,t),l(this,"objects",[]),l(this,"drainDisabled",!1),l(this,"animState",void 0),this.animState=e}),[{key:"start",value:function(t){this.objects.push(Ft.start),this.objects.push(t),this.animState.animationsChanged=!0}},{key:"interrupt",value:function(t){this.objects.push(Ft.interrupt),this.objects.push(t)}},{key:"end",value:function(t){this.objects.push(Ft.end),this.objects.push(t),this.animState.animationsChanged=!0}},{key:"dispose",value:function(t){this.objects.push(Ft.dispose),this.objects.push(t)}},{key:"complete",value:function(t){this.objects.push(Ft.complete),this.objects.push(t)}},{key:"event",value:function(t,e){this.objects.push(Ft.event),this.objects.push(t),this.objects.push(e)}},{key:"drain",value:function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,n=0;n0&&u&&u.length>0&&(f.names=c,f.values=u,c=null,u=null),f.u=f.x/h.width,f.v=f.y/h.height,90==f.degrees?(f.u2=(f.x+f.height)/h.width,f.v2=(f.y+f.width)/h.height):(f.u2=(f.x+f.width)/h.width,f.v2=(f.y+f.height)/h.height),this.regions.push(f)}else{for(h=new Qt(o.trim());0!=n.readEntry(a,o=n.readLine());){var g=r[a[0]];g&&g(h)}this.pages.push(h)}}),[{key:"findRegion",value:function(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:"",a=k(this.pages);try{for(a.s();!(e=a.n()).done;){var r=e.value;r.setTexture(t.get(n+r.name))}}catch(t){a.e(t)}finally{a.f()}}},{key:"dispose",value:function(){for(var t=0;t=this.lines.length?null:this.lines[this.index++]}},{key:"readEntry",value:function(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;var n=e.indexOf(":");if(-1==n)return 0;t[0]=e.substr(0,n).trim();for(var a=1,r=n+1;;a++){var i=e.indexOf(",",r);if(-1==i)return t[a]=e.substr(r).trim(),a;if(t[a]=e.substr(r,i-r).trim(),r=i+1,4==a)return 4}}}]),Qt=h((function t(e){s(this,t),l(this,"name",void 0),l(this,"minFilter",Gt.Nearest),l(this,"magFilter",Gt.Nearest),l(this,"uWrap",zt.ClampToEdge),l(this,"vWrap",zt.ClampToEdge),l(this,"texture",null),l(this,"width",0),l(this,"height",0),l(this,"pma",!1),l(this,"regions",new Array),this.name=e}),[{key:"setTexture",value:function(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);var e,n=k(this.regions);try{for(n.s();!(e=n.n()).done;)e.value.texture=t}catch(t){n.e(t)}finally{n.f()}}}]),Zt=function(t){function e(t,n){var a,r,i,o;return s(this,e),r=this,i=u(i=e),l(a=d(r,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,[],u(r).constructor):i.apply(r,o)),"page",void 0),l(a,"name",void 0),l(a,"x",0),l(a,"y",0),l(a,"offsetX",0),l(a,"offsetY",0),l(a,"originalWidth",0),l(a,"originalHeight",0),l(a,"index",0),l(a,"degrees",0),l(a,"names",null),l(a,"values",null),a.page=t,a.name=n,t.regions.push(a),a}return c(e,t),h(e)}(Ht);var te=function(t){function e(t,n){var a,r,i,o;return s(this,e),r=this,o=[t],i=u(i=e),l(a=d(r,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,o||[],u(r).constructor):i.apply(r,o)),"region",null),l(a,"path",void 0),l(a,"regionUVs",[]),l(a,"uvs",[]),l(a,"triangles",[]),l(a,"color",new E(1,1,1,1)),l(a,"width",0),l(a,"height",0),l(a,"hullLength",0),l(a,"edges",[]),l(a,"parentMesh",null),l(a,"sequence",null),l(a,"tempColor",new E(0,0,0,0)),a.path=n,a}return c(e,t),h(e,[{key:"updateRegion",value:function(){if(!this.region)throw new Error("Region not set.");var t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=C.newFloatArray(t.length));var e=this.uvs,n=this.uvs.length,a=this.region.u,r=this.region.v,i=0,s=0;if(this.region instanceof Zt){var o=this.region,h=o.page,l=h.width,c=h.height;switch(o.degrees){case 90:a-=(o.originalHeight-o.offsetY-o.height)/l,r-=(o.originalWidth-o.offsetX-o.width)/c,i=o.originalHeight/l,s=o.originalWidth/c;for(var u=0;u= 0.");if(!n)throw new Error("name cannot be null.");this.index=e,this.name=n,this.parent=a}));!function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(re||(re={}));var oe=h((function t(e,n,a){if(s(this,t),l(this,"data",void 0),l(this,"skeleton",void 0),l(this,"parent",null),l(this,"children",new Array),l(this,"x",0),l(this,"y",0),l(this,"rotation",0),l(this,"scaleX",0),l(this,"scaleY",0),l(this,"shearX",0),l(this,"shearY",0),l(this,"ax",0),l(this,"ay",0),l(this,"arotation",0),l(this,"ascaleX",0),l(this,"ascaleY",0),l(this,"ashearX",0),l(this,"ashearY",0),l(this,"a",0),l(this,"b",0),l(this,"c",0),l(this,"d",0),l(this,"worldY",0),l(this,"worldX",0),l(this,"inherit",re.Normal),l(this,"sorted",!1),l(this,"active",!1),!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=n,this.parent=a,this.setToSetupPose()}),[{key:"isActive",value:function(){return this.active}},{key:"update",value:function(t){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}},{key:"updateWorldTransform",value:function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}},{key:"updateWorldTransformWith",value:function(t,e,n,a,r,i,s){this.ax=t,this.ay=e,this.arotation=n,this.ascaleX=a,this.ascaleY=r,this.ashearX=i,this.ashearY=s;var o=this.parent;if(!o){var h=this.skeleton,l=h.scaleX,c=h.scaleY,u=(n+i)*A.degRad,f=(n+90+s)*A.degRad;return this.a=Math.cos(u)*a*l,this.b=Math.cos(f)*r*l,this.c=Math.sin(u)*a*c,this.d=Math.sin(f)*r*c,this.worldX=t*l+h.x,void(this.worldY=e*c+h.y)}var d=o.a,v=o.b,m=o.c,p=o.d;switch(this.worldX=d*t+v*e+o.worldX,this.worldY=m*t+p*e+o.worldY,this.inherit){case re.Normal:var g=(n+i)*A.degRad,y=(n+90+s)*A.degRad,k=Math.cos(g)*a,w=Math.cos(y)*r,b=Math.sin(g)*a,x=Math.sin(y)*r;return this.a=d*k+v*b,this.b=d*w+v*x,this.c=m*k+p*b,void(this.d=m*w+p*x);case re.OnlyTranslation:var I=(n+i)*A.degRad,E=(n+90+s)*A.degRad;this.a=Math.cos(I)*a,this.b=Math.cos(E)*r,this.c=Math.sin(I)*a,this.d=Math.sin(E)*r;break;case re.NoRotationOrReflection:var S=d*d+m*m,R=0;S>1e-4?(S=Math.abs(d*p-v*m)/S,d/=this.skeleton.scaleX,v=(m/=this.skeleton.scaleY)*S,p=d*S,R=Math.atan2(m,d)*A.radDeg):(d=0,m=0,R=90-Math.atan2(p,v)*A.radDeg);var T=(n+i-R)*A.degRad,C=(n+s-R+90)*A.degRad,M=Math.cos(T)*a,F=Math.cos(C)*r,P=Math.sin(T)*a,Y=Math.sin(C)*r;this.a=d*M-v*P,this.b=d*F-v*Y,this.c=m*M+p*P,this.d=m*F+p*Y;break;case re.NoScale:case re.NoScaleOrReflection:n*=A.degRad;var X=Math.cos(n),O=Math.sin(n),N=(d*X+v*O)/this.skeleton.scaleX,L=(m*X+p*O)/this.skeleton.scaleY,_=Math.sqrt(N*N+L*L);_>1e-5&&(_=1/_),N*=_,L*=_,_=Math.sqrt(N*N+L*L),this.inherit==re.NoScale&&d*p-v*m<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(_=-_),n=Math.PI/2+Math.atan2(L,N);var B=Math.cos(n)*_,D=Math.sin(n)*_;i*=A.degRad,s=(90+s)*A.degRad;var V=Math.cos(i)*a,U=Math.cos(s)*r,q=Math.sin(i)*a,W=Math.sin(s)*r;this.a=N*V+B*q,this.b=N*U+B*W,this.c=L*V+D*q,this.d=L*U+D*W}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}},{key:"setToSetupPose",value:function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY,this.inherit=t.inherit}},{key:"updateAppliedTransform",value:function(){var t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*A.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*A.radDeg);var e,n,a,r,i=t.a,s=t.b,o=t.c,h=t.d,l=1/(i*h-s*o),c=h*l,u=s*l,f=o*l,d=i*l,v=this.worldX-t.worldX,m=this.worldY-t.worldY;if(this.ax=v*c-m*u,this.ay=m*d-v*f,this.inherit==re.OnlyTranslation)e=this.a,n=this.b,a=this.c,r=this.d;else{switch(this.inherit){case re.NoRotationOrReflection:var p=Math.abs(i*h-s*o)/(i*i+o*o),g=i/this.skeleton.scaleX;s=-o/this.skeleton.scaleY*p*this.skeleton.scaleX,c=(h=g*p*this.skeleton.scaleY)*(l=1/(i*h-s*o)),u=s*l;break;case re.NoScale:case re.NoScaleOrReflection:var y=A.cosDeg(this.rotation),k=A.sinDeg(this.rotation);i=(i*y+s*k)/this.skeleton.scaleX,o=(o*y+h*k)/this.skeleton.scaleY;var w=Math.sqrt(i*i+o*o);w>1e-5&&(w=1/w),i*=w,o*=w,w=Math.sqrt(i*i+o*o),this.inherit==re.NoScale&&l<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(w=-w);var b=A.PI/2+Math.atan2(o,i);s=Math.cos(b)*w,c=(h=Math.sin(b)*w)*(l=1/(i*h-s*o)),u=s*l,f=o*l,d=i*l}e=c*this.a-u*this.c,n=c*this.b-u*this.d,a=d*this.c-f*this.a,r=d*this.d-f*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(e*e+a*a),this.ascaleX>1e-4){var x=e*r-n*a;this.ascaleY=x/this.ascaleX,this.ashearY=-Math.atan2(e*n+a*r,x)*A.radDeg,this.arotation=Math.atan2(a,e)*A.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(n*n+r*r),this.ashearY=0,this.arotation=90-Math.atan2(r,n)*A.radDeg}},{key:"getWorldRotationX",value:function(){return Math.atan2(this.c,this.a)*A.radDeg}},{key:"getWorldRotationY",value:function(){return Math.atan2(this.d,this.b)*A.radDeg}},{key:"getWorldScaleX",value:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},{key:"getWorldScaleY",value:function(){return Math.sqrt(this.b*this.b+this.d*this.d)}},{key:"worldToLocal",value:function(t){var e=1/(this.a*this.d-this.b*this.c),n=t.x-this.worldX,a=t.y-this.worldY;return t.x=n*this.d*e-a*this.b*e,t.y=a*this.a*e-n*this.c*e,t}},{key:"localToWorld",value:function(t){var e=t.x,n=t.y;return t.x=e*this.a+n*this.b+this.worldX,t.y=e*this.c+n*this.d+this.worldY,t}},{key:"worldToParent",value:function(t){if(null==t)throw new Error("world cannot be null.");return null==this.parent?t:this.parent.worldToLocal(t)}},{key:"parentToWorld",value:function(t){if(null==t)throw new Error("world cannot be null.");return null==this.parent?t:this.parent.localToWorld(t)}},{key:"worldToLocalRotation",value:function(t){var e=A.sinDeg(t),n=A.cosDeg(t);return Math.atan2(this.a*e-this.c*n,this.d*n-this.b*e)*A.radDeg+this.rotation-this.shearX}},{key:"localToWorldRotation",value:function(t){t-=this.rotation-this.shearX;var e=A.sinDeg(t),n=A.cosDeg(t);return Math.atan2(n*this.c+e*this.d,n*this.a+e*this.b)*A.radDeg}},{key:"rotateWorld",value:function(t){t*=A.degRad;var e=Math.sin(t),n=Math.cos(t),a=this.a,r=this.b;this.a=n*a-e*this.c,this.b=n*r-e*this.d,this.c=e*a+n*this.c,this.d=e*r+n*this.d}}]),he=h((function t(e,n,a){s(this,t),l(this,"name",void 0),l(this,"order",void 0),l(this,"skinRequired",void 0),this.name=e,this.order=n,this.skinRequired=a})),le=h((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ce;s(this,t),l(this,"pathPrefix",""),l(this,"textureLoader",void 0),l(this,"downloader",void 0),l(this,"assets",{}),l(this,"errors",{}),l(this,"toLoad",0),l(this,"loaded",0),this.textureLoader=e,this.pathPrefix=n,this.downloader=a}),[{key:"start",value:function(t){return this.toLoad++,this.pathPrefix+t}},{key:"success",value:function(t,e,n){this.toLoad--,this.loaded++,this.assets[e]=n,t&&t(e,n)}},{key:"error",value:function(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)}},{key:"loadAll",value:function(){var t=this;return new Promise((function(e,n){requestAnimationFrame((function a(){t.isLoadingComplete()?t.hasErrors()?n(t.errors):e(t):requestAnimationFrame(a)}))}))}},{key:"setRawDataURI",value:function(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}},{key:"loadBinary",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadBinary(t,(function(a){e.success(n,t,a)}),(function(n,r){e.error(a,t,"Couldn't load binary ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"loadText",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadText(t,(function(a){e.success(n,t,a)}),(function(n,r){e.error(a,t,"Couldn't load text ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"loadJson",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadJson(t,(function(a){e.success(n,t,a)}),(function(n,r){e.error(a,t,"Couldn't load JSON ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"loadTexture",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(t=this.start(t),"undefined"!=typeof window&&"undefined"!=typeof navigator&&window.document){var r=new Image;r.crossOrigin="anonymous",r.onload=function(){e.success(n,t,e.textureLoader(r))},r.onerror=function(){e.error(a,t,"Couldn't load image: ".concat(t))},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),r.src=t}else fetch(t,{mode:"cors"}).then((function(n){return n.ok?n.blob():(e.error(a,t,"Couldn't load image: ".concat(t)),null)})).then((function(t){return t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null})).then((function(a){a&&e.success(n,t,e.textureLoader(a))}))}},{key:"loadTextureAtlas",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=arguments.length>3?arguments[3]:void 0,i=t.lastIndexOf("/"),s=i>=0?t.substring(0,i+1):"";t=this.start(t),this.downloader.downloadText(t,(function(i){try{var o,h=new Jt(i),l=h.pages.length,c=!1,u=k(h.pages);try{var f=function(){var i=o.value;e.loadTexture(r?r[i.name]:s+i.name,(function(a,r){c||(i.setTexture(r),0==--l&&e.success(n,t,h))}),(function(n,r){c||e.error(a,t,"Couldn't load texture atlas ".concat(t," page image: ").concat(n)),c=!0}))};for(u.s();!(o=u.n()).done;)f()}catch(t){u.e(t)}finally{u.f()}}catch(n){e.error(a,t,"Couldn't parse texture atlas ".concat(t,": ").concat(n.message))}}),(function(n,r){e.error(a,t,"Couldn't load texture atlas ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"get",value:function(t){return this.assets[this.pathPrefix+t]}},{key:"require",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];if(e)return e;var n=this.errors[t];throw Error("Asset not found: "+t+(n?"\n"+n:""))}},{key:"remove",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}},{key:"removeAll",value:function(){for(var t in this.assets){var e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}},{key:"isLoadingComplete",value:function(){return 0==this.toLoad}},{key:"getToLoad",value:function(){return this.toLoad}},{key:"getLoaded",value:function(){return this.loaded}},{key:"dispose",value:function(){this.removeAll()}},{key:"hasErrors",value:function(){return Object.keys(this.errors).length>0}},{key:"getErrors",value:function(){return this.errors}}]),ce=h((function t(){s(this,t),l(this,"callbacks",{}),l(this,"rawDataUris",{})}),[{key:"dataUriToString",value:function(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");var e=t.indexOf("base64,");return-1!=e?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}},{key:"base64ToUint8Array",value:function(t){for(var e=window.atob(t),n=e.length,a=new Uint8Array(n),r=0;r180?f-=360:f<-180&&(f+=360);var b=t.ascaleX,x=t.ascaleY;if(a||r){switch(t.inherit){case re.NoScale:case re.NoScaleOrReflection:d=e-t.worldX,v=n-t.worldY}var I=t.data.length*b;if(I>1e-4){var E=d*d+v*v;if(a&&EI*I){var S=(Math.sqrt(E)/I-1)*s+1;b*=S,i&&(x*=S)}}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*s,b,x,t.ashearX,t.ashearY)}},{key:"apply2",value:function(t,e,n,a,r,i,s,o,h){if(t.inherit==re.Normal&&e.inherit==re.Normal){var l=t.ax,c=t.ay,u=t.ascaleX,f=t.ascaleY,d=u,v=f,m=e.ascaleX,p=0,g=0,y=0;u<0?(u=-u,p=180,y=-1):(p=0,y=1),f<0&&(f=-f,y=-y),m<0?(m=-m,g=180):g=0;var k=e.ax,w=0,b=0,x=0,I=t.a,E=t.b,S=t.c,R=t.d,T=Math.abs(u-f)<=1e-4;!T||i?(w=0,b=I*k+t.worldX,x=S*k+t.worldY):(b=I*k+E*(w=e.ay)+t.worldX,x=S*k+R*w+t.worldY);var C=t.parent;if(!C)throw new Error("IK parent must itself have a parent.");I=C.a,E=C.b,S=C.c;var M,F,P=I*(R=C.d)-E*S,Y=b-C.worldX,X=x-C.worldY,O=(Y*R-X*E)*(P=Math.abs(P)<=1e-4?0:1/P)-l,N=(X*I-Y*S)*P-c,L=Math.sqrt(O*O+N*N),_=e.data.length*m;if(L<1e-4)return this.apply1(t,n,a,!1,i,!1,h),void e.updateWorldTransformWith(k,w,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);var B=((Y=n-C.worldX)*R-(X=a-C.worldY)*E)*P-l,D=(X*I-Y*S)*P-c,V=B*B+D*D;if(0!=o){o*=u*(m+1)*.5;var U=Math.sqrt(V),q=U-L-_*u+o;if(q>0){var W=Math.min(1,q/(2*o))-1;V=(B-=(W=(q-o*(1-W*W))/U)*B)*B+(D-=W*D)*D}}t:if(T){var G=(V-L*L-(_*=u)*_)/(2*L*_);G<-1?(G=-1,F=Math.PI*r):G>1?(G=1,F=0,i&&(d*=I=(Math.sqrt(V)/(L+_)-1)*h+1,s&&(v*=I))):F=Math.acos(G)*r,I=L+_*G,E=_*Math.sin(F),M=Math.atan2(D*I-B*E,B*I+D*E)}else{var z=(I=u*_)*I,j=(E=f*_)*E,H=Math.atan2(D,B),$=-2*j*L,J=j-z;if((R=$*$-4*J*(S=j*L*L+z*V-z*j))>=0){var K=Math.sqrt(R);$<0&&(K=-K);var Q=(K=.5*-($+K))/J,Z=S/K,tt=Math.abs(Q)=-1&&S<=1&&(S=Math.acos(S),(R=(Y=I*Math.cos(S)+L)*Y+(X=E*Math.sin(S))*X)ot&&(it=S,ot=R,st=Y,ht=X)),V<=.5*(at+ot)?(M=H-Math.atan2(rt*r,nt),F=et*r):(M=H-Math.atan2(ht*r,st),F=it*r)}var lt=Math.atan2(w,k)*y,ct=t.arotation;(M=(M-lt)*A.radDeg+p-ct)>180?M-=360:M<-180&&(M+=360),t.updateWorldTransformWith(l,c,ct+M*h,d,v,0,0),ct=e.arotation,(F=((F+lt)*A.radDeg-e.ashearX)*y+g-ct)>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(k,w,ct+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}}]);var ve=function(t){function e(t){var n,a,r,i;return s(this,e),a=this,i=[t,0,!1],r=u(r=e),l(n=d(a,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(r,i||[],u(a).constructor):r.apply(a,i)),"bones",new Array),l(n,"_target",null),l(n,"bendDirection",0),l(n,"compress",!1),l(n,"stretch",!1),l(n,"uniform",!1),l(n,"mix",0),l(n,"softness",0),n}return c(e,t),h(e,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t}}])}(he);var me,pe,ge,ye=function(t){function e(t){var n,a,r,i;return s(this,e),a=this,i=[t,0,!1],r=u(r=e),l(n=d(a,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(r,i||[],u(a).constructor):r.apply(a,i)),"bones",new Array),l(n,"_target",null),l(n,"positionMode",me.Fixed),l(n,"spacingMode",pe.Fixed),l(n,"rotateMode",ge.Chain),l(n,"offsetRotation",0),l(n,"position",0),l(n,"spacing",0),l(n,"mixRotate",0),l(n,"mixX",0),l(n,"mixY",0),n}return c(e,t),h(e,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("SlotData not set.")},set:function(t){this._target=t}}])}(he);!function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(me||(me={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"}(pe||(pe={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(ge||(ge={}));var ke=function(){function t(e,n){if(s(this,t),l(this,"data",void 0),l(this,"bones",void 0),l(this,"target",void 0),l(this,"position",0),l(this,"spacing",0),l(this,"mixRotate",0),l(this,"mixX",0),l(this,"mixY",0),l(this,"spaces",new Array),l(this,"positions",new Array),l(this,"world",new Array),l(this,"curves",new Array),l(this,"lengths",new Array),l(this,"segments",new Array),l(this,"active",!1),!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(var a=0,r=e.bones.length;a0){b=u/b*v;for(var F=1;F0?A.degRad:-A.degRad}for(var z=0,j=3;z0){var et=H.a,nt=H.b,at=H.c,rt=H.d,it=0,st=0,ot=0;if(it=o?D[j-1]:0==f[z+1]?D[j+2]:Math.atan2(Q,K),it-=Math.atan2(at,et),W){st=Math.cos(it),ot=Math.sin(it);var ht=H.data.length;V+=(ht*(st*et-ot*at)-K)*a,U+=(ht*(ot*et+st*at)-Q)*a}else it+=q;it>A.PI?it-=A.PI2:it<-A.PI&&(it+=A.PI2),it*=a,st=Math.cos(it),ot=Math.sin(it),H.a=st*et-ot*at,H.b=st*nt-ot*rt,H.c=ot*et+st*at,H.d=ot*nt+st*rt}H.updateAppliedTransform()}}}}},{key:"computeWorldPositions",value:function(e,n,a){var r=this.target,i=this.position,s=this.spaces,o=C.setArraySize(this.positions,3*n+2),h=this.world,l=e.closed,c=e.worldVerticesLength,u=c/6,f=t.NONE;if(!e.constantSpeed){var d,v=e.lengths,m=v[u-=l?1:2];switch(this.data.positionMode==me.Percent&&(i*=m),this.data.spacingMode){case pe.Percent:d=m;break;case pe.Proportional:d=m/n;break;default:d=1}h=C.setArraySize(this.world,8);for(var p=0,g=0,y=0;pm){f!=t.AFTER&&(f=t.AFTER,e.computeWorldVertices(r,c-6,4,h,0,2)),this.addAfterPosition(w-m,h,0,o,g);continue}}for(;;y++){var b=v[y];if(!(w>b)){if(0==y)w/=b;else{var x=v[y-1];w=(w-x)/(b-x)}break}}y!=f&&(f=y,l&&y==u?(e.computeWorldVertices(r,c-4,4,h,0,2),e.computeWorldVertices(r,0,4,h,4,2)):e.computeWorldVertices(r,6*y+2,8,h,0,2)),this.addCurvePosition(w,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],o,g,a||p>0&&0==k)}return o}l?(c+=2,h=C.setArraySize(this.world,c),e.computeWorldVertices(r,2,c-4,h,0,2),e.computeWorldVertices(r,0,2,h,c-4,2),h[c-2]=h[0],h[c-1]=h[1]):(u--,c-=4,h=C.setArraySize(this.world,c),e.computeWorldVertices(r,2,c,h,0,2));for(var I,E=C.setArraySize(this.curves,u),A=0,S=h[0],R=h[1],T=0,M=0,F=0,P=0,Y=0,X=0,O=0,N=0,L=0,_=0,B=0,D=0,V=0,U=0,q=0,W=2;qA){this.addAfterPosition(Q-A,h,c-4,o,H);continue}}for(;;$++){var Z=E[$];if(!(Q>Z)){if(0==$)Q/=Z;else{var tt=E[$-1];Q=(Q-tt)/(Z-tt)}break}}if($!=f){f=$;var et=6*$;for(S=h[et],R=h[et+1],T=h[et+2],M=h[et+3],F=h[et+4],P=h[et+5],B=2*(O=.03*(S-2*T+F))+(L=.006*(3*(T-F)-S+(Y=h[et+6]))),D=2*(N=.03*(R-2*M+P))+(_=.006*(3*(M-P)-R+(X=h[et+7]))),V=.3*(T-S)+O+.16666667*L,U=.3*(M-R)+N+.16666667*_,z=Math.sqrt(V*V+U*U),G[0]=z,et=1;et<8;et++)V+=B,U+=D,B+=L,D+=_,z+=Math.sqrt(V*V+U*U),G[et]=z;V+=B,U+=D,z+=Math.sqrt(V*V+U*U),G[8]=z,V+=B+L,U+=D+_,z+=Math.sqrt(V*V+U*U),G[9]=z,J=0}for(Q*=z;;J++){var nt=G[J];if(!(Q>nt)){if(0==J)Q/=nt;else{var at=G[J-1];Q=J+(Q-at)/(nt-at)}break}}this.addCurvePosition(.1*Q,S,R,T,M,F,P,Y,X,o,H,a||j>0&&0==K)}return o}},{key:"addBeforePosition",value:function(t,e,n,a,r){var i=e[n],s=e[n+1],o=e[n+2]-i,h=e[n+3]-s,l=Math.atan2(h,o);a[r]=i+t*Math.cos(l),a[r+1]=s+t*Math.sin(l),a[r+2]=l}},{key:"addAfterPosition",value:function(t,e,n,a,r){var i=e[n+2],s=e[n+3],o=i-e[n],h=s-e[n+1],l=Math.atan2(h,o);a[r]=i+t*Math.cos(l),a[r+1]=s+t*Math.sin(l),a[r+2]=l}},{key:"addCurvePosition",value:function(t,e,n,a,r,i,s,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=n,void(l[c+2]=Math.atan2(r-n,a-e));var f=t*t,d=f*t,v=1-t,m=v*v,p=m*v,g=v*t,y=3*g,k=v*y,w=y*t,b=e*p+a*k+i*w+o*d,x=n*p+r*k+s*w+h*d;l[c]=b,l[c+1]=x,u&&(l[c+2]=t<.001?Math.atan2(r-n,a-e):Math.atan2(x-(n*m+r*g*2+s*f),b-(e*m+a*g*2+i*f)))}}])}();l(ke,"NONE",-1),l(ke,"BEFORE",-2),l(ke,"AFTER",-3),l(ke,"epsilon",1e-5);var we,be=h((function t(e,n){s(this,t),l(this,"data",void 0),l(this,"_bone",null),l(this,"inertia",0),l(this,"strength",0),l(this,"damping",0),l(this,"massInverse",0),l(this,"wind",0),l(this,"gravity",0),l(this,"mix",0),l(this,"_reset",!0),l(this,"ux",0),l(this,"uy",0),l(this,"cx",0),l(this,"cy",0),l(this,"tx",0),l(this,"ty",0),l(this,"xOffset",0),l(this,"xVelocity",0),l(this,"yOffset",0),l(this,"yVelocity",0),l(this,"rotateOffset",0),l(this,"rotateVelocity",0),l(this,"scaleOffset",0),l(this,"scaleVelocity",0),l(this,"active",!1),l(this,"skeleton",void 0),l(this,"remaining",0),l(this,"lastTime",0),this.data=e,this.skeleton=n,this.bone=n.bones[e.bone.index],this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}),[{key:"bone",get:function(){if(this._bone)return this._bone;throw new Error("Bone not set.")},set:function(t){this._bone=t}},{key:"reset",value:function(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}},{key:"setToSetupPose",value:function(){var t=this.data;this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}},{key:"isActive",value:function(){return this.active}},{key:"update",value:function(t){var e=this.mix;if(0!=e){var n=this.data.x>0,a=this.data.y>0,r=this.data.rotate>0||this.data.shearX>0,i=this.data.scaleX>0,s=this.bone,o=s.data.length;switch(t){case we.none:return;case we.reset:this.reset();case we.update:var h=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=h,this.lastTime=this.skeleton.time;var l=s.worldX,c=s.worldY;if(this._reset)this._reset=!1,this.ux=l,this.uy=c;else{var u=this.remaining,f=this.inertia,d=this.data.limit*h,v=this.data.step,m=this.skeleton.data.referenceScale,p=-1;if(n||a){if(n){var g=(this.ux-l)*f;this.xOffset+=g>d?d:g<-d?-d:g,this.ux=l}if(a){var y=(this.uy-c)*f;this.yOffset+=y>d?d:y<-d?-d:y,this.uy=c}if(u>=v){p=Math.pow(this.damping,60*v);var k=this.massInverse*v,w=this.strength,b=this.wind*m,x=(Ee.yDown?-this.gravity:this.gravity)*m;do{n&&(this.xVelocity+=(b-this.xOffset*w)*k,this.xOffset+=this.xVelocity*v,this.xVelocity*=p),a&&(this.yVelocity-=(x+this.yOffset*w)*k,this.yOffset+=this.yVelocity*v,this.yVelocity*=p),u-=v}while(u>=v)}n&&(s.worldX+=this.xOffset*e*this.data.x),a&&(s.worldY+=this.yOffset*e*this.data.y)}if(r||i){var I=Math.atan2(s.c,s.a),E=0,S=0,R=0,T=this.cx-s.worldX,C=this.cy-s.worldY;if(T>d?T=d:T<-d&&(T=-d),C>d?C=d:C<-d&&(C=-d),r){R=(this.data.rotate+this.data.shearX)*e;var M=Math.atan2(C+this.ty,T+this.tx)-I-this.rotateOffset*R;this.rotateOffset+=(M-Math.ceil(M*A.invPI2-.5)*A.PI2)*f,M=this.rotateOffset*R+I,E=Math.cos(M),S=Math.sin(M),i&&(M=o*s.getWorldScaleX())>0&&(this.scaleOffset+=(T*E+C*S)*f/M)}else{E=Math.cos(I),S=Math.sin(I);var F=o*s.getWorldScaleX();F>0&&(this.scaleOffset+=(T*E+C*S)*f/F)}if((u=this.remaining)>=v){-1==p&&(p=Math.pow(this.damping,60*v));for(var P=this.massInverse*v,Y=this.strength,X=this.wind,O=Ee.yDown?-this.gravity:this.gravity,N=o/m;;)if(u-=v,i&&(this.scaleVelocity+=(X*E-O*S-this.scaleOffset*Y)*P,this.scaleOffset+=this.scaleVelocity*v,this.scaleVelocity*=p),r){if(this.rotateVelocity-=((X*S+O*E)*N+this.rotateOffset*Y)*P,this.rotateOffset+=this.rotateVelocity*v,this.rotateVelocity*=p,u0){var U=0;this.data.rotate>0&&(U=_*this.data.rotate,B=Math.sin(U),D=Math.cos(U),V=s.b,s.b=D*V-B*s.d,s.d=B*V+D*s.d),U+=_*this.data.shearX,B=Math.sin(U),D=Math.cos(U),V=s.a,s.a=D*V-B*s.c,s.c=B*V+D*s.c}else _*=this.data.rotate,B=Math.sin(_),D=Math.cos(_),V=s.a,s.a=D*V-B*s.c,s.c=B*V+D*s.c,V=s.b,s.b=D*V-B*s.d,s.d=B*V+D*s.d}if(i){var q=1+this.scaleOffset*e*this.data.scaleX;s.a*=q,s.c*=q}t!=we.pose&&(this.tx=o*s.a,this.ty=o*s.c),s.updateAppliedTransform()}}},{key:"translate",value:function(t,e){this.ux-=t,this.uy-=e,this.cx-=t,this.cy-=e}},{key:"rotate",value:function(t,e,n){var a=n*A.degRad,r=Math.cos(a),i=Math.sin(a),s=this.cx-t,o=this.cy-e;this.translate(s*r-o*i-s,s*i+o*r-o)}}]),xe=h((function t(e,n){if(s(this,t),l(this,"data",void 0),l(this,"bone",void 0),l(this,"color",void 0),l(this,"darkColor",null),l(this,"attachment",null),l(this,"attachmentState",0),l(this,"sequenceIndex",-1),l(this,"deform",new Array),!e)throw new Error("data cannot be null.");if(!n)throw new Error("bone cannot be null.");this.data=e,this.bone=n,this.color=new E,this.darkColor=e.darkColor?new E:null,this.setToSetupPose()}),[{key:"getSkeleton",value:function(){return this.bone.skeleton}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setAttachment",value:function(t){this.attachment!=t&&(t instanceof N&&this.attachment instanceof N&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}},{key:"setToSetupPose",value:function(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}}]),Ie=h((function t(e,n){if(s(this,t),l(this,"data",void 0),l(this,"bones",void 0),l(this,"target",void 0),l(this,"mixRotate",0),l(this,"mixX",0),l(this,"mixY",0),l(this,"mixScaleX",0),l(this,"mixScaleY",0),l(this,"mixShearY",0),l(this,"temp",new P),l(this,"active",!1),!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(var a=0;a0?A.degRad:-A.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pA.PI?I-=A.PI2:I<-A.PI&&(I+=A.PI2),I*=t;var E=Math.cos(I),S=Math.sin(I);y.a=E*k-S*b,y.b=E*w-S*x,y.c=S*k+E*b,y.d=S*w+E*x}if(s){var R=this.temp;o.localToWorld(R.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(R.x-y.worldX)*e,y.worldY+=(R.y-y.worldY)*n}if(0!=a){var T=Math.sqrt(y.a*y.a+y.c*y.c);0!=T&&(T=(T+(Math.sqrt(h*h+c*c)-T+this.data.offsetScaleX)*a)/T),y.a*=T,y.c*=T}if(0!=r){var C=Math.sqrt(y.b*y.b+y.d*y.d);0!=C&&(C=(C+(Math.sqrt(l*l+u*u)-C+this.data.offsetScaleY)*r)/C),y.b*=C,y.d*=C}if(i>0){var M=y.b,F=y.d,P=Math.atan2(F,M),Y=Math.atan2(u,l)-Math.atan2(c,h)-(P-Math.atan2(y.c,y.a));Y>A.PI?Y-=A.PI2:Y<-A.PI&&(Y+=A.PI2),Y=P+(Y+v)*i;var X=Math.sqrt(M*M+F*F);y.b=Math.cos(Y)*X,y.d=Math.sin(Y)*X}y.updateAppliedTransform()}}},{key:"applyRelativeWorld",value:function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,a=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=0!=e||0!=n,o=this.target,h=o.a,l=o.b,c=o.c,u=o.d,f=h*u-l*c>0?A.degRad:-A.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pA.PI?I-=A.PI2:I<-A.PI&&(I+=A.PI2),I*=t;var E=Math.cos(I),S=Math.sin(I);y.a=E*k-S*b,y.b=E*w-S*x,y.c=S*k+E*b,y.d=S*w+E*x}if(s){var R=this.temp;o.localToWorld(R.set(this.data.offsetX,this.data.offsetY)),y.worldX+=R.x*e,y.worldY+=R.y*n}if(0!=a){var T=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleX)*a+1;y.a*=T,y.c*=T}if(0!=r){var C=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleY)*r+1;y.b*=C,y.d*=C}if(i>0){var M=Math.atan2(u,l)-Math.atan2(c,h);M>A.PI?M-=A.PI2:M<-A.PI&&(M+=A.PI2);var F=y.b,P=y.d;M=Math.atan2(P,F)+(M-A.PI/2+v)*i;var Y=Math.sqrt(F*F+P*P);y.b=Math.cos(M)*Y,y.d=Math.sin(M)*Y}y.updateAppliedTransform()}}},{key:"applyAbsoluteLocal",value:function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,a=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=this.target,o=this.bones,h=0,l=o.length;h2&&void 0!==arguments[2]?arguments[2]:new Array(2),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(!e)throw new Error("offset cannot be null.");if(!n)throw new Error("size cannot be null.");for(var i=this.drawOrder,s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=0,u=i.length;c0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0;s(this,t),l(this,"slotIndex",void 0),l(this,"name",void 0),l(this,"attachment",void 0),this.slotIndex=e,this.name=n,this.attachment=a})),Ce=h((function t(e){if(s(this,t),l(this,"name",void 0),l(this,"attachments",new Array),l(this,"bones",Array()),l(this,"constraints",new Array),l(this,"color",new E(.99607843,.61960787,.30980393,1)),!e)throw new Error("name cannot be null.");this.name=e}),[{key:"setAttachment",value:function(t,e,n){if(!n)throw new Error("attachment cannot be null.");var a=this.attachments;t>=a.length&&(a.length=t+1),a[t]||(a[t]={}),a[t][e]=n}},{key:"addSkin",value:function(t){for(var e=0;e= 0.");if(!n)throw new Error("name cannot be null.");if(!a)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=a}));!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(Ae||(Ae={}));var Fe,Pe=function(t){function e(t){var n,a,r,i;return s(this,e),a=this,i=[t,0,!1],r=u(r=e),l(n=d(a,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(r,i||[],u(a).constructor):r.apply(a,i)),"bones",new Array),l(n,"_target",null),l(n,"mixRotate",0),l(n,"mixX",0),l(n,"mixY",0),l(n,"mixScaleX",0),l(n,"mixScaleY",0),l(n,"mixShearY",0),l(n,"offsetRotation",0),l(n,"offsetX",0),l(n,"offsetY",0),l(n,"offsetScaleX",0),l(n,"offsetScaleY",0),l(n,"offsetShearY",0),l(n,"relative",!1),l(n,"local",!1),n}return c(e,t),h(e,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t}}])}(he),Ye=h((function t(e){s(this,t),l(this,"scale",1),l(this,"attachmentLoader",void 0),l(this,"linkedMeshes",new Array),this.attachmentLoader=e}),[{key:"readSkeletonData",value:function(t){var e=this.scale,n=new Re;n.name="";var a=new Xe(t),r=a.readInt32(),i=a.readInt32();n.hash=0==i&&0==r?null:i.toString(16)+r.toString(16),n.version=a.readString(),n.x=a.readFloat(),n.y=a.readFloat(),n.width=a.readFloat(),n.height=a.readFloat(),n.referenceScale=a.readFloat()*e;var s=a.readBoolean();s&&(n.fps=a.readFloat(),n.imagesPath=a.readString(),n.audioPath=a.readString());var o=0;o=a.readInt(!0);for(var h=0;h>1&3,L.rotateMode=B>>3&3,0!=(128&B)&&(L.offsetRotation=a.readFloat()),L.position=a.readFloat(),L.positionMode==me.Fixed&&(L.position*=e),L.spacing=a.readFloat(),L.spacingMode!=pe.Length&&L.spacingMode!=pe.Fixed||(L.spacing*=e),L.mixRotate=a.readFloat(),L.mixX=a.readFloat(),L.mixY=a.readFloat(),n.pathConstraints.push(L)}o=a.readInt(!0);for(var D=0;D>4,t.readFloat())}a.push(tr)}}var rr=t.readInt(!0);if(rr>0){for(var ir=new vt(rr),sr=n.slots.length,or=0;or=0;ur--)cr[ur]=-1;for(var fr=C.newArray(sr-lr,0),dr=0,vr=0,mr=0;mr=0;gr--)-1==cr[gr]&&(cr[gr]=fr[--vr]);ir.setFrame(or,hr,cr)}a.push(ir)}var yr=t.readInt(!0);if(yr>0){for(var kr=new dt(yr),wr=0;wr1&&void 0!==arguments[1]?arguments[1]:new Array,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new DataView(e.buffer);s(this,t),l(this,"strings",void 0),l(this,"index",void 0),l(this,"buffer",void 0),this.strings=n,this.index=a,this.buffer=r}),[{key:"readByte",value:function(){return this.buffer.getInt8(this.index++)}},{key:"readUnsignedByte",value:function(){return this.buffer.getUint8(this.index++)}},{key:"readShort",value:function(){var t=this.buffer.getInt16(this.index);return this.index+=2,t}},{key:"readInt32",value:function(){var t=this.buffer.getInt32(this.index);return this.index+=4,t}},{key:"readInt",value:function(t){var e=this.readByte(),n=127&e;return 0!=(128&e)&&(n|=(127&(e=this.readByte()))<<7,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<14,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<21,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<28)))),t?n:n>>>1^-(1&n)}},{key:"readStringRef",value:function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]}},{key:"readString",value:function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",n=0;n>4){case 12:case 13:e+=String.fromCharCode((31&a)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&a)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(a),n++}}return e}},{key:"readFloat",value:function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t}},{key:"readBoolean",value:function(){return 0!=this.readByte()}}]),Oe=h((function t(e,n,a,r,i){s(this,t),l(this,"parent",void 0),l(this,"skinIndex",void 0),l(this,"slotIndex",void 0),l(this,"mesh",void 0),l(this,"inheritTimeline",void 0),this.mesh=e,this.skinIndex=n,this.slotIndex=a,this.parent=r,this.inheritTimeline=i})),Ne=h((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;s(this,t),l(this,"bones",void 0),l(this,"vertices",void 0),l(this,"length",void 0),this.bones=e,this.vertices=n,this.length=a}));function Le(t,e,n){for(var a=t.readFloat(),r=t.readFloat()*n,i=0,s=0,o=e.getFrameCount()-1;e.setFrame(i,a,r),i!=o;i++){var h=t.readFloat(),l=t.readFloat()*n;switch(t.readByte()){case yn:e.setStepped(i);break;case kn:Be(t,e,s++,i,0,a,h,r,l,n)}a=h,r=l}return e}function _e(t,e,n){for(var a=t.readFloat(),r=t.readFloat()*n,i=t.readFloat()*n,s=0,o=0,h=e.getFrameCount()-1;e.setFrame(s,a,r,i),s!=h;s++){var l=t.readFloat(),c=t.readFloat()*n,u=t.readFloat()*n;switch(t.readByte()){case yn:e.setStepped(s);break;case kn:Be(t,e,o++,s,0,a,l,r,c,n),Be(t,e,o++,s,1,a,l,i,u,n)}a=l,r=c,i=u}return e}function Be(t,e,n,a,r,i,s,o,h,l){e.setBezier(n,a,r,i,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,s,h)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(Fe||(Fe={}));var De,Ve=0,Ue=1,qe=2,We=3,Ge=4,ze=5,je=6,He=7,$e=8,Je=9,Ke=10,Qe=0,Ze=1,tn=2,en=3,nn=4,an=5,rn=0,sn=1,on=0,hn=1,ln=2,cn=0,un=1,fn=2,dn=4,vn=5,mn=6,pn=7,gn=8,yn=1,kn=2,wn=h((function t(){s(this,t),l(this,"minX",0),l(this,"minY",0),l(this,"maxX",0),l(this,"maxY",0),l(this,"boundingBoxes",new Array),l(this,"polygons",new Array),l(this,"polygonPool",new F((function(){return C.newFloatArray(16)})))}),[{key:"update",value:function(t,e){if(!t)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,a=this.polygons,r=this.polygonPool,i=t.slots,s=i.length;n.length=0,r.freeAll(a),a.length=0;for(var o=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}},{key:"aabbIntersectsSegment",value:function(t,e,n,a){var r=this.minX,i=this.minY,s=this.maxX,o=this.maxY;if(t<=r&&n<=r||e<=i&&a<=i||t>=s&&n>=s||e>=o&&a>=o)return!1;var h=(a-e)/(n-t),l=h*(r-t)+e;if(l>i&&li&&lr&&cr&&ct.minX&&this.minYt.minY}},{key:"containsPoint",value:function(t,e){for(var n=this.polygons,a=0,r=n.length;a=n||l=n){var c=a[o];c+(n-h)/(l-h)*(a[i]-c)=c&&k<=d||k>=d&&k<=c)&&(k>=e&&k<=a||k>=a&&k<=e)){var w=(l*g-h*m)/y;if((w>=u&&w<=v||w>=v&&w<=u)&&(w>=n&&w<=r||w>=r&&w<=n))return!0}c=d,u=v}return!1}},{key:"getPolygon",value:function(t){if(!t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}},{key:"getWidth",value:function(){return this.maxX-this.minX}},{key:"getHeight",value:function(){return this.maxY-this.minY}}]),bn=function(){function t(){s(this,t),l(this,"convexPolygons",new Array),l(this,"convexPolygonsIndices",new Array),l(this,"indicesArray",new Array),l(this,"isConcaveArray",new Array),l(this,"triangles",new Array),l(this,"polygonPool",new F((function(){return new Array}))),l(this,"polygonIndicesPool",new F((function(){return new Array})))}return h(t,[{key:"triangulate",value:function(e){var n=e,a=e.length>>1,r=this.indicesArray;r.length=0;for(var i=0;i3;){for(var c=a-1,u=0,f=1;;){t:if(!s[u]){for(var d=r[c]<<1,v=r[u]<<1,m=r[f]<<1,p=n[d],g=n[d+1],y=n[v],k=n[v+1],w=n[m],b=n[m+1],x=(f+1)%a;x!=c;x=(x+1)%a)if(s[x]){var I=r[x]<<1,E=n[I],A=n[I+1];if(t.positiveArea(w,b,p,g,E,A)&&t.positiveArea(p,g,y,k,E,A)&&t.positiveArea(y,k,w,b,E,A))break t}break}if(0==f){do{if(!s[u])break;u--}while(u>0);break}c=u,u=f,f=(f+1)%a}l.push(r[(a+u-1)%a]),l.push(r[u]),l.push(r[(u+1)%a]),r.splice(u,1),s.splice(u,1);var S=(--a+u-1)%a,R=u==a?0:u;s[S]=t.isConcave(S,a,n,r),s[R]=t.isConcave(R,a,n,r)}return 3==a&&(l.push(r[2]),l.push(r[0]),l.push(r[1])),l}},{key:"decompose",value:function(e,n){var a=e,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var s=this.polygonIndicesPool.obtain();s.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,c=0,u=n.length;c0?(r.push(o),i.push(s)):(this.polygonPool.free(o),this.polygonIndicesPool.free(s)),(o=this.polygonPool.obtain()).length=0,o.push(m),o.push(p),o.push(g),o.push(y),o.push(k),o.push(w),(s=this.polygonIndicesPool.obtain()).length=0,s.push(f),s.push(d),s.push(v),l=t.winding(m,p,g,y,k,w),h=f)}o.length>0&&(r.push(o),i.push(s));for(var A=0,S=r.length;A=0;$--)0==(o=r[$]).length&&(r.splice($,1),this.polygonPool.free(o),s=i[$],i.splice($,1),this.polygonIndicesPool.free(s));return r}}],[{key:"isConcave",value:function(t,e,n,a){var r=a[(e+t-1)%e]<<1,i=a[t]<<1,s=a[(t+1)%e]<<1;return!this.positiveArea(n[r],n[r+1],n[i],n[i+1],n[s],n[s+1])}},{key:"positiveArea",value:function(t,e,n,a,r,i){return t*(i-a)+n*(e-i)+r*(a-e)>=0}},{key:"winding",value:function(t,e,n,a,r,i){var s=n-t,o=a-e;return r*o-i*s+s*e-t*o>=0?1:-1}}])}(),xn=function(){function t(){s(this,t),l(this,"triangulator",new bn),l(this,"clippingPolygon",new Array),l(this,"clipOutput",new Array),l(this,"clippedVertices",new Array),l(this,"clippedTriangles",new Array),l(this,"scratch",new Array),l(this,"clipAttachment",null),l(this,"clippingPolygons",null)}return h(t,[{key:"clipStart",value:function(e,n){if(this.clipAttachment)return 0;this.clipAttachment=n;var a=n.worldVerticesLength,r=C.setArraySize(this.clippingPolygon,a);n.computeWorldVertices(e,0,a,r,0,2);var i=this.clippingPolygon;t.makeClockwise(i);for(var s=this.clippingPolygons=this.triangulator.decompose(i,this.triangulator.triangulate(i)),o=0,h=s.length;o>1,I=this.clipOutput,E=C.setArraySize(r,y+2*x),A=0;A>1,D=this.clipOutput,V=C.setArraySize(h,M+B*f),U=0;U=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(n),h.push(a),h.push(r),h.push(i),h.push(t),h.push(e),o.length=0;for(var u=s.length-4,f=s,d=0;;d+=2){for(var v=f[d],m=f[d+1],p=v-f[d+2],g=m-f[d+3],y=o.length,k=h,w=0,b=h.length-2;wp*(m-A),R=g*(v-x)-p*(m-I);if(R>0){if(S){o.push(E),o.push(A);continue}var T=E-x,C=A-I,M=R/(T*g-C*p);if(!(M>=0&&M<=1)){o.push(E),o.push(A);continue}o.push(x+T*M),o.push(I+C*M)}else if(S){var F=E-x,P=A-I,Y=R/(F*g-P*p);if(!(Y>=0&&Y<=1)){o.push(E),o.push(A);continue}o.push(x+F*Y),o.push(I+P*Y),o.push(E),o.push(A)}c=!0}if(y==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),d==u)break;var X=o;(o=h).length=0,h=X}if(l!=o){l.length=0;for(var O=0,N=o.length-2;O>1;l0){var Cn=n.findPhysicsConstraint(xn);if(!Cn)throw new Error("Physics constraint not found: "+xn);En=n.physicsConstraints.indexOf(Cn)}for(var Mn in In){var Fn=In[Mn],Pn=Fn[0];if(Pn){var Yn=Fn.length;if("reset"!=Mn){var Xn=void 0;if("inertia"==Mn)Xn=new bt(Yn,Yn,En);else if("strength"==Mn)Xn=new xt(Yn,Yn,En);else if("damping"==Mn)Xn=new It(Yn,Yn,En);else if("mass"==Mn)Xn=new Et(Yn,Yn,En);else if("wind"==Mn)Xn=new At(Yn,Yn,En);else if("gravity"==Mn)Xn=new St(Yn,Yn,En);else{if("mix"!=Mn)continue;Xn=new Rt(Yn,Yn,En)}r.push(An(Fn,Xn,0,1))}else{for(var On=new Tt(Yn,En),Nn=0;null!=Pn;Pn=Fn[Nn+1],Nn++)On.setFrame(Nn,Tn(Pn,"time",0));r.push(On)}}}}if(t.attachments)for(var Ln in t.attachments){var _n=t.attachments[Ln],Bn=n.findSkin(Ln);if(!Bn)throw new Error("Skin not found: "+Ln);for(var Dn in _n){var Vn=_n[Dn],Un=n.findSlot(Dn);if(!Un)throw new Error("Slot not found: "+Dn);var qn=Un.index;for(var Wn in Vn){var Gn=Vn[Wn],zn=Bn.getAttachment(qn,Wn);for(var jn in Gn){var Hn=Gn[jn],$n=Hn[0];if($n)if("deform"==jn){for(var Jn=zn.bones,Kn=zn.vertices,Qn=Jn?Kn.length/3*2:Kn.length,Zn=new ft(Hn.length,Hn.length,qn,zn),ta=Tn($n,"time",0),ea=0,na=0;;ea++){var aa=void 0,ra=Tn($n,"vertices",null);if(ra){aa=C.newFloatArray(Qn);var ia=Tn($n,"offset",0);if(C.arrayCopy(ra,0,aa,ia,ra.length),1!=a)for(var sa=ia,oa=sa+ra.length;sa=0;Ya--)-1==Ea[Ya]&&(Ea[Ya]=Sa[--Ta])}ka.setFrame(ba,Tn(Ia,"time",0),Ea)}r.push(ka)}if(t.events){for(var Xa=new dt(t.events.length),Oa=0,Na=0;Na)?=?)"),d("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),d("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),d("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),d("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),d("COERCEPLAIN","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")),d("COERCE","".concat(h[l.COERCEPLAIN],"(?:$|[^\\d])")),d("COERCEFULL",h[l.COERCEPLAIN]+"(?:".concat(h[l.PRERELEASE],")?")+"(?:".concat(h[l.BUILD],")?")+"(?:$|[^\\d])"),d("COERCERTL",h[l.COERCE],!0),d("COERCERTLFULL",h[l.COERCEFULL],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",d("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),d("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("LONECARET","(?:\\^)"),d("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",d("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),d("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),d("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),d("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),d("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(_n,_n.exports);var Bn=_n.exports;Yn(Bn);var Dn=Object.freeze({loose:!0}),Vn=Object.freeze({}),Un=function(t){return t?"object"!==i(t)?Dn:t:Vn};Yn(Un);var qn=/^[0-9]+$/,Wn=function(t,e){var n=qn.test(t),a=qn.test(e);return n&&a&&(t=+t,e=+e),t===e?0:n&&!a?-1:a&&!n?1:tjn)throw new TypeError("version is longer than ".concat(jn," characters"));zn("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var a=e.trim().match(n.loose?$n[Jn.LOOSE]:$n[Jn.FULL]);if(!a)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>Hn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Hn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Hn||this.patch<0)throw new TypeError("Invalid patch version");a[4]?this.prerelease=a[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(a)}}if(e){var i=[e,a];!1===n&&(i=[e]),0===Qn(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}])}(),ta=Zn;Yn(ta);var ea=ta,na=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof ea)return t;try{return new ea(t,e)}catch(t){if(!n)return null;throw t}};Yn(na);var aa=na,ra=Yn((function(t,e){var n=aa(t,e);return n?n.version:null})),ia=ta,sa=na,oa=Bn.safeRe,ha=Bn.t,la=Yn((function(t,e){if(t instanceof ia)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var a,r=e.includePrerelease?oa[ha.COERCERTLFULL]:oa[ha.COERCERTL];(a=r.exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&a.index+a[0].length===n.index+n[0].length||(n=a),r.lastIndex=a.index+a[1].length+a[2].length;r.lastIndex=-1}else n=t.match(e.includePrerelease?oa[ha.COERCEFULL]:oa[ha.COERCE]);if(null===n)return null;var i=n[2],s=n[3]||"0",o=n[4]||"0",h=e.includePrerelease&&n[5]?"-".concat(n[5]):"",l=e.includePrerelease&&n[6]?"+".concat(n[6]):"";return sa("".concat(i,".").concat(s,".").concat(o).concat(h).concat(l),e)})),ca=h((function t(){s(this,t),this.max=1e3,this.map=new Map}),[{key:"get",value:function(t){var e=this.map.get(t);return void 0===e?void 0:(this.map.delete(t),this.map.set(t,e),e)}},{key:"delete",value:function(t){return!!this.map.has(t)&&(this.map.delete(t),!0)}},{key:"set",value:function(t,e){if(!this.delete(t)&&void 0!==e){if(this.map.size>=this.max){var n=this.map.keys().next().value;this.delete(n)}this.map.set(t,e)}return this}}]);Yn(ca);var ua=ta,fa=function(t,e,n){return new ua(t,n).compare(new ua(e,n))};Yn(fa);var da=fa,va=function(t,e,n){return 0===da(t,e,n)};Yn(va);var ma=fa,pa=function(t,e,n){return 0!==ma(t,e,n)};Yn(pa);var ga=fa,ya=function(t,e,n){return ga(t,e,n)>0};Yn(ya);var ka=fa,wa=function(t,e,n){return ka(t,e,n)>=0};Yn(wa);var ba=fa,xa=function(t,e,n){return ba(t,e,n)<0};Yn(xa);var Ia=fa,Ea=function(t,e,n){return Ia(t,e,n)<=0};Yn(Ea);var Aa,Sa,Ra,Ta,Ca=va,Ma=pa,Fa=ya,Pa=wa,Ya=xa,Xa=Ea,Oa=function(t,e,n,a){switch(e){case"===":return"object"===i(t)&&(t=t.version),"object"===i(n)&&(n=n.version),t===n;case"!==":return"object"===i(t)&&(t=t.version),"object"===i(n)&&(n=n.version),t!==n;case"":case"=":case"==":return Ca(t,n,a);case"!=":return Ma(t,n,a);case">":return Fa(t,n,a);case">=":return Pa(t,n,a);case"<":return Ya(t,n,a);case"<=":return Xa(t,n,a);default:throw new TypeError("Invalid operator: ".concat(e))}};function Na(){if(Ta)return Ra;Ta=1;var t=function(){function t(e,r){var i=this;if(s(this,t),r=n(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return i.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!m(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var h,l=k(this.set);try{for(l.s();!(h=l.n()).done;){var c=h.value;if(1===c.length&&g(c[0])){this.set=[c];break}}}catch(t){l.e(t)}finally{l.f()}}}this.format()}return h(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var n=this,i=((this.options.includePrerelease&&d)|(this.options.loose&&v))+":"+t,s=e.get(i);if(s)return s;var h=this.options.loose,g=h?o[l.HYPHENRANGELOOSE]:o[l.HYPHENRANGE];t=t.replace(g,M(this.options.includePrerelease)),r("hyphen replace",t),t=t.replace(o[l.COMPARATORTRIM],c),r("comparator trim",t),t=t.replace(o[l.TILDETRIM],u),r("tilde trim",t),t=t.replace(o[l.CARETTRIM],f),r("caret trim",t);var y=t.split(" ").map((function(t){return w(t,n.options)})).join(" ").split(/\s+/).map((function(t){return C(t,n.options)}));h&&(y=y.filter((function(t){return r("loose invalid filter",t,n.options),!!t.match(o[l.COMPARATORLOOSE])}))),r("range list",y);var b,x=new Map,I=y.map((function(t){return new a(t,n.options)})),E=k(I);try{for(E.s();!(b=E.n()).done;){var A=b.value;if(m(A))return[A];x.set(A.value,A)}}catch(t){E.e(t)}finally{E.f()}x.size>1&&x.has("")&&x.delete("");var S=p(x.values());return e.set(i,S),S}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return y(t,n)&&e.set.some((function(e){return y(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new i(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(i(this.semver,"<",t.semver,a)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(i(this.semver,">",t.semver,a)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}])}();Aa=e;var n=Un,a=Bn.safeRe,r=Bn.t,i=Oa,o=Ln,l=ta,c=Na();return Aa}(),r=Ln,i=ta,o=Bn.safeRe,l=Bn.t,c=Bn.comparatorTrimReplace,u=Bn.tildeTrimReplace,f=Bn.caretTrimReplace,d=Xn.FLAG_INCLUDE_PRERELEASE,v=Xn.FLAG_LOOSE,m=function(t){return"<0.0.0-0"===t.value},g=function(t){return""===t.value},y=function(t,e){for(var n=!0,a=t.slice(),r=a.pop();n&&a.length;)n=a.every((function(t){return r.intersects(t,e)})),r=a.pop();return n},w=function(t,e){return r("comp",t,e),t=E(t,e),r("caret",t),t=x(t,e),r("tildes",t),t=S(t,e),r("xrange",t),t=T(t,e),r("stars",t),t},b=function(t){return!t||"x"===t.toLowerCase()||"*"===t},x=function(t,e){return t.trim().split(/\s+/).map((function(t){return I(t,e)})).join(" ")},I=function(t,e){var n=e.loose?o[l.TILDELOOSE]:o[l.TILDE];return t.replace(n,(function(e,n,a,i,s){var o;return r("tilde",t,e,n,a,i,s),b(n)?o="":b(a)?o=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):b(i)?o=">=".concat(n,".").concat(a,".0 <").concat(n,".").concat(+a+1,".0-0"):s?(r("replaceTilde pr",s),o=">=".concat(n,".").concat(a,".").concat(i,"-").concat(s," <").concat(n,".").concat(+a+1,".0-0")):o=">=".concat(n,".").concat(a,".").concat(i," <").concat(n,".").concat(+a+1,".0-0"),r("tilde return",o),o}))},E=function(t,e){return t.trim().split(/\s+/).map((function(t){return A(t,e)})).join(" ")},A=function(t,e){r("caret",t,e);var n=e.loose?o[l.CARETLOOSE]:o[l.CARET],a=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,i,s,o){var h;return r("caret",t,e,n,i,s,o),b(n)?h="":b(i)?h=">=".concat(n,".0.0").concat(a," <").concat(+n+1,".0.0-0"):b(s)?h="0"===n?">=".concat(n,".").concat(i,".0").concat(a," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(a," <").concat(+n+1,".0.0-0"):o?(r("replaceCaret pr",o),h="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(n,".").concat(i,".").concat(+s+1,"-0"):">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(+n+1,".0.0-0")):(r("no pr"),h="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(s).concat(a," <").concat(n,".").concat(i,".").concat(+s+1,"-0"):">=".concat(n,".").concat(i,".").concat(s).concat(a," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(s," <").concat(+n+1,".0.0-0")),r("caret return",h),h}))},S=function(t,e){return r("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return R(t,e)})).join(" ")},R=function(t,e){t=t.trim();var n=e.loose?o[l.XRANGELOOSE]:o[l.XRANGE];return t.replace(n,(function(n,a,i,s,o,h){r("xRange",t,n,a,i,s,o,h);var l=b(i),c=l||b(s),u=c||b(o),f=u;return"="===a&&f&&(a=""),h=e.includePrerelease?"-0":"",l?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&f?(c&&(s=0),o=0,">"===a?(a=">=",c?(i=+i+1,s=0,o=0):(s=+s+1,o=0)):"<="===a&&(a="<",c?i=+i+1:s=+s+1),"<"===a&&(h="-0"),n="".concat(a+i,".").concat(s,".").concat(o).concat(h)):c?n=">=".concat(i,".0.0").concat(h," <").concat(+i+1,".0.0-0"):u&&(n=">=".concat(i,".").concat(s,".0").concat(h," <").concat(i,".").concat(+s+1,".0-0")),r("xRange return",n),n}))},T=function(t,e){return r("replaceStars",t,e),t.trim().replace(o[l.STAR],"")},C=function(t,e){return r("replaceGTE0",t,e),t.trim().replace(o[e.includePrerelease?l.GTE0PRE:l.GTE0],"")},M=function(t){return function(e,n,a,r,i,s,o,h,l,c,u,f){return n=b(a)?"":b(r)?">=".concat(a,".0.0").concat(t?"-0":""):b(i)?">=".concat(a,".").concat(r,".0").concat(t?"-0":""):s?">=".concat(n):">=".concat(n).concat(t?"-0":""),h=b(l)?"":b(c)?"<".concat(+l+1,".0.0-0"):b(u)?"<".concat(l,".").concat(+c+1,".0-0"):f?"<=".concat(l,".").concat(c,".").concat(u,"-").concat(f):t?"<".concat(l,".").concat(c,".").concat(+u+1,"-0"):"<=".concat(h),"".concat(n," ").concat(h).trim()}},F=function(t,e,n){for(var i=0;i0){var o=t[s].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0};return Ra}Yn(Oa);var La=Na(),_a=function(t,e,n){try{e=new La(e,n)}catch(t){return!1}return e.test(t)},Ba={valid:ra,coerce:la,satisfies:Yn(_a),SEMVER_SPEC_VERSION:On.SEMVER_SPEC_VERSION},Da=0,Va=1,Ua=2,qa=[0,1,2,2,3,0],Wa=h((function t(e,n,a,i){var o;if(s(this,t),l(this,"autoUpdate",!0),l(this,"skeleton",void 0),l(this,"states",void 0),this._app=e,this._position=new r.Vec3,1===Jt.length){var h,c=k((o=new Jt(n)).pages);try{for(c.s();!(h=c.n()).done;){var u=h.value;u.setTexture(new Pn(i[u.name]))}}catch(t){c.e(t)}finally{c.f()}}else o=new Jt(n,(function(t){return new Pn(i[t])}));var f=new In(new ie(o));f.scale*=.01;var d=f.readSkeletonData(a);this.skeletonVersion=Ba.valid(Ba.coerce(d.version)),this._spine_3_6_0=Ba.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=Ba.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_0_X=Ba.satisfies(this.skeletonVersion,"~4.0.0"),this._spine_4_1_X=Ba.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new Ee(d),this.skeleton.updateWorldTransform(),this.stateData=new Ut(this.skeleton.data),this.states=[new Mt(this.stateData)],this.clipper=new xn,this._node=new r.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new r.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new r.Vec2,this._aabbTempSize=new r.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[r.LAYERID_UI],this.init(),this._hidden=!1}),[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new r.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new r.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&u.indices.length>0){t&&t!==u.material&&(this.SubmitBatch(e,n,t),t=u.material,e=s,n=0),t=u.material;var f=u.positions,d=u.vertexColor.r,v=u.vertexColor.g,m=u.vertexColor.b,p=u.vertexColor.a,g=u.uvs,y=void 0,k=f.length/2;for(y=0;y0){var a=new r.Mesh(this._app.graphicsDevice);a.vertexBuffer=this._vertexBuffer,a.indexBuffer[0]=this._indexBuffer,a.primitive[0].type=r.PRIMITIVE_TRIANGLES,a.primitive[0].base=t,a.primitive[0].count=e,a.primitive[0].indexed=!0,a.aabb=this._aabb,this._meshes.push(a);var i=new r.MeshInstance(a,this._materials[n],this._node);i.drawOrder=this.priority+this._meshInstances.length,i.visible=!this._hidden,this._meshInstances.push(i)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var n=this.states.length;for(e=0;et.length)&&(e=t.length);for(var n=0,a=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){o=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function w(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,e||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function b(t,e,n){return e=u(e),d(t,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(e,n||[],u(t).constructor):e.apply(t,n))}var x=h((function t(){s(this,t),l(this,"array",new Array)}),[{key:"add",value:function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e}},{key:"contains",value:function(t){return null!=this.array[0|t]}},{key:"remove",value:function(t){this.array[0|t]=void 0}},{key:"clear",value:function(){this.array.length=0}}]),I=h((function t(){s(this,t),l(this,"entries",{}),l(this,"size",0)}),[{key:"add",value:function(t){var e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}},{key:"addAll",value:function(t){for(var e=this.size,n=0,a=t.length;n0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;s(this,t),l(this,"r",void 0),l(this,"g",void 0),l(this,"b",void 0),l(this,"a",void 0),this.r=e,this.g=n,this.b=a,this.a=r}return h(t,[{key:"set",value:function(t,e,n,a){return this.r=t,this.g=e,this.b=n,this.a=a,this.clamp()}},{key:"setFromColor",value:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}},{key:"setFromString",value:function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=8!=t.length?1:parseInt(t.substr(6,2),16)/255,this}},{key:"add",value:function(t,e,n,a){return this.r+=t,this.g+=e,this.b+=n,this.a+=a,this.clamp()}},{key:"clamp",value:function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}},{key:"toRgb888",value:function(){var t=function(t){return("0"+(255*t).toString(16)).slice(-2)};return Number("0x"+t(this.r)+t(this.g)+t(this.b))}}],[{key:"rgba8888ToColor",value:function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}},{key:"rgb888ToColor",value:function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}},{key:"fromString",value:function(e){return(new t).setFromString(e)}}])}();l(E,"WHITE",new(n=E)(1,1,1,1)),l(E,"RED",new n(1,0,0,1)),l(E,"GREEN",new n(0,1,0,1)),l(E,"BLUE",new n(0,0,1,1)),l(E,"MAGENTA",new n(1,0,1,1));var A=function(){function t(){s(this,t)}return h(t,null,[{key:"clamp",value:function(t,e,n){return tn?n:t}},{key:"cosDeg",value:function(e){return Math.cos(e*t.degRad)}},{key:"sinDeg",value:function(e){return Math.sin(e*t.degRad)}},{key:"atan2Deg",value:function(e,n){return Math.atan2(e,n)*t.degRad}},{key:"signum",value:function(t){return t>0?1:t<0?-1:0}},{key:"toInt",value:function(t){return t>0?Math.floor(t):Math.ceil(t)}},{key:"cbrt",value:function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}},{key:"randomTriangular",value:function(e,n){return t.randomTriangularWith(e,n,.5*(e+n))}},{key:"randomTriangularWith",value:function(t,e,n){var a=Math.random(),r=e-t;return a<=(n-t)/r?t+Math.sqrt(a*r*(n-t)):e-Math.sqrt((1-a)*r*(e-n))}},{key:"isPowerOfTwo",value:function(t){return t&&0==(t&t-1)}}])}();a=A,l(A,"PI",3.1415927),l(A,"PI2",2*a.PI),l(A,"invPI2",1/a.PI2),l(A,"radiansToDegrees",180/a.PI),l(A,"radDeg",a.radiansToDegrees),l(A,"degreesToRadians",a.PI/180),l(A,"degRad",a.degreesToRadians);var S=h((function t(){s(this,t)}),[{key:"apply",value:function(t,e,n){return t+(e-t)*this.applyInternal(n)}}]),R=function(t){function e(t){var n;return s(this,e),l(n=b(this,e),"power",2),n.power=t,n}return c(e,t),h(e,[{key:"applyInternal",value:function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}}])}(S),T=function(t){function e(t){return s(this,e),b(this,e,[t])}return c(e,t),h(e,[{key:"applyInternal",value:function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}])}(R),C=function(){function t(){s(this,t)}return h(t,null,[{key:"arrayCopy",value:function(t,e,n,a,r){for(var i=e,s=a;i2&&void 0!==arguments[2]?arguments[2]:0,a=t.length;if(a==e)return t;if(t.length=e,a2&&void 0!==arguments[2]?arguments[2]:0;return e.length>=n?e:t.setArraySize(e,n,a)}},{key:"newArray",value:function(t,e){for(var n=new Array(t),a=0;a0?this.items.pop():this.instantiator()}},{key:"free",value:function(t){t.reset&&t.reset(),this.items.push(t)}},{key:"freeAll",value:function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s(this,t),l(this,"x",void 0),l(this,"y",void 0),this.x=e,this.y=n}),[{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"length",value:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}},{key:"normalize",value:function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}}]),Y=h((function t(){s(this,t),l(this,"maxDelta",.064),l(this,"framesPerSecond",0),l(this,"delta",0),l(this,"totalTime",0),l(this,"lastTime",Date.now()/1e3),l(this,"frameCount",0),l(this,"frameTime",0)}),[{key:"update",value:function(){var t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}]),X=h((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;s(this,t),l(this,"values",void 0),l(this,"addedValues",0),l(this,"lastValue",0),l(this,"mean",0),l(this,"dirty",!0),this.values=new Array(e)}),[{key:"hasEnoughData",value:function(){return this.addedValues>=this.values.length}},{key:"addValue",value:function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}},{key:"getMean",value:function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*i;var s=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(l){for(var c=0,u=0,f=0;f0&&(h=o);for(var O=t.bone,N=O.worldX,L=O.worldY,_=O.a,B=O.b,D=O.c,V=O.d,U=e,q=r;q=this.regions.length&&(n=this.regions.length-1);var a=this.regions[n];e.region!=a&&(e.region=a,e.updateRegion())}},{key:"getPath",value:function(t,e){for(var n=t,a=(this.start+e).toString(),r=this.digits-a.length;r>0;r--)n+="0";return n+=a}}],[{key:"nextID",value:function(){return t._nextID++}}])}();l(_,"_nextID",0),function(t){t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse"}(L||(L={}));var B=[L.hold,L.once,L.loop,L.pingpong,L.onceReverse,L.loopReverse,L.pingpongReverse];function D(t,e,n){return e=u(e),d(t,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(e,n||[],u(t).constructor):e.apply(t,n))}var V,U,q=h((function t(e,n,a){if(s(this,t),l(this,"name",void 0),l(this,"timelines",[]),l(this,"timelineIds",new I),l(this,"duration",void 0),!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(n),this.duration=a}),[{key:"setTimelines",value:function(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e0&&(e%=this.duration));for(var h=this.timelines,l=0,c=h.length;le)return a-1;return n-1}},{key:"search",value:function(t,e,n){for(var a=t.length,r=n;re)return r-n;return a-n}}]),z=function(t){function e(t,n,a){var r;return s(this,e),l(r=D(this,e,[t,a]),"curves",void 0),r.curves=C.newFloatArray(t+18*n),r.curves[t-1]=1,r}return c(e,t),h(e,[{key:"setLinear",value:function(t){this.curves[t]=0}},{key:"setStepped",value:function(t){this.curves[t]=1}},{key:"shrink",value:function(t){var e=this.getFrameCount()+18*t;if(this.curves.length>e){var n=C.newFloatArray(e);C.arrayCopy(this.curves,0,n,0,e),this.curves=n}}},{key:"setBezier",value:function(t,e,n,a,r,i,s,o,h,l,c){var u=this.curves,f=this.getFrameCount()+18*t;0==n&&(u[e]=2+f);for(var d=.03*(a-2*i+o),v=.03*(r-2*s+h),m=.006*(3*(i-o)-a+l),p=.006*(3*(s-h)-r+c),g=2*d+m,y=2*v+p,k=.3*(i-a)+d+.16666667*m,w=.3*(s-r)+v+.16666667*p,b=a+k,x=r+w,I=f+18;ft){var i=this.frames[e],s=this.frames[e+n];return s+(t-i)/(r[a]-i)*(r[a+1]-s)}var o=a+18;for(a+=2;a=t){var h=r[a-2],l=r[a-1];return l+(t-h)/(r[a]-h)*(r[a+1]-l)}e+=this.getFrameEntries();var c=r[o-2],u=r[o-1];return u+(t-c)/(this.frames[e]-c)*(this.frames[e+n]-u)}}])}(G),j=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,[a]])}return c(e,t),h(e,[{key:"getFrameEntries",value:function(){return 2}},{key:"setFrame",value:function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+1]=n}},{key:"getCurveValue",value:function(t){for(var e=this.frames,n=e.length-2,a=2;a<=n;a+=2)if(e[a]>t){n=a-2;break}var r=this.curves[n>>1];switch(r){case 0:var i=e[n],s=e[n+1];return s+(t-i)/(e[n+2]-i)*(e[n+2+1]-s);case 1:return e[n+1]}return this.getBezierValue(t,n,1,r-2)}},{key:"getRelativeValue",value:function(t,e,n,a,r){if(t>2];switch(m){case 0:var p=h[v];u=h[v+1],f=h[v+2],d=h[v+3];var g=(n-p)/(h[v+4]-p);u+=(h[v+4+1]-u)*g,f+=(h[v+4+2]-f)*g,d+=(h[v+4+3]-d)*g;break;case 1:u=h[v+1],f=h[v+2],d=h[v+3];break;default:u=this.getBezierValue(n,v,1,m-2),f=this.getBezierValue(n,v,2,m+18-2),d=this.getBezierValue(n,v,3,m+36-2)}if(1==r)l.r=u,l.g=f,l.b=d;else{if(i==V.setup){var y=o.data.color;l.r=y.r,l.g=y.g,l.b=y.b}l.r+=(u-l.r)*r,l.g+=(f-l.g)*r,l.b+=(d-l.b)*r}}}}}])}(z),ht=function(t){function e(t,n,a){var r;return s(this,e),l(r=D(this,e,[t,n,W.alpha+"|"+a]),"slotIndex",0),r.slotIndex=a,r}return c(e,t),h(e,[{key:"apply",value:function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.color;if(n>3];switch(b){case 0:var x=h[w];d=h[w+1],v=h[w+2],m=h[w+3],p=h[w+4],g=h[w+5],y=h[w+6],k=h[w+7];var I=(n-x)/(h[w+8]-x);d+=(h[w+8+1]-d)*I,v+=(h[w+8+2]-v)*I,m+=(h[w+8+3]-m)*I,p+=(h[w+8+4]-p)*I,g+=(h[w+8+5]-g)*I,y+=(h[w+8+6]-y)*I,k+=(h[w+8+7]-k)*I;break;case 1:d=h[w+1],v=h[w+2],m=h[w+3],p=h[w+4],g=h[w+5],y=h[w+6],k=h[w+7];break;default:d=this.getBezierValue(n,w,1,b-2),v=this.getBezierValue(n,w,2,b+18-2),m=this.getBezierValue(n,w,3,b+36-2),p=this.getBezierValue(n,w,4,b+54-2),g=this.getBezierValue(n,w,5,b+72-2),y=this.getBezierValue(n,w,6,b+90-2),k=this.getBezierValue(n,w,7,b+108-2)}if(1==r)l.set(d,v,m,p),c.r=g,c.g=y,c.b=k;else{if(i==V.setup){l.setFromColor(o.data.color);var E=o.data.darkColor;c.r=E.r,c.g=E.g,c.b=E.b}l.add((d-l.r)*r,(v-l.g)*r,(m-l.b)*r,(p-l.a)*r),c.r+=(g-c.r)*r,c.g+=(y-c.g)*r,c.b+=(k-c.b)*r}}}}}])}(z),ct=function(t){function e(t,n,a){var r;return s(this,e),l(r=D(this,e,[t,n,[W.rgb+"|"+a,W.rgb2+"|"+a]]),"slotIndex",0),r.slotIndex=a,r}return c(e,t),h(e,[{key:"getFrameEntries",value:function(){return 7}},{key:"setFrame",value:function(t,e,n,a,r,i,s,o){t*=7,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=a,this.frames[t+3]=r,this.frames[t+4]=i,this.frames[t+5]=s,this.frames[t+6]=o}},{key:"apply",value:function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames,l=o.color,c=o.darkColor;if(nt){var i=this.frames[e];return n[a+1]*(t-i)/(n[a]-i)}var s=a+18;for(a+=2;a=t){var o=n[a-2],h=n[a-1];return h+(t-o)/(n[a]-o)*(n[a+1]-h)}var l=n[s-2],c=n[s-1];return c+(1-c)*(t-l)/(this.frames[e+this.getFrameEntries()]-l)}},{key:"apply",value:function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h&&h instanceof N&&h.timelineAttachment==this.attachment){var l=o.deform;0==l.length&&(i=V.setup);var c=this.vertices,u=c[0].length,f=this.frames;if(n=f[f.length-1]){var p=c[f.length-1];if(1==r)if(i==V.add){var g=h;if(g.bones)for(var y=0;yn)this.apply(t,e,Number.MAX_VALUE,a,r,i,s),e=-1;else if(e>=o[h-1])return;if(!(n0&&o[l-1]==c;)l--;for(;l=o[l];l++)a.push(this.events[l])}}}}])}(G);l(dt,"propertyIds",[""+W.event]);var vt=function(t){function e(t){var n;return s(this,e),l(n=D(this,e,[t,e.propertyIds]),"drawOrders",void 0),n.drawOrders=new Array(t),n}return c(e,t),h(e,[{key:"getFrameCount",value:function(){return this.frames.length}},{key:"setFrame",value:function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n}},{key:"apply",value:function(t,e,n,a,r,i,s){if(s!=U.mixOut)if(n>2];switch(d){case 0:var v=h[f];l=h[f+1],c=h[f+2],u=h[f+3];var m=(n-v)/(h[f+4]-v);l+=(h[f+4+1]-l)*m,c+=(h[f+4+2]-c)*m,u+=(h[f+4+3]-u)*m;break;case 1:l=h[f+1],c=h[f+2],u=h[f+3];break;default:l=this.getBezierValue(n,f,1,d-2),c=this.getBezierValue(n,f,2,d+18-2),u=this.getBezierValue(n,f,3,d+36-2)}if(i==V.setup){var p=o.data;o.mixRotate=p.mixRotate+(l-p.mixRotate)*r,o.mixX=p.mixX+(c-p.mixX)*r,o.mixY=p.mixY+(u-p.mixY)*r}else o.mixRotate+=(l-o.mixRotate)*r,o.mixX+=(c-o.mixX)*r,o.mixY+=(u-o.mixY)*r}}}}])}(z),wt=function(t){function e(t,n,a,r){var i;return s(this,e),l(i=D(this,e,[t,n,r+"|"+a]),"constraintIndex",0),i.constraintIndex=a,i}return c(e,t),h(e,[{key:"apply",value:function(t,e,n,a,r,i,s){var o;if(-1==this.constraintIndex){var h,l=n>=this.frames[0]?this.getCurveValue(n):0,c=k(t.physicsConstraints);try{for(c.s();!(h=c.n()).done;){var u=h.value;u.active&&this.global(u.data)&&this.set(u,this.getAbsoluteValue2(n,r,i,this.get(u),this.setup(u),l))}}catch(t){c.e(t)}finally{c.f()}}else(o=t.physicsConstraints[this.constraintIndex]).active&&this.set(o,this.getAbsoluteValue(n,r,i,this.get(o),this.setup(o)))}}])}(j),bt=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,a,W.physicsConstraintInertia])}return c(e,t),h(e,[{key:"setup",value:function(t){return t.data.inertia}},{key:"get",value:function(t){return t.inertia}},{key:"set",value:function(t,e){t.inertia=e}},{key:"global",value:function(t){return t.inertiaGlobal}}])}(wt),xt=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,a,W.physicsConstraintStrength])}return c(e,t),h(e,[{key:"setup",value:function(t){return t.data.strength}},{key:"get",value:function(t){return t.strength}},{key:"set",value:function(t,e){t.strength=e}},{key:"global",value:function(t){return t.strengthGlobal}}])}(wt),It=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,a,W.physicsConstraintDamping])}return c(e,t),h(e,[{key:"setup",value:function(t){return t.data.damping}},{key:"get",value:function(t){return t.damping}},{key:"set",value:function(t,e){t.damping=e}},{key:"global",value:function(t){return t.dampingGlobal}}])}(wt),Et=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,a,W.physicsConstraintMass])}return c(e,t),h(e,[{key:"setup",value:function(t){return 1/t.data.massInverse}},{key:"get",value:function(t){return 1/t.massInverse}},{key:"set",value:function(t,e){t.massInverse=1/e}},{key:"global",value:function(t){return t.massGlobal}}])}(wt),At=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,a,W.physicsConstraintWind])}return c(e,t),h(e,[{key:"setup",value:function(t){return t.data.wind}},{key:"get",value:function(t){return t.wind}},{key:"set",value:function(t,e){t.wind=e}},{key:"global",value:function(t){return t.windGlobal}}])}(wt),St=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,a,W.physicsConstraintGravity])}return c(e,t),h(e,[{key:"setup",value:function(t){return t.data.gravity}},{key:"get",value:function(t){return t.gravity}},{key:"set",value:function(t,e){t.gravity=e}},{key:"global",value:function(t){return t.gravityGlobal}}])}(wt),Rt=function(t){function e(t,n,a){return s(this,e),D(this,e,[t,n,a,W.physicsConstraintMix])}return c(e,t),h(e,[{key:"setup",value:function(t){return t.data.mix}},{key:"get",value:function(t){return t.mix}},{key:"set",value:function(t,e){t.mix=e}},{key:"global",value:function(t){return t.mixGlobal}}])}(wt),Tt=function(t){function e(t,n){var a;return s(this,e),l(a=D(this,e,[t,e.propertyIds]),"constraintIndex",void 0),a.constraintIndex=n,a}return c(e,t),h(e,[{key:"getFrameCount",value:function(){return this.frames.length}},{key:"setFrame",value:function(t,e){this.frames[t]=e}},{key:"apply",value:function(t,e,n,a,r,i,s){var o;if(-1==this.constraintIndex||(o=t.physicsConstraints[this.constraintIndex]).active){var h=this.frames;if(e>n)this.apply(t,e,Number.MAX_VALUE,[],r,i,s),e=-1;else if(e>=h[h.length-1])return;if(!(n=h[G.search1(h,e)+1]))if(null!=o)o.reset();else{var l,c=k(t.physicsConstraints);try{for(c.s();!(l=c.n()).done;){var u=l.value;u.active&&u.reset()}}catch(t){c.e(t)}finally{c.f()}}}}}])}(G);l(Tt,"propertyIds",[W.physicsConstraintReset.toString()]);var Ct=function(t){function e(t,n,a){var r;return s(this,e),l(r=D(this,e,[t,[W.sequence+"|"+n+"|"+a.sequence.id]]),"slotIndex",void 0),l(r,"attachment",void 0),r.slotIndex=n,r.attachment=a,r}return c(e,t),h(e,[{key:"getFrameEntries",value:function(){return e.ENTRIES}},{key:"getSlotIndex",value:function(){return this.slotIndex}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setFrame",value:function(t,n,a,r,i){var s=this.frames;s[t*=e.ENTRIES]=n,s[t+e.MODE]=a|r<<4,s[t+e.DELAY]=i}},{key:"apply",value:function(t,n,a,r,i,s,o){var h=t.slots[this.slotIndex];if(h.bone.active){var l=h.attachment,c=this.attachment;if(l==c||l instanceof N&&l.timelineAttachment==c){var u=this.frames;if(a>4,g=this.attachment.sequence.regions.length,y=B[15&v];if(y!=L.hold)switch(p+=(a-d)/m+1e-5|0,y){case L.once:p=Math.min(g-1,p);break;case L.loop:p%=g;break;case L.pingpong:var k=(g<<1)-2;(p=0==k?0:p%k)>=g&&(p=k-p);break;case L.onceReverse:p=Math.max(g-1-p,0);break;case L.loopReverse:p=g-1-p%g;break;case L.pingpongReverse:var w=(g<<1)-2;(p=0==w?0:(p+g-1)%w)>=g&&(p=w-p)}h.sequenceIndex=p}}}}}}])}(G);l(Ct,"ENTRIES",3),l(Ct,"MODE",1),l(Ct,"DELAY",2);var Mt=function(){function t(e){s(this,t),l(this,"data",void 0),l(this,"tracks",new Array),l(this,"timeScale",1),l(this,"unkeyedState",0),l(this,"events",new Array),l(this,"listeners",new Array),l(this,"queue",new Yt(this)),l(this,"propertyIDs",new I),l(this,"animationsChanged",!1),l(this,"trackEntryPool",new F((function(){return new Pt}))),this.data=e}return h(t,[{key:"update",value:function(t){t*=this.timeScale;for(var e=this.tracks,n=0,a=e.length;n0){if(r.delay-=i,r.delay>0)continue;i=-r.delay,r.delay=0}var s=r.next;if(s){var o=r.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*s.timeScale,r.trackTime+=i,this.setCurrent(n,s,!0);s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){e[n]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=i}}this.queue.drain()}},{key:"updateMixingFrom",value:function(t,e){var n=t.mixingFrom;if(!n)return!0;var a=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),a):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)}},{key:"apply",value:function(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,n=this.tracks,a=!1,r=0,i=n.length;r0)){a=!0;var o=0==r?V.first:s.mixBlend,h=s.alpha;s.mixingFrom?h*=this.applyMixingFrom(s,t,o):s.trackTime>=s.trackEnd&&!s.next&&(h=0);var l=h>=s.alphaAttachmentThreshold,c=s.animationLast,u=s.getAnimationTime(),f=u,d=e;s.reverse&&(f=s.animation.duration-f,d=null);var v=s.animation.timelines,m=v.length;if(0==r&&1==h||o==V.add){0==r&&(l=!0);for(var p=0;p1&&(r=1),n!=V.first&&(n=a.mixBlend));var i=r=a.alphaAttachmentThreshold):(C.webkit602BugfixHelper(E,n),s&&b instanceof vt&&I==V.setup&&(x=U.mixIn),b.apply(e,u,d,v,E,I,x))}}return t.mixDuration>0&&this.queueEvents(a,f),this.events.length=0,a.nextAnimationLast=f,a.nextTrackLast=a.trackTime,r}},{key:"applyAttachmentTimeline",value:function(t,e,n,a,r){var i=e.slots[t.slotIndex];i.bone.active&&(n=0,g=d>=0;Math.abs(v)<=90&&A.signum(v)!=A.signum(f)&&(Math.abs(d-m)>180?(u+=360*A.signum(d),g=p):0!=m?u-=360*A.signum(d):g=p),g!=p&&(u+=360*A.signum(d)),i[s]=u}i[s+1]=f,h.rotation=l+u*a}}else t.apply(e,0,n,null,1,r,U.mixIn)}},{key:"queueEvents",value:function(t,e){for(var n=t.animationStart,a=t.animationEnd,r=a-n,i=t.trackLast%r,s=this.events,o=0,h=s.length;oa||this.queue.event(t,l)}var c=!1;if(t.loop)if(0==r)c=!0;else{var u=Math.floor(t.trackTime/r);c=u>0&&u>Math.floor(t.trackLast/r)}else c=e>=a&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(e){this.queue.end(e),this.clearNext(e);for(var n=e;;){var a=n.mixingFrom;if(!a)break;this.queue.end(a),n.mixingFrom=null,n.mixingTo=null,n=a}this.tracks[e.trackIndex]=null,this.queue.drain()}}}},{key:"setCurrent",value:function(t,e,n){var a=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,a&&(n&&this.queue.interrupt(a),e.mixingFrom=a,a.mixingTo=e,e.mixTime=0,a.mixingFrom&&a.mixDuration>0&&(e.interruptAlpha*=Math.min(1,a.mixTime/a.mixDuration)),a.timelinesRotation.length=0),this.queue.start(e)}},{key:"setAnimation",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=this.data.skeletonData.findAnimation(e);if(!a)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,a,n)}},{key:"setAnimationWith",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)throw new Error("animation cannot be null.");var a=!0,r=this.expandToIndex(t);r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,a=!1):this.clearNext(r));var i=this.trackEntry(t,e,n,r);return this.setCurrent(t,i,a),this.queue.drain(),i}},{key:"addAnimation",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,n,a)}},{key:"addAnimationWith",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;var i=this.trackEntry(t,e,n,r);return r?(r.next=i,i.previous=r,a<=0&&(a+=r.getTrackComplete()-i.mixDuration)):(this.setCurrent(t,i,!0),this.queue.drain()),i.delay=a,i}},{key:"setEmptyAnimation",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=this.setAnimationWith(e,t.emptyAnimation(),!1);return a.mixDuration=n,a.trackEnd=n,a}},{key:"addEmptyAnimation",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.addAnimationWith(e,t.emptyAnimation(),!1,a);return a<=0&&(r.delay+=r.mixDuration-n),r.mixDuration=n,r.trackEnd=n,r}},{key:"setEmptyAnimations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,a=this.tracks.length;n0){r[h]=Bt,i[h]=u;continue t}break}r[h]=_t}else r[h]=Ot}}},{key:"getCurrent",value:function(t){return t>=this.tracks.length?null:this.tracks[t]}},{key:"addListener",value:function(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}},{key:"removeListener",value:function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}},{key:"clearListeners",value:function(){this.listeners.length=0}},{key:"clearListenerNotifications",value:function(){this.queue.clear()}}],[{key:"emptyAnimation",value:function(){return t._emptyAnimation}}])}();l(Mt,"_emptyAnimation",new q("",[],0));var Ft,Pt=h((function t(){s(this,t),l(this,"animation",null),l(this,"previous",null),l(this,"next",null),l(this,"mixingFrom",null),l(this,"mixingTo",null),l(this,"listener",null),l(this,"trackIndex",0),l(this,"loop",!1),l(this,"holdPrevious",!1),l(this,"reverse",!1),l(this,"shortestRotation",!1),l(this,"eventThreshold",0),l(this,"mixAttachmentThreshold",0),l(this,"alphaAttachmentThreshold",0),l(this,"mixDrawOrderThreshold",0),l(this,"animationStart",0),l(this,"animationEnd",0),l(this,"animationLast",0),l(this,"nextAnimationLast",0),l(this,"delay",0),l(this,"trackTime",0),l(this,"trackLast",0),l(this,"nextTrackLast",0),l(this,"trackEnd",0),l(this,"timeScale",0),l(this,"alpha",0),l(this,"mixTime",0),l(this,"_mixDuration",0),l(this,"interruptAlpha",0),l(this,"totalAlpha",0),l(this,"mixBlend",V.replace),l(this,"timelineMode",new Array),l(this,"timelineHoldMix",new Array),l(this,"timelinesRotation",new Array)}),[{key:"mixDuration",get:function(){return this._mixDuration},set:function(t){this._mixDuration=t}},{key:"setMixDurationWithDelay",value:function(t,e){this._mixDuration=t,null!=this.previous&&e<=0&&(e+=this.previous.getTrackComplete()-t),this.delay=e}},{key:"reset",value:function(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}},{key:"getAnimationTime",value:function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}},{key:"setAnimationLast",value:function(t){this.animationLast=t,this.nextAnimationLast=t}},{key:"isComplete",value:function(){return this.trackTime>=this.animationEnd-this.animationStart}},{key:"resetRotationDirections",value:function(){this.timelinesRotation.length=0}},{key:"getTrackComplete",value:function(){var t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime=0}}]),Yt=h((function t(e){s(this,t),l(this,"objects",[]),l(this,"drainDisabled",!1),l(this,"animState",void 0),this.animState=e}),[{key:"start",value:function(t){this.objects.push(Ft.start),this.objects.push(t),this.animState.animationsChanged=!0}},{key:"interrupt",value:function(t){this.objects.push(Ft.interrupt),this.objects.push(t)}},{key:"end",value:function(t){this.objects.push(Ft.end),this.objects.push(t),this.animState.animationsChanged=!0}},{key:"dispose",value:function(t){this.objects.push(Ft.dispose),this.objects.push(t)}},{key:"complete",value:function(t){this.objects.push(Ft.complete),this.objects.push(t)}},{key:"event",value:function(t,e){this.objects.push(Ft.event),this.objects.push(t),this.objects.push(e)}},{key:"drain",value:function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,n=0;n0&&u&&u.length>0&&(f.names=c,f.values=u,c=null,u=null),f.u=f.x/h.width,f.v=f.y/h.height,90==f.degrees?(f.u2=(f.x+f.height)/h.width,f.v2=(f.y+f.width)/h.height):(f.u2=(f.x+f.width)/h.width,f.v2=(f.y+f.height)/h.height),this.regions.push(f)}else{for(h=new Qt(o.trim());0!=n.readEntry(a,o=n.readLine());){var g=r[a[0]];g&&g(h)}this.pages.push(h)}}),[{key:"findRegion",value:function(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:"",a=k(this.pages);try{for(a.s();!(e=a.n()).done;){var r=e.value;r.setTexture(t.get(n+r.name))}}catch(t){a.e(t)}finally{a.f()}}},{key:"dispose",value:function(){for(var t=0;t=this.lines.length?null:this.lines[this.index++]}},{key:"readEntry",value:function(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;var n=e.indexOf(":");if(-1==n)return 0;t[0]=e.substr(0,n).trim();for(var a=1,r=n+1;;a++){var i=e.indexOf(",",r);if(-1==i)return t[a]=e.substr(r).trim(),a;if(t[a]=e.substr(r,i-r).trim(),r=i+1,4==a)return 4}}}]),Qt=h((function t(e){s(this,t),l(this,"name",void 0),l(this,"minFilter",Gt.Nearest),l(this,"magFilter",Gt.Nearest),l(this,"uWrap",zt.ClampToEdge),l(this,"vWrap",zt.ClampToEdge),l(this,"texture",null),l(this,"width",0),l(this,"height",0),l(this,"pma",!1),l(this,"regions",new Array),this.name=e}),[{key:"setTexture",value:function(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);var e,n=k(this.regions);try{for(n.s();!(e=n.n()).done;)e.value.texture=t}catch(t){n.e(t)}finally{n.f()}}}]),Zt=function(t){function e(t,n){var a,r,i,o;return s(this,e),r=this,i=u(i=e),l(a=d(r,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,[],u(r).constructor):i.apply(r,o)),"page",void 0),l(a,"name",void 0),l(a,"x",0),l(a,"y",0),l(a,"offsetX",0),l(a,"offsetY",0),l(a,"originalWidth",0),l(a,"originalHeight",0),l(a,"index",0),l(a,"degrees",0),l(a,"names",null),l(a,"values",null),a.page=t,a.name=n,t.regions.push(a),a}return c(e,t),h(e)}(Ht);var te=function(t){function e(t,n){var a,r,i,o;return s(this,e),r=this,o=[t],i=u(i=e),l(a=d(r,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,o||[],u(r).constructor):i.apply(r,o)),"region",null),l(a,"path",void 0),l(a,"regionUVs",[]),l(a,"uvs",[]),l(a,"triangles",[]),l(a,"color",new E(1,1,1,1)),l(a,"width",0),l(a,"height",0),l(a,"hullLength",0),l(a,"edges",[]),l(a,"parentMesh",null),l(a,"sequence",null),l(a,"tempColor",new E(0,0,0,0)),a.path=n,a}return c(e,t),h(e,[{key:"updateRegion",value:function(){if(!this.region)throw new Error("Region not set.");var t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=C.newFloatArray(t.length));var e=this.uvs,n=this.uvs.length,a=this.region.u,r=this.region.v,i=0,s=0;if(this.region instanceof Zt){var o=this.region,h=o.page,l=h.width,c=h.height;switch(o.degrees){case 90:a-=(o.originalHeight-o.offsetY-o.height)/l,r-=(o.originalWidth-o.offsetX-o.width)/c,i=o.originalHeight/l,s=o.originalWidth/c;for(var u=0;u= 0.");if(!n)throw new Error("name cannot be null.");this.index=e,this.name=n,this.parent=a}));!function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(re||(re={}));var oe=h((function t(e,n,a){if(s(this,t),l(this,"data",void 0),l(this,"skeleton",void 0),l(this,"parent",null),l(this,"children",new Array),l(this,"x",0),l(this,"y",0),l(this,"rotation",0),l(this,"scaleX",0),l(this,"scaleY",0),l(this,"shearX",0),l(this,"shearY",0),l(this,"ax",0),l(this,"ay",0),l(this,"arotation",0),l(this,"ascaleX",0),l(this,"ascaleY",0),l(this,"ashearX",0),l(this,"ashearY",0),l(this,"a",0),l(this,"b",0),l(this,"c",0),l(this,"d",0),l(this,"worldY",0),l(this,"worldX",0),l(this,"inherit",re.Normal),l(this,"sorted",!1),l(this,"active",!1),!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=n,this.parent=a,this.setToSetupPose()}),[{key:"isActive",value:function(){return this.active}},{key:"update",value:function(t){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}},{key:"updateWorldTransform",value:function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}},{key:"updateWorldTransformWith",value:function(t,e,n,a,r,i,s){this.ax=t,this.ay=e,this.arotation=n,this.ascaleX=a,this.ascaleY=r,this.ashearX=i,this.ashearY=s;var o=this.parent;if(!o){var h=this.skeleton,l=h.scaleX,c=h.scaleY,u=(n+i)*A.degRad,f=(n+90+s)*A.degRad;return this.a=Math.cos(u)*a*l,this.b=Math.cos(f)*r*l,this.c=Math.sin(u)*a*c,this.d=Math.sin(f)*r*c,this.worldX=t*l+h.x,void(this.worldY=e*c+h.y)}var d=o.a,v=o.b,m=o.c,p=o.d;switch(this.worldX=d*t+v*e+o.worldX,this.worldY=m*t+p*e+o.worldY,this.inherit){case re.Normal:var g=(n+i)*A.degRad,y=(n+90+s)*A.degRad,k=Math.cos(g)*a,w=Math.cos(y)*r,b=Math.sin(g)*a,x=Math.sin(y)*r;return this.a=d*k+v*b,this.b=d*w+v*x,this.c=m*k+p*b,void(this.d=m*w+p*x);case re.OnlyTranslation:var I=(n+i)*A.degRad,E=(n+90+s)*A.degRad;this.a=Math.cos(I)*a,this.b=Math.cos(E)*r,this.c=Math.sin(I)*a,this.d=Math.sin(E)*r;break;case re.NoRotationOrReflection:var S=d*d+m*m,R=0;S>1e-4?(S=Math.abs(d*p-v*m)/S,d/=this.skeleton.scaleX,v=(m/=this.skeleton.scaleY)*S,p=d*S,R=Math.atan2(m,d)*A.radDeg):(d=0,m=0,R=90-Math.atan2(p,v)*A.radDeg);var T=(n+i-R)*A.degRad,C=(n+s-R+90)*A.degRad,M=Math.cos(T)*a,F=Math.cos(C)*r,P=Math.sin(T)*a,Y=Math.sin(C)*r;this.a=d*M-v*P,this.b=d*F-v*Y,this.c=m*M+p*P,this.d=m*F+p*Y;break;case re.NoScale:case re.NoScaleOrReflection:n*=A.degRad;var X=Math.cos(n),O=Math.sin(n),N=(d*X+v*O)/this.skeleton.scaleX,L=(m*X+p*O)/this.skeleton.scaleY,_=Math.sqrt(N*N+L*L);_>1e-5&&(_=1/_),N*=_,L*=_,_=Math.sqrt(N*N+L*L),this.inherit==re.NoScale&&d*p-v*m<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(_=-_),n=Math.PI/2+Math.atan2(L,N);var B=Math.cos(n)*_,D=Math.sin(n)*_;i*=A.degRad,s=(90+s)*A.degRad;var V=Math.cos(i)*a,U=Math.cos(s)*r,q=Math.sin(i)*a,W=Math.sin(s)*r;this.a=N*V+B*q,this.b=N*U+B*W,this.c=L*V+D*q,this.d=L*U+D*W}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}},{key:"setToSetupPose",value:function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY,this.inherit=t.inherit}},{key:"updateAppliedTransform",value:function(){var t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*A.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*A.radDeg);var e,n,a,r,i=t.a,s=t.b,o=t.c,h=t.d,l=1/(i*h-s*o),c=h*l,u=s*l,f=o*l,d=i*l,v=this.worldX-t.worldX,m=this.worldY-t.worldY;if(this.ax=v*c-m*u,this.ay=m*d-v*f,this.inherit==re.OnlyTranslation)e=this.a,n=this.b,a=this.c,r=this.d;else{switch(this.inherit){case re.NoRotationOrReflection:var p=Math.abs(i*h-s*o)/(i*i+o*o),g=i/this.skeleton.scaleX;s=-o/this.skeleton.scaleY*p*this.skeleton.scaleX,c=(h=g*p*this.skeleton.scaleY)*(l=1/(i*h-s*o)),u=s*l;break;case re.NoScale:case re.NoScaleOrReflection:var y=A.cosDeg(this.rotation),k=A.sinDeg(this.rotation);i=(i*y+s*k)/this.skeleton.scaleX,o=(o*y+h*k)/this.skeleton.scaleY;var w=Math.sqrt(i*i+o*o);w>1e-5&&(w=1/w),i*=w,o*=w,w=Math.sqrt(i*i+o*o),this.inherit==re.NoScale&&l<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(w=-w);var b=A.PI/2+Math.atan2(o,i);s=Math.cos(b)*w,c=(h=Math.sin(b)*w)*(l=1/(i*h-s*o)),u=s*l,f=o*l,d=i*l}e=c*this.a-u*this.c,n=c*this.b-u*this.d,a=d*this.c-f*this.a,r=d*this.d-f*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(e*e+a*a),this.ascaleX>1e-4){var x=e*r-n*a;this.ascaleY=x/this.ascaleX,this.ashearY=-Math.atan2(e*n+a*r,x)*A.radDeg,this.arotation=Math.atan2(a,e)*A.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(n*n+r*r),this.ashearY=0,this.arotation=90-Math.atan2(r,n)*A.radDeg}},{key:"getWorldRotationX",value:function(){return Math.atan2(this.c,this.a)*A.radDeg}},{key:"getWorldRotationY",value:function(){return Math.atan2(this.d,this.b)*A.radDeg}},{key:"getWorldScaleX",value:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},{key:"getWorldScaleY",value:function(){return Math.sqrt(this.b*this.b+this.d*this.d)}},{key:"worldToLocal",value:function(t){var e=1/(this.a*this.d-this.b*this.c),n=t.x-this.worldX,a=t.y-this.worldY;return t.x=n*this.d*e-a*this.b*e,t.y=a*this.a*e-n*this.c*e,t}},{key:"localToWorld",value:function(t){var e=t.x,n=t.y;return t.x=e*this.a+n*this.b+this.worldX,t.y=e*this.c+n*this.d+this.worldY,t}},{key:"worldToParent",value:function(t){if(null==t)throw new Error("world cannot be null.");return null==this.parent?t:this.parent.worldToLocal(t)}},{key:"parentToWorld",value:function(t){if(null==t)throw new Error("world cannot be null.");return null==this.parent?t:this.parent.localToWorld(t)}},{key:"worldToLocalRotation",value:function(t){var e=A.sinDeg(t),n=A.cosDeg(t);return Math.atan2(this.a*e-this.c*n,this.d*n-this.b*e)*A.radDeg+this.rotation-this.shearX}},{key:"localToWorldRotation",value:function(t){t-=this.rotation-this.shearX;var e=A.sinDeg(t),n=A.cosDeg(t);return Math.atan2(n*this.c+e*this.d,n*this.a+e*this.b)*A.radDeg}},{key:"rotateWorld",value:function(t){t*=A.degRad;var e=Math.sin(t),n=Math.cos(t),a=this.a,r=this.b;this.a=n*a-e*this.c,this.b=n*r-e*this.d,this.c=e*a+n*this.c,this.d=e*r+n*this.d}}]),he=h((function t(e,n,a){s(this,t),l(this,"name",void 0),l(this,"order",void 0),l(this,"skinRequired",void 0),this.name=e,this.order=n,this.skinRequired=a})),le=h((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ce;s(this,t),l(this,"pathPrefix",""),l(this,"textureLoader",void 0),l(this,"downloader",void 0),l(this,"assets",{}),l(this,"errors",{}),l(this,"toLoad",0),l(this,"loaded",0),this.textureLoader=e,this.pathPrefix=n,this.downloader=a}),[{key:"start",value:function(t){return this.toLoad++,this.pathPrefix+t}},{key:"success",value:function(t,e,n){this.toLoad--,this.loaded++,this.assets[e]=n,t&&t(e,n)}},{key:"error",value:function(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)}},{key:"loadAll",value:function(){var t=this;return new Promise((function(e,n){requestAnimationFrame((function a(){t.isLoadingComplete()?t.hasErrors()?n(t.errors):e(t):requestAnimationFrame(a)}))}))}},{key:"setRawDataURI",value:function(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}},{key:"loadBinary",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadBinary(t,(function(a){e.success(n,t,a)}),(function(n,r){e.error(a,t,"Couldn't load binary ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"loadText",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadText(t,(function(a){e.success(n,t,a)}),(function(n,r){e.error(a,t,"Couldn't load text ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"loadJson",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadJson(t,(function(a){e.success(n,t,a)}),(function(n,r){e.error(a,t,"Couldn't load JSON ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"loadTexture",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(t=this.start(t),"undefined"!=typeof window&&"undefined"!=typeof navigator&&window.document){var r=new Image;r.crossOrigin="anonymous",r.onload=function(){e.success(n,t,e.textureLoader(r))},r.onerror=function(){e.error(a,t,"Couldn't load image: ".concat(t))},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),r.src=t}else fetch(t,{mode:"cors"}).then((function(n){return n.ok?n.blob():(e.error(a,t,"Couldn't load image: ".concat(t)),null)})).then((function(t){return t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null})).then((function(a){a&&e.success(n,t,e.textureLoader(a))}))}},{key:"loadTextureAtlas",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=arguments.length>3?arguments[3]:void 0,i=t.lastIndexOf("/"),s=i>=0?t.substring(0,i+1):"";t=this.start(t),this.downloader.downloadText(t,(function(i){try{var o,h=new Jt(i),l=h.pages.length,c=!1,u=k(h.pages);try{var f=function(){var i=o.value;e.loadTexture(r?r[i.name]:s+i.name,(function(a,r){c||(i.setTexture(r),0==--l&&e.success(n,t,h))}),(function(n,r){c||e.error(a,t,"Couldn't load texture atlas ".concat(t," page image: ").concat(n)),c=!0}))};for(u.s();!(o=u.n()).done;)f()}catch(t){u.e(t)}finally{u.f()}}catch(n){e.error(a,t,"Couldn't parse texture atlas ".concat(t,": ").concat(n.message))}}),(function(n,r){e.error(a,t,"Couldn't load texture atlas ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"get",value:function(t){return this.assets[this.pathPrefix+t]}},{key:"require",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];if(e)return e;var n=this.errors[t];throw Error("Asset not found: "+t+(n?"\n"+n:""))}},{key:"remove",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}},{key:"removeAll",value:function(){for(var t in this.assets){var e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}},{key:"isLoadingComplete",value:function(){return 0==this.toLoad}},{key:"getToLoad",value:function(){return this.toLoad}},{key:"getLoaded",value:function(){return this.loaded}},{key:"dispose",value:function(){this.removeAll()}},{key:"hasErrors",value:function(){return Object.keys(this.errors).length>0}},{key:"getErrors",value:function(){return this.errors}}]),ce=h((function t(){s(this,t),l(this,"callbacks",{}),l(this,"rawDataUris",{})}),[{key:"dataUriToString",value:function(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");var e=t.indexOf("base64,");return-1!=e?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}},{key:"base64ToUint8Array",value:function(t){for(var e=window.atob(t),n=e.length,a=new Uint8Array(n),r=0;r180?f-=360:f<-180&&(f+=360);var b=t.ascaleX,x=t.ascaleY;if(a||r){switch(t.inherit){case re.NoScale:case re.NoScaleOrReflection:d=e-t.worldX,v=n-t.worldY}var I=t.data.length*b;if(I>1e-4){var E=d*d+v*v;if(a&&EI*I){var S=(Math.sqrt(E)/I-1)*s+1;b*=S,i&&(x*=S)}}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*s,b,x,t.ashearX,t.ashearY)}},{key:"apply2",value:function(t,e,n,a,r,i,s,o,h){if(t.inherit==re.Normal&&e.inherit==re.Normal){var l=t.ax,c=t.ay,u=t.ascaleX,f=t.ascaleY,d=u,v=f,m=e.ascaleX,p=0,g=0,y=0;u<0?(u=-u,p=180,y=-1):(p=0,y=1),f<0&&(f=-f,y=-y),m<0?(m=-m,g=180):g=0;var k=e.ax,w=0,b=0,x=0,I=t.a,E=t.b,S=t.c,R=t.d,T=Math.abs(u-f)<=1e-4;!T||i?(w=0,b=I*k+t.worldX,x=S*k+t.worldY):(b=I*k+E*(w=e.ay)+t.worldX,x=S*k+R*w+t.worldY);var C=t.parent;if(!C)throw new Error("IK parent must itself have a parent.");I=C.a,E=C.b,S=C.c;var M,F,P=I*(R=C.d)-E*S,Y=b-C.worldX,X=x-C.worldY,O=(Y*R-X*E)*(P=Math.abs(P)<=1e-4?0:1/P)-l,N=(X*I-Y*S)*P-c,L=Math.sqrt(O*O+N*N),_=e.data.length*m;if(L<1e-4)return this.apply1(t,n,a,!1,i,!1,h),void e.updateWorldTransformWith(k,w,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);var B=((Y=n-C.worldX)*R-(X=a-C.worldY)*E)*P-l,D=(X*I-Y*S)*P-c,V=B*B+D*D;if(0!=o){o*=u*(m+1)*.5;var U=Math.sqrt(V),q=U-L-_*u+o;if(q>0){var W=Math.min(1,q/(2*o))-1;V=(B-=(W=(q-o*(1-W*W))/U)*B)*B+(D-=W*D)*D}}t:if(T){var G=(V-L*L-(_*=u)*_)/(2*L*_);G<-1?(G=-1,F=Math.PI*r):G>1?(G=1,F=0,i&&(d*=I=(Math.sqrt(V)/(L+_)-1)*h+1,s&&(v*=I))):F=Math.acos(G)*r,I=L+_*G,E=_*Math.sin(F),M=Math.atan2(D*I-B*E,B*I+D*E)}else{var z=(I=u*_)*I,j=(E=f*_)*E,H=Math.atan2(D,B),$=-2*j*L,J=j-z;if((R=$*$-4*J*(S=j*L*L+z*V-z*j))>=0){var K=Math.sqrt(R);$<0&&(K=-K);var Q=(K=.5*-($+K))/J,Z=S/K,tt=Math.abs(Q)=-1&&S<=1&&(S=Math.acos(S),(R=(Y=I*Math.cos(S)+L)*Y+(X=E*Math.sin(S))*X)ot&&(it=S,ot=R,st=Y,ht=X)),V<=.5*(at+ot)?(M=H-Math.atan2(rt*r,nt),F=et*r):(M=H-Math.atan2(ht*r,st),F=it*r)}var lt=Math.atan2(w,k)*y,ct=t.arotation;(M=(M-lt)*A.radDeg+p-ct)>180?M-=360:M<-180&&(M+=360),t.updateWorldTransformWith(l,c,ct+M*h,d,v,0,0),ct=e.arotation,(F=((F+lt)*A.radDeg-e.ashearX)*y+g-ct)>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(k,w,ct+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}}]);var ve=function(t){function e(t){var n,a,r,i;return s(this,e),a=this,i=[t,0,!1],r=u(r=e),l(n=d(a,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(r,i||[],u(a).constructor):r.apply(a,i)),"bones",new Array),l(n,"_target",null),l(n,"bendDirection",0),l(n,"compress",!1),l(n,"stretch",!1),l(n,"uniform",!1),l(n,"mix",0),l(n,"softness",0),n}return c(e,t),h(e,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t}}])}(he);var me,pe,ge,ye=function(t){function e(t){var n,a,r,i;return s(this,e),a=this,i=[t,0,!1],r=u(r=e),l(n=d(a,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(r,i||[],u(a).constructor):r.apply(a,i)),"bones",new Array),l(n,"_target",null),l(n,"positionMode",me.Fixed),l(n,"spacingMode",pe.Fixed),l(n,"rotateMode",ge.Chain),l(n,"offsetRotation",0),l(n,"position",0),l(n,"spacing",0),l(n,"mixRotate",0),l(n,"mixX",0),l(n,"mixY",0),n}return c(e,t),h(e,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("SlotData not set.")},set:function(t){this._target=t}}])}(he);!function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(me||(me={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"}(pe||(pe={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(ge||(ge={}));var ke=function(){function t(e,n){if(s(this,t),l(this,"data",void 0),l(this,"bones",void 0),l(this,"target",void 0),l(this,"position",0),l(this,"spacing",0),l(this,"mixRotate",0),l(this,"mixX",0),l(this,"mixY",0),l(this,"spaces",new Array),l(this,"positions",new Array),l(this,"world",new Array),l(this,"curves",new Array),l(this,"lengths",new Array),l(this,"segments",new Array),l(this,"active",!1),!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(var a=0,r=e.bones.length;a0){b=u/b*v;for(var F=1;F0?A.degRad:-A.degRad}for(var z=0,j=3;z0){var et=H.a,nt=H.b,at=H.c,rt=H.d,it=0,st=0,ot=0;if(it=o?D[j-1]:0==f[z+1]?D[j+2]:Math.atan2(Q,K),it-=Math.atan2(at,et),W){st=Math.cos(it),ot=Math.sin(it);var ht=H.data.length;V+=(ht*(st*et-ot*at)-K)*a,U+=(ht*(ot*et+st*at)-Q)*a}else it+=q;it>A.PI?it-=A.PI2:it<-A.PI&&(it+=A.PI2),it*=a,st=Math.cos(it),ot=Math.sin(it),H.a=st*et-ot*at,H.b=st*nt-ot*rt,H.c=ot*et+st*at,H.d=ot*nt+st*rt}H.updateAppliedTransform()}}}}},{key:"computeWorldPositions",value:function(e,n,a){var r=this.target,i=this.position,s=this.spaces,o=C.setArraySize(this.positions,3*n+2),h=this.world,l=e.closed,c=e.worldVerticesLength,u=c/6,f=t.NONE;if(!e.constantSpeed){var d,v=e.lengths,m=v[u-=l?1:2];switch(this.data.positionMode==me.Percent&&(i*=m),this.data.spacingMode){case pe.Percent:d=m;break;case pe.Proportional:d=m/n;break;default:d=1}h=C.setArraySize(this.world,8);for(var p=0,g=0,y=0;pm){f!=t.AFTER&&(f=t.AFTER,e.computeWorldVertices(r,c-6,4,h,0,2)),this.addAfterPosition(w-m,h,0,o,g);continue}}for(;;y++){var b=v[y];if(!(w>b)){if(0==y)w/=b;else{var x=v[y-1];w=(w-x)/(b-x)}break}}y!=f&&(f=y,l&&y==u?(e.computeWorldVertices(r,c-4,4,h,0,2),e.computeWorldVertices(r,0,4,h,4,2)):e.computeWorldVertices(r,6*y+2,8,h,0,2)),this.addCurvePosition(w,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],o,g,a||p>0&&0==k)}return o}l?(c+=2,h=C.setArraySize(this.world,c),e.computeWorldVertices(r,2,c-4,h,0,2),e.computeWorldVertices(r,0,2,h,c-4,2),h[c-2]=h[0],h[c-1]=h[1]):(u--,c-=4,h=C.setArraySize(this.world,c),e.computeWorldVertices(r,2,c,h,0,2));for(var I,E=C.setArraySize(this.curves,u),A=0,S=h[0],R=h[1],T=0,M=0,F=0,P=0,Y=0,X=0,O=0,N=0,L=0,_=0,B=0,D=0,V=0,U=0,q=0,W=2;qA){this.addAfterPosition(Q-A,h,c-4,o,H);continue}}for(;;$++){var Z=E[$];if(!(Q>Z)){if(0==$)Q/=Z;else{var tt=E[$-1];Q=(Q-tt)/(Z-tt)}break}}if($!=f){f=$;var et=6*$;for(S=h[et],R=h[et+1],T=h[et+2],M=h[et+3],F=h[et+4],P=h[et+5],B=2*(O=.03*(S-2*T+F))+(L=.006*(3*(T-F)-S+(Y=h[et+6]))),D=2*(N=.03*(R-2*M+P))+(_=.006*(3*(M-P)-R+(X=h[et+7]))),V=.3*(T-S)+O+.16666667*L,U=.3*(M-R)+N+.16666667*_,z=Math.sqrt(V*V+U*U),G[0]=z,et=1;et<8;et++)V+=B,U+=D,B+=L,D+=_,z+=Math.sqrt(V*V+U*U),G[et]=z;V+=B,U+=D,z+=Math.sqrt(V*V+U*U),G[8]=z,V+=B+L,U+=D+_,z+=Math.sqrt(V*V+U*U),G[9]=z,J=0}for(Q*=z;;J++){var nt=G[J];if(!(Q>nt)){if(0==J)Q/=nt;else{var at=G[J-1];Q=J+(Q-at)/(nt-at)}break}}this.addCurvePosition(.1*Q,S,R,T,M,F,P,Y,X,o,H,a||j>0&&0==K)}return o}},{key:"addBeforePosition",value:function(t,e,n,a,r){var i=e[n],s=e[n+1],o=e[n+2]-i,h=e[n+3]-s,l=Math.atan2(h,o);a[r]=i+t*Math.cos(l),a[r+1]=s+t*Math.sin(l),a[r+2]=l}},{key:"addAfterPosition",value:function(t,e,n,a,r){var i=e[n+2],s=e[n+3],o=i-e[n],h=s-e[n+1],l=Math.atan2(h,o);a[r]=i+t*Math.cos(l),a[r+1]=s+t*Math.sin(l),a[r+2]=l}},{key:"addCurvePosition",value:function(t,e,n,a,r,i,s,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=n,void(l[c+2]=Math.atan2(r-n,a-e));var f=t*t,d=f*t,v=1-t,m=v*v,p=m*v,g=v*t,y=3*g,k=v*y,w=y*t,b=e*p+a*k+i*w+o*d,x=n*p+r*k+s*w+h*d;l[c]=b,l[c+1]=x,u&&(l[c+2]=t<.001?Math.atan2(r-n,a-e):Math.atan2(x-(n*m+r*g*2+s*f),b-(e*m+a*g*2+i*f)))}}])}();l(ke,"NONE",-1),l(ke,"BEFORE",-2),l(ke,"AFTER",-3),l(ke,"epsilon",1e-5);var we,be=h((function t(e,n){s(this,t),l(this,"data",void 0),l(this,"_bone",null),l(this,"inertia",0),l(this,"strength",0),l(this,"damping",0),l(this,"massInverse",0),l(this,"wind",0),l(this,"gravity",0),l(this,"mix",0),l(this,"_reset",!0),l(this,"ux",0),l(this,"uy",0),l(this,"cx",0),l(this,"cy",0),l(this,"tx",0),l(this,"ty",0),l(this,"xOffset",0),l(this,"xVelocity",0),l(this,"yOffset",0),l(this,"yVelocity",0),l(this,"rotateOffset",0),l(this,"rotateVelocity",0),l(this,"scaleOffset",0),l(this,"scaleVelocity",0),l(this,"active",!1),l(this,"skeleton",void 0),l(this,"remaining",0),l(this,"lastTime",0),this.data=e,this.skeleton=n,this.bone=n.bones[e.bone.index],this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}),[{key:"bone",get:function(){if(this._bone)return this._bone;throw new Error("Bone not set.")},set:function(t){this._bone=t}},{key:"reset",value:function(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}},{key:"setToSetupPose",value:function(){var t=this.data;this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}},{key:"isActive",value:function(){return this.active}},{key:"update",value:function(t){var e=this.mix;if(0!=e){var n=this.data.x>0,a=this.data.y>0,r=this.data.rotate>0||this.data.shearX>0,i=this.data.scaleX>0,s=this.bone,o=s.data.length;switch(t){case we.none:return;case we.reset:this.reset();case we.update:var h=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=h,this.lastTime=this.skeleton.time;var l=s.worldX,c=s.worldY;if(this._reset)this._reset=!1,this.ux=l,this.uy=c;else{var u=this.remaining,f=this.inertia,d=this.data.limit*h,v=this.data.step,m=this.skeleton.data.referenceScale,p=-1;if(n||a){if(n){var g=(this.ux-l)*f;this.xOffset+=g>d?d:g<-d?-d:g,this.ux=l}if(a){var y=(this.uy-c)*f;this.yOffset+=y>d?d:y<-d?-d:y,this.uy=c}if(u>=v){p=Math.pow(this.damping,60*v);var k=this.massInverse*v,w=this.strength,b=this.wind*m,x=(Ee.yDown?-this.gravity:this.gravity)*m;do{n&&(this.xVelocity+=(b-this.xOffset*w)*k,this.xOffset+=this.xVelocity*v,this.xVelocity*=p),a&&(this.yVelocity-=(x+this.yOffset*w)*k,this.yOffset+=this.yVelocity*v,this.yVelocity*=p),u-=v}while(u>=v)}n&&(s.worldX+=this.xOffset*e*this.data.x),a&&(s.worldY+=this.yOffset*e*this.data.y)}if(r||i){var I=Math.atan2(s.c,s.a),E=0,S=0,R=0,T=this.cx-s.worldX,C=this.cy-s.worldY;if(T>d?T=d:T<-d&&(T=-d),C>d?C=d:C<-d&&(C=-d),r){R=(this.data.rotate+this.data.shearX)*e;var M=Math.atan2(C+this.ty,T+this.tx)-I-this.rotateOffset*R;this.rotateOffset+=(M-Math.ceil(M*A.invPI2-.5)*A.PI2)*f,M=this.rotateOffset*R+I,E=Math.cos(M),S=Math.sin(M),i&&(M=o*s.getWorldScaleX())>0&&(this.scaleOffset+=(T*E+C*S)*f/M)}else{E=Math.cos(I),S=Math.sin(I);var F=o*s.getWorldScaleX();F>0&&(this.scaleOffset+=(T*E+C*S)*f/F)}if((u=this.remaining)>=v){-1==p&&(p=Math.pow(this.damping,60*v));for(var P=this.massInverse*v,Y=this.strength,X=this.wind,O=Ee.yDown?-this.gravity:this.gravity,N=o/m;;)if(u-=v,i&&(this.scaleVelocity+=(X*E-O*S-this.scaleOffset*Y)*P,this.scaleOffset+=this.scaleVelocity*v,this.scaleVelocity*=p),r){if(this.rotateVelocity-=((X*S+O*E)*N+this.rotateOffset*Y)*P,this.rotateOffset+=this.rotateVelocity*v,this.rotateVelocity*=p,u0){var U=0;this.data.rotate>0&&(U=_*this.data.rotate,B=Math.sin(U),D=Math.cos(U),V=s.b,s.b=D*V-B*s.d,s.d=B*V+D*s.d),U+=_*this.data.shearX,B=Math.sin(U),D=Math.cos(U),V=s.a,s.a=D*V-B*s.c,s.c=B*V+D*s.c}else _*=this.data.rotate,B=Math.sin(_),D=Math.cos(_),V=s.a,s.a=D*V-B*s.c,s.c=B*V+D*s.c,V=s.b,s.b=D*V-B*s.d,s.d=B*V+D*s.d}if(i){var q=1+this.scaleOffset*e*this.data.scaleX;s.a*=q,s.c*=q}t!=we.pose&&(this.tx=o*s.a,this.ty=o*s.c),s.updateAppliedTransform()}}},{key:"translate",value:function(t,e){this.ux-=t,this.uy-=e,this.cx-=t,this.cy-=e}},{key:"rotate",value:function(t,e,n){var a=n*A.degRad,r=Math.cos(a),i=Math.sin(a),s=this.cx-t,o=this.cy-e;this.translate(s*r-o*i-s,s*i+o*r-o)}}]),xe=h((function t(e,n){if(s(this,t),l(this,"data",void 0),l(this,"bone",void 0),l(this,"color",void 0),l(this,"darkColor",null),l(this,"attachment",null),l(this,"attachmentState",0),l(this,"sequenceIndex",-1),l(this,"deform",new Array),!e)throw new Error("data cannot be null.");if(!n)throw new Error("bone cannot be null.");this.data=e,this.bone=n,this.color=new E,this.darkColor=e.darkColor?new E:null,this.setToSetupPose()}),[{key:"getSkeleton",value:function(){return this.bone.skeleton}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setAttachment",value:function(t){this.attachment!=t&&(t instanceof N&&this.attachment instanceof N&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}},{key:"setToSetupPose",value:function(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}}]),Ie=h((function t(e,n){if(s(this,t),l(this,"data",void 0),l(this,"bones",void 0),l(this,"target",void 0),l(this,"mixRotate",0),l(this,"mixX",0),l(this,"mixY",0),l(this,"mixScaleX",0),l(this,"mixScaleY",0),l(this,"mixShearY",0),l(this,"temp",new P),l(this,"active",!1),!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(var a=0;a0?A.degRad:-A.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pA.PI?I-=A.PI2:I<-A.PI&&(I+=A.PI2),I*=t;var E=Math.cos(I),S=Math.sin(I);y.a=E*k-S*b,y.b=E*w-S*x,y.c=S*k+E*b,y.d=S*w+E*x}if(s){var R=this.temp;o.localToWorld(R.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(R.x-y.worldX)*e,y.worldY+=(R.y-y.worldY)*n}if(0!=a){var T=Math.sqrt(y.a*y.a+y.c*y.c);0!=T&&(T=(T+(Math.sqrt(h*h+c*c)-T+this.data.offsetScaleX)*a)/T),y.a*=T,y.c*=T}if(0!=r){var C=Math.sqrt(y.b*y.b+y.d*y.d);0!=C&&(C=(C+(Math.sqrt(l*l+u*u)-C+this.data.offsetScaleY)*r)/C),y.b*=C,y.d*=C}if(i>0){var M=y.b,F=y.d,P=Math.atan2(F,M),Y=Math.atan2(u,l)-Math.atan2(c,h)-(P-Math.atan2(y.c,y.a));Y>A.PI?Y-=A.PI2:Y<-A.PI&&(Y+=A.PI2),Y=P+(Y+v)*i;var X=Math.sqrt(M*M+F*F);y.b=Math.cos(Y)*X,y.d=Math.sin(Y)*X}y.updateAppliedTransform()}}},{key:"applyRelativeWorld",value:function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,a=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=0!=e||0!=n,o=this.target,h=o.a,l=o.b,c=o.c,u=o.d,f=h*u-l*c>0?A.degRad:-A.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pA.PI?I-=A.PI2:I<-A.PI&&(I+=A.PI2),I*=t;var E=Math.cos(I),S=Math.sin(I);y.a=E*k-S*b,y.b=E*w-S*x,y.c=S*k+E*b,y.d=S*w+E*x}if(s){var R=this.temp;o.localToWorld(R.set(this.data.offsetX,this.data.offsetY)),y.worldX+=R.x*e,y.worldY+=R.y*n}if(0!=a){var T=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleX)*a+1;y.a*=T,y.c*=T}if(0!=r){var C=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleY)*r+1;y.b*=C,y.d*=C}if(i>0){var M=Math.atan2(u,l)-Math.atan2(c,h);M>A.PI?M-=A.PI2:M<-A.PI&&(M+=A.PI2);var F=y.b,P=y.d;M=Math.atan2(P,F)+(M-A.PI/2+v)*i;var Y=Math.sqrt(F*F+P*P);y.b=Math.cos(M)*Y,y.d=Math.sin(M)*Y}y.updateAppliedTransform()}}},{key:"applyAbsoluteLocal",value:function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,a=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=this.target,o=this.bones,h=0,l=o.length;h2&&void 0!==arguments[2]?arguments[2]:new Array(2),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(!e)throw new Error("offset cannot be null.");if(!n)throw new Error("size cannot be null.");for(var i=this.drawOrder,s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=0,u=i.length;c0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0;s(this,t),l(this,"slotIndex",void 0),l(this,"name",void 0),l(this,"attachment",void 0),this.slotIndex=e,this.name=n,this.attachment=a})),Ce=h((function t(e){if(s(this,t),l(this,"name",void 0),l(this,"attachments",new Array),l(this,"bones",Array()),l(this,"constraints",new Array),l(this,"color",new E(.99607843,.61960787,.30980393,1)),!e)throw new Error("name cannot be null.");this.name=e}),[{key:"setAttachment",value:function(t,e,n){if(!n)throw new Error("attachment cannot be null.");var a=this.attachments;t>=a.length&&(a.length=t+1),a[t]||(a[t]={}),a[t][e]=n}},{key:"addSkin",value:function(t){for(var e=0;e= 0.");if(!n)throw new Error("name cannot be null.");if(!a)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=a}));!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(Ae||(Ae={}));var Fe,Pe=function(t){function e(t){var n,a,r,i;return s(this,e),a=this,i=[t,0,!1],r=u(r=e),l(n=d(a,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(r,i||[],u(a).constructor):r.apply(a,i)),"bones",new Array),l(n,"_target",null),l(n,"mixRotate",0),l(n,"mixX",0),l(n,"mixY",0),l(n,"mixScaleX",0),l(n,"mixScaleY",0),l(n,"mixShearY",0),l(n,"offsetRotation",0),l(n,"offsetX",0),l(n,"offsetY",0),l(n,"offsetScaleX",0),l(n,"offsetScaleY",0),l(n,"offsetShearY",0),l(n,"relative",!1),l(n,"local",!1),n}return c(e,t),h(e,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t}}])}(he),Ye=h((function t(e){s(this,t),l(this,"scale",1),l(this,"attachmentLoader",void 0),l(this,"linkedMeshes",new Array),this.attachmentLoader=e}),[{key:"readSkeletonData",value:function(t){var e=this.scale,n=new Re;n.name="";var a=new Xe(t),r=a.readInt32(),i=a.readInt32();n.hash=0==i&&0==r?null:i.toString(16)+r.toString(16),n.version=a.readString(),n.x=a.readFloat(),n.y=a.readFloat(),n.width=a.readFloat(),n.height=a.readFloat(),n.referenceScale=a.readFloat()*e;var s=a.readBoolean();s&&(n.fps=a.readFloat(),n.imagesPath=a.readString(),n.audioPath=a.readString());var o=0;o=a.readInt(!0);for(var h=0;h>1&3,L.rotateMode=B>>3&3,0!=(128&B)&&(L.offsetRotation=a.readFloat()),L.position=a.readFloat(),L.positionMode==me.Fixed&&(L.position*=e),L.spacing=a.readFloat(),L.spacingMode!=pe.Length&&L.spacingMode!=pe.Fixed||(L.spacing*=e),L.mixRotate=a.readFloat(),L.mixX=a.readFloat(),L.mixY=a.readFloat(),n.pathConstraints.push(L)}o=a.readInt(!0);for(var D=0;D>4,t.readFloat())}a.push(tr)}}var rr=t.readInt(!0);if(rr>0){for(var ir=new vt(rr),sr=n.slots.length,or=0;or=0;ur--)cr[ur]=-1;for(var fr=C.newArray(sr-lr,0),dr=0,vr=0,mr=0;mr=0;gr--)-1==cr[gr]&&(cr[gr]=fr[--vr]);ir.setFrame(or,hr,cr)}a.push(ir)}var yr=t.readInt(!0);if(yr>0){for(var kr=new dt(yr),wr=0;wr1&&void 0!==arguments[1]?arguments[1]:new Array,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new DataView(e.buffer);s(this,t),l(this,"strings",void 0),l(this,"index",void 0),l(this,"buffer",void 0),this.strings=n,this.index=a,this.buffer=r}),[{key:"readByte",value:function(){return this.buffer.getInt8(this.index++)}},{key:"readUnsignedByte",value:function(){return this.buffer.getUint8(this.index++)}},{key:"readShort",value:function(){var t=this.buffer.getInt16(this.index);return this.index+=2,t}},{key:"readInt32",value:function(){var t=this.buffer.getInt32(this.index);return this.index+=4,t}},{key:"readInt",value:function(t){var e=this.readByte(),n=127&e;return 0!=(128&e)&&(n|=(127&(e=this.readByte()))<<7,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<14,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<21,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<28)))),t?n:n>>>1^-(1&n)}},{key:"readStringRef",value:function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]}},{key:"readString",value:function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",n=0;n>4){case 12:case 13:e+=String.fromCharCode((31&a)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&a)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(a),n++}}return e}},{key:"readFloat",value:function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t}},{key:"readBoolean",value:function(){return 0!=this.readByte()}}]),Oe=h((function t(e,n,a,r,i){s(this,t),l(this,"parent",void 0),l(this,"skinIndex",void 0),l(this,"slotIndex",void 0),l(this,"mesh",void 0),l(this,"inheritTimeline",void 0),this.mesh=e,this.skinIndex=n,this.slotIndex=a,this.parent=r,this.inheritTimeline=i})),Ne=h((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;s(this,t),l(this,"bones",void 0),l(this,"vertices",void 0),l(this,"length",void 0),this.bones=e,this.vertices=n,this.length=a}));function Le(t,e,n){for(var a=t.readFloat(),r=t.readFloat()*n,i=0,s=0,o=e.getFrameCount()-1;e.setFrame(i,a,r),i!=o;i++){var h=t.readFloat(),l=t.readFloat()*n;switch(t.readByte()){case yn:e.setStepped(i);break;case kn:Be(t,e,s++,i,0,a,h,r,l,n)}a=h,r=l}return e}function _e(t,e,n){for(var a=t.readFloat(),r=t.readFloat()*n,i=t.readFloat()*n,s=0,o=0,h=e.getFrameCount()-1;e.setFrame(s,a,r,i),s!=h;s++){var l=t.readFloat(),c=t.readFloat()*n,u=t.readFloat()*n;switch(t.readByte()){case yn:e.setStepped(s);break;case kn:Be(t,e,o++,s,0,a,l,r,c,n),Be(t,e,o++,s,1,a,l,i,u,n)}a=l,r=c,i=u}return e}function Be(t,e,n,a,r,i,s,o,h,l){e.setBezier(n,a,r,i,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,s,h)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(Fe||(Fe={}));var De,Ve=0,Ue=1,qe=2,We=3,Ge=4,ze=5,je=6,He=7,$e=8,Je=9,Ke=10,Qe=0,Ze=1,tn=2,en=3,nn=4,an=5,rn=0,sn=1,on=0,hn=1,ln=2,cn=0,un=1,fn=2,dn=4,vn=5,mn=6,pn=7,gn=8,yn=1,kn=2,wn=h((function t(){s(this,t),l(this,"minX",0),l(this,"minY",0),l(this,"maxX",0),l(this,"maxY",0),l(this,"boundingBoxes",new Array),l(this,"polygons",new Array),l(this,"polygonPool",new F((function(){return C.newFloatArray(16)})))}),[{key:"update",value:function(t,e){if(!t)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,a=this.polygons,r=this.polygonPool,i=t.slots,s=i.length;n.length=0,r.freeAll(a),a.length=0;for(var o=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}},{key:"aabbIntersectsSegment",value:function(t,e,n,a){var r=this.minX,i=this.minY,s=this.maxX,o=this.maxY;if(t<=r&&n<=r||e<=i&&a<=i||t>=s&&n>=s||e>=o&&a>=o)return!1;var h=(a-e)/(n-t),l=h*(r-t)+e;if(l>i&&li&&lr&&cr&&ct.minX&&this.minYt.minY}},{key:"containsPoint",value:function(t,e){for(var n=this.polygons,a=0,r=n.length;a=n||l=n){var c=a[o];c+(n-h)/(l-h)*(a[i]-c)=c&&k<=d||k>=d&&k<=c)&&(k>=e&&k<=a||k>=a&&k<=e)){var w=(l*g-h*m)/y;if((w>=u&&w<=v||w>=v&&w<=u)&&(w>=n&&w<=r||w>=r&&w<=n))return!0}c=d,u=v}return!1}},{key:"getPolygon",value:function(t){if(!t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}},{key:"getWidth",value:function(){return this.maxX-this.minX}},{key:"getHeight",value:function(){return this.maxY-this.minY}}]),bn=function(){function t(){s(this,t),l(this,"convexPolygons",new Array),l(this,"convexPolygonsIndices",new Array),l(this,"indicesArray",new Array),l(this,"isConcaveArray",new Array),l(this,"triangles",new Array),l(this,"polygonPool",new F((function(){return new Array}))),l(this,"polygonIndicesPool",new F((function(){return new Array})))}return h(t,[{key:"triangulate",value:function(e){var n=e,a=e.length>>1,r=this.indicesArray;r.length=0;for(var i=0;i3;){for(var c=a-1,u=0,f=1;;){t:if(!s[u]){for(var d=r[c]<<1,v=r[u]<<1,m=r[f]<<1,p=n[d],g=n[d+1],y=n[v],k=n[v+1],w=n[m],b=n[m+1],x=(f+1)%a;x!=c;x=(x+1)%a)if(s[x]){var I=r[x]<<1,E=n[I],A=n[I+1];if(t.positiveArea(w,b,p,g,E,A)&&t.positiveArea(p,g,y,k,E,A)&&t.positiveArea(y,k,w,b,E,A))break t}break}if(0==f){do{if(!s[u])break;u--}while(u>0);break}c=u,u=f,f=(f+1)%a}l.push(r[(a+u-1)%a]),l.push(r[u]),l.push(r[(u+1)%a]),r.splice(u,1),s.splice(u,1);var S=(--a+u-1)%a,R=u==a?0:u;s[S]=t.isConcave(S,a,n,r),s[R]=t.isConcave(R,a,n,r)}return 3==a&&(l.push(r[2]),l.push(r[0]),l.push(r[1])),l}},{key:"decompose",value:function(e,n){var a=e,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var s=this.polygonIndicesPool.obtain();s.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,c=0,u=n.length;c0?(r.push(o),i.push(s)):(this.polygonPool.free(o),this.polygonIndicesPool.free(s)),(o=this.polygonPool.obtain()).length=0,o.push(m),o.push(p),o.push(g),o.push(y),o.push(k),o.push(w),(s=this.polygonIndicesPool.obtain()).length=0,s.push(f),s.push(d),s.push(v),l=t.winding(m,p,g,y,k,w),h=f)}o.length>0&&(r.push(o),i.push(s));for(var A=0,S=r.length;A=0;$--)0==(o=r[$]).length&&(r.splice($,1),this.polygonPool.free(o),s=i[$],i.splice($,1),this.polygonIndicesPool.free(s));return r}}],[{key:"isConcave",value:function(t,e,n,a){var r=a[(e+t-1)%e]<<1,i=a[t]<<1,s=a[(t+1)%e]<<1;return!this.positiveArea(n[r],n[r+1],n[i],n[i+1],n[s],n[s+1])}},{key:"positiveArea",value:function(t,e,n,a,r,i){return t*(i-a)+n*(e-i)+r*(a-e)>=0}},{key:"winding",value:function(t,e,n,a,r,i){var s=n-t,o=a-e;return r*o-i*s+s*e-t*o>=0?1:-1}}])}(),xn=function(){function t(){s(this,t),l(this,"triangulator",new bn),l(this,"clippingPolygon",new Array),l(this,"clipOutput",new Array),l(this,"clippedVertices",new Array),l(this,"clippedTriangles",new Array),l(this,"scratch",new Array),l(this,"clipAttachment",null),l(this,"clippingPolygons",null)}return h(t,[{key:"clipStart",value:function(e,n){if(this.clipAttachment)return 0;this.clipAttachment=n;var a=n.worldVerticesLength,r=C.setArraySize(this.clippingPolygon,a);n.computeWorldVertices(e,0,a,r,0,2);var i=this.clippingPolygon;t.makeClockwise(i);for(var s=this.clippingPolygons=this.triangulator.decompose(i,this.triangulator.triangulate(i)),o=0,h=s.length;o>1,I=this.clipOutput,E=C.setArraySize(r,y+2*x),A=0;A>1,D=this.clipOutput,V=C.setArraySize(h,M+B*f),U=0;U=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(n),h.push(a),h.push(r),h.push(i),h.push(t),h.push(e),o.length=0;for(var u=s.length-4,f=s,d=0;;d+=2){for(var v=f[d],m=f[d+1],p=v-f[d+2],g=m-f[d+3],y=o.length,k=h,w=0,b=h.length-2;wp*(m-A),R=g*(v-x)-p*(m-I);if(R>0){if(S){o.push(E),o.push(A);continue}var T=E-x,C=A-I,M=R/(T*g-C*p);if(!(M>=0&&M<=1)){o.push(E),o.push(A);continue}o.push(x+T*M),o.push(I+C*M)}else if(S){var F=E-x,P=A-I,Y=R/(F*g-P*p);if(!(Y>=0&&Y<=1)){o.push(E),o.push(A);continue}o.push(x+F*Y),o.push(I+P*Y),o.push(E),o.push(A)}c=!0}if(y==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),d==u)break;var X=o;(o=h).length=0,h=X}if(l!=o){l.length=0;for(var O=0,N=o.length-2;O>1;l0){var Cn=n.findPhysicsConstraint(xn);if(!Cn)throw new Error("Physics constraint not found: "+xn);En=n.physicsConstraints.indexOf(Cn)}for(var Mn in In){var Fn=In[Mn],Pn=Fn[0];if(Pn){var Yn=Fn.length;if("reset"!=Mn){var Xn=void 0;if("inertia"==Mn)Xn=new bt(Yn,Yn,En);else if("strength"==Mn)Xn=new xt(Yn,Yn,En);else if("damping"==Mn)Xn=new It(Yn,Yn,En);else if("mass"==Mn)Xn=new Et(Yn,Yn,En);else if("wind"==Mn)Xn=new At(Yn,Yn,En);else if("gravity"==Mn)Xn=new St(Yn,Yn,En);else{if("mix"!=Mn)continue;Xn=new Rt(Yn,Yn,En)}r.push(An(Fn,Xn,0,1))}else{for(var On=new Tt(Yn,En),Nn=0;null!=Pn;Pn=Fn[Nn+1],Nn++)On.setFrame(Nn,Tn(Pn,"time",0));r.push(On)}}}}if(t.attachments)for(var Ln in t.attachments){var _n=t.attachments[Ln],Bn=n.findSkin(Ln);if(!Bn)throw new Error("Skin not found: "+Ln);for(var Dn in _n){var Vn=_n[Dn],Un=n.findSlot(Dn);if(!Un)throw new Error("Slot not found: "+Dn);var qn=Un.index;for(var Wn in Vn){var Gn=Vn[Wn],zn=Bn.getAttachment(qn,Wn);for(var jn in Gn){var Hn=Gn[jn],$n=Hn[0];if($n)if("deform"==jn){for(var Jn=zn.bones,Kn=zn.vertices,Qn=Jn?Kn.length/3*2:Kn.length,Zn=new ft(Hn.length,Hn.length,qn,zn),ta=Tn($n,"time",0),ea=0,na=0;;ea++){var aa=void 0,ra=Tn($n,"vertices",null);if(ra){aa=C.newFloatArray(Qn);var ia=Tn($n,"offset",0);if(C.arrayCopy(ra,0,aa,ia,ra.length),1!=a)for(var sa=ia,oa=sa+ra.length;sa=0;Ya--)-1==Ea[Ya]&&(Ea[Ya]=Sa[--Ta])}ka.setFrame(ba,Tn(Ia,"time",0),Ea)}r.push(ka)}if(t.events){for(var Xa=new dt(t.events.length),Oa=0,Na=0;Na)?=?)"),d("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),d("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),d("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),d("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),d("COERCEPLAIN","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")),d("COERCE","".concat(h[l.COERCEPLAIN],"(?:$|[^\\d])")),d("COERCEFULL",h[l.COERCEPLAIN]+"(?:".concat(h[l.PRERELEASE],")?")+"(?:".concat(h[l.BUILD],")?")+"(?:$|[^\\d])"),d("COERCERTL",h[l.COERCE],!0),d("COERCERTLFULL",h[l.COERCEFULL],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",d("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),d("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("LONECARET","(?:\\^)"),d("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",d("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),d("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),d("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),d("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),d("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(_n,_n.exports);var Bn=_n.exports;Yn(Bn);var Dn=Object.freeze({loose:!0}),Vn=Object.freeze({}),Un=function(t){return t?"object"!==i(t)?Dn:t:Vn};Yn(Un);var qn=/^[0-9]+$/,Wn=function(t,e){var n=qn.test(t),a=qn.test(e);return n&&a&&(t=+t,e=+e),t===e?0:n&&!a?-1:a&&!n?1:tjn)throw new TypeError("version is longer than ".concat(jn," characters"));zn("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var a=e.trim().match(n.loose?$n[Jn.LOOSE]:$n[Jn.FULL]);if(!a)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>Hn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Hn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Hn||this.patch<0)throw new TypeError("Invalid patch version");a[4]?this.prerelease=a[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(a)}}if(e){var i=[e,a];!1===n&&(i=[e]),0===Qn(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}])}(),ta=Zn;Yn(ta);var ea=ta,na=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof ea)return t;try{return new ea(t,e)}catch(t){if(!n)return null;throw t}};Yn(na);var aa=na,ra=Yn((function(t,e){var n=aa(t,e);return n?n.version:null})),ia=ta,sa=na,oa=Bn.safeRe,ha=Bn.t,la=Yn((function(t,e){if(t instanceof ia)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var a,r=e.includePrerelease?oa[ha.COERCERTLFULL]:oa[ha.COERCERTL];(a=r.exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&a.index+a[0].length===n.index+n[0].length||(n=a),r.lastIndex=a.index+a[1].length+a[2].length;r.lastIndex=-1}else n=t.match(e.includePrerelease?oa[ha.COERCEFULL]:oa[ha.COERCE]);if(null===n)return null;var i=n[2],s=n[3]||"0",o=n[4]||"0",h=e.includePrerelease&&n[5]?"-".concat(n[5]):"",l=e.includePrerelease&&n[6]?"+".concat(n[6]):"";return sa("".concat(i,".").concat(s,".").concat(o).concat(h).concat(l),e)})),ca=h((function t(){s(this,t),this.max=1e3,this.map=new Map}),[{key:"get",value:function(t){var e=this.map.get(t);return void 0===e?void 0:(this.map.delete(t),this.map.set(t,e),e)}},{key:"delete",value:function(t){return!!this.map.has(t)&&(this.map.delete(t),!0)}},{key:"set",value:function(t,e){if(!this.delete(t)&&void 0!==e){if(this.map.size>=this.max){var n=this.map.keys().next().value;this.delete(n)}this.map.set(t,e)}return this}}]);Yn(ca);var ua=ta,fa=function(t,e,n){return new ua(t,n).compare(new ua(e,n))};Yn(fa);var da=fa,va=function(t,e,n){return 0===da(t,e,n)};Yn(va);var ma=fa,pa=function(t,e,n){return 0!==ma(t,e,n)};Yn(pa);var ga=fa,ya=function(t,e,n){return ga(t,e,n)>0};Yn(ya);var ka=fa,wa=function(t,e,n){return ka(t,e,n)>=0};Yn(wa);var ba=fa,xa=function(t,e,n){return ba(t,e,n)<0};Yn(xa);var Ia=fa,Ea=function(t,e,n){return Ia(t,e,n)<=0};Yn(Ea);var Aa,Sa,Ra,Ta,Ca=va,Ma=pa,Fa=ya,Pa=wa,Ya=xa,Xa=Ea,Oa=function(t,e,n,a){switch(e){case"===":return"object"===i(t)&&(t=t.version),"object"===i(n)&&(n=n.version),t===n;case"!==":return"object"===i(t)&&(t=t.version),"object"===i(n)&&(n=n.version),t!==n;case"":case"=":case"==":return Ca(t,n,a);case"!=":return Ma(t,n,a);case">":return Fa(t,n,a);case">=":return Pa(t,n,a);case"<":return Ya(t,n,a);case"<=":return Xa(t,n,a);default:throw new TypeError("Invalid operator: ".concat(e))}};function Na(){if(Ta)return Ra;Ta=1;var t=function(){function t(e,r){var i=this;if(s(this,t),r=n(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return i.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!m(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var h,l=k(this.set);try{for(l.s();!(h=l.n()).done;){var c=h.value;if(1===c.length&&g(c[0])){this.set=[c];break}}}catch(t){l.e(t)}finally{l.f()}}}this.format()}return h(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var n=this,i=((this.options.includePrerelease&&d)|(this.options.loose&&v))+":"+t,s=e.get(i);if(s)return s;var h=this.options.loose,g=h?o[l.HYPHENRANGELOOSE]:o[l.HYPHENRANGE];t=t.replace(g,M(this.options.includePrerelease)),r("hyphen replace",t),t=t.replace(o[l.COMPARATORTRIM],c),r("comparator trim",t),t=t.replace(o[l.TILDETRIM],u),r("tilde trim",t),t=t.replace(o[l.CARETTRIM],f),r("caret trim",t);var y=t.split(" ").map((function(t){return w(t,n.options)})).join(" ").split(/\s+/).map((function(t){return C(t,n.options)}));h&&(y=y.filter((function(t){return r("loose invalid filter",t,n.options),!!t.match(o[l.COMPARATORLOOSE])}))),r("range list",y);var b,x=new Map,I=y.map((function(t){return new a(t,n.options)})),E=k(I);try{for(E.s();!(b=E.n()).done;){var A=b.value;if(m(A))return[A];x.set(A.value,A)}}catch(t){E.e(t)}finally{E.f()}x.size>1&&x.has("")&&x.delete("");var S=p(x.values());return e.set(i,S),S}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return y(t,n)&&e.set.some((function(e){return y(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new i(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(i(this.semver,"<",t.semver,a)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(i(this.semver,">",t.semver,a)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}])}();Aa=e;var n=Un,a=Bn.safeRe,r=Bn.t,i=Oa,o=Ln,l=ta,c=Na();return Aa}(),r=Ln,i=ta,o=Bn.safeRe,l=Bn.t,c=Bn.comparatorTrimReplace,u=Bn.tildeTrimReplace,f=Bn.caretTrimReplace,d=Xn.FLAG_INCLUDE_PRERELEASE,v=Xn.FLAG_LOOSE,m=function(t){return"<0.0.0-0"===t.value},g=function(t){return""===t.value},y=function(t,e){for(var n=!0,a=t.slice(),r=a.pop();n&&a.length;)n=a.every((function(t){return r.intersects(t,e)})),r=a.pop();return n},w=function(t,e){return r("comp",t,e),t=E(t,e),r("caret",t),t=x(t,e),r("tildes",t),t=S(t,e),r("xrange",t),t=T(t,e),r("stars",t),t},b=function(t){return!t||"x"===t.toLowerCase()||"*"===t},x=function(t,e){return t.trim().split(/\s+/).map((function(t){return I(t,e)})).join(" ")},I=function(t,e){var n=e.loose?o[l.TILDELOOSE]:o[l.TILDE];return t.replace(n,(function(e,n,a,i,s){var o;return r("tilde",t,e,n,a,i,s),b(n)?o="":b(a)?o=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):b(i)?o=">=".concat(n,".").concat(a,".0 <").concat(n,".").concat(+a+1,".0-0"):s?(r("replaceTilde pr",s),o=">=".concat(n,".").concat(a,".").concat(i,"-").concat(s," <").concat(n,".").concat(+a+1,".0-0")):o=">=".concat(n,".").concat(a,".").concat(i," <").concat(n,".").concat(+a+1,".0-0"),r("tilde return",o),o}))},E=function(t,e){return t.trim().split(/\s+/).map((function(t){return A(t,e)})).join(" ")},A=function(t,e){r("caret",t,e);var n=e.loose?o[l.CARETLOOSE]:o[l.CARET],a=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,i,s,o){var h;return r("caret",t,e,n,i,s,o),b(n)?h="":b(i)?h=">=".concat(n,".0.0").concat(a," <").concat(+n+1,".0.0-0"):b(s)?h="0"===n?">=".concat(n,".").concat(i,".0").concat(a," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(a," <").concat(+n+1,".0.0-0"):o?(r("replaceCaret pr",o),h="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(n,".").concat(i,".").concat(+s+1,"-0"):">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(+n+1,".0.0-0")):(r("no pr"),h="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(s).concat(a," <").concat(n,".").concat(i,".").concat(+s+1,"-0"):">=".concat(n,".").concat(i,".").concat(s).concat(a," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(s," <").concat(+n+1,".0.0-0")),r("caret return",h),h}))},S=function(t,e){return r("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return R(t,e)})).join(" ")},R=function(t,e){t=t.trim();var n=e.loose?o[l.XRANGELOOSE]:o[l.XRANGE];return t.replace(n,(function(n,a,i,s,o,h){r("xRange",t,n,a,i,s,o,h);var l=b(i),c=l||b(s),u=c||b(o),f=u;return"="===a&&f&&(a=""),h=e.includePrerelease?"-0":"",l?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&f?(c&&(s=0),o=0,">"===a?(a=">=",c?(i=+i+1,s=0,o=0):(s=+s+1,o=0)):"<="===a&&(a="<",c?i=+i+1:s=+s+1),"<"===a&&(h="-0"),n="".concat(a+i,".").concat(s,".").concat(o).concat(h)):c?n=">=".concat(i,".0.0").concat(h," <").concat(+i+1,".0.0-0"):u&&(n=">=".concat(i,".").concat(s,".0").concat(h," <").concat(i,".").concat(+s+1,".0-0")),r("xRange return",n),n}))},T=function(t,e){return r("replaceStars",t,e),t.trim().replace(o[l.STAR],"")},C=function(t,e){return r("replaceGTE0",t,e),t.trim().replace(o[e.includePrerelease?l.GTE0PRE:l.GTE0],"")},M=function(t){return function(e,n,a,r,i,s,o,h,l,c,u,f){return n=b(a)?"":b(r)?">=".concat(a,".0.0").concat(t?"-0":""):b(i)?">=".concat(a,".").concat(r,".0").concat(t?"-0":""):s?">=".concat(n):">=".concat(n).concat(t?"-0":""),h=b(l)?"":b(c)?"<".concat(+l+1,".0.0-0"):b(u)?"<".concat(l,".").concat(+c+1,".0-0"):f?"<=".concat(l,".").concat(c,".").concat(u,"-").concat(f):t?"<".concat(l,".").concat(c,".").concat(+u+1,"-0"):"<=".concat(h),"".concat(n," ").concat(h).trim()}},F=function(t,e,n){for(var i=0;i0){var o=t[s].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0};return Ra}Yn(Oa);var La=Na(),_a=function(t,e,n){try{e=new La(e,n)}catch(t){return!1}return e.test(t)},Ba={valid:ra,coerce:la,satisfies:Yn(_a),SEMVER_SPEC_VERSION:On.SEMVER_SPEC_VERSION},Da=0,Va=1,Ua=2,qa=[0,1,2,2,3,0],Wa=h((function t(e,n,a,i){var o;if(s(this,t),l(this,"autoUpdate",!0),l(this,"skeleton",void 0),l(this,"states",void 0),this._app=e,this._position=new r.Vec3,1===Jt.length){var h,c=k((o=new Jt(n)).pages);try{for(c.s();!(h=c.n()).done;){var u=h.value;u.setTexture(new Pn(i[u.name]))}}catch(t){c.e(t)}finally{c.f()}}else o=new Jt(n,(function(t){return new Pn(i[t])}));var f=new In(new ie(o));f.scale*=.01;var d=f.readSkeletonData(a);this.skeletonVersion=Ba.valid(Ba.coerce(d.version)),this._spine_3_6_0=Ba.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=Ba.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_0_X=Ba.satisfies(this.skeletonVersion,"~4.0.0"),this._spine_4_1_X=Ba.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new Ee(d),this.skeleton.updateWorldTransform(),this.stateData=new Ut(this.skeleton.data),this.states=[new Mt(this.stateData)],this.clipper=new xn,this._node=new r.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new r.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new r.Vec2,this._aabbTempSize=new r.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[r.LAYERID_UI],this.init(),this._hidden=!1}),[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new r.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new r.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&u.indices.length>0){t&&t!==u.material&&(this.SubmitBatch(e,n,t),t=u.material,e=s,n=0),t=u.material;var f=u.positions,d=u.vertexColor.r,v=u.vertexColor.g,m=u.vertexColor.b,p=u.vertexColor.a,g=u.uvs,y=void 0,k=f.length/2;for(y=0;y0){var a=new r.Mesh(this._app.graphicsDevice);a.vertexBuffer=this._vertexBuffer,a.indexBuffer[0]=this._indexBuffer,a.primitive[0].type=r.PRIMITIVE_TRIANGLES,a.primitive[0].base=t,a.primitive[0].count=e,a.primitive[0].indexed=!0,a.aabb=this._aabb,this._meshes.push(a);var i=new r.MeshInstance(a,this._materials[n],this._node);i.drawOrder=this.priority+this._meshInstances.length,i.visible=!this._hidden,this._meshInstances.push(i)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var n=this.states.length;for(e=0;e