@esotericsoftware/spine-webgl 4.0.12 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
- var spine=(()=>{var Li=Object.defineProperty,vs=t=>Li(t,"__esModule",{value:!0}),fr=typeof require!="undefined"?require:t=>{throw new Error('Dynamic require of "'+t+'" is not supported')},ys=(t,e)=>{vs(t);for(var i in e)Li(t,i,{get:e[i],enumerable:!0})},Bi={};ys(Bi,{AlphaTimeline:()=>Ze,Animation:()=>be,AnimationState:()=>ri,AnimationStateAdapter:()=>Ts,AnimationStateData:()=>Ms,AssetManager:()=>ns,AssetManagerBase:()=>Ji,AtlasAttachmentLoader:()=>ks,Attachment:()=>Oe,AttachmentTimeline:()=>Ht,BinaryInput:()=>es,BlendMode:()=>pt,Bone:()=>ui,BoneData:()=>fi,BoundingBoxAttachment:()=>ye,CURRENT:()=>qi,CameraController:()=>rr,ClippingAttachment:()=>ue,Color:()=>V,Color2Attribute:()=>hs,ColorAttribute:()=>Ie,ConstraintData:()=>Ae,CurveTimeline:()=>Ft,CurveTimeline1:()=>Xt,CurveTimeline2:()=>we,DebugUtils:()=>Ss,DeformTimeline:()=>Qe,Downloader:()=>Ki,DrawOrderTimeline:()=>Zt,Event:()=>mi,EventData:()=>gi,EventQueue:()=>Wi,EventTimeline:()=>fe,EventType:()=>St,FIRST:()=>ai,FakeTexture:()=>Ys,GLTexture:()=>me,HOLD_FIRST:()=>ve,HOLD_MIX:()=>_i,HOLD_SUBSEQUENT:()=>ni,IkConstraint:()=>Qi,IkConstraintData:()=>xi,IkConstraintTimeline:()=>$e,Input:()=>Ti,IntSet:()=>As,Interpolation:()=>Pi,JitterEffect:()=>er,LoadingScreen:()=>or,M00:()=>N,M01:()=>G,M02:()=>j,M03:()=>U,M10:()=>H,M11:()=>z,M12:()=>Z,M13:()=>W,M20:()=>J,M21:()=>K,M22:()=>_,M23:()=>q,M30:()=>$,M31:()=>tt,M32:()=>et,M33:()=>Q,ManagedWebGLRenderingContext:()=>vt,MathUtils:()=>E,Matrix4:()=>Wt,Mesh:()=>Mi,MeshAttachment:()=>_t,MixBlend:()=>ut,MixDirection:()=>Vt,OrthoCamera:()=>ls,PathAttachment:()=>Kt,PathConstraint:()=>ee,PathConstraintData:()=>bi,PathConstraintMixTimeline:()=>si,PathConstraintPositionTimeline:()=>ei,PathConstraintSpacingTimeline:()=>ii,PointAttachment:()=>di,PolygonBatcher:()=>Ii,Pool:()=>he,Position2Attribute:()=>Ye,Position3Attribute:()=>ar,PositionMode:()=>Pt,Pow:()=>Oi,PowOut:()=>Di,RGB2Timeline:()=>Ke,RGBA2Timeline:()=>Je,RGBATimeline:()=>je,RGBTimeline:()=>He,RegionAttachment:()=>at,ResizeMode:()=>re,RotateMode:()=>Qt,RotateTimeline:()=>de,SETUP:()=>li,SUBSEQUENT:()=>pe,ScaleTimeline:()=>Ue,ScaleXTimeline:()=>ze,ScaleYTimeline:()=>We,SceneRenderer:()=>ds,Shader:()=>bt,ShapeRenderer:()=>ki,ShapeType:()=>yt,ShearTimeline:()=>_e,ShearXTimeline:()=>qe,ShearYTimeline:()=>Ge,Skeleton:()=>Fs,SkeletonBinary:()=>Xs,SkeletonBounds:()=>is,SkeletonClipping:()=>Ce,SkeletonData:()=>wi,SkeletonDebugRenderer:()=>Fe,SkeletonJson:()=>$s,SkeletonRenderer:()=>Fi,Skin:()=>Se,SkinEntry:()=>pi,Slot:()=>$i,SlotData:()=>vi,SpacingMode:()=>gt,SpineCanvas:()=>dr,StringSet:()=>Be,SwirlEffect:()=>rs,TexCoordAttribute:()=>Yi,Texture:()=>hi,TextureAtlas:()=>ji,TextureAtlasPage:()=>Hi,TextureAtlasRegion:()=>ci,TextureFilter:()=>Mt,TextureRegion:()=>Gi,TextureWrap:()=>Jt,TimeKeeper:()=>Pe,Timeline:()=>mt,Touch:()=>os,TrackEntry:()=>zi,TransformConstraint:()=>ts,TransformConstraintData:()=>yi,TransformConstraintTimeline:()=>ti,TransformMode:()=>Ct,TranslateTimeline:()=>De,TranslateXTimeline:()=>Ve,TranslateYTimeline:()=>Ne,Triangulator:()=>Tt,Utils:()=>O,Vector2:()=>ce,Vector3:()=>Yt,VertexAttachment:()=>Bt,VertexAttribute:()=>se,VertexAttributeType:()=>qt,WebGLBlendModeConverter:()=>Me,WindowedMean:()=>Cs});var As=class{constructor(){this.array=new Array}add(t){let e=this.contains(t);return this.array[t|0]=t|0,!e}contains(t){return this.array[t|0]!=null}remove(t){this.array[t|0]=void 0}clear(){this.array.length=0}},Be=class{constructor(){this.entries={},this.size=0}add(t){let e=this.entries[t];return this.entries[t]=!0,e?!1:(this.size++,!0)}addAll(t){let e=this.size;for(var i=0,s=t.length;i<s;i++)this.add(t[i]);return e!=this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}},jt=class{constructor(t=0,e=0,i=0,s=0){this.r=t,this.g=e,this.b=i,this.a=s}set(t,e,i,s){return this.r=t,this.g=e,this.b=i,this.a=s,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(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=t.length!=8?1:parseInt(t.substr(6,2),16)/255,this}add(t,e,i,s){return this.r+=t,this.g+=e,this.b+=i,this.a+=s,this.clamp()}clamp(){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}static rgba8888ToColor(t,e){t.r=((e&4278190080)>>>24)/255,t.g=((e&16711680)>>>16)/255,t.b=((e&65280)>>>8)/255,t.a=(e&255)/255}static rgb888ToColor(t,e){t.r=((e&16711680)>>>16)/255,t.g=((e&65280)>>>8)/255,t.b=(e&255)/255}static fromString(t){return new jt().setFromString(t)}},V=jt;V.WHITE=new jt(1,1,1,1),V.RED=new jt(1,0,0,1),V.GREEN=new jt(0,1,0,1),V.BLUE=new jt(0,0,1,1),V.MAGENTA=new jt(1,0,1,1);var Dt=class{static clamp(t,e,i){return t<e?e:t>i?i:t}static cosDeg(t){return Math.cos(t*Dt.degRad)}static sinDeg(t){return Math.sin(t*Dt.degRad)}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return Dt.randomTriangularWith(t,e,(t+e)*.5)}static randomTriangularWith(t,e,i){let s=Math.random(),a=e-t;return s<=(i-t)/a?t+Math.sqrt(s*a*(i-t)):e-Math.sqrt((1-s)*a*(e-i))}static isPowerOfTwo(t){return t&&(t&t-1)==0}},E=Dt;E.PI=3.1415927,E.PI2=Dt.PI*2,E.radiansToDegrees=180/Dt.PI,E.radDeg=Dt.radiansToDegrees,E.degreesToRadians=Dt.PI/180,E.degRad=Dt.degreesToRadians;var Pi=class{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}},Oi=class extends Pi{constructor(t){super();this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(t*2,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2==0?-2:2)+1}},Di=class extends Oi{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}},te=class{static arrayCopy(t,e,i,s,a){for(let c=e,n=s;c<e+a;c++,n++)i[n]=t[c]}static arrayFill(t,e,i,s){for(let a=e;a<i;a++)t[a]=s}static setArraySize(t,e,i=0){let s=t.length;if(s==e)return t;if(t.length=e,s<e)for(let a=s;a<e;a++)t[a]=i;return t}static ensureArrayCapacity(t,e,i=0){return t.length>=e?t:te.setArraySize(t,e,i)}static newArray(t,e){let i=new Array(t);for(let s=0;s<t;s++)i[s]=e;return i}static newFloatArray(t){if(te.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let e=new Array(t);for(let i=0;i<e.length;i++)e[i]=0;return e}}static newShortArray(t){if(te.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let e=new Array(t);for(let i=0;i<e.length;i++)e[i]=0;return e}}static toFloatArray(t){return te.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return te.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,e){}static contains(t,e,i=!0){for(var s=0;s<t.length;s++)if(t[s]==e)return!0;return!1}static enumValue(t,e){return t[e[0].toUpperCase()+e.slice(1)]}},O=te;O.SUPPORTS_TYPED_ARRAYS=typeof Float32Array!="undefined";var Ss=class{static logBones(t){for(let e=0;e<t.bones.length;e++){let i=t.bones[e];console.log(i.data.name+", "+i.a+", "+i.b+", "+i.c+", "+i.d+", "+i.worldX+", "+i.worldY)}}},he=class{constructor(t){this.items=new Array,this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}},ce=class{constructor(t=0,e=0){this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){let t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){let t=this.length();return t!=0&&(this.x/=t,this.y/=t),this}},Pe=class{constructor(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}update(){let 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)}},Cs=class{constructor(t=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=t,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let e=0;e<this.values.length;e++)t+=this.values[e];this.mean=t/this.values.length,this.dirty=!1}return this.mean}return 0}},Oe=class{constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}},Vi=class extends Oe{constructor(t){super(t);this.id=Vi.nextID++,this.worldVerticesLength=0,this.deformAttachment=this}computeWorldVertices(t,e,i,s,a,c){i=a+(i>>1)*c;let n=t.bone.skeleton,r=t.deform,o=this.vertices,l=this.bones;if(!l){r.length>0&&(o=r);let m=t.bone,u=m.worldX,x=m.worldY,p=m.a,v=m.b,g=m.c,w=m.d;for(let b=e,y=a;y<i;b+=2,y+=c){let T=o[b],A=o[b+1];s[y]=T*p+A*v+u,s[y+1]=T*g+A*w+x}return}let h=0,d=0;for(let m=0;m<e;m+=2){let u=l[h];h+=u+1,d+=u}let f=n.bones;if(r.length==0)for(let m=a,u=d*3;m<i;m+=c){let x=0,p=0,v=l[h++];for(v+=h;h<v;h++,u+=3){let g=f[l[h]],w=o[u],b=o[u+1],y=o[u+2];x+=(w*g.a+b*g.b+g.worldX)*y,p+=(w*g.c+b*g.d+g.worldY)*y}s[m]=x,s[m+1]=p}else{let m=r;for(let u=a,x=d*3,p=d<<1;u<i;u+=c){let v=0,g=0,w=l[h++];for(w+=h;h<w;h++,x+=3,p+=2){let b=f[l[h]],y=o[x]+m[p],T=o[x+1]+m[p+1],A=o[x+2];v+=(y*b.a+T*b.b+b.worldX)*A,g+=(y*b.c+T*b.d+b.worldY)*A}s[u]=v,s[u+1]=g}}}copyTo(t){this.bones?(t.bones=new Array(this.bones.length),O.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices?(t.vertices=O.newFloatArray(this.vertices.length),O.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)):t.vertices=null,t.worldVerticesLength=this.worldVerticesLength,t.deformAttachment=this.deformAttachment}},Bt=Vi;Bt.nextID=0;var be=class{constructor(t,e,i){if(!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=i}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds=new Be;for(var e=0;e<t.length;e++)this.timelineIds.addAll(t[e].getPropertyIds())}hasTimeline(t){for(let e=0;e<t.length;e++)if(this.timelineIds.contains(t[e]))return!0;return!1}apply(t,e,i,s,a,c,n,r){if(!t)throw new Error("skeleton cannot be null.");s&&this.duration!=0&&(i%=this.duration,e>0&&(e%=this.duration));let o=this.timelines;for(let l=0,h=o.length;l<h;l++)o[l].apply(t,e,i,a,c,n,r)}},ut;(function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"})(ut||(ut={}));var Vt;(function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"})(Vt||(Vt={}));var ot={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,rgb:7,alpha:8,rgb2:9,attachment:10,deform:11,event:12,drawOrder:13,ikConstraint:14,transformConstraint:15,pathConstraintPosition:16,pathConstraintSpacing:17,pathConstraintMix:18},mt=class{constructor(t,e){this.propertyIds=e,this.frames=O.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let i=t.length;for(let s=1;s<i;s++)if(t[s]>e)return s-1;return i-1}static search(t,e,i){let s=t.length;for(let a=i;a<s;a+=i)if(t[a]>e)return a-i;return s-i}},Ft=class extends mt{constructor(t,e,i){super(t,i);this.curves=O.newFloatArray(t+e*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+t*18;if(this.curves.length>e){let i=O.newFloatArray(e);O.arrayCopy(this.curves,0,i,0,e),this.curves=i}}setBezier(t,e,i,s,a,c,n,r,o,l,h){let d=this.curves,f=this.getFrameCount()+t*18;i==0&&(d[e]=2+f);let m=(s-c*2+r)*.03,u=(a-n*2+o)*.03,x=((c-r)*3-s+l)*.006,p=((n-o)*3-a+h)*.006,v=m*2+x,g=u*2+p,w=(c-s)*.3+m+x*.16666667,b=(n-a)*.3+u+p*.16666667,y=s+w,T=a+b;for(let A=f+18;f<A;f+=2)d[f]=y,d[f+1]=T,w+=v,b+=g,v+=x,g+=p,y+=w,T+=b}getBezierValue(t,e,i,s){let a=this.curves;if(a[s]>t){let o=this.frames[e],l=this.frames[e+i];return l+(t-o)/(a[s]-o)*(a[s+1]-l)}let c=s+18;for(s+=2;s<c;s+=2)if(a[s]>=t){let o=a[s-2],l=a[s-1];return l+(t-o)/(a[s]-o)*(a[s+1]-l)}e+=this.getFrameEntries();let n=a[c-2],r=a[c-1];return r+(t-n)/(this.frames[e]-n)*(this.frames[e+i]-r)}},Xt=class extends Ft{constructor(t,e,i){super(t,e,[i])}getFrameEntries(){return 2}setFrame(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+1]=i}getCurveValue(t){let e=this.frames,i=e.length-2;for(let a=2;a<=i;a+=2)if(e[a]>t){i=a-2;break}let s=this.curves[i>>1];switch(s){case 0:let a=e[i],c=e[i+1];return c+(t-a)/(e[i+2]-a)*(e[i+2+1]-c);case 1:return e[i+1]}return this.getBezierValue(t,i,1,s-2)}},we=class extends Ft{constructor(t,e,i,s){super(t,e,[i,s])}getFrameEntries(){return 3}setFrame(t,e,i,s){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s}},de=class extends Xt{constructor(t,e,i){super(t,e,ot.rotate+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,a,c,n){let r=t.bones[this.boneIndex];if(!r.active)return;let o=this.frames;if(i<o[0]){switch(c){case 0:r.rotation=r.data.rotation;return;case 1:r.rotation+=(r.data.rotation-r.rotation)*a}return}let l=this.getCurveValue(i);switch(c){case 0:r.rotation=r.data.rotation+l*a;break;case 1:case 2:l+=r.data.rotation-r.rotation;case 3:r.rotation+=l*a}}},De=class extends we{constructor(t,e,i){super(t,e,ot.x+"|"+i,ot.y+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,a,c,n){let r=t.bones[this.boneIndex];if(!r.active)return;let o=this.frames;if(i<o[0]){switch(c){case 0:r.x=r.data.x,r.y=r.data.y;return;case 1:r.x+=(r.data.x-r.x)*a,r.y+=(r.data.y-r.y)*a}return}let l=0,h=0,d=mt.search(o,i,3),f=this.curves[d/3];switch(f){case 0:let m=o[d];l=o[d+1],h=o[d+2];let u=(i-m)/(o[d+3]-m);l+=(o[d+3+1]-l)*u,h+=(o[d+3+2]-h)*u;break;case 1:l=o[d+1],h=o[d+2];break;default:l=this.getBezierValue(i,d,1,f-2),h=this.getBezierValue(i,d,2,f+18-2)}switch(c){case 0:r.x=r.data.x+l*a,r.y=r.data.y+h*a;break;case 1:case 2:r.x+=(r.data.x+l-r.x)*a,r.y+=(r.data.y+h-r.y)*a;break;case 3:r.x+=l*a,r.y+=h*a}}},Ve=class extends Xt{constructor(t,e,i){super(t,e,ot.x+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,a,c,n){let r=t.bones[this.boneIndex];if(!r.active)return;let o=this.frames;if(i<o[0]){switch(c){case 0:r.x=r.data.x;return;case 1:r.x+=(r.data.x-r.x)*a}return}let l=this.getCurveValue(i);switch(c){case 0:r.x=r.data.x+l*a;break;case 1:case 2:r.x+=(r.data.x+l-r.x)*a;break;case 3:r.x+=l*a}}},Ne=class extends Xt{constructor(t,e,i){super(t,e,ot.y+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,a,c,n){let r=t.bones[this.boneIndex];if(!r.active)return;let o=this.frames;if(i<o[0]){switch(c){case 0:r.y=r.data.y;return;case 1:r.y+=(r.data.y-r.y)*a}return}let l=this.getCurveValue(i);switch(c){case 0:r.y=r.data.y+l*a;break;case 1:case 2:r.y+=(r.data.y+l-r.y)*a;break;case 3:r.y+=l*a}}},Ue=class extends we{constructor(t,e,i){super(t,e,ot.scaleX+"|"+i,ot.scaleY+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,a,c,n){let r=t.bones[this.boneIndex];if(!r.active)return;let o=this.frames;if(i<o[0]){switch(c){case 0:r.scaleX=r.data.scaleX,r.scaleY=r.data.scaleY;return;case 1:r.scaleX+=(r.data.scaleX-r.scaleX)*a,r.scaleY+=(r.data.scaleY-r.scaleY)*a}return}let l,h,d=mt.search(o,i,3),f=this.curves[d/3];switch(f){case 0:let m=o[d];l=o[d+1],h=o[d+2];let u=(i-m)/(o[d+3]-m);l+=(o[d+3+1]-l)*u,h+=(o[d+3+2]-h)*u;break;case 1:l=o[d+1],h=o[d+2];break;default:l=this.getBezierValue(i,d,1,f-2),h=this.getBezierValue(i,d,2,f+18-2)}if(l*=r.data.scaleX,h*=r.data.scaleY,a==1)c==3?(r.scaleX+=l-r.data.scaleX,r.scaleY+=h-r.data.scaleY):(r.scaleX=l,r.scaleY=h);else{let m=0,u=0;if(n==1)switch(c){case 0:m=r.data.scaleX,u=r.data.scaleY,r.scaleX=m+(Math.abs(l)*E.signum(m)-m)*a,r.scaleY=u+(Math.abs(h)*E.signum(u)-u)*a;break;case 1:case 2:m=r.scaleX,u=r.scaleY,r.scaleX=m+(Math.abs(l)*E.signum(m)-m)*a,r.scaleY=u+(Math.abs(h)*E.signum(u)-u)*a;break;case 3:r.scaleX=(l-r.data.scaleX)*a,r.scaleY=(h-r.data.scaleY)*a}else switch(c){case 0:m=Math.abs(r.data.scaleX)*E.signum(l),u=Math.abs(r.data.scaleY)*E.signum(h),r.scaleX=m+(l-m)*a,r.scaleY=u+(h-u)*a;break;case 1:case 2:m=Math.abs(r.scaleX)*E.signum(l),u=Math.abs(r.scaleY)*E.signum(h),r.scaleX=m+(l-m)*a,r.scaleY=u+(h-u)*a;break;case 3:r.scaleX+=(l-r.data.scaleX)*a,r.scaleY+=(h-r.data.scaleY)*a}}}},ze=class extends Xt{constructor(t,e,i){super(t,e,ot.scaleX+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,a,c,n){let r=t.bones[this.boneIndex];if(!r.active)return;let o=this.frames;if(i<o[0]){switch(c){case 0:r.scaleX=r.data.scaleX;return;case 1:r.scaleX+=(r.data.scaleX-r.scaleX)*a}return}let l=this.getCurveValue(i)*r.data.scaleX;if(a==1)c==3?r.scaleX+=l-r.data.scaleX:r.scaleX=l;else{let h=0;if(n==1)switch(c){case 0:h=r.data.scaleX,r.scaleX=h+(Math.abs(l)*E.signum(h)-h)*a;break;case 1:case 2:h=r.scaleX,r.scaleX=h+(Math.abs(l)*E.signum(h)-h)*a;break;case 3:r.scaleX=(l-r.data.scaleX)*a}else switch(c){case 0:h=Math.abs(r.data.scaleX)*E.signum(l),r.scaleX=h+(l-h)*a;break;case 1:case 2:h=Math.abs(r.scaleX)*E.signum(l),r.scaleX=h+(l-h)*a;break;case 3:r.scaleX+=(l-r.data.scaleX)*a}}}},We=class extends Xt{constructor(t,e,i){super(t,e,ot.scaleY+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,a,c,n){let r=t.bones[this.boneIndex];if(!r.active)return;let o=this.frames;if(i<o[0]){switch(c){case 0:r.scaleY=r.data.scaleY;return;case 1:r.scaleY+=(r.data.scaleY-r.scaleY)*a}return}let l=this.getCurveValue(i)*r.data.scaleY;if(a==1)c==3?r.scaleY+=l-r.data.scaleY:r.scaleY=l;else{let h=0;if(n==1)switch(c){case 0:h=r.data.scaleY,r.scaleY=h+(Math.abs(l)*E.signum(h)-h)*a;break;case 1:case 2:h=r.scaleY,r.scaleY=h+(Math.abs(l)*E.signum(h)-h)*a;break;case 3:r.scaleY=(l-r.data.scaleY)*a}else switch(c){case 0:h=Math.abs(r.data.scaleY)*E.signum(l),r.scaleY=h+(l-h)*a;break;case 1:case 2:h=Math.abs(r.scaleY)*E.signum(l),r.scaleY=h+(l-h)*a;break;case 3:r.scaleY+=(l-r.data.scaleY)*a}}}},_e=class extends we{constructor(t,e,i){super(t,e,ot.shearX+"|"+i,ot.shearY+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,a,c,n){let r=t.bones[this.boneIndex];if(!r.active)return;let o=this.frames;if(i<o[0]){switch(c){case 0:r.shearX=r.data.shearX,r.shearY=r.data.shearY;return;case 1:r.shearX+=(r.data.shearX-r.shearX)*a,r.shearY+=(r.data.shearY-r.shearY)*a}return}let l=0,h=0,d=mt.search(o,i,3),f=this.curves[d/3];switch(f){case 0:let m=o[d];l=o[d+1],h=o[d+2];let u=(i-m)/(o[d+3]-m);l+=(o[d+3+1]-l)*u,h+=(o[d+3+2]-h)*u;break;case 1:l=o[d+1],h=o[d+2];break;default:l=this.getBezierValue(i,d,1,f-2),h=this.getBezierValue(i,d,2,f+18-2)}switch(c){case 0:r.shearX=r.data.shearX+l*a,r.shearY=r.data.shearY+h*a;break;case 1:case 2:r.shearX+=(r.data.shearX+l-r.shearX)*a,r.shearY+=(r.data.shearY+h-r.shearY)*a;break;case 3:r.shearX+=l*a,r.shearY+=h*a}}},qe=class extends Xt{constructor(t,e,i){super(t,e,ot.shearX+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,a,c,n){let r=t.bones[this.boneIndex];if(!r.active)return;let o=this.frames;if(i<o[0]){switch(c){case 0:r.shearX=r.data.shearX;return;case 1:r.shearX+=(r.data.shearX-r.shearX)*a}return}let l=this.getCurveValue(i);switch(c){case 0:r.shearX=r.data.shearX+l*a;break;case 1:case 2:r.shearX+=(r.data.shearX+l-r.shearX)*a;break;case 3:r.shearX+=l*a}}},Ge=class extends Xt{constructor(t,e,i){super(t,e,ot.shearY+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,a,c,n){let r=t.bones[this.boneIndex];if(!r.active)return;let o=this.frames;if(i<o[0]){switch(c){case 0:r.shearY=r.data.shearY;return;case 1:r.shearY+=(r.data.shearY-r.shearY)*a}return}let l=this.getCurveValue(i);switch(c){case 0:r.shearY=r.data.shearY+l*a;break;case 1:case 2:r.shearY+=(r.data.shearY+l-r.shearY)*a;break;case 3:r.shearY+=l*a}}},je=class extends Ft{constructor(t,e,i){super(t,e,[ot.rgb+"|"+i,ot.alpha+"|"+i]);this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 5}setFrame(t,e,i,s,a,c){t*=5,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=a,this.frames[t+4]=c}apply(t,e,i,s,a,c,n){let r=t.slots[this.slotIndex];if(!r.bone.active)return;let o=this.frames,l=r.color;if(i<o[0]){let p=r.data.color;switch(c){case 0:l.setFromColor(p);return;case 1:l.add((p.r-l.r)*a,(p.g-l.g)*a,(p.b-l.b)*a,(p.a-l.a)*a)}return}let h=0,d=0,f=0,m=0,u=mt.search(o,i,5),x=this.curves[u/5];switch(x){case 0:let p=o[u];h=o[u+1],d=o[u+2],f=o[u+3],m=o[u+4];let v=(i-p)/(o[u+5]-p);h+=(o[u+5+1]-h)*v,d+=(o[u+5+2]-d)*v,f+=(o[u+5+3]-f)*v,m+=(o[u+5+4]-m)*v;break;case 1:h=o[u+1],d=o[u+2],f=o[u+3],m=o[u+4];break;default:h=this.getBezierValue(i,u,1,x-2),d=this.getBezierValue(i,u,2,x+18-2),f=this.getBezierValue(i,u,3,x+18*2-2),m=this.getBezierValue(i,u,4,x+18*3-2)}a==1?l.set(h,d,f,m):(c==0&&l.setFromColor(r.data.color),l.add((h-l.r)*a,(d-l.g)*a,(f-l.b)*a,(m-l.a)*a))}},He=class extends Ft{constructor(t,e,i){super(t,e,[ot.rgb+"|"+i]);this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 4}setFrame(t,e,i,s,a){t<<=2,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=a}apply(t,e,i,s,a,c,n){let r=t.slots[this.slotIndex];if(!r.bone.active)return;let o=this.frames,l=r.color;if(i<o[0]){let x=r.data.color;switch(c){case 0:l.r=x.r,l.g=x.g,l.b=x.b;return;case 1:l.r+=(x.r-l.r)*a,l.g+=(x.g-l.g)*a,l.b+=(x.b-l.b)*a}return}let h=0,d=0,f=0,m=mt.search(o,i,4),u=this.curves[m>>2];switch(u){case 0:let x=o[m];h=o[m+1],d=o[m+2],f=o[m+3];let p=(i-x)/(o[m+4]-x);h+=(o[m+4+1]-h)*p,d+=(o[m+4+2]-d)*p,f+=(o[m+4+3]-f)*p;break;case 1:h=o[m+1],d=o[m+2],f=o[m+3];break;default:h=this.getBezierValue(i,m,1,u-2),d=this.getBezierValue(i,m,2,u+18-2),f=this.getBezierValue(i,m,3,u+18*2-2)}if(a==1)l.r=h,l.g=d,l.b=f;else{if(c==0){let x=r.data.color;l.r=x.r,l.g=x.g,l.b=x.b}l.r+=(h-l.r)*a,l.g+=(d-l.g)*a,l.b+=(f-l.b)*a}}},Ze=class extends Xt{constructor(t,e,i){super(t,e,ot.alpha+"|"+i);this.slotIndex=0,this.slotIndex=i}apply(t,e,i,s,a,c,n){let r=t.slots[this.slotIndex];if(!r.bone.active)return;let o=r.color;if(i<this.frames[0]){let h=r.data.color;switch(c){case 0:o.a=h.a;return;case 1:o.a+=(h.a-o.a)*a}return}let l=this.getCurveValue(i);a==1?o.a=l:(c==0&&(o.a=r.data.color.a),o.a+=(l-o.a)*a)}},Je=class extends Ft{constructor(t,e,i){super(t,e,[ot.rgb+"|"+i,ot.alpha+"|"+i,ot.rgb2+"|"+i]);this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 8}setFrame(t,e,i,s,a,c,n,r,o){t<<=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=a,this.frames[t+4]=c,this.frames[t+5]=n,this.frames[t+6]=r,this.frames[t+7]=o}apply(t,e,i,s,a,c,n){let r=t.slots[this.slotIndex];if(!r.bone.active)return;let o=this.frames,l=r.color,h=r.darkColor;if(i<o[0]){let b=r.data.color,y=r.data.darkColor;switch(c){case 0:l.setFromColor(b),h.r=y.r,h.g=y.g,h.b=y.b;return;case 1:l.add((b.r-l.r)*a,(b.g-l.g)*a,(b.b-l.b)*a,(b.a-l.a)*a),h.r+=(y.r-h.r)*a,h.g+=(y.g-h.g)*a,h.b+=(y.b-h.b)*a}return}let d=0,f=0,m=0,u=0,x=0,p=0,v=0,g=mt.search(o,i,8),w=this.curves[g>>3];switch(w){case 0:let b=o[g];d=o[g+1],f=o[g+2],m=o[g+3],u=o[g+4],x=o[g+5],p=o[g+6],v=o[g+7];let y=(i-b)/(o[g+8]-b);d+=(o[g+8+1]-d)*y,f+=(o[g+8+2]-f)*y,m+=(o[g+8+3]-m)*y,u+=(o[g+8+4]-u)*y,x+=(o[g+8+5]-x)*y,p+=(o[g+8+6]-p)*y,v+=(o[g+8+7]-v)*y;break;case 1:d=o[g+1],f=o[g+2],m=o[g+3],u=o[g+4],x=o[g+5],p=o[g+6],v=o[g+7];break;default:d=this.getBezierValue(i,g,1,w-2),f=this.getBezierValue(i,g,2,w+18-2),m=this.getBezierValue(i,g,3,w+18*2-2),u=this.getBezierValue(i,g,4,w+18*3-2),x=this.getBezierValue(i,g,5,w+18*4-2),p=this.getBezierValue(i,g,6,w+18*5-2),v=this.getBezierValue(i,g,7,w+18*6-2)}if(a==1)l.set(d,f,m,u),h.r=x,h.g=p,h.b=v;else{if(c==0){l.setFromColor(r.data.color);let b=r.data.darkColor;h.r=b.r,h.g=b.g,h.b=b.b}l.add((d-l.r)*a,(f-l.g)*a,(m-l.b)*a,(u-l.a)*a),h.r+=(x-h.r)*a,h.g+=(p-h.g)*a,h.b+=(v-h.b)*a}}},Ke=class extends Ft{constructor(t,e,i){super(t,e,[ot.rgb+"|"+i,ot.rgb2+"|"+i]);this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,s,a,c,n,r){t*=7,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=a,this.frames[t+4]=c,this.frames[t+5]=n,this.frames[t+6]=r}apply(t,e,i,s,a,c,n){let r=t.slots[this.slotIndex];if(!r.bone.active)return;let o=this.frames,l=r.color,h=r.darkColor;if(i<o[0]){let b=r.data.color,y=r.data.darkColor;switch(c){case 0:l.r=b.r,l.g=b.g,l.b=b.b,h.r=y.r,h.g=y.g,h.b=y.b;return;case 1:l.r+=(b.r-l.r)*a,l.g+=(b.g-l.g)*a,l.b+=(b.b-l.b)*a,h.r+=(y.r-h.r)*a,h.g+=(y.g-h.g)*a,h.b+=(y.b-h.b)*a}return}let d=0,f=0,m=0,u=0,x=0,p=0,v=0,g=mt.search(o,i,7),w=this.curves[g/7];switch(w){case 0:let b=o[g];d=o[g+1],f=o[g+2],m=o[g+3],x=o[g+4],p=o[g+5],v=o[g+6];let y=(i-b)/(o[g+7]-b);d+=(o[g+7+1]-d)*y,f+=(o[g+7+2]-f)*y,m+=(o[g+7+3]-m)*y,x+=(o[g+7+4]-x)*y,p+=(o[g+7+5]-p)*y,v+=(o[g+7+6]-v)*y;break;case 1:d=o[g+1],f=o[g+2],m=o[g+3],x=o[g+4],p=o[g+5],v=o[g+6];break;default:d=this.getBezierValue(i,g,1,w-2),f=this.getBezierValue(i,g,2,w+18-2),m=this.getBezierValue(i,g,3,w+18*2-2),x=this.getBezierValue(i,g,4,w+18*3-2),p=this.getBezierValue(i,g,5,w+18*4-2),v=this.getBezierValue(i,g,6,w+18*5-2)}if(a==1)l.r=d,l.g=f,l.b=m,h.r=x,h.g=p,h.b=v;else{if(c==0){let b=r.data.color,y=r.data.darkColor;l.r=b.r,l.g=b.g,l.b=b.b,h.r=y.r,h.g=y.g,h.b=y.b}l.r+=(d-l.r)*a,l.g+=(f-l.g)*a,l.b+=(m-l.b)*a,h.r+=(x-h.r)*a,h.g+=(p-h.g)*a,h.b+=(v-h.b)*a}}},Ht=class extends mt{constructor(t,e){super(t,[ot.attachment+"|"+e]);this.slotIndex=0,this.slotIndex=e,this.attachmentNames=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i}apply(t,e,i,s,a,c,n){let r=t.slots[this.slotIndex];if(!!r.bone.active){if(n==1){c==0&&this.setAttachment(t,r,r.data.attachmentName);return}if(i<this.frames[0]){(c==0||c==1)&&this.setAttachment(t,r,r.data.attachmentName);return}this.setAttachment(t,r,this.attachmentNames[mt.search1(this.frames,i)])}}setAttachment(t,e,i){e.setAttachment(i?t.getAttachment(this.slotIndex,i):null)}},Qe=class extends Ft{constructor(t,e,i,s){super(t,e,[ot.deform+"|"+i+"|"+s.id]);this.slotIndex=0,this.slotIndex=i,this.attachment=s,this.vertices=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.vertices[t]=i}setBezier(t,e,i,s,a,c,n,r,o,l,h){let d=this.curves,f=this.getFrameCount()+t*18;i==0&&(d[e]=2+f);let m=(s-c*2+r)*.03,u=o*.03-n*.06,x=((c-r)*3-s+l)*.006,p=(n-o+.33333333)*.018,v=m*2+x,g=u*2+p,w=(c-s)*.3+m+x*.16666667,b=n*.3+u+p*.16666667,y=s+w,T=b;for(let A=f+18;f<A;f+=2)d[f]=y,d[f+1]=T,w+=v,b+=g,v+=x,g+=p,y+=w,T+=b}getCurvePercent(t,e){let i=this.curves,s=i[e];switch(s){case 0:let r=this.frames[e];return(t-r)/(this.frames[e+this.getFrameEntries()]-r);case 1:return 0}if(s-=2,i[s]>t){let r=this.frames[e];return i[s+1]*(t-r)/(i[s]-r)}let a=s+18;for(s+=2;s<a;s+=2)if(i[s]>=t){let r=i[s-2],o=i[s-1];return o+(t-r)/(i[s]-r)*(i[s+1]-o)}let c=i[a-2],n=i[a-1];return n+(1-n)*(t-c)/(this.frames[e+this.getFrameEntries()]-c)}apply(t,e,i,s,a,c,n){let r=t.slots[this.slotIndex];if(!r.bone.active)return;let o=r.getAttachment();if(!(o instanceof Bt)||o.deformAttachment!=this.attachment)return;let l=r.deform;l.length==0&&(c=0);let h=this.vertices,d=h[0].length,f=this.frames;if(i<f[0]){let g=o;switch(c){case 0:l.length=0;return;case 1:if(a==1){l.length=0;return}if(l.length=d,g.bones){a=1-a;for(var m=0;m<d;m++)l[m]*=a}else{let w=g.vertices;for(var m=0;m<d;m++)l[m]+=(w[m]-l[m])*a}}return}if(l.length=d,i>=f[f.length-1]){let g=h[f.length-1];if(a==1)if(c==3){let w=o;if(w.bones)for(let b=0;b<d;b++)l[b]+=g[b];else{let b=w.vertices;for(let y=0;y<d;y++)l[y]+=g[y]-b[y]}}else O.arrayCopy(g,0,l,0,d);else switch(c){case 0:{let b=o;if(b.bones)for(let y=0;y<d;y++)l[y]=g[y]*a;else{let y=b.vertices;for(let T=0;T<d;T++){let A=y[T];l[T]=A+(g[T]-A)*a}}break}case 1:case 2:for(let b=0;b<d;b++)l[b]+=(g[b]-l[b])*a;break;case 3:let w=o;if(w.bones)for(let b=0;b<d;b++)l[b]+=g[b]*a;else{let b=w.vertices;for(let y=0;y<d;y++)l[y]+=(g[y]-b[y])*a}}return}let u=mt.search1(f,i),x=this.getCurvePercent(i,u),p=h[u],v=h[u+1];if(a==1)if(c==3){let g=o;if(g.bones)for(let w=0;w<d;w++){let b=p[w];l[w]+=b+(v[w]-b)*x}else{let w=g.vertices;for(let b=0;b<d;b++){let y=p[b];l[b]+=y+(v[b]-y)*x-w[b]}}}else for(let g=0;g<d;g++){let w=p[g];l[g]=w+(v[g]-w)*x}else switch(c){case 0:{let w=o;if(w.bones)for(let b=0;b<d;b++){let y=p[b];l[b]=(y+(v[b]-y)*x)*a}else{let b=w.vertices;for(let y=0;y<d;y++){let T=p[y],A=b[y];l[y]=A+(T+(v[y]-T)*x-A)*a}}break}case 1:case 2:for(let w=0;w<d;w++){let b=p[w];l[w]+=(b+(v[w]-b)*x-l[w])*a}break;case 3:let g=o;if(g.bones)for(let w=0;w<d;w++){let b=p[w];l[w]+=(b+(v[w]-b)*x)*a}else{let w=g.vertices;for(let b=0;b<d;b++){let y=p[b];l[b]+=(y+(v[b]-y)*x-w[b])*a}}}}},Ni=class extends mt{constructor(t){super(t,Ni.propertyIds);this.events=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,i,s,a,c,n){if(!s)return;let r=this.frames,o=this.frames.length;if(e>i)this.apply(t,e,Number.MAX_VALUE,s,a,c,n),e=-1;else if(e>=r[o-1])return;if(i<r[0])return;let l=0;if(e<r[0])l=0;else{l=mt.search1(r,e)+1;let h=r[l];for(;l>0&&r[l-1]==h;)l--}for(;l<o&&i>=r[l];l++)s.push(this.events[l])}},fe=Ni;fe.propertyIds=[""+ot.event];var Ui=class extends mt{constructor(t){super(t,Ui.propertyIds);this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,s,a,c,n){if(n==1){c==0&&O.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(i<this.frames[0]){(c==0||c==1)&&O.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}let r=this.drawOrders[mt.search1(this.frames,i)];if(!r)O.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);else{let o=t.drawOrder,l=t.slots;for(let h=0,d=r.length;h<d;h++)o[h]=l[r[h]]}}},Zt=Ui;Zt.propertyIds=[""+ot.drawOrder];var $e=class extends Ft{constructor(t,e,i){super(t,e,[ot.ikConstraint+"|"+i]);this.ikConstraintIndex=i}getFrameEntries(){return 6}setFrame(t,e,i,s,a,c,n){t*=6,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=a,this.frames[t+4]=c?1:0,this.frames[t+5]=n?1:0}apply(t,e,i,s,a,c,n){let r=t.ikConstraints[this.ikConstraintIndex];if(!r.active)return;let o=this.frames;if(i<o[0]){switch(c){case 0:r.mix=r.data.mix,r.softness=r.data.softness,r.bendDirection=r.data.bendDirection,r.compress=r.data.compress,r.stretch=r.data.stretch;return;case 1:r.mix+=(r.data.mix-r.mix)*a,r.softness+=(r.data.softness-r.softness)*a,r.bendDirection=r.data.bendDirection,r.compress=r.data.compress,r.stretch=r.data.stretch}return}let l=0,h=0,d=mt.search(o,i,6),f=this.curves[d/6];switch(f){case 0:let m=o[d];l=o[d+1],h=o[d+2];let u=(i-m)/(o[d+6]-m);l+=(o[d+6+1]-l)*u,h+=(o[d+6+2]-h)*u;break;case 1:l=o[d+1],h=o[d+2];break;default:l=this.getBezierValue(i,d,1,f-2),h=this.getBezierValue(i,d,2,f+18-2)}c==0?(r.mix=r.data.mix+(l-r.data.mix)*a,r.softness=r.data.softness+(h-r.data.softness)*a,n==1?(r.bendDirection=r.data.bendDirection,r.compress=r.data.compress,r.stretch=r.data.stretch):(r.bendDirection=o[d+3],r.compress=o[d+4]!=0,r.stretch=o[d+5]!=0)):(r.mix+=(l-r.mix)*a,r.softness+=(h-r.softness)*a,n==0&&(r.bendDirection=o[d+3],r.compress=o[d+4]!=0,r.stretch=o[d+5]!=0))}},ti=class extends Ft{constructor(t,e,i){super(t,e,[ot.transformConstraint+"|"+i]);this.transformConstraintIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,s,a,c,n,r){let o=this.frames;t*=7,o[t]=e,o[t+1]=i,o[t+2]=s,o[t+3]=a,o[t+4]=c,o[t+5]=n,o[t+6]=r}apply(t,e,i,s,a,c,n){let r=t.transformConstraints[this.transformConstraintIndex];if(!r.active)return;let o=this.frames;if(i<o[0]){let v=r.data;switch(c){case 0:r.mixRotate=v.mixRotate,r.mixX=v.mixX,r.mixY=v.mixY,r.mixScaleX=v.mixScaleX,r.mixScaleY=v.mixScaleY,r.mixShearY=v.mixShearY;return;case 1:r.mixRotate+=(v.mixRotate-r.mixRotate)*a,r.mixX+=(v.mixX-r.mixX)*a,r.mixY+=(v.mixY-r.mixY)*a,r.mixScaleX+=(v.mixScaleX-r.mixScaleX)*a,r.mixScaleY+=(v.mixScaleY-r.mixScaleY)*a,r.mixShearY+=(v.mixShearY-r.mixShearY)*a}return}let l,h,d,f,m,u,x=mt.search(o,i,7),p=this.curves[x/7];switch(p){case 0:let v=o[x];l=o[x+1],h=o[x+2],d=o[x+3],f=o[x+4],m=o[x+5],u=o[x+6];let g=(i-v)/(o[x+7]-v);l+=(o[x+7+1]-l)*g,h+=(o[x+7+2]-h)*g,d+=(o[x+7+3]-d)*g,f+=(o[x+7+4]-f)*g,m+=(o[x+7+5]-m)*g,u+=(o[x+7+6]-u)*g;break;case 1:l=o[x+1],h=o[x+2],d=o[x+3],f=o[x+4],m=o[x+5],u=o[x+6];break;default:l=this.getBezierValue(i,x,1,p-2),h=this.getBezierValue(i,x,2,p+18-2),d=this.getBezierValue(i,x,3,p+18*2-2),f=this.getBezierValue(i,x,4,p+18*3-2),m=this.getBezierValue(i,x,5,p+18*4-2),u=this.getBezierValue(i,x,6,p+18*5-2)}if(c==0){let v=r.data;r.mixRotate=v.mixRotate+(l-v.mixRotate)*a,r.mixX=v.mixX+(h-v.mixX)*a,r.mixY=v.mixY+(d-v.mixY)*a,r.mixScaleX=v.mixScaleX+(f-v.mixScaleX)*a,r.mixScaleY=v.mixScaleY+(m-v.mixScaleY)*a,r.mixShearY=v.mixShearY+(u-v.mixShearY)*a}else r.mixRotate+=(l-r.mixRotate)*a,r.mixX+=(h-r.mixX)*a,r.mixY+=(d-r.mixY)*a,r.mixScaleX+=(f-r.mixScaleX)*a,r.mixScaleY+=(m-r.mixScaleY)*a,r.mixShearY+=(u-r.mixShearY)*a}},ei=class extends Xt{constructor(t,e,i){super(t,e,ot.pathConstraintPosition+"|"+i);this.pathConstraintIndex=i}apply(t,e,i,s,a,c,n){let r=t.pathConstraints[this.pathConstraintIndex];if(!r.active)return;let o=this.frames;if(i<o[0]){switch(c){case 0:r.position=r.data.position;return;case 1:r.position+=(r.data.position-r.position)*a}return}let l=this.getCurveValue(i);c==0?r.position=r.data.position+(l-r.data.position)*a:r.position+=(l-r.position)*a}},ii=class extends Xt{constructor(t,e,i){super(t,e,ot.pathConstraintSpacing+"|"+i);this.pathConstraintIndex=0,this.pathConstraintIndex=i}apply(t,e,i,s,a,c,n){let r=t.pathConstraints[this.pathConstraintIndex];if(!r.active)return;let o=this.frames;if(i<o[0]){switch(c){case 0:r.spacing=r.data.spacing;return;case 1:r.spacing+=(r.data.spacing-r.spacing)*a}return}let l=this.getCurveValue(i);c==0?r.spacing=r.data.spacing+(l-r.data.spacing)*a:r.spacing+=(l-r.spacing)*a}},si=class extends Ft{constructor(t,e,i){super(t,e,[ot.pathConstraintMix+"|"+i]);this.pathConstraintIndex=0,this.pathConstraintIndex=i}getFrameEntries(){return 4}setFrame(t,e,i,s,a){let c=this.frames;t<<=2,c[t]=e,c[t+1]=i,c[t+2]=s,c[t+3]=a}apply(t,e,i,s,a,c,n){let r=t.pathConstraints[this.pathConstraintIndex];if(!r.active)return;let o=this.frames;if(i<o[0]){switch(c){case 0:r.mixRotate=r.data.mixRotate,r.mixX=r.data.mixX,r.mixY=r.data.mixY;return;case 1:r.mixRotate+=(r.data.mixRotate-r.mixRotate)*a,r.mixX+=(r.data.mixX-r.mixX)*a,r.mixY+=(r.data.mixY-r.mixY)*a}return}let l,h,d,f=mt.search(o,i,4),m=this.curves[f>>2];switch(m){case 0:let u=o[f];l=o[f+1],h=o[f+2],d=o[f+3];let x=(i-u)/(o[f+4]-u);l+=(o[f+4+1]-l)*x,h+=(o[f+4+2]-h)*x,d+=(o[f+4+3]-d)*x;break;case 1:l=o[f+1],h=o[f+2],d=o[f+3];break;default:l=this.getBezierValue(i,f,1,m-2),h=this.getBezierValue(i,f,2,m+18-2),d=this.getBezierValue(i,f,3,m+18*2-2)}if(c==0){let u=r.data;r.mixRotate=u.mixRotate+(l-u.mixRotate)*a,r.mixX=u.mixX+(h-u.mixX)*a,r.mixY=u.mixY+(d-u.mixY)*a}else r.mixRotate+=(l-r.mixRotate)*a,r.mixX+=(h-r.mixX)*a,r.mixY+=(d-r.mixY)*a}},ri=class{constructor(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Wi(this),this.propertyIDs=new Be,this.animationsChanged=!1,this.trackEntryPool=new he(()=>new zi),this.data=t}static emptyAnimation(){return oi||(oi=new be("<empty>",[],0)),oi}update(t){t*=this.timeScale;let e=this.tracks;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(!a)continue;a.animationLast=a.nextAnimationLast,a.trackLast=a.nextTrackLast;let c=t*a.timeScale;if(a.delay>0){if(a.delay-=c,a.delay>0)continue;c=-a.delay,a.delay=0}let n=a.next;if(n){let r=a.trackLast-n.delay;if(r>=0){for(n.delay=0,n.trackTime+=a.timeScale==0?0:(r/a.timeScale+t)*n.timeScale,a.trackTime+=c,this.setCurrent(i,n,!0);n.mixingFrom;)n.mixTime+=t,n=n.mixingFrom;continue}}else if(a.trackLast>=a.trackEnd&&!a.mixingFrom){e[i]=null,this.queue.end(a),this.clearNext(a);continue}if(a.mixingFrom&&this.updateMixingFrom(a,t)){let r=a.mixingFrom;for(a.mixingFrom=null,r&&(r.mixingTo=null);r;)this.queue.end(r),r=r.mixingFrom}a.trackTime+=c}this.queue.drain()}updateMixingFrom(t,e){let i=t.mixingFrom;if(!i)return!0;let s=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?((i.totalAlpha==0||t.mixDuration==0)&&(t.mixingFrom=i.mixingFrom,i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),s):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,i=this.tracks,s=!1;for(let d=0,f=i.length;d<f;d++){let m=i[d];if(!m||m.delay>0)continue;s=!0;let u=d==0?ut.first:m.mixBlend,x=m.alpha;m.mixingFrom?x*=this.applyMixingFrom(m,t,u):m.trackTime>=m.trackEnd&&!m.next&&(x=0);let p=m.animationLast,v=m.getAnimationTime(),g=v,w=e;m.reverse&&(g=m.animation.duration-g,w=null);let b=m.animation.timelines,y=b.length;if(d==0&&x==1||u==ut.add)for(let T=0;T<y;T++){O.webkit602BugfixHelper(x,u);var a=b[T];a instanceof Ht?this.applyAttachmentTimeline(a,t,g,u,!0):a.apply(t,p,g,w,x,u,Vt.mixIn)}else{let T=m.timelineMode,A=m.timelinesRotation.length!=y<<1;A&&(m.timelinesRotation.length=y<<1);for(let I=0;I<y;I++){let k=b[I],F=T[I]==pe?u:ut.setup;k instanceof de?this.applyRotateTimeline(k,t,g,x,F,m.timelinesRotation,I<<1,A):k instanceof Ht?this.applyAttachmentTimeline(k,t,g,u,!0):(O.webkit602BugfixHelper(x,u),k.apply(t,p,g,w,x,F,Vt.mixIn))}}this.queueEvents(m,v),e.length=0,m.nextAnimationLast=v,m.nextTrackLast=m.trackTime}for(var c=this.unkeyedState+li,n=t.slots,r=0,o=t.slots.length;r<o;r++){var l=n[r];if(l.attachmentState==c){var h=l.data.attachmentName;l.setAttachment(h?t.getAttachment(l.data.index,h):null)}}return this.unkeyedState+=2,this.queue.drain(),s}applyMixingFrom(t,e,i){let s=t.mixingFrom;s.mixingFrom&&this.applyMixingFrom(s,e,i);let a=0;t.mixDuration==0?(a=1,i==ut.first&&(i=ut.setup)):(a=t.mixTime/t.mixDuration,a>1&&(a=1),i!=ut.first&&(i=s.mixBlend));let c=a<s.attachmentThreshold,n=a<s.drawOrderThreshold,r=s.animation.timelines,o=r.length,l=s.alpha*t.interruptAlpha,h=l*(1-a),d=s.animationLast,f=s.getAnimationTime(),m=f,u=null;if(s.reverse?m=s.animation.duration-m:a<s.eventThreshold&&(u=this.events),i==ut.add)for(let x=0;x<o;x++)r[x].apply(e,d,m,u,h,i,Vt.mixOut);else{let x=s.timelineMode,p=s.timelineHoldMix,v=s.timelinesRotation.length!=o<<1;v&&(s.timelinesRotation.length=o<<1),s.totalAlpha=0;for(let g=0;g<o;g++){let w=r[g],b=Vt.mixOut,y,T=0;switch(x[g]){case pe:if(!n&&w instanceof Zt)continue;y=i,T=h;break;case ai:y=ut.setup,T=h;break;case ni:y=i,T=l;break;case ve:y=ut.setup,T=l;break;default:y=ut.setup;let A=p[g];T=l*Math.max(0,1-A.mixTime/A.mixDuration);break}s.totalAlpha+=T,w instanceof de?this.applyRotateTimeline(w,e,m,T,y,s.timelinesRotation,g<<1,v):w instanceof Ht?this.applyAttachmentTimeline(w,e,m,y,c):(O.webkit602BugfixHelper(T,i),n&&w instanceof Zt&&y==ut.setup&&(b=Vt.mixIn),w.apply(e,d,m,u,T,y,b))}}return t.mixDuration>0&&this.queueEvents(s,f),this.events.length=0,s.nextAnimationLast=f,s.nextTrackLast=s.trackTime,a}applyAttachmentTimeline(t,e,i,s,a){var c=e.slots[t.slotIndex];!c.bone.active||(i<t.frames[0]?(s==ut.setup||s==ut.first)&&this.setAttachment(e,c,c.data.attachmentName,a):this.setAttachment(e,c,t.attachmentNames[mt.search1(t.frames,i)],a),c.attachmentState<=this.unkeyedState&&(c.attachmentState=this.unkeyedState+li))}setAttachment(t,e,i,s){e.setAttachment(i?t.getAttachment(e.data.index,i):null),s&&(e.attachmentState=this.unkeyedState+qi)}applyRotateTimeline(t,e,i,s,a,c,n,r){if(r&&(c[n]=0),s==1){t.apply(e,0,i,null,1,a,Vt.mixIn);return}let o=e.bones[t.boneIndex];if(!o.active)return;let l=t.frames,h=0,d=0;if(i<l[0])switch(a){case ut.setup:o.rotation=o.data.rotation;default:return;case ut.first:h=o.rotation,d=o.data.rotation}else h=a==ut.setup?o.data.rotation:o.rotation,d=o.data.rotation+t.getCurveValue(i);let f=0,m=d-h;if(m-=(16384-(16384.499999999996-m/360|0))*360,m==0)f=c[n];else{let u=0,x=0;r?(u=0,x=m):(u=c[n],x=c[n+1]);let p=m>0,v=u>=0;E.signum(x)!=E.signum(m)&&Math.abs(x)<=90&&(Math.abs(u)>180&&(u+=360*E.signum(u)),v=p),f=m+u-u%360,v!=p&&(f+=360*E.signum(u)),c[n]=f}c[n+1]=m,o.rotation=h+f*s}queueEvents(t,e){let i=t.animationStart,s=t.animationEnd,a=s-i,c=t.trackLast%a,n=this.events,r=0,o=n.length;for(;r<o;r++){let h=n[r];if(h.time<c)break;h.time>s||this.queue.event(t,h)}let l=!1;for(t.loop?l=a==0||c>t.trackTime%a:l=e>=s&&t.animationLast<s,l&&this.queue.complete(t);r<o;r++){let h=n[r];h.time<i||this.queue.event(t,h)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e<i;e++)this.clearTrack(e);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let i=e;for(;;){let s=i.mixingFrom;if(!s)break;this.queue.end(s),i.mixingFrom=null,i.mixingTo=null,i=s}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,i){let s=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,s&&(i&&this.queue.interrupt(s),e.mixingFrom=s,s.mixingTo=e,e.mixTime=0,s.mixingFrom&&s.mixDuration>0&&(e.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,i=!1){let s=this.data.skeletonData.findAnimation(e);if(!s)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,s,i)}setAnimationWith(t,e,i=!1){if(!e)throw new Error("animation cannot be null.");let s=!0,a=this.expandToIndex(t);a&&(a.nextTrackLast==-1?(this.tracks[t]=a.mixingFrom,this.queue.interrupt(a),this.queue.end(a),this.clearNext(a),a=a.mixingFrom,s=!1):this.clearNext(a));let c=this.trackEntry(t,e,i,a);return this.setCurrent(t,c,s),this.queue.drain(),c}addAnimation(t,e,i=!1,s=0){let a=this.data.skeletonData.findAnimation(e);if(!a)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,a,i,s)}addAnimationWith(t,e,i=!1,s=0){if(!e)throw new Error("animation cannot be null.");let a=this.expandToIndex(t);if(a)for(;a.next;)a=a.next;let c=this.trackEntry(t,e,i,a);return a?(a.next=c,c.previous=a,s<=0&&(s+=a.getTrackComplete()-c.mixDuration)):(this.setCurrent(t,c,!0),this.queue.drain()),c.delay=s,c}setEmptyAnimation(t,e=0){let i=this.setAnimationWith(t,ri.emptyAnimation(),!1);return i.mixDuration=e,i.trackEnd=e,i}addEmptyAnimation(t,e=0,i=0){let s=this.addAnimationWith(t,ri.emptyAnimation(),!1,i);return i<=0&&(s.delay+=s.mixDuration-e),s.mixDuration=e,s.trackEnd=e,s}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let i=0,s=this.tracks.length;i<s;i++){let a=this.tracks[i];a&&this.setEmptyAnimation(a.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(O.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,e,i,s){let a=this.trackEntryPool.obtain();return a.trackIndex=t,a.animation=e,a.loop=i,a.holdPrevious=!1,a.eventThreshold=0,a.attachmentThreshold=0,a.drawOrderThreshold=0,a.animationStart=0,a.animationEnd=e.duration,a.animationLast=-1,a.nextAnimationLast=-1,a.delay=0,a.trackTime=0,a.trackLast=-1,a.nextTrackLast=-1,a.trackEnd=Number.MAX_VALUE,a.timeScale=1,a.alpha=1,a.interruptAlpha=1,a.mixTime=0,a.mixDuration=s?this.data.getMix(s.animation,e):0,a.mixBlend=ut.replace,a}clearNext(t){let e=t.next;for(;e;)this.queue.dispose(e),e=e.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let t=this.tracks;for(let e=0,i=t.length;e<i;e++){let s=t[e];if(!!s){for(;s.mixingFrom;)s=s.mixingFrom;do(!s.mixingTo||s.mixBlend!=ut.add)&&this.computeHold(s),s=s.mixingTo;while(s)}}}computeHold(t){let e=t.mixingTo,i=t.animation.timelines,s=t.animation.timelines.length,a=t.timelineMode;a.length=s;let c=t.timelineHoldMix;c.length=0;let n=this.propertyIDs;if(e&&e.holdPrevious){for(let r=0;r<s;r++)a[r]=n.addAll(i[r].getPropertyIds())?ve:ni;return}t:for(let r=0;r<s;r++){let o=i[r],l=o.getPropertyIds();if(!n.addAll(l))a[r]=pe;else if(!e||o instanceof Ht||o instanceof Zt||o instanceof fe||!e.animation.hasTimeline(l))a[r]=ai;else{for(let h=e.mixingTo;h;h=h.mixingTo)if(!h.animation.hasTimeline(l)){if(t.mixDuration>0){a[r]=_i,c[r]=h;continue t}break}a[r]=ve}}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},zi=class{constructor(){this.mixBlend=ut.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){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}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return t==0?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(t!=0){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime}},Wi=class{constructor(t){this.objects=[],this.drainDisabled=!1,this.animState=t}start(t){this.objects.push(St.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(St.interrupt),this.objects.push(t)}end(t){this.objects.push(St.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(St.dispose),this.objects.push(t)}complete(t){this.objects.push(St.complete),this.objects.push(t)}event(t,e){this.objects.push(St.event),this.objects.push(t),this.objects.push(e)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let t=this.objects,e=this.animState.listeners;for(let i=0;i<t.length;i+=2){let s=t[i],a=t[i+1];switch(s){case St.start:a.listener&&a.listener.start&&a.listener.start(a);for(let n=0;n<e.length;n++)e[n].start&&e[n].start(a);break;case St.interrupt:a.listener&&a.listener.interrupt&&a.listener.interrupt(a);for(let n=0;n<e.length;n++)e[n].interrupt&&e[n].interrupt(a);break;case St.end:a.listener&&a.listener.end&&a.listener.end(a);for(let n=0;n<e.length;n++)e[n].end&&e[n].end(a);case St.dispose:a.listener&&a.listener.dispose&&a.listener.dispose(a);for(let n=0;n<e.length;n++)e[n].dispose&&e[n].dispose(a);this.animState.trackEntryPool.free(a);break;case St.complete:a.listener&&a.listener.complete&&a.listener.complete(a);for(let n=0;n<e.length;n++)e[n].complete&&e[n].complete(a);break;case St.event:let c=t[i+++2];a.listener&&a.listener.event&&a.listener.event(a,c);for(let n=0;n<e.length;n++)e[n].event&&e[n].event(a,c);break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},St;(function(t){t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event"})(St||(St={}));var Ts=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}},pe=0,ai=1,ni=2,ve=3,_i=4,li=1,qi=2,oi=null,Ms=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,i){let s=this.skeletonData.findAnimation(t);if(!s)throw new Error("Animation not found: "+t);let a=this.skeletonData.findAnimation(e);if(!a)throw new Error("Animation not found: "+e);this.setMixWith(s,a,i)}setMixWith(t,e,i){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let s=t.name+"."+e.name;this.animationToMixTime[s]=i}getMix(t,e){let i=t.name+"."+e.name,s=this.animationToMixTime[i];return s===void 0?this.defaultMix:s}},ye=class extends Bt{constructor(t){super(t);this.color=new V(1,1,1,1)}copy(){let t=new ye(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},ue=class extends Bt{constructor(t){super(t);this.color=new V(.2275,.2275,.8078,1)}copy(){let t=new ue(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},hi=class{constructor(t){this._image=t}getImage(){return this._image}},Mt;(function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"})(Mt||(Mt={}));var Jt;(function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"})(Jt||(Jt={}));var Gi=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},Ys=class extends hi{setFilters(t,e){}setWraps(t,e){}dispose(){}},ji=class{constructor(t){this.pages=new Array,this.regions=new Array;let e=new Is(t),i=new Array(4),s=null,a=null,c={};c.size=()=>{s.width=parseInt(i[1]),s.height=parseInt(i[2])},c.format=()=>{},c.filter=()=>{s.minFilter=O.enumValue(Mt,i[1]),s.magFilter=O.enumValue(Mt,i[2])},c.repeat=()=>{i[1].indexOf("x")!=-1&&(s.uWrap=Jt.Repeat),i[1].indexOf("y")!=-1&&(s.vWrap=Jt.Repeat)},c.pma=()=>{s.pma=i[1]=="true"};var n={};n.xy=()=>{a.x=parseInt(i[1]),a.y=parseInt(i[2])},n.size=()=>{a.width=parseInt(i[1]),a.height=parseInt(i[2])},n.bounds=()=>{a.x=parseInt(i[1]),a.y=parseInt(i[2]),a.width=parseInt(i[3]),a.height=parseInt(i[4])},n.offset=()=>{a.offsetX=parseInt(i[1]),a.offsetY=parseInt(i[2])},n.orig=()=>{a.originalWidth=parseInt(i[1]),a.originalHeight=parseInt(i[2])},n.offsets=()=>{a.offsetX=parseInt(i[1]),a.offsetY=parseInt(i[2]),a.originalWidth=parseInt(i[3]),a.originalHeight=parseInt(i[4])},n.rotate=()=>{let h=i[1];h=="true"?a.degrees=90:h!="false"&&(a.degrees=parseInt(h))},n.index=()=>{a.index=parseInt(i[1])};let r=e.readLine();for(;r&&r.trim().length==0;)r=e.readLine();for(;!(!r||r.trim().length==0||e.readEntry(i,r)==0);)r=e.readLine();let o=null,l=null;for(;r!==null;)if(r.trim().length==0)s=null,r=e.readLine();else if(s){for(a=new ci,a.page=s,a.name=r;;){let h=e.readEntry(i,r=e.readLine());if(h==0)break;let d=n[i[0]];if(d)d();else{o||(o=[],l=[]),o.push(i[0]);let f=[];for(let m=0;m<h;m++)f.push(parseInt(i[m+1]));l.push(f)}}a.originalWidth==0&&a.originalHeight==0&&(a.originalWidth=a.width,a.originalHeight=a.height),o&&o.length>0&&(a.names=o,a.values=l,o=null,l=null),a.u=a.x/s.width,a.v=a.y/s.height,a.degrees==90?(a.u2=(a.x+a.height)/s.width,a.v2=(a.y+a.width)/s.height):(a.u2=(a.x+a.width)/s.width,a.v2=(a.y+a.height)/s.height),this.regions.push(a)}else{for(s=new Hi,s.name=r.trim();e.readEntry(i,r=e.readLine())!=0;){let h=c[i[0]];h&&h()}this.pages.push(s)}}findRegion(t){for(let e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null}setTextures(t,e=""){for(let i of this.pages)i.setTexture(t.get(e+i.name))}dispose(){for(let t=0;t<this.pages.length;t++)this.pages[t].texture.dispose()}},Is=class{constructor(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e||(e=e.trim(),e.length==0))return 0;let i=e.indexOf(":");if(i==-1)return 0;t[0]=e.substr(0,i).trim();for(let s=1,a=i+1;;s++){let c=e.indexOf(",",a);if(c==-1)return t[s]=e.substr(a).trim(),s;if(t[s]=e.substr(a,c-a).trim(),a=c+1,s==4)return 4}}},Hi=class{constructor(){this.minFilter=Mt.Nearest,this.magFilter=Mt.Nearest,this.uWrap=Jt.ClampToEdge,this.vWrap=Jt.ClampToEdge}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}},ci=class extends Gi{},_t=class extends Bt{constructor(t){super(t);this.color=new V(1,1,1,1),this.tempColor=new V(0,0,0,0)}updateUVs(){let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=O.newFloatArray(t.length));let e=this.uvs,i=this.uvs.length,s=this.region.u,a=this.region.v,c=0,n=0;if(this.region instanceof ci){let r=this.region,o=r.page.texture.getImage(),l=o.width,h=o.height;switch(r.degrees){case 90:s-=(r.originalHeight-r.offsetY-r.height)/l,a-=(r.originalWidth-r.offsetX-r.width)/h,c=r.originalHeight/l,n=r.originalWidth/h;for(let d=0;d<i;d+=2)e[d]=s+t[d+1]*c,e[d+1]=a+(1-t[d])*n;return;case 180:s-=(r.originalWidth-r.offsetX-r.width)/l,a-=r.offsetY/h,c=r.originalWidth/l,n=r.originalHeight/h;for(let d=0;d<i;d+=2)e[d]=s+(1-t[d])*c,e[d+1]=a+(1-t[d+1])*n;return;case 270:s-=r.offsetY/l,a-=r.offsetX/h,c=r.originalHeight/l,n=r.originalWidth/h;for(let d=0;d<i;d+=2)e[d]=s+(1-t[d+1])*c,e[d+1]=a+t[d]*n;return}s-=r.offsetX/l,a-=(r.originalHeight-r.offsetY-r.height)/h,c=r.originalWidth/l,n=r.originalHeight/h}else this.region?(c=this.region.u2-s,n=this.region.v2-a):(s=a=0,c=n=1);for(let r=0;r<i;r+=2)e[r]=s+t[r]*c,e[r+1]=a+t[r+1]*n}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let t=new _t(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Array(this.regionUVs.length),O.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=new Array(this.uvs.length),O.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=new Array(this.triangles.length),O.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,this.edges&&(t.edges=new Array(this.edges.length),O.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}newLinkedMesh(){let t=new _t(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),t.deformAttachment=this.deformAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),t.updateUVs(),t}},Kt=class extends Bt{constructor(t){super(t);this.closed=!1,this.constantSpeed=!1,this.color=new V(1,1,1,1)}copy(){let t=new Kt(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),O.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}},di=class extends Bt{constructor(t){super(t);this.color=new V(.38,.94,0,1)}computeWorldPosition(t,e){return e.x=this.x*t.a+this.y*t.b+t.worldX,e.y=this.x*t.c+this.y*t.d+t.worldY,e}computeWorldRotation(t){let e=E.cosDeg(this.rotation),i=E.sinDeg(this.rotation),s=e*t.a+i*t.b,a=e*t.c+i*t.d;return Math.atan2(a,s)*E.radDeg}copy(){let t=new di(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}},Zi=class extends Oe{constructor(t){super(t);this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new V(1,1,1,1),this.offset=O.newFloatArray(8),this.uvs=O.newFloatArray(8),this.tempColor=new V(1,1,1,1)}updateOffset(){let t=this.region,e=this.width/this.region.originalWidth*this.scaleX,i=this.height/this.region.originalHeight*this.scaleY,s=-this.width/2*this.scaleX+this.region.offsetX*e,a=-this.height/2*this.scaleY+this.region.offsetY*i,c=s+this.region.width*e,n=a+this.region.height*i,r=this.rotation*Math.PI/180,o=Math.cos(r),l=Math.sin(r),h=this.x,d=this.y,f=s*o+h,m=s*l,u=a*o+d,x=a*l,p=c*o+h,v=c*l,g=n*o+d,w=n*l,b=this.offset;b[0]=f-x,b[1]=u+m,b[2]=f-w,b[3]=g+m,b[4]=p-w,b[5]=g+v,b[6]=p-x,b[7]=u+v}setRegion(t){this.region=t;let e=this.uvs;t.degrees==90?(e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v,e[0]=t.u2,e[1]=t.v2):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)}computeWorldVertices(t,e,i,s){let a=this.offset,c=t.worldX,n=t.worldY,r=t.a,o=t.b,l=t.c,h=t.d,d=0,f=0;d=a[0],f=a[1],e[i]=d*r+f*o+c,e[i+1]=d*l+f*h+n,i+=s,d=a[2],f=a[3],e[i]=d*r+f*o+c,e[i+1]=d*l+f*h+n,i+=s,d=a[4],f=a[5],e[i]=d*r+f*o+c,e[i+1]=d*l+f*h+n,i+=s,d=a[6],f=a[7],e[i]=d*r+f*o+c,e[i+1]=d*l+f*h+n}copy(){let t=new Zi(this.name);return t.region=this.region,t.rendererObject=this.rendererObject,t.path=this.path,t.x=this.x,t.y=this.y,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.rotation=this.rotation,t.width=this.width,t.height=this.height,O.arrayCopy(this.uvs,0,t.uvs,0,8),O.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t}},at=Zi;at.X1=0,at.Y1=1,at.C1R=2,at.C1G=3,at.C1B=4,at.C1A=5,at.U1=6,at.V1=7,at.X2=8,at.Y2=9,at.C2R=10,at.C2G=11,at.C2B=12,at.C2A=13,at.U2=14,at.V2=15,at.X3=16,at.Y3=17,at.C3R=18,at.C3G=19,at.C3B=20,at.C3A=21,at.U3=22,at.V3=23,at.X4=24,at.Y4=25,at.C4R=26,at.C4G=27,at.C4B=28,at.C4A=29,at.U4=30,at.V4=31;var ks=class{constructor(t){this.atlas=t}newRegionAttachment(t,e,i){let s=this.atlas.findRegion(i);if(!s)throw new Error("Region not found in atlas: "+i+" (region attachment: "+e+")");s.renderObject=s;let a=new at(e);return a.setRegion(s),a}newMeshAttachment(t,e,i){let s=this.atlas.findRegion(i);if(!s)throw new Error("Region not found in atlas: "+i+" (mesh attachment: "+e+")");s.renderObject=s;let a=new _t(e);return a.region=s,a}newBoundingBoxAttachment(t,e){return new ye(e)}newPathAttachment(t,e){return new Kt(e)}newPointAttachment(t,e){return new di(e)}newClippingAttachment(t,e){return new ue(e)}},fi=class{constructor(t,e,i){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=Ct.Normal,this.skinRequired=!1,this.color=new V,t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}},Ct;(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"})(Ct||(Ct={}));var ui=class{constructor(t,e,i){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,s,a,c,n){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=s,this.ascaleY=a,this.ashearX=c,this.ashearY=n;let r=this.parent;if(!r){let f=this.skeleton,m=i+90+n,u=f.scaleX,x=f.scaleY;this.a=E.cosDeg(i+c)*s*u,this.b=E.cosDeg(m)*a*u,this.c=E.sinDeg(i+c)*s*x,this.d=E.sinDeg(m)*a*x,this.worldX=t*u+f.x,this.worldY=e*x+f.y;return}let o=r.a,l=r.b,h=r.c,d=r.d;switch(this.worldX=o*t+l*e+r.worldX,this.worldY=h*t+d*e+r.worldY,this.data.transformMode){case Ct.Normal:{let f=i+90+n,m=E.cosDeg(i+c)*s,u=E.cosDeg(f)*a,x=E.sinDeg(i+c)*s,p=E.sinDeg(f)*a;this.a=o*m+l*x,this.b=o*u+l*p,this.c=h*m+d*x,this.d=h*u+d*p;return}case Ct.OnlyTranslation:{let f=i+90+n;this.a=E.cosDeg(i+c)*s,this.b=E.cosDeg(f)*a,this.c=E.sinDeg(i+c)*s,this.d=E.sinDeg(f)*a;break}case Ct.NoRotationOrReflection:{let f=o*o+h*h,m=0;f>1e-4?(f=Math.abs(o*d-l*h)/f,o/=this.skeleton.scaleX,h/=this.skeleton.scaleY,l=h*f,d=o*f,m=Math.atan2(h,o)*E.radDeg):(o=0,h=0,m=90-Math.atan2(d,l)*E.radDeg);let u=i+c-m,x=i+n-m+90,p=E.cosDeg(u)*s,v=E.cosDeg(x)*a,g=E.sinDeg(u)*s,w=E.sinDeg(x)*a;this.a=o*p-l*g,this.b=o*v-l*w,this.c=h*p+d*g,this.d=h*v+d*w;break}case Ct.NoScale:case Ct.NoScaleOrReflection:{let f=E.cosDeg(i),m=E.sinDeg(i),u=(o*f+l*m)/this.skeleton.scaleX,x=(h*f+d*m)/this.skeleton.scaleY,p=Math.sqrt(u*u+x*x);p>1e-5&&(p=1/p),u*=p,x*=p,p=Math.sqrt(u*u+x*x),this.data.transformMode==Ct.NoScale&&o*d-l*h<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let v=Math.PI/2+Math.atan2(x,u),g=Math.cos(v)*p,w=Math.sin(v)*p,b=E.cosDeg(c)*s,y=E.cosDeg(90+n)*a,T=E.sinDeg(c)*s,A=E.sinDeg(90+n)*a;this.a=u*b+g*T,this.b=u*y+g*A,this.c=x*b+w*T,this.d=x*y+w*A;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let 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}getWorldRotationX(){return Math.atan2(this.c,this.a)*E.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*E.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){let t=this.parent;if(!t){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*E.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,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*E.radDeg;return}let e=t.a,i=t.b,s=t.c,a=t.d,c=1/(e*a-i*s),n=this.worldX-t.worldX,r=this.worldY-t.worldY;this.ax=n*a*c-r*i*c,this.ay=r*e*c-n*s*c;let o=c*a,l=c*e,h=c*i,d=c*s,f=o*this.a-h*this.c,m=o*this.b-h*this.d,u=l*this.c-d*this.a,x=l*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+u*u),this.ascaleX>1e-4){let p=f*x-m*u;this.ascaleY=p/this.ascaleX,this.ashearY=Math.atan2(f*m+u*x,p)*E.radDeg,this.arotation=Math.atan2(u,f)*E.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(m*m+x*x),this.ashearY=0,this.arotation=90-Math.atan2(x,m)*E.radDeg}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),i=t.x-this.worldX,s=t.y-this.worldY;return t.x=i*this.d*e-s*this.b*e,t.y=s*this.a*e-i*this.c*e,t}localToWorld(t){let e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t}worldToLocalRotation(t){let e=E.sinDeg(t),i=E.cosDeg(t);return Math.atan2(this.a*e-this.c*i,this.d*i-this.b*e)*E.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=E.sinDeg(t),i=E.cosDeg(t);return Math.atan2(i*this.c+e*this.d,i*this.a+e*this.b)*E.radDeg}rotateWorld(t){let e=this.a,i=this.b,s=this.c,a=this.d,c=E.cosDeg(t),n=E.sinDeg(t);this.a=c*e-n*s,this.b=c*i-n*a,this.c=n*e+c*s,this.d=n*i+c*a}},Ae=class{constructor(t,e,i){this.name=t,this.order=e,this.skinRequired=i}},Ji=class{constructor(t,e="",i=null){this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e,this.downloader=i||new Ki}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,i){this.toLoad--,this.loaded++,this.assets[e]=i,t&&t(e,i)}error(t,e,i){this.toLoad--,this.loaded++,this.errors[e]=i,t&&t(e,i)}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=null,i=null){t=this.start(t),this.downloader.downloadBinary(t,s=>{this.success(e,t,s)},(s,a)=>{this.error(i,t,`Couldn't load binary ${t}: status ${s}, ${a}`)})}loadText(t,e=null,i=null){t=this.start(t),this.downloader.downloadText(t,s=>{this.success(e,t,s)},(s,a)=>{this.error(i,t,`Couldn't load text ${t}: status ${s}, ${a}`)})}loadJson(t,e=null,i=null){t=this.start(t),this.downloader.downloadJson(t,s=>{this.success(e,t,s)},(s,a)=>{this.error(i,t,`Couldn't load JSON ${t}: status ${s}, ${a}`)})}loadTexture(t,e=null,i=null){if(t=this.start(t),!!!(typeof window!="undefined"&&typeof navigator!="undefined"&&window.document))fetch(t,{mode:"cors"}).then(c=>c.ok?c.blob():(this.error(i,t,`Couldn't load image: ${t}`),null)).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{c&&this.success(e,t,this.textureLoader(c))});else{let c=new Image;c.crossOrigin="anonymous",c.onload=()=>{this.success(e,t,this.textureLoader(c))},c.onerror=()=>{this.error(i,t,`Couldn't load image: ${t}`)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),c.src=t}}loadTextureAtlas(t,e=null,i=null){let s=t.lastIndexOf("/"),a=s>=0?t.substring(0,s+1):"";t=this.start(t),this.downloader.downloadText(t,c=>{try{let n=new ji(c),r=n.pages.length,o=!1;for(let l of n.pages)this.loadTexture(a+l.name,(h,d)=>{o||(l.setTexture(d),--r==0&&this.success(e,t,n))},(h,d)=>{o||this.error(i,t,`Couldn't load texture atlas ${t} page image: ${h}`),o=!0})}catch(n){this.error(i,t,`Couldn't parse texture atlas ${t}: ${n.message}`)}},(c,n)=>{this.error(i,t,`Couldn't load texture atlas ${t}: status ${c}, ${n}`)})}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let e=this.assets[t];if(e)return e;let i=this.errors[t];throw Error("Asset not found: "+t+(i?`
2
- `+i:""))}remove(t){t=this.pathPrefix+t;let e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}removeAll(){for(let t in this.assets){let e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}isLoadingComplete(){return this.toLoad==0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},Ki=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return e!=-1?(e+="base64,".length,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var e=window.atob(t),i=e.length,s=new Uint8Array(i),a=0;a<i;a++)s[a]=e.charCodeAt(a);return s}dataUriToUint8Array(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");if(e==-1)throw new Error("Not a binary data URI.");return e+="base64,".length,this.base64ToUint8Array(t.substr(e))}downloadText(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let c=this.rawDataUris[t];this.finish(t,200,this.dataUriToString(c))}catch(c){this.finish(t,400,JSON.stringify(c))}return}let s=new XMLHttpRequest;s.overrideMimeType("text/html"),s.open("GET",t,!0);let a=()=>{this.finish(t,s.status,s.responseText)};s.onload=a,s.onerror=a,s.send()}downloadJson(t,e,i){this.downloadText(t,s=>{e(JSON.parse(s))},i)}downloadBinary(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let c=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(c))}catch(c){this.finish(t,400,JSON.stringify(c))}return}let s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType="arraybuffer";let a=()=>{this.finish(t,s.status,s.response)};s.onload=()=>{s.status==200?this.finish(t,200,new Uint8Array(s.response)):a()},s.onerror=a,s.send()}start(t,e,i){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,i)}}finish(t,e,i){let s=this.callbacks[t];delete this.callbacks[t];let a=e==200?[i]:[e,i];for(let c=a.length-1,n=s.length;c<n;c+=2)s[c].apply(null,a)}},mi=class{constructor(t,e){if(!e)throw new Error("data cannot be null.");this.time=t,this.data=e}},gi=class{constructor(t){this.name=t}},Qi=class{constructor(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(let i=0;i<t.bones.length;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}update(){if(this.mix==0)return;let t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(t,e,i,s,a,c,n){let r=t.parent,o=r.a,l=r.b,h=r.c,d=r.d,f=-t.ashearX-t.arotation,m=0,u=0;switch(t.data.transformMode){case Ct.OnlyTranslation:m=e-t.worldX,u=i-t.worldY;break;case Ct.NoRotationOrReflection:let v=Math.abs(o*d-l*h)/(o*o+h*h),g=o/t.skeleton.scaleX,w=h/t.skeleton.scaleY;l=-w*v*t.skeleton.scaleX,d=g*v*t.skeleton.scaleY,f+=Math.atan2(w,g)*E.radDeg;default:let b=e-r.worldX,y=i-r.worldY,T=o*d-l*h;m=(b*d-y*l)/T-t.ax,u=(y*o-b*h)/T-t.ay}f+=Math.atan2(u,m)*E.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let x=t.ascaleX,p=t.ascaleY;if(s||a){switch(t.data.transformMode){case Ct.NoScale:case Ct.NoScaleOrReflection:m=e-t.worldX,u=i-t.worldY}let v=t.data.length*x,g=Math.sqrt(m*m+u*u);if(s&&g<v||a&&g>v&&v>1e-4){let w=(g/v-1)*n+1;x*=w,c&&(p*=w)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*n,x,p,t.ashearX,t.ashearY)}apply2(t,e,i,s,a,c,n,r,o){let l=t.ax,h=t.ay,d=t.ascaleX,f=t.ascaleY,m=d,u=f,x=e.ascaleX,p=0,v=0,g=0;d<0?(d=-d,p=180,g=-1):(p=0,g=1),f<0&&(f=-f,g=-g),x<0?(x=-x,v=180):v=0;let w=e.ax,b=0,y=0,T=0,A=t.a,I=t.b,k=t.c,F=t.d,P=Math.abs(d-f)<=1e-4;!P||c?(b=0,y=A*w+t.worldX,T=k*w+t.worldY):(b=e.ay,y=A*w+I*b+t.worldX,T=k*w+F*b+t.worldY);let L=t.parent;A=L.a,I=L.b,k=L.c,F=L.d;let B=1/(A*F-I*k),C=y-L.worldX,M=T-L.worldY,D=(C*F-M*I)*B-l,X=(M*A-C*k)*B-h,R=Math.sqrt(D*D+X*X),st=e.data.length*x,dt,ht;if(R<1e-4){this.apply1(t,i,s,!1,c,!1,o),e.updateWorldTransformWith(w,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);return}C=i-L.worldX,M=s-L.worldY;let rt=(C*F-M*I)*B-l,it=(M*A-C*k)*B-h,ct=rt*rt+it*it;if(r!=0){r*=d*(x+1)*.5;let wt=Math.sqrt(ct),It=wt-R-st*d+r;if(It>0){let kt=Math.min(1,It/(r*2))-1;kt=(It-r*(1-kt*kt))/wt,rt-=kt*rt,it-=kt*it,ct=rt*rt+it*it}}t:if(P){st*=d;let wt=(ct-R*R-st*st)/(2*R*st);wt<-1?(wt=-1,ht=Math.PI*a):wt>1?(wt=1,ht=0,c&&(A=(Math.sqrt(ct)/(R+st)-1)*o+1,m*=A,n&&(u*=A))):ht=Math.acos(wt)*a,A=R+st*wt,I=st*Math.sin(ht),dt=Math.atan2(it*A-rt*I,rt*A+it*I)}else{A=d*st,I=f*st;let wt=A*A,It=I*I,kt=Math.atan2(it,rt);k=It*R*R+wt*ct-wt*It;let Gt=-2*It*R,ne=It-wt;if(F=Gt*Gt-4*ne*k,F>=0){let le=Math.sqrt(F);Gt<0&&(le=-le),le=-(Gt+le)*.5;let ws=le/ne,ps=k/le,oe=Math.abs(ws)<Math.abs(ps)?ws:ps;if(oe*oe<=ct){M=Math.sqrt(ct-oe*oe)*a,dt=kt-Math.atan2(M,oe),ht=Math.atan2(M/f,(oe-R)/d);break t}}let xe=E.PI,Ee=R-A,Ri=Ee*Ee,gs=0,xs=0,Le=R+A,Ei=Le*Le,bs=0;k=-A*R/(wt-It),k>=-1&&k<=1&&(k=Math.acos(k),C=A*Math.cos(k)+R,M=I*Math.sin(k),F=C*C+M*M,F<Ri&&(xe=k,Ri=F,Ee=C,gs=M),F>Ei&&(xs=k,Ei=F,Le=C,bs=M)),ct<=(Ri+Ei)*.5?(dt=kt-Math.atan2(gs*a,Ee),ht=xe*a):(dt=kt-Math.atan2(bs*a,Le),ht=xs*a)}let At=Math.atan2(b,w)*g,Lt=t.arotation;dt=(dt-At)*E.radDeg+p-Lt,dt>180?dt-=360:dt<-180&&(dt+=360),t.updateWorldTransformWith(l,h,Lt+dt*o,m,u,0,0),Lt=e.arotation,ht=((ht+At)*E.radDeg-e.ashearX)*g+v-Lt,ht>180?ht-=360:ht<-180&&(ht+=360),e.updateWorldTransformWith(w,b,Lt+ht*o,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}},xi=class extends Ae{constructor(t){super(t,0,!1);this.bones=new Array,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}},bi=class extends Ae{constructor(t){super(t,0,!1);this.bones=new Array,this.mixRotate=0,this.mixX=0,this.mixY=0}},Pt;(function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"})(Pt||(Pt={}));var gt;(function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"})(gt||(gt={}));var Qt;(function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"})(Qt||(Qt={}));var Nt=class{constructor(t,e){if(this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0,s=t.bones.length;i<s;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findSlot(t.target.name),this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}isActive(){return this.active}update(){let t=this.target.getAttachment();if(!(t instanceof Kt))return;let e=this.mixRotate,i=this.mixX,s=this.mixY;if(e==0&&i==0&&s==0)return;let a=this.data,c=a.rotateMode==Qt.Tangent,n=a.rotateMode==Qt.ChainScale,r=this.bones,o=r.length,l=c?o:o+1,h=O.setArraySize(this.spaces,l),d=n?this.lengths=O.setArraySize(this.lengths,o):null,f=this.spacing;switch(a.spacingMode){case gt.Percent:if(n)for(let b=0,y=l-1;b<y;b++){let T=r[b],A=T.data.length;if(A<Nt.epsilon)d[b]=0;else{let I=A*T.a,k=A*T.c;d[b]=Math.sqrt(I*I+k*k)}}O.arrayFill(h,1,l,f);break;case gt.Proportional:let g=0;for(let b=0,y=l-1;b<y;){let T=r[b],A=T.data.length;if(A<Nt.epsilon)n&&(d[b]=0),h[++b]=f;else{let I=A*T.a,k=A*T.c,F=Math.sqrt(I*I+k*k);n&&(d[b]=F),h[++b]=F,g+=F}}if(g>0){g=l/g*f;for(let b=1;b<l;b++)h[b]*=g}break;default:let w=a.spacingMode==gt.Length;for(let b=0,y=l-1;b<y;){let T=r[b],A=T.data.length;if(A<Nt.epsilon)n&&(d[b]=0),h[++b]=f;else{let I=A*T.a,k=A*T.c,F=Math.sqrt(I*I+k*k);n&&(d[b]=F),h[++b]=(w?A+f:f)*F/A}}}let m=this.computeWorldPositions(t,l,c),u=m[0],x=m[1],p=a.offsetRotation,v=!1;if(p==0)v=a.rotateMode==Qt.Chain;else{v=!1;let g=this.target.bone;p*=g.a*g.d-g.b*g.c>0?E.degRad:-E.degRad}for(let g=0,w=3;g<o;g++,w+=3){let b=r[g];b.worldX+=(u-b.worldX)*i,b.worldY+=(x-b.worldY)*s;let y=m[w],T=m[w+1],A=y-u,I=T-x;if(n){let k=d[g];if(k!=0){let F=(Math.sqrt(A*A+I*I)/k-1)*e+1;b.a*=F,b.c*=F}}if(u=y,x=T,e>0){let k=b.a,F=b.b,P=b.c,L=b.d,B=0,C=0,M=0;if(c?B=m[w-1]:h[g+1]==0?B=m[w+2]:B=Math.atan2(I,A),B-=Math.atan2(P,k),v){C=Math.cos(B),M=Math.sin(B);let D=b.data.length;u+=(D*(C*k-M*P)-A)*e,x+=(D*(M*k+C*P)-I)*e}else B+=p;B>E.PI?B-=E.PI2:B<-E.PI&&(B+=E.PI2),B*=e,C=Math.cos(B),M=Math.sin(B),b.a=C*k-M*P,b.b=C*F-M*L,b.c=M*k+C*P,b.d=M*F+C*L}b.updateAppliedTransform()}}computeWorldPositions(t,e,i){let s=this.target,a=this.position,c=this.spaces,n=O.setArraySize(this.positions,e*3+2),r=null,o=t.closed,l=t.worldVerticesLength,h=l/6,d=Nt.NONE;if(!t.constantSpeed){let X=t.lengths;h-=o?1:2;let R=X[h];this.data.positionMode==Pt.Percent&&(a*=R);let st;switch(this.data.spacingMode){case gt.Percent:st=R;break;case gt.Proportional:st=R/e;break;default:st=1}r=O.setArraySize(this.world,8);for(let dt=0,ht=0,rt=0;dt<e;dt++,ht+=3){let it=c[dt]*st;a+=it;let ct=a;if(o)ct%=R,ct<0&&(ct+=R),rt=0;else if(ct<0){d!=Nt.BEFORE&&(d=Nt.BEFORE,t.computeWorldVertices(s,2,4,r,0,2)),this.addBeforePosition(ct,r,0,n,ht);continue}else if(ct>R){d!=Nt.AFTER&&(d=Nt.AFTER,t.computeWorldVertices(s,l-6,4,r,0,2)),this.addAfterPosition(ct-R,r,0,n,ht);continue}for(;;rt++){let At=X[rt];if(!(ct>At)){if(rt==0)ct/=At;else{let Lt=X[rt-1];ct=(ct-Lt)/(At-Lt)}break}}rt!=d&&(d=rt,o&&rt==h?(t.computeWorldVertices(s,l-4,4,r,0,2),t.computeWorldVertices(s,0,4,r,4,2)):t.computeWorldVertices(s,rt*6+2,8,r,0,2)),this.addCurvePosition(ct,r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],n,ht,i||dt>0&&it==0)}return n}o?(l+=2,r=O.setArraySize(this.world,l),t.computeWorldVertices(s,2,l-4,r,0,2),t.computeWorldVertices(s,0,2,r,l-4,2),r[l-2]=r[0],r[l-1]=r[1]):(h--,l-=4,r=O.setArraySize(this.world,l),t.computeWorldVertices(s,2,l,r,0,2));let f=O.setArraySize(this.curves,h),m=0,u=r[0],x=r[1],p=0,v=0,g=0,w=0,b=0,y=0,T=0,A=0,I=0,k=0,F=0,P=0,L=0,B=0;for(let X=0,R=2;X<h;X++,R+=6)p=r[R],v=r[R+1],g=r[R+2],w=r[R+3],b=r[R+4],y=r[R+5],T=(u-p*2+g)*.1875,A=(x-v*2+w)*.1875,I=((p-g)*3-u+b)*.09375,k=((v-w)*3-x+y)*.09375,F=T*2+I,P=A*2+k,L=(p-u)*.75+T+I*.16666667,B=(v-x)*.75+A+k*.16666667,m+=Math.sqrt(L*L+B*B),L+=F,B+=P,F+=I,P+=k,m+=Math.sqrt(L*L+B*B),L+=F,B+=P,m+=Math.sqrt(L*L+B*B),L+=F+I,B+=P+k,m+=Math.sqrt(L*L+B*B),f[X]=m,u=b,x=y;this.data.positionMode==Pt.Percent&&(a*=m);let C;switch(this.data.spacingMode){case gt.Percent:C=m;break;case gt.Proportional:C=m/e;break;default:C=1}let M=this.segments,D=0;for(let X=0,R=0,st=0,dt=0;X<e;X++,R+=3){let ht=c[X]*C;a+=ht;let rt=a;if(o)rt%=m,rt<0&&(rt+=m),st=0;else if(rt<0){this.addBeforePosition(rt,r,0,n,R);continue}else if(rt>m){this.addAfterPosition(rt-m,r,l-4,n,R);continue}for(;;st++){let it=f[st];if(!(rt>it)){if(st==0)rt/=it;else{let ct=f[st-1];rt=(rt-ct)/(it-ct)}break}}if(st!=d){d=st;let it=st*6;for(u=r[it],x=r[it+1],p=r[it+2],v=r[it+3],g=r[it+4],w=r[it+5],b=r[it+6],y=r[it+7],T=(u-p*2+g)*.03,A=(x-v*2+w)*.03,I=((p-g)*3-u+b)*.006,k=((v-w)*3-x+y)*.006,F=T*2+I,P=A*2+k,L=(p-u)*.3+T+I*.16666667,B=(v-x)*.3+A+k*.16666667,D=Math.sqrt(L*L+B*B),M[0]=D,it=1;it<8;it++)L+=F,B+=P,F+=I,P+=k,D+=Math.sqrt(L*L+B*B),M[it]=D;L+=F,B+=P,D+=Math.sqrt(L*L+B*B),M[8]=D,L+=F+I,B+=P+k,D+=Math.sqrt(L*L+B*B),M[9]=D,dt=0}for(rt*=D;;dt++){let it=M[dt];if(!(rt>it)){if(dt==0)rt/=it;else{let ct=M[dt-1];rt=dt+(rt-ct)/(it-ct)}break}}this.addCurvePosition(rt*.1,u,x,p,v,g,w,b,y,n,R,i||X>0&&ht==0)}return n}addBeforePosition(t,e,i,s,a){let c=e[i],n=e[i+1],r=e[i+2]-c,o=e[i+3]-n,l=Math.atan2(o,r);s[a]=c+t*Math.cos(l),s[a+1]=n+t*Math.sin(l),s[a+2]=l}addAfterPosition(t,e,i,s,a){let c=e[i+2],n=e[i+3],r=c-e[i],o=n-e[i+1],l=Math.atan2(o,r);s[a]=c+t*Math.cos(l),s[a+1]=n+t*Math.sin(l),s[a+2]=l}addCurvePosition(t,e,i,s,a,c,n,r,o,l,h,d){if(t==0||isNaN(t)){l[h]=e,l[h+1]=i,l[h+2]=Math.atan2(a-i,s-e);return}let f=t*t,m=f*t,u=1-t,x=u*u,p=x*u,v=u*t,g=v*3,w=u*g,b=g*t,y=e*p+s*w+c*b+r*m,T=i*p+a*w+n*b+o*m;l[h]=y,l[h+1]=T,d&&(t<.001?l[h+2]=Math.atan2(a-i,s-e):l[h+2]=Math.atan2(T-(i*x+a*v*2+n*f),y-(e*x+s*v*2+c*f)))}},ee=Nt;ee.NONE=-1,ee.BEFORE=-2,ee.AFTER=-3,ee.epsilon=1e-5;var $i=class{constructor(t,e){if(this.deform=new Array,!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new V,this.darkColor=t.darkColor?new V:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&((!(t instanceof Bt)||!(this.attachment instanceof Bt)||t.deformAttachment!=this.attachment.deformAttachment)&&(this.deform.length=0),this.attachment=t,this.attachmentTime=this.bone.skeleton.time)}setAttachmentTime(t){this.attachmentTime=this.bone.skeleton.time-t}getAttachmentTime(){return this.bone.skeleton.time-this.attachmentTime}setToSetupPose(){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}},ts=class{constructor(t,e){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new ce,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(let i=0;i<t.bones.length;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}update(){this.mixRotate==0&&this.mixX==0&&this.mixY==0&&this.mixScaleX==0&&this.mixScaleX==0&&this.mixShearY==0||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,a=this.mixScaleY,c=this.mixShearY,n=e!=0||i!=0,r=this.target,o=r.a,l=r.b,h=r.c,d=r.d,f=o*d-l*h>0?E.degRad:-E.degRad,m=this.data.offsetRotation*f,u=this.data.offsetShearY*f,x=this.bones;for(let p=0,v=x.length;p<v;p++){let g=x[p];if(t!=0){let w=g.a,b=g.b,y=g.c,T=g.d,A=Math.atan2(h,o)-Math.atan2(y,w)+m;A>E.PI?A-=E.PI2:A<-E.PI&&(A+=E.PI2),A*=t;let I=Math.cos(A),k=Math.sin(A);g.a=I*w-k*y,g.b=I*b-k*T,g.c=k*w+I*y,g.d=k*b+I*T}if(n){let w=this.temp;r.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(w.x-g.worldX)*e,g.worldY+=(w.y-g.worldY)*i}if(s!=0){let w=Math.sqrt(g.a*g.a+g.c*g.c);w!=0&&(w=(w+(Math.sqrt(o*o+h*h)-w+this.data.offsetScaleX)*s)/w),g.a*=w,g.c*=w}if(a!=0){let w=Math.sqrt(g.b*g.b+g.d*g.d);w!=0&&(w=(w+(Math.sqrt(l*l+d*d)-w+this.data.offsetScaleY)*a)/w),g.b*=w,g.d*=w}if(c>0){let w=g.b,b=g.d,y=Math.atan2(b,w),T=Math.atan2(d,l)-Math.atan2(h,o)-(y-Math.atan2(g.c,g.a));T>E.PI?T-=E.PI2:T<-E.PI&&(T+=E.PI2),T=y+(T+u)*c;let A=Math.sqrt(w*w+b*b);g.b=Math.cos(T)*A,g.d=Math.sin(T)*A}g.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,a=this.mixScaleY,c=this.mixShearY,n=e!=0||i!=0,r=this.target,o=r.a,l=r.b,h=r.c,d=r.d,f=o*d-l*h>0?E.degRad:-E.degRad,m=this.data.offsetRotation*f,u=this.data.offsetShearY*f,x=this.bones;for(let p=0,v=x.length;p<v;p++){let g=x[p];if(t!=0){let w=g.a,b=g.b,y=g.c,T=g.d,A=Math.atan2(h,o)+m;A>E.PI?A-=E.PI2:A<-E.PI&&(A+=E.PI2),A*=t;let I=Math.cos(A),k=Math.sin(A);g.a=I*w-k*y,g.b=I*b-k*T,g.c=k*w+I*y,g.d=k*b+I*T}if(n){let w=this.temp;r.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),g.worldX+=w.x*e,g.worldY+=w.y*i}if(s!=0){let w=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleX)*s+1;g.a*=w,g.c*=w}if(a!=0){let w=(Math.sqrt(l*l+d*d)-1+this.data.offsetScaleY)*a+1;g.b*=w,g.d*=w}if(c>0){let w=Math.atan2(d,l)-Math.atan2(h,o);w>E.PI?w-=E.PI2:w<-E.PI&&(w+=E.PI2);let b=g.b,y=g.d;w=Math.atan2(y,b)+(w-E.PI/2+u)*c;let T=Math.sqrt(b*b+y*y);g.b=Math.cos(w)*T,g.d=Math.sin(w)*T}g.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,a=this.mixScaleY,c=this.mixShearY,n=this.target,r=this.bones;for(let o=0,l=r.length;o<l;o++){let h=r[o],d=h.arotation;if(t!=0){let v=n.arotation-d+this.data.offsetRotation;v-=(16384-(16384.499999999996-v/360|0))*360,d+=v*t}let f=h.ax,m=h.ay;f+=(n.ax-f+this.data.offsetX)*e,m+=(n.ay-m+this.data.offsetY)*i;let u=h.ascaleX,x=h.ascaleY;s!=0&&u!=0&&(u=(u+(n.ascaleX-u+this.data.offsetScaleX)*s)/u),a!=0&&x!=0&&(x=(x+(n.ascaleY-x+this.data.offsetScaleY)*a)/x);let p=h.ashearY;if(c!=0){let v=n.ashearY-p+this.data.offsetShearY;v-=(16384-(16384.499999999996-v/360|0))*360,p+=v*c}h.updateWorldTransformWith(f,m,d,u,x,h.ashearX,p)}}applyRelativeLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,a=this.mixScaleY,c=this.mixShearY,n=this.target,r=this.bones;for(let o=0,l=r.length;o<l;o++){let h=r[o],d=h.arotation+(n.arotation+this.data.offsetRotation)*t,f=h.ax+(n.ax+this.data.offsetX)*e,m=h.ay+(n.ay+this.data.offsetY)*i,u=h.ascaleX*((n.ascaleX-1+this.data.offsetScaleX)*s+1),x=h.ascaleY*((n.ascaleY-1+this.data.offsetScaleY)*a+1),p=h.ashearY+(n.ashearY+this.data.offsetShearY)*c;h.updateWorldTransformWith(f,m,d,u,x,h.ashearX,p)}}},Fs=class{constructor(t){if(this._updateCache=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,!t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(let e=0;e<t.bones.length;e++){let i=t.bones[e],s;if(!i.parent)s=new ui(i,this,null);else{let a=this.bones[i.parent.index];s=new ui(i,this,a),a.children.push(s)}this.bones.push(s)}this.slots=new Array,this.drawOrder=new Array;for(let e=0;e<t.slots.length;e++){let i=t.slots[e],s=this.bones[i.boneData.index],a=new $i(i,s);this.slots.push(a),this.drawOrder.push(a)}this.ikConstraints=new Array;for(let e=0;e<t.ikConstraints.length;e++){let i=t.ikConstraints[e];this.ikConstraints.push(new Qi(i,this))}this.transformConstraints=new Array;for(let e=0;e<t.transformConstraints.length;e++){let i=t.transformConstraints[e];this.transformConstraints.push(new ts(i,this))}this.pathConstraints=new Array;for(let e=0;e<t.pathConstraints.length;e++){let i=t.pathConstraints[e];this.pathConstraints.push(new ee(i,this))}this.color=new V(1,1,1,1),this.updateCache()}updateCache(){let t=this._updateCache;t.length=0;let e=this.bones;for(let l=0,h=e.length;l<h;l++){let d=e[l];d.sorted=d.data.skinRequired,d.active=!d.sorted}if(this.skin){let l=this.skin.bones;for(let h=0,d=this.skin.bones.length;h<d;h++){let f=this.bones[l[h].index];do f.sorted=!1,f.active=!0,f=f.parent;while(f)}}let i=this.ikConstraints,s=this.transformConstraints,a=this.pathConstraints,c=i.length,n=s.length,r=a.length,o=c+n+r;t:for(let l=0;l<o;l++){for(let h=0;h<c;h++){let d=i[h];if(d.data.order==l){this.sortIkConstraint(d);continue t}}for(let h=0;h<n;h++){let d=s[h];if(d.data.order==l){this.sortTransformConstraint(d);continue t}}for(let h=0;h<r;h++){let d=a[h];if(d.data.order==l){this.sortPathConstraint(d);continue t}}}for(let l=0,h=e.length;l<h;l++)this.sortBone(e[l])}sortIkConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&O.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target;this.sortBone(e);let i=t.bones,s=i[0];if(this.sortBone(s),i.length==1)this._updateCache.push(t),this.sortReset(s.children);else{let a=i[i.length-1];this.sortBone(a),this._updateCache.push(t),this.sortReset(s.children),a.sorted=!0}}sortPathConstraint(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&O.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target,i=e.data.index,s=e.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,i,s),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,i,s);for(let r=0,o=this.data.skins.length;r<o;r++)this.sortPathConstraintAttachment(this.data.skins[r],i,s);let a=e.getAttachment();a instanceof Kt&&this.sortPathConstraintAttachmentWith(a,s);let c=t.bones,n=c.length;for(let r=0;r<n;r++)this.sortBone(c[r]);this._updateCache.push(t);for(let r=0;r<n;r++)this.sortReset(c[r].children);for(let r=0;r<n;r++)c[r].sorted=!0}sortTransformConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&O.contains(this.skin.constraints,t.data,!0)),!t.active)return;this.sortBone(t.target);let e=t.bones,i=e.length;if(t.data.local)for(let s=0;s<i;s++){let a=e[s];this.sortBone(a.parent),this.sortBone(a)}else for(let s=0;s<i;s++)this.sortBone(e[s]);this._updateCache.push(t);for(let s=0;s<i;s++)this.sortReset(e[s].children);for(let s=0;s<i;s++)e[s].sorted=!0}sortPathConstraintAttachment(t,e,i){let s=t.attachments[e];if(!!s)for(let a in s)this.sortPathConstraintAttachmentWith(s[a],i)}sortPathConstraintAttachmentWith(t,e){if(!(t instanceof Kt))return;let i=t.bones;if(!i)this.sortBone(e);else{let s=this.bones;for(let a=0,c=i.length;a<c;){let n=i[a++];for(n+=a;a<n;)this.sortBone(s[i[a++]])}}}sortBone(t){if(t.sorted)return;let e=t.parent;e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let e=0,i=t.length;e<i;e++){let s=t[e];!s.active||(s.sorted&&this.sortReset(s.children),s.sorted=!1)}}updateWorldTransform(){let t=this.bones;for(let i=0,s=t.length;i<s;i++){let a=t[i];a.ax=a.x,a.ay=a.y,a.arotation=a.rotation,a.ascaleX=a.scaleX,a.ascaleY=a.scaleY,a.ashearX=a.shearX,a.ashearY=a.shearY}let e=this._updateCache;for(let i=0,s=e.length;i<s;i++)e[i].update()}updateWorldTransformWith(t){let e=this.getRootBone(),i=t.a,s=t.b,a=t.c,c=t.d;e.worldX=i*this.x+s*this.y+t.worldX,e.worldY=a*this.x+c*this.y+t.worldY;let n=e.rotation+90+e.shearY,r=E.cosDeg(e.rotation+e.shearX)*e.scaleX,o=E.cosDeg(n)*e.scaleY,l=E.sinDeg(e.rotation+e.shearX)*e.scaleX,h=E.sinDeg(n)*e.scaleY;e.a=(i*r+s*l)*this.scaleX,e.b=(i*o+s*h)*this.scaleX,e.c=(a*r+c*l)*this.scaleY,e.d=(a*o+c*h)*this.scaleY;let d=this._updateCache;for(let f=0,m=d.length;f<m;f++){let u=d[f];u!=e&&u.update()}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){let t=this.bones;for(let a=0,c=t.length;a<c;a++)t[a].setToSetupPose();let e=this.ikConstraints;for(let a=0,c=e.length;a<c;a++){let n=e[a];n.mix=n.data.mix,n.softness=n.data.softness,n.bendDirection=n.data.bendDirection,n.compress=n.data.compress,n.stretch=n.data.stretch}let i=this.transformConstraints;for(let a=0,c=i.length;a<c;a++){let n=i[a],r=n.data;n.mixRotate=r.mixRotate,n.mixX=r.mixX,n.mixY=r.mixY,n.mixScaleX=r.mixScaleX,n.mixScaleY=r.mixScaleY,n.mixShearY=r.mixShearY}let s=this.pathConstraints;for(let a=0,c=s.length;a<c;a++){let n=s[a],r=n.data;n.position=r.position,n.spacing=r.spacing,n.mixRotate=r.mixRotate,n.mixX=r.mixX,n.mixY=r.mixY}}setSlotsToSetupPose(){let t=this.slots;O.arrayCopy(t,0,this.drawOrder,0,t.length);for(let e=0,i=t.length;e<i;e++)t[e].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(a.data.name==t)return a}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(a.data.name==t)return a}return null}setSkinByName(t){let e=this.data.findSkin(t);if(!e)throw new Error("Skin not found: "+t);this.setSkin(e)}setSkin(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else{let e=this.slots;for(let i=0,s=e.length;i<s;i++){let a=e[i],c=a.data.attachmentName;if(c){let n=t.getAttachment(i,c);n&&a.setAttachment(n)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,e){return this.getAttachment(this.data.findSlot(t).index,e)}getAttachment(t,e){if(!e)throw new Error("attachmentName cannot be null.");if(this.skin){let i=this.skin.getAttachment(t,e);if(i)return i}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null}setAttachment(t,e){if(!t)throw new Error("slotName cannot be null.");let i=this.slots;for(let s=0,a=i.length;s<a;s++){let c=i[s];if(c.data.name==t){let n=null;if(e&&(n=this.getAttachment(s,e),!n))throw new Error("Attachment not found: "+e+", for slot: "+t);c.setAttachment(n);return}}throw new Error("Slot not found: "+t)}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.ikConstraints;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(a.data.name==t)return a}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.transformConstraints;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(a.data.name==t)return a}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.pathConstraints;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(a.data.name==t)return a}return null}getBounds(t,e,i=new Array(2)){if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");let s=this.drawOrder,a=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let o=0,l=s.length;o<l;o++){let h=s[o];if(!h.bone.active)continue;let d=0,f=null,m=h.getAttachment();if(m instanceof at)d=8,f=O.setArraySize(i,d,0),m.computeWorldVertices(h.bone,f,0,2);else if(m instanceof _t){let u=m;d=u.worldVerticesLength,f=O.setArraySize(i,d,0),u.computeWorldVertices(h,0,d,f,0,2)}if(f)for(let u=0,x=f.length;u<x;u+=2){let p=f[u],v=f[u+1];a=Math.min(a,p),c=Math.min(c,v),n=Math.max(n,p),r=Math.max(r,v)}}t.set(a,c),e.set(n-a,r-c)}update(t){this.time+=t}},wi=class{constructor(){this.bones=new Array,this.slots=new Array,this.skins=new Array,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.fps=0}findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(a.name==t)return a}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(a.name==t)return a}return null}findSkin(t){if(!t)throw new Error("skinName cannot be null.");let e=this.skins;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(a.name==t)return a}return null}findEvent(t){if(!t)throw new Error("eventDataName cannot be null.");let e=this.events;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(a.name==t)return a}return null}findAnimation(t){if(!t)throw new Error("animationName cannot be null.");let e=this.animations;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(a.name==t)return a}return null}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.ikConstraints;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(a.name==t)return a}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.transformConstraints;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(a.name==t)return a}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.pathConstraints;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(a.name==t)return a}return null}},pi=class{constructor(t,e,i){this.slotIndex=t,this.name=e,this.attachment=i}},Se=class{constructor(t){if(this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!t)throw new Error("name cannot be null.");this.name=t}setAttachment(t,e,i){if(!i)throw new Error("attachment cannot be null.");let s=this.attachments;t>=s.length&&(s.length=t+1),s[t]||(s[t]={}),s[t][e]=i}addSkin(t){for(let s=0;s<t.bones.length;s++){let a=t.bones[s],c=!1;for(let n=0;n<this.bones.length;n++)if(this.bones[n]==a){c=!0;break}c||this.bones.push(a)}for(let s=0;s<t.constraints.length;s++){let a=t.constraints[s],c=!1;for(let n=0;n<this.constraints.length;n++)if(this.constraints[n]==a){c=!0;break}c||this.constraints.push(a)}let e=t.getAttachments();for(let s=0;s<e.length;s++){var i=e[s];this.setAttachment(i.slotIndex,i.name,i.attachment)}}copySkin(t){for(let s=0;s<t.bones.length;s++){let a=t.bones[s],c=!1;for(let n=0;n<this.bones.length;n++)if(this.bones[n]==a){c=!0;break}c||this.bones.push(a)}for(let s=0;s<t.constraints.length;s++){let a=t.constraints[s],c=!1;for(let n=0;n<this.constraints.length;n++)if(this.constraints[n]==a){c=!0;break}c||this.constraints.push(a)}let e=t.getAttachments();for(let s=0;s<e.length;s++){var i=e[s];!i.attachment||(i.attachment instanceof _t?(i.attachment=i.attachment.newLinkedMesh(),this.setAttachment(i.slotIndex,i.name,i.attachment)):(i.attachment=i.attachment.copy(),this.setAttachment(i.slotIndex,i.name,i.attachment)))}}getAttachment(t,e){let i=this.attachments[t];return i?i[e]:null}removeAttachment(t,e){let i=this.attachments[t];i&&(i[e]=null)}getAttachments(){let t=new Array;for(var e=0;e<this.attachments.length;e++){let i=this.attachments[e];if(i)for(let s in i){let a=i[s];a&&t.push(new pi(e,s,a))}}return t}getAttachmentsForSlot(t,e){let i=this.attachments[t];if(i)for(let s in i){let a=i[s];a&&e.push(new pi(t,s,a))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(t,e){let i=0;for(let s=0;s<t.slots.length;s++){let a=t.slots[s],c=a.getAttachment();if(c&&i<e.attachments.length){let n=e.attachments[i];for(let r in n){let o=n[r];if(c==o){let l=this.getAttachment(i,r);l&&a.setAttachment(l);break}}}i++}}},vi=class{constructor(t,e,i){if(this.color=new V(1,1,1,1),t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}},pt;(function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"})(pt||(pt={}));var yi=class extends Ae{constructor(t){super(t,0,!1);this.bones=new Array,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}},Xs=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new wi;i.name="";let s=new es(t),a=s.readInt32(),c=s.readInt32();i.hash=c==0&&a==0?null:c.toString(16)+a.toString(16),i.version=s.readString(),i.x=s.readFloat(),i.y=s.readFloat(),i.width=s.readFloat(),i.height=s.readFloat();let n=s.readBoolean();n&&(i.fps=s.readFloat(),i.imagesPath=s.readString(),i.audioPath=s.readString());let r=0;r=s.readInt(!0);for(let l=0;l<r;l++)s.strings.push(s.readString());r=s.readInt(!0);for(let l=0;l<r;l++){let h=s.readString(),d=l==0?null:i.bones[s.readInt(!0)],f=new fi(l,h,d);f.rotation=s.readFloat(),f.x=s.readFloat()*e,f.y=s.readFloat()*e,f.scaleX=s.readFloat(),f.scaleY=s.readFloat(),f.shearX=s.readFloat(),f.shearY=s.readFloat(),f.length=s.readFloat()*e,f.transformMode=s.readInt(!0),f.skinRequired=s.readBoolean(),n&&V.rgba8888ToColor(f.color,s.readInt32()),i.bones.push(f)}r=s.readInt(!0);for(let l=0;l<r;l++){let h=s.readString(),d=i.bones[s.readInt(!0)],f=new vi(l,h,d);V.rgba8888ToColor(f.color,s.readInt32());let m=s.readInt32();m!=-1&&V.rgb888ToColor(f.darkColor=new V,m),f.attachmentName=s.readStringRef(),f.blendMode=s.readInt(!0),i.slots.push(f)}r=s.readInt(!0);for(let l=0,h;l<r;l++){let d=new xi(s.readString());d.order=s.readInt(!0),d.skinRequired=s.readBoolean(),h=s.readInt(!0);for(let f=0;f<h;f++)d.bones.push(i.bones[s.readInt(!0)]);d.target=i.bones[s.readInt(!0)],d.mix=s.readFloat(),d.softness=s.readFloat()*e,d.bendDirection=s.readByte(),d.compress=s.readBoolean(),d.stretch=s.readBoolean(),d.uniform=s.readBoolean(),i.ikConstraints.push(d)}r=s.readInt(!0);for(let l=0,h;l<r;l++){let d=new yi(s.readString());d.order=s.readInt(!0),d.skinRequired=s.readBoolean(),h=s.readInt(!0);for(let f=0;f<h;f++)d.bones.push(i.bones[s.readInt(!0)]);d.target=i.bones[s.readInt(!0)],d.local=s.readBoolean(),d.relative=s.readBoolean(),d.offsetRotation=s.readFloat(),d.offsetX=s.readFloat()*e,d.offsetY=s.readFloat()*e,d.offsetScaleX=s.readFloat(),d.offsetScaleY=s.readFloat(),d.offsetShearY=s.readFloat(),d.mixRotate=s.readFloat(),d.mixX=s.readFloat(),d.mixY=s.readFloat(),d.mixScaleX=s.readFloat(),d.mixScaleY=s.readFloat(),d.mixShearY=s.readFloat(),i.transformConstraints.push(d)}r=s.readInt(!0);for(let l=0,h;l<r;l++){let d=new bi(s.readString());d.order=s.readInt(!0),d.skinRequired=s.readBoolean(),h=s.readInt(!0);for(let f=0;f<h;f++)d.bones.push(i.bones[s.readInt(!0)]);d.target=i.slots[s.readInt(!0)],d.positionMode=s.readInt(!0),d.spacingMode=s.readInt(!0),d.rotateMode=s.readInt(!0),d.offsetRotation=s.readFloat(),d.position=s.readFloat(),d.positionMode==Pt.Fixed&&(d.position*=e),d.spacing=s.readFloat(),(d.spacingMode==gt.Length||d.spacingMode==gt.Fixed)&&(d.spacing*=e),d.mixRotate=s.readFloat(),d.mixX=s.readFloat(),d.mixY=s.readFloat(),i.pathConstraints.push(d)}let o=this.readSkin(s,i,!0,n);o&&(i.defaultSkin=o,i.skins.push(o));{let l=i.skins.length;for(O.setArraySize(i.skins,r=l+s.readInt(!0));l<r;l++)i.skins[l]=this.readSkin(s,i,!1,n)}r=this.linkedMeshes.length;for(let l=0;l<r;l++){let h=this.linkedMeshes[l],f=(h.skin?i.findSkin(h.skin):i.defaultSkin).getAttachment(h.slotIndex,h.parent);h.mesh.deformAttachment=h.inheritDeform?f:h.mesh,h.mesh.setParentMesh(f),h.mesh.updateUVs()}this.linkedMeshes.length=0,r=s.readInt(!0);for(let l=0;l<r;l++){let h=new gi(s.readStringRef());h.intValue=s.readInt(!1),h.floatValue=s.readFloat(),h.stringValue=s.readString(),h.audioPath=s.readString(),h.audioPath&&(h.volume=s.readFloat(),h.balance=s.readFloat()),i.events.push(h)}r=s.readInt(!0);for(let l=0;l<r;l++)i.animations.push(this.readAnimation(s,s.readString(),i));return i}readSkin(t,e,i,s){let a=null,c=0;if(i){if(c=t.readInt(!0),c==0)return null;a=new Se("default")}else{a=new Se(t.readStringRef()),a.bones.length=t.readInt(!0);for(let n=0,r=a.bones.length;n<r;n++)a.bones[n]=e.bones[t.readInt(!0)];for(let n=0,r=t.readInt(!0);n<r;n++)a.constraints.push(e.ikConstraints[t.readInt(!0)]);for(let n=0,r=t.readInt(!0);n<r;n++)a.constraints.push(e.transformConstraints[t.readInt(!0)]);for(let n=0,r=t.readInt(!0);n<r;n++)a.constraints.push(e.pathConstraints[t.readInt(!0)]);c=t.readInt(!0)}for(let n=0;n<c;n++){let r=t.readInt(!0);for(let o=0,l=t.readInt(!0);o<l;o++){let h=t.readStringRef(),d=this.readAttachment(t,e,a,r,h,s);d&&a.setAttachment(r,h,d)}}return a}readAttachment(t,e,i,s,a,c){let n=this.scale,r=t.readStringRef();switch(r||(r=a),t.readByte()){case Ut.Region:{let o=t.readStringRef(),l=t.readFloat(),h=t.readFloat(),d=t.readFloat(),f=t.readFloat(),m=t.readFloat(),u=t.readFloat(),x=t.readFloat(),p=t.readInt32();o||(o=r);let v=this.attachmentLoader.newRegionAttachment(i,r,o);return v?(v.path=o,v.x=h*n,v.y=d*n,v.scaleX=f,v.scaleY=m,v.rotation=l,v.width=u*n,v.height=x*n,V.rgba8888ToColor(v.color,p),v.updateOffset(),v):null}case Ut.BoundingBox:{let o=t.readInt(!0),l=this.readVertices(t,o),h=c?t.readInt32():0,d=this.attachmentLoader.newBoundingBoxAttachment(i,r);return d?(d.worldVerticesLength=o<<1,d.vertices=l.vertices,d.bones=l.bones,c&&V.rgba8888ToColor(d.color,h),d):null}case Ut.Mesh:{let o=t.readStringRef(),l=t.readInt32(),h=t.readInt(!0),d=this.readFloatArray(t,h<<1,1),f=this.readShortArray(t),m=this.readVertices(t,h),u=t.readInt(!0),x=null,p=0,v=0;c&&(x=this.readShortArray(t),p=t.readFloat(),v=t.readFloat()),o||(o=r);let g=this.attachmentLoader.newMeshAttachment(i,r,o);return g?(g.path=o,V.rgba8888ToColor(g.color,l),g.bones=m.bones,g.vertices=m.vertices,g.worldVerticesLength=h<<1,g.triangles=f,g.regionUVs=d,g.updateUVs(),g.hullLength=u<<1,c&&(g.edges=x,g.width=p*n,g.height=v*n),g):null}case Ut.LinkedMesh:{let o=t.readStringRef(),l=t.readInt32(),h=t.readStringRef(),d=t.readStringRef(),f=t.readBoolean(),m=0,u=0;c&&(m=t.readFloat(),u=t.readFloat()),o||(o=r);let x=this.attachmentLoader.newMeshAttachment(i,r,o);return x?(x.path=o,V.rgba8888ToColor(x.color,l),c&&(x.width=m*n,x.height=u*n),this.linkedMeshes.push(new Rs(x,h,s,d,f)),x):null}case Ut.Path:{let o=t.readBoolean(),l=t.readBoolean(),h=t.readInt(!0),d=this.readVertices(t,h),f=O.newArray(h/3,0);for(let x=0,p=f.length;x<p;x++)f[x]=t.readFloat()*n;let m=c?t.readInt32():0,u=this.attachmentLoader.newPathAttachment(i,r);return u?(u.closed=o,u.constantSpeed=l,u.worldVerticesLength=h<<1,u.vertices=d.vertices,u.bones=d.bones,u.lengths=f,c&&V.rgba8888ToColor(u.color,m),u):null}case Ut.Point:{let o=t.readFloat(),l=t.readFloat(),h=t.readFloat(),d=c?t.readInt32():0,f=this.attachmentLoader.newPointAttachment(i,r);return f?(f.x=l*n,f.y=h*n,f.rotation=o,c&&V.rgba8888ToColor(f.color,d),f):null}case Ut.Clipping:{let o=t.readInt(!0),l=t.readInt(!0),h=this.readVertices(t,l),d=c?t.readInt32():0,f=this.attachmentLoader.newClippingAttachment(i,r);return f?(f.endSlot=e.slots[o],f.worldVerticesLength=l<<1,f.vertices=h.vertices,f.bones=h.bones,c&&V.rgba8888ToColor(f.color,d),f):null}}return null}readVertices(t,e){let i=this.scale,s=e<<1,a=new Es;if(!t.readBoolean())return a.vertices=this.readFloatArray(t,s,i),a;let c=new Array,n=new Array;for(let r=0;r<e;r++){let o=t.readInt(!0);n.push(o);for(let l=0;l<o;l++)n.push(t.readInt(!0)),c.push(t.readFloat()*i),c.push(t.readFloat()*i),c.push(t.readFloat())}return a.vertices=O.toFloatArray(c),a.bones=n,a}readFloatArray(t,e,i){let s=new Array(e);if(i==1)for(let a=0;a<e;a++)s[a]=t.readFloat();else for(let a=0;a<e;a++)s[a]=t.readFloat()*i;return s}readShortArray(t){let e=t.readInt(!0),i=new Array(e);for(let s=0;s<e;s++)i[s]=t.readShort();return i}readAnimation(t,e,i){t.readInt(!0);let s=new Array,a=this.scale,c=new V,n=new V;for(let h=0,d=t.readInt(!0);h<d;h++){let f=t.readInt(!0);for(let m=0,u=t.readInt(!0);m<u;m++){let x=t.readByte(),p=t.readInt(!0),v=p-1;switch(x){case _s:{let g=new Ht(p,f);for(let w=0;w<p;w++)g.setFrame(w,t.readFloat(),t.readStringRef());s.push(g);break}case qs:{let g=t.readInt(!0),w=new je(p,g,f),b=t.readFloat(),y=t.readUnsignedByte()/255,T=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,I=t.readUnsignedByte()/255;for(let k=0,F=0;w.setFrame(k,b,y,T,A,I),k!=v;k++){let P=t.readFloat(),L=t.readUnsignedByte()/255,B=t.readUnsignedByte()/255,C=t.readUnsignedByte()/255,M=t.readUnsignedByte()/255;switch(t.readByte()){case Rt:w.setStepped(k);break;case Et:nt(t,w,F++,k,0,b,P,y,L,1),nt(t,w,F++,k,1,b,P,T,B,1),nt(t,w,F++,k,2,b,P,A,C,1),nt(t,w,F++,k,3,b,P,I,M,1)}b=P,y=L,T=B,A=C,I=M}s.push(w);break}case Gs:{let g=t.readInt(!0),w=new He(p,g,f),b=t.readFloat(),y=t.readUnsignedByte()/255,T=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255;for(let I=0,k=0;w.setFrame(I,b,y,T,A),I!=v;I++){let F=t.readFloat(),P=t.readUnsignedByte()/255,L=t.readUnsignedByte()/255,B=t.readUnsignedByte()/255;switch(t.readByte()){case Rt:w.setStepped(I);break;case Et:nt(t,w,k++,I,0,b,F,y,P,1),nt(t,w,k++,I,1,b,F,T,L,1),nt(t,w,k++,I,2,b,F,A,B,1)}b=F,y=P,T=L,A=B}s.push(w);break}case js:{let g=t.readInt(!0),w=new Je(p,g,f),b=t.readFloat(),y=t.readUnsignedByte()/255,T=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,I=t.readUnsignedByte()/255,k=t.readUnsignedByte()/255,F=t.readUnsignedByte()/255,P=t.readUnsignedByte()/255;for(let L=0,B=0;w.setFrame(L,b,y,T,A,I,k,F,P),L!=v;L++){let C=t.readFloat(),M=t.readUnsignedByte()/255,D=t.readUnsignedByte()/255,X=t.readUnsignedByte()/255,R=t.readUnsignedByte()/255,st=t.readUnsignedByte()/255,dt=t.readUnsignedByte()/255,ht=t.readUnsignedByte()/255;switch(t.readByte()){case Rt:w.setStepped(L);break;case Et:nt(t,w,B++,L,0,b,C,y,M,1),nt(t,w,B++,L,1,b,C,T,D,1),nt(t,w,B++,L,2,b,C,A,X,1),nt(t,w,B++,L,3,b,C,I,R,1),nt(t,w,B++,L,4,b,C,k,st,1),nt(t,w,B++,L,5,b,C,F,dt,1),nt(t,w,B++,L,6,b,C,P,ht,1)}b=C,y=M,T=D,A=X,I=R,k=st,F=dt,P=ht}s.push(w);break}case Hs:{let g=t.readInt(!0),w=new Ke(p,g,f),b=t.readFloat(),y=t.readUnsignedByte()/255,T=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,I=t.readUnsignedByte()/255,k=t.readUnsignedByte()/255,F=t.readUnsignedByte()/255;for(let P=0,L=0;w.setFrame(P,b,y,T,A,I,k,F),P!=v;P++){let B=t.readFloat(),C=t.readUnsignedByte()/255,M=t.readUnsignedByte()/255,D=t.readUnsignedByte()/255,X=t.readUnsignedByte()/255,R=t.readUnsignedByte()/255,st=t.readUnsignedByte()/255;switch(t.readByte()){case Rt:w.setStepped(P);break;case Et:nt(t,w,L++,P,0,b,B,y,C,1),nt(t,w,L++,P,1,b,B,T,M,1),nt(t,w,L++,P,2,b,B,A,D,1),nt(t,w,L++,P,3,b,B,I,X,1),nt(t,w,L++,P,4,b,B,k,R,1),nt(t,w,L++,P,5,b,B,F,st,1)}b=B,y=C,T=M,A=D,I=X,k=R,F=st}s.push(w);break}case Zs:{let g=new Ze(p,t.readInt(!0),f),w=t.readFloat(),b=t.readUnsignedByte()/255;for(let y=0,T=0;g.setFrame(y,w,b),y!=v;y++){let A=t.readFloat(),I=t.readUnsignedByte()/255;switch(t.readByte()){case Rt:g.setStepped(y);break;case Et:nt(t,g,T++,y,0,w,A,b,I,1)}w=A,b=I}s.push(g);break}}}}for(let h=0,d=t.readInt(!0);h<d;h++){let f=t.readInt(!0);for(let m=0,u=t.readInt(!0);m<u;m++){let x=t.readByte(),p=t.readInt(!0),v=t.readInt(!0);switch(x){case Ls:s.push(zt(t,new de(p,v,f),1));break;case Bs:s.push(Ai(t,new De(p,v,f),a));break;case Ps:s.push(zt(t,new Ve(p,v,f),a));break;case Os:s.push(zt(t,new Ne(p,v,f),a));break;case Ds:s.push(Ai(t,new Ue(p,v,f),1));break;case Vs:s.push(zt(t,new ze(p,v,f),1));break;case Ns:s.push(zt(t,new We(p,v,f),1));break;case Us:s.push(Ai(t,new _e(p,v,f),1));break;case zs:s.push(zt(t,new qe(p,v,f),1));break;case Ws:s.push(zt(t,new Ge(p,v,f),1))}}}for(let h=0,d=t.readInt(!0);h<d;h++){let f=t.readInt(!0),m=t.readInt(!0),u=m-1,x=new $e(m,t.readInt(!0),f),p=t.readFloat(),v=t.readFloat(),g=t.readFloat()*a;for(let w=0,b=0;x.setFrame(w,p,v,g,t.readByte(),t.readBoolean(),t.readBoolean()),w!=u;w++){let y=t.readFloat(),T=t.readFloat(),A=t.readFloat()*a;switch(t.readByte()){case Rt:x.setStepped(w);break;case Et:nt(t,x,b++,w,0,p,y,v,T,1),nt(t,x,b++,w,1,p,y,g,A,a)}p=y,v=T,g=A}s.push(x)}for(let h=0,d=t.readInt(!0);h<d;h++){let f=t.readInt(!0),m=t.readInt(!0),u=m-1,x=new ti(m,t.readInt(!0),f),p=t.readFloat(),v=t.readFloat(),g=t.readFloat(),w=t.readFloat(),b=t.readFloat(),y=t.readFloat(),T=t.readFloat();for(let A=0,I=0;x.setFrame(A,p,v,g,w,b,y,T),A!=u;A++){let k=t.readFloat(),F=t.readFloat(),P=t.readFloat(),L=t.readFloat(),B=t.readFloat(),C=t.readFloat(),M=t.readFloat();switch(t.readByte()){case Rt:x.setStepped(A);break;case Et:nt(t,x,I++,A,0,p,k,v,F,1),nt(t,x,I++,A,1,p,k,g,P,1),nt(t,x,I++,A,2,p,k,w,L,1),nt(t,x,I++,A,3,p,k,b,B,1),nt(t,x,I++,A,4,p,k,y,C,1),nt(t,x,I++,A,5,p,k,T,M,1)}p=k,v=F,g=P,w=L,b=B,y=C,T=M}s.push(x)}for(let h=0,d=t.readInt(!0);h<d;h++){let f=t.readInt(!0),m=i.pathConstraints[f];for(let u=0,x=t.readInt(!0);u<x;u++)switch(t.readByte()){case Js:s.push(zt(t,new ei(t.readInt(!0),t.readInt(!0),f),m.positionMode==Pt.Fixed?a:1));break;case Ks:s.push(zt(t,new ii(t.readInt(!0),t.readInt(!0),f),m.spacingMode==gt.Length||m.spacingMode==gt.Fixed?a:1));break;case Qs:let p=new si(t.readInt(!0),t.readInt(!0),f),v=t.readFloat(),g=t.readFloat(),w=t.readFloat(),b=t.readFloat();for(let y=0,T=0,A=p.getFrameCount()-1;p.setFrame(y,v,g,w,b),y!=A;y++){let I=t.readFloat(),k=t.readFloat(),F=t.readFloat(),P=t.readFloat();switch(t.readByte()){case Rt:p.setStepped(y);break;case Et:nt(t,p,T++,y,0,v,I,g,k,1),nt(t,p,T++,y,1,v,I,w,F,1),nt(t,p,T++,y,2,v,I,b,P,1)}v=I,g=k,w=F,b=P}s.push(p)}}for(let h=0,d=t.readInt(!0);h<d;h++){let f=i.skins[t.readInt(!0)];for(let m=0,u=t.readInt(!0);m<u;m++){let x=t.readInt(!0);for(let p=0,v=t.readInt(!0);p<v;p++){let g=t.readStringRef(),w=f.getAttachment(x,g),b=w.bones,y=w.vertices,T=b?y.length/3*2:y.length,A=t.readInt(!0),I=A-1,k=t.readInt(!0),F=new Qe(A,k,x,w),P=t.readFloat();for(let L=0,B=0;;L++){let C,M=t.readInt(!0);if(M==0)C=b?O.newFloatArray(T):y;else{C=O.newFloatArray(T);let X=t.readInt(!0);if(M+=X,a==1)for(let R=X;R<M;R++)C[R]=t.readFloat();else for(let R=X;R<M;R++)C[R]=t.readFloat()*a;if(!b)for(let R=0,st=C.length;R<st;R++)C[R]+=y[R]}if(F.setFrame(L,P,C),L==I)break;let D=t.readFloat();switch(t.readByte()){case Rt:F.setStepped(L);break;case Et:nt(t,F,B++,L,0,P,D,0,1,1)}P=D}s.push(F)}}}let r=t.readInt(!0);if(r>0){let h=new Zt(r),d=i.slots.length;for(let f=0;f<r;f++){let m=t.readFloat(),u=t.readInt(!0),x=O.newArray(d,0);for(let w=d-1;w>=0;w--)x[w]=-1;let p=O.newArray(d-u,0),v=0,g=0;for(let w=0;w<u;w++){let b=t.readInt(!0);for(;v!=b;)p[g++]=v++;x[v+t.readInt(!0)]=v++}for(;v<d;)p[g++]=v++;for(let w=d-1;w>=0;w--)x[w]==-1&&(x[w]=p[--g]);h.setFrame(f,m,x)}s.push(h)}let o=t.readInt(!0);if(o>0){let h=new fe(o);for(let d=0;d<o;d++){let f=t.readFloat(),m=i.events[t.readInt(!0)],u=new mi(f,m);u.intValue=t.readInt(!1),u.floatValue=t.readFloat(),u.stringValue=t.readBoolean()?t.readString():m.stringValue,u.data.audioPath&&(u.volume=t.readFloat(),u.balance=t.readFloat()),h.setFrame(d,u)}s.push(h)}let l=0;for(let h=0,d=s.length;h<d;h++)l=Math.max(l,s[h].getDuration());return new be(e,s,l)}},es=class{constructor(t,e=new Array,i=0,s=new DataView(t.buffer)){this.strings=e,this.index=i,this.buffer=s}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let t=this.buffer.getInt16(this.index);return this.index+=2,t}readInt32(){let t=this.buffer.getInt32(this.index);return this.index+=4,t}readInt(t){let e=this.readByte(),i=e&127;return(e&128)!=0&&(e=this.readByte(),i|=(e&127)<<7,(e&128)!=0&&(e=this.readByte(),i|=(e&127)<<14,(e&128)!=0&&(e=this.readByte(),i|=(e&127)<<21,(e&128)!=0&&(e=this.readByte(),i|=(e&127)<<28)))),t?i:i>>>1^-(i&1)}readStringRef(){let t=this.readInt(!0);return t==0?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="",i=0;for(let s=0;s<t;){let a=this.readByte();switch(a>>4){case 12:case 13:e+=String.fromCharCode((a&31)<<6|this.readByte()&63),s+=2;break;case 14:e+=String.fromCharCode((a&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),s+=3;break;default:e+=String.fromCharCode(a),s++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return this.readByte()!=0}},Rs=class{constructor(t,e,i,s,a){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=s,this.inheritDeform=a}},Es=class{constructor(t=null,e=null){this.bones=t,this.vertices=e}},Ut;(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"})(Ut||(Ut={}));function zt(t,e,i){let s=t.readFloat(),a=t.readFloat()*i;for(let c=0,n=0,r=e.getFrameCount()-1;e.setFrame(c,s,a),c!=r;c++){let o=t.readFloat(),l=t.readFloat()*i;switch(t.readByte()){case Rt:e.setStepped(c);break;case Et:nt(t,e,n++,c,0,s,o,a,l,i)}s=o,a=l}return e}function Ai(t,e,i){let s=t.readFloat(),a=t.readFloat()*i,c=t.readFloat()*i;for(let n=0,r=0,o=e.getFrameCount()-1;e.setFrame(n,s,a,c),n!=o;n++){let l=t.readFloat(),h=t.readFloat()*i,d=t.readFloat()*i;switch(t.readByte()){case Rt:e.setStepped(n);break;case Et:nt(t,e,r++,n,0,s,l,a,h,i),nt(t,e,r++,n,1,s,l,c,d,i)}s=l,a=h,c=d}return e}function nt(t,e,i,s,a,c,n,r,o,l){e.setBezier(i,s,a,c,r,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,n,o)}var Ls=0,Bs=1,Ps=2,Os=3,Ds=4,Vs=5,Ns=6,Us=7,zs=8,Ws=9,_s=0,qs=1,Gs=2,js=3,Hs=4,Zs=5,Js=0,Ks=1,Qs=2,Rt=1,Et=2,is=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new he(()=>O.newFloatArray(16))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");let i=this.boundingBoxes,s=this.polygons,a=this.polygonPool,c=t.slots,n=c.length;i.length=0,a.freeAll(s),s.length=0;for(let r=0;r<n;r++){let o=c[r];if(!o.bone.active)continue;let l=o.getAttachment();if(l instanceof ye){let h=l;i.push(h);let d=a.obtain();d.length!=h.worldVerticesLength&&(d=O.newFloatArray(h.worldVerticesLength)),s.push(d),h.computeWorldVertices(o,0,h.worldVerticesLength,d,0,2)}}e?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,a=this.polygons;for(let c=0,n=a.length;c<n;c++){let r=a[c],o=r;for(let l=0,h=r.length;l<h;l+=2){let d=o[l],f=o[l+1];t=Math.min(t,d),e=Math.min(e,f),i=Math.max(i,d),s=Math.max(s,f)}}this.minX=t,this.minY=e,this.maxX=i,this.maxY=s}aabbContainsPoint(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,i,s){let a=this.minX,c=this.minY,n=this.maxX,r=this.maxY;if(t<=a&&i<=a||e<=c&&s<=c||t>=n&&i>=n||e>=r&&s>=r)return!1;let o=(s-e)/(i-t),l=o*(a-t)+e;if(l>c&&l<r||(l=o*(n-t)+e,l>c&&l<r))return!0;let h=(c-e)/o+t;return!!(h>a&&h<n||(h=(r-e)/o+t,h>a&&h<n))}aabbIntersectsSkeleton(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY}containsPoint(t,e){let i=this.polygons;for(let s=0,a=i.length;s<a;s++)if(this.containsPointPolygon(i[s],t,e))return this.boundingBoxes[s];return null}containsPointPolygon(t,e,i){let s=t,a=t.length,c=a-2,n=!1;for(let r=0;r<a;r+=2){let o=s[r+1],l=s[c+1];if(o<i&&l>=i||l<i&&o>=i){let h=s[r];h+(i-o)/(l-o)*(s[c]-h)<e&&(n=!n)}c=r}return n}intersectsSegment(t,e,i,s){let a=this.polygons;for(let c=0,n=a.length;c<n;c++)if(this.intersectsSegmentPolygon(a[c],t,e,i,s))return this.boundingBoxes[c];return null}intersectsSegmentPolygon(t,e,i,s,a){let c=t,n=t.length,r=e-s,o=i-a,l=e*a-i*s,h=c[n-2],d=c[n-1];for(let f=0;f<n;f+=2){let m=c[f],u=c[f+1],x=h*u-d*m,p=h-m,v=d-u,g=r*v-o*p,w=(l*p-r*x)/g;if((w>=h&&w<=m||w>=m&&w<=h)&&(w>=e&&w<=s||w>=s&&w<=e)){let b=(l*v-o*x)/g;if((b>=d&&b<=u||b>=u&&b<=d)&&(b>=i&&b<=a||b>=a&&b<=i))return!0}h=m,d=u}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return e==-1?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},Tt=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new he(()=>new Array),this.polygonIndicesPool=new he(()=>new Array)}triangulate(t){let e=t,i=t.length>>1,s=this.indicesArray;s.length=0;for(let n=0;n<i;n++)s[n]=n;let a=this.isConcaveArray;a.length=0;for(let n=0,r=i;n<r;++n)a[n]=Tt.isConcave(n,i,e,s);let c=this.triangles;for(c.length=0;i>3;){let n=i-1,r=0,o=1;for(;;){t:if(!a[r]){let d=s[n]<<1,f=s[r]<<1,m=s[o]<<1,u=e[d],x=e[d+1],p=e[f],v=e[f+1],g=e[m],w=e[m+1];for(let b=(o+1)%i;b!=n;b=(b+1)%i){if(!a[b])continue;let y=s[b]<<1,T=e[y],A=e[y+1];if(Tt.positiveArea(g,w,u,x,T,A)&&Tt.positiveArea(u,x,p,v,T,A)&&Tt.positiveArea(p,v,g,w,T,A))break t}break}if(o==0){do{if(!a[r])break;r--}while(r>0);break}n=r,r=o,o=(o+1)%i}c.push(s[(i+r-1)%i]),c.push(s[r]),c.push(s[(r+1)%i]),s.splice(r,1),a.splice(r,1),i--;let l=(i+r-1)%i,h=r==i?0:r;a[l]=Tt.isConcave(l,i,e,s),a[h]=Tt.isConcave(h,i,e,s)}return i==3&&(c.push(s[2]),c.push(s[0]),c.push(s[1])),c}decompose(t,e){let i=t,s=this.convexPolygons;this.polygonPool.freeAll(s),s.length=0;let a=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(a),a.length=0;let c=this.polygonIndicesPool.obtain();c.length=0;let n=this.polygonPool.obtain();n.length=0;let r=-1,o=0;for(let l=0,h=e.length;l<h;l+=3){let d=e[l]<<1,f=e[l+1]<<1,m=e[l+2]<<1,u=i[d],x=i[d+1],p=i[f],v=i[f+1],g=i[m],w=i[m+1],b=!1;if(r==d){let y=n.length-4,T=Tt.winding(n[y],n[y+1],n[y+2],n[y+3],g,w),A=Tt.winding(g,w,n[0],n[1],n[2],n[3]);T==o&&A==o&&(n.push(g),n.push(w),c.push(m),b=!0)}b||(n.length>0?(s.push(n),a.push(c)):(this.polygonPool.free(n),this.polygonIndicesPool.free(c)),n=this.polygonPool.obtain(),n.length=0,n.push(u),n.push(x),n.push(p),n.push(v),n.push(g),n.push(w),c=this.polygonIndicesPool.obtain(),c.length=0,c.push(d),c.push(f),c.push(m),o=Tt.winding(u,x,p,v,g,w),r=d)}n.length>0&&(s.push(n),a.push(c));for(let l=0,h=s.length;l<h;l++){if(c=a[l],c.length==0)continue;let d=c[0],f=c[c.length-1];n=s[l];let m=n.length-4,u=n[m],x=n[m+1],p=n[m+2],v=n[m+3],g=n[0],w=n[1],b=n[2],y=n[3],T=Tt.winding(u,x,p,v,g,w);for(let A=0;A<h;A++){if(A==l)continue;let I=a[A];if(I.length!=3)continue;let k=I[0],F=I[1],P=I[2],L=s[A],B=L[L.length-2],C=L[L.length-1];if(k!=d||F!=f)continue;let M=Tt.winding(u,x,p,v,B,C),D=Tt.winding(B,C,g,w,b,y);M==T&&D==T&&(L.length=0,I.length=0,n.push(B),n.push(C),c.push(P),u=p,x=v,p=B,v=C,A=0)}}for(let l=s.length-1;l>=0;l--)n=s[l],n.length==0&&(s.splice(l,1),this.polygonPool.free(n),c=a[l],a.splice(l,1),this.polygonIndicesPool.free(c));return s}static isConcave(t,e,i,s){let a=s[(e+t-1)%e]<<1,c=s[t]<<1,n=s[(t+1)%e]<<1;return!this.positiveArea(i[a],i[a+1],i[c],i[c+1],i[n],i[n+1])}static positiveArea(t,e,i,s,a,c){return t*(c-s)+i*(e-c)+a*(s-e)>=0}static winding(t,e,i,s,a,c){let n=i-t,r=s-e;return a*r-c*n+n*e-t*r>=0?1:-1}},Ce=class{constructor(){this.triangulator=new Tt,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let i=e.worldVerticesLength,s=O.setArraySize(this.clippingPolygon,i);e.computeWorldVertices(t,0,i,s,0,2);let a=this.clippingPolygon;Ce.makeClockwise(a);let c=this.clippingPolygons=this.triangulator.decompose(a,this.triangulator.triangulate(a));for(let n=0,r=c.length;n<r;n++){let o=c[n];Ce.makeClockwise(o),o.push(o[0]),o.push(o[1])}return c.length}clipEndWithSlot(t){this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()}clipEnd(){!this.clipAttachment||(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return this.clipAttachment!=null}clipTriangles(t,e,i,s,a,c,n,r){let o=this.clipOutput,l=this.clippedVertices,h=this.clippedTriangles,d=this.clippingPolygons,f=this.clippingPolygons.length,m=r?12:8,u=0;l.length=0,h.length=0;t:for(let x=0;x<s;x+=3){let p=i[x]<<1,v=t[p],g=t[p+1],w=a[p],b=a[p+1];p=i[x+1]<<1;let y=t[p],T=t[p+1],A=a[p],I=a[p+1];p=i[x+2]<<1;let k=t[p],F=t[p+1],P=a[p],L=a[p+1];for(let B=0;B<f;B++){let C=l.length;if(this.clip(v,g,y,T,k,F,d[B],o)){let M=o.length;if(M==0)continue;let D=T-F,X=k-y,R=v-k,st=F-g,dt=1/(D*R+X*(g-F)),ht=M>>1,rt=this.clipOutput,it=O.setArraySize(l,C+ht*m);for(let At=0;At<M;At+=2){let Lt=rt[At],wt=rt[At+1];it[C]=Lt,it[C+1]=wt,it[C+2]=c.r,it[C+3]=c.g,it[C+4]=c.b,it[C+5]=c.a;let It=Lt-k,kt=wt-F,Gt=(D*It+X*kt)*dt,ne=(st*It+R*kt)*dt,xe=1-Gt-ne;it[C+6]=w*Gt+A*ne+P*xe,it[C+7]=b*Gt+I*ne+L*xe,r&&(it[C+8]=n.r,it[C+9]=n.g,it[C+10]=n.b,it[C+11]=n.a),C+=m}C=h.length;let ct=O.setArraySize(h,C+3*(ht-2));ht--;for(let At=1;At<ht;At++)ct[C]=u,ct[C+1]=u+At,ct[C+2]=u+At+1,C+=3;u+=ht+1}else{let M=O.setArraySize(l,C+3*m);M[C]=v,M[C+1]=g,M[C+2]=c.r,M[C+3]=c.g,M[C+4]=c.b,M[C+5]=c.a,r?(M[C+6]=w,M[C+7]=b,M[C+8]=n.r,M[C+9]=n.g,M[C+10]=n.b,M[C+11]=n.a,M[C+12]=y,M[C+13]=T,M[C+14]=c.r,M[C+15]=c.g,M[C+16]=c.b,M[C+17]=c.a,M[C+18]=A,M[C+19]=I,M[C+20]=n.r,M[C+21]=n.g,M[C+22]=n.b,M[C+23]=n.a,M[C+24]=k,M[C+25]=F,M[C+26]=c.r,M[C+27]=c.g,M[C+28]=c.b,M[C+29]=c.a,M[C+30]=P,M[C+31]=L,M[C+32]=n.r,M[C+33]=n.g,M[C+34]=n.b,M[C+35]=n.a):(M[C+6]=w,M[C+7]=b,M[C+8]=y,M[C+9]=T,M[C+10]=c.r,M[C+11]=c.g,M[C+12]=c.b,M[C+13]=c.a,M[C+14]=A,M[C+15]=I,M[C+16]=k,M[C+17]=F,M[C+18]=c.r,M[C+19]=c.g,M[C+20]=c.b,M[C+21]=c.a,M[C+22]=P,M[C+23]=L),C=h.length;let D=O.setArraySize(h,C+3);D[C]=u,D[C+1]=u+1,D[C+2]=u+2,u+=3;continue t}}}}clip(t,e,i,s,a,c,n,r){let o=r,l=!1,h=null;n.length%4>=2?(h=r,r=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(i),h.push(s),h.push(a),h.push(c),h.push(t),h.push(e),r.length=0;let d=n,f=n.length-4;for(let m=0;;m+=2){let u=d[m],x=d[m+1],p=d[m+2],v=d[m+3],g=u-p,w=x-v,b=h,y=h.length-2,T=r.length;for(let I=0;I<y;I+=2){let k=b[I],F=b[I+1],P=b[I+2],L=b[I+3],B=g*(L-v)-w*(P-p)>0;if(g*(F-v)-w*(k-p)>0){if(B){r.push(P),r.push(L);continue}let C=L-F,M=P-k,D=C*(p-u)-M*(v-x);if(Math.abs(D)>1e-6){let X=(M*(x-F)-C*(u-k))/D;r.push(u+(p-u)*X),r.push(x+(v-x)*X)}else r.push(u),r.push(x)}else if(B){let C=L-F,M=P-k,D=C*(p-u)-M*(v-x);if(Math.abs(D)>1e-6){let X=(M*(x-F)-C*(u-k))/D;r.push(u+(p-u)*X),r.push(x+(v-x)*X)}else r.push(u),r.push(x);r.push(P),r.push(L)}l=!0}if(T==r.length)return o.length=0,!0;if(r.push(r[0]),r.push(r[1]),m==f)break;let A=r;r=h,r.length=0,h=A}if(o!=r){o.length=0;for(let m=0,u=r.length-2;m<u;m++)o[m]=r[m]}else o.length=o.length-2;return l}static makeClockwise(t){let e=t,i=t.length,s=e[i-2]*e[1]-e[0]*e[i-1],a=0,c=0,n=0,r=0;for(let o=0,l=i-3;o<l;o+=2)a=e[o],c=e[o+1],n=e[o+2],r=e[o+3],s+=a*r-n*c;if(!(s<0))for(let o=0,l=i-2,h=i>>1;o<h;o+=2){let d=e[o],f=e[o+1],m=l-o;e[o]=e[m],e[o+1]=e[m+1],e[m]=d,e[m+1]=f}}},$s=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new wi,s=typeof t=="string"?JSON.parse(t):t,a=s.skeleton;if(a&&(i.hash=a.hash,i.version=a.spine,i.x=a.x,i.y=a.y,i.width=a.width,i.height=a.height,i.fps=a.fps,i.imagesPath=a.images),s.bones)for(let c=0;c<s.bones.length;c++){let n=s.bones[c],r=null,o=Y(n,"parent",null);o&&(r=i.findBone(o));let l=new fi(i.bones.length,n.name,r);l.length=Y(n,"length",0)*e,l.x=Y(n,"x",0)*e,l.y=Y(n,"y",0)*e,l.rotation=Y(n,"rotation",0),l.scaleX=Y(n,"scaleX",1),l.scaleY=Y(n,"scaleY",1),l.shearX=Y(n,"shearX",0),l.shearY=Y(n,"shearY",0),l.transformMode=O.enumValue(Ct,Y(n,"transform","Normal")),l.skinRequired=Y(n,"skin",!1);let h=Y(n,"color",null);h&&l.color.setFromString(h),i.bones.push(l)}if(s.slots)for(let c=0;c<s.slots.length;c++){let n=s.slots[c],r=i.findBone(n.bone),o=new vi(i.slots.length,n.name,r),l=Y(n,"color",null);l&&o.color.setFromString(l);let h=Y(n,"dark",null);h&&(o.darkColor=V.fromString(h)),o.attachmentName=Y(n,"attachment",null),o.blendMode=O.enumValue(pt,Y(n,"blend","normal")),i.slots.push(o)}if(s.ik)for(let c=0;c<s.ik.length;c++){let n=s.ik[c],r=new xi(n.name);r.order=Y(n,"order",0),r.skinRequired=Y(n,"skin",!1);for(let o=0;o<n.bones.length;o++)r.bones.push(i.findBone(n.bones[o]));r.target=i.findBone(n.target),r.mix=Y(n,"mix",1),r.softness=Y(n,"softness",0)*e,r.bendDirection=Y(n,"bendPositive",!0)?1:-1,r.compress=Y(n,"compress",!1),r.stretch=Y(n,"stretch",!1),r.uniform=Y(n,"uniform",!1),i.ikConstraints.push(r)}if(s.transform)for(let c=0;c<s.transform.length;c++){let n=s.transform[c],r=new yi(n.name);r.order=Y(n,"order",0),r.skinRequired=Y(n,"skin",!1);for(let l=0;l<n.bones.length;l++)r.bones.push(i.findBone(n.bones[l]));let o=n.target;r.target=i.findBone(o),r.local=Y(n,"local",!1),r.relative=Y(n,"relative",!1),r.offsetRotation=Y(n,"rotation",0),r.offsetX=Y(n,"x",0)*e,r.offsetY=Y(n,"y",0)*e,r.offsetScaleX=Y(n,"scaleX",0),r.offsetScaleY=Y(n,"scaleY",0),r.offsetShearY=Y(n,"shearY",0),r.mixRotate=Y(n,"mixRotate",1),r.mixX=Y(n,"mixX",1),r.mixY=Y(n,"mixY",r.mixX),r.mixScaleX=Y(n,"mixScaleX",1),r.mixScaleY=Y(n,"mixScaleY",r.mixScaleX),r.mixShearY=Y(n,"mixShearY",1),i.transformConstraints.push(r)}if(s.path)for(let c=0;c<s.path.length;c++){let n=s.path[c],r=new bi(n.name);r.order=Y(n,"order",0),r.skinRequired=Y(n,"skin",!1);for(let l=0;l<n.bones.length;l++)r.bones.push(i.findBone(n.bones[l]));let o=n.target;r.target=i.findSlot(o),r.positionMode=O.enumValue(Pt,Y(n,"positionMode","Percent")),r.spacingMode=O.enumValue(gt,Y(n,"spacingMode","Length")),r.rotateMode=O.enumValue(Qt,Y(n,"rotateMode","Tangent")),r.offsetRotation=Y(n,"rotation",0),r.position=Y(n,"position",0),r.positionMode==Pt.Fixed&&(r.position*=e),r.spacing=Y(n,"spacing",0),(r.spacingMode==gt.Length||r.spacingMode==gt.Fixed)&&(r.spacing*=e),r.mixRotate=Y(n,"mixRotate",1),r.mixX=Y(n,"mixX",1),r.mixY=Y(n,"mixY",r.mixX),i.pathConstraints.push(r)}if(s.skins)for(let c=0;c<s.skins.length;c++){let n=s.skins[c],r=new Se(n.name);if(n.bones)for(let o=0;o<n.bones.length;o++)r.bones.push(i.findBone(n.bones[o]));if(n.ik)for(let o=0;o<n.ik.length;o++)r.constraints.push(i.findIkConstraint(n.ik[o]));if(n.transform)for(let o=0;o<n.transform.length;o++)r.constraints.push(i.findTransformConstraint(n.transform[o]));if(n.path)for(let o=0;o<n.path.length;o++)r.constraints.push(i.findPathConstraint(n.path[o]));for(let o in n.attachments){let l=i.findSlot(o),h=n.attachments[o];for(let d in h){let f=this.readAttachment(h[d],r,l.index,d,i);f&&r.setAttachment(l.index,d,f)}}i.skins.push(r),r.name=="default"&&(i.defaultSkin=r)}for(let c=0,n=this.linkedMeshes.length;c<n;c++){let r=this.linkedMeshes[c],l=(r.skin?i.findSkin(r.skin):i.defaultSkin).getAttachment(r.slotIndex,r.parent);r.mesh.deformAttachment=r.inheritDeform?l:r.mesh,r.mesh.setParentMesh(l),r.mesh.updateUVs()}if(this.linkedMeshes.length=0,s.events)for(let c in s.events){let n=s.events[c],r=new gi(c);r.intValue=Y(n,"int",0),r.floatValue=Y(n,"float",0),r.stringValue=Y(n,"string",""),r.audioPath=Y(n,"audio",null),r.audioPath&&(r.volume=Y(n,"volume",1),r.balance=Y(n,"balance",0)),i.events.push(r)}if(s.animations)for(let c in s.animations){let n=s.animations[c];this.readAnimation(n,c,i)}return i}readAttachment(t,e,i,s,a){let c=this.scale;switch(s=Y(t,"name",s),Y(t,"type","region")){case"region":{let n=Y(t,"path",s),r=this.attachmentLoader.newRegionAttachment(e,s,n);if(!r)return null;r.path=n,r.x=Y(t,"x",0)*c,r.y=Y(t,"y",0)*c,r.scaleX=Y(t,"scaleX",1),r.scaleY=Y(t,"scaleY",1),r.rotation=Y(t,"rotation",0),r.width=t.width*c,r.height=t.height*c;let o=Y(t,"color",null);return o&&r.color.setFromString(o),r.updateOffset(),r}case"boundingbox":{let n=this.attachmentLoader.newBoundingBoxAttachment(e,s);if(!n)return null;this.readVertices(t,n,t.vertexCount<<1);let r=Y(t,"color",null);return r&&n.color.setFromString(r),n}case"mesh":case"linkedmesh":{let n=Y(t,"path",s),r=this.attachmentLoader.newMeshAttachment(e,s,n);if(!r)return null;r.path=n;let o=Y(t,"color",null);o&&r.color.setFromString(o),r.width=Y(t,"width",0)*c,r.height=Y(t,"height",0)*c;let l=Y(t,"parent",null);if(l)return this.linkedMeshes.push(new tr(r,Y(t,"skin",null),i,l,Y(t,"deform",!0))),r;let h=t.uvs;return this.readVertices(t,r,h.length),r.triangles=t.triangles,r.regionUVs=h,r.updateUVs(),r.edges=Y(t,"edges",null),r.hullLength=Y(t,"hull",0)*2,r}case"path":{let n=this.attachmentLoader.newPathAttachment(e,s);if(!n)return null;n.closed=Y(t,"closed",!1),n.constantSpeed=Y(t,"constantSpeed",!0);let r=t.vertexCount;this.readVertices(t,n,r<<1);let o=O.newArray(r/3,0);for(let h=0;h<t.lengths.length;h++)o[h]=t.lengths[h]*c;n.lengths=o;let l=Y(t,"color",null);return l&&n.color.setFromString(l),n}case"point":{let n=this.attachmentLoader.newPointAttachment(e,s);if(!n)return null;n.x=Y(t,"x",0)*c,n.y=Y(t,"y",0)*c,n.rotation=Y(t,"rotation",0);let r=Y(t,"color",null);return r&&n.color.setFromString(r),n}case"clipping":{let n=this.attachmentLoader.newClippingAttachment(e,s);if(!n)return null;let r=Y(t,"end",null);r&&(n.endSlot=a.findSlot(r));let o=t.vertexCount;this.readVertices(t,n,o<<1);let l=Y(t,"color",null);return l&&n.color.setFromString(l),n}}return null}readVertices(t,e,i){let s=this.scale;e.worldVerticesLength=i;let a=t.vertices;if(i==a.length){let r=O.toFloatArray(a);if(s!=1)for(let o=0,l=a.length;o<l;o++)r[o]*=s;e.vertices=r;return}let c=new Array,n=new Array;for(let r=0,o=a.length;r<o;){let l=a[r++];n.push(l);for(let h=r+l*4;r<h;r+=4)n.push(a[r]),c.push(a[r+1]*s),c.push(a[r+2]*s),c.push(a[r+3])}e.bones=n,e.vertices=O.toFloatArray(c)}readAnimation(t,e,i){let s=this.scale,a=new Array;if(t.slots)for(let n in t.slots){let r=t.slots[n],o=i.findSlot(n).index;for(let l in r){let h=r[l];if(!h)continue;let d=h.length;if(l=="attachment"){let f=new Ht(d,o);for(let m=0;m<d;m++){let u=h[m];f.setFrame(m,Y(u,"time",0),u.name)}a.push(f)}else if(l=="rgba"){let f=new je(d,d<<2,o),m=h[0],u=Y(m,"time",0),x=V.fromString(m.color);for(let p=0,v=0;;p++){f.setFrame(p,u,x.r,x.g,x.b,x.a);let g=h[p+1];if(!g){f.shrink(v);break}let w=Y(g,"time",0),b=V.fromString(g.color),y=m.curve;y&&(v=lt(y,f,v,p,0,u,w,x.r,b.r,1),v=lt(y,f,v,p,1,u,w,x.g,b.g,1),v=lt(y,f,v,p,2,u,w,x.b,b.b,1),v=lt(y,f,v,p,3,u,w,x.a,b.a,1)),u=w,x=b,m=g}a.push(f)}else if(l=="rgb"){let f=new He(d,d*3,o),m=h[0],u=Y(m,"time",0),x=V.fromString(m.color);for(let p=0,v=0;;p++){f.setFrame(p,u,x.r,x.g,x.b);let g=h[p+1];if(!g){f.shrink(v);break}let w=Y(g,"time",0),b=V.fromString(g.color),y=m.curve;y&&(v=lt(y,f,v,p,0,u,w,x.r,b.r,1),v=lt(y,f,v,p,1,u,w,x.g,b.g,1),v=lt(y,f,v,p,2,u,w,x.b,b.b,1)),u=w,x=b,m=g}a.push(f)}else if(l=="alpha")a.push(Ot(h,new Ze(d,d,o),0,1));else if(l=="rgba2"){let f=new Je(d,d*7,o),m=h[0],u=Y(m,"time",0),x=V.fromString(m.light),p=V.fromString(m.dark);for(let v=0,g=0;;v++){f.setFrame(v,u,x.r,x.g,x.b,x.a,p.r,p.g,p.b);let w=h[v+1];if(!w){f.shrink(g);break}let b=Y(w,"time",0),y=V.fromString(w.light),T=V.fromString(w.dark),A=m.curve;A&&(g=lt(A,f,g,v,0,u,b,x.r,y.r,1),g=lt(A,f,g,v,1,u,b,x.g,y.g,1),g=lt(A,f,g,v,2,u,b,x.b,y.b,1),g=lt(A,f,g,v,3,u,b,x.a,y.a,1),g=lt(A,f,g,v,4,u,b,p.r,T.r,1),g=lt(A,f,g,v,5,u,b,p.g,T.g,1),g=lt(A,f,g,v,6,u,b,p.b,T.b,1)),u=b,x=y,p=T,m=w}a.push(f)}else if(l=="rgb2"){let f=new Ke(d,d*6,o),m=h[0],u=Y(m,"time",0),x=V.fromString(m.light),p=V.fromString(m.dark);for(let v=0,g=0;;v++){f.setFrame(v,u,x.r,x.g,x.b,p.r,p.g,p.b);let w=h[v+1];if(!w){f.shrink(g);break}let b=Y(w,"time",0),y=V.fromString(w.light),T=V.fromString(w.dark),A=m.curve;A&&(g=lt(A,f,g,v,0,u,b,x.r,y.r,1),g=lt(A,f,g,v,1,u,b,x.g,y.g,1),g=lt(A,f,g,v,2,u,b,x.b,y.b,1),g=lt(A,f,g,v,3,u,b,p.r,T.r,1),g=lt(A,f,g,v,4,u,b,p.g,T.g,1),g=lt(A,f,g,v,5,u,b,p.b,T.b,1)),u=b,x=y,p=T,m=w}a.push(f)}}}if(t.bones)for(let n in t.bones){let r=t.bones[n],o=i.findBone(n).index;for(let l in r){let h=r[l],d=h.length;if(d!=0){if(l==="rotate")a.push(Ot(h,new de(d,d,o),0,1));else if(l==="translate"){let f=new De(d,d<<1,o);a.push(Si(h,f,"x","y",0,s))}else if(l==="translatex"){let f=new Ve(d,d,o);a.push(Ot(h,f,0,s))}else if(l==="translatey"){let f=new Ne(d,d,o);a.push(Ot(h,f,0,s))}else if(l==="scale"){let f=new Ue(d,d<<1,o);a.push(Si(h,f,"x","y",1,1))}else if(l==="scalex"){let f=new ze(d,d,o);a.push(Ot(h,f,1,1))}else if(l==="scaley"){let f=new We(d,d,o);a.push(Ot(h,f,1,1))}else if(l==="shear"){let f=new _e(d,d<<1,o);a.push(Si(h,f,"x","y",0,1))}else if(l==="shearx"){let f=new qe(d,d,o);a.push(Ot(h,f,0,1))}else if(l==="sheary"){let f=new Ge(d,d,o);a.push(Ot(h,f,0,1))}}}}if(t.ik)for(let n in t.ik){let r=t.ik[n],o=r[0];if(!o)continue;let l=i.findIkConstraint(n),h=i.ikConstraints.indexOf(l),d=new $e(r.length,r.length<<1,h),f=Y(o,"time",0),m=Y(o,"mix",1),u=Y(o,"softness",0)*s;for(let x=0,p=0;;x++){d.setFrame(x,f,m,u,Y(o,"bendPositive",!0)?1:-1,Y(o,"compress",!1),Y(o,"stretch",!1));let v=r[x+1];if(!v){d.shrink(p);break}let g=Y(v,"time",0),w=Y(v,"mix",1),b=Y(v,"softness",0)*s,y=o.curve;y&&(p=lt(y,d,p,x,0,f,g,m,w,1),p=lt(y,d,p,x,1,f,g,u,b,s)),f=g,m=w,u=b,o=v}a.push(d)}if(t.transform)for(let n in t.transform){let r=t.transform[n],o=r[0];if(!o)continue;let l=i.findTransformConstraint(n),h=i.transformConstraints.indexOf(l),d=new ti(r.length,r.length*6,h),f=Y(o,"time",0),m=Y(o,"mixRotate",1),u=Y(o,"mixX",1),x=Y(o,"mixY",u),p=Y(o,"mixScaleX",1),v=Y(o,"mixScaleY",p),g=Y(o,"mixShearY",1);for(let w=0,b=0;;w++){d.setFrame(w,f,m,u,x,p,v,g);let y=r[w+1];if(!y){d.shrink(b);break}let T=Y(y,"time",0),A=Y(y,"mixRotate",1),I=Y(y,"mixX",1),k=Y(y,"mixY",I),F=Y(y,"mixScaleX",1),P=Y(y,"mixScaleY",F),L=Y(y,"mixShearY",1),B=o.curve;B&&(b=lt(B,d,b,w,0,f,T,m,A,1),b=lt(B,d,b,w,1,f,T,u,I,1),b=lt(B,d,b,w,2,f,T,x,k,1),b=lt(B,d,b,w,3,f,T,p,F,1),b=lt(B,d,b,w,4,f,T,v,P,1),b=lt(B,d,b,w,5,f,T,g,L,1)),f=T,m=A,u=I,x=k,p=F,v=P,p=F,o=y}a.push(d)}if(t.path)for(let n in t.path){let r=t.path[n],o=i.findPathConstraint(n),l=i.pathConstraints.indexOf(o);for(let h in r){let d=r[h],f=d[0];if(!f)continue;let m=d.length;if(h==="position"){let u=new ei(m,m,l);a.push(Ot(d,u,0,o.positionMode==Pt.Fixed?s:1))}else if(h==="spacing"){let u=new ii(m,m,l);a.push(Ot(d,u,0,o.spacingMode==gt.Length||o.spacingMode==gt.Fixed?s:1))}else if(h==="mix"){let u=new si(m,m*3,l),x=Y(f,"time",0),p=Y(f,"mixRotate",1),v=Y(f,"mixX",1),g=Y(f,"mixY",v);for(let w=0,b=0;;w++){u.setFrame(w,x,p,v,g);let y=d[w+1];if(!y){u.shrink(b);break}let T=Y(y,"time",0),A=Y(y,"mixRotate",1),I=Y(y,"mixX",1),k=Y(y,"mixY",I),F=f.curve;F&&(b=lt(F,u,b,w,0,x,T,p,A,1),b=lt(F,u,b,w,1,x,T,v,I,1),b=lt(F,u,b,w,2,x,T,g,k,1)),x=T,p=A,v=I,g=k,f=y}a.push(u)}}}if(t.deform)for(let n in t.deform){let r=t.deform[n],o=i.findSkin(n);for(let l in r){let h=r[l],d=i.findSlot(l).index;for(let f in h){let m=h[f],u=m[0];if(!u)continue;let x=o.getAttachment(d,f),p=x.bones,v=x.vertices,g=p?v.length/3*2:v.length,w=new Qe(m.length,m.length,d,x),b=Y(u,"time",0);for(let y=0,T=0;;y++){let A,I=Y(u,"vertices",null);if(!I)A=p?O.newFloatArray(g):v;else{A=O.newFloatArray(g);let L=Y(u,"offset",0);if(O.arrayCopy(I,0,A,L,I.length),s!=1)for(let B=L,C=B+I.length;B<C;B++)A[B]*=s;if(!p)for(let B=0;B<g;B++)A[B]+=v[B]}w.setFrame(y,b,A);let k=m[y+1];if(!k){w.shrink(T);break}let F=Y(k,"time",0),P=u.curve;P&&(T=lt(P,w,T,y,0,b,F,0,1,1)),b=F,u=k}a.push(w)}}}if(t.drawOrder){let n=new Zt(t.drawOrder.length),r=i.slots.length,o=0;for(let l=0;l<t.drawOrder.length;l++,o++){let h=t.drawOrder[l],d=null,f=Y(h,"offsets",null);if(f){d=O.newArray(r,-1);let m=O.newArray(r-f.length,0),u=0,x=0;for(let p=0;p<f.length;p++){let v=f[p],g=i.findSlot(v.slot).index;for(;u!=g;)m[x++]=u++;d[u+v.offset]=u++}for(;u<r;)m[x++]=u++;for(let p=r-1;p>=0;p--)d[p]==-1&&(d[p]=m[--x])}n.setFrame(o,Y(h,"time",0),d)}a.push(n)}if(t.events){let n=new fe(t.events.length),r=0;for(let o=0;o<t.events.length;o++,r++){let l=t.events[o],h=i.findEvent(l.name),d=new mi(O.toSinglePrecision(Y(l,"time",0)),h);d.intValue=Y(l,"int",h.intValue),d.floatValue=Y(l,"float",h.floatValue),d.stringValue=Y(l,"string",h.stringValue),d.data.audioPath&&(d.volume=Y(l,"volume",1),d.balance=Y(l,"balance",0)),n.setFrame(r,d)}a.push(n)}let c=0;for(let n=0,r=a.length;n<r;n++)c=Math.max(c,a[n].getDuration());i.animations.push(new be(e,a,c))}},tr=class{constructor(t,e,i,s,a){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=s,this.inheritDeform=a}};function Ot(t,e,i,s){let a=t[0],c=Y(a,"time",0),n=Y(a,"value",i)*s,r=0;for(let o=0;;o++){e.setFrame(o,c,n);let l=t[o+1];if(!l)return e.shrink(r),e;let h=Y(l,"time",0),d=Y(l,"value",i)*s;a.curve&&(r=lt(a.curve,e,r,o,0,c,h,n,d,s)),c=h,n=d,a=l}}function Si(t,e,i,s,a,c){let n=t[0],r=Y(n,"time",0),o=Y(n,i,a)*c,l=Y(n,s,a)*c,h=0;for(let d=0;;d++){e.setFrame(d,r,o,l);let f=t[d+1];if(!f)return e.shrink(h),e;let m=Y(f,"time",0),u=Y(f,i,a)*c,x=Y(f,s,a)*c,p=n.curve;p&&(h=lt(p,e,h,d,0,r,m,o,u,c),h=lt(p,e,h,d,1,r,m,l,x,c)),r=m,o=u,l=x,n=f}}function lt(t,e,i,s,a,c,n,r,o,l){if(t=="stepped")return e.setStepped(s),i;let h=a<<2,d=t[h],f=t[h+1]*l,m=t[h+2],u=t[h+3]*l;return e.setBezier(i,s,a,c,r,d,f,m,u,n,o),i+1}function Y(t,e,i){return t[e]!==void 0?t[e]:i}(()=>{typeof Math.fround=="undefined"&&(Math.fround=function(t){return function(e){return t[0]=e,t[0]}}(new Float32Array(1)))})();var er=class{constructor(t,e){this.jitterX=0,this.jitterY=0,this.jitterX=t,this.jitterY=e}begin(t){}transform(t,e,i,s){t.x+=E.randomTriangular(-this.jitterX,this.jitterY),t.y+=E.randomTriangular(-this.jitterX,this.jitterY)}end(){}},ss=class{constructor(t){this.centerX=0,this.centerY=0,this.radius=0,this.angle=0,this.worldX=0,this.worldY=0,this.radius=t}begin(t){this.worldX=t.x+this.centerX,this.worldY=t.y+this.centerY}transform(t,e,i,s){let a=this.angle*E.degreesToRadians,c=t.x-this.worldX,n=t.y-this.worldY,r=Math.sqrt(c*c+n*n);if(r<this.radius){let o=ss.interpolation.apply(0,a,(this.radius-r)/this.radius),l=Math.cos(o),h=Math.sin(o);t.x=l*c-h*n+this.worldX,t.y=h*c+l*n+this.worldY}}end(){}},rs=ss;rs.interpolation=new Di(2);var vt=class{constructor(t,e={alpha:"true"}){this.restorables=new Array,t instanceof WebGLRenderingContext||typeof WebGL2RenderingContext!="undefined"&&t instanceof WebGL2RenderingContext?(this.gl=t,this.canvas=this.gl.canvas):this.setupCanvas(t,e)}setupCanvas(t,e){this.gl=t.getContext("webgl2",e)||t.getContext("webgl",e),this.canvas=t,t.addEventListener("webglcontextlost",i=>{let s=i;i&&i.preventDefault()}),t.addEventListener("webglcontextrestored",i=>{for(let s=0,a=this.restorables.length;s<a;s++)this.restorables[s].restore()})}addRestorable(t){this.restorables.push(t)}removeRestorable(t){let e=this.restorables.indexOf(t);e>-1&&this.restorables.splice(e,1)}},ie=1,ir=769,as=770,Te=771,sr=774,Me=class{static getDestGLBlendMode(t){switch(t){case pt.Normal:return Te;case pt.Additive:return ie;case pt.Multiply:return Te;case pt.Screen:return Te;default:throw new Error("Unknown blend mode: "+t)}}static getSourceColorGLBlendMode(t,e=!1){switch(t){case pt.Normal:return e?ie:as;case pt.Additive:return e?ie:as;case pt.Multiply:return sr;case pt.Screen:return ie;default:throw new Error("Unknown blend mode: "+t)}}static getSourceAlphaGLBlendMode(t){switch(t){case pt.Normal:return ie;case pt.Additive:return ie;case pt.Multiply:return Te;case pt.Screen:return ir;default:throw new Error("Unknown blend mode: "+t)}}},Ci=class extends hi{constructor(t,e,i=!1){super(e);this.texture=null,this.boundUnit=0,this.useMipMaps=!1,this.context=t instanceof vt?t:new vt(t),this.useMipMaps=i,this.restore(),this.context.addRestorable(this)}setFilters(t,e){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,Ci.validateMagFilter(e))}static validateMagFilter(t){switch(t){case Mt.MipMap:case Mt.MipMapLinearLinear:case Mt.MipMapLinearNearest:case Mt.MipMapNearestLinear:case Mt.MipMapNearestNearest:return Mt.Linear;default:return t}}setWraps(t,e){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e)}update(t){let e=this.context.gl;this.texture||(this.texture=this.context.gl.createTexture()),this.bind(),Ci.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL&&e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this._image),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t&&e.generateMipmap(e.TEXTURE_2D)}restore(){this.texture=null,this.update(this.useMipMaps)}bind(t=0){let e=this.context.gl;this.boundUnit=t,e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.texture)}unbind(){let t=this.context.gl;t.activeTexture(t.TEXTURE0+this.boundUnit),t.bindTexture(t.TEXTURE_2D,null)}dispose(){this.context.removeRestorable(this),this.context.gl.deleteTexture(this.texture)}},me=Ci;me.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL=!1;var ns=class extends Ji{constructor(t,e="",i=null){super(s=>new me(t,s),e,i)}},Yt=class{constructor(t=0,e=0,i=0){this.x=0,this.y=0,this.z=0,this.x=t,this.y=e,this.z=i}setFrom(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}set(t,e,i){return this.x=t,this.y=e,this.z=i,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}scale(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(){let t=this.length();return t==0?this:(t=1/t,this.x*=t,this.y*=t,this.z*=t,this)}cross(t){return this.set(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)}multiply(t){let e=t.values;return this.set(this.x*e[N]+this.y*e[G]+this.z*e[j]+e[U],this.x*e[H]+this.y*e[z]+this.z*e[Z]+e[W],this.x*e[J]+this.y*e[K]+this.z*e[_]+e[q])}project(t){let e=t.values,i=1/(this.x*e[$]+this.y*e[tt]+this.z*e[et]+e[Q]);return this.set((this.x*e[N]+this.y*e[G]+this.z*e[j]+e[U])*i,(this.x*e[H]+this.y*e[z]+this.z*e[Z]+e[W])*i,(this.x*e[J]+this.y*e[K]+this.z*e[_]+e[q])*i)}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}distance(t){let e=t.x-this.x,i=t.y-this.y,s=t.z-this.z;return Math.sqrt(e*e+i*i+s*s)}},N=0,G=4,j=8,U=12,H=1,z=5,Z=9,W=13,J=2,K=6,_=10,q=14,$=3,tt=7,et=11,Q=15,xt=class{constructor(){this.temp=new Float32Array(16),this.values=new Float32Array(16);let t=this.values;t[N]=1,t[z]=1,t[_]=1,t[Q]=1}set(t){return this.values.set(t),this}transpose(){let t=this.temp,e=this.values;return t[N]=e[N],t[G]=e[H],t[j]=e[J],t[U]=e[$],t[H]=e[G],t[z]=e[z],t[Z]=e[K],t[W]=e[tt],t[J]=e[j],t[K]=e[Z],t[_]=e[_],t[q]=e[et],t[$]=e[U],t[tt]=e[W],t[et]=e[q],t[Q]=e[Q],this.set(t)}identity(){let t=this.values;return t[N]=1,t[G]=0,t[j]=0,t[U]=0,t[H]=0,t[z]=1,t[Z]=0,t[W]=0,t[J]=0,t[K]=0,t[_]=1,t[q]=0,t[$]=0,t[tt]=0,t[et]=0,t[Q]=1,this}invert(){let t=this.values,e=this.temp,i=t[$]*t[K]*t[Z]*t[U]-t[J]*t[tt]*t[Z]*t[U]-t[$]*t[z]*t[_]*t[U]+t[H]*t[tt]*t[_]*t[U]+t[J]*t[z]*t[et]*t[U]-t[H]*t[K]*t[et]*t[U]-t[$]*t[K]*t[j]*t[W]+t[J]*t[tt]*t[j]*t[W]+t[$]*t[G]*t[_]*t[W]-t[N]*t[tt]*t[_]*t[W]-t[J]*t[G]*t[et]*t[W]+t[N]*t[K]*t[et]*t[W]+t[$]*t[z]*t[j]*t[q]-t[H]*t[tt]*t[j]*t[q]-t[$]*t[G]*t[Z]*t[q]+t[N]*t[tt]*t[Z]*t[q]+t[H]*t[G]*t[et]*t[q]-t[N]*t[z]*t[et]*t[q]-t[J]*t[z]*t[j]*t[Q]+t[H]*t[K]*t[j]*t[Q]+t[J]*t[G]*t[Z]*t[Q]-t[N]*t[K]*t[Z]*t[Q]-t[H]*t[G]*t[_]*t[Q]+t[N]*t[z]*t[_]*t[Q];if(i==0)throw new Error("non-invertible matrix");let s=1/i;return e[N]=t[Z]*t[q]*t[tt]-t[W]*t[_]*t[tt]+t[W]*t[K]*t[et]-t[z]*t[q]*t[et]-t[Z]*t[K]*t[Q]+t[z]*t[_]*t[Q],e[G]=t[U]*t[_]*t[tt]-t[j]*t[q]*t[tt]-t[U]*t[K]*t[et]+t[G]*t[q]*t[et]+t[j]*t[K]*t[Q]-t[G]*t[_]*t[Q],e[j]=t[j]*t[W]*t[tt]-t[U]*t[Z]*t[tt]+t[U]*t[z]*t[et]-t[G]*t[W]*t[et]-t[j]*t[z]*t[Q]+t[G]*t[Z]*t[Q],e[U]=t[U]*t[Z]*t[K]-t[j]*t[W]*t[K]-t[U]*t[z]*t[_]+t[G]*t[W]*t[_]+t[j]*t[z]*t[q]-t[G]*t[Z]*t[q],e[H]=t[W]*t[_]*t[$]-t[Z]*t[q]*t[$]-t[W]*t[J]*t[et]+t[H]*t[q]*t[et]+t[Z]*t[J]*t[Q]-t[H]*t[_]*t[Q],e[z]=t[j]*t[q]*t[$]-t[U]*t[_]*t[$]+t[U]*t[J]*t[et]-t[N]*t[q]*t[et]-t[j]*t[J]*t[Q]+t[N]*t[_]*t[Q],e[Z]=t[U]*t[Z]*t[$]-t[j]*t[W]*t[$]-t[U]*t[H]*t[et]+t[N]*t[W]*t[et]+t[j]*t[H]*t[Q]-t[N]*t[Z]*t[Q],e[W]=t[j]*t[W]*t[J]-t[U]*t[Z]*t[J]+t[U]*t[H]*t[_]-t[N]*t[W]*t[_]-t[j]*t[H]*t[q]+t[N]*t[Z]*t[q],e[J]=t[z]*t[q]*t[$]-t[W]*t[K]*t[$]+t[W]*t[J]*t[tt]-t[H]*t[q]*t[tt]-t[z]*t[J]*t[Q]+t[H]*t[K]*t[Q],e[K]=t[U]*t[K]*t[$]-t[G]*t[q]*t[$]-t[U]*t[J]*t[tt]+t[N]*t[q]*t[tt]+t[G]*t[J]*t[Q]-t[N]*t[K]*t[Q],e[_]=t[G]*t[W]*t[$]-t[U]*t[z]*t[$]+t[U]*t[H]*t[tt]-t[N]*t[W]*t[tt]-t[G]*t[H]*t[Q]+t[N]*t[z]*t[Q],e[q]=t[U]*t[z]*t[J]-t[G]*t[W]*t[J]-t[U]*t[H]*t[K]+t[N]*t[W]*t[K]+t[G]*t[H]*t[q]-t[N]*t[z]*t[q],e[$]=t[Z]*t[K]*t[$]-t[z]*t[_]*t[$]-t[Z]*t[J]*t[tt]+t[H]*t[_]*t[tt]+t[z]*t[J]*t[et]-t[H]*t[K]*t[et],e[tt]=t[G]*t[_]*t[$]-t[j]*t[K]*t[$]+t[j]*t[J]*t[tt]-t[N]*t[_]*t[tt]-t[G]*t[J]*t[et]+t[N]*t[K]*t[et],e[et]=t[j]*t[z]*t[$]-t[G]*t[Z]*t[$]-t[j]*t[H]*t[tt]+t[N]*t[Z]*t[tt]+t[G]*t[H]*t[et]-t[N]*t[z]*t[et],e[Q]=t[G]*t[Z]*t[J]-t[j]*t[z]*t[J]+t[j]*t[H]*t[K]-t[N]*t[Z]*t[K]-t[G]*t[H]*t[_]+t[N]*t[z]*t[_],t[N]=e[N]*s,t[G]=e[G]*s,t[j]=e[j]*s,t[U]=e[U]*s,t[H]=e[H]*s,t[z]=e[z]*s,t[Z]=e[Z]*s,t[W]=e[W]*s,t[J]=e[J]*s,t[K]=e[K]*s,t[_]=e[_]*s,t[q]=e[q]*s,t[$]=e[$]*s,t[tt]=e[tt]*s,t[et]=e[et]*s,t[Q]=e[Q]*s,this}determinant(){let t=this.values;return t[$]*t[K]*t[Z]*t[U]-t[J]*t[tt]*t[Z]*t[U]-t[$]*t[z]*t[_]*t[U]+t[H]*t[tt]*t[_]*t[U]+t[J]*t[z]*t[et]*t[U]-t[H]*t[K]*t[et]*t[U]-t[$]*t[K]*t[j]*t[W]+t[J]*t[tt]*t[j]*t[W]+t[$]*t[G]*t[_]*t[W]-t[N]*t[tt]*t[_]*t[W]-t[J]*t[G]*t[et]*t[W]+t[N]*t[K]*t[et]*t[W]+t[$]*t[z]*t[j]*t[q]-t[H]*t[tt]*t[j]*t[q]-t[$]*t[G]*t[Z]*t[q]+t[N]*t[tt]*t[Z]*t[q]+t[H]*t[G]*t[et]*t[q]-t[N]*t[z]*t[et]*t[q]-t[J]*t[z]*t[j]*t[Q]+t[H]*t[K]*t[j]*t[Q]+t[J]*t[G]*t[Z]*t[Q]-t[N]*t[K]*t[Z]*t[Q]-t[H]*t[G]*t[_]*t[Q]+t[N]*t[z]*t[_]*t[Q]}translate(t,e,i){let s=this.values;return s[U]+=t,s[W]+=e,s[q]+=i,this}copy(){return new xt().set(this.values)}projection(t,e,i,s){this.identity();let a=1/Math.tan(i*(Math.PI/180)/2),c=(e+t)/(t-e),n=2*e*t/(t-e),r=this.values;return r[N]=a/s,r[H]=0,r[J]=0,r[$]=0,r[G]=0,r[z]=a,r[K]=0,r[tt]=0,r[j]=0,r[Z]=0,r[_]=c,r[et]=-1,r[U]=0,r[W]=0,r[q]=n,r[Q]=0,this}ortho2d(t,e,i,s){return this.ortho(t,t+i,e,e+s,0,1)}ortho(t,e,i,s,a,c){this.identity();let n=2/(e-t),r=2/(s-i),o=-2/(c-a),l=-(e+t)/(e-t),h=-(s+i)/(s-i),d=-(c+a)/(c-a),f=this.values;return f[N]=n,f[H]=0,f[J]=0,f[$]=0,f[G]=0,f[z]=r,f[K]=0,f[tt]=0,f[j]=0,f[Z]=0,f[_]=o,f[et]=0,f[U]=l,f[W]=h,f[q]=d,f[Q]=1,this}multiply(t){let e=this.temp,i=this.values,s=t.values;return e[N]=i[N]*s[N]+i[G]*s[H]+i[j]*s[J]+i[U]*s[$],e[G]=i[N]*s[G]+i[G]*s[z]+i[j]*s[K]+i[U]*s[tt],e[j]=i[N]*s[j]+i[G]*s[Z]+i[j]*s[_]+i[U]*s[et],e[U]=i[N]*s[U]+i[G]*s[W]+i[j]*s[q]+i[U]*s[Q],e[H]=i[H]*s[N]+i[z]*s[H]+i[Z]*s[J]+i[W]*s[$],e[z]=i[H]*s[G]+i[z]*s[z]+i[Z]*s[K]+i[W]*s[tt],e[Z]=i[H]*s[j]+i[z]*s[Z]+i[Z]*s[_]+i[W]*s[et],e[W]=i[H]*s[U]+i[z]*s[W]+i[Z]*s[q]+i[W]*s[Q],e[J]=i[J]*s[N]+i[K]*s[H]+i[_]*s[J]+i[q]*s[$],e[K]=i[J]*s[G]+i[K]*s[z]+i[_]*s[K]+i[q]*s[tt],e[_]=i[J]*s[j]+i[K]*s[Z]+i[_]*s[_]+i[q]*s[et],e[q]=i[J]*s[U]+i[K]*s[W]+i[_]*s[q]+i[q]*s[Q],e[$]=i[$]*s[N]+i[tt]*s[H]+i[et]*s[J]+i[Q]*s[$],e[tt]=i[$]*s[G]+i[tt]*s[z]+i[et]*s[K]+i[Q]*s[tt],e[et]=i[$]*s[j]+i[tt]*s[Z]+i[et]*s[_]+i[Q]*s[et],e[Q]=i[$]*s[U]+i[tt]*s[W]+i[et]*s[q]+i[Q]*s[Q],this.set(this.temp)}multiplyLeft(t){let e=this.temp,i=this.values,s=t.values;return e[N]=s[N]*i[N]+s[G]*i[H]+s[j]*i[J]+s[U]*i[$],e[G]=s[N]*i[G]+s[G]*i[z]+s[j]*i[K]+s[U]*i[tt],e[j]=s[N]*i[j]+s[G]*i[Z]+s[j]*i[_]+s[U]*i[et],e[U]=s[N]*i[U]+s[G]*i[W]+s[j]*i[q]+s[U]*i[Q],e[H]=s[H]*i[N]+s[z]*i[H]+s[Z]*i[J]+s[W]*i[$],e[z]=s[H]*i[G]+s[z]*i[z]+s[Z]*i[K]+s[W]*i[tt],e[Z]=s[H]*i[j]+s[z]*i[Z]+s[Z]*i[_]+s[W]*i[et],e[W]=s[H]*i[U]+s[z]*i[W]+s[Z]*i[q]+s[W]*i[Q],e[J]=s[J]*i[N]+s[K]*i[H]+s[_]*i[J]+s[q]*i[$],e[K]=s[J]*i[G]+s[K]*i[z]+s[_]*i[K]+s[q]*i[tt],e[_]=s[J]*i[j]+s[K]*i[Z]+s[_]*i[_]+s[q]*i[et],e[q]=s[J]*i[U]+s[K]*i[W]+s[_]*i[q]+s[q]*i[Q],e[$]=s[$]*i[N]+s[tt]*i[H]+s[et]*i[J]+s[Q]*i[$],e[tt]=s[$]*i[G]+s[tt]*i[z]+s[et]*i[K]+s[Q]*i[tt],e[et]=s[$]*i[j]+s[tt]*i[Z]+s[et]*i[_]+s[Q]*i[et],e[Q]=s[$]*i[U]+s[tt]*i[W]+s[et]*i[q]+s[Q]*i[Q],this.set(this.temp)}lookAt(t,e,i){xt.initTemps();let s=xt.xAxis,a=xt.yAxis,c=xt.zAxis;c.setFrom(e).normalize(),s.setFrom(e).normalize(),s.cross(i).normalize(),a.setFrom(s).cross(c).normalize(),this.identity();let n=this.values;return n[N]=s.x,n[G]=s.y,n[j]=s.z,n[H]=a.x,n[z]=a.y,n[Z]=a.z,n[J]=-c.x,n[K]=-c.y,n[_]=-c.z,xt.tmpMatrix.identity(),xt.tmpMatrix.values[U]=-t.x,xt.tmpMatrix.values[W]=-t.y,xt.tmpMatrix.values[q]=-t.z,this.multiply(xt.tmpMatrix),this}static initTemps(){xt.xAxis===null&&(xt.xAxis=new Yt),xt.yAxis===null&&(xt.yAxis=new Yt),xt.zAxis===null&&(xt.zAxis=new Yt)}},Wt=xt;Wt.xAxis=null,Wt.yAxis=null,Wt.zAxis=null,Wt.tmpMatrix=new xt;var ls=class{constructor(t,e){this.position=new Yt(0,0,0),this.direction=new Yt(0,0,-1),this.up=new Yt(0,1,0),this.near=0,this.far=100,this.zoom=1,this.viewportWidth=0,this.viewportHeight=0,this.projectionView=new Wt,this.inverseProjectionView=new Wt,this.projection=new Wt,this.view=new Wt,this.viewportWidth=t,this.viewportHeight=e,this.update()}update(){let t=this.projection,e=this.view,i=this.projectionView,s=this.inverseProjectionView,a=this.zoom,c=this.viewportWidth,n=this.viewportHeight;t.ortho(a*(-c/2),a*(c/2),a*(-n/2),a*(n/2),this.near,this.far),e.lookAt(this.position,this.direction,this.up),i.set(t.values),i.multiply(e),s.set(i.values).invert()}screenToWorld(t,e,i){let s=t.x,a=i-t.y-1;return t.x=2*s/e-1,t.y=2*a/i-1,t.z=2*t.z-1,t.project(this.inverseProjectionView),t}worldToScreen(t,e,i){return t.project(this.projectionView),t.x=e*(t.x+1)/2,t.y=i*(t.y+1)/2,t.z=(t.z+1)/2,t}setViewport(t,e){this.viewportWidth=t,this.viewportHeight=e}},rr=class{constructor(t,e){this.canvas=t,this.camera=e;let i=0,s=0,a=0,c=0,n=0,r=0,o=0,l=0;new Ti(t).addListener({down:(h,d)=>{console.log(`Down ${h.toFixed(0)} ${d.toFixed(0)}`),i=e.position.x,s=e.position.y,c=r=h,n=o=d,l=e.zoom},dragged:(h,d)=>{console.log(`Dragged ${h.toFixed(0)} ${d.toFixed(0)}`);let f=h-c,m=d-n,u=e.screenToWorld(new Yt(0,0),t.clientWidth,t.clientHeight),x=e.screenToWorld(new Yt(f,m),t.clientWidth,t.clientHeight).sub(u);e.position.set(i-x.x,s-x.y,0),e.update(),r=h,o=d},wheel:h=>{let d=h/200*e.zoom,f=e.zoom+d;if(f>0){let m=0,u=0;if(h<0)m=r,u=o;else{let v=new Yt(t.clientWidth/2+15,t.clientHeight/2),g=r-v.x,w=t.clientHeight-1-o-v.y;m=v.x-g,u=t.clientHeight-1-v.y+w}let x=e.screenToWorld(new Yt(m,u),t.clientWidth,t.clientHeight);e.zoom=f,e.update();let p=e.screenToWorld(new Yt(m,u),t.clientWidth,t.clientHeight);e.position.add(x.sub(p)),e.update()}},zoom:(h,d)=>{let f=h/d;console.log(`${f}, ${h}, ${d}`),e.zoom=l*f,console.log(`zoom ${f}`)},up:(h,d)=>{console.log(`Up ${h.toFixed(0)} ${d.toFixed(0)}`),r=h,o=d},moved:(h,d)=>{r=h,o=d}})}},Ti=class{constructor(t){this.mouseX=0,this.mouseY=0,this.buttonDown=!1,this.touch0=null,this.touch1=null,this.initialPinchDistance=0,this.listeners=new Array,this.element=t,this.setupCallbacks(t)}setupCallbacks(t){let e=n=>{if(n instanceof MouseEvent){let r=t.getBoundingClientRect();this.mouseX=n.clientX-r.left,this.mouseY=n.clientY-r.top,this.buttonDown=!0,this.listeners.map(o=>{o.down&&o.down(this.mouseX,this.mouseY)}),document.addEventListener("mousemove",i),document.addEventListener("mouseup",s)}},i=n=>{if(n instanceof MouseEvent){let r=t.getBoundingClientRect();this.mouseX=n.clientX-r.left,this.mouseY=n.clientY-r.top,this.listeners.map(o=>{this.buttonDown?o.dragged&&o.dragged(this.mouseX,this.mouseY):o.moved&&o.moved(this.mouseX,this.mouseY)})}},s=n=>{if(n instanceof MouseEvent){let r=t.getBoundingClientRect();this.mouseX=n.clientX-r.left,this.mouseY=n.clientY-r.top,this.buttonDown=!1,this.listeners.map(o=>{o.up&&o.up(this.mouseX,this.mouseY)}),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s)}},a=n=>{n.preventDefault();let r=n.deltaY;n.deltaMode==WheelEvent.DOM_DELTA_LINE&&(r*=8),n.deltaMode==WheelEvent.DOM_DELTA_PAGE&&(r*=24),this.listeners.map(o=>{o.wheel&&o.wheel(n.deltaY)})};t.addEventListener("mousedown",e,!0),t.addEventListener("mousemove",i,!0),t.addEventListener("mouseup",s,!0),t.addEventListener("wheel",a,!0),t.addEventListener("touchstart",n=>{if(!this.touch0||!this.touch1){var r=n.changedTouches;let o=r.item(0),l=t.getBoundingClientRect(),h=o.clientX-l.left,d=o.clientY-l.top,f=new os(o.identifier,h,d);if(this.mouseX=h,this.mouseY=d,this.buttonDown=!0,!this.touch0)this.touch0=f,this.listeners.map(m=>{m.down&&m.down(f.x,f.y)});else if(!this.touch1){this.touch1=f;let m=this.touch1.x-this.touch0.x,u=this.touch1.x-this.touch0.x;this.initialPinchDistance=Math.sqrt(m*m+u*u),this.listeners.map(x=>{x.zoom&&x.zoom(this.initialPinchDistance,this.initialPinchDistance)})}}n.preventDefault()},!1),t.addEventListener("touchmove",n=>{if(this.touch0){var r=n.changedTouches;let h=t.getBoundingClientRect();for(var o=0;o<r.length;o++){var l=r[o];let d=l.clientX-h.left,f=l.clientY-h.top;this.touch0.identifier===l.identifier&&(this.touch0.x=this.mouseX=d,this.touch0.y=this.mouseY=f,this.listeners.map(m=>{m.dragged&&m.dragged(d,f)})),this.touch1&&this.touch1.identifier===l.identifier&&(this.touch1.x=this.mouseX=d,this.touch1.y=this.mouseY=f)}if(this.touch0&&this.touch1){let d=this.touch1.x-this.touch0.x,f=this.touch1.x-this.touch0.x,m=Math.sqrt(d*d+f*f);this.listeners.map(u=>{u.zoom&&u.zoom(this.initialPinchDistance,m)})}}n.preventDefault()},!1);let c=n=>{if(this.touch0){var r=n.changedTouches;let h=t.getBoundingClientRect();for(var o=0;o<r.length;o++){var l=r[o];let d=l.clientX-h.left,f=l.clientY-h.top;if(this.touch0.identifier===l.identifier)if(this.touch0=null,this.mouseX=d,this.mouseY=f,this.listeners.map(m=>{m.up&&m.up(d,f)}),this.touch1)this.touch0=this.touch1,this.touch1=null,this.mouseX=this.touch0.x,this.mouseX=this.touch0.x,this.buttonDown=!0,this.listeners.map(m=>{m.down&&m.down(this.touch0.x,this.touch0.y)});else{this.buttonDown=!1;break}this.touch1&&this.touch1.identifier&&(this.touch1=null)}}n.preventDefault()};t.addEventListener("touchend",c,!1),t.addEventListener("touchcancel",c)}addListener(t){this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>-1&&this.listeners.splice(e,1)}},os=class{constructor(t,e,i){this.identifier=t,this.x=e,this.y=i}},ft=class{constructor(t,e,i){this.vertexShader=e,this.fragmentShader=i,this.vs=null,this.fs=null,this.program=null,this.tmp2x2=new Float32Array(2*2),this.tmp3x3=new Float32Array(3*3),this.tmp4x4=new Float32Array(4*4),this.vsSource=e,this.fsSource=i,this.context=t instanceof vt?t:new vt(t),this.context.addRestorable(this),this.compile()}getProgram(){return this.program}getVertexShader(){return this.vertexShader}getFragmentShader(){return this.fragmentShader}getVertexShaderSource(){return this.vsSource}getFragmentSource(){return this.fsSource}compile(){let t=this.context.gl;try{this.vs=this.compileShader(t.VERTEX_SHADER,this.vertexShader),this.fs=this.compileShader(t.FRAGMENT_SHADER,this.fragmentShader),this.program=this.compileProgram(this.vs,this.fs)}catch(e){throw this.dispose(),e}}compileShader(t,e){let i=this.context.gl,s=i.createShader(t);if(i.shaderSource(s,e),i.compileShader(s),!i.getShaderParameter(s,i.COMPILE_STATUS)){let a="Couldn't compile shader: "+i.getShaderInfoLog(s);if(i.deleteShader(s),!i.isContextLost())throw new Error(a)}return s}compileProgram(t,e){let i=this.context.gl,s=i.createProgram();if(i.attachShader(s,t),i.attachShader(s,e),i.linkProgram(s),!i.getProgramParameter(s,i.LINK_STATUS)){let a="Couldn't compile shader program: "+i.getProgramInfoLog(s);if(i.deleteProgram(s),!i.isContextLost())throw new Error(a)}return s}restore(){this.compile()}bind(){this.context.gl.useProgram(this.program)}unbind(){this.context.gl.useProgram(null)}setUniformi(t,e){this.context.gl.uniform1i(this.getUniformLocation(t),e)}setUniformf(t,e){this.context.gl.uniform1f(this.getUniformLocation(t),e)}setUniform2f(t,e,i){this.context.gl.uniform2f(this.getUniformLocation(t),e,i)}setUniform3f(t,e,i,s){this.context.gl.uniform3f(this.getUniformLocation(t),e,i,s)}setUniform4f(t,e,i,s,a){this.context.gl.uniform4f(this.getUniformLocation(t),e,i,s,a)}setUniform2x2f(t,e){let i=this.context.gl;this.tmp2x2.set(e),i.uniformMatrix2fv(this.getUniformLocation(t),!1,this.tmp2x2)}setUniform3x3f(t,e){let i=this.context.gl;this.tmp3x3.set(e),i.uniformMatrix3fv(this.getUniformLocation(t),!1,this.tmp3x3)}setUniform4x4f(t,e){let i=this.context.gl;this.tmp4x4.set(e),i.uniformMatrix4fv(this.getUniformLocation(t),!1,this.tmp4x4)}getUniformLocation(t){let e=this.context.gl,i=e.getUniformLocation(this.program,t);if(!i&&!e.isContextLost())throw new Error(`Couldn't find location for uniform ${t}`);return i}getAttributeLocation(t){let e=this.context.gl,i=e.getAttribLocation(this.program,t);if(i==-1&&!e.isContextLost())throw new Error(`Couldn't find location for attribute ${t}`);return i}dispose(){this.context.removeRestorable(this);let t=this.context.gl;this.vs&&(t.deleteShader(this.vs),this.vs=null),this.fs&&(t.deleteShader(this.fs),this.fs=null),this.program&&(t.deleteProgram(this.program),this.program=null)}static newColoredTextured(t){let e=`
3
- attribute vec4 ${ft.POSITION};
4
- attribute vec4 ${ft.COLOR};
5
- attribute vec2 ${ft.TEXCOORDS};
6
- uniform mat4 ${ft.MVP_MATRIX};
1
+ var spine=(()=>{var Vi=Object.defineProperty,Is=e=>Vi(e,"__esModule",{value:!0}),Ms=(e,t)=>{Is(e);for(var i in t)Vi(e,i,{get:t[i],enumerable:!0})},Ni={};Ms(Ni,{AlphaTimeline:()=>ei,Animation:()=>yt,AnimationState:()=>hi,AnimationStateAdapter:()=>Es,AnimationStateData:()=>Fs,AssetManager:()=>us,AssetManagerBase:()=>is,AtlasAttachmentLoader:()=>Bs,Attachment:()=>Ut,AttachmentTimeline:()=>Je,BinaryInput:()=>ls,BlendMode:()=>we,Bone:()=>pi,BoneData:()=>bi,BoundingBoxAttachment:()=>Tt,CURRENT:()=>Ki,CameraController:()=>ur,ClippingAttachment:()=>xt,Color:()=>V,Color2Attribute:()=>gs,ColorAttribute:()=>Ft,ConstraintData:()=>It,CurveTimeline:()=>Ee,CurveTimeline1:()=>Fe,CurveTimeline2:()=>At,DebugUtils:()=>ks,DeformTimeline:()=>si,Downloader:()=>ss,DrawOrderTimeline:()=>Ke,Event:()=>wi,EventData:()=>vi,EventQueue:()=>Zi,EventTimeline:()=>gt,EventType:()=>Se,FIRST:()=>ci,FakeTexture:()=>Xs,GLTexture:()=>bt,HOLD_FIRST:()=>Ct,HOLD_MIX:()=>Ji,HOLD_SUBSEQUENT:()=>di,IkConstraint:()=>rs,IkConstraintData:()=>yi,IkConstraintTimeline:()=>ri,Input:()=>Ri,IntSet:()=>Ys,Interpolation:()=>Ui,JitterEffect:()=>hr,LoadingScreen:()=>xr,M00:()=>N,M01:()=>G,M02:()=>H,M03:()=>U,M10:()=>j,M11:()=>z,M12:()=>Z,M13:()=>W,M20:()=>J,M21:()=>K,M22:()=>q,M23:()=>_,M30:()=>$,M31:()=>ee,M32:()=>te,M33:()=>Q,ManagedWebGLRenderingContext:()=>ve,MathUtils:()=>F,Matrix4:()=>qe,Mesh:()=>Ei,MeshAttachment:()=>Ge,MixBlend:()=>fe,MixDirection:()=>Ne,OrthoCamera:()=>fs,PathAttachment:()=>$e,PathConstraint:()=>rt,PathConstraintData:()=>Ai,PathConstraintMixTimeline:()=>oi,PathConstraintPositionTimeline:()=>ni,PathConstraintSpacingTimeline:()=>li,PointAttachment:()=>xi,PolygonBatcher:()=>Xi,Pool:()=>ut,Position2Attribute:()=>Et,Position3Attribute:()=>fr,PositionMode:()=>Pe,Pow:()=>zi,PowOut:()=>Wi,RGB2Timeline:()=>ii,RGBA2Timeline:()=>ti,RGBATimeline:()=>Qt,RGBTimeline:()=>$t,RegionAttachment:()=>ne,ResizeMode:()=>lt,RotateMode:()=>et,RotateTimeline:()=>mt,SETUP:()=>ui,SUBSEQUENT:()=>St,ScaleTimeline:()=>Gt,ScaleXTimeline:()=>Ht,ScaleYTimeline:()=>jt,SceneRenderer:()=>bs,SequenceTimeline:()=>st,Shader:()=>be,ShapeRenderer:()=>Li,ShapeType:()=>ye,ShearTimeline:()=>Zt,ShearXTimeline:()=>Jt,ShearYTimeline:()=>Kt,Skeleton:()=>Ps,SkeletonBinary:()=>Os,SkeletonBounds:()=>os,SkeletonClipping:()=>Yt,SkeletonData:()=>Si,SkeletonDebugRenderer:()=>Lt,SkeletonJson:()=>lr,SkeletonRenderer:()=>Bi,Skin:()=>Mt,SkinEntry:()=>Ci,Slot:()=>as,SlotData:()=>Ti,SpacingMode:()=>ge,SpineCanvas:()=>wr,StringSet:()=>Vt,SwirlEffect:()=>cs,TexCoordAttribute:()=>Fi,Texture:()=>mi,TextureAtlas:()=>$i,TextureAtlasPage:()=>es,TextureAtlasRegion:()=>gi,TextureFilter:()=>Ie,TextureRegion:()=>Qi,TextureWrap:()=>Qe,TimeKeeper:()=>Nt,Timeline:()=>me,Touch:()=>ms,TrackEntry:()=>ji,TransformConstraint:()=>ns,TransformConstraintData:()=>Ii,TransformConstraintTimeline:()=>ai,TransformMode:()=>Ce,TranslateTimeline:()=>Wt,TranslateXTimeline:()=>qt,TranslateYTimeline:()=>_t,Triangulator:()=>Te,Utils:()=>D,Vector2:()=>ft,Vector3:()=>Me,VertexAttachment:()=>Re,VertexAttribute:()=>nt,VertexAttributeType:()=>He,WebGLBlendModeConverter:()=>Rt,WindowedMean:()=>Rs});var Ys=class{constructor(){this.array=new Array}add(e){let t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!=null}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}},Vt=class{constructor(){this.entries={},this.size=0}add(e){let t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){let t=this.size;for(var i=0,s=e.length;i<s;i++)this.add(e[i]);return t!=this.size}contains(e){return this.entries[e]}clear(){this.entries={},this.size=0}},Ze=class{constructor(e=0,t=0,i=0,s=0){this.r=e,this.g=t,this.b=i,this.a=s}set(e,t,i,s){return this.r=e,this.g=t,this.b=i,this.a=s,this.clamp()}setFromColor(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}setFromString(e){return e=e.charAt(0)=="#"?e.substr(1):e,this.r=parseInt(e.substr(0,2),16)/255,this.g=parseInt(e.substr(2,2),16)/255,this.b=parseInt(e.substr(4,2),16)/255,this.a=e.length!=8?1:parseInt(e.substr(6,2),16)/255,this}add(e,t,i,s){return this.r+=e,this.g+=t,this.b+=i,this.a+=s,this.clamp()}clamp(){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}static rgba8888ToColor(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}static fromString(e){return new Ze().setFromString(e)}},V=Ze;V.WHITE=new Ze(1,1,1,1),V.RED=new Ze(1,0,0,1),V.GREEN=new Ze(0,1,0,1),V.BLUE=new Ze(0,0,1,1),V.MAGENTA=new Ze(1,0,1,1);var De=class{static clamp(e,t,i){return e<t?t:e>i?i:e}static cosDeg(e){return Math.cos(e*De.degRad)}static sinDeg(e){return Math.sin(e*De.degRad)}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){let t=Math.pow(Math.abs(e),1/3);return e<0?-t:t}static randomTriangular(e,t){return De.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,i){let s=Math.random(),r=t-e;return s<=(i-e)/r?e+Math.sqrt(s*r*(i-e)):t-Math.sqrt((1-s)*r*(t-i))}static isPowerOfTwo(e){return e&&(e&e-1)==0}},F=De;F.PI=3.1415927,F.PI2=De.PI*2,F.radiansToDegrees=180/De.PI,F.radDeg=De.radiansToDegrees,F.degreesToRadians=De.PI/180,F.degRad=De.degreesToRadians;var Ui=class{apply(e,t,i){return e+(t-e)*this.applyInternal(i)}},zi=class extends Ui{constructor(e){super();this.power=2,this.power=e}applyInternal(e){return e<=.5?Math.pow(e*2,this.power)/2:Math.pow((e-1)*2,this.power)/(this.power%2==0?-2:2)+1}},Wi=class extends zi{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2==0?-1:1)+1}},it=class{static arrayCopy(e,t,i,s,r){for(let c=t,n=s;c<t+r;c++,n++)i[n]=e[c]}static arrayFill(e,t,i,s){for(let r=t;r<i;r++)e[r]=s}static setArraySize(e,t,i=0){let s=e.length;if(s==t)return e;if(e.length=t,s<t)for(let r=s;r<t;r++)e[r]=i;return e}static ensureArrayCapacity(e,t,i=0){return e.length>=t?e:it.setArraySize(e,t,i)}static newArray(e,t){let i=new Array(e);for(let s=0;s<e;s++)i[s]=t;return i}static newFloatArray(e){if(it.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);{let t=new Array(e);for(let i=0;i<t.length;i++)t[i]=0;return t}}static newShortArray(e){if(it.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);{let t=new Array(e);for(let i=0;i<t.length;i++)t[i]=0;return t}}static toFloatArray(e){return it.SUPPORTS_TYPED_ARRAYS?new Float32Array(e):e}static toSinglePrecision(e){return it.SUPPORTS_TYPED_ARRAYS?Math.fround(e):e}static webkit602BugfixHelper(e,t){}static contains(e,t,i=!0){for(var s=0;s<e.length;s++)if(e[s]==t)return!0;return!1}static enumValue(e,t){return e[t[0].toUpperCase()+t.slice(1)]}},D=it;D.SUPPORTS_TYPED_ARRAYS=typeof Float32Array!="undefined";var ks=class{static logBones(e){for(let t=0;t<e.bones.length;t++){let i=e.bones[t];console.log(i.data.name+", "+i.a+", "+i.b+", "+i.c+", "+i.d+", "+i.worldX+", "+i.worldY)}}},ut=class{constructor(e){this.items=new Array,this.instantiator=e}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(e){e.reset&&e.reset(),this.items.push(e)}freeAll(e){for(let t=0;t<e.length;t++)this.free(e[t])}clear(){this.items.length=0}},ft=class{constructor(e=0,t=0){this.x=e,this.y=t}set(e,t){return this.x=e,this.y=t,this}length(){let e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}normalize(){let e=this.length();return e!=0&&(this.x/=e,this.y/=e),this}},Nt=class{constructor(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}update(){let e=Date.now()/1e3;this.delta=e-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},Rs=class{constructor(e=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=e,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t<this.values.length;t++)e+=this.values[t];this.mean=e/this.values.length,this.dirty=!1}return this.mean}return 0}},Ut=class{constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}},qi=class extends Ut{constructor(e){super(e);this.id=qi.nextID++,this.worldVerticesLength=0,this.timelineAttahment=this}computeWorldVertices(e,t,i,s,r,c){i=r+(i>>1)*c;let n=e.bone.skeleton,a=e.deform,l=this.vertices,o=this.bones;if(!o){a.length>0&&(l=a);let f=e.bone,m=f.worldX,x=f.worldY,w=f.a,v=f.b,g=f.c,b=f.d;for(let p=t,y=r;y<i;p+=2,y+=c){let T=l[p],A=l[p+1];s[y]=T*w+A*v+m,s[y+1]=T*g+A*b+x}return}let h=0,d=0;for(let f=0;f<t;f+=2){let m=o[h];h+=m+1,d+=m}let u=n.bones;if(a.length==0)for(let f=r,m=d*3;f<i;f+=c){let x=0,w=0,v=o[h++];for(v+=h;h<v;h++,m+=3){let g=u[o[h]],b=l[m],p=l[m+1],y=l[m+2];x+=(b*g.a+p*g.b+g.worldX)*y,w+=(b*g.c+p*g.d+g.worldY)*y}s[f]=x,s[f+1]=w}else{let f=a;for(let m=r,x=d*3,w=d<<1;m<i;m+=c){let v=0,g=0,b=o[h++];for(b+=h;h<b;h++,x+=3,w+=2){let p=u[o[h]],y=l[x]+f[w],T=l[x+1]+f[w+1],A=l[x+2];v+=(y*p.a+T*p.b+p.worldX)*A,g+=(y*p.c+T*p.d+p.worldY)*A}s[m]=v,s[m+1]=g}}}copyTo(e){this.bones?(e.bones=new Array(this.bones.length),D.arrayCopy(this.bones,0,e.bones,0,this.bones.length)):e.bones=null,this.vertices?(e.vertices=D.newFloatArray(this.vertices.length),D.arrayCopy(this.vertices,0,e.vertices,0,this.vertices.length)):e.vertices=null,e.worldVerticesLength=this.worldVerticesLength,e.timelineAttahment=this.timelineAttahment}},Re=qi;Re.nextID=0;var vt=class{constructor(e){this.id=vt.nextID(),this.start=0,this.digits=0,this.setupIndex=0,this.regions=new Array(e)}copy(){let e=new vt(this.regions.length);return D.arrayCopy(this.regions,0,e.regions,0,this.regions.length),e.start=this.start,e.digits=this.digits,e.setupIndex=this.setupIndex,e}apply(e,t){let i=e.sequenceIndex;i==-1&&(i=this.setupIndex),i>=this.regions.length&&(i=this.regions.length-1);let s=this.regions[i];t.region!=s&&(t.region=s,t.updateRegion())}getPath(e,t){let i=e,s=(this.start+t).toString();for(let r=this.digits-s.length;r>0;r--)i+="0";return i+=s,i}static nextID(){return vt._nextID++}},zt=vt;zt._nextID=0;var Ve;(function(e){e[e.hold=0]="hold",e[e.once=1]="once",e[e.loop=2]="loop",e[e.pingpong=3]="pingpong",e[e.onceReverse=4]="onceReverse",e[e.loopReverse=5]="loopReverse",e[e.pingpongReverse=6]="pingpongReverse"})(Ve||(Ve={}));var _i=[0,1,2,3,4,5,6],yt=class{constructor(e,t,i){if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=i}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds=new Vt;for(var t=0;t<e.length;t++)this.timelineIds.addAll(e[t].getPropertyIds())}hasTimeline(e){for(let t=0;t<e.length;t++)if(this.timelineIds.contains(e[t]))return!0;return!1}apply(e,t,i,s,r,c,n,a){if(!e)throw new Error("skeleton cannot be null.");s&&this.duration!=0&&(i%=this.duration,t>0&&(t%=this.duration));let l=this.timelines;for(let o=0,h=l.length;o<h;o++)l[o].apply(e,t,i,r,c,n,a)}},fe;(function(e){e[e.setup=0]="setup",e[e.first=1]="first",e[e.replace=2]="replace",e[e.add=3]="add"})(fe||(fe={}));var Ne;(function(e){e[e.mixIn=0]="mixIn",e[e.mixOut=1]="mixOut"})(Ne||(Ne={}));var ce={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,rgb:7,alpha:8,rgb2:9,attachment:10,deform:11,event:12,drawOrder:13,ikConstraint:14,transformConstraint:15,pathConstraintPosition:16,pathConstraintSpacing:17,pathConstraintMix:18,sequence:19},me=class{constructor(e,t){this.propertyIds=t,this.frames=D.newFloatArray(e*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(e,t){let i=e.length;for(let s=1;s<i;s++)if(e[s]>t)return s-1;return i-1}static search(e,t,i){let s=e.length;for(let r=i;r<s;r+=i)if(e[r]>t)return r-i;return s-i}},Ee=class extends me{constructor(e,t,i){super(e,i);this.curves=D.newFloatArray(e+t*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){let t=this.getFrameCount()+e*18;if(this.curves.length>t){let i=D.newFloatArray(t);D.arrayCopy(this.curves,0,i,0,t),this.curves=i}}setBezier(e,t,i,s,r,c,n,a,l,o,h){let d=this.curves,u=this.getFrameCount()+e*18;i==0&&(d[t]=2+u);let f=(s-c*2+a)*.03,m=(r-n*2+l)*.03,x=((c-a)*3-s+o)*.006,w=((n-l)*3-r+h)*.006,v=f*2+x,g=m*2+w,b=(c-s)*.3+f+x*.16666667,p=(n-r)*.3+m+w*.16666667,y=s+b,T=r+p;for(let A=u+18;u<A;u+=2)d[u]=y,d[u+1]=T,b+=v,p+=g,v+=x,g+=w,y+=b,T+=p}getBezierValue(e,t,i,s){let r=this.curves;if(r[s]>e){let l=this.frames[t],o=this.frames[t+i];return o+(e-l)/(r[s]-l)*(r[s+1]-o)}let c=s+18;for(s+=2;s<c;s+=2)if(r[s]>=e){let l=r[s-2],o=r[s-1];return o+(e-l)/(r[s]-l)*(r[s+1]-o)}t+=this.getFrameEntries();let n=r[c-2],a=r[c-1];return a+(e-n)/(this.frames[t]-n)*(this.frames[t+i]-a)}},Fe=class extends Ee{constructor(e,t,i){super(e,t,[i])}getFrameEntries(){return 2}setFrame(e,t,i){e<<=1,this.frames[e]=t,this.frames[e+1]=i}getCurveValue(e){let t=this.frames,i=t.length-2;for(let r=2;r<=i;r+=2)if(t[r]>e){i=r-2;break}let s=this.curves[i>>1];switch(s){case 0:let r=t[i],c=t[i+1];return c+(e-r)/(t[i+2]-r)*(t[i+2+1]-c);case 1:return t[i+1]}return this.getBezierValue(e,i,1,s-2)}},At=class extends Ee{constructor(e,t,i,s){super(e,t,[i,s])}getFrameEntries(){return 3}setFrame(e,t,i,s){e*=3,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=s}},mt=class extends Fe{constructor(e,t,i){super(e,t,ce.rotate+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(e,t,i,s,r,c,n){let a=e.bones[this.boneIndex];if(!a.active)return;let l=this.frames;if(i<l[0]){switch(c){case 0:a.rotation=a.data.rotation;return;case 1:a.rotation+=(a.data.rotation-a.rotation)*r}return}let o=this.getCurveValue(i);switch(c){case 0:a.rotation=a.data.rotation+o*r;break;case 1:case 2:o+=a.data.rotation-a.rotation;case 3:a.rotation+=o*r}}},Wt=class extends At{constructor(e,t,i){super(e,t,ce.x+"|"+i,ce.y+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(e,t,i,s,r,c,n){let a=e.bones[this.boneIndex];if(!a.active)return;let l=this.frames;if(i<l[0]){switch(c){case 0:a.x=a.data.x,a.y=a.data.y;return;case 1:a.x+=(a.data.x-a.x)*r,a.y+=(a.data.y-a.y)*r}return}let o=0,h=0,d=me.search(l,i,3),u=this.curves[d/3];switch(u){case 0:let f=l[d];o=l[d+1],h=l[d+2];let m=(i-f)/(l[d+3]-f);o+=(l[d+3+1]-o)*m,h+=(l[d+3+2]-h)*m;break;case 1:o=l[d+1],h=l[d+2];break;default:o=this.getBezierValue(i,d,1,u-2),h=this.getBezierValue(i,d,2,u+18-2)}switch(c){case 0:a.x=a.data.x+o*r,a.y=a.data.y+h*r;break;case 1:case 2:a.x+=(a.data.x+o-a.x)*r,a.y+=(a.data.y+h-a.y)*r;break;case 3:a.x+=o*r,a.y+=h*r}}},qt=class extends Fe{constructor(e,t,i){super(e,t,ce.x+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(e,t,i,s,r,c,n){let a=e.bones[this.boneIndex];if(!a.active)return;let l=this.frames;if(i<l[0]){switch(c){case 0:a.x=a.data.x;return;case 1:a.x+=(a.data.x-a.x)*r}return}let o=this.getCurveValue(i);switch(c){case 0:a.x=a.data.x+o*r;break;case 1:case 2:a.x+=(a.data.x+o-a.x)*r;break;case 3:a.x+=o*r}}},_t=class extends Fe{constructor(e,t,i){super(e,t,ce.y+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(e,t,i,s,r,c,n){let a=e.bones[this.boneIndex];if(!a.active)return;let l=this.frames;if(i<l[0]){switch(c){case 0:a.y=a.data.y;return;case 1:a.y+=(a.data.y-a.y)*r}return}let o=this.getCurveValue(i);switch(c){case 0:a.y=a.data.y+o*r;break;case 1:case 2:a.y+=(a.data.y+o-a.y)*r;break;case 3:a.y+=o*r}}},Gt=class extends At{constructor(e,t,i){super(e,t,ce.scaleX+"|"+i,ce.scaleY+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(e,t,i,s,r,c,n){let a=e.bones[this.boneIndex];if(!a.active)return;let l=this.frames;if(i<l[0]){switch(c){case 0:a.scaleX=a.data.scaleX,a.scaleY=a.data.scaleY;return;case 1:a.scaleX+=(a.data.scaleX-a.scaleX)*r,a.scaleY+=(a.data.scaleY-a.scaleY)*r}return}let o,h,d=me.search(l,i,3),u=this.curves[d/3];switch(u){case 0:let f=l[d];o=l[d+1],h=l[d+2];let m=(i-f)/(l[d+3]-f);o+=(l[d+3+1]-o)*m,h+=(l[d+3+2]-h)*m;break;case 1:o=l[d+1],h=l[d+2];break;default:o=this.getBezierValue(i,d,1,u-2),h=this.getBezierValue(i,d,2,u+18-2)}if(o*=a.data.scaleX,h*=a.data.scaleY,r==1)c==3?(a.scaleX+=o-a.data.scaleX,a.scaleY+=h-a.data.scaleY):(a.scaleX=o,a.scaleY=h);else{let f=0,m=0;if(n==1)switch(c){case 0:f=a.data.scaleX,m=a.data.scaleY,a.scaleX=f+(Math.abs(o)*F.signum(f)-f)*r,a.scaleY=m+(Math.abs(h)*F.signum(m)-m)*r;break;case 1:case 2:f=a.scaleX,m=a.scaleY,a.scaleX=f+(Math.abs(o)*F.signum(f)-f)*r,a.scaleY=m+(Math.abs(h)*F.signum(m)-m)*r;break;case 3:a.scaleX=(o-a.data.scaleX)*r,a.scaleY=(h-a.data.scaleY)*r}else switch(c){case 0:f=Math.abs(a.data.scaleX)*F.signum(o),m=Math.abs(a.data.scaleY)*F.signum(h),a.scaleX=f+(o-f)*r,a.scaleY=m+(h-m)*r;break;case 1:case 2:f=Math.abs(a.scaleX)*F.signum(o),m=Math.abs(a.scaleY)*F.signum(h),a.scaleX=f+(o-f)*r,a.scaleY=m+(h-m)*r;break;case 3:a.scaleX+=(o-a.data.scaleX)*r,a.scaleY+=(h-a.data.scaleY)*r}}}},Ht=class extends Fe{constructor(e,t,i){super(e,t,ce.scaleX+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(e,t,i,s,r,c,n){let a=e.bones[this.boneIndex];if(!a.active)return;let l=this.frames;if(i<l[0]){switch(c){case 0:a.scaleX=a.data.scaleX;return;case 1:a.scaleX+=(a.data.scaleX-a.scaleX)*r}return}let o=this.getCurveValue(i)*a.data.scaleX;if(r==1)c==3?a.scaleX+=o-a.data.scaleX:a.scaleX=o;else{let h=0;if(n==1)switch(c){case 0:h=a.data.scaleX,a.scaleX=h+(Math.abs(o)*F.signum(h)-h)*r;break;case 1:case 2:h=a.scaleX,a.scaleX=h+(Math.abs(o)*F.signum(h)-h)*r;break;case 3:a.scaleX=(o-a.data.scaleX)*r}else switch(c){case 0:h=Math.abs(a.data.scaleX)*F.signum(o),a.scaleX=h+(o-h)*r;break;case 1:case 2:h=Math.abs(a.scaleX)*F.signum(o),a.scaleX=h+(o-h)*r;break;case 3:a.scaleX+=(o-a.data.scaleX)*r}}}},jt=class extends Fe{constructor(e,t,i){super(e,t,ce.scaleY+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(e,t,i,s,r,c,n){let a=e.bones[this.boneIndex];if(!a.active)return;let l=this.frames;if(i<l[0]){switch(c){case 0:a.scaleY=a.data.scaleY;return;case 1:a.scaleY+=(a.data.scaleY-a.scaleY)*r}return}let o=this.getCurveValue(i)*a.data.scaleY;if(r==1)c==3?a.scaleY+=o-a.data.scaleY:a.scaleY=o;else{let h=0;if(n==1)switch(c){case 0:h=a.data.scaleY,a.scaleY=h+(Math.abs(o)*F.signum(h)-h)*r;break;case 1:case 2:h=a.scaleY,a.scaleY=h+(Math.abs(o)*F.signum(h)-h)*r;break;case 3:a.scaleY=(o-a.data.scaleY)*r}else switch(c){case 0:h=Math.abs(a.data.scaleY)*F.signum(o),a.scaleY=h+(o-h)*r;break;case 1:case 2:h=Math.abs(a.scaleY)*F.signum(o),a.scaleY=h+(o-h)*r;break;case 3:a.scaleY+=(o-a.data.scaleY)*r}}}},Zt=class extends At{constructor(e,t,i){super(e,t,ce.shearX+"|"+i,ce.shearY+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(e,t,i,s,r,c,n){let a=e.bones[this.boneIndex];if(!a.active)return;let l=this.frames;if(i<l[0]){switch(c){case 0:a.shearX=a.data.shearX,a.shearY=a.data.shearY;return;case 1:a.shearX+=(a.data.shearX-a.shearX)*r,a.shearY+=(a.data.shearY-a.shearY)*r}return}let o=0,h=0,d=me.search(l,i,3),u=this.curves[d/3];switch(u){case 0:let f=l[d];o=l[d+1],h=l[d+2];let m=(i-f)/(l[d+3]-f);o+=(l[d+3+1]-o)*m,h+=(l[d+3+2]-h)*m;break;case 1:o=l[d+1],h=l[d+2];break;default:o=this.getBezierValue(i,d,1,u-2),h=this.getBezierValue(i,d,2,u+18-2)}switch(c){case 0:a.shearX=a.data.shearX+o*r,a.shearY=a.data.shearY+h*r;break;case 1:case 2:a.shearX+=(a.data.shearX+o-a.shearX)*r,a.shearY+=(a.data.shearY+h-a.shearY)*r;break;case 3:a.shearX+=o*r,a.shearY+=h*r}}},Jt=class extends Fe{constructor(e,t,i){super(e,t,ce.shearX+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(e,t,i,s,r,c,n){let a=e.bones[this.boneIndex];if(!a.active)return;let l=this.frames;if(i<l[0]){switch(c){case 0:a.shearX=a.data.shearX;return;case 1:a.shearX+=(a.data.shearX-a.shearX)*r}return}let o=this.getCurveValue(i);switch(c){case 0:a.shearX=a.data.shearX+o*r;break;case 1:case 2:a.shearX+=(a.data.shearX+o-a.shearX)*r;break;case 3:a.shearX+=o*r}}},Kt=class extends Fe{constructor(e,t,i){super(e,t,ce.shearY+"|"+i);this.boneIndex=0,this.boneIndex=i}apply(e,t,i,s,r,c,n){let a=e.bones[this.boneIndex];if(!a.active)return;let l=this.frames;if(i<l[0]){switch(c){case 0:a.shearY=a.data.shearY;return;case 1:a.shearY+=(a.data.shearY-a.shearY)*r}return}let o=this.getCurveValue(i);switch(c){case 0:a.shearY=a.data.shearY+o*r;break;case 1:case 2:a.shearY+=(a.data.shearY+o-a.shearY)*r;break;case 3:a.shearY+=o*r}}},Qt=class extends Ee{constructor(e,t,i){super(e,t,[ce.rgb+"|"+i,ce.alpha+"|"+i]);this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 5}setFrame(e,t,i,s,r,c){e*=5,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=s,this.frames[e+3]=r,this.frames[e+4]=c}apply(e,t,i,s,r,c,n){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let l=this.frames,o=a.color;if(i<l[0]){let w=a.data.color;switch(c){case 0:o.setFromColor(w);return;case 1:o.add((w.r-o.r)*r,(w.g-o.g)*r,(w.b-o.b)*r,(w.a-o.a)*r)}return}let h=0,d=0,u=0,f=0,m=me.search(l,i,5),x=this.curves[m/5];switch(x){case 0:let w=l[m];h=l[m+1],d=l[m+2],u=l[m+3],f=l[m+4];let v=(i-w)/(l[m+5]-w);h+=(l[m+5+1]-h)*v,d+=(l[m+5+2]-d)*v,u+=(l[m+5+3]-u)*v,f+=(l[m+5+4]-f)*v;break;case 1:h=l[m+1],d=l[m+2],u=l[m+3],f=l[m+4];break;default:h=this.getBezierValue(i,m,1,x-2),d=this.getBezierValue(i,m,2,x+18-2),u=this.getBezierValue(i,m,3,x+18*2-2),f=this.getBezierValue(i,m,4,x+18*3-2)}r==1?o.set(h,d,u,f):(c==0&&o.setFromColor(a.data.color),o.add((h-o.r)*r,(d-o.g)*r,(u-o.b)*r,(f-o.a)*r))}},$t=class extends Ee{constructor(e,t,i){super(e,t,[ce.rgb+"|"+i]);this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 4}setFrame(e,t,i,s,r){e<<=2,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=s,this.frames[e+3]=r}apply(e,t,i,s,r,c,n){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let l=this.frames,o=a.color;if(i<l[0]){let x=a.data.color;switch(c){case 0:o.r=x.r,o.g=x.g,o.b=x.b;return;case 1:o.r+=(x.r-o.r)*r,o.g+=(x.g-o.g)*r,o.b+=(x.b-o.b)*r}return}let h=0,d=0,u=0,f=me.search(l,i,4),m=this.curves[f>>2];switch(m){case 0:let x=l[f];h=l[f+1],d=l[f+2],u=l[f+3];let w=(i-x)/(l[f+4]-x);h+=(l[f+4+1]-h)*w,d+=(l[f+4+2]-d)*w,u+=(l[f+4+3]-u)*w;break;case 1:h=l[f+1],d=l[f+2],u=l[f+3];break;default:h=this.getBezierValue(i,f,1,m-2),d=this.getBezierValue(i,f,2,m+18-2),u=this.getBezierValue(i,f,3,m+18*2-2)}if(r==1)o.r=h,o.g=d,o.b=u;else{if(c==0){let x=a.data.color;o.r=x.r,o.g=x.g,o.b=x.b}o.r+=(h-o.r)*r,o.g+=(d-o.g)*r,o.b+=(u-o.b)*r}}},ei=class extends Fe{constructor(e,t,i){super(e,t,ce.alpha+"|"+i);this.slotIndex=0,this.slotIndex=i}apply(e,t,i,s,r,c,n){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let l=a.color;if(i<this.frames[0]){let h=a.data.color;switch(c){case 0:l.a=h.a;return;case 1:l.a+=(h.a-l.a)*r}return}let o=this.getCurveValue(i);r==1?l.a=o:(c==0&&(l.a=a.data.color.a),l.a+=(o-l.a)*r)}},ti=class extends Ee{constructor(e,t,i){super(e,t,[ce.rgb+"|"+i,ce.alpha+"|"+i,ce.rgb2+"|"+i]);this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 8}setFrame(e,t,i,s,r,c,n,a,l){e<<=3,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=s,this.frames[e+3]=r,this.frames[e+4]=c,this.frames[e+5]=n,this.frames[e+6]=a,this.frames[e+7]=l}apply(e,t,i,s,r,c,n){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let l=this.frames,o=a.color,h=a.darkColor;if(i<l[0]){let p=a.data.color,y=a.data.darkColor;switch(c){case 0:o.setFromColor(p),h.r=y.r,h.g=y.g,h.b=y.b;return;case 1:o.add((p.r-o.r)*r,(p.g-o.g)*r,(p.b-o.b)*r,(p.a-o.a)*r),h.r+=(y.r-h.r)*r,h.g+=(y.g-h.g)*r,h.b+=(y.b-h.b)*r}return}let d=0,u=0,f=0,m=0,x=0,w=0,v=0,g=me.search(l,i,8),b=this.curves[g>>3];switch(b){case 0:let p=l[g];d=l[g+1],u=l[g+2],f=l[g+3],m=l[g+4],x=l[g+5],w=l[g+6],v=l[g+7];let y=(i-p)/(l[g+8]-p);d+=(l[g+8+1]-d)*y,u+=(l[g+8+2]-u)*y,f+=(l[g+8+3]-f)*y,m+=(l[g+8+4]-m)*y,x+=(l[g+8+5]-x)*y,w+=(l[g+8+6]-w)*y,v+=(l[g+8+7]-v)*y;break;case 1:d=l[g+1],u=l[g+2],f=l[g+3],m=l[g+4],x=l[g+5],w=l[g+6],v=l[g+7];break;default:d=this.getBezierValue(i,g,1,b-2),u=this.getBezierValue(i,g,2,b+18-2),f=this.getBezierValue(i,g,3,b+18*2-2),m=this.getBezierValue(i,g,4,b+18*3-2),x=this.getBezierValue(i,g,5,b+18*4-2),w=this.getBezierValue(i,g,6,b+18*5-2),v=this.getBezierValue(i,g,7,b+18*6-2)}if(r==1)o.set(d,u,f,m),h.r=x,h.g=w,h.b=v;else{if(c==0){o.setFromColor(a.data.color);let p=a.data.darkColor;h.r=p.r,h.g=p.g,h.b=p.b}o.add((d-o.r)*r,(u-o.g)*r,(f-o.b)*r,(m-o.a)*r),h.r+=(x-h.r)*r,h.g+=(w-h.g)*r,h.b+=(v-h.b)*r}}},ii=class extends Ee{constructor(e,t,i){super(e,t,[ce.rgb+"|"+i,ce.rgb2+"|"+i]);this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 7}setFrame(e,t,i,s,r,c,n,a){e*=7,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=s,this.frames[e+3]=r,this.frames[e+4]=c,this.frames[e+5]=n,this.frames[e+6]=a}apply(e,t,i,s,r,c,n){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let l=this.frames,o=a.color,h=a.darkColor;if(i<l[0]){let p=a.data.color,y=a.data.darkColor;switch(c){case 0:o.r=p.r,o.g=p.g,o.b=p.b,h.r=y.r,h.g=y.g,h.b=y.b;return;case 1:o.r+=(p.r-o.r)*r,o.g+=(p.g-o.g)*r,o.b+=(p.b-o.b)*r,h.r+=(y.r-h.r)*r,h.g+=(y.g-h.g)*r,h.b+=(y.b-h.b)*r}return}let d=0,u=0,f=0,m=0,x=0,w=0,v=0,g=me.search(l,i,7),b=this.curves[g/7];switch(b){case 0:let p=l[g];d=l[g+1],u=l[g+2],f=l[g+3],x=l[g+4],w=l[g+5],v=l[g+6];let y=(i-p)/(l[g+7]-p);d+=(l[g+7+1]-d)*y,u+=(l[g+7+2]-u)*y,f+=(l[g+7+3]-f)*y,x+=(l[g+7+4]-x)*y,w+=(l[g+7+5]-w)*y,v+=(l[g+7+6]-v)*y;break;case 1:d=l[g+1],u=l[g+2],f=l[g+3],x=l[g+4],w=l[g+5],v=l[g+6];break;default:d=this.getBezierValue(i,g,1,b-2),u=this.getBezierValue(i,g,2,b+18-2),f=this.getBezierValue(i,g,3,b+18*2-2),x=this.getBezierValue(i,g,4,b+18*3-2),w=this.getBezierValue(i,g,5,b+18*4-2),v=this.getBezierValue(i,g,6,b+18*5-2)}if(r==1)o.r=d,o.g=u,o.b=f,h.r=x,h.g=w,h.b=v;else{if(c==0){let p=a.data.color,y=a.data.darkColor;o.r=p.r,o.g=p.g,o.b=p.b,h.r=y.r,h.g=y.g,h.b=y.b}o.r+=(d-o.r)*r,o.g+=(u-o.g)*r,o.b+=(f-o.b)*r,h.r+=(x-h.r)*r,h.g+=(w-h.g)*r,h.b+=(v-h.b)*r}}},Je=class extends me{constructor(e,t){super(e,[ce.attachment+"|"+t]);this.slotIndex=0,this.slotIndex=t,this.attachmentNames=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,i){this.frames[e]=t,this.attachmentNames[e]=i}apply(e,t,i,s,r,c,n){let a=e.slots[this.slotIndex];if(!!a.bone.active){if(n==1){c==0&&this.setAttachment(e,a,a.data.attachmentName);return}if(i<this.frames[0]){(c==0||c==1)&&this.setAttachment(e,a,a.data.attachmentName);return}this.setAttachment(e,a,this.attachmentNames[me.search1(this.frames,i)])}}setAttachment(e,t,i){t.setAttachment(i?e.getAttachment(this.slotIndex,i):null)}},si=class extends Ee{constructor(e,t,i,s){super(e,t,[ce.deform+"|"+i+"|"+s.id]);this.slotIndex=0,this.slotIndex=i,this.attachment=s,this.vertices=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,i){this.frames[e]=t,this.vertices[e]=i}setBezier(e,t,i,s,r,c,n,a,l,o,h){let d=this.curves,u=this.getFrameCount()+e*18;i==0&&(d[t]=2+u);let f=(s-c*2+a)*.03,m=l*.03-n*.06,x=((c-a)*3-s+o)*.006,w=(n-l+.33333333)*.018,v=f*2+x,g=m*2+w,b=(c-s)*.3+f+x*.16666667,p=n*.3+m+w*.16666667,y=s+b,T=p;for(let A=u+18;u<A;u+=2)d[u]=y,d[u+1]=T,b+=v,p+=g,v+=x,g+=w,y+=b,T+=p}getCurvePercent(e,t){let i=this.curves,s=i[t];switch(s){case 0:let a=this.frames[t];return(e-a)/(this.frames[t+this.getFrameEntries()]-a);case 1:return 0}if(s-=2,i[s]>e){let a=this.frames[t];return i[s+1]*(e-a)/(i[s]-a)}let r=s+18;for(s+=2;s<r;s+=2)if(i[s]>=e){let a=i[s-2],l=i[s-1];return l+(e-a)/(i[s]-a)*(i[s+1]-l)}let c=i[r-2],n=i[r-1];return n+(1-n)*(e-c)/(this.frames[t+this.getFrameEntries()]-c)}apply(e,t,i,s,r,c,n){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let l=a.getAttachment();if(!(l instanceof Re)||l.timelineAttahment!=this.attachment)return;let o=a.deform;o.length==0&&(c=0);let h=this.vertices,d=h[0].length,u=this.frames;if(i<u[0]){switch(c){case 0:o.length=0;return;case 1:if(r==1){o.length=0;return}o.length=d;let g=l;if(g.bones){r=1-r;for(var f=0;f<d;f++)o[f]*=r}else{let b=g.vertices;for(var f=0;f<d;f++)o[f]+=(b[f]-o[f])*r}}return}if(o.length=d,i>=u[u.length-1]){let g=h[u.length-1];if(r==1)if(c==3){let b=l;if(b.bones)for(let p=0;p<d;p++)o[p]+=g[p];else{let p=b.vertices;for(let y=0;y<d;y++)o[y]+=g[y]-p[y]}}else D.arrayCopy(g,0,o,0,d);else switch(c){case 0:{let p=l;if(p.bones)for(let y=0;y<d;y++)o[y]=g[y]*r;else{let y=p.vertices;for(let T=0;T<d;T++){let A=y[T];o[T]=A+(g[T]-A)*r}}break}case 1:case 2:for(let p=0;p<d;p++)o[p]+=(g[p]-o[p])*r;break;case 3:let b=l;if(b.bones)for(let p=0;p<d;p++)o[p]+=g[p]*r;else{let p=b.vertices;for(let y=0;y<d;y++)o[y]+=(g[y]-p[y])*r}}return}let m=me.search1(u,i),x=this.getCurvePercent(i,m),w=h[m],v=h[m+1];if(r==1)if(c==3){let g=l;if(g.bones)for(let b=0;b<d;b++){let p=w[b];o[b]+=p+(v[b]-p)*x}else{let b=g.vertices;for(let p=0;p<d;p++){let y=w[p];o[p]+=y+(v[p]-y)*x-b[p]}}}else for(let g=0;g<d;g++){let b=w[g];o[g]=b+(v[g]-b)*x}else switch(c){case 0:{let b=l;if(b.bones)for(let p=0;p<d;p++){let y=w[p];o[p]=(y+(v[p]-y)*x)*r}else{let p=b.vertices;for(let y=0;y<d;y++){let T=w[y],A=p[y];o[y]=A+(T+(v[y]-T)*x-A)*r}}break}case 1:case 2:for(let b=0;b<d;b++){let p=w[b];o[b]+=(p+(v[b]-p)*x-o[b])*r}break;case 3:let g=l;if(g.bones)for(let b=0;b<d;b++){let p=w[b];o[b]+=(p+(v[b]-p)*x)*r}else{let b=g.vertices;for(let p=0;p<d;p++){let y=w[p];o[p]+=(y+(v[p]-y)*x-b[p])*r}}}}},Gi=class extends me{constructor(e){super(e,Gi.propertyIds);this.events=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t){this.frames[e]=t.time,this.events[e]=t}apply(e,t,i,s,r,c,n){if(!s)return;let a=this.frames,l=this.frames.length;if(t>i)this.apply(e,t,Number.MAX_VALUE,s,r,c,n),t=-1;else if(t>=a[l-1])return;if(i<a[0])return;let o=0;if(t<a[0])o=0;else{o=me.search1(a,t)+1;let h=a[o];for(;o>0&&a[o-1]==h;)o--}for(;o<l&&i>=a[o];o++)s.push(this.events[o])}},gt=Gi;gt.propertyIds=[""+ce.event];var Hi=class extends me{constructor(e){super(e,Hi.propertyIds);this.drawOrders=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,i){this.frames[e]=t,this.drawOrders[e]=i}apply(e,t,i,s,r,c,n){if(n==1){c==0&&D.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}if(i<this.frames[0]){(c==0||c==1)&&D.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}let a=this.drawOrders[me.search1(this.frames,i)];if(!a)D.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);else{let l=e.drawOrder,o=e.slots;for(let h=0,d=a.length;h<d;h++)l[h]=o[a[h]]}}},Ke=Hi;Ke.propertyIds=[""+ce.drawOrder];var ri=class extends Ee{constructor(e,t,i){super(e,t,[ce.ikConstraint+"|"+i]);this.ikConstraintIndex=i}getFrameEntries(){return 6}setFrame(e,t,i,s,r,c,n){e*=6,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=s,this.frames[e+3]=r,this.frames[e+4]=c?1:0,this.frames[e+5]=n?1:0}apply(e,t,i,s,r,c,n){let a=e.ikConstraints[this.ikConstraintIndex];if(!a.active)return;let l=this.frames;if(i<l[0]){switch(c){case 0:a.mix=a.data.mix,a.softness=a.data.softness,a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch;return;case 1:a.mix+=(a.data.mix-a.mix)*r,a.softness+=(a.data.softness-a.softness)*r,a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch}return}let o=0,h=0,d=me.search(l,i,6),u=this.curves[d/6];switch(u){case 0:let f=l[d];o=l[d+1],h=l[d+2];let m=(i-f)/(l[d+6]-f);o+=(l[d+6+1]-o)*m,h+=(l[d+6+2]-h)*m;break;case 1:o=l[d+1],h=l[d+2];break;default:o=this.getBezierValue(i,d,1,u-2),h=this.getBezierValue(i,d,2,u+18-2)}c==0?(a.mix=a.data.mix+(o-a.data.mix)*r,a.softness=a.data.softness+(h-a.data.softness)*r,n==1?(a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch):(a.bendDirection=l[d+3],a.compress=l[d+4]!=0,a.stretch=l[d+5]!=0)):(a.mix+=(o-a.mix)*r,a.softness+=(h-a.softness)*r,n==0&&(a.bendDirection=l[d+3],a.compress=l[d+4]!=0,a.stretch=l[d+5]!=0))}},ai=class extends Ee{constructor(e,t,i){super(e,t,[ce.transformConstraint+"|"+i]);this.transformConstraintIndex=i}getFrameEntries(){return 7}setFrame(e,t,i,s,r,c,n,a){let l=this.frames;e*=7,l[e]=t,l[e+1]=i,l[e+2]=s,l[e+3]=r,l[e+4]=c,l[e+5]=n,l[e+6]=a}apply(e,t,i,s,r,c,n){let a=e.transformConstraints[this.transformConstraintIndex];if(!a.active)return;let l=this.frames;if(i<l[0]){let v=a.data;switch(c){case 0:a.mixRotate=v.mixRotate,a.mixX=v.mixX,a.mixY=v.mixY,a.mixScaleX=v.mixScaleX,a.mixScaleY=v.mixScaleY,a.mixShearY=v.mixShearY;return;case 1:a.mixRotate+=(v.mixRotate-a.mixRotate)*r,a.mixX+=(v.mixX-a.mixX)*r,a.mixY+=(v.mixY-a.mixY)*r,a.mixScaleX+=(v.mixScaleX-a.mixScaleX)*r,a.mixScaleY+=(v.mixScaleY-a.mixScaleY)*r,a.mixShearY+=(v.mixShearY-a.mixShearY)*r}return}let o,h,d,u,f,m,x=me.search(l,i,7),w=this.curves[x/7];switch(w){case 0:let v=l[x];o=l[x+1],h=l[x+2],d=l[x+3],u=l[x+4],f=l[x+5],m=l[x+6];let g=(i-v)/(l[x+7]-v);o+=(l[x+7+1]-o)*g,h+=(l[x+7+2]-h)*g,d+=(l[x+7+3]-d)*g,u+=(l[x+7+4]-u)*g,f+=(l[x+7+5]-f)*g,m+=(l[x+7+6]-m)*g;break;case 1:o=l[x+1],h=l[x+2],d=l[x+3],u=l[x+4],f=l[x+5],m=l[x+6];break;default:o=this.getBezierValue(i,x,1,w-2),h=this.getBezierValue(i,x,2,w+18-2),d=this.getBezierValue(i,x,3,w+18*2-2),u=this.getBezierValue(i,x,4,w+18*3-2),f=this.getBezierValue(i,x,5,w+18*4-2),m=this.getBezierValue(i,x,6,w+18*5-2)}if(c==0){let v=a.data;a.mixRotate=v.mixRotate+(o-v.mixRotate)*r,a.mixX=v.mixX+(h-v.mixX)*r,a.mixY=v.mixY+(d-v.mixY)*r,a.mixScaleX=v.mixScaleX+(u-v.mixScaleX)*r,a.mixScaleY=v.mixScaleY+(f-v.mixScaleY)*r,a.mixShearY=v.mixShearY+(m-v.mixShearY)*r}else a.mixRotate+=(o-a.mixRotate)*r,a.mixX+=(h-a.mixX)*r,a.mixY+=(d-a.mixY)*r,a.mixScaleX+=(u-a.mixScaleX)*r,a.mixScaleY+=(f-a.mixScaleY)*r,a.mixShearY+=(m-a.mixShearY)*r}},ni=class extends Fe{constructor(e,t,i){super(e,t,ce.pathConstraintPosition+"|"+i);this.pathConstraintIndex=i}apply(e,t,i,s,r,c,n){let a=e.pathConstraints[this.pathConstraintIndex];if(!a.active)return;let l=this.frames;if(i<l[0]){switch(c){case 0:a.position=a.data.position;return;case 1:a.position+=(a.data.position-a.position)*r}return}let o=this.getCurveValue(i);c==0?a.position=a.data.position+(o-a.data.position)*r:a.position+=(o-a.position)*r}},li=class extends Fe{constructor(e,t,i){super(e,t,ce.pathConstraintSpacing+"|"+i);this.pathConstraintIndex=0,this.pathConstraintIndex=i}apply(e,t,i,s,r,c,n){let a=e.pathConstraints[this.pathConstraintIndex];if(!a.active)return;let l=this.frames;if(i<l[0]){switch(c){case 0:a.spacing=a.data.spacing;return;case 1:a.spacing+=(a.data.spacing-a.spacing)*r}return}let o=this.getCurveValue(i);c==0?a.spacing=a.data.spacing+(o-a.data.spacing)*r:a.spacing+=(o-a.spacing)*r}},oi=class extends Ee{constructor(e,t,i){super(e,t,[ce.pathConstraintMix+"|"+i]);this.pathConstraintIndex=0,this.pathConstraintIndex=i}getFrameEntries(){return 4}setFrame(e,t,i,s,r){let c=this.frames;e<<=2,c[e]=t,c[e+1]=i,c[e+2]=s,c[e+3]=r}apply(e,t,i,s,r,c,n){let a=e.pathConstraints[this.pathConstraintIndex];if(!a.active)return;let l=this.frames;if(i<l[0]){switch(c){case 0:a.mixRotate=a.data.mixRotate,a.mixX=a.data.mixX,a.mixY=a.data.mixY;return;case 1:a.mixRotate+=(a.data.mixRotate-a.mixRotate)*r,a.mixX+=(a.data.mixX-a.mixX)*r,a.mixY+=(a.data.mixY-a.mixY)*r}return}let o,h,d,u=me.search(l,i,4),f=this.curves[u>>2];switch(f){case 0:let m=l[u];o=l[u+1],h=l[u+2],d=l[u+3];let x=(i-m)/(l[u+4]-m);o+=(l[u+4+1]-o)*x,h+=(l[u+4+2]-h)*x,d+=(l[u+4+3]-d)*x;break;case 1:o=l[u+1],h=l[u+2],d=l[u+3];break;default:o=this.getBezierValue(i,u,1,f-2),h=this.getBezierValue(i,u,2,f+18-2),d=this.getBezierValue(i,u,3,f+18*2-2)}if(c==0){let m=a.data;a.mixRotate=m.mixRotate+(o-m.mixRotate)*r,a.mixX=m.mixX+(h-m.mixX)*r,a.mixY=m.mixY+(d-m.mixY)*r}else a.mixRotate+=(o-a.mixRotate)*r,a.mixX+=(h-a.mixX)*r,a.mixY+=(d-a.mixY)*r}},_e=class extends me{constructor(e,t,i){super(e,[ce.sequence+"|"+t+"|"+i.sequence.id]);this.slotIndex=t,this.attachment=i}getFrameEntries(){return _e.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(e,t,i,s,r){let c=this.frames;e*=_e.ENTRIES,c[e]=t,c[e+_e.MODE]=i|s<<4,c[e+_e.DELAY]=r}apply(e,t,i,s,r,c,n){let a=e.slots[this.slotIndex];if(!a.bone.active)return;let l=a.attachment,o=this.attachment;if(l!=o&&(!(l instanceof Re)||l.timelineAttahment!=o))return;let h=this.frames;if(i<h[0]){(c==0||c==1)&&(a.sequenceIndex=-1);return}let d=me.search(h,i,_e.ENTRIES),u=h[d],f=h[d+_e.MODE],m=h[d+_e.DELAY],x=f>>4,w=this.attachment.sequence.regions.length,v=_i[f&15];if(v!=Ve.hold)switch(x+=(i-u)/m+1e-5|0,v){case Ve.once:x=Math.min(w-1,x);break;case Ve.loop:x%=w;break;case Ve.pingpong:let g=(w<<1)-2;x%=g,x>=w&&(x=g-x);break;case Ve.onceReverse:x=Math.max(w-1-x,0);break;case Ve.loopReverse:x=w-1-x%w}a.sequenceIndex=x}},st=_e;st.ENTRIES=3,st.MODE=1,st.DELAY=2;var hi=class{constructor(e){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Zi(this),this.propertyIDs=new Vt,this.animationsChanged=!1,this.trackEntryPool=new ut(()=>new ji),this.data=e}static emptyAnimation(){return fi||(fi=new yt("<empty>",[],0)),fi}update(e){e*=this.timeScale;let t=this.tracks;for(let i=0,s=t.length;i<s;i++){let r=t[i];if(!r)continue;r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;let c=e*r.timeScale;if(r.delay>0){if(r.delay-=c,r.delay>0)continue;c=-r.delay,r.delay=0}let n=r.next;if(n){let a=r.trackLast-n.delay;if(a>=0){for(n.delay=0,n.trackTime+=r.timeScale==0?0:(a/r.timeScale+e)*n.timeScale,r.trackTime+=c,this.setCurrent(i,n,!0);n.mixingFrom;)n.mixTime+=e,n=n.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[i]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let a=r.mixingFrom;for(r.mixingFrom=null,a&&(a.mixingTo=null);a;)this.queue.end(a),a=a.mixingFrom}r.trackTime+=c}this.queue.drain()}updateMixingFrom(e,t){let i=e.mixingFrom;if(!i)return!0;let s=this.updateMixingFrom(i,t);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,e.mixTime>0&&e.mixTime>=e.mixDuration?((i.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=i.mixingFrom,i.mixingFrom&&(i.mixingFrom.mixingTo=e),e.interruptAlpha=i.interruptAlpha,this.queue.end(i)),s):(i.trackTime+=t*i.timeScale,e.mixTime+=t,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let t=this.events,i=this.tracks,s=!1;for(let d=0,u=i.length;d<u;d++){let f=i[d];if(!f||f.delay>0)continue;s=!0;let m=d==0?fe.first:f.mixBlend,x=f.alpha;f.mixingFrom?x*=this.applyMixingFrom(f,e,m):f.trackTime>=f.trackEnd&&!f.next&&(x=0);let w=f.animationLast,v=f.getAnimationTime(),g=v,b=t;f.reverse&&(g=f.animation.duration-g,b=null);let p=f.animation.timelines,y=p.length;if(d==0&&x==1||m==fe.add)for(let T=0;T<y;T++){D.webkit602BugfixHelper(x,m);var r=p[T];r instanceof Je?this.applyAttachmentTimeline(r,e,g,m,!0):r.apply(e,w,g,b,x,m,Ne.mixIn)}else{let T=f.timelineMode,A=f.timelinesRotation.length!=y<<1;A&&(f.timelinesRotation.length=y<<1);for(let Y=0;Y<y;Y++){let k=p[Y],R=T[Y]==St?m:fe.setup;k instanceof mt?this.applyRotateTimeline(k,e,g,x,R,f.timelinesRotation,Y<<1,A):k instanceof Je?this.applyAttachmentTimeline(k,e,g,m,!0):(D.webkit602BugfixHelper(x,m),k.apply(e,w,g,b,x,R,Ne.mixIn))}}this.queueEvents(f,v),t.length=0,f.nextAnimationLast=v,f.nextTrackLast=f.trackTime}for(var c=this.unkeyedState+ui,n=e.slots,a=0,l=e.slots.length;a<l;a++){var o=n[a];if(o.attachmentState==c){var h=o.data.attachmentName;o.setAttachment(h?e.getAttachment(o.data.index,h):null)}}return this.unkeyedState+=2,this.queue.drain(),s}applyMixingFrom(e,t,i){let s=e.mixingFrom;s.mixingFrom&&this.applyMixingFrom(s,t,i);let r=0;e.mixDuration==0?(r=1,i==fe.first&&(i=fe.setup)):(r=e.mixTime/e.mixDuration,r>1&&(r=1),i!=fe.first&&(i=s.mixBlend));let c=r<s.attachmentThreshold,n=r<s.drawOrderThreshold,a=s.animation.timelines,l=a.length,o=s.alpha*e.interruptAlpha,h=o*(1-r),d=s.animationLast,u=s.getAnimationTime(),f=u,m=null;if(s.reverse?f=s.animation.duration-f:r<s.eventThreshold&&(m=this.events),i==fe.add)for(let x=0;x<l;x++)a[x].apply(t,d,f,m,h,i,Ne.mixOut);else{let x=s.timelineMode,w=s.timelineHoldMix,v=s.timelinesRotation.length!=l<<1;v&&(s.timelinesRotation.length=l<<1),s.totalAlpha=0;for(let g=0;g<l;g++){let b=a[g],p=Ne.mixOut,y,T=0;switch(x[g]){case St:if(!n&&b instanceof Ke)continue;y=i,T=h;break;case ci:y=fe.setup,T=h;break;case di:y=i,T=o;break;case Ct:y=fe.setup,T=o;break;default:y=fe.setup;let A=w[g];T=o*Math.max(0,1-A.mixTime/A.mixDuration);break}s.totalAlpha+=T,b instanceof mt?this.applyRotateTimeline(b,t,f,T,y,s.timelinesRotation,g<<1,v):b instanceof Je?this.applyAttachmentTimeline(b,t,f,y,c):(D.webkit602BugfixHelper(T,i),n&&b instanceof Ke&&y==fe.setup&&(p=Ne.mixIn),b.apply(t,d,f,m,T,y,p))}}return e.mixDuration>0&&this.queueEvents(s,u),this.events.length=0,s.nextAnimationLast=u,s.nextTrackLast=s.trackTime,r}applyAttachmentTimeline(e,t,i,s,r){var c=t.slots[e.slotIndex];!c.bone.active||(i<e.frames[0]?(s==fe.setup||s==fe.first)&&this.setAttachment(t,c,c.data.attachmentName,r):this.setAttachment(t,c,e.attachmentNames[me.search1(e.frames,i)],r),c.attachmentState<=this.unkeyedState&&(c.attachmentState=this.unkeyedState+ui))}setAttachment(e,t,i,s){t.setAttachment(i?e.getAttachment(t.data.index,i):null),s&&(t.attachmentState=this.unkeyedState+Ki)}applyRotateTimeline(e,t,i,s,r,c,n,a){if(a&&(c[n]=0),s==1){e.apply(t,0,i,null,1,r,Ne.mixIn);return}let l=t.bones[e.boneIndex];if(!l.active)return;let o=e.frames,h=0,d=0;if(i<o[0])switch(r){case fe.setup:l.rotation=l.data.rotation;default:return;case fe.first:h=l.rotation,d=l.data.rotation}else h=r==fe.setup?l.data.rotation:l.rotation,d=l.data.rotation+e.getCurveValue(i);let u=0,f=d-h;if(f-=(16384-(16384.499999999996-f/360|0))*360,f==0)u=c[n];else{let m=0,x=0;a?(m=0,x=f):(m=c[n],x=c[n+1]);let w=f>0,v=m>=0;F.signum(x)!=F.signum(f)&&Math.abs(x)<=90&&(Math.abs(m)>180&&(m+=360*F.signum(m)),v=w),u=f+m-m%360,v!=w&&(u+=360*F.signum(m)),c[n]=u}c[n+1]=f,l.rotation=h+u*s}queueEvents(e,t){let i=e.animationStart,s=e.animationEnd,r=s-i,c=e.trackLast%r,n=this.events,a=0,l=n.length;for(;a<l;a++){let h=n[a];if(h.time<c)break;h.time>s||this.queue.event(e,h)}let o=!1;for(e.loop?o=r==0||c>e.trackTime%r:o=t>=s&&e.animationLast<s,o&&this.queue.complete(e);a<l;a++){let h=n[a];h.time<i||this.queue.event(e,h)}}clearTracks(){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,i=this.tracks.length;t<i;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=e,this.queue.drain()}clearTrack(e){if(e>=this.tracks.length)return;let t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let i=t;for(;;){let s=i.mixingFrom;if(!s)break;this.queue.end(s),i.mixingFrom=null,i.mixingTo=null,i=s}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(e,t,i){let s=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,s&&(i&&this.queue.interrupt(s),t.mixingFrom=s,s.mixingTo=t,t.mixTime=0,s.mixingFrom&&s.mixDuration>0&&(t.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,i=!1){let s=this.data.skeletonData.findAnimation(t);if(!s)throw new Error("Animation not found: "+t);return this.setAnimationWith(e,s,i)}setAnimationWith(e,t,i=!1){if(!t)throw new Error("animation cannot be null.");let s=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast==-1?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,s=!1):this.clearNext(r));let c=this.trackEntry(e,t,i,r);return this.setCurrent(e,c,s),this.queue.drain(),c}addAnimation(e,t,i=!1,s=0){let r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);return this.addAnimationWith(e,r,i,s)}addAnimationWith(e,t,i=!1,s=0){if(!t)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;let c=this.trackEntry(e,t,i,r);return r?(r.next=c,c.previous=r,s<=0&&(s+=r.getTrackComplete()-c.mixDuration)):(this.setCurrent(e,c,!0),this.queue.drain()),c.delay=s,c}setEmptyAnimation(e,t=0){let i=this.setAnimationWith(e,hi.emptyAnimation(),!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){let s=this.addAnimationWith(e,hi.emptyAnimation(),!1,i);return i<=0&&(s.delay+=s.mixDuration-t),s.mixDuration=t,s.trackEnd=t,s}setEmptyAnimations(e=0){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let i=0,s=this.tracks.length;i<s;i++){let r=this.tracks[i];r&&this.setEmptyAnimation(r.trackIndex,e)}this.queue.drainDisabled=t,this.queue.drain()}expandToIndex(e){return e<this.tracks.length?this.tracks[e]:(D.ensureArrayCapacity(this.tracks,e+1,null),this.tracks.length=e+1,null)}trackEntry(e,t,i,s){let r=this.trackEntryPool.obtain();return r.trackIndex=e,r.animation=t,r.loop=i,r.holdPrevious=!1,r.eventThreshold=0,r.attachmentThreshold=0,r.drawOrderThreshold=0,r.animationStart=0,r.animationEnd=t.duration,r.animationLast=-1,r.nextAnimationLast=-1,r.delay=0,r.trackTime=0,r.trackLast=-1,r.nextTrackLast=-1,r.trackEnd=Number.MAX_VALUE,r.timeScale=1,r.alpha=1,r.interruptAlpha=1,r.mixTime=0,r.mixDuration=s?this.data.getMix(s.animation,t):0,r.mixBlend=fe.replace,r}clearNext(e){let t=e.next;for(;t;)this.queue.dispose(t),t=t.next;e.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let e=this.tracks;for(let t=0,i=e.length;t<i;t++){let s=e[t];if(!!s){for(;s.mixingFrom;)s=s.mixingFrom;do(!s.mixingTo||s.mixBlend!=fe.add)&&this.computeHold(s),s=s.mixingTo;while(s)}}}computeHold(e){let t=e.mixingTo,i=e.animation.timelines,s=e.animation.timelines.length,r=e.timelineMode;r.length=s;let c=e.timelineHoldMix;c.length=0;let n=this.propertyIDs;if(t&&t.holdPrevious){for(let a=0;a<s;a++)r[a]=n.addAll(i[a].getPropertyIds())?Ct:di;return}e:for(let a=0;a<s;a++){let l=i[a],o=l.getPropertyIds();if(!n.addAll(o))r[a]=St;else if(!t||l instanceof Je||l instanceof Ke||l instanceof gt||!t.animation.hasTimeline(o))r[a]=ci;else{for(let h=t.mixingTo;h;h=h.mixingTo)if(!h.animation.hasTimeline(o)){if(e.mixDuration>0){r[a]=Ji,c[a]=h;continue e}break}r[a]=Ct}}}getCurrent(e){return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){let t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},ji=class{constructor(){this.mixBlend=fe.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){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}getAnimationTime(){if(this.loop){let e=this.animationEnd-this.animationStart;return e==0?this.animationStart:this.trackTime%e+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let e=this.animationEnd-this.animationStart;if(e!=0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime<e)return e}return this.trackTime}},Zi=class{constructor(e){this.objects=[],this.drainDisabled=!1,this.animState=e}start(e){this.objects.push(Se.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(Se.interrupt),this.objects.push(e)}end(e){this.objects.push(Se.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(Se.dispose),this.objects.push(e)}complete(e){this.objects.push(Se.complete),this.objects.push(e)}event(e,t){this.objects.push(Se.event),this.objects.push(e),this.objects.push(t)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects,t=this.animState.listeners;for(let i=0;i<e.length;i+=2){let s=e[i],r=e[i+1];switch(s){case Se.start:r.listener&&r.listener.start&&r.listener.start(r);for(let n=0;n<t.length;n++)t[n].start&&t[n].start(r);break;case Se.interrupt:r.listener&&r.listener.interrupt&&r.listener.interrupt(r);for(let n=0;n<t.length;n++)t[n].interrupt&&t[n].interrupt(r);break;case Se.end:r.listener&&r.listener.end&&r.listener.end(r);for(let n=0;n<t.length;n++)t[n].end&&t[n].end(r);case Se.dispose:r.listener&&r.listener.dispose&&r.listener.dispose(r);for(let n=0;n<t.length;n++)t[n].dispose&&t[n].dispose(r);this.animState.trackEntryPool.free(r);break;case Se.complete:r.listener&&r.listener.complete&&r.listener.complete(r);for(let n=0;n<t.length;n++)t[n].complete&&t[n].complete(r);break;case Se.event:let c=e[i+++2];r.listener&&r.listener.event&&r.listener.event(r,c);for(let n=0;n<t.length;n++)t[n].event&&t[n].event(r,c);break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},Se;(function(e){e[e.start=0]="start",e[e.interrupt=1]="interrupt",e[e.end=2]="end",e[e.dispose=3]="dispose",e[e.complete=4]="complete",e[e.event=5]="event"})(Se||(Se={}));var Es=class{start(e){}interrupt(e){}end(e){}dispose(e){}complete(e){}event(e,t){}},St=0,ci=1,di=2,Ct=3,Ji=4,ui=1,Ki=2,fi=null,Fs=class{constructor(e){if(this.animationToMixTime={},this.defaultMix=0,!e)throw new Error("skeletonData cannot be null.");this.skeletonData=e}setMix(e,t,i){let s=this.skeletonData.findAnimation(e);if(!s)throw new Error("Animation not found: "+e);let r=this.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);this.setMixWith(s,r,i)}setMixWith(e,t,i){if(!e)throw new Error("from cannot be null.");if(!t)throw new Error("to cannot be null.");let s=e.name+"."+t.name;this.animationToMixTime[s]=i}getMix(e,t){let i=e.name+"."+t.name,s=this.animationToMixTime[i];return s===void 0?this.defaultMix:s}},Tt=class extends Re{constructor(e){super(e);this.color=new V(1,1,1,1)}copy(){let e=new Tt(this.name);return this.copyTo(e),e.color.setFromColor(this.color),e}},xt=class extends Re{constructor(e){super(e);this.color=new V(.2275,.2275,.8078,1)}copy(){let e=new xt(this.name);return this.copyTo(e),e.endSlot=this.endSlot,e.color.setFromColor(this.color),e}},mi=class{constructor(e){this._image=e}getImage(){return this._image}},Ie;(function(e){e[e.Nearest=9728]="Nearest",e[e.Linear=9729]="Linear",e[e.MipMap=9987]="MipMap",e[e.MipMapNearestNearest=9984]="MipMapNearestNearest",e[e.MipMapLinearNearest=9985]="MipMapLinearNearest",e[e.MipMapNearestLinear=9986]="MipMapNearestLinear",e[e.MipMapLinearLinear=9987]="MipMapLinearLinear"})(Ie||(Ie={}));var Qe;(function(e){e[e.MirroredRepeat=33648]="MirroredRepeat",e[e.ClampToEdge=33071]="ClampToEdge",e[e.Repeat=10497]="Repeat"})(Qe||(Qe={}));var Qi=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},Xs=class extends mi{setFilters(e,t){}setWraps(e,t){}dispose(){}},$i=class{constructor(e){this.pages=new Array,this.regions=new Array;let t=new Ls(e),i=new Array(4),s=null,r=null,c={};c.size=()=>{s.width=parseInt(i[1]),s.height=parseInt(i[2])},c.format=()=>{},c.filter=()=>{s.minFilter=D.enumValue(Ie,i[1]),s.magFilter=D.enumValue(Ie,i[2])},c.repeat=()=>{i[1].indexOf("x")!=-1&&(s.uWrap=Qe.Repeat),i[1].indexOf("y")!=-1&&(s.vWrap=Qe.Repeat)},c.pma=()=>{s.pma=i[1]=="true"};var n={};n.xy=()=>{r.x=parseInt(i[1]),r.y=parseInt(i[2])},n.size=()=>{r.width=parseInt(i[1]),r.height=parseInt(i[2])},n.bounds=()=>{r.x=parseInt(i[1]),r.y=parseInt(i[2]),r.width=parseInt(i[3]),r.height=parseInt(i[4])},n.offset=()=>{r.offsetX=parseInt(i[1]),r.offsetY=parseInt(i[2])},n.orig=()=>{r.originalWidth=parseInt(i[1]),r.originalHeight=parseInt(i[2])},n.offsets=()=>{r.offsetX=parseInt(i[1]),r.offsetY=parseInt(i[2]),r.originalWidth=parseInt(i[3]),r.originalHeight=parseInt(i[4])},n.rotate=()=>{let h=i[1];h=="true"?r.degrees=90:h!="false"&&(r.degrees=parseInt(h))},n.index=()=>{r.index=parseInt(i[1])};let a=t.readLine();for(;a&&a.trim().length==0;)a=t.readLine();for(;!(!a||a.trim().length==0||t.readEntry(i,a)==0);)a=t.readLine();let l=null,o=null;for(;a!==null;)if(a.trim().length==0)s=null,a=t.readLine();else if(s){for(r=new gi,r.page=s,r.name=a;;){let h=t.readEntry(i,a=t.readLine());if(h==0)break;let d=n[i[0]];if(d)d();else{l||(l=[],o=[]),l.push(i[0]);let u=[];for(let f=0;f<h;f++)u.push(parseInt(i[f+1]));o.push(u)}}r.originalWidth==0&&r.originalHeight==0&&(r.originalWidth=r.width,r.originalHeight=r.height),l&&l.length>0&&(r.names=l,r.values=o,l=null,o=null),r.u=r.x/s.width,r.v=r.y/s.height,r.degrees==90?(r.u2=(r.x+r.height)/s.width,r.v2=(r.y+r.width)/s.height):(r.u2=(r.x+r.width)/s.width,r.v2=(r.y+r.height)/s.height),this.regions.push(r)}else{for(s=new es,s.name=a.trim();t.readEntry(i,a=t.readLine())!=0;){let h=c[i[0]];h&&h()}this.pages.push(s)}}findRegion(e){for(let t=0;t<this.regions.length;t++)if(this.regions[t].name==e)return this.regions[t];return null}setTextures(e,t=""){for(let i of this.pages)i.setTexture(e.get(t+i.name))}dispose(){for(let e=0;e<this.pages.length;e++)this.pages[e].texture.dispose()}},Ls=class{constructor(e){this.index=0,this.lines=e.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length==0))return 0;let i=t.indexOf(":");if(i==-1)return 0;e[0]=t.substr(0,i).trim();for(let s=1,r=i+1;;s++){let c=t.indexOf(",",r);if(c==-1)return e[s]=t.substr(r).trim(),s;if(e[s]=t.substr(r,c-r).trim(),r=c+1,s==4)return 4}}},es=class{constructor(){this.minFilter=Ie.Nearest,this.magFilter=Ie.Nearest,this.uWrap=Qe.ClampToEdge,this.vWrap=Qe.ClampToEdge}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap)}},gi=class extends Qi{},Ge=class extends Re{constructor(e){super(e);this.color=new V(1,1,1,1),this.tempColor=new V(0,0,0,0)}updateRegion(){let e=this.regionUVs;(!this.uvs||this.uvs.length!=e.length)&&(this.uvs=D.newFloatArray(e.length));let t=this.uvs,i=this.uvs.length,s=this.region.u,r=this.region.v,c=0,n=0;if(this.region instanceof gi){let a=this.region,l=a.page.texture.getImage(),o=l.width,h=l.height;switch(a.degrees){case 90:s-=(a.originalHeight-a.offsetY-a.height)/o,r-=(a.originalWidth-a.offsetX-a.width)/h,c=a.originalHeight/o,n=a.originalWidth/h;for(let d=0;d<i;d+=2)t[d]=s+e[d+1]*c,t[d+1]=r+(1-e[d])*n;return;case 180:s-=(a.originalWidth-a.offsetX-a.width)/o,r-=a.offsetY/h,c=a.originalWidth/o,n=a.originalHeight/h;for(let d=0;d<i;d+=2)t[d]=s+(1-e[d])*c,t[d+1]=r+(1-e[d+1])*n;return;case 270:s-=a.offsetY/o,r-=a.offsetX/h,c=a.originalHeight/o,n=a.originalWidth/h;for(let d=0;d<i;d+=2)t[d]=s+(1-e[d+1])*c,t[d+1]=r+e[d]*n;return}s-=a.offsetX/o,r-=(a.originalHeight-a.offsetY-a.height)/h,c=a.originalWidth/o,n=a.originalHeight/h}else this.region?(c=this.region.u2-s,n=this.region.v2-r):(s=r=0,c=n=1);for(let a=0;a<i;a+=2)t[a]=s+e[a]*c,t[a+1]=r+e[a+1]*n}getParentMesh(){return this.parentMesh}setParentMesh(e){this.parentMesh=e,e&&(this.bones=e.bones,this.vertices=e.vertices,this.worldVerticesLength=e.worldVerticesLength,this.regionUVs=e.regionUVs,this.triangles=e.triangles,this.hullLength=e.hullLength,this.worldVerticesLength=e.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let e=new Ge(this.name);return e.region=this.region,e.path=this.path,e.color.setFromColor(this.color),this.copyTo(e),e.regionUVs=new Array(this.regionUVs.length),D.arrayCopy(this.regionUVs,0,e.regionUVs,0,this.regionUVs.length),e.uvs=new Array(this.uvs.length),D.arrayCopy(this.uvs,0,e.uvs,0,this.uvs.length),e.triangles=new Array(this.triangles.length),D.arrayCopy(this.triangles,0,e.triangles,0,this.triangles.length),e.hullLength=this.hullLength,e.sequence=this.sequence.copy(),this.edges&&(e.edges=new Array(this.edges.length),D.arrayCopy(this.edges,0,e.edges,0,this.edges.length)),e.width=this.width,e.height=this.height,e}computeWorldVertices(e,t,i,s,r,c){this.sequence!=null&&this.sequence.apply(e,this),super.computeWorldVertices(e,t,i,s,r,c)}newLinkedMesh(){let e=new Ge(this.name);return e.region=this.region,e.path=this.path,e.color.setFromColor(this.color),e.timelineAttahment=this.timelineAttahment,e.setParentMesh(this.parentMesh?this.parentMesh:this),e.region!=null&&e.updateRegion(),e}},$e=class extends Re{constructor(e){super(e);this.closed=!1,this.constantSpeed=!1,this.color=new V(1,1,1,1)}copy(){let e=new $e(this.name);return this.copyTo(e),e.lengths=new Array(this.lengths.length),D.arrayCopy(this.lengths,0,e.lengths,0,this.lengths.length),e.closed=closed,e.constantSpeed=this.constantSpeed,e.color.setFromColor(this.color),e}},xi=class extends Re{constructor(e){super(e);this.color=new V(.38,.94,0,1)}computeWorldPosition(e,t){return t.x=this.x*e.a+this.y*e.b+e.worldX,t.y=this.x*e.c+this.y*e.d+e.worldY,t}computeWorldRotation(e){let t=F.cosDeg(this.rotation),i=F.sinDeg(this.rotation),s=t*e.a+i*e.b,r=t*e.c+i*e.d;return Math.atan2(r,s)*F.radDeg}copy(){let e=new xi(this.name);return e.x=this.x,e.y=this.y,e.rotation=this.rotation,e.color.setFromColor(this.color),e}},ts=class extends Ut{constructor(e){super(e);this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new V(1,1,1,1),this.offset=D.newFloatArray(8),this.uvs=D.newFloatArray(8),this.tempColor=new V(1,1,1,1)}updateRegion(){let e=this.region,t=this.width/this.region.originalWidth*this.scaleX,i=this.height/this.region.originalHeight*this.scaleY,s=-this.width/2*this.scaleX+this.region.offsetX*t,r=-this.height/2*this.scaleY+this.region.offsetY*i,c=s+this.region.width*t,n=r+this.region.height*i,a=this.rotation*Math.PI/180,l=Math.cos(a),o=Math.sin(a),h=this.x,d=this.y,u=s*l+h,f=s*o,m=r*l+d,x=r*o,w=c*l+h,v=c*o,g=n*l+d,b=n*o,p=this.offset;p[0]=u-x,p[1]=m+f,p[2]=u-b,p[3]=g+f,p[4]=w-b,p[5]=g+v,p[6]=w-x,p[7]=m+v;let y=this.uvs;e.degrees==90?(y[2]=e.u,y[3]=e.v2,y[4]=e.u,y[5]=e.v,y[6]=e.u2,y[7]=e.v,y[0]=e.u2,y[1]=e.v2):(y[0]=e.u,y[1]=e.v2,y[2]=e.u,y[3]=e.v,y[4]=e.u2,y[5]=e.v,y[6]=e.u2,y[7]=e.v2)}computeWorldVertices(e,t,i,s){this.sequence!=null&&this.sequence.apply(e,this);let r=e.bone,c=this.offset,n=r.worldX,a=r.worldY,l=r.a,o=r.b,h=r.c,d=r.d,u=0,f=0;u=c[0],f=c[1],t[i]=u*l+f*o+n,t[i+1]=u*h+f*d+a,i+=s,u=c[2],f=c[3],t[i]=u*l+f*o+n,t[i+1]=u*h+f*d+a,i+=s,u=c[4],f=c[5],t[i]=u*l+f*o+n,t[i+1]=u*h+f*d+a,i+=s,u=c[6],f=c[7],t[i]=u*l+f*o+n,t[i+1]=u*h+f*d+a}copy(){let e=new ts(this.name);return e.region=this.region,e.rendererObject=this.rendererObject,e.path=this.path,e.x=this.x,e.y=this.y,e.scaleX=this.scaleX,e.scaleY=this.scaleY,e.rotation=this.rotation,e.width=this.width,e.height=this.height,D.arrayCopy(this.uvs,0,e.uvs,0,8),D.arrayCopy(this.offset,0,e.offset,0,8),e.color.setFromColor(this.color),e.sequence=this.sequence.copy(),e}},ne=ts;ne.X1=0,ne.Y1=1,ne.C1R=2,ne.C1G=3,ne.C1B=4,ne.C1A=5,ne.U1=6,ne.V1=7,ne.X2=8,ne.Y2=9,ne.C2R=10,ne.C2G=11,ne.C2B=12,ne.C2A=13,ne.U2=14,ne.V2=15,ne.X3=16,ne.Y3=17,ne.C3R=18,ne.C3G=19,ne.C3B=20,ne.C3A=21,ne.U3=22,ne.V3=23,ne.X4=24,ne.Y4=25,ne.C4R=26,ne.C4G=27,ne.C4B=28,ne.C4A=29,ne.U4=30,ne.V4=31;var Bs=class{constructor(e){this.atlas=e}loadSequence(e,t,i){let s=i.regions;for(let r=0,c=s.length;r<c;r++){let n=i.getPath(t,r);if(s[r]=this.atlas.findRegion(n),s[r].renderObject=s[r],s[r]==null)throw new Error("Region not found in atlas: "+n+" (sequence: "+e+")")}}newRegionAttachment(e,t,i,s){let r=new ne(t);if(s!=null)this.loadSequence(t,i,s);else{let c=this.atlas.findRegion(i);if(!c)throw new Error("Region not found in atlas: "+i+" (region attachment: "+t+")");c.renderObject=c,r.region=c}return r}newMeshAttachment(e,t,i,s){let r=new Ge(t);if(s!=null)this.loadSequence(t,i,s);else{let c=this.atlas.findRegion(i);if(!c)throw new Error("Region not found in atlas: "+i+" (mesh attachment: "+t+")");c.renderObject=c,r.region=c}return r}newBoundingBoxAttachment(e,t){return new Tt(t)}newPathAttachment(e,t){return new $e(t)}newPointAttachment(e,t){return new xi(t)}newClippingAttachment(e,t){return new xt(t)}},bi=class{constructor(e,t,i){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=Ce.Normal,this.skinRequired=!1,this.color=new V,e<0)throw new Error("index must be >= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=i}},Ce;(function(e){e[e.Normal=0]="Normal",e[e.OnlyTranslation=1]="OnlyTranslation",e[e.NoRotationOrReflection=2]="NoRotationOrReflection",e[e.NoScale=3]="NoScale",e[e.NoScaleOrReflection=4]="NoScaleOrReflection"})(Ce||(Ce={}));var pi=class{constructor(e,t,i){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=t,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,t,i,s,r,c,n){this.ax=e,this.ay=t,this.arotation=i,this.ascaleX=s,this.ascaleY=r,this.ashearX=c,this.ashearY=n;let a=this.parent;if(!a){let u=this.skeleton,f=i+90+n,m=u.scaleX,x=u.scaleY;this.a=F.cosDeg(i+c)*s*m,this.b=F.cosDeg(f)*r*m,this.c=F.sinDeg(i+c)*s*x,this.d=F.sinDeg(f)*r*x,this.worldX=e*m+u.x,this.worldY=t*x+u.y;return}let l=a.a,o=a.b,h=a.c,d=a.d;switch(this.worldX=l*e+o*t+a.worldX,this.worldY=h*e+d*t+a.worldY,this.data.transformMode){case Ce.Normal:{let u=i+90+n,f=F.cosDeg(i+c)*s,m=F.cosDeg(u)*r,x=F.sinDeg(i+c)*s,w=F.sinDeg(u)*r;this.a=l*f+o*x,this.b=l*m+o*w,this.c=h*f+d*x,this.d=h*m+d*w;return}case Ce.OnlyTranslation:{let u=i+90+n;this.a=F.cosDeg(i+c)*s,this.b=F.cosDeg(u)*r,this.c=F.sinDeg(i+c)*s,this.d=F.sinDeg(u)*r;break}case Ce.NoRotationOrReflection:{let u=l*l+h*h,f=0;u>1e-4?(u=Math.abs(l*d-o*h)/u,l/=this.skeleton.scaleX,h/=this.skeleton.scaleY,o=h*u,d=l*u,f=Math.atan2(h,l)*F.radDeg):(l=0,h=0,f=90-Math.atan2(d,o)*F.radDeg);let m=i+c-f,x=i+n-f+90,w=F.cosDeg(m)*s,v=F.cosDeg(x)*r,g=F.sinDeg(m)*s,b=F.sinDeg(x)*r;this.a=l*w-o*g,this.b=l*v-o*b,this.c=h*w+d*g,this.d=h*v+d*b;break}case Ce.NoScale:case Ce.NoScaleOrReflection:{let u=F.cosDeg(i),f=F.sinDeg(i),m=(l*u+o*f)/this.skeleton.scaleX,x=(h*u+d*f)/this.skeleton.scaleY,w=Math.sqrt(m*m+x*x);w>1e-5&&(w=1/w),m*=w,x*=w,w=Math.sqrt(m*m+x*x),this.data.transformMode==Ce.NoScale&&l*d-o*h<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(w=-w);let v=Math.PI/2+Math.atan2(x,m),g=Math.cos(v)*w,b=Math.sin(v)*w,p=F.cosDeg(c)*s,y=F.cosDeg(90+n)*r,T=F.sinDeg(c)*s,A=F.sinDeg(90+n)*r;this.a=m*p+g*T,this.b=m*y+g*A,this.c=x*p+b*T,this.d=x*y+b*A;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let e=this.data;this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY}getWorldRotationX(){return Math.atan2(this.c,this.a)*F.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*F.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){let e=this.parent;if(!e){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*F.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,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*F.radDeg;return}let t=e.a,i=e.b,s=e.c,r=e.d,c=1/(t*r-i*s),n=this.worldX-e.worldX,a=this.worldY-e.worldY;this.ax=n*r*c-a*i*c,this.ay=a*t*c-n*s*c;let l=c*r,o=c*t,h=c*i,d=c*s,u=l*this.a-h*this.c,f=l*this.b-h*this.d,m=o*this.c-d*this.a,x=o*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(u*u+m*m),this.ascaleX>1e-4){let w=u*x-f*m;this.ascaleY=w/this.ascaleX,this.ashearY=Math.atan2(u*f+m*x,w)*F.radDeg,this.arotation=Math.atan2(m,u)*F.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(f*f+x*x),this.ashearY=0,this.arotation=90-Math.atan2(x,f)*F.radDeg}worldToLocal(e){let t=1/(this.a*this.d-this.b*this.c),i=e.x-this.worldX,s=e.y-this.worldY;return e.x=i*this.d*t-s*this.b*t,e.y=s*this.a*t-i*this.c*t,e}localToWorld(e){let t=e.x,i=e.y;return e.x=t*this.a+i*this.b+this.worldX,e.y=t*this.c+i*this.d+this.worldY,e}worldToLocalRotation(e){let t=F.sinDeg(e),i=F.cosDeg(e);return Math.atan2(this.a*t-this.c*i,this.d*i-this.b*t)*F.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=F.sinDeg(e),i=F.cosDeg(e);return Math.atan2(i*this.c+t*this.d,i*this.a+t*this.b)*F.radDeg}rotateWorld(e){let t=this.a,i=this.b,s=this.c,r=this.d,c=F.cosDeg(e),n=F.sinDeg(e);this.a=c*t-n*s,this.b=c*i-n*r,this.c=n*t+c*s,this.d=n*i+c*r}},It=class{constructor(e,t,i){this.name=e,this.order=t,this.skinRequired=i}},is=class{constructor(e,t="",i=null){this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=e,this.pathPrefix=t,this.downloader=i||new ss}start(e){return this.toLoad++,this.pathPrefix+e}success(e,t,i){this.toLoad--,this.loaded++,this.assets[t]=i,e&&e(t,i)}error(e,t,i){this.toLoad--,this.loaded++,this.errors[t]=i,e&&e(t,i)}setRawDataURI(e,t){this.downloader.rawDataUris[this.pathPrefix+e]=t}loadBinary(e,t=null,i=null){e=this.start(e),this.downloader.downloadBinary(e,s=>{this.success(t,e,s)},(s,r)=>{this.error(i,e,`Couldn't load binary ${e}: status ${s}, ${r}`)})}loadText(e,t=null,i=null){e=this.start(e),this.downloader.downloadText(e,s=>{this.success(t,e,s)},(s,r)=>{this.error(i,e,`Couldn't load text ${e}: status ${s}, ${r}`)})}loadJson(e,t=null,i=null){e=this.start(e),this.downloader.downloadJson(e,s=>{this.success(t,e,s)},(s,r)=>{this.error(i,e,`Couldn't load JSON ${e}: status ${s}, ${r}`)})}loadTexture(e,t=null,i=null){if(e=this.start(e),!!!(typeof window!="undefined"&&typeof navigator!="undefined"&&window.document))fetch(e,{mode:"cors"}).then(c=>c.ok?c.blob():(this.error(i,e,`Couldn't load image: ${e}`),null)).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{c&&this.success(t,e,this.textureLoader(c))});else{let c=new Image;c.crossOrigin="anonymous",c.onload=()=>{this.success(t,e,this.textureLoader(c))},c.onerror=()=>{this.error(i,e,`Couldn't load image: ${e}`)},this.downloader.rawDataUris[e]&&(e=this.downloader.rawDataUris[e]),c.src=e}}loadTextureAtlas(e,t=null,i=null){let s=e.lastIndexOf("/"),r=s>=0?e.substring(0,s+1):"";e=this.start(e),this.downloader.downloadText(e,c=>{try{let n=new $i(c),a=n.pages.length,l=!1;for(let o of n.pages)this.loadTexture(r+o.name,(h,d)=>{l||(o.setTexture(d),--a==0&&this.success(t,e,n))},(h,d)=>{l||this.error(i,e,`Couldn't load texture atlas ${e} page image: ${h}`),l=!0})}catch(n){this.error(i,e,`Couldn't parse texture atlas ${e}: ${n.message}`)}},(c,n)=>{this.error(i,e,`Couldn't load texture atlas ${e}: status ${c}, ${n}`)})}get(e){return this.assets[this.pathPrefix+e]}require(e){e=this.pathPrefix+e;let t=this.assets[e];if(t)return t;let i=this.errors[e];throw Error("Asset not found: "+e+(i?`
2
+ `+i:""))}remove(e){e=this.pathPrefix+e;let t=this.assets[e];return t.dispose&&t.dispose(),delete this.assets[e],t}removeAll(){for(let e in this.assets){let t=this.assets[e];t.dispose&&t.dispose()}this.assets={}}isLoadingComplete(){return this.toLoad==0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},ss=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");return t!=-1?(t+="base64,".length,atob(e.substr(t))):e.substr(e.indexOf(",")+1)}base64ToUint8Array(e){for(var t=window.atob(e),i=t.length,s=new Uint8Array(i),r=0;r<i;r++)s[r]=t.charCodeAt(r);return s}dataUriToUint8Array(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");if(t==-1)throw new Error("Not a binary data URI.");return t+="base64,".length,this.base64ToUint8Array(e.substr(t))}downloadText(e,t,i){if(this.start(e,t,i))return;if(this.rawDataUris[e]){try{let c=this.rawDataUris[e];this.finish(e,200,this.dataUriToString(c))}catch(c){this.finish(e,400,JSON.stringify(c))}return}let s=new XMLHttpRequest;s.overrideMimeType("text/html"),s.open("GET",e,!0);let r=()=>{this.finish(e,s.status,s.responseText)};s.onload=r,s.onerror=r,s.send()}downloadJson(e,t,i){this.downloadText(e,s=>{t(JSON.parse(s))},i)}downloadBinary(e,t,i){if(this.start(e,t,i))return;if(this.rawDataUris[e]){try{let c=this.rawDataUris[e];this.finish(e,200,this.dataUriToUint8Array(c))}catch(c){this.finish(e,400,JSON.stringify(c))}return}let s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="arraybuffer";let r=()=>{this.finish(e,s.status,s.response)};s.onload=()=>{s.status==200?this.finish(e,200,new Uint8Array(s.response)):r()},s.onerror=r,s.send()}start(e,t,i){let s=this.callbacks[e];try{if(s)return!0;this.callbacks[e]=s=[]}finally{s.push(t,i)}}finish(e,t,i){let s=this.callbacks[e];delete this.callbacks[e];let r=t==200?[i]:[t,i];for(let c=r.length-1,n=s.length;c<n;c+=2)s[c].apply(null,r)}},wi=class{constructor(e,t){if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},vi=class{constructor(e){this.name=e}},rs=class{constructor(e,t){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch,this.bones=new Array;for(let i=0;i<e.bones.length;i++)this.bones.push(t.findBone(e.bones[i].name));this.target=t.findBone(e.target.name)}isActive(){return this.active}update(){if(this.mix==0)return;let e=this.target,t=this.bones;switch(t.length){case 1:this.apply1(t[0],e.worldX,e.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(t[0],t[1],e.worldX,e.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(e,t,i,s,r,c,n){let a=e.parent,l=a.a,o=a.b,h=a.c,d=a.d,u=-e.ashearX-e.arotation,f=0,m=0;switch(e.data.transformMode){case Ce.OnlyTranslation:f=t-e.worldX,m=i-e.worldY;break;case Ce.NoRotationOrReflection:let v=Math.abs(l*d-o*h)/(l*l+h*h),g=l/e.skeleton.scaleX,b=h/e.skeleton.scaleY;o=-b*v*e.skeleton.scaleX,d=g*v*e.skeleton.scaleY,u+=Math.atan2(b,g)*F.radDeg;default:let p=t-a.worldX,y=i-a.worldY,T=l*d-o*h;f=(p*d-y*o)/T-e.ax,m=(y*l-p*h)/T-e.ay}u+=Math.atan2(m,f)*F.radDeg,e.ascaleX<0&&(u+=180),u>180?u-=360:u<-180&&(u+=360);let x=e.ascaleX,w=e.ascaleY;if(s||r){switch(e.data.transformMode){case Ce.NoScale:case Ce.NoScaleOrReflection:f=t-e.worldX,m=i-e.worldY}let v=e.data.length*x,g=Math.sqrt(f*f+m*m);if(s&&g<v||r&&g>v&&v>1e-4){let b=(g/v-1)*n+1;x*=b,c&&(w*=b)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+u*n,x,w,e.ashearX,e.ashearY)}apply2(e,t,i,s,r,c,n,a,l){let o=e.ax,h=e.ay,d=e.ascaleX,u=e.ascaleY,f=d,m=u,x=t.ascaleX,w=0,v=0,g=0;d<0?(d=-d,w=180,g=-1):(w=0,g=1),u<0&&(u=-u,g=-g),x<0?(x=-x,v=180):v=0;let b=t.ax,p=0,y=0,T=0,A=e.a,Y=e.b,k=e.c,R=e.d,P=Math.abs(d-u)<=1e-4;!P||c?(p=0,y=A*b+e.worldX,T=k*b+e.worldY):(p=t.ay,y=A*b+Y*p+e.worldX,T=k*b+R*p+e.worldY);let X=e.parent;A=X.a,Y=X.b,k=X.c,R=X.d;let B=1/(A*R-Y*k),C=y-X.worldX,I=T-X.worldY,O=(C*R-I*Y)*B-o,E=(I*A-C*k)*B-h,L=Math.sqrt(O*O+E*E),se=t.data.length*x,re,he;if(L<1e-4){this.apply1(e,i,s,!1,c,!1,l),t.updateWorldTransformWith(b,p,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}C=i-X.worldX,I=s-X.worldY;let ae=(C*R-I*Y)*B-o,ie=(I*A-C*k)*B-h,de=ae*ae+ie*ie;if(a!=0){a*=d*(x+1)*.5;let pe=Math.sqrt(de),Ye=pe-L-se*d+a;if(Ye>0){let ke=Math.min(1,Ye/(a*2))-1;ke=(Ye-a*(1-ke*ke))/pe,ae-=ke*ae,ie-=ke*ie,de=ae*ae+ie*ie}}e:if(P){se*=d;let pe=(de-L*L-se*se)/(2*L*se);pe<-1?(pe=-1,he=Math.PI*r):pe>1?(pe=1,he=0,c&&(A=(Math.sqrt(de)/(L+se)-1)*l+1,f*=A,n&&(m*=A))):he=Math.acos(pe)*r,A=L+se*pe,Y=se*Math.sin(he),re=Math.atan2(ie*A-ae*Y,ae*A+ie*Y)}else{A=d*se,Y=u*se;let pe=A*A,Ye=Y*Y,ke=Math.atan2(ie,ae);k=Ye*L*L+pe*de-pe*Ye;let je=-2*Ye*L,ht=Ye-pe;if(R=je*je-4*ht*k,R>=0){let ct=Math.sqrt(R);je<0&&(ct=-ct),ct=-(je+ct)*.5;let Cs=ct/ht,Ts=k/ct,dt=Math.abs(Cs)<Math.abs(Ts)?Cs:Ts;if(dt*dt<=de){I=Math.sqrt(de-dt*dt)*r,re=ke-Math.atan2(I,dt),he=Math.atan2(I/u,(dt-L)/d);break e}}let wt=F.PI,Ot=L-A,Oi=Ot*Ot,ys=0,As=0,Dt=L+A,Di=Dt*Dt,Ss=0;k=-A*L/(pe-Ye),k>=-1&&k<=1&&(k=Math.acos(k),C=A*Math.cos(k)+L,I=Y*Math.sin(k),R=C*C+I*I,R<Oi&&(wt=k,Oi=R,Ot=C,ys=I),R>Di&&(As=k,Di=R,Dt=C,Ss=I)),de<=(Oi+Di)*.5?(re=ke-Math.atan2(ys*r,Ot),he=wt*r):(re=ke-Math.atan2(Ss*r,Dt),he=As*r)}let Ae=Math.atan2(p,b)*g,Be=e.arotation;re=(re-Ae)*F.radDeg+w-Be,re>180?re-=360:re<-180&&(re+=360),e.updateWorldTransformWith(o,h,Be+re*l,f,m,0,0),Be=t.arotation,he=((he+Ae)*F.radDeg-t.ashearX)*g+v-Be,he>180?he-=360:he<-180&&(he+=360),t.updateWorldTransformWith(b,p,Be+he*l,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},yi=class extends It{constructor(e){super(e,0,!1);this.bones=new Array,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}},Ai=class extends It{constructor(e){super(e,0,!1);this.bones=new Array,this.mixRotate=0,this.mixX=0,this.mixY=0}},Pe;(function(e){e[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent"})(Pe||(Pe={}));var ge;(function(e){e[e.Length=0]="Length",e[e.Fixed=1]="Fixed",e[e.Percent=2]="Percent",e[e.Proportional=3]="Proportional"})(ge||(ge={}));var et;(function(e){e[e.Tangent=0]="Tangent",e[e.Chain=1]="Chain",e[e.ChainScale=2]="ChainScale"})(et||(et={}));var Ue=class{constructor(e,t){if(this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let i=0,s=e.bones.length;i<s;i++)this.bones.push(t.findBone(e.bones[i].name));this.target=t.findSlot(e.target.name),this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}isActive(){return this.active}update(){let e=this.target.getAttachment();if(!(e instanceof $e))return;let t=this.mixRotate,i=this.mixX,s=this.mixY;if(t==0&&i==0&&s==0)return;let r=this.data,c=r.rotateMode==et.Tangent,n=r.rotateMode==et.ChainScale,a=this.bones,l=a.length,o=c?l:l+1,h=D.setArraySize(this.spaces,o),d=n?this.lengths=D.setArraySize(this.lengths,l):null,u=this.spacing;switch(r.spacingMode){case ge.Percent:if(n)for(let p=0,y=o-1;p<y;p++){let T=a[p],A=T.data.length;if(A<Ue.epsilon)d[p]=0;else{let Y=A*T.a,k=A*T.c;d[p]=Math.sqrt(Y*Y+k*k)}}D.arrayFill(h,1,o,u);break;case ge.Proportional:let g=0;for(let p=0,y=o-1;p<y;){let T=a[p],A=T.data.length;if(A<Ue.epsilon)n&&(d[p]=0),h[++p]=u;else{let Y=A*T.a,k=A*T.c,R=Math.sqrt(Y*Y+k*k);n&&(d[p]=R),h[++p]=R,g+=R}}if(g>0){g=o/g*u;for(let p=1;p<o;p++)h[p]*=g}break;default:let b=r.spacingMode==ge.Length;for(let p=0,y=o-1;p<y;){let T=a[p],A=T.data.length;if(A<Ue.epsilon)n&&(d[p]=0),h[++p]=u;else{let Y=A*T.a,k=A*T.c,R=Math.sqrt(Y*Y+k*k);n&&(d[p]=R),h[++p]=(b?A+u:u)*R/A}}}let f=this.computeWorldPositions(e,o,c),m=f[0],x=f[1],w=r.offsetRotation,v=!1;if(w==0)v=r.rotateMode==et.Chain;else{v=!1;let g=this.target.bone;w*=g.a*g.d-g.b*g.c>0?F.degRad:-F.degRad}for(let g=0,b=3;g<l;g++,b+=3){let p=a[g];p.worldX+=(m-p.worldX)*i,p.worldY+=(x-p.worldY)*s;let y=f[b],T=f[b+1],A=y-m,Y=T-x;if(n){let k=d[g];if(k!=0){let R=(Math.sqrt(A*A+Y*Y)/k-1)*t+1;p.a*=R,p.c*=R}}if(m=y,x=T,t>0){let k=p.a,R=p.b,P=p.c,X=p.d,B=0,C=0,I=0;if(c?B=f[b-1]:h[g+1]==0?B=f[b+2]:B=Math.atan2(Y,A),B-=Math.atan2(P,k),v){C=Math.cos(B),I=Math.sin(B);let O=p.data.length;m+=(O*(C*k-I*P)-A)*t,x+=(O*(I*k+C*P)-Y)*t}else B+=w;B>F.PI?B-=F.PI2:B<-F.PI&&(B+=F.PI2),B*=t,C=Math.cos(B),I=Math.sin(B),p.a=C*k-I*P,p.b=C*R-I*X,p.c=I*k+C*P,p.d=I*R+C*X}p.updateAppliedTransform()}}computeWorldPositions(e,t,i){let s=this.target,r=this.position,c=this.spaces,n=D.setArraySize(this.positions,t*3+2),a=null,l=e.closed,o=e.worldVerticesLength,h=o/6,d=Ue.NONE;if(!e.constantSpeed){let E=e.lengths;h-=l?1:2;let L=E[h];this.data.positionMode==Pe.Percent&&(r*=L);let se;switch(this.data.spacingMode){case ge.Percent:se=L;break;case ge.Proportional:se=L/t;break;default:se=1}a=D.setArraySize(this.world,8);for(let re=0,he=0,ae=0;re<t;re++,he+=3){let ie=c[re]*se;r+=ie;let de=r;if(l)de%=L,de<0&&(de+=L),ae=0;else if(de<0){d!=Ue.BEFORE&&(d=Ue.BEFORE,e.computeWorldVertices(s,2,4,a,0,2)),this.addBeforePosition(de,a,0,n,he);continue}else if(de>L){d!=Ue.AFTER&&(d=Ue.AFTER,e.computeWorldVertices(s,o-6,4,a,0,2)),this.addAfterPosition(de-L,a,0,n,he);continue}for(;;ae++){let Ae=E[ae];if(!(de>Ae)){if(ae==0)de/=Ae;else{let Be=E[ae-1];de=(de-Be)/(Ae-Be)}break}}ae!=d&&(d=ae,l&&ae==h?(e.computeWorldVertices(s,o-4,4,a,0,2),e.computeWorldVertices(s,0,4,a,4,2)):e.computeWorldVertices(s,ae*6+2,8,a,0,2)),this.addCurvePosition(de,a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],n,he,i||re>0&&ie==0)}return n}l?(o+=2,a=D.setArraySize(this.world,o),e.computeWorldVertices(s,2,o-4,a,0,2),e.computeWorldVertices(s,0,2,a,o-4,2),a[o-2]=a[0],a[o-1]=a[1]):(h--,o-=4,a=D.setArraySize(this.world,o),e.computeWorldVertices(s,2,o,a,0,2));let u=D.setArraySize(this.curves,h),f=0,m=a[0],x=a[1],w=0,v=0,g=0,b=0,p=0,y=0,T=0,A=0,Y=0,k=0,R=0,P=0,X=0,B=0;for(let E=0,L=2;E<h;E++,L+=6)w=a[L],v=a[L+1],g=a[L+2],b=a[L+3],p=a[L+4],y=a[L+5],T=(m-w*2+g)*.1875,A=(x-v*2+b)*.1875,Y=((w-g)*3-m+p)*.09375,k=((v-b)*3-x+y)*.09375,R=T*2+Y,P=A*2+k,X=(w-m)*.75+T+Y*.16666667,B=(v-x)*.75+A+k*.16666667,f+=Math.sqrt(X*X+B*B),X+=R,B+=P,R+=Y,P+=k,f+=Math.sqrt(X*X+B*B),X+=R,B+=P,f+=Math.sqrt(X*X+B*B),X+=R+Y,B+=P+k,f+=Math.sqrt(X*X+B*B),u[E]=f,m=p,x=y;this.data.positionMode==Pe.Percent&&(r*=f);let C;switch(this.data.spacingMode){case ge.Percent:C=f;break;case ge.Proportional:C=f/t;break;default:C=1}let I=this.segments,O=0;for(let E=0,L=0,se=0,re=0;E<t;E++,L+=3){let he=c[E]*C;r+=he;let ae=r;if(l)ae%=f,ae<0&&(ae+=f),se=0;else if(ae<0){this.addBeforePosition(ae,a,0,n,L);continue}else if(ae>f){this.addAfterPosition(ae-f,a,o-4,n,L);continue}for(;;se++){let ie=u[se];if(!(ae>ie)){if(se==0)ae/=ie;else{let de=u[se-1];ae=(ae-de)/(ie-de)}break}}if(se!=d){d=se;let ie=se*6;for(m=a[ie],x=a[ie+1],w=a[ie+2],v=a[ie+3],g=a[ie+4],b=a[ie+5],p=a[ie+6],y=a[ie+7],T=(m-w*2+g)*.03,A=(x-v*2+b)*.03,Y=((w-g)*3-m+p)*.006,k=((v-b)*3-x+y)*.006,R=T*2+Y,P=A*2+k,X=(w-m)*.3+T+Y*.16666667,B=(v-x)*.3+A+k*.16666667,O=Math.sqrt(X*X+B*B),I[0]=O,ie=1;ie<8;ie++)X+=R,B+=P,R+=Y,P+=k,O+=Math.sqrt(X*X+B*B),I[ie]=O;X+=R,B+=P,O+=Math.sqrt(X*X+B*B),I[8]=O,X+=R+Y,B+=P+k,O+=Math.sqrt(X*X+B*B),I[9]=O,re=0}for(ae*=O;;re++){let ie=I[re];if(!(ae>ie)){if(re==0)ae/=ie;else{let de=I[re-1];ae=re+(ae-de)/(ie-de)}break}}this.addCurvePosition(ae*.1,m,x,w,v,g,b,p,y,n,L,i||E>0&&he==0)}return n}addBeforePosition(e,t,i,s,r){let c=t[i],n=t[i+1],a=t[i+2]-c,l=t[i+3]-n,o=Math.atan2(l,a);s[r]=c+e*Math.cos(o),s[r+1]=n+e*Math.sin(o),s[r+2]=o}addAfterPosition(e,t,i,s,r){let c=t[i+2],n=t[i+3],a=c-t[i],l=n-t[i+1],o=Math.atan2(l,a);s[r]=c+e*Math.cos(o),s[r+1]=n+e*Math.sin(o),s[r+2]=o}addCurvePosition(e,t,i,s,r,c,n,a,l,o,h,d){if(e==0||isNaN(e)){o[h]=t,o[h+1]=i,o[h+2]=Math.atan2(r-i,s-t);return}let u=e*e,f=u*e,m=1-e,x=m*m,w=x*m,v=m*e,g=v*3,b=m*g,p=g*e,y=t*w+s*b+c*p+a*f,T=i*w+r*b+n*p+l*f;o[h]=y,o[h+1]=T,d&&(e<.001?o[h+2]=Math.atan2(r-i,s-t):o[h+2]=Math.atan2(T-(i*x+r*v*2+n*u),y-(t*x+s*v*2+c*u)))}},rt=Ue;rt.NONE=-1,rt.BEFORE=-2,rt.AFTER=-3,rt.epsilon=1e-5;var as=class{constructor(e,t){if(this.deform=new Array,!e)throw new Error("data cannot be null.");if(!t)throw new Error("bone cannot be null.");this.data=e,this.bone=t,this.color=new V,this.darkColor=e.darkColor?new V:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof Re)||!(this.attachment instanceof Re)||e.timelineAttahment!=this.attachment.timelineAttahment)&&(this.deform.length=0),this.attachment=e,this.sequenceIndex=-1)}setToSetupPose(){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}},ns=class{constructor(e,t){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new ft,this.active=!1,!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY,this.bones=new Array;for(let i=0;i<e.bones.length;i++)this.bones.push(t.findBone(e.bones[i].name));this.target=t.findBone(e.target.name)}isActive(){return this.active}update(){this.mixRotate==0&&this.mixX==0&&this.mixY==0&&this.mixScaleX==0&&this.mixScaleX==0&&this.mixShearY==0||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let e=this.mixRotate,t=this.mixX,i=this.mixY,s=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=t!=0||i!=0,a=this.target,l=a.a,o=a.b,h=a.c,d=a.d,u=l*d-o*h>0?F.degRad:-F.degRad,f=this.data.offsetRotation*u,m=this.data.offsetShearY*u,x=this.bones;for(let w=0,v=x.length;w<v;w++){let g=x[w];if(e!=0){let b=g.a,p=g.b,y=g.c,T=g.d,A=Math.atan2(h,l)-Math.atan2(y,b)+f;A>F.PI?A-=F.PI2:A<-F.PI&&(A+=F.PI2),A*=e;let Y=Math.cos(A),k=Math.sin(A);g.a=Y*b-k*y,g.b=Y*p-k*T,g.c=k*b+Y*y,g.d=k*p+Y*T}if(n){let b=this.temp;a.localToWorld(b.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(b.x-g.worldX)*t,g.worldY+=(b.y-g.worldY)*i}if(s!=0){let b=Math.sqrt(g.a*g.a+g.c*g.c);b!=0&&(b=(b+(Math.sqrt(l*l+h*h)-b+this.data.offsetScaleX)*s)/b),g.a*=b,g.c*=b}if(r!=0){let b=Math.sqrt(g.b*g.b+g.d*g.d);b!=0&&(b=(b+(Math.sqrt(o*o+d*d)-b+this.data.offsetScaleY)*r)/b),g.b*=b,g.d*=b}if(c>0){let b=g.b,p=g.d,y=Math.atan2(p,b),T=Math.atan2(d,o)-Math.atan2(h,l)-(y-Math.atan2(g.c,g.a));T>F.PI?T-=F.PI2:T<-F.PI&&(T+=F.PI2),T=y+(T+m)*c;let A=Math.sqrt(b*b+p*p);g.b=Math.cos(T)*A,g.d=Math.sin(T)*A}g.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,i=this.mixY,s=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=t!=0||i!=0,a=this.target,l=a.a,o=a.b,h=a.c,d=a.d,u=l*d-o*h>0?F.degRad:-F.degRad,f=this.data.offsetRotation*u,m=this.data.offsetShearY*u,x=this.bones;for(let w=0,v=x.length;w<v;w++){let g=x[w];if(e!=0){let b=g.a,p=g.b,y=g.c,T=g.d,A=Math.atan2(h,l)+f;A>F.PI?A-=F.PI2:A<-F.PI&&(A+=F.PI2),A*=e;let Y=Math.cos(A),k=Math.sin(A);g.a=Y*b-k*y,g.b=Y*p-k*T,g.c=k*b+Y*y,g.d=k*p+Y*T}if(n){let b=this.temp;a.localToWorld(b.set(this.data.offsetX,this.data.offsetY)),g.worldX+=b.x*t,g.worldY+=b.y*i}if(s!=0){let b=(Math.sqrt(l*l+h*h)-1+this.data.offsetScaleX)*s+1;g.a*=b,g.c*=b}if(r!=0){let b=(Math.sqrt(o*o+d*d)-1+this.data.offsetScaleY)*r+1;g.b*=b,g.d*=b}if(c>0){let b=Math.atan2(d,o)-Math.atan2(h,l);b>F.PI?b-=F.PI2:b<-F.PI&&(b+=F.PI2);let p=g.b,y=g.d;b=Math.atan2(y,p)+(b-F.PI/2+m)*c;let T=Math.sqrt(p*p+y*y);g.b=Math.cos(b)*T,g.d=Math.sin(b)*T}g.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,i=this.mixY,s=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=this.target,a=this.bones;for(let l=0,o=a.length;l<o;l++){let h=a[l],d=h.arotation;if(e!=0){let v=n.arotation-d+this.data.offsetRotation;v-=(16384-(16384.499999999996-v/360|0))*360,d+=v*e}let u=h.ax,f=h.ay;u+=(n.ax-u+this.data.offsetX)*t,f+=(n.ay-f+this.data.offsetY)*i;let m=h.ascaleX,x=h.ascaleY;s!=0&&m!=0&&(m=(m+(n.ascaleX-m+this.data.offsetScaleX)*s)/m),r!=0&&x!=0&&(x=(x+(n.ascaleY-x+this.data.offsetScaleY)*r)/x);let w=h.ashearY;if(c!=0){let v=n.ashearY-w+this.data.offsetShearY;v-=(16384-(16384.499999999996-v/360|0))*360,w+=v*c}h.updateWorldTransformWith(u,f,d,m,x,h.ashearX,w)}}applyRelativeLocal(){let e=this.mixRotate,t=this.mixX,i=this.mixY,s=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,n=this.target,a=this.bones;for(let l=0,o=a.length;l<o;l++){let h=a[l],d=h.arotation+(n.arotation+this.data.offsetRotation)*e,u=h.ax+(n.ax+this.data.offsetX)*t,f=h.ay+(n.ay+this.data.offsetY)*i,m=h.ascaleX*((n.ascaleX-1+this.data.offsetScaleX)*s+1),x=h.ascaleY*((n.ascaleY-1+this.data.offsetScaleY)*r+1),w=h.ashearY+(n.ashearY+this.data.offsetShearY)*c;h.updateWorldTransformWith(u,f,d,m,x,h.ashearX,w)}}},Ps=class{constructor(e){if(this._updateCache=new Array,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,!e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(let t=0;t<e.bones.length;t++){let i=e.bones[t],s;if(!i.parent)s=new pi(i,this,null);else{let r=this.bones[i.parent.index];s=new pi(i,this,r),r.children.push(s)}this.bones.push(s)}this.slots=new Array,this.drawOrder=new Array;for(let t=0;t<e.slots.length;t++){let i=e.slots[t],s=this.bones[i.boneData.index],r=new as(i,s);this.slots.push(r),this.drawOrder.push(r)}this.ikConstraints=new Array;for(let t=0;t<e.ikConstraints.length;t++){let i=e.ikConstraints[t];this.ikConstraints.push(new rs(i,this))}this.transformConstraints=new Array;for(let t=0;t<e.transformConstraints.length;t++){let i=e.transformConstraints[t];this.transformConstraints.push(new ns(i,this))}this.pathConstraints=new Array;for(let t=0;t<e.pathConstraints.length;t++){let i=e.pathConstraints[t];this.pathConstraints.push(new rt(i,this))}this.color=new V(1,1,1,1),this.updateCache()}updateCache(){let e=this._updateCache;e.length=0;let t=this.bones;for(let o=0,h=t.length;o<h;o++){let d=t[o];d.sorted=d.data.skinRequired,d.active=!d.sorted}if(this.skin){let o=this.skin.bones;for(let h=0,d=this.skin.bones.length;h<d;h++){let u=this.bones[o[h].index];do u.sorted=!1,u.active=!0,u=u.parent;while(u)}}let i=this.ikConstraints,s=this.transformConstraints,r=this.pathConstraints,c=i.length,n=s.length,a=r.length,l=c+n+a;e:for(let o=0;o<l;o++){for(let h=0;h<c;h++){let d=i[h];if(d.data.order==o){this.sortIkConstraint(d);continue e}}for(let h=0;h<n;h++){let d=s[h];if(d.data.order==o){this.sortTransformConstraint(d);continue e}}for(let h=0;h<a;h++){let d=r[h];if(d.data.order==o){this.sortPathConstraint(d);continue e}}}for(let o=0,h=t.length;o<h;o++)this.sortBone(t[o])}sortIkConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&D.contains(this.skin.constraints,e.data,!0)),!e.active)return;let t=e.target;this.sortBone(t);let i=e.bones,s=i[0];if(this.sortBone(s),i.length==1)this._updateCache.push(e),this.sortReset(s.children);else{let r=i[i.length-1];this.sortBone(r),this._updateCache.push(e),this.sortReset(s.children),r.sorted=!0}}sortPathConstraint(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||this.skin&&D.contains(this.skin.constraints,e.data,!0)),!e.active)return;let t=e.target,i=t.data.index,s=t.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,i,s),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,i,s);for(let a=0,l=this.data.skins.length;a<l;a++)this.sortPathConstraintAttachment(this.data.skins[a],i,s);let r=t.getAttachment();r instanceof $e&&this.sortPathConstraintAttachmentWith(r,s);let c=e.bones,n=c.length;for(let a=0;a<n;a++)this.sortBone(c[a]);this._updateCache.push(e);for(let a=0;a<n;a++)this.sortReset(c[a].children);for(let a=0;a<n;a++)c[a].sorted=!0}sortTransformConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&D.contains(this.skin.constraints,e.data,!0)),!e.active)return;this.sortBone(e.target);let t=e.bones,i=t.length;if(e.data.local)for(let s=0;s<i;s++){let r=t[s];this.sortBone(r.parent),this.sortBone(r)}else for(let s=0;s<i;s++)this.sortBone(t[s]);this._updateCache.push(e);for(let s=0;s<i;s++)this.sortReset(t[s].children);for(let s=0;s<i;s++)t[s].sorted=!0}sortPathConstraintAttachment(e,t,i){let s=e.attachments[t];if(!!s)for(let r in s)this.sortPathConstraintAttachmentWith(s[r],i)}sortPathConstraintAttachmentWith(e,t){if(!(e instanceof $e))return;let i=e.bones;if(!i)this.sortBone(t);else{let s=this.bones;for(let r=0,c=i.length;r<c;){let n=i[r++];for(n+=r;r<n;)this.sortBone(s[i[r++]])}}}sortBone(e){if(e.sorted)return;let t=e.parent;t&&this.sortBone(t),e.sorted=!0,this._updateCache.push(e)}sortReset(e){for(let t=0,i=e.length;t<i;t++){let s=e[t];!s.active||(s.sorted&&this.sortReset(s.children),s.sorted=!1)}}updateWorldTransform(){let e=this.bones;for(let i=0,s=e.length;i<s;i++){let r=e[i];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY}let t=this._updateCache;for(let i=0,s=t.length;i<s;i++)t[i].update()}updateWorldTransformWith(e){let t=this.getRootBone(),i=e.a,s=e.b,r=e.c,c=e.d;t.worldX=i*this.x+s*this.y+e.worldX,t.worldY=r*this.x+c*this.y+e.worldY;let n=t.rotation+90+t.shearY,a=F.cosDeg(t.rotation+t.shearX)*t.scaleX,l=F.cosDeg(n)*t.scaleY,o=F.sinDeg(t.rotation+t.shearX)*t.scaleX,h=F.sinDeg(n)*t.scaleY;t.a=(i*a+s*o)*this.scaleX,t.b=(i*l+s*h)*this.scaleX,t.c=(r*a+c*o)*this.scaleY,t.d=(r*l+c*h)*this.scaleY;let d=this._updateCache;for(let u=0,f=d.length;u<f;u++){let m=d[u];m!=t&&m.update()}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){let e=this.bones;for(let r=0,c=e.length;r<c;r++)e[r].setToSetupPose();let t=this.ikConstraints;for(let r=0,c=t.length;r<c;r++){let n=t[r];n.mix=n.data.mix,n.softness=n.data.softness,n.bendDirection=n.data.bendDirection,n.compress=n.data.compress,n.stretch=n.data.stretch}let i=this.transformConstraints;for(let r=0,c=i.length;r<c;r++){let n=i[r],a=n.data;n.mixRotate=a.mixRotate,n.mixX=a.mixX,n.mixY=a.mixY,n.mixScaleX=a.mixScaleX,n.mixScaleY=a.mixScaleY,n.mixShearY=a.mixShearY}let s=this.pathConstraints;for(let r=0,c=s.length;r<c;r++){let n=s[r],a=n.data;n.position=a.position,n.spacing=a.spacing,n.mixRotate=a.mixRotate,n.mixX=a.mixX,n.mixY=a.mixY}}setSlotsToSetupPose(){let e=this.slots;D.arrayCopy(e,0,this.drawOrder,0,e.length);for(let t=0,i=e.length;t<i;t++)e[t].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(e){if(!e)throw new Error("boneName cannot be null.");let t=this.bones;for(let i=0,s=t.length;i<s;i++){let r=t[i];if(r.data.name==e)return r}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let t=this.slots;for(let i=0,s=t.length;i<s;i++){let r=t[i];if(r.data.name==e)return r}return null}setSkinByName(e){let t=this.data.findSkin(e);if(!t)throw new Error("Skin not found: "+e);this.setSkin(t)}setSkin(e){if(e!=this.skin){if(e)if(this.skin)e.attachAll(this,this.skin);else{let t=this.slots;for(let i=0,s=t.length;i<s;i++){let r=t[i],c=r.data.attachmentName;if(c){let n=e.getAttachment(i,c);n&&r.setAttachment(n)}}}this.skin=e,this.updateCache()}}getAttachmentByName(e,t){return this.getAttachment(this.data.findSlot(e).index,t)}getAttachment(e,t){if(!t)throw new Error("attachmentName cannot be null.");if(this.skin){let i=this.skin.getAttachment(e,t);if(i)return i}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(e,t):null}setAttachment(e,t){if(!e)throw new Error("slotName cannot be null.");let i=this.slots;for(let s=0,r=i.length;s<r;s++){let c=i[s];if(c.data.name==e){let n=null;if(t&&(n=this.getAttachment(s,t),!n))throw new Error("Attachment not found: "+t+", for slot: "+e);c.setAttachment(n);return}}throw new Error("Slot not found: "+e)}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let t=this.ikConstraints;for(let i=0,s=t.length;i<s;i++){let r=t[i];if(r.data.name==e)return r}return null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let t=this.transformConstraints;for(let i=0,s=t.length;i<s;i++){let r=t[i];if(r.data.name==e)return r}return null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let t=this.pathConstraints;for(let i=0,s=t.length;i<s;i++){let r=t[i];if(r.data.name==e)return r}return null}getBounds(e,t,i=new Array(2)){if(!e)throw new Error("offset cannot be null.");if(!t)throw new Error("size cannot be null.");let s=this.drawOrder,r=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let l=0,o=s.length;l<o;l++){let h=s[l];if(!h.bone.active)continue;let d=0,u=null,f=h.getAttachment();if(f instanceof ne)d=8,u=D.setArraySize(i,d,0),f.computeWorldVertices(h,u,0,2);else if(f instanceof Ge){let m=f;d=m.worldVerticesLength,u=D.setArraySize(i,d,0),m.computeWorldVertices(h,0,d,u,0,2)}if(u)for(let m=0,x=u.length;m<x;m+=2){let w=u[m],v=u[m+1];r=Math.min(r,w),c=Math.min(c,v),n=Math.max(n,w),a=Math.max(a,v)}}e.set(r,c),t.set(n-r,a-c)}},Si=class{constructor(){this.bones=new Array,this.slots=new Array,this.skins=new Array,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.fps=0}findBone(e){if(!e)throw new Error("boneName cannot be null.");let t=this.bones;for(let i=0,s=t.length;i<s;i++){let r=t[i];if(r.name==e)return r}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let t=this.slots;for(let i=0,s=t.length;i<s;i++){let r=t[i];if(r.name==e)return r}return null}findSkin(e){if(!e)throw new Error("skinName cannot be null.");let t=this.skins;for(let i=0,s=t.length;i<s;i++){let r=t[i];if(r.name==e)return r}return null}findEvent(e){if(!e)throw new Error("eventDataName cannot be null.");let t=this.events;for(let i=0,s=t.length;i<s;i++){let r=t[i];if(r.name==e)return r}return null}findAnimation(e){if(!e)throw new Error("animationName cannot be null.");let t=this.animations;for(let i=0,s=t.length;i<s;i++){let r=t[i];if(r.name==e)return r}return null}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let t=this.ikConstraints;for(let i=0,s=t.length;i<s;i++){let r=t[i];if(r.name==e)return r}return null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let t=this.transformConstraints;for(let i=0,s=t.length;i<s;i++){let r=t[i];if(r.name==e)return r}return null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let t=this.pathConstraints;for(let i=0,s=t.length;i<s;i++){let r=t[i];if(r.name==e)return r}return null}},Ci=class{constructor(e,t,i){this.slotIndex=e,this.name=t,this.attachment=i}},Mt=class{constructor(e){if(this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!e)throw new Error("name cannot be null.");this.name=e}setAttachment(e,t,i){if(!i)throw new Error("attachment cannot be null.");let s=this.attachments;e>=s.length&&(s.length=e+1),s[e]||(s[e]={}),s[e][t]=i}addSkin(e){for(let s=0;s<e.bones.length;s++){let r=e.bones[s],c=!1;for(let n=0;n<this.bones.length;n++)if(this.bones[n]==r){c=!0;break}c||this.bones.push(r)}for(let s=0;s<e.constraints.length;s++){let r=e.constraints[s],c=!1;for(let n=0;n<this.constraints.length;n++)if(this.constraints[n]==r){c=!0;break}c||this.constraints.push(r)}let t=e.getAttachments();for(let s=0;s<t.length;s++){var i=t[s];this.setAttachment(i.slotIndex,i.name,i.attachment)}}copySkin(e){for(let s=0;s<e.bones.length;s++){let r=e.bones[s],c=!1;for(let n=0;n<this.bones.length;n++)if(this.bones[n]==r){c=!0;break}c||this.bones.push(r)}for(let s=0;s<e.constraints.length;s++){let r=e.constraints[s],c=!1;for(let n=0;n<this.constraints.length;n++)if(this.constraints[n]==r){c=!0;break}c||this.constraints.push(r)}let t=e.getAttachments();for(let s=0;s<t.length;s++){var i=t[s];!i.attachment||(i.attachment instanceof Ge?(i.attachment=i.attachment.newLinkedMesh(),this.setAttachment(i.slotIndex,i.name,i.attachment)):(i.attachment=i.attachment.copy(),this.setAttachment(i.slotIndex,i.name,i.attachment)))}}getAttachment(e,t){let i=this.attachments[e];return i?i[t]:null}removeAttachment(e,t){let i=this.attachments[e];i&&(i[t]=null)}getAttachments(){let e=new Array;for(var t=0;t<this.attachments.length;t++){let i=this.attachments[t];if(i)for(let s in i){let r=i[s];r&&e.push(new Ci(t,s,r))}}return e}getAttachmentsForSlot(e,t){let i=this.attachments[e];if(i)for(let s in i){let r=i[s];r&&t.push(new Ci(e,s,r))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(e,t){let i=0;for(let s=0;s<e.slots.length;s++){let r=e.slots[s],c=r.getAttachment();if(c&&i<t.attachments.length){let n=t.attachments[i];for(let a in n){let l=n[a];if(c==l){let o=this.getAttachment(i,a);o&&r.setAttachment(o);break}}}i++}}},Ti=class{constructor(e,t,i){if(this.color=new V(1,1,1,1),e<0)throw new Error("index must be >= 0.");if(!t)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=i}},we;(function(e){e[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen"})(we||(we={}));var Ii=class extends It{constructor(e){super(e,0,!1);this.bones=new Array,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}},Os=class{constructor(e){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,i=new Si;i.name="";let s=new ls(e),r=s.readInt32(),c=s.readInt32();i.hash=c==0&&r==0?null:c.toString(16)+r.toString(16),i.version=s.readString(),i.x=s.readFloat(),i.y=s.readFloat(),i.width=s.readFloat(),i.height=s.readFloat();let n=s.readBoolean();n&&(i.fps=s.readFloat(),i.imagesPath=s.readString(),i.audioPath=s.readString());let a=0;a=s.readInt(!0);for(let o=0;o<a;o++)s.strings.push(s.readString());a=s.readInt(!0);for(let o=0;o<a;o++){let h=s.readString(),d=o==0?null:i.bones[s.readInt(!0)],u=new bi(o,h,d);u.rotation=s.readFloat(),u.x=s.readFloat()*t,u.y=s.readFloat()*t,u.scaleX=s.readFloat(),u.scaleY=s.readFloat(),u.shearX=s.readFloat(),u.shearY=s.readFloat(),u.length=s.readFloat()*t,u.transformMode=s.readInt(!0),u.skinRequired=s.readBoolean(),n&&V.rgba8888ToColor(u.color,s.readInt32()),i.bones.push(u)}a=s.readInt(!0);for(let o=0;o<a;o++){let h=s.readString(),d=i.bones[s.readInt(!0)],u=new Ti(o,h,d);V.rgba8888ToColor(u.color,s.readInt32());let f=s.readInt32();f!=-1&&V.rgb888ToColor(u.darkColor=new V,f),u.attachmentName=s.readStringRef(),u.blendMode=s.readInt(!0),i.slots.push(u)}a=s.readInt(!0);for(let o=0,h;o<a;o++){let d=new yi(s.readString());d.order=s.readInt(!0),d.skinRequired=s.readBoolean(),h=s.readInt(!0);for(let u=0;u<h;u++)d.bones.push(i.bones[s.readInt(!0)]);d.target=i.bones[s.readInt(!0)],d.mix=s.readFloat(),d.softness=s.readFloat()*t,d.bendDirection=s.readByte(),d.compress=s.readBoolean(),d.stretch=s.readBoolean(),d.uniform=s.readBoolean(),i.ikConstraints.push(d)}a=s.readInt(!0);for(let o=0,h;o<a;o++){let d=new Ii(s.readString());d.order=s.readInt(!0),d.skinRequired=s.readBoolean(),h=s.readInt(!0);for(let u=0;u<h;u++)d.bones.push(i.bones[s.readInt(!0)]);d.target=i.bones[s.readInt(!0)],d.local=s.readBoolean(),d.relative=s.readBoolean(),d.offsetRotation=s.readFloat(),d.offsetX=s.readFloat()*t,d.offsetY=s.readFloat()*t,d.offsetScaleX=s.readFloat(),d.offsetScaleY=s.readFloat(),d.offsetShearY=s.readFloat(),d.mixRotate=s.readFloat(),d.mixX=s.readFloat(),d.mixY=s.readFloat(),d.mixScaleX=s.readFloat(),d.mixScaleY=s.readFloat(),d.mixShearY=s.readFloat(),i.transformConstraints.push(d)}a=s.readInt(!0);for(let o=0,h;o<a;o++){let d=new Ai(s.readString());d.order=s.readInt(!0),d.skinRequired=s.readBoolean(),h=s.readInt(!0);for(let u=0;u<h;u++)d.bones.push(i.bones[s.readInt(!0)]);d.target=i.slots[s.readInt(!0)],d.positionMode=s.readInt(!0),d.spacingMode=s.readInt(!0),d.rotateMode=s.readInt(!0),d.offsetRotation=s.readFloat(),d.position=s.readFloat(),d.positionMode==Pe.Fixed&&(d.position*=t),d.spacing=s.readFloat(),(d.spacingMode==ge.Length||d.spacingMode==ge.Fixed)&&(d.spacing*=t),d.mixRotate=s.readFloat(),d.mixX=s.readFloat(),d.mixY=s.readFloat(),i.pathConstraints.push(d)}let l=this.readSkin(s,i,!0,n);l&&(i.defaultSkin=l,i.skins.push(l));{let o=i.skins.length;for(D.setArraySize(i.skins,a=o+s.readInt(!0));o<a;o++)i.skins[o]=this.readSkin(s,i,!1,n)}a=this.linkedMeshes.length;for(let o=0;o<a;o++){let h=this.linkedMeshes[o],u=(h.skin?i.findSkin(h.skin):i.defaultSkin).getAttachment(h.slotIndex,h.parent);h.mesh.timelineAttahment=h.inheritTimeline?u:h.mesh,h.mesh.setParentMesh(u),h.mesh.region!=null&&h.mesh.updateRegion()}this.linkedMeshes.length=0,a=s.readInt(!0);for(let o=0;o<a;o++){let h=new vi(s.readStringRef());h.intValue=s.readInt(!1),h.floatValue=s.readFloat(),h.stringValue=s.readString(),h.audioPath=s.readString(),h.audioPath&&(h.volume=s.readFloat(),h.balance=s.readFloat()),i.events.push(h)}a=s.readInt(!0);for(let o=0;o<a;o++)i.animations.push(this.readAnimation(s,s.readString(),i));return i}readSkin(e,t,i,s){let r=null,c=0;if(i){if(c=e.readInt(!0),c==0)return null;r=new Mt("default")}else{r=new Mt(e.readStringRef()),r.bones.length=e.readInt(!0);for(let n=0,a=r.bones.length;n<a;n++)r.bones[n]=t.bones[e.readInt(!0)];for(let n=0,a=e.readInt(!0);n<a;n++)r.constraints.push(t.ikConstraints[e.readInt(!0)]);for(let n=0,a=e.readInt(!0);n<a;n++)r.constraints.push(t.transformConstraints[e.readInt(!0)]);for(let n=0,a=e.readInt(!0);n<a;n++)r.constraints.push(t.pathConstraints[e.readInt(!0)]);c=e.readInt(!0)}for(let n=0;n<c;n++){let a=e.readInt(!0);for(let l=0,o=e.readInt(!0);l<o;l++){let h=e.readStringRef(),d=this.readAttachment(e,t,r,a,h,s);d&&r.setAttachment(a,h,d)}}return r}readAttachment(e,t,i,s,r,c){let n=this.scale,a=e.readStringRef();switch(a||(a=r),e.readByte()){case ze.Region:{let l=e.readStringRef(),o=e.readFloat(),h=e.readFloat(),d=e.readFloat(),u=e.readFloat(),f=e.readFloat(),m=e.readFloat(),x=e.readFloat(),w=e.readInt32(),v=this.readSequence(e);l||(l=a);let g=this.attachmentLoader.newRegionAttachment(i,a,l,v);return g?(g.path=l,g.x=h*n,g.y=d*n,g.scaleX=u,g.scaleY=f,g.rotation=o,g.width=m*n,g.height=x*n,V.rgba8888ToColor(g.color,w),g.sequence=v,v==null&&g.updateRegion(),g):null}case ze.BoundingBox:{let l=e.readInt(!0),o=this.readVertices(e,l),h=c?e.readInt32():0,d=this.attachmentLoader.newBoundingBoxAttachment(i,a);return d?(d.worldVerticesLength=l<<1,d.vertices=o.vertices,d.bones=o.bones,c&&V.rgba8888ToColor(d.color,h),d):null}case ze.Mesh:{let l=e.readStringRef(),o=e.readInt32(),h=e.readInt(!0),d=this.readFloatArray(e,h<<1,1),u=this.readShortArray(e),f=this.readVertices(e,h),m=e.readInt(!0),x=this.readSequence(e),w=null,v=0,g=0;c&&(w=this.readShortArray(e),v=e.readFloat(),g=e.readFloat()),l||(l=a);let b=this.attachmentLoader.newMeshAttachment(i,a,l,x);return b?(b.path=l,V.rgba8888ToColor(b.color,o),b.bones=f.bones,b.vertices=f.vertices,b.worldVerticesLength=h<<1,b.triangles=u,b.regionUVs=d,x==null&&b.updateRegion(),b.hullLength=m<<1,b.sequence=x,c&&(b.edges=w,b.width=v*n,b.height=g*n),b):null}case ze.LinkedMesh:{let l=e.readStringRef(),o=e.readInt32(),h=e.readStringRef(),d=e.readStringRef(),u=e.readBoolean(),f=this.readSequence(e),m=0,x=0;c&&(m=e.readFloat(),x=e.readFloat()),l||(l=a);let w=this.attachmentLoader.newMeshAttachment(i,a,l,f);return w?(w.path=l,V.rgba8888ToColor(w.color,o),w.sequence=f,c&&(w.width=m*n,w.height=x*n),this.linkedMeshes.push(new Ds(w,h,s,d,u)),w):null}case ze.Path:{let l=e.readBoolean(),o=e.readBoolean(),h=e.readInt(!0),d=this.readVertices(e,h),u=D.newArray(h/3,0);for(let x=0,w=u.length;x<w;x++)u[x]=e.readFloat()*n;let f=c?e.readInt32():0,m=this.attachmentLoader.newPathAttachment(i,a);return m?(m.closed=l,m.constantSpeed=o,m.worldVerticesLength=h<<1,m.vertices=d.vertices,m.bones=d.bones,m.lengths=u,c&&V.rgba8888ToColor(m.color,f),m):null}case ze.Point:{let l=e.readFloat(),o=e.readFloat(),h=e.readFloat(),d=c?e.readInt32():0,u=this.attachmentLoader.newPointAttachment(i,a);return u?(u.x=o*n,u.y=h*n,u.rotation=l,c&&V.rgba8888ToColor(u.color,d),u):null}case ze.Clipping:{let l=e.readInt(!0),o=e.readInt(!0),h=this.readVertices(e,o),d=c?e.readInt32():0,u=this.attachmentLoader.newClippingAttachment(i,a);return u?(u.endSlot=t.slots[l],u.worldVerticesLength=o<<1,u.vertices=h.vertices,u.bones=h.bones,c&&V.rgba8888ToColor(u.color,d),u):null}}return null}readSequence(e){if(!e.readBoolean())return null;let t=new zt(e.readInt(!0));return t.start=e.readInt(!0),t.digits=e.readInt(!0),t.setupIndex=e.readInt(!0),t}readVertices(e,t){let i=this.scale,s=t<<1,r=new Vs;if(!e.readBoolean())return r.vertices=this.readFloatArray(e,s,i),r;let c=new Array,n=new Array;for(let a=0;a<t;a++){let l=e.readInt(!0);n.push(l);for(let o=0;o<l;o++)n.push(e.readInt(!0)),c.push(e.readFloat()*i),c.push(e.readFloat()*i),c.push(e.readFloat())}return r.vertices=D.toFloatArray(c),r.bones=n,r}readFloatArray(e,t,i){let s=new Array(t);if(i==1)for(let r=0;r<t;r++)s[r]=e.readFloat();else for(let r=0;r<t;r++)s[r]=e.readFloat()*i;return s}readShortArray(e){let t=e.readInt(!0),i=new Array(t);for(let s=0;s<t;s++)i[s]=e.readShort();return i}readAnimation(e,t,i){e.readInt(!0);let s=new Array,r=this.scale,c=new V,n=new V;for(let h=0,d=e.readInt(!0);h<d;h++){let u=e.readInt(!0);for(let f=0,m=e.readInt(!0);f<m;f++){let x=e.readByte(),w=e.readInt(!0),v=w-1;switch(x){case Js:{let g=new Je(w,u);for(let b=0;b<w;b++)g.setFrame(b,e.readFloat(),e.readStringRef());s.push(g);break}case Ks:{let g=e.readInt(!0),b=new Qt(w,g,u),p=e.readFloat(),y=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255;for(let k=0,R=0;b.setFrame(k,p,y,T,A,Y),k!=v;k++){let P=e.readFloat(),X=e.readUnsignedByte()/255,B=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255;switch(e.readByte()){case Xe:b.setStepped(k);break;case Le:le(e,b,R++,k,0,p,P,y,X,1),le(e,b,R++,k,1,p,P,T,B,1),le(e,b,R++,k,2,p,P,A,C,1),le(e,b,R++,k,3,p,P,Y,I,1)}p=P,y=X,T=B,A=C,Y=I}s.push(b);break}case Qs:{let g=e.readInt(!0),b=new $t(w,g,u),p=e.readFloat(),y=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255;for(let Y=0,k=0;b.setFrame(Y,p,y,T,A),Y!=v;Y++){let R=e.readFloat(),P=e.readUnsignedByte()/255,X=e.readUnsignedByte()/255,B=e.readUnsignedByte()/255;switch(e.readByte()){case Xe:b.setStepped(Y);break;case Le:le(e,b,k++,Y,0,p,R,y,P,1),le(e,b,k++,Y,1,p,R,T,X,1),le(e,b,k++,Y,2,p,R,A,B,1)}p=R,y=P,T=X,A=B}s.push(b);break}case $s:{let g=e.readInt(!0),b=new ti(w,g,u),p=e.readFloat(),y=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,k=e.readUnsignedByte()/255,R=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255;for(let X=0,B=0;b.setFrame(X,p,y,T,A,Y,k,R,P),X!=v;X++){let C=e.readFloat(),I=e.readUnsignedByte()/255,O=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255,L=e.readUnsignedByte()/255,se=e.readUnsignedByte()/255,re=e.readUnsignedByte()/255,he=e.readUnsignedByte()/255;switch(e.readByte()){case Xe:b.setStepped(X);break;case Le:le(e,b,B++,X,0,p,C,y,I,1),le(e,b,B++,X,1,p,C,T,O,1),le(e,b,B++,X,2,p,C,A,E,1),le(e,b,B++,X,3,p,C,Y,L,1),le(e,b,B++,X,4,p,C,k,se,1),le(e,b,B++,X,5,p,C,R,re,1),le(e,b,B++,X,6,p,C,P,he,1)}p=C,y=I,T=O,A=E,Y=L,k=se,R=re,P=he}s.push(b);break}case er:{let g=e.readInt(!0),b=new ii(w,g,u),p=e.readFloat(),y=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,k=e.readUnsignedByte()/255,R=e.readUnsignedByte()/255;for(let P=0,X=0;b.setFrame(P,p,y,T,A,Y,k,R),P!=v;P++){let B=e.readFloat(),C=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,O=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255,L=e.readUnsignedByte()/255,se=e.readUnsignedByte()/255;switch(e.readByte()){case Xe:b.setStepped(P);break;case Le:le(e,b,X++,P,0,p,B,y,C,1),le(e,b,X++,P,1,p,B,T,I,1),le(e,b,X++,P,2,p,B,A,O,1),le(e,b,X++,P,3,p,B,Y,E,1),le(e,b,X++,P,4,p,B,k,L,1),le(e,b,X++,P,5,p,B,R,se,1)}p=B,y=C,T=I,A=O,Y=E,k=L,R=se}s.push(b);break}case tr:{let g=new ei(w,e.readInt(!0),u),b=e.readFloat(),p=e.readUnsignedByte()/255;for(let y=0,T=0;g.setFrame(y,b,p),y!=v;y++){let A=e.readFloat(),Y=e.readUnsignedByte()/255;switch(e.readByte()){case Xe:g.setStepped(y);break;case Le:le(e,g,T++,y,0,b,A,p,Y,1)}b=A,p=Y}s.push(g)}}}}for(let h=0,d=e.readInt(!0);h<d;h++){let u=e.readInt(!0);for(let f=0,m=e.readInt(!0);f<m;f++){let x=e.readByte(),w=e.readInt(!0),v=e.readInt(!0);switch(x){case Ns:s.push(We(e,new mt(w,v,u),1));break;case Us:s.push(Mi(e,new Wt(w,v,u),r));break;case zs:s.push(We(e,new qt(w,v,u),r));break;case Ws:s.push(We(e,new _t(w,v,u),r));break;case qs:s.push(Mi(e,new Gt(w,v,u),1));break;case _s:s.push(We(e,new Ht(w,v,u),1));break;case Gs:s.push(We(e,new jt(w,v,u),1));break;case Hs:s.push(Mi(e,new Zt(w,v,u),1));break;case js:s.push(We(e,new Jt(w,v,u),1));break;case Zs:s.push(We(e,new Kt(w,v,u),1))}}}for(let h=0,d=e.readInt(!0);h<d;h++){let u=e.readInt(!0),f=e.readInt(!0),m=f-1,x=new ri(f,e.readInt(!0),u),w=e.readFloat(),v=e.readFloat(),g=e.readFloat()*r;for(let b=0,p=0;x.setFrame(b,w,v,g,e.readByte(),e.readBoolean(),e.readBoolean()),b!=m;b++){let y=e.readFloat(),T=e.readFloat(),A=e.readFloat()*r;switch(e.readByte()){case Xe:x.setStepped(b);break;case Le:le(e,x,p++,b,0,w,y,v,T,1),le(e,x,p++,b,1,w,y,g,A,r)}w=y,v=T,g=A}s.push(x)}for(let h=0,d=e.readInt(!0);h<d;h++){let u=e.readInt(!0),f=e.readInt(!0),m=f-1,x=new ai(f,e.readInt(!0),u),w=e.readFloat(),v=e.readFloat(),g=e.readFloat(),b=e.readFloat(),p=e.readFloat(),y=e.readFloat(),T=e.readFloat();for(let A=0,Y=0;x.setFrame(A,w,v,g,b,p,y,T),A!=m;A++){let k=e.readFloat(),R=e.readFloat(),P=e.readFloat(),X=e.readFloat(),B=e.readFloat(),C=e.readFloat(),I=e.readFloat();switch(e.readByte()){case Xe:x.setStepped(A);break;case Le:le(e,x,Y++,A,0,w,k,v,R,1),le(e,x,Y++,A,1,w,k,g,P,1),le(e,x,Y++,A,2,w,k,b,X,1),le(e,x,Y++,A,3,w,k,p,B,1),le(e,x,Y++,A,4,w,k,y,C,1),le(e,x,Y++,A,5,w,k,T,I,1)}w=k,v=R,g=P,b=X,p=B,y=C,T=I}s.push(x)}for(let h=0,d=e.readInt(!0);h<d;h++){let u=e.readInt(!0),f=i.pathConstraints[u];for(let m=0,x=e.readInt(!0);m<x;m++)switch(e.readByte()){case rr:s.push(We(e,new ni(e.readInt(!0),e.readInt(!0),u),f.positionMode==Pe.Fixed?r:1));break;case ar:s.push(We(e,new li(e.readInt(!0),e.readInt(!0),u),f.spacingMode==ge.Length||f.spacingMode==ge.Fixed?r:1));break;case nr:let w=new oi(e.readInt(!0),e.readInt(!0),u),v=e.readFloat(),g=e.readFloat(),b=e.readFloat(),p=e.readFloat();for(let y=0,T=0,A=w.getFrameCount()-1;w.setFrame(y,v,g,b,p),y!=A;y++){let Y=e.readFloat(),k=e.readFloat(),R=e.readFloat(),P=e.readFloat();switch(e.readByte()){case Xe:w.setStepped(y);break;case Le:le(e,w,T++,y,0,v,Y,g,k,1),le(e,w,T++,y,1,v,Y,b,R,1),le(e,w,T++,y,2,v,Y,p,P,1)}v=Y,g=k,b=R,p=P}s.push(w)}}for(let h=0,d=e.readInt(!0);h<d;h++){let u=i.skins[e.readInt(!0)];for(let f=0,m=e.readInt(!0);f<m;f++){let x=e.readInt(!0);for(let w=0,v=e.readInt(!0);w<v;w++){let g=e.readStringRef(),b=u.getAttachment(x,g),p=e.readByte(),y=e.readInt(!0),T=y-1;switch(p){case ir:{let A=b,Y=A.bones,k=A.vertices,R=Y?k.length/3*2:k.length,P=e.readInt(!0),X=new si(y,P,x,A),B=e.readFloat();for(let C=0,I=0;;C++){let O,E=e.readInt(!0);if(E==0)O=Y?D.newFloatArray(R):k;else{O=D.newFloatArray(R);let se=e.readInt(!0);if(E+=se,r==1)for(let re=se;re<E;re++)O[re]=e.readFloat();else for(let re=se;re<E;re++)O[re]=e.readFloat()*r;if(!Y)for(let re=0,he=O.length;re<he;re++)O[re]+=k[re]}if(X.setFrame(C,B,O),C==T)break;let L=e.readFloat();switch(e.readByte()){case Xe:X.setStepped(C);break;case Le:le(e,X,I++,C,0,B,L,0,1,1)}B=L}s.push(X);break}case sr:{let A=new st(y,x,b);for(let Y=0;Y<y;Y++){let k=e.readFloat(),R=e.readInt32();A.setFrame(Y,k,_i[R&15],R>>4,e.readFloat())}s.push(A);break}}}}}let a=e.readInt(!0);if(a>0){let h=new Ke(a),d=i.slots.length;for(let u=0;u<a;u++){let f=e.readFloat(),m=e.readInt(!0),x=D.newArray(d,0);for(let b=d-1;b>=0;b--)x[b]=-1;let w=D.newArray(d-m,0),v=0,g=0;for(let b=0;b<m;b++){let p=e.readInt(!0);for(;v!=p;)w[g++]=v++;x[v+e.readInt(!0)]=v++}for(;v<d;)w[g++]=v++;for(let b=d-1;b>=0;b--)x[b]==-1&&(x[b]=w[--g]);h.setFrame(u,f,x)}s.push(h)}let l=e.readInt(!0);if(l>0){let h=new gt(l);for(let d=0;d<l;d++){let u=e.readFloat(),f=i.events[e.readInt(!0)],m=new wi(u,f);m.intValue=e.readInt(!1),m.floatValue=e.readFloat(),m.stringValue=e.readBoolean()?e.readString():f.stringValue,m.data.audioPath&&(m.volume=e.readFloat(),m.balance=e.readFloat()),h.setFrame(d,m)}s.push(h)}let o=0;for(let h=0,d=s.length;h<d;h++)o=Math.max(o,s[h].getDuration());return new yt(t,s,o)}},ls=class{constructor(e,t=new Array,i=0,s=new DataView(e.buffer)){this.strings=t,this.index=i,this.buffer=s}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let e=this.buffer.getInt16(this.index);return this.index+=2,e}readInt32(){let e=this.buffer.getInt32(this.index);return this.index+=4,e}readInt(e){let t=this.readByte(),i=t&127;return(t&128)!=0&&(t=this.readByte(),i|=(t&127)<<7,(t&128)!=0&&(t=this.readByte(),i|=(t&127)<<14,(t&128)!=0&&(t=this.readByte(),i|=(t&127)<<21,(t&128)!=0&&(t=this.readByte(),i|=(t&127)<<28)))),e?i:i>>>1^-(i&1)}readStringRef(){let e=this.readInt(!0);return e==0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="",i=0;for(let s=0;s<e;){let r=this.readByte();switch(r>>4){case 12:case 13:t+=String.fromCharCode((r&31)<<6|this.readByte()&63),s+=2;break;case 14:t+=String.fromCharCode((r&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),s+=3;break;default:t+=String.fromCharCode(r),s++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},Ds=class{constructor(e,t,i,s,r){this.mesh=e,this.skin=t,this.slotIndex=i,this.parent=s,this.inheritTimeline=r}},Vs=class{constructor(e=null,t=null){this.bones=e,this.vertices=t}},ze;(function(e){e[e.Region=0]="Region",e[e.BoundingBox=1]="BoundingBox",e[e.Mesh=2]="Mesh",e[e.LinkedMesh=3]="LinkedMesh",e[e.Path=4]="Path",e[e.Point=5]="Point",e[e.Clipping=6]="Clipping"})(ze||(ze={}));function We(e,t,i){let s=e.readFloat(),r=e.readFloat()*i;for(let c=0,n=0,a=t.getFrameCount()-1;t.setFrame(c,s,r),c!=a;c++){let l=e.readFloat(),o=e.readFloat()*i;switch(e.readByte()){case Xe:t.setStepped(c);break;case Le:le(e,t,n++,c,0,s,l,r,o,i)}s=l,r=o}return t}function Mi(e,t,i){let s=e.readFloat(),r=e.readFloat()*i,c=e.readFloat()*i;for(let n=0,a=0,l=t.getFrameCount()-1;t.setFrame(n,s,r,c),n!=l;n++){let o=e.readFloat(),h=e.readFloat()*i,d=e.readFloat()*i;switch(e.readByte()){case Xe:t.setStepped(n);break;case Le:le(e,t,a++,n,0,s,o,r,h,i),le(e,t,a++,n,1,s,o,c,d,i)}s=o,r=h,c=d}return t}function le(e,t,i,s,r,c,n,a,l,o){t.setBezier(i,s,r,c,a,e.readFloat(),e.readFloat()*o,e.readFloat(),e.readFloat()*o,n,l)}var Ns=0,Us=1,zs=2,Ws=3,qs=4,_s=5,Gs=6,Hs=7,js=8,Zs=9,Js=0,Ks=1,Qs=2,$s=3,er=4,tr=5,ir=0,sr=1,rr=0,ar=1,nr=2,Xe=1,Le=2,os=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new ut(()=>D.newFloatArray(16))}update(e,t){if(!e)throw new Error("skeleton cannot be null.");let i=this.boundingBoxes,s=this.polygons,r=this.polygonPool,c=e.slots,n=c.length;i.length=0,r.freeAll(s),s.length=0;for(let a=0;a<n;a++){let l=c[a];if(!l.bone.active)continue;let o=l.getAttachment();if(o instanceof Tt){let h=o;i.push(h);let d=r.obtain();d.length!=h.worldVerticesLength&&(d=D.newFloatArray(h.worldVerticesLength)),s.push(d),h.computeWorldVertices(l,0,h.worldVerticesLength,d,0,2)}}t?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,r=this.polygons;for(let c=0,n=r.length;c<n;c++){let a=r[c],l=a;for(let o=0,h=a.length;o<h;o+=2){let d=l[o],u=l[o+1];e=Math.min(e,d),t=Math.min(t,u),i=Math.max(i,d),s=Math.max(s,u)}}this.minX=e,this.minY=t,this.maxX=i,this.maxY=s}aabbContainsPoint(e,t){return e>=this.minX&&e<=this.maxX&&t>=this.minY&&t<=this.maxY}aabbIntersectsSegment(e,t,i,s){let r=this.minX,c=this.minY,n=this.maxX,a=this.maxY;if(e<=r&&i<=r||t<=c&&s<=c||e>=n&&i>=n||t>=a&&s>=a)return!1;let l=(s-t)/(i-e),o=l*(r-e)+t;if(o>c&&o<a||(o=l*(n-e)+t,o>c&&o<a))return!0;let h=(c-t)/l+e;return!!(h>r&&h<n||(h=(a-t)/l+e,h>r&&h<n))}aabbIntersectsSkeleton(e){return this.minX<e.maxX&&this.maxX>e.minX&&this.minY<e.maxY&&this.maxY>e.minY}containsPoint(e,t){let i=this.polygons;for(let s=0,r=i.length;s<r;s++)if(this.containsPointPolygon(i[s],e,t))return this.boundingBoxes[s];return null}containsPointPolygon(e,t,i){let s=e,r=e.length,c=r-2,n=!1;for(let a=0;a<r;a+=2){let l=s[a+1],o=s[c+1];if(l<i&&o>=i||o<i&&l>=i){let h=s[a];h+(i-l)/(o-l)*(s[c]-h)<t&&(n=!n)}c=a}return n}intersectsSegment(e,t,i,s){let r=this.polygons;for(let c=0,n=r.length;c<n;c++)if(this.intersectsSegmentPolygon(r[c],e,t,i,s))return this.boundingBoxes[c];return null}intersectsSegmentPolygon(e,t,i,s,r){let c=e,n=e.length,a=t-s,l=i-r,o=t*r-i*s,h=c[n-2],d=c[n-1];for(let u=0;u<n;u+=2){let f=c[u],m=c[u+1],x=h*m-d*f,w=h-f,v=d-m,g=a*v-l*w,b=(o*w-a*x)/g;if((b>=h&&b<=f||b>=f&&b<=h)&&(b>=t&&b<=s||b>=s&&b<=t)){let p=(o*v-l*x)/g;if((p>=d&&p<=m||p>=m&&p<=d)&&(p>=i&&p<=r||p>=r&&p<=i))return!0}h=f,d=m}return!1}getPolygon(e){if(!e)throw new Error("boundingBox cannot be null.");let t=this.boundingBoxes.indexOf(e);return t==-1?null:this.polygons[t]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},Te=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new ut(()=>new Array),this.polygonIndicesPool=new ut(()=>new Array)}triangulate(e){let t=e,i=e.length>>1,s=this.indicesArray;s.length=0;for(let n=0;n<i;n++)s[n]=n;let r=this.isConcaveArray;r.length=0;for(let n=0,a=i;n<a;++n)r[n]=Te.isConcave(n,i,t,s);let c=this.triangles;for(c.length=0;i>3;){let n=i-1,a=0,l=1;for(;;){e:if(!r[a]){let d=s[n]<<1,u=s[a]<<1,f=s[l]<<1,m=t[d],x=t[d+1],w=t[u],v=t[u+1],g=t[f],b=t[f+1];for(let p=(l+1)%i;p!=n;p=(p+1)%i){if(!r[p])continue;let y=s[p]<<1,T=t[y],A=t[y+1];if(Te.positiveArea(g,b,m,x,T,A)&&Te.positiveArea(m,x,w,v,T,A)&&Te.positiveArea(w,v,g,b,T,A))break e}break}if(l==0){do{if(!r[a])break;a--}while(a>0);break}n=a,a=l,l=(l+1)%i}c.push(s[(i+a-1)%i]),c.push(s[a]),c.push(s[(a+1)%i]),s.splice(a,1),r.splice(a,1),i--;let o=(i+a-1)%i,h=a==i?0:a;r[o]=Te.isConcave(o,i,t,s),r[h]=Te.isConcave(h,i,t,s)}return i==3&&(c.push(s[2]),c.push(s[0]),c.push(s[1])),c}decompose(e,t){let i=e,s=this.convexPolygons;this.polygonPool.freeAll(s),s.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let c=this.polygonIndicesPool.obtain();c.length=0;let n=this.polygonPool.obtain();n.length=0;let a=-1,l=0;for(let o=0,h=t.length;o<h;o+=3){let d=t[o]<<1,u=t[o+1]<<1,f=t[o+2]<<1,m=i[d],x=i[d+1],w=i[u],v=i[u+1],g=i[f],b=i[f+1],p=!1;if(a==d){let y=n.length-4,T=Te.winding(n[y],n[y+1],n[y+2],n[y+3],g,b),A=Te.winding(g,b,n[0],n[1],n[2],n[3]);T==l&&A==l&&(n.push(g),n.push(b),c.push(f),p=!0)}p||(n.length>0?(s.push(n),r.push(c)):(this.polygonPool.free(n),this.polygonIndicesPool.free(c)),n=this.polygonPool.obtain(),n.length=0,n.push(m),n.push(x),n.push(w),n.push(v),n.push(g),n.push(b),c=this.polygonIndicesPool.obtain(),c.length=0,c.push(d),c.push(u),c.push(f),l=Te.winding(m,x,w,v,g,b),a=d)}n.length>0&&(s.push(n),r.push(c));for(let o=0,h=s.length;o<h;o++){if(c=r[o],c.length==0)continue;let d=c[0],u=c[c.length-1];n=s[o];let f=n.length-4,m=n[f],x=n[f+1],w=n[f+2],v=n[f+3],g=n[0],b=n[1],p=n[2],y=n[3],T=Te.winding(m,x,w,v,g,b);for(let A=0;A<h;A++){if(A==o)continue;let Y=r[A];if(Y.length!=3)continue;let k=Y[0],R=Y[1],P=Y[2],X=s[A],B=X[X.length-2],C=X[X.length-1];if(k!=d||R!=u)continue;let I=Te.winding(m,x,w,v,B,C),O=Te.winding(B,C,g,b,p,y);I==T&&O==T&&(X.length=0,Y.length=0,n.push(B),n.push(C),c.push(P),m=w,x=v,w=B,v=C,A=0)}}for(let o=s.length-1;o>=0;o--)n=s[o],n.length==0&&(s.splice(o,1),this.polygonPool.free(n),c=r[o],r.splice(o,1),this.polygonIndicesPool.free(c));return s}static isConcave(e,t,i,s){let r=s[(t+e-1)%t]<<1,c=s[e]<<1,n=s[(e+1)%t]<<1;return!this.positiveArea(i[r],i[r+1],i[c],i[c+1],i[n],i[n+1])}static positiveArea(e,t,i,s,r,c){return e*(c-s)+i*(t-c)+r*(s-t)>=0}static winding(e,t,i,s,r,c){let n=i-e,a=s-t;return r*a-c*n+n*t-e*a>=0?1:-1}},Yt=class{constructor(){this.triangulator=new Te,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let i=t.worldVerticesLength,s=D.setArraySize(this.clippingPolygon,i);t.computeWorldVertices(e,0,i,s,0,2);let r=this.clippingPolygon;Yt.makeClockwise(r);let c=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let n=0,a=c.length;n<a;n++){let l=c[n];Yt.makeClockwise(l),l.push(l[0]),l.push(l[1])}return c.length}clipEndWithSlot(e){this.clipAttachment&&this.clipAttachment.endSlot==e.data&&this.clipEnd()}clipEnd(){!this.clipAttachment||(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return this.clipAttachment!=null}clipTriangles(e,t,i,s,r,c,n,a){let l=this.clipOutput,o=this.clippedVertices,h=this.clippedTriangles,d=this.clippingPolygons,u=this.clippingPolygons.length,f=a?12:8,m=0;o.length=0,h.length=0;e:for(let x=0;x<s;x+=3){let w=i[x]<<1,v=e[w],g=e[w+1],b=r[w],p=r[w+1];w=i[x+1]<<1;let y=e[w],T=e[w+1],A=r[w],Y=r[w+1];w=i[x+2]<<1;let k=e[w],R=e[w+1],P=r[w],X=r[w+1];for(let B=0;B<u;B++){let C=o.length;if(this.clip(v,g,y,T,k,R,d[B],l)){let I=l.length;if(I==0)continue;let O=T-R,E=k-y,L=v-k,se=R-g,re=1/(O*L+E*(g-R)),he=I>>1,ae=this.clipOutput,ie=D.setArraySize(o,C+he*f);for(let Ae=0;Ae<I;Ae+=2){let Be=ae[Ae],pe=ae[Ae+1];ie[C]=Be,ie[C+1]=pe,ie[C+2]=c.r,ie[C+3]=c.g,ie[C+4]=c.b,ie[C+5]=c.a;let Ye=Be-k,ke=pe-R,je=(O*Ye+E*ke)*re,ht=(se*Ye+L*ke)*re,wt=1-je-ht;ie[C+6]=b*je+A*ht+P*wt,ie[C+7]=p*je+Y*ht+X*wt,a&&(ie[C+8]=n.r,ie[C+9]=n.g,ie[C+10]=n.b,ie[C+11]=n.a),C+=f}C=h.length;let de=D.setArraySize(h,C+3*(he-2));he--;for(let Ae=1;Ae<he;Ae++)de[C]=m,de[C+1]=m+Ae,de[C+2]=m+Ae+1,C+=3;m+=he+1}else{let I=D.setArraySize(o,C+3*f);I[C]=v,I[C+1]=g,I[C+2]=c.r,I[C+3]=c.g,I[C+4]=c.b,I[C+5]=c.a,a?(I[C+6]=b,I[C+7]=p,I[C+8]=n.r,I[C+9]=n.g,I[C+10]=n.b,I[C+11]=n.a,I[C+12]=y,I[C+13]=T,I[C+14]=c.r,I[C+15]=c.g,I[C+16]=c.b,I[C+17]=c.a,I[C+18]=A,I[C+19]=Y,I[C+20]=n.r,I[C+21]=n.g,I[C+22]=n.b,I[C+23]=n.a,I[C+24]=k,I[C+25]=R,I[C+26]=c.r,I[C+27]=c.g,I[C+28]=c.b,I[C+29]=c.a,I[C+30]=P,I[C+31]=X,I[C+32]=n.r,I[C+33]=n.g,I[C+34]=n.b,I[C+35]=n.a):(I[C+6]=b,I[C+7]=p,I[C+8]=y,I[C+9]=T,I[C+10]=c.r,I[C+11]=c.g,I[C+12]=c.b,I[C+13]=c.a,I[C+14]=A,I[C+15]=Y,I[C+16]=k,I[C+17]=R,I[C+18]=c.r,I[C+19]=c.g,I[C+20]=c.b,I[C+21]=c.a,I[C+22]=P,I[C+23]=X),C=h.length;let O=D.setArraySize(h,C+3);O[C]=m,O[C+1]=m+1,O[C+2]=m+2,m+=3;continue e}}}}clip(e,t,i,s,r,c,n,a){let l=a,o=!1,h=null;n.length%4>=2?(h=a,a=this.scratch):h=this.scratch,h.length=0,h.push(e),h.push(t),h.push(i),h.push(s),h.push(r),h.push(c),h.push(e),h.push(t),a.length=0;let d=n,u=n.length-4;for(let f=0;;f+=2){let m=d[f],x=d[f+1],w=d[f+2],v=d[f+3],g=m-w,b=x-v,p=h,y=h.length-2,T=a.length;for(let Y=0;Y<y;Y+=2){let k=p[Y],R=p[Y+1],P=p[Y+2],X=p[Y+3],B=g*(X-v)-b*(P-w)>0;if(g*(R-v)-b*(k-w)>0){if(B){a.push(P),a.push(X);continue}let C=X-R,I=P-k,O=C*(w-m)-I*(v-x);if(Math.abs(O)>1e-6){let E=(I*(x-R)-C*(m-k))/O;a.push(m+(w-m)*E),a.push(x+(v-x)*E)}else a.push(m),a.push(x)}else if(B){let C=X-R,I=P-k,O=C*(w-m)-I*(v-x);if(Math.abs(O)>1e-6){let E=(I*(x-R)-C*(m-k))/O;a.push(m+(w-m)*E),a.push(x+(v-x)*E)}else a.push(m),a.push(x);a.push(P),a.push(X)}o=!0}if(T==a.length)return l.length=0,!0;if(a.push(a[0]),a.push(a[1]),f==u)break;let A=a;a=h,a.length=0,h=A}if(l!=a){l.length=0;for(let f=0,m=a.length-2;f<m;f++)l[f]=a[f]}else l.length=l.length-2;return o}static makeClockwise(e){let t=e,i=e.length,s=t[i-2]*t[1]-t[0]*t[i-1],r=0,c=0,n=0,a=0;for(let l=0,o=i-3;l<o;l+=2)r=t[l],c=t[l+1],n=t[l+2],a=t[l+3],s+=r*a-n*c;if(!(s<0))for(let l=0,o=i-2,h=i>>1;l<h;l+=2){let d=t[l],u=t[l+1],f=o-l;t[l]=t[f],t[l+1]=t[f+1],t[f]=d,t[f+1]=u}}},lr=class{constructor(e){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,i=new Si,s=typeof e=="string"?JSON.parse(e):e,r=s.skeleton;if(r&&(i.hash=r.hash,i.version=r.spine,i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height,i.fps=r.fps,i.imagesPath=r.images),s.bones)for(let c=0;c<s.bones.length;c++){let n=s.bones[c],a=null,l=M(n,"parent",null);l&&(a=i.findBone(l));let o=new bi(i.bones.length,n.name,a);o.length=M(n,"length",0)*t,o.x=M(n,"x",0)*t,o.y=M(n,"y",0)*t,o.rotation=M(n,"rotation",0),o.scaleX=M(n,"scaleX",1),o.scaleY=M(n,"scaleY",1),o.shearX=M(n,"shearX",0),o.shearY=M(n,"shearY",0),o.transformMode=D.enumValue(Ce,M(n,"transform","Normal")),o.skinRequired=M(n,"skin",!1);let h=M(n,"color",null);h&&o.color.setFromString(h),i.bones.push(o)}if(s.slots)for(let c=0;c<s.slots.length;c++){let n=s.slots[c],a=i.findBone(n.bone),l=new Ti(i.slots.length,n.name,a),o=M(n,"color",null);o&&l.color.setFromString(o);let h=M(n,"dark",null);h&&(l.darkColor=V.fromString(h)),l.attachmentName=M(n,"attachment",null),l.blendMode=D.enumValue(we,M(n,"blend","normal")),i.slots.push(l)}if(s.ik)for(let c=0;c<s.ik.length;c++){let n=s.ik[c],a=new yi(n.name);a.order=M(n,"order",0),a.skinRequired=M(n,"skin",!1);for(let l=0;l<n.bones.length;l++)a.bones.push(i.findBone(n.bones[l]));a.target=i.findBone(n.target),a.mix=M(n,"mix",1),a.softness=M(n,"softness",0)*t,a.bendDirection=M(n,"bendPositive",!0)?1:-1,a.compress=M(n,"compress",!1),a.stretch=M(n,"stretch",!1),a.uniform=M(n,"uniform",!1),i.ikConstraints.push(a)}if(s.transform)for(let c=0;c<s.transform.length;c++){let n=s.transform[c],a=new Ii(n.name);a.order=M(n,"order",0),a.skinRequired=M(n,"skin",!1);for(let o=0;o<n.bones.length;o++)a.bones.push(i.findBone(n.bones[o]));let l=n.target;a.target=i.findBone(l),a.local=M(n,"local",!1),a.relative=M(n,"relative",!1),a.offsetRotation=M(n,"rotation",0),a.offsetX=M(n,"x",0)*t,a.offsetY=M(n,"y",0)*t,a.offsetScaleX=M(n,"scaleX",0),a.offsetScaleY=M(n,"scaleY",0),a.offsetShearY=M(n,"shearY",0),a.mixRotate=M(n,"mixRotate",1),a.mixX=M(n,"mixX",1),a.mixY=M(n,"mixY",a.mixX),a.mixScaleX=M(n,"mixScaleX",1),a.mixScaleY=M(n,"mixScaleY",a.mixScaleX),a.mixShearY=M(n,"mixShearY",1),i.transformConstraints.push(a)}if(s.path)for(let c=0;c<s.path.length;c++){let n=s.path[c],a=new Ai(n.name);a.order=M(n,"order",0),a.skinRequired=M(n,"skin",!1);for(let o=0;o<n.bones.length;o++)a.bones.push(i.findBone(n.bones[o]));let l=n.target;a.target=i.findSlot(l),a.positionMode=D.enumValue(Pe,M(n,"positionMode","Percent")),a.spacingMode=D.enumValue(ge,M(n,"spacingMode","Length")),a.rotateMode=D.enumValue(et,M(n,"rotateMode","Tangent")),a.offsetRotation=M(n,"rotation",0),a.position=M(n,"position",0),a.positionMode==Pe.Fixed&&(a.position*=t),a.spacing=M(n,"spacing",0),(a.spacingMode==ge.Length||a.spacingMode==ge.Fixed)&&(a.spacing*=t),a.mixRotate=M(n,"mixRotate",1),a.mixX=M(n,"mixX",1),a.mixY=M(n,"mixY",a.mixX),i.pathConstraints.push(a)}if(s.skins)for(let c=0;c<s.skins.length;c++){let n=s.skins[c],a=new Mt(n.name);if(n.bones)for(let l=0;l<n.bones.length;l++)a.bones.push(i.findBone(n.bones[l]));if(n.ik)for(let l=0;l<n.ik.length;l++)a.constraints.push(i.findIkConstraint(n.ik[l]));if(n.transform)for(let l=0;l<n.transform.length;l++)a.constraints.push(i.findTransformConstraint(n.transform[l]));if(n.path)for(let l=0;l<n.path.length;l++)a.constraints.push(i.findPathConstraint(n.path[l]));for(let l in n.attachments){let o=i.findSlot(l),h=n.attachments[l];for(let d in h){let u=this.readAttachment(h[d],a,o.index,d,i);u&&a.setAttachment(o.index,d,u)}}i.skins.push(a),a.name=="default"&&(i.defaultSkin=a)}for(let c=0,n=this.linkedMeshes.length;c<n;c++){let a=this.linkedMeshes[c],o=(a.skin?i.findSkin(a.skin):i.defaultSkin).getAttachment(a.slotIndex,a.parent);a.mesh.timelineAttahment=a.inheritTimeline?o:a.mesh,a.mesh.setParentMesh(o),a.mesh.region!=null&&a.mesh.updateRegion()}if(this.linkedMeshes.length=0,s.events)for(let c in s.events){let n=s.events[c],a=new vi(c);a.intValue=M(n,"int",0),a.floatValue=M(n,"float",0),a.stringValue=M(n,"string",""),a.audioPath=M(n,"audio",null),a.audioPath&&(a.volume=M(n,"volume",1),a.balance=M(n,"balance",0)),i.events.push(a)}if(s.animations)for(let c in s.animations){let n=s.animations[c];this.readAnimation(n,c,i)}return i}readAttachment(e,t,i,s,r){let c=this.scale;switch(s=M(e,"name",s),M(e,"type","region")){case"region":{let n=M(e,"path",s),a=this.readSequence(M(e,"sequence",null)),l=this.attachmentLoader.newRegionAttachment(t,s,n,a);if(!l)return null;l.path=n,l.x=M(e,"x",0)*c,l.y=M(e,"y",0)*c,l.scaleX=M(e,"scaleX",1),l.scaleY=M(e,"scaleY",1),l.rotation=M(e,"rotation",0),l.width=e.width*c,l.height=e.height*c,l.sequence=a;let o=M(e,"color",null);return o&&l.color.setFromString(o),l.region!=null&&l.updateRegion(),l}case"boundingbox":{let n=this.attachmentLoader.newBoundingBoxAttachment(t,s);if(!n)return null;this.readVertices(e,n,e.vertexCount<<1);let a=M(e,"color",null);return a&&n.color.setFromString(a),n}case"mesh":case"linkedmesh":{let n=M(e,"path",s),a=this.readSequence(M(e,"sequence",null)),l=this.attachmentLoader.newMeshAttachment(t,s,n,a);if(!l)return null;l.path=n;let o=M(e,"color",null);o&&l.color.setFromString(o),l.width=M(e,"width",0)*c,l.height=M(e,"height",0)*c,l.sequence=a;let h=M(e,"parent",null);if(h)return this.linkedMeshes.push(new or(l,M(e,"skin",null),i,h,M(e,"timelines",!0))),l;let d=e.uvs;return this.readVertices(e,l,d.length),l.triangles=e.triangles,l.regionUVs=d,l.region!=null&&l.updateRegion(),l.edges=M(e,"edges",null),l.hullLength=M(e,"hull",0)*2,l}case"path":{let n=this.attachmentLoader.newPathAttachment(t,s);if(!n)return null;n.closed=M(e,"closed",!1),n.constantSpeed=M(e,"constantSpeed",!0);let a=e.vertexCount;this.readVertices(e,n,a<<1);let l=D.newArray(a/3,0);for(let h=0;h<e.lengths.length;h++)l[h]=e.lengths[h]*c;n.lengths=l;let o=M(e,"color",null);return o&&n.color.setFromString(o),n}case"point":{let n=this.attachmentLoader.newPointAttachment(t,s);if(!n)return null;n.x=M(e,"x",0)*c,n.y=M(e,"y",0)*c,n.rotation=M(e,"rotation",0);let a=M(e,"color",null);return a&&n.color.setFromString(a),n}case"clipping":{let n=this.attachmentLoader.newClippingAttachment(t,s);if(!n)return null;let a=M(e,"end",null);a&&(n.endSlot=r.findSlot(a));let l=e.vertexCount;this.readVertices(e,n,l<<1);let o=M(e,"color",null);return o&&n.color.setFromString(o),n}}return null}readSequence(e){if(e==null)return null;let t=new zt(M(e,"count",0));return t.start=M(e,"start",1),t.digits=M(e,"digits",0),t.setupIndex=M(e,"setup",0),t}readVertices(e,t,i){let s=this.scale;t.worldVerticesLength=i;let r=e.vertices;if(i==r.length){let a=D.toFloatArray(r);if(s!=1)for(let l=0,o=r.length;l<o;l++)a[l]*=s;t.vertices=a;return}let c=new Array,n=new Array;for(let a=0,l=r.length;a<l;){let o=r[a++];n.push(o);for(let h=a+o*4;a<h;a+=4)n.push(r[a]),c.push(r[a+1]*s),c.push(r[a+2]*s),c.push(r[a+3])}t.bones=n,t.vertices=D.toFloatArray(c)}readAnimation(e,t,i){let s=this.scale,r=new Array;if(e.slots)for(let n in e.slots){let a=e.slots[n],l=i.findSlot(n).index;for(let o in a){let h=a[o];if(!h)continue;let d=h.length;if(o=="attachment"){let u=new Je(d,l);for(let f=0;f<d;f++){let m=h[f];u.setFrame(f,M(m,"time",0),M(m,"name",null))}r.push(u)}else if(o=="rgba"){let u=new Qt(d,d<<2,l),f=h[0],m=M(f,"time",0),x=V.fromString(f.color);for(let w=0,v=0;;w++){u.setFrame(w,m,x.r,x.g,x.b,x.a);let g=h[w+1];if(!g){u.shrink(v);break}let b=M(g,"time",0),p=V.fromString(g.color),y=f.curve;y&&(v=oe(y,u,v,w,0,m,b,x.r,p.r,1),v=oe(y,u,v,w,1,m,b,x.g,p.g,1),v=oe(y,u,v,w,2,m,b,x.b,p.b,1),v=oe(y,u,v,w,3,m,b,x.a,p.a,1)),m=b,x=p,f=g}r.push(u)}else if(o=="rgb"){let u=new $t(d,d*3,l),f=h[0],m=M(f,"time",0),x=V.fromString(f.color);for(let w=0,v=0;;w++){u.setFrame(w,m,x.r,x.g,x.b);let g=h[w+1];if(!g){u.shrink(v);break}let b=M(g,"time",0),p=V.fromString(g.color),y=f.curve;y&&(v=oe(y,u,v,w,0,m,b,x.r,p.r,1),v=oe(y,u,v,w,1,m,b,x.g,p.g,1),v=oe(y,u,v,w,2,m,b,x.b,p.b,1)),m=b,x=p,f=g}r.push(u)}else if(o=="alpha")r.push(Oe(h,new ei(d,d,l),0,1));else if(o=="rgba2"){let u=new ti(d,d*7,l),f=h[0],m=M(f,"time",0),x=V.fromString(f.light),w=V.fromString(f.dark);for(let v=0,g=0;;v++){u.setFrame(v,m,x.r,x.g,x.b,x.a,w.r,w.g,w.b);let b=h[v+1];if(!b){u.shrink(g);break}let p=M(b,"time",0),y=V.fromString(b.light),T=V.fromString(b.dark),A=f.curve;A&&(g=oe(A,u,g,v,0,m,p,x.r,y.r,1),g=oe(A,u,g,v,1,m,p,x.g,y.g,1),g=oe(A,u,g,v,2,m,p,x.b,y.b,1),g=oe(A,u,g,v,3,m,p,x.a,y.a,1),g=oe(A,u,g,v,4,m,p,w.r,T.r,1),g=oe(A,u,g,v,5,m,p,w.g,T.g,1),g=oe(A,u,g,v,6,m,p,w.b,T.b,1)),m=p,x=y,w=T,f=b}r.push(u)}else if(o=="rgb2"){let u=new ii(d,d*6,l),f=h[0],m=M(f,"time",0),x=V.fromString(f.light),w=V.fromString(f.dark);for(let v=0,g=0;;v++){u.setFrame(v,m,x.r,x.g,x.b,w.r,w.g,w.b);let b=h[v+1];if(!b){u.shrink(g);break}let p=M(b,"time",0),y=V.fromString(b.light),T=V.fromString(b.dark),A=f.curve;A&&(g=oe(A,u,g,v,0,m,p,x.r,y.r,1),g=oe(A,u,g,v,1,m,p,x.g,y.g,1),g=oe(A,u,g,v,2,m,p,x.b,y.b,1),g=oe(A,u,g,v,3,m,p,w.r,T.r,1),g=oe(A,u,g,v,4,m,p,w.g,T.g,1),g=oe(A,u,g,v,5,m,p,w.b,T.b,1)),m=p,x=y,w=T,f=b}r.push(u)}}}if(e.bones)for(let n in e.bones){let a=e.bones[n],l=i.findBone(n).index;for(let o in a){let h=a[o],d=h.length;if(d!=0){if(o==="rotate")r.push(Oe(h,new mt(d,d,l),0,1));else if(o==="translate"){let u=new Wt(d,d<<1,l);r.push(Yi(h,u,"x","y",0,s))}else if(o==="translatex"){let u=new qt(d,d,l);r.push(Oe(h,u,0,s))}else if(o==="translatey"){let u=new _t(d,d,l);r.push(Oe(h,u,0,s))}else if(o==="scale"){let u=new Gt(d,d<<1,l);r.push(Yi(h,u,"x","y",1,1))}else if(o==="scalex"){let u=new Ht(d,d,l);r.push(Oe(h,u,1,1))}else if(o==="scaley"){let u=new jt(d,d,l);r.push(Oe(h,u,1,1))}else if(o==="shear"){let u=new Zt(d,d<<1,l);r.push(Yi(h,u,"x","y",0,1))}else if(o==="shearx"){let u=new Jt(d,d,l);r.push(Oe(h,u,0,1))}else if(o==="sheary"){let u=new Kt(d,d,l);r.push(Oe(h,u,0,1))}}}}if(e.ik)for(let n in e.ik){let a=e.ik[n],l=a[0];if(!l)continue;let o=i.findIkConstraint(n),h=i.ikConstraints.indexOf(o),d=new ri(a.length,a.length<<1,h),u=M(l,"time",0),f=M(l,"mix",1),m=M(l,"softness",0)*s;for(let x=0,w=0;;x++){d.setFrame(x,u,f,m,M(l,"bendPositive",!0)?1:-1,M(l,"compress",!1),M(l,"stretch",!1));let v=a[x+1];if(!v){d.shrink(w);break}let g=M(v,"time",0),b=M(v,"mix",1),p=M(v,"softness",0)*s,y=l.curve;y&&(w=oe(y,d,w,x,0,u,g,f,b,1),w=oe(y,d,w,x,1,u,g,m,p,s)),u=g,f=b,m=p,l=v}r.push(d)}if(e.transform)for(let n in e.transform){let a=e.transform[n],l=a[0];if(!l)continue;let o=i.findTransformConstraint(n),h=i.transformConstraints.indexOf(o),d=new ai(a.length,a.length*6,h),u=M(l,"time",0),f=M(l,"mixRotate",1),m=M(l,"mixX",1),x=M(l,"mixY",m),w=M(l,"mixScaleX",1),v=M(l,"mixScaleY",w),g=M(l,"mixShearY",1);for(let b=0,p=0;;b++){d.setFrame(b,u,f,m,x,w,v,g);let y=a[b+1];if(!y){d.shrink(p);break}let T=M(y,"time",0),A=M(y,"mixRotate",1),Y=M(y,"mixX",1),k=M(y,"mixY",Y),R=M(y,"mixScaleX",1),P=M(y,"mixScaleY",R),X=M(y,"mixShearY",1),B=l.curve;B&&(p=oe(B,d,p,b,0,u,T,f,A,1),p=oe(B,d,p,b,1,u,T,m,Y,1),p=oe(B,d,p,b,2,u,T,x,k,1),p=oe(B,d,p,b,3,u,T,w,R,1),p=oe(B,d,p,b,4,u,T,v,P,1),p=oe(B,d,p,b,5,u,T,g,X,1)),u=T,f=A,m=Y,x=k,w=R,v=P,w=R,l=y}r.push(d)}if(e.path)for(let n in e.path){let a=e.path[n],l=i.findPathConstraint(n),o=i.pathConstraints.indexOf(l);for(let h in a){let d=a[h],u=d[0];if(!u)continue;let f=d.length;if(h==="position"){let m=new ni(f,f,o);r.push(Oe(d,m,0,l.positionMode==Pe.Fixed?s:1))}else if(h==="spacing"){let m=new li(f,f,o);r.push(Oe(d,m,0,l.spacingMode==ge.Length||l.spacingMode==ge.Fixed?s:1))}else if(h==="mix"){let m=new oi(f,f*3,o),x=M(u,"time",0),w=M(u,"mixRotate",1),v=M(u,"mixX",1),g=M(u,"mixY",v);for(let b=0,p=0;;b++){m.setFrame(b,x,w,v,g);let y=d[b+1];if(!y){m.shrink(p);break}let T=M(y,"time",0),A=M(y,"mixRotate",1),Y=M(y,"mixX",1),k=M(y,"mixY",Y),R=u.curve;R&&(p=oe(R,m,p,b,0,x,T,w,A,1),p=oe(R,m,p,b,1,x,T,v,Y,1),p=oe(R,m,p,b,2,x,T,g,k,1)),x=T,w=A,v=Y,g=k,u=y}r.push(m)}}}if(e.attachments)for(let n in e.attachments){let a=e.attachments[n],l=i.findSkin(n);for(let o in a){let h=a[o],d=i.findSlot(o).index;for(let u in h){let f=h[u],m=l.getAttachment(d,u);for(let x in f){let w=f[x],v=w[0];if(!!v){if(x=="deform"){let g=m.bones,b=m.vertices,p=g?b.length/3*2:b.length,y=new si(w.length,w.length,d,m),T=M(v,"time",0);for(let A=0,Y=0;;A++){let k,R=M(v,"vertices",null);if(!R)k=g?D.newFloatArray(p):b;else{k=D.newFloatArray(p);let C=M(v,"offset",0);if(D.arrayCopy(R,0,k,C,R.length),s!=1)for(let I=C,O=I+R.length;I<O;I++)k[I]*=s;if(!g)for(let I=0;I<p;I++)k[I]+=b[I]}y.setFrame(A,T,k);let P=w[A+1];if(!P){y.shrink(Y);break}let X=M(P,"time",0),B=v.curve;B&&(Y=oe(B,y,Y,A,0,T,X,0,1,1)),T=X,v=P}r.push(y)}else if(x=="sequence"){let g=new st(w.length,d,m),b=0;for(let p=0;p<w.length;p++){let y=M(v,"delay",b),T=M(v,"time",0),A=Ve[M(v,"mode","hold")],Y=M(v,"index",0);g.setFrame(p,T,A,Y,y),b=y,v=w[p+1]}r.push(g)}}}}}}if(e.drawOrder){let n=new Ke(e.drawOrder.length),a=i.slots.length,l=0;for(let o=0;o<e.drawOrder.length;o++,l++){let h=e.drawOrder[o],d=null,u=M(h,"offsets",null);if(u){d=D.newArray(a,-1);let f=D.newArray(a-u.length,0),m=0,x=0;for(let w=0;w<u.length;w++){let v=u[w],g=i.findSlot(v.slot).index;for(;m!=g;)f[x++]=m++;d[m+v.offset]=m++}for(;m<a;)f[x++]=m++;for(let w=a-1;w>=0;w--)d[w]==-1&&(d[w]=f[--x])}n.setFrame(l,M(h,"time",0),d)}r.push(n)}if(e.events){let n=new gt(e.events.length),a=0;for(let l=0;l<e.events.length;l++,a++){let o=e.events[l],h=i.findEvent(o.name),d=new wi(D.toSinglePrecision(M(o,"time",0)),h);d.intValue=M(o,"int",h.intValue),d.floatValue=M(o,"float",h.floatValue),d.stringValue=M(o,"string",h.stringValue),d.data.audioPath&&(d.volume=M(o,"volume",1),d.balance=M(o,"balance",0)),n.setFrame(a,d)}r.push(n)}let c=0;for(let n=0,a=r.length;n<a;n++)c=Math.max(c,r[n].getDuration());i.animations.push(new yt(t,r,c))}},or=class{constructor(e,t,i,s,r){this.mesh=e,this.skin=t,this.slotIndex=i,this.parent=s,this.inheritTimeline=r}};function Oe(e,t,i,s){let r=e[0],c=M(r,"time",0),n=M(r,"value",i)*s,a=0;for(let l=0;;l++){t.setFrame(l,c,n);let o=e[l+1];if(!o)return t.shrink(a),t;let h=M(o,"time",0),d=M(o,"value",i)*s;r.curve&&(a=oe(r.curve,t,a,l,0,c,h,n,d,s)),c=h,n=d,r=o}}function Yi(e,t,i,s,r,c){let n=e[0],a=M(n,"time",0),l=M(n,i,r)*c,o=M(n,s,r)*c,h=0;for(let d=0;;d++){t.setFrame(d,a,l,o);let u=e[d+1];if(!u)return t.shrink(h),t;let f=M(u,"time",0),m=M(u,i,r)*c,x=M(u,s,r)*c,w=n.curve;w&&(h=oe(w,t,h,d,0,a,f,l,m,c),h=oe(w,t,h,d,1,a,f,o,x,c)),a=f,l=m,o=x,n=u}}function oe(e,t,i,s,r,c,n,a,l,o){if(e=="stepped")return t.setStepped(s),i;let h=r<<2,d=e[h],u=e[h+1]*o,f=e[h+2],m=e[h+3]*o;return t.setBezier(i,s,r,c,a,d,u,f,m,n,l),i+1}function M(e,t,i){return e[t]!==void 0?e[t]:i}(()=>{typeof Math.fround=="undefined"&&(Math.fround=function(e){return function(t){return e[0]=t,e[0]}}(new Float32Array(1)))})();var hr=class{constructor(e,t){this.jitterX=0,this.jitterY=0,this.jitterX=e,this.jitterY=t}begin(e){}transform(e,t,i,s){e.x+=F.randomTriangular(-this.jitterX,this.jitterY),e.y+=F.randomTriangular(-this.jitterX,this.jitterY)}end(){}},hs=class{constructor(e){this.centerX=0,this.centerY=0,this.radius=0,this.angle=0,this.worldX=0,this.worldY=0,this.radius=e}begin(e){this.worldX=e.x+this.centerX,this.worldY=e.y+this.centerY}transform(e,t,i,s){let r=this.angle*F.degreesToRadians,c=e.x-this.worldX,n=e.y-this.worldY,a=Math.sqrt(c*c+n*n);if(a<this.radius){let l=hs.interpolation.apply(0,r,(this.radius-a)/this.radius),o=Math.cos(l),h=Math.sin(l);e.x=o*c-h*n+this.worldX,e.y=h*c+o*n+this.worldY}}end(){}},cs=hs;cs.interpolation=new Wi(2);var ve=class{constructor(e,t={alpha:"true"}){this.restorables=new Array,e instanceof WebGLRenderingContext||typeof WebGL2RenderingContext!="undefined"&&e instanceof WebGL2RenderingContext?(this.gl=e,this.canvas=this.gl.canvas):this.setupCanvas(e,t)}setupCanvas(e,t){this.gl=e.getContext("webgl2",t)||e.getContext("webgl",t),this.canvas=e,e.addEventListener("webglcontextlost",i=>{let s=i;i&&i.preventDefault()}),e.addEventListener("webglcontextrestored",i=>{for(let s=0,r=this.restorables.length;s<r;s++)this.restorables[s].restore()})}addRestorable(e){this.restorables.push(e)}removeRestorable(e){let t=this.restorables.indexOf(e);t>-1&&this.restorables.splice(t,1)}},at=1,cr=769,ds=770,kt=771,dr=774,Rt=class{static getDestGLBlendMode(e){switch(e){case we.Normal:return kt;case we.Additive:return at;case we.Multiply:return kt;case we.Screen:return kt;default:throw new Error("Unknown blend mode: "+e)}}static getSourceColorGLBlendMode(e,t=!1){switch(e){case we.Normal:return t?at:ds;case we.Additive:return t?at:ds;case we.Multiply:return dr;case we.Screen:return at;default:throw new Error("Unknown blend mode: "+e)}}static getSourceAlphaGLBlendMode(e){switch(e){case we.Normal:return at;case we.Additive:return at;case we.Multiply:return kt;case we.Screen:return cr;default:throw new Error("Unknown blend mode: "+e)}}},ki=class extends mi{constructor(e,t,i=!1){super(t);this.texture=null,this.boundUnit=0,this.useMipMaps=!1,this.context=e instanceof ve?e:new ve(e),this.useMipMaps=i,this.restore(),this.context.addRestorable(this)}setFilters(e,t){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,ki.validateMagFilter(t))}static validateMagFilter(e){switch(e){case Ie.MipMap:case Ie.MipMapLinearLinear:case Ie.MipMapLinearNearest:case Ie.MipMapNearestLinear:case Ie.MipMapNearestNearest:return Ie.Linear;default:return e}}setWraps(e,t){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,t)}update(e){let t=this.context.gl;this.texture||(this.texture=this.context.gl.createTexture()),this.bind(),ki.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL&&t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this._image),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e?t.LINEAR_MIPMAP_LINEAR:t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e&&t.generateMipmap(t.TEXTURE_2D)}restore(){this.texture=null,this.update(this.useMipMaps)}bind(e=0){let t=this.context.gl;this.boundUnit=e,t.activeTexture(t.TEXTURE0+e),t.bindTexture(t.TEXTURE_2D,this.texture)}unbind(){let e=this.context.gl;e.activeTexture(e.TEXTURE0+this.boundUnit),e.bindTexture(e.TEXTURE_2D,null)}dispose(){this.context.removeRestorable(this),this.context.gl.deleteTexture(this.texture)}},bt=ki;bt.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL=!1;var us=class extends is{constructor(e,t="",i=null){super(s=>new bt(e,s),t,i)}},Me=class{constructor(e=0,t=0,i=0){this.x=0,this.y=0,this.z=0,this.x=e,this.y=t,this.z=i}setFrom(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}set(e,t,i){return this.x=e,this.y=t,this.z=i,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}scale(e){return this.x*=e,this.y*=e,this.z*=e,this}normalize(){let e=this.length();return e==0?this:(e=1/e,this.x*=e,this.y*=e,this.z*=e,this)}cross(e){return this.set(this.y*e.z-this.z*e.y,this.z*e.x-this.x*e.z,this.x*e.y-this.y*e.x)}multiply(e){let t=e.values;return this.set(this.x*t[N]+this.y*t[G]+this.z*t[H]+t[U],this.x*t[j]+this.y*t[z]+this.z*t[Z]+t[W],this.x*t[J]+this.y*t[K]+this.z*t[q]+t[_])}project(e){let t=e.values,i=1/(this.x*t[$]+this.y*t[ee]+this.z*t[te]+t[Q]);return this.set((this.x*t[N]+this.y*t[G]+this.z*t[H]+t[U])*i,(this.x*t[j]+this.y*t[z]+this.z*t[Z]+t[W])*i,(this.x*t[J]+this.y*t[K]+this.z*t[q]+t[_])*i)}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}distance(e){let t=e.x-this.x,i=e.y-this.y,s=e.z-this.z;return Math.sqrt(t*t+i*i+s*s)}},N=0,G=4,H=8,U=12,j=1,z=5,Z=9,W=13,J=2,K=6,q=10,_=14,$=3,ee=7,te=11,Q=15,xe=class{constructor(){this.temp=new Float32Array(16),this.values=new Float32Array(16);let e=this.values;e[N]=1,e[z]=1,e[q]=1,e[Q]=1}set(e){return this.values.set(e),this}transpose(){let e=this.temp,t=this.values;return e[N]=t[N],e[G]=t[j],e[H]=t[J],e[U]=t[$],e[j]=t[G],e[z]=t[z],e[Z]=t[K],e[W]=t[ee],e[J]=t[H],e[K]=t[Z],e[q]=t[q],e[_]=t[te],e[$]=t[U],e[ee]=t[W],e[te]=t[_],e[Q]=t[Q],this.set(e)}identity(){let e=this.values;return e[N]=1,e[G]=0,e[H]=0,e[U]=0,e[j]=0,e[z]=1,e[Z]=0,e[W]=0,e[J]=0,e[K]=0,e[q]=1,e[_]=0,e[$]=0,e[ee]=0,e[te]=0,e[Q]=1,this}invert(){let e=this.values,t=this.temp,i=e[$]*e[K]*e[Z]*e[U]-e[J]*e[ee]*e[Z]*e[U]-e[$]*e[z]*e[q]*e[U]+e[j]*e[ee]*e[q]*e[U]+e[J]*e[z]*e[te]*e[U]-e[j]*e[K]*e[te]*e[U]-e[$]*e[K]*e[H]*e[W]+e[J]*e[ee]*e[H]*e[W]+e[$]*e[G]*e[q]*e[W]-e[N]*e[ee]*e[q]*e[W]-e[J]*e[G]*e[te]*e[W]+e[N]*e[K]*e[te]*e[W]+e[$]*e[z]*e[H]*e[_]-e[j]*e[ee]*e[H]*e[_]-e[$]*e[G]*e[Z]*e[_]+e[N]*e[ee]*e[Z]*e[_]+e[j]*e[G]*e[te]*e[_]-e[N]*e[z]*e[te]*e[_]-e[J]*e[z]*e[H]*e[Q]+e[j]*e[K]*e[H]*e[Q]+e[J]*e[G]*e[Z]*e[Q]-e[N]*e[K]*e[Z]*e[Q]-e[j]*e[G]*e[q]*e[Q]+e[N]*e[z]*e[q]*e[Q];if(i==0)throw new Error("non-invertible matrix");let s=1/i;return t[N]=e[Z]*e[_]*e[ee]-e[W]*e[q]*e[ee]+e[W]*e[K]*e[te]-e[z]*e[_]*e[te]-e[Z]*e[K]*e[Q]+e[z]*e[q]*e[Q],t[G]=e[U]*e[q]*e[ee]-e[H]*e[_]*e[ee]-e[U]*e[K]*e[te]+e[G]*e[_]*e[te]+e[H]*e[K]*e[Q]-e[G]*e[q]*e[Q],t[H]=e[H]*e[W]*e[ee]-e[U]*e[Z]*e[ee]+e[U]*e[z]*e[te]-e[G]*e[W]*e[te]-e[H]*e[z]*e[Q]+e[G]*e[Z]*e[Q],t[U]=e[U]*e[Z]*e[K]-e[H]*e[W]*e[K]-e[U]*e[z]*e[q]+e[G]*e[W]*e[q]+e[H]*e[z]*e[_]-e[G]*e[Z]*e[_],t[j]=e[W]*e[q]*e[$]-e[Z]*e[_]*e[$]-e[W]*e[J]*e[te]+e[j]*e[_]*e[te]+e[Z]*e[J]*e[Q]-e[j]*e[q]*e[Q],t[z]=e[H]*e[_]*e[$]-e[U]*e[q]*e[$]+e[U]*e[J]*e[te]-e[N]*e[_]*e[te]-e[H]*e[J]*e[Q]+e[N]*e[q]*e[Q],t[Z]=e[U]*e[Z]*e[$]-e[H]*e[W]*e[$]-e[U]*e[j]*e[te]+e[N]*e[W]*e[te]+e[H]*e[j]*e[Q]-e[N]*e[Z]*e[Q],t[W]=e[H]*e[W]*e[J]-e[U]*e[Z]*e[J]+e[U]*e[j]*e[q]-e[N]*e[W]*e[q]-e[H]*e[j]*e[_]+e[N]*e[Z]*e[_],t[J]=e[z]*e[_]*e[$]-e[W]*e[K]*e[$]+e[W]*e[J]*e[ee]-e[j]*e[_]*e[ee]-e[z]*e[J]*e[Q]+e[j]*e[K]*e[Q],t[K]=e[U]*e[K]*e[$]-e[G]*e[_]*e[$]-e[U]*e[J]*e[ee]+e[N]*e[_]*e[ee]+e[G]*e[J]*e[Q]-e[N]*e[K]*e[Q],t[q]=e[G]*e[W]*e[$]-e[U]*e[z]*e[$]+e[U]*e[j]*e[ee]-e[N]*e[W]*e[ee]-e[G]*e[j]*e[Q]+e[N]*e[z]*e[Q],t[_]=e[U]*e[z]*e[J]-e[G]*e[W]*e[J]-e[U]*e[j]*e[K]+e[N]*e[W]*e[K]+e[G]*e[j]*e[_]-e[N]*e[z]*e[_],t[$]=e[Z]*e[K]*e[$]-e[z]*e[q]*e[$]-e[Z]*e[J]*e[ee]+e[j]*e[q]*e[ee]+e[z]*e[J]*e[te]-e[j]*e[K]*e[te],t[ee]=e[G]*e[q]*e[$]-e[H]*e[K]*e[$]+e[H]*e[J]*e[ee]-e[N]*e[q]*e[ee]-e[G]*e[J]*e[te]+e[N]*e[K]*e[te],t[te]=e[H]*e[z]*e[$]-e[G]*e[Z]*e[$]-e[H]*e[j]*e[ee]+e[N]*e[Z]*e[ee]+e[G]*e[j]*e[te]-e[N]*e[z]*e[te],t[Q]=e[G]*e[Z]*e[J]-e[H]*e[z]*e[J]+e[H]*e[j]*e[K]-e[N]*e[Z]*e[K]-e[G]*e[j]*e[q]+e[N]*e[z]*e[q],e[N]=t[N]*s,e[G]=t[G]*s,e[H]=t[H]*s,e[U]=t[U]*s,e[j]=t[j]*s,e[z]=t[z]*s,e[Z]=t[Z]*s,e[W]=t[W]*s,e[J]=t[J]*s,e[K]=t[K]*s,e[q]=t[q]*s,e[_]=t[_]*s,e[$]=t[$]*s,e[ee]=t[ee]*s,e[te]=t[te]*s,e[Q]=t[Q]*s,this}determinant(){let e=this.values;return e[$]*e[K]*e[Z]*e[U]-e[J]*e[ee]*e[Z]*e[U]-e[$]*e[z]*e[q]*e[U]+e[j]*e[ee]*e[q]*e[U]+e[J]*e[z]*e[te]*e[U]-e[j]*e[K]*e[te]*e[U]-e[$]*e[K]*e[H]*e[W]+e[J]*e[ee]*e[H]*e[W]+e[$]*e[G]*e[q]*e[W]-e[N]*e[ee]*e[q]*e[W]-e[J]*e[G]*e[te]*e[W]+e[N]*e[K]*e[te]*e[W]+e[$]*e[z]*e[H]*e[_]-e[j]*e[ee]*e[H]*e[_]-e[$]*e[G]*e[Z]*e[_]+e[N]*e[ee]*e[Z]*e[_]+e[j]*e[G]*e[te]*e[_]-e[N]*e[z]*e[te]*e[_]-e[J]*e[z]*e[H]*e[Q]+e[j]*e[K]*e[H]*e[Q]+e[J]*e[G]*e[Z]*e[Q]-e[N]*e[K]*e[Z]*e[Q]-e[j]*e[G]*e[q]*e[Q]+e[N]*e[z]*e[q]*e[Q]}translate(e,t,i){let s=this.values;return s[U]+=e,s[W]+=t,s[_]+=i,this}copy(){return new xe().set(this.values)}projection(e,t,i,s){this.identity();let r=1/Math.tan(i*(Math.PI/180)/2),c=(t+e)/(e-t),n=2*t*e/(e-t),a=this.values;return a[N]=r/s,a[j]=0,a[J]=0,a[$]=0,a[G]=0,a[z]=r,a[K]=0,a[ee]=0,a[H]=0,a[Z]=0,a[q]=c,a[te]=-1,a[U]=0,a[W]=0,a[_]=n,a[Q]=0,this}ortho2d(e,t,i,s){return this.ortho(e,e+i,t,t+s,0,1)}ortho(e,t,i,s,r,c){this.identity();let n=2/(t-e),a=2/(s-i),l=-2/(c-r),o=-(t+e)/(t-e),h=-(s+i)/(s-i),d=-(c+r)/(c-r),u=this.values;return u[N]=n,u[j]=0,u[J]=0,u[$]=0,u[G]=0,u[z]=a,u[K]=0,u[ee]=0,u[H]=0,u[Z]=0,u[q]=l,u[te]=0,u[U]=o,u[W]=h,u[_]=d,u[Q]=1,this}multiply(e){let t=this.temp,i=this.values,s=e.values;return t[N]=i[N]*s[N]+i[G]*s[j]+i[H]*s[J]+i[U]*s[$],t[G]=i[N]*s[G]+i[G]*s[z]+i[H]*s[K]+i[U]*s[ee],t[H]=i[N]*s[H]+i[G]*s[Z]+i[H]*s[q]+i[U]*s[te],t[U]=i[N]*s[U]+i[G]*s[W]+i[H]*s[_]+i[U]*s[Q],t[j]=i[j]*s[N]+i[z]*s[j]+i[Z]*s[J]+i[W]*s[$],t[z]=i[j]*s[G]+i[z]*s[z]+i[Z]*s[K]+i[W]*s[ee],t[Z]=i[j]*s[H]+i[z]*s[Z]+i[Z]*s[q]+i[W]*s[te],t[W]=i[j]*s[U]+i[z]*s[W]+i[Z]*s[_]+i[W]*s[Q],t[J]=i[J]*s[N]+i[K]*s[j]+i[q]*s[J]+i[_]*s[$],t[K]=i[J]*s[G]+i[K]*s[z]+i[q]*s[K]+i[_]*s[ee],t[q]=i[J]*s[H]+i[K]*s[Z]+i[q]*s[q]+i[_]*s[te],t[_]=i[J]*s[U]+i[K]*s[W]+i[q]*s[_]+i[_]*s[Q],t[$]=i[$]*s[N]+i[ee]*s[j]+i[te]*s[J]+i[Q]*s[$],t[ee]=i[$]*s[G]+i[ee]*s[z]+i[te]*s[K]+i[Q]*s[ee],t[te]=i[$]*s[H]+i[ee]*s[Z]+i[te]*s[q]+i[Q]*s[te],t[Q]=i[$]*s[U]+i[ee]*s[W]+i[te]*s[_]+i[Q]*s[Q],this.set(this.temp)}multiplyLeft(e){let t=this.temp,i=this.values,s=e.values;return t[N]=s[N]*i[N]+s[G]*i[j]+s[H]*i[J]+s[U]*i[$],t[G]=s[N]*i[G]+s[G]*i[z]+s[H]*i[K]+s[U]*i[ee],t[H]=s[N]*i[H]+s[G]*i[Z]+s[H]*i[q]+s[U]*i[te],t[U]=s[N]*i[U]+s[G]*i[W]+s[H]*i[_]+s[U]*i[Q],t[j]=s[j]*i[N]+s[z]*i[j]+s[Z]*i[J]+s[W]*i[$],t[z]=s[j]*i[G]+s[z]*i[z]+s[Z]*i[K]+s[W]*i[ee],t[Z]=s[j]*i[H]+s[z]*i[Z]+s[Z]*i[q]+s[W]*i[te],t[W]=s[j]*i[U]+s[z]*i[W]+s[Z]*i[_]+s[W]*i[Q],t[J]=s[J]*i[N]+s[K]*i[j]+s[q]*i[J]+s[_]*i[$],t[K]=s[J]*i[G]+s[K]*i[z]+s[q]*i[K]+s[_]*i[ee],t[q]=s[J]*i[H]+s[K]*i[Z]+s[q]*i[q]+s[_]*i[te],t[_]=s[J]*i[U]+s[K]*i[W]+s[q]*i[_]+s[_]*i[Q],t[$]=s[$]*i[N]+s[ee]*i[j]+s[te]*i[J]+s[Q]*i[$],t[ee]=s[$]*i[G]+s[ee]*i[z]+s[te]*i[K]+s[Q]*i[ee],t[te]=s[$]*i[H]+s[ee]*i[Z]+s[te]*i[q]+s[Q]*i[te],t[Q]=s[$]*i[U]+s[ee]*i[W]+s[te]*i[_]+s[Q]*i[Q],this.set(this.temp)}lookAt(e,t,i){xe.initTemps();let s=xe.xAxis,r=xe.yAxis,c=xe.zAxis;c.setFrom(t).normalize(),s.setFrom(t).normalize(),s.cross(i).normalize(),r.setFrom(s).cross(c).normalize(),this.identity();let n=this.values;return n[N]=s.x,n[G]=s.y,n[H]=s.z,n[j]=r.x,n[z]=r.y,n[Z]=r.z,n[J]=-c.x,n[K]=-c.y,n[q]=-c.z,xe.tmpMatrix.identity(),xe.tmpMatrix.values[U]=-e.x,xe.tmpMatrix.values[W]=-e.y,xe.tmpMatrix.values[_]=-e.z,this.multiply(xe.tmpMatrix),this}static initTemps(){xe.xAxis===null&&(xe.xAxis=new Me),xe.yAxis===null&&(xe.yAxis=new Me),xe.zAxis===null&&(xe.zAxis=new Me)}},qe=xe;qe.xAxis=null,qe.yAxis=null,qe.zAxis=null,qe.tmpMatrix=new xe;var fs=class{constructor(e,t){this.position=new Me(0,0,0),this.direction=new Me(0,0,-1),this.up=new Me(0,1,0),this.near=0,this.far=100,this.zoom=1,this.viewportWidth=0,this.viewportHeight=0,this.projectionView=new qe,this.inverseProjectionView=new qe,this.projection=new qe,this.view=new qe,this.viewportWidth=e,this.viewportHeight=t,this.update()}update(){let e=this.projection,t=this.view,i=this.projectionView,s=this.inverseProjectionView,r=this.zoom,c=this.viewportWidth,n=this.viewportHeight;e.ortho(r*(-c/2),r*(c/2),r*(-n/2),r*(n/2),this.near,this.far),t.lookAt(this.position,this.direction,this.up),i.set(e.values),i.multiply(t),s.set(i.values).invert()}screenToWorld(e,t,i){let s=e.x,r=i-e.y-1;return e.x=2*s/t-1,e.y=2*r/i-1,e.z=2*e.z-1,e.project(this.inverseProjectionView),e}worldToScreen(e,t,i){return e.project(this.projectionView),e.x=t*(e.x+1)/2,e.y=i*(e.y+1)/2,e.z=(e.z+1)/2,e}setViewport(e,t){this.viewportWidth=e,this.viewportHeight=t}},Ri=class{constructor(e){this.mouseX=0,this.mouseY=0,this.buttonDown=!1,this.touch0=null,this.touch1=null,this.initialPinchDistance=0,this.listeners=new Array,this.element=e,this.setupCallbacks(e)}setupCallbacks(e){let t=n=>{if(n instanceof MouseEvent){let a=e.getBoundingClientRect();this.mouseX=n.clientX-a.left,this.mouseY=n.clientY-a.top,this.buttonDown=!0,this.listeners.map(l=>{l.down&&l.down(this.mouseX,this.mouseY)}),document.addEventListener("mousemove",i),document.addEventListener("mouseup",s)}},i=n=>{if(n instanceof MouseEvent){let a=e.getBoundingClientRect();this.mouseX=n.clientX-a.left,this.mouseY=n.clientY-a.top,this.listeners.map(l=>{this.buttonDown?l.dragged&&l.dragged(this.mouseX,this.mouseY):l.moved&&l.moved(this.mouseX,this.mouseY)})}},s=n=>{if(n instanceof MouseEvent){let a=e.getBoundingClientRect();this.mouseX=n.clientX-a.left,this.mouseY=n.clientY-a.top,this.buttonDown=!1,this.listeners.map(l=>{l.up&&l.up(this.mouseX,this.mouseY)}),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s)}},r=n=>{n.preventDefault();let a=n.deltaY;n.deltaMode==WheelEvent.DOM_DELTA_LINE&&(a*=8),n.deltaMode==WheelEvent.DOM_DELTA_PAGE&&(a*=24),this.listeners.map(l=>{l.wheel&&l.wheel(n.deltaY)})};e.addEventListener("mousedown",t,!0),e.addEventListener("mousemove",i,!0),e.addEventListener("mouseup",s,!0),e.addEventListener("wheel",r,!0),e.addEventListener("touchstart",n=>{if(!this.touch0||!this.touch1){var a=n.changedTouches;let l=a.item(0),o=e.getBoundingClientRect(),h=l.clientX-o.left,d=l.clientY-o.top,u=new ms(l.identifier,h,d);if(this.mouseX=h,this.mouseY=d,this.buttonDown=!0,!this.touch0)this.touch0=u,this.listeners.map(f=>{f.down&&f.down(u.x,u.y)});else if(!this.touch1){this.touch1=u;let f=this.touch1.x-this.touch0.x,m=this.touch1.x-this.touch0.x;this.initialPinchDistance=Math.sqrt(f*f+m*m),this.listeners.map(x=>{x.zoom&&x.zoom(this.initialPinchDistance,this.initialPinchDistance)})}}n.preventDefault()},!1),e.addEventListener("touchmove",n=>{if(this.touch0){var a=n.changedTouches;let h=e.getBoundingClientRect();for(var l=0;l<a.length;l++){var o=a[l];let d=o.clientX-h.left,u=o.clientY-h.top;this.touch0.identifier===o.identifier&&(this.touch0.x=this.mouseX=d,this.touch0.y=this.mouseY=u,this.listeners.map(f=>{f.dragged&&f.dragged(d,u)})),this.touch1&&this.touch1.identifier===o.identifier&&(this.touch1.x=this.mouseX=d,this.touch1.y=this.mouseY=u)}if(this.touch0&&this.touch1){let d=this.touch1.x-this.touch0.x,u=this.touch1.x-this.touch0.x,f=Math.sqrt(d*d+u*u);this.listeners.map(m=>{m.zoom&&m.zoom(this.initialPinchDistance,f)})}}n.preventDefault()},!1);let c=n=>{if(this.touch0){var a=n.changedTouches;let h=e.getBoundingClientRect();for(var l=0;l<a.length;l++){var o=a[l];let d=o.clientX-h.left,u=o.clientY-h.top;if(this.touch0.identifier===o.identifier)if(this.touch0=null,this.mouseX=d,this.mouseY=u,this.listeners.map(f=>{f.up&&f.up(d,u)}),this.touch1)this.touch0=this.touch1,this.touch1=null,this.mouseX=this.touch0.x,this.mouseX=this.touch0.x,this.buttonDown=!0,this.listeners.map(f=>{f.down&&f.down(this.touch0.x,this.touch0.y)});else{this.buttonDown=!1;break}this.touch1&&this.touch1.identifier&&(this.touch1=null)}}n.preventDefault()};e.addEventListener("touchend",c,!1),e.addEventListener("touchcancel",c)}addListener(e){this.listeners.push(e)}removeListener(e){let t=this.listeners.indexOf(e);t>-1&&this.listeners.splice(t,1)}},ms=class{constructor(e,t,i){this.identifier=e,this.x=t,this.y=i}},ur=class{constructor(e,t){this.canvas=e,this.camera=t;let i=0,s=0,r=0,c=0,n=0,a=0,l=0,o=0;new Ri(e).addListener({down:(h,d)=>{i=t.position.x,s=t.position.y,c=a=h,n=l=d,o=t.zoom},dragged:(h,d)=>{let u=h-c,f=d-n,m=t.screenToWorld(new Me(0,0),e.clientWidth,e.clientHeight),x=t.screenToWorld(new Me(u,f),e.clientWidth,e.clientHeight).sub(m);t.position.set(i-x.x,s-x.y,0),t.update(),a=h,l=d},wheel:h=>{let d=h/200*t.zoom,u=t.zoom+d;if(u>0){let f=0,m=0;if(h<0)f=a,m=l;else{let v=new Me(e.clientWidth/2+15,e.clientHeight/2),g=a-v.x,b=e.clientHeight-1-l-v.y;f=v.x-g,m=e.clientHeight-1-v.y+b}let x=t.screenToWorld(new Me(f,m),e.clientWidth,e.clientHeight);t.zoom=u,t.update();let w=t.screenToWorld(new Me(f,m),e.clientWidth,e.clientHeight);t.position.add(x.sub(w)),t.update()}},zoom:(h,d)=>{let u=h/d;t.zoom=o*u},up:(h,d)=>{a=h,l=d},moved:(h,d)=>{a=h,l=d}})}},ue=class{constructor(e,t,i){this.vertexShader=t,this.fragmentShader=i,this.vs=null,this.fs=null,this.program=null,this.tmp2x2=new Float32Array(2*2),this.tmp3x3=new Float32Array(3*3),this.tmp4x4=new Float32Array(4*4),this.vsSource=t,this.fsSource=i,this.context=e instanceof ve?e:new ve(e),this.context.addRestorable(this),this.compile()}getProgram(){return this.program}getVertexShader(){return this.vertexShader}getFragmentShader(){return this.fragmentShader}getVertexShaderSource(){return this.vsSource}getFragmentSource(){return this.fsSource}compile(){let e=this.context.gl;try{this.vs=this.compileShader(e.VERTEX_SHADER,this.vertexShader),this.fs=this.compileShader(e.FRAGMENT_SHADER,this.fragmentShader),this.program=this.compileProgram(this.vs,this.fs)}catch(t){throw this.dispose(),t}}compileShader(e,t){let i=this.context.gl,s=i.createShader(e);if(i.shaderSource(s,t),i.compileShader(s),!i.getShaderParameter(s,i.COMPILE_STATUS)){let r="Couldn't compile shader: "+i.getShaderInfoLog(s);if(i.deleteShader(s),!i.isContextLost())throw new Error(r)}return s}compileProgram(e,t){let i=this.context.gl,s=i.createProgram();if(i.attachShader(s,e),i.attachShader(s,t),i.linkProgram(s),!i.getProgramParameter(s,i.LINK_STATUS)){let r="Couldn't compile shader program: "+i.getProgramInfoLog(s);if(i.deleteProgram(s),!i.isContextLost())throw new Error(r)}return s}restore(){this.compile()}bind(){this.context.gl.useProgram(this.program)}unbind(){this.context.gl.useProgram(null)}setUniformi(e,t){this.context.gl.uniform1i(this.getUniformLocation(e),t)}setUniformf(e,t){this.context.gl.uniform1f(this.getUniformLocation(e),t)}setUniform2f(e,t,i){this.context.gl.uniform2f(this.getUniformLocation(e),t,i)}setUniform3f(e,t,i,s){this.context.gl.uniform3f(this.getUniformLocation(e),t,i,s)}setUniform4f(e,t,i,s,r){this.context.gl.uniform4f(this.getUniformLocation(e),t,i,s,r)}setUniform2x2f(e,t){let i=this.context.gl;this.tmp2x2.set(t),i.uniformMatrix2fv(this.getUniformLocation(e),!1,this.tmp2x2)}setUniform3x3f(e,t){let i=this.context.gl;this.tmp3x3.set(t),i.uniformMatrix3fv(this.getUniformLocation(e),!1,this.tmp3x3)}setUniform4x4f(e,t){let i=this.context.gl;this.tmp4x4.set(t),i.uniformMatrix4fv(this.getUniformLocation(e),!1,this.tmp4x4)}getUniformLocation(e){let t=this.context.gl,i=t.getUniformLocation(this.program,e);if(!i&&!t.isContextLost())throw new Error(`Couldn't find location for uniform ${e}`);return i}getAttributeLocation(e){let t=this.context.gl,i=t.getAttribLocation(this.program,e);if(i==-1&&!t.isContextLost())throw new Error(`Couldn't find location for attribute ${e}`);return i}dispose(){this.context.removeRestorable(this);let e=this.context.gl;this.vs&&(e.deleteShader(this.vs),this.vs=null),this.fs&&(e.deleteShader(this.fs),this.fs=null),this.program&&(e.deleteProgram(this.program),this.program=null)}static newColoredTextured(e){let t=`
3
+ attribute vec4 ${ue.POSITION};
4
+ attribute vec4 ${ue.COLOR};
5
+ attribute vec2 ${ue.TEXCOORDS};
6
+ uniform mat4 ${ue.MVP_MATRIX};
7
7
  varying vec4 v_color;
8
8
  varying vec2 v_texCoords;
9
9
 
10
10
  void main () {
11
- v_color = ${ft.COLOR};
12
- v_texCoords = ${ft.TEXCOORDS};
13
- gl_Position = ${ft.MVP_MATRIX} * ${ft.POSITION};
11
+ v_color = ${ue.COLOR};
12
+ v_texCoords = ${ue.TEXCOORDS};
13
+ gl_Position = ${ue.MVP_MATRIX} * ${ue.POSITION};
14
14
  }
15
15
  `,i=`
16
16
  #ifdef GL_ES
@@ -26,21 +26,21 @@ var spine=(()=>{var Li=Object.defineProperty,vs=t=>Li(t,"__esModule",{value:!0})
26
26
  void main () {
27
27
  gl_FragColor = v_color * texture2D(u_texture, v_texCoords);
28
28
  }
29
- `;return new ft(t,e,i)}static newTwoColoredTextured(t){let e=`
30
- attribute vec4 ${ft.POSITION};
31
- attribute vec4 ${ft.COLOR};
32
- attribute vec4 ${ft.COLOR2};
33
- attribute vec2 ${ft.TEXCOORDS};
34
- uniform mat4 ${ft.MVP_MATRIX};
29
+ `;return new ue(e,t,i)}static newTwoColoredTextured(e){let t=`
30
+ attribute vec4 ${ue.POSITION};
31
+ attribute vec4 ${ue.COLOR};
32
+ attribute vec4 ${ue.COLOR2};
33
+ attribute vec2 ${ue.TEXCOORDS};
34
+ uniform mat4 ${ue.MVP_MATRIX};
35
35
  varying vec4 v_light;
36
36
  varying vec4 v_dark;
37
37
  varying vec2 v_texCoords;
38
38
 
39
39
  void main () {
40
- v_light = ${ft.COLOR};
41
- v_dark = ${ft.COLOR2};
42
- v_texCoords = ${ft.TEXCOORDS};
43
- gl_Position = ${ft.MVP_MATRIX} * ${ft.POSITION};
40
+ v_light = ${ue.COLOR};
41
+ v_dark = ${ue.COLOR2};
42
+ v_texCoords = ${ue.TEXCOORDS};
43
+ gl_Position = ${ue.MVP_MATRIX} * ${ue.POSITION};
44
44
  }
45
45
  `,i=`
46
46
  #ifdef GL_ES
@@ -59,15 +59,15 @@ var spine=(()=>{var Li=Object.defineProperty,vs=t=>Li(t,"__esModule",{value:!0})
59
59
  gl_FragColor.a = texColor.a * v_light.a;
60
60
  gl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;
61
61
  }
62
- `;return new ft(t,e,i)}static newColored(t){let e=`
63
- attribute vec4 ${ft.POSITION};
64
- attribute vec4 ${ft.COLOR};
65
- uniform mat4 ${ft.MVP_MATRIX};
62
+ `;return new ue(e,t,i)}static newColored(e){let t=`
63
+ attribute vec4 ${ue.POSITION};
64
+ attribute vec4 ${ue.COLOR};
65
+ uniform mat4 ${ue.MVP_MATRIX};
66
66
  varying vec4 v_color;
67
67
 
68
68
  void main () {
69
- v_color = ${ft.COLOR};
70
- gl_Position = ${ft.MVP_MATRIX} * ${ft.POSITION};
69
+ v_color = ${ue.COLOR};
70
+ gl_Position = ${ue.MVP_MATRIX} * ${ue.POSITION};
71
71
  }
72
72
  `,i=`
73
73
  #ifdef GL_ES
@@ -81,4 +81,4 @@ var spine=(()=>{var Li=Object.defineProperty,vs=t=>Li(t,"__esModule",{value:!0})
81
81
  void main () {
82
82
  gl_FragColor = v_color;
83
83
  }
84
- `;return new ft(t,e,i)}},bt=ft;bt.MVP_MATRIX="u_projTrans",bt.POSITION="a_position",bt.COLOR="a_color",bt.COLOR2="a_color2",bt.TEXCOORDS="a_texCoords",bt.SAMPLER="u_texture";var Mi=class{constructor(t,e,i,s){this.attributes=e,this.verticesLength=0,this.dirtyVertices=!1,this.indicesLength=0,this.dirtyIndices=!1,this.elementsPerVertex=0,this.context=t instanceof vt?t:new vt(t),this.elementsPerVertex=0;for(let a=0;a<e.length;a++)this.elementsPerVertex+=e[a].numElements;this.vertices=new Float32Array(i*this.elementsPerVertex),this.indices=new Uint16Array(s),this.context.addRestorable(this)}getAttributes(){return this.attributes}maxVertices(){return this.vertices.length/this.elementsPerVertex}numVertices(){return this.verticesLength/this.elementsPerVertex}setVerticesLength(t){this.dirtyVertices=!0,this.verticesLength=t}getVertices(){return this.vertices}maxIndices(){return this.indices.length}numIndices(){return this.indicesLength}setIndicesLength(t){this.dirtyIndices=!0,this.indicesLength=t}getIndices(){return this.indices}getVertexSizeInFloats(){let t=0;for(var e=0;e<this.attributes.length;e++)t+=this.attributes[e].numElements;return t}setVertices(t){if(this.dirtyVertices=!0,t.length>this.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length}setIndices(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length}draw(t,e){this.drawWithOffset(t,e,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)}drawWithOffset(t,e,i,s){let a=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?a.drawElements(e,s,a.UNSIGNED_SHORT,i*2):a.drawArrays(e,i,s),this.unbind(t)}bind(t){let e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);let i=0;for(let s=0;s<this.attributes.length;s++){let a=this.attributes[s],c=t.getAttributeLocation(a.name);e.enableVertexAttribArray(c),e.vertexAttribPointer(c,a.numElements,e.FLOAT,!1,this.elementsPerVertex*4,i*4),i+=a.numElements}this.indicesLength>0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)}unbind(t){let e=this.context.gl;for(let i=0;i<this.attributes.length;i++){let s=this.attributes[i],a=t.getAttributeLocation(s.name);e.disableVertexAttribArray(a)}e.bindBuffer(e.ARRAY_BUFFER,null),this.indicesLength>0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)}update(){let t=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=t.createBuffer()),t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),t.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),t.DYNAMIC_DRAW),this.dirtyIndices=!1)}restore(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()}dispose(){this.context.removeRestorable(this);let t=this.context.gl;t.deleteBuffer(this.verticesBuffer),t.deleteBuffer(this.indicesBuffer)}},se=class{constructor(t,e,i){this.name=t,this.type=e,this.numElements=i}},Ye=class extends se{constructor(){super(bt.POSITION,qt.Float,2)}},ar=class extends se{constructor(){super(bt.POSITION,qt.Float,3)}},Yi=class extends se{constructor(t=0){super(bt.TEXCOORDS+(t==0?"":t),qt.Float,2)}},Ie=class extends se{constructor(){super(bt.COLOR,qt.Float,4)}},hs=class extends se{constructor(){super(bt.COLOR2,qt.Float,4)}},qt;(function(t){t[t.Float=0]="Float"})(qt||(qt={}));var Ii=class{constructor(t,e=!0,i=10920){if(this.isDrawing=!1,this.shader=null,this.lastTexture=null,this.verticesLength=0,this.indicesLength=0,i>10920)throw new Error("Can't have more than 10920 triangles per batch: "+i);this.context=t instanceof vt?t:new vt(t);let s=e?[new Ye,new Ie,new Yi,new hs]:[new Ye,new Ie,new Yi];this.mesh=new Mi(t,s,i,i*3);let a=this.context.gl;this.srcColorBlend=a.SRC_ALPHA,this.srcAlphaBlend=a.ONE,this.dstBlend=a.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=t,this.lastTexture=null,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend)}setBlendMode(t,e,i){this.srcColorBlend=t,this.srcAlphaBlend=e,this.dstBlend=i,this.isDrawing&&(this.flush(),this.context.gl.blendFuncSeparate(t,i,e,i))}draw(t,e,i){t!=this.lastTexture?(this.flush(),this.lastTexture=t):(this.verticesLength+e.length>this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();let s=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);let a=this.mesh.getIndices();for(let c=this.indicesLength,n=0;n<i.length;c++,n++)a[c]=i[n]+s;this.indicesLength+=i.length,this.mesh.setIndicesLength(this.indicesLength)}flush(){this.verticesLength!=0&&(this.lastTexture.bind(),this.mesh.draw(this.shader,this.context.gl.TRIANGLES),this.verticesLength=0,this.indicesLength=0,this.mesh.setVerticesLength(0),this.mesh.setIndicesLength(0),this.drawCalls++)}end(){if(!this.isDrawing)throw new Error("PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()");(this.verticesLength>0||this.indicesLength>0)&&this.flush(),this.shader=null,this.lastTexture=null,this.isDrawing=!1;let t=this.context.gl;t.disable(t.BLEND)}getDrawCalls(){return this.drawCalls}dispose(){this.mesh.dispose()}},ki=class{constructor(t,e=10920){if(this.isDrawing=!1,this.shapeType=yt.Filled,this.color=new V(1,1,1,1),this.vertexIndex=0,this.tmp=new ce,e>10920)throw new Error("Can't have more than 10920 triangles per batch: "+e);this.context=t instanceof vt?t:new vt(t),this.mesh=new Mi(t,[new Ye,new Ie],e,0);let i=this.context.gl;this.srcColorBlend=i.SRC_ALPHA,this.srcAlphaBlend=i.ONE,this.dstBlend=i.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("ShapeRenderer.begin() has already been called");this.shader=t,this.vertexIndex=0,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend)}setBlendMode(t,e,i){this.srcColorBlend=t,this.srcAlphaBlend=e,this.dstBlend=i,this.isDrawing&&(this.flush(),this.context.gl.blendFuncSeparate(t,i,e,i))}setColor(t){this.color.setFromColor(t)}setColorWith(t,e,i,s){this.color.set(t,e,i,s)}point(t,e,i=null){this.check(yt.Point,1),i===null&&(i=this.color),this.vertex(t,e,i)}line(t,e,i,s,a=null){this.check(yt.Line,2);let c=this.mesh.getVertices(),n=this.vertexIndex;a===null&&(a=this.color),this.vertex(t,e,a),this.vertex(i,s,a)}triangle(t,e,i,s,a,c,n,r=null,o=null,l=null){this.check(t?yt.Filled:yt.Line,3);let h=this.mesh.getVertices(),d=this.vertexIndex;r===null&&(r=this.color),o===null&&(o=this.color),l===null&&(l=this.color),t?(this.vertex(e,i,r),this.vertex(s,a,o),this.vertex(c,n,l)):(this.vertex(e,i,r),this.vertex(s,a,o),this.vertex(s,a,r),this.vertex(c,n,o),this.vertex(c,n,r),this.vertex(e,i,o))}quad(t,e,i,s,a,c,n,r,o,l=null,h=null,d=null,f=null){this.check(t?yt.Filled:yt.Line,3);let m=this.mesh.getVertices(),u=this.vertexIndex;l===null&&(l=this.color),h===null&&(h=this.color),d===null&&(d=this.color),f===null&&(f=this.color),t?(this.vertex(e,i,l),this.vertex(s,a,h),this.vertex(c,n,d),this.vertex(c,n,d),this.vertex(r,o,f),this.vertex(e,i,l)):(this.vertex(e,i,l),this.vertex(s,a,h),this.vertex(s,a,h),this.vertex(c,n,d),this.vertex(c,n,d),this.vertex(r,o,f),this.vertex(r,o,f),this.vertex(e,i,l))}rect(t,e,i,s,a,c=null){this.quad(t,e,i,e+s,i,e+s,i+a,e,i+a,c,c,c,c)}rectLine(t,e,i,s,a,c,n=null){this.check(t?yt.Filled:yt.Line,8),n===null&&(n=this.color);let r=this.tmp.set(a-i,e-s);r.normalize(),c*=.5;let o=r.x*c,l=r.y*c;t?(this.vertex(e+o,i+l,n),this.vertex(e-o,i-l,n),this.vertex(s+o,a+l,n),this.vertex(s-o,a-l,n),this.vertex(s+o,a+l,n),this.vertex(e-o,i-l,n)):(this.vertex(e+o,i+l,n),this.vertex(e-o,i-l,n),this.vertex(s+o,a+l,n),this.vertex(s-o,a-l,n),this.vertex(s+o,a+l,n),this.vertex(e+o,i+l,n),this.vertex(s-o,a-l,n),this.vertex(e-o,i-l,n))}x(t,e,i){this.line(t-i,e-i,t+i,e+i),this.line(t-i,e+i,t+i,e-i)}polygon(t,e,i,s=null){if(i<3)throw new Error("Polygon must contain at least 3 vertices");this.check(yt.Line,i*2),s===null&&(s=this.color);let a=this.mesh.getVertices(),c=this.vertexIndex;e<<=1,i<<=1;let n=t[e],r=t[e+1],o=e+i;for(let l=e,h=e+i-2;l<h;l+=2){let d=t[l],f=t[l+1],m=0,u=0;l+2>=o?(m=n,u=r):(m=t[l+2],u=t[l+3]),this.vertex(d,f,s),this.vertex(m,u,s)}}circle(t,e,i,s,a=null,c=0){if(c===0&&(c=Math.max(1,6*E.cbrt(s)|0)),c<=0)throw new Error("segments must be > 0.");a===null&&(a=this.color);let n=2*E.PI/c,r=Math.cos(n),o=Math.sin(n),l=s,h=0;if(t){this.check(yt.Filled,c*3+3),c--;for(let f=0;f<c;f++){this.vertex(e,i,a),this.vertex(e+l,i+h,a);let m=l;l=r*l-o*h,h=o*m+r*h,this.vertex(e+l,i+h,a)}this.vertex(e,i,a),this.vertex(e+l,i+h,a)}else{this.check(yt.Line,c*2+2);for(let f=0;f<c;f++){this.vertex(e+l,i+h,a);let m=l;l=r*l-o*h,h=o*m+r*h,this.vertex(e+l,i+h,a)}this.vertex(e+l,i+h,a)}let d=l;l=s,h=0,this.vertex(e+l,i+h,a)}curve(t,e,i,s,a,c,n,r,o,l=null){this.check(yt.Line,o*2+2),l===null&&(l=this.color);let h=1/o,d=h*h,f=h*h*h,m=3*h,u=3*d,x=6*d,p=6*f,v=t-i*2+a,g=e-s*2+c,w=(i-a)*3-t+n,b=(s-c)*3-e+r,y=t,T=e,A=(i-t)*m+v*u+w*f,I=(s-e)*m+g*u+b*f,k=v*x+w*p,F=g*x+b*p,P=w*p,L=b*p;for(;o-- >0;)this.vertex(y,T,l),y+=A,T+=I,A+=k,I+=F,k+=P,F+=L,this.vertex(y,T,l);this.vertex(y,T,l),this.vertex(n,r,l)}vertex(t,e,i){let s=this.vertexIndex,a=this.mesh.getVertices();a[s++]=t,a[s++]=e,a[s++]=i.r,a[s++]=i.g,a[s++]=i.b,a[s++]=i.a,this.vertexIndex=s}end(){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");this.flush();let t=this.context.gl;t.disable(t.BLEND),this.isDrawing=!1}flush(){this.vertexIndex!=0&&(this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0)}check(t,e){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");if(this.shapeType==t)if(this.mesh.maxVertices()-this.mesh.numVertices()<e)this.flush();else return;else this.flush(),this.shapeType=t}dispose(){this.mesh.dispose()}},yt;(function(t){t[t.Point=0]="Point",t[t.Line=1]="Line",t[t.Filled=4]="Filled"})(yt||(yt={}));var ke=class{constructor(t){this.boneLineColor=new V(1,0,0,1),this.boneOriginColor=new V(0,1,0,1),this.attachmentLineColor=new V(0,0,1,.5),this.triangleLineColor=new V(1,.64,0,.5),this.pathColor=new V().setFromString("FF7F00"),this.clipColor=new V(.8,0,0,2),this.aabbColor=new V(0,1,0,.5),this.drawBones=!0,this.drawRegionAttachments=!0,this.drawBoundingBoxes=!0,this.drawMeshHull=!0,this.drawMeshTriangles=!0,this.drawPaths=!0,this.drawSkeletonXY=!1,this.drawClipping=!0,this.premultipliedAlpha=!1,this.scale=1,this.boneWidth=2,this.bounds=new is,this.temp=new Array,this.vertices=O.newFloatArray(2*1024),this.context=t instanceof vt?t:new vt(t)}draw(t,e,i=null){let s=e.x,a=e.y,c=this.context.gl,n=this.premultipliedAlpha?c.ONE:c.SRC_ALPHA;t.setBlendMode(n,c.ONE,c.ONE_MINUS_SRC_ALPHA);let r=e.bones;if(this.drawBones){t.setColor(this.boneLineColor);for(let o=0,l=r.length;o<l;o++){let h=r[o];if(i&&i.indexOf(h.data.name)>-1||!h.parent)continue;let d=s+h.data.length*h.a+h.worldX,f=a+h.data.length*h.c+h.worldY;t.rectLine(!0,s+h.worldX,a+h.worldY,d,f,this.boneWidth*this.scale)}this.drawSkeletonXY&&t.x(s,a,4*this.scale)}if(this.drawRegionAttachments){t.setColor(this.attachmentLineColor);let o=e.slots;for(let l=0,h=o.length;l<h;l++){let d=o[l],f=d.getAttachment();if(f instanceof at){let m=f,u=this.vertices;m.computeWorldVertices(d.bone,u,0,2),t.line(u[0],u[1],u[2],u[3]),t.line(u[2],u[3],u[4],u[5]),t.line(u[4],u[5],u[6],u[7]),t.line(u[6],u[7],u[0],u[1])}}}if(this.drawMeshHull||this.drawMeshTriangles){let o=e.slots;for(let l=0,h=o.length;l<h;l++){let d=o[l];if(!d.bone.active)continue;let f=d.getAttachment();if(!(f instanceof _t))continue;let m=f,u=this.vertices;m.computeWorldVertices(d,0,m.worldVerticesLength,u,0,2);let x=m.triangles,p=m.hullLength;if(this.drawMeshTriangles){t.setColor(this.triangleLineColor);for(let v=0,g=x.length;v<g;v+=3){let w=x[v]*2,b=x[v+1]*2,y=x[v+2]*2;t.triangle(!1,u[w],u[w+1],u[b],u[b+1],u[y],u[y+1])}}if(this.drawMeshHull&&p>0){t.setColor(this.attachmentLineColor),p=(p>>1)*2;let v=u[p-2],g=u[p-1];for(let w=0,b=p;w<b;w+=2){let y=u[w],T=u[w+1];t.line(y,T,v,g),v=y,g=T}}}}if(this.drawBoundingBoxes){let o=this.bounds;o.update(e,!0),t.setColor(this.aabbColor),t.rect(!1,o.minX,o.minY,o.getWidth(),o.getHeight());let l=o.polygons,h=o.boundingBoxes;for(let d=0,f=l.length;d<f;d++){let m=l[d];t.setColor(h[d].color),t.polygon(m,0,m.length)}}if(this.drawPaths){let o=e.slots;for(let l=0,h=o.length;l<h;l++){let d=o[l];if(!d.bone.active)continue;let f=d.getAttachment();if(!(f instanceof Kt))continue;let m=f,u=m.worldVerticesLength,x=this.temp=O.setArraySize(this.temp,u,0);m.computeWorldVertices(d,0,u,x,0,2);let p=this.pathColor,v=x[2],g=x[3],w=0,b=0;if(m.closed){t.setColor(p);let y=x[0],T=x[1],A=x[u-2],I=x[u-1];w=x[u-4],b=x[u-3],t.curve(v,g,y,T,A,I,w,b,32),t.setColor(ke.LIGHT_GRAY),t.line(v,g,y,T),t.line(w,b,A,I)}u-=4;for(let y=4;y<u;y+=6){let T=x[y],A=x[y+1],I=x[y+2],k=x[y+3];w=x[y+4],b=x[y+5],t.setColor(p),t.curve(v,g,T,A,I,k,w,b,32),t.setColor(ke.LIGHT_GRAY),t.line(v,g,T,A),t.line(w,b,I,k),v=w,g=b}}}if(this.drawBones){t.setColor(this.boneOriginColor);for(let o=0,l=r.length;o<l;o++){let h=r[o];i&&i.indexOf(h.data.name)>-1||t.circle(!0,s+h.worldX,a+h.worldY,3*this.scale,ke.GREEN,8)}}if(this.drawClipping){let o=e.slots;t.setColor(this.clipColor);for(let l=0,h=o.length;l<h;l++){let d=o[l];if(!d.bone.active)continue;let f=d.getAttachment();if(!(f instanceof ue))continue;let m=f,u=m.worldVerticesLength,x=this.temp=O.setArraySize(this.temp,u,0);m.computeWorldVertices(d,0,u,x,0,2);for(let p=0,v=x.length;p<v;p+=2){let g=x[p],w=x[p+1],b=x[(p+2)%x.length],y=x[(p+3)%x.length];t.line(g,w,b,y)}}}}dispose(){}},Fe=ke;Fe.LIGHT_GRAY=new V(192/255,192/255,192/255,1),Fe.GREEN=new V(0,1,0,1);var nr=class{constructor(t,e,i){this.vertices=t,this.numVertices=e,this.numFloats=i}},cs=class{constructor(t,e=!0){this.premultipliedAlpha=!1,this.vertexEffect=null,this.tempColor=new V,this.tempColor2=new V,this.vertexSize=2+2+4,this.twoColorTint=!1,this.renderable=new nr(null,0,0),this.clipper=new Ce,this.temp=new ce,this.temp2=new ce,this.temp3=new V,this.temp4=new V,this.twoColorTint=e,e&&(this.vertexSize+=4),this.vertices=O.newFloatArray(this.vertexSize*1024)}draw(t,e,i=-1,s=-1){let a=this.clipper,c=this.premultipliedAlpha,n=this.twoColorTint,r=null,o=this.temp,l=this.temp2,h=this.temp3,d=this.temp4,f=this.renderable,m=null,u=null,x=e.drawOrder,p=null,v=e.color,g=n?12:8,w=!1;i==-1&&(w=!0);for(let b=0,y=x.length;b<y;b++){let T=a.isClipping()?2:g,A=x[b];if(!A.bone.active){a.clipEndWithSlot(A);continue}if(i>=0&&i==A.data.index&&(w=!0),!w){a.clipEndWithSlot(A);continue}s>=0&&s==A.data.index&&(w=!1);let I=A.getAttachment(),k=null;if(I instanceof at){let F=I;f.vertices=this.vertices,f.numVertices=4,f.numFloats=T<<2,F.computeWorldVertices(A.bone,f.vertices,0,T),u=cs.QUAD_TRIANGLES,m=F.uvs,k=F.region.renderObject.page.texture,p=F.color}else if(I instanceof _t){let F=I;f.vertices=this.vertices,f.numVertices=F.worldVerticesLength>>1,f.numFloats=f.numVertices*T,f.numFloats>f.vertices.length&&(f.vertices=this.vertices=O.newFloatArray(f.numFloats)),F.computeWorldVertices(A,0,F.worldVerticesLength,f.vertices,0,T),u=F.triangles,k=F.region.renderObject.page.texture,m=F.uvs,p=F.color}else if(I instanceof ue){let F=I;a.clipStart(A,F);continue}else{a.clipEndWithSlot(A);continue}if(k){let F=A.color,P=this.tempColor;P.r=v.r*F.r*p.r,P.g=v.g*F.g*p.g,P.b=v.b*F.b*p.b,P.a=v.a*F.a*p.a,c&&(P.r*=P.a,P.g*=P.a,P.b*=P.a);let L=this.tempColor2;A.darkColor?(c?(L.r=A.darkColor.r*P.a,L.g=A.darkColor.g*P.a,L.b=A.darkColor.b*P.a):L.setFromColor(A.darkColor),L.a=c?1:0):L.set(0,0,0,1);let B=A.data.blendMode;if(B!=r&&(r=B,t.setBlendMode(Me.getSourceColorGLBlendMode(r,c),Me.getSourceAlphaGLBlendMode(r),Me.getDestGLBlendMode(r))),a.isClipping()){a.clipTriangles(f.vertices,f.numFloats,u,u.length,m,P,L,n);let C=new Float32Array(a.clippedVertices),M=a.clippedTriangles;if(this.vertexEffect){let D=this.vertexEffect,X=C;if(n)for(let R=0,st=C.length;R<st;R+=g)o.x=X[R],o.y=X[R+1],h.set(X[R+2],X[R+3],X[R+4],X[R+5]),l.x=X[R+6],l.y=X[R+7],d.set(X[R+8],X[R+9],X[R+10],X[R+11]),D.transform(o,l,h,d),X[R]=o.x,X[R+1]=o.y,X[R+2]=h.r,X[R+3]=h.g,X[R+4]=h.b,X[R+5]=h.a,X[R+6]=l.x,X[R+7]=l.y,X[R+8]=d.r,X[R+9]=d.g,X[R+10]=d.b,X[R+11]=d.a;else for(let R=0,st=C.length;R<st;R+=g)o.x=X[R],o.y=X[R+1],h.set(X[R+2],X[R+3],X[R+4],X[R+5]),l.x=X[R+6],l.y=X[R+7],d.set(0,0,0,0),D.transform(o,l,h,d),X[R]=o.x,X[R+1]=o.y,X[R+2]=h.r,X[R+3]=h.g,X[R+4]=h.b,X[R+5]=h.a,X[R+6]=l.x,X[R+7]=l.y}t.draw(k,C,M)}else{let C=f.vertices;if(this.vertexEffect){let D=this.vertexEffect;if(n)for(let X=0,R=0,st=f.numFloats;X<st;X+=g,R+=2)o.x=C[X],o.y=C[X+1],l.x=m[R],l.y=m[R+1],h.setFromColor(P),d.setFromColor(L),D.transform(o,l,h,d),C[X]=o.x,C[X+1]=o.y,C[X+2]=h.r,C[X+3]=h.g,C[X+4]=h.b,C[X+5]=h.a,C[X+6]=l.x,C[X+7]=l.y,C[X+8]=d.r,C[X+9]=d.g,C[X+10]=d.b,C[X+11]=d.a;else for(let X=0,R=0,st=f.numFloats;X<st;X+=g,R+=2)o.x=C[X],o.y=C[X+1],l.x=m[R],l.y=m[R+1],h.setFromColor(P),d.set(0,0,0,0),D.transform(o,l,h,d),C[X]=o.x,C[X+1]=o.y,C[X+2]=h.r,C[X+3]=h.g,C[X+4]=h.b,C[X+5]=h.a,C[X+6]=l.x,C[X+7]=l.y}else if(n)for(let D=2,X=0,R=f.numFloats;D<R;D+=g,X+=2)C[D]=P.r,C[D+1]=P.g,C[D+2]=P.b,C[D+3]=P.a,C[D+4]=m[X],C[D+5]=m[X+1],C[D+6]=L.r,C[D+7]=L.g,C[D+8]=L.b,C[D+9]=L.a;else for(let D=2,X=0,R=f.numFloats;D<R;D+=g,X+=2)C[D]=P.r,C[D+1]=P.g,C[D+2]=P.b,C[D+3]=P.a,C[D+4]=m[X],C[D+5]=m[X+1];let M=f.vertices.subarray(0,f.numFloats);t.draw(k,M,u)}}a.clipEndWithSlot(A)}a.clipEnd()}},Fi=cs;Fi.QUAD_TRIANGLES=[0,1,2,2,3,0];var S=[0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0],Xe=[0,1,2,2,3,0],Re=new V(1,1,1,1),ds=class{constructor(t,e,i=!0){this.twoColorTint=!1,this.canvas=t,this.context=e instanceof vt?e:new vt(e),this.twoColorTint=i,this.camera=new ls(t.width,t.height),this.batcherShader=i?bt.newTwoColoredTextured(this.context):bt.newColoredTextured(this.context),this.batcher=new Ii(this.context,i),this.shapesShader=bt.newColored(this.context),this.shapes=new ki(this.context),this.skeletonRenderer=new Fi(this.context,i),this.skeletonDebugRenderer=new Fe(this.context)}begin(){this.camera.update(),this.enableRenderer(this.batcher)}drawSkeleton(t,e=!1,i=-1,s=-1){this.enableRenderer(this.batcher),this.skeletonRenderer.premultipliedAlpha=e,this.skeletonRenderer.draw(this.batcher,t,i,s)}drawSkeletonDebug(t,e=!1,i=null){this.enableRenderer(this.shapes),this.skeletonDebugRenderer.premultipliedAlpha=e,this.skeletonDebugRenderer.draw(this.shapes,t,i)}drawTexture(t,e,i,s,a,c=null){this.enableRenderer(this.batcher),c===null&&(c=Re);var n=0;S[n++]=e,S[n++]=i,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=0,S[n++]=1,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n++]=0),S[n++]=e+s,S[n++]=i,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=1,S[n++]=1,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n++]=0),S[n++]=e+s,S[n++]=i+a,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=1,S[n++]=0,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n++]=0),S[n++]=e,S[n++]=i+a,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=0,S[n++]=0,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n]=0),this.batcher.draw(t,S,Xe)}drawTextureUV(t,e,i,s,a,c,n,r,o,l=null){this.enableRenderer(this.batcher),l===null&&(l=Re);var h=0;S[h++]=e,S[h++]=i,S[h++]=l.r,S[h++]=l.g,S[h++]=l.b,S[h++]=l.a,S[h++]=c,S[h++]=n,this.twoColorTint&&(S[h++]=0,S[h++]=0,S[h++]=0,S[h++]=0),S[h++]=e+s,S[h++]=i,S[h++]=l.r,S[h++]=l.g,S[h++]=l.b,S[h++]=l.a,S[h++]=r,S[h++]=n,this.twoColorTint&&(S[h++]=0,S[h++]=0,S[h++]=0,S[h++]=0),S[h++]=e+s,S[h++]=i+a,S[h++]=l.r,S[h++]=l.g,S[h++]=l.b,S[h++]=l.a,S[h++]=r,S[h++]=o,this.twoColorTint&&(S[h++]=0,S[h++]=0,S[h++]=0,S[h++]=0),S[h++]=e,S[h++]=i+a,S[h++]=l.r,S[h++]=l.g,S[h++]=l.b,S[h++]=l.a,S[h++]=c,S[h++]=o,this.twoColorTint&&(S[h++]=0,S[h++]=0,S[h++]=0,S[h]=0),this.batcher.draw(t,S,Xe)}drawTextureRotated(t,e,i,s,a,c,n,r,o=null){this.enableRenderer(this.batcher),o===null&&(o=Re);let l=e+c,h=i+n,d=-c,f=-n,m=s-c,u=a-n,x=d,p=f,v=d,g=u,w=m,b=u,y=m,T=f,A=0,I=0,k=0,F=0,P=0,L=0,B=0,C=0;if(r!=0){let D=E.cosDeg(r),X=E.sinDeg(r);A=D*x-X*p,I=X*x+D*p,B=D*v-X*g,C=X*v+D*g,P=D*w-X*b,L=X*w+D*b,k=P+(A-B),F=L+(I-C)}else A=x,I=p,B=v,C=g,P=w,L=b,k=y,F=T;A+=l,I+=h,k+=l,F+=h,P+=l,L+=h,B+=l,C+=h;var M=0;S[M++]=A,S[M++]=I,S[M++]=o.r,S[M++]=o.g,S[M++]=o.b,S[M++]=o.a,S[M++]=0,S[M++]=1,this.twoColorTint&&(S[M++]=0,S[M++]=0,S[M++]=0,S[M++]=0),S[M++]=k,S[M++]=F,S[M++]=o.r,S[M++]=o.g,S[M++]=o.b,S[M++]=o.a,S[M++]=1,S[M++]=1,this.twoColorTint&&(S[M++]=0,S[M++]=0,S[M++]=0,S[M++]=0),S[M++]=P,S[M++]=L,S[M++]=o.r,S[M++]=o.g,S[M++]=o.b,S[M++]=o.a,S[M++]=1,S[M++]=0,this.twoColorTint&&(S[M++]=0,S[M++]=0,S[M++]=0,S[M++]=0),S[M++]=B,S[M++]=C,S[M++]=o.r,S[M++]=o.g,S[M++]=o.b,S[M++]=o.a,S[M++]=0,S[M++]=0,this.twoColorTint&&(S[M++]=0,S[M++]=0,S[M++]=0,S[M]=0),this.batcher.draw(t,S,Xe)}drawRegion(t,e,i,s,a,c=null){this.enableRenderer(this.batcher),c===null&&(c=Re);var n=0;S[n++]=e,S[n++]=i,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=t.u,S[n++]=t.v2,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n++]=0),S[n++]=e+s,S[n++]=i,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=t.u2,S[n++]=t.v2,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n++]=0),S[n++]=e+s,S[n++]=i+a,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=t.u2,S[n++]=t.v,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n++]=0),S[n++]=e,S[n++]=i+a,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=t.u,S[n++]=t.v,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n]=0),this.batcher.draw(t.page.texture,S,Xe)}line(t,e,i,s,a=null,c=null){this.enableRenderer(this.shapes),this.shapes.line(t,e,i,s,a)}triangle(t,e,i,s,a,c,n,r=null,o=null,l=null){this.enableRenderer(this.shapes),this.shapes.triangle(t,e,i,s,a,c,n,r,o,l)}quad(t,e,i,s,a,c,n,r,o,l=null,h=null,d=null,f=null){this.enableRenderer(this.shapes),this.shapes.quad(t,e,i,s,a,c,n,r,o,l,h,d,f)}rect(t,e,i,s,a,c=null){this.enableRenderer(this.shapes),this.shapes.rect(t,e,i,s,a,c)}rectLine(t,e,i,s,a,c,n=null){this.enableRenderer(this.shapes),this.shapes.rectLine(t,e,i,s,a,c,n)}polygon(t,e,i,s=null){this.enableRenderer(this.shapes),this.shapes.polygon(t,e,i,s)}circle(t,e,i,s,a=null,c=0){this.enableRenderer(this.shapes),this.shapes.circle(t,e,i,s,a,c)}curve(t,e,i,s,a,c,n,r,o,l=null){this.enableRenderer(this.shapes),this.shapes.curve(t,e,i,s,a,c,n,r,o,l)}end(){this.activeRenderer===this.batcher?this.batcher.end():this.activeRenderer===this.shapes&&this.shapes.end(),this.activeRenderer=null}resize(t){let e=this.canvas;var i=window.devicePixelRatio||1,s=Math.round(e.clientWidth*i),a=Math.round(e.clientHeight*i);if((e.width!=s||e.height!=a)&&(e.width=s,e.height=a),this.context.gl.viewport(0,0,e.width,e.height),t===re.Expand)this.camera.setViewport(s,a);else if(t===re.Fit){let c=e.width,n=e.height,r=this.camera.viewportWidth,o=this.camera.viewportHeight,l=o/r,h=n/c,d=l<h?r/c:o/n;this.camera.setViewport(c*d,n*d)}this.camera.update()}enableRenderer(t){this.activeRenderer!==t&&(this.end(),t instanceof Ii?(this.batcherShader.bind(),this.batcherShader.setUniform4x4f(bt.MVP_MATRIX,this.camera.projectionView.values),this.batcherShader.setUniformi("u_texture",0),this.batcher.begin(this.batcherShader),this.activeRenderer=this.batcher):t instanceof ki?(this.shapesShader.bind(),this.shapesShader.setUniform4x4f(bt.MVP_MATRIX,this.camera.projectionView.values),this.shapes.begin(this.shapesShader),this.activeRenderer=this.shapes):this.activeRenderer=this.skeletonDebugRenderer)}dispose(){this.batcher.dispose(),this.batcherShader.dispose(),this.shapes.dispose(),this.shapesShader.dispose(),this.skeletonDebugRenderer.dispose()}},re;(function(t){t[t.Stretch=0]="Stretch",t[t.Expand=1]="Expand",t[t.Fit=2]="Fit"})(re||(re={}));var ge,ae,fs=0,lr=1,Xi=1,us=165,ms=108,$t=163,or=class{constructor(t){if(this.logo=null,this.spinner=null,this.angle=0,this.fadeOut=0,this.fadeIn=0,this.timeKeeper=new Pe,this.backgroundColor=new V(.135,.135,.135,1),this.tempColor=new V,this.renderer=t,this.timeKeeper.maxDelta=9,!ae){let e=navigator.userAgent.indexOf("Safari")>-1,i=()=>fs++;ae=new Image,ae.src=cr,e||(ae.crossOrigin="anonymous"),ae.onload=i,ge=new Image,ge.src=hr,e||(ge.crossOrigin="anonymous"),ge.onload=i}}draw(t=!1){if(fs<2||t&&this.fadeOut>Xi)return;this.timeKeeper.update();let e=Math.abs(Math.sin(this.timeKeeper.totalTime+.25));this.angle-=this.timeKeeper.delta*200*(1+1.5*Math.pow(e,5));let i=this.tempColor,s=this.renderer,a=s.canvas,c=s.context.gl;if(s.resize(re.Expand),s.camera.position.set(a.width/2,a.height/2,0),s.batcher.setBlendMode(c.ONE,c.ONE,c.ONE_MINUS_SRC_ALPHA),t){if(this.fadeOut+=this.timeKeeper.delta*(this.timeKeeper.totalTime<1?2:1),this.fadeOut>Xi)return;i.setFromColor(this.backgroundColor),e=1-this.fadeOut/Xi,e=1-(e-1)*(e-1),i.a*=e,i.a>0&&(s.camera.zoom=1,s.begin(),s.quad(!0,0,0,a.width,0,a.width,a.height,0,a.height,i,i,i,i),s.end())}else this.fadeIn+=this.timeKeeper.delta,this.backgroundColor.a>0&&(c.clearColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),c.clear(c.COLOR_BUFFER_BIT)),e=1;e*=Math.min(this.fadeIn/lr,1),i.set(e,e,e,e),this.logo||(this.logo=new me(s.context,ae),this.spinner=new me(s.context,ge)),s.camera.zoom=Math.max(1,$t/a.height),s.begin(),s.drawTexture(this.logo,(a.width-us)/2,(a.height-ms)/2,us,ms,i),s.drawTextureRotated(this.spinner,(a.width-$t)/2,(a.height-$t)/2,$t,$t,$t/2,$t/2,this.angle,i),s.end()}},hr="data:image/png;base64,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",cr="data:image/png;base64,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",dr=class{constructor(t,e){this.time=new Pe,e.pathPrefix===void 0&&(e.pathPrefix=""),e.app===void 0&&(e.app={loadAssets:()=>{},initialize:()=>{},update:()=>{},render:()=>{},error:()=>{}}),e.webglConfig===void 0&&(e.webglConfig={alpha:!0}),this.htmlCanvas=t,this.context=new vt(t,e.webglConfig),this.renderer=new ds(t,this.context),this.gl=this.context.gl,this.assetManager=new ns(this.context,e.pathPrefix),this.input=new Ti(t),e.app.loadAssets(this);let i=()=>{requestAnimationFrame(i),this.time.update(),e.app.update(this,this.time.delta),e.app.render(this)},s=()=>{if(this.assetManager.isLoadingComplete()){this.assetManager.hasErrors()?e.app.error(this,this.assetManager.getErrors()):(e.app.initialize(this),i());return}requestAnimationFrame(s)};requestAnimationFrame(s)}clear(t,e,i,s){this.gl.clearColor(t,e,i,s),this.gl.clear(this.gl.COLOR_BUFFER_BIT)}};return Bi})();
84
+ `;return new ue(e,t,i)}},be=ue;be.MVP_MATRIX="u_projTrans",be.POSITION="a_position",be.COLOR="a_color",be.COLOR2="a_color2",be.TEXCOORDS="a_texCoords",be.SAMPLER="u_texture";var Ei=class{constructor(e,t,i,s){this.attributes=t,this.verticesLength=0,this.dirtyVertices=!1,this.indicesLength=0,this.dirtyIndices=!1,this.elementsPerVertex=0,this.context=e instanceof ve?e:new ve(e),this.elementsPerVertex=0;for(let r=0;r<t.length;r++)this.elementsPerVertex+=t[r].numElements;this.vertices=new Float32Array(i*this.elementsPerVertex),this.indices=new Uint16Array(s),this.context.addRestorable(this)}getAttributes(){return this.attributes}maxVertices(){return this.vertices.length/this.elementsPerVertex}numVertices(){return this.verticesLength/this.elementsPerVertex}setVerticesLength(e){this.dirtyVertices=!0,this.verticesLength=e}getVertices(){return this.vertices}maxIndices(){return this.indices.length}numIndices(){return this.indicesLength}setIndicesLength(e){this.dirtyIndices=!0,this.indicesLength=e}getIndices(){return this.indices}getVertexSizeInFloats(){let e=0;for(var t=0;t<this.attributes.length;t++)e+=this.attributes[t].numElements;return e}setVertices(e){if(this.dirtyVertices=!0,e.length>this.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(e,0),this.verticesLength=e.length}setIndices(e){if(this.dirtyIndices=!0,e.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(e,0),this.indicesLength=e.length}draw(e,t){this.drawWithOffset(e,t,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)}drawWithOffset(e,t,i,s){let r=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(e),this.indicesLength>0?r.drawElements(t,s,r.UNSIGNED_SHORT,i*2):r.drawArrays(t,i,s),this.unbind(e)}bind(e){let t=this.context.gl;t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer);let i=0;for(let s=0;s<this.attributes.length;s++){let r=this.attributes[s],c=e.getAttributeLocation(r.name);t.enableVertexAttribArray(c),t.vertexAttribPointer(c,r.numElements,t.FLOAT,!1,this.elementsPerVertex*4,i*4),i+=r.numElements}this.indicesLength>0&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)}unbind(e){let t=this.context.gl;for(let i=0;i<this.attributes.length;i++){let s=this.attributes[i],r=e.getAttributeLocation(s.name);t.disableVertexAttribArray(r)}t.bindBuffer(t.ARRAY_BUFFER,null),this.indicesLength>0&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}update(){let e=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=e.createBuffer()),e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),e.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=e.createBuffer()),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),e.DYNAMIC_DRAW),this.dirtyIndices=!1)}restore(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()}dispose(){this.context.removeRestorable(this);let e=this.context.gl;e.deleteBuffer(this.verticesBuffer),e.deleteBuffer(this.indicesBuffer)}},nt=class{constructor(e,t,i){this.name=e,this.type=t,this.numElements=i}},Et=class extends nt{constructor(){super(be.POSITION,He.Float,2)}},fr=class extends nt{constructor(){super(be.POSITION,He.Float,3)}},Fi=class extends nt{constructor(e=0){super(be.TEXCOORDS+(e==0?"":e),He.Float,2)}},Ft=class extends nt{constructor(){super(be.COLOR,He.Float,4)}},gs=class extends nt{constructor(){super(be.COLOR2,He.Float,4)}},He;(function(e){e[e.Float=0]="Float"})(He||(He={}));var Xi=class{constructor(e,t=!0,i=10920){if(this.isDrawing=!1,this.shader=null,this.lastTexture=null,this.verticesLength=0,this.indicesLength=0,i>10920)throw new Error("Can't have more than 10920 triangles per batch: "+i);this.context=e instanceof ve?e:new ve(e);let s=t?[new Et,new Ft,new Fi,new gs]:[new Et,new Ft,new Fi];this.mesh=new Ei(e,s,i,i*3);let r=this.context.gl;this.srcColorBlend=r.SRC_ALPHA,this.srcAlphaBlend=r.ONE,this.dstBlend=r.ONE_MINUS_SRC_ALPHA}begin(e){if(this.isDrawing)throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=e,this.lastTexture=null,this.isDrawing=!0;let t=this.context.gl;t.enable(t.BLEND),t.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend)}setBlendMode(e,t,i){this.srcColorBlend==e&&this.srcAlphaBlend==t&&this.dstBlend==i||(this.srcColorBlend=e,this.srcAlphaBlend=t,this.dstBlend=i,this.isDrawing&&(this.flush(),this.context.gl.blendFuncSeparate(e,i,t,i)))}draw(e,t,i){e!=this.lastTexture?(this.flush(),this.lastTexture=e):(this.verticesLength+t.length>this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();let s=this.mesh.numVertices();this.mesh.getVertices().set(t,this.verticesLength),this.verticesLength+=t.length,this.mesh.setVerticesLength(this.verticesLength);let r=this.mesh.getIndices();for(let c=this.indicesLength,n=0;n<i.length;c++,n++)r[c]=i[n]+s;this.indicesLength+=i.length,this.mesh.setIndicesLength(this.indicesLength)}flush(){this.verticesLength!=0&&(this.lastTexture.bind(),this.mesh.draw(this.shader,this.context.gl.TRIANGLES),this.verticesLength=0,this.indicesLength=0,this.mesh.setVerticesLength(0),this.mesh.setIndicesLength(0),this.drawCalls++)}end(){if(!this.isDrawing)throw new Error("PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()");(this.verticesLength>0||this.indicesLength>0)&&this.flush(),this.shader=null,this.lastTexture=null,this.isDrawing=!1;let e=this.context.gl;e.disable(e.BLEND)}getDrawCalls(){return this.drawCalls}dispose(){this.mesh.dispose()}},Li=class{constructor(e,t=10920){if(this.isDrawing=!1,this.shapeType=ye.Filled,this.color=new V(1,1,1,1),this.vertexIndex=0,this.tmp=new ft,t>10920)throw new Error("Can't have more than 10920 triangles per batch: "+t);this.context=e instanceof ve?e:new ve(e),this.mesh=new Ei(e,[new Et,new Ft],t,0);let i=this.context.gl;this.srcColorBlend=i.SRC_ALPHA,this.srcAlphaBlend=i.ONE,this.dstBlend=i.ONE_MINUS_SRC_ALPHA}begin(e){if(this.isDrawing)throw new Error("ShapeRenderer.begin() has already been called");this.shader=e,this.vertexIndex=0,this.isDrawing=!0;let t=this.context.gl;t.enable(t.BLEND),t.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend)}setBlendMode(e,t,i){this.srcColorBlend=e,this.srcAlphaBlend=t,this.dstBlend=i,this.isDrawing&&(this.flush(),this.context.gl.blendFuncSeparate(e,i,t,i))}setColor(e){this.color.setFromColor(e)}setColorWith(e,t,i,s){this.color.set(e,t,i,s)}point(e,t,i=null){this.check(ye.Point,1),i===null&&(i=this.color),this.vertex(e,t,i)}line(e,t,i,s,r=null){this.check(ye.Line,2);let c=this.mesh.getVertices(),n=this.vertexIndex;r===null&&(r=this.color),this.vertex(e,t,r),this.vertex(i,s,r)}triangle(e,t,i,s,r,c,n,a=null,l=null,o=null){this.check(e?ye.Filled:ye.Line,3);let h=this.mesh.getVertices(),d=this.vertexIndex;a===null&&(a=this.color),l===null&&(l=this.color),o===null&&(o=this.color),e?(this.vertex(t,i,a),this.vertex(s,r,l),this.vertex(c,n,o)):(this.vertex(t,i,a),this.vertex(s,r,l),this.vertex(s,r,a),this.vertex(c,n,l),this.vertex(c,n,a),this.vertex(t,i,l))}quad(e,t,i,s,r,c,n,a,l,o=null,h=null,d=null,u=null){this.check(e?ye.Filled:ye.Line,3);let f=this.mesh.getVertices(),m=this.vertexIndex;o===null&&(o=this.color),h===null&&(h=this.color),d===null&&(d=this.color),u===null&&(u=this.color),e?(this.vertex(t,i,o),this.vertex(s,r,h),this.vertex(c,n,d),this.vertex(c,n,d),this.vertex(a,l,u),this.vertex(t,i,o)):(this.vertex(t,i,o),this.vertex(s,r,h),this.vertex(s,r,h),this.vertex(c,n,d),this.vertex(c,n,d),this.vertex(a,l,u),this.vertex(a,l,u),this.vertex(t,i,o))}rect(e,t,i,s,r,c=null){this.quad(e,t,i,t+s,i,t+s,i+r,t,i+r,c,c,c,c)}rectLine(e,t,i,s,r,c,n=null){this.check(e?ye.Filled:ye.Line,8),n===null&&(n=this.color);let a=this.tmp.set(r-i,t-s);a.normalize(),c*=.5;let l=a.x*c,o=a.y*c;e?(this.vertex(t+l,i+o,n),this.vertex(t-l,i-o,n),this.vertex(s+l,r+o,n),this.vertex(s-l,r-o,n),this.vertex(s+l,r+o,n),this.vertex(t-l,i-o,n)):(this.vertex(t+l,i+o,n),this.vertex(t-l,i-o,n),this.vertex(s+l,r+o,n),this.vertex(s-l,r-o,n),this.vertex(s+l,r+o,n),this.vertex(t+l,i+o,n),this.vertex(s-l,r-o,n),this.vertex(t-l,i-o,n))}x(e,t,i){this.line(e-i,t-i,e+i,t+i),this.line(e-i,t+i,e+i,t-i)}polygon(e,t,i,s=null){if(i<3)throw new Error("Polygon must contain at least 3 vertices");this.check(ye.Line,i*2),s===null&&(s=this.color);let r=this.mesh.getVertices(),c=this.vertexIndex;t<<=1,i<<=1;let n=e[t],a=e[t+1],l=t+i;for(let o=t,h=t+i-2;o<h;o+=2){let d=e[o],u=e[o+1],f=0,m=0;o+2>=l?(f=n,m=a):(f=e[o+2],m=e[o+3]),this.vertex(d,u,s),this.vertex(f,m,s)}}circle(e,t,i,s,r=null,c=0){if(c===0&&(c=Math.max(1,6*F.cbrt(s)|0)),c<=0)throw new Error("segments must be > 0.");r===null&&(r=this.color);let n=2*F.PI/c,a=Math.cos(n),l=Math.sin(n),o=s,h=0;if(e){this.check(ye.Filled,c*3+3),c--;for(let u=0;u<c;u++){this.vertex(t,i,r),this.vertex(t+o,i+h,r);let f=o;o=a*o-l*h,h=l*f+a*h,this.vertex(t+o,i+h,r)}this.vertex(t,i,r),this.vertex(t+o,i+h,r)}else{this.check(ye.Line,c*2+2);for(let u=0;u<c;u++){this.vertex(t+o,i+h,r);let f=o;o=a*o-l*h,h=l*f+a*h,this.vertex(t+o,i+h,r)}this.vertex(t+o,i+h,r)}let d=o;o=s,h=0,this.vertex(t+o,i+h,r)}curve(e,t,i,s,r,c,n,a,l,o=null){this.check(ye.Line,l*2+2),o===null&&(o=this.color);let h=1/l,d=h*h,u=h*h*h,f=3*h,m=3*d,x=6*d,w=6*u,v=e-i*2+r,g=t-s*2+c,b=(i-r)*3-e+n,p=(s-c)*3-t+a,y=e,T=t,A=(i-e)*f+v*m+b*u,Y=(s-t)*f+g*m+p*u,k=v*x+b*w,R=g*x+p*w,P=b*w,X=p*w;for(;l-- >0;)this.vertex(y,T,o),y+=A,T+=Y,A+=k,Y+=R,k+=P,R+=X,this.vertex(y,T,o);this.vertex(y,T,o),this.vertex(n,a,o)}vertex(e,t,i){let s=this.vertexIndex,r=this.mesh.getVertices();r[s++]=e,r[s++]=t,r[s++]=i.r,r[s++]=i.g,r[s++]=i.b,r[s++]=i.a,this.vertexIndex=s}end(){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");this.flush();let e=this.context.gl;e.disable(e.BLEND),this.isDrawing=!1}flush(){this.vertexIndex!=0&&(this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0)}check(e,t){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");if(this.shapeType==e)if(this.mesh.maxVertices()-this.mesh.numVertices()<t)this.flush();else return;else this.flush(),this.shapeType=e}dispose(){this.mesh.dispose()}},ye;(function(e){e[e.Point=0]="Point",e[e.Line=1]="Line",e[e.Filled=4]="Filled"})(ye||(ye={}));var Xt=class{constructor(e){this.boneLineColor=new V(1,0,0,1),this.boneOriginColor=new V(0,1,0,1),this.attachmentLineColor=new V(0,0,1,.5),this.triangleLineColor=new V(1,.64,0,.5),this.pathColor=new V().setFromString("FF7F00"),this.clipColor=new V(.8,0,0,2),this.aabbColor=new V(0,1,0,.5),this.drawBones=!0,this.drawRegionAttachments=!0,this.drawBoundingBoxes=!0,this.drawMeshHull=!0,this.drawMeshTriangles=!0,this.drawPaths=!0,this.drawSkeletonXY=!1,this.drawClipping=!0,this.premultipliedAlpha=!1,this.scale=1,this.boneWidth=2,this.bounds=new os,this.temp=new Array,this.vertices=D.newFloatArray(2*1024),this.context=e instanceof ve?e:new ve(e)}draw(e,t,i=null){let s=t.x,r=t.y,c=this.context.gl,n=this.premultipliedAlpha?c.ONE:c.SRC_ALPHA;e.setBlendMode(n,c.ONE,c.ONE_MINUS_SRC_ALPHA);let a=t.bones;if(this.drawBones){e.setColor(this.boneLineColor);for(let l=0,o=a.length;l<o;l++){let h=a[l];if(i&&i.indexOf(h.data.name)>-1||!h.parent)continue;let d=h.data.length*h.a+h.worldX,u=h.data.length*h.c+h.worldY;e.rectLine(!0,h.worldX,h.worldY,d,u,this.boneWidth*this.scale)}this.drawSkeletonXY&&e.x(s,r,4*this.scale)}if(this.drawRegionAttachments){e.setColor(this.attachmentLineColor);let l=t.slots;for(let o=0,h=l.length;o<h;o++){let d=l[o],u=d.getAttachment();if(u instanceof ne){let f=u,m=this.vertices;f.computeWorldVertices(d,m,0,2),e.line(m[0],m[1],m[2],m[3]),e.line(m[2],m[3],m[4],m[5]),e.line(m[4],m[5],m[6],m[7]),e.line(m[6],m[7],m[0],m[1])}}}if(this.drawMeshHull||this.drawMeshTriangles){let l=t.slots;for(let o=0,h=l.length;o<h;o++){let d=l[o];if(!d.bone.active)continue;let u=d.getAttachment();if(!(u instanceof Ge))continue;let f=u,m=this.vertices;f.computeWorldVertices(d,0,f.worldVerticesLength,m,0,2);let x=f.triangles,w=f.hullLength;if(this.drawMeshTriangles){e.setColor(this.triangleLineColor);for(let v=0,g=x.length;v<g;v+=3){let b=x[v]*2,p=x[v+1]*2,y=x[v+2]*2;e.triangle(!1,m[b],m[b+1],m[p],m[p+1],m[y],m[y+1])}}if(this.drawMeshHull&&w>0){e.setColor(this.attachmentLineColor),w=(w>>1)*2;let v=m[w-2],g=m[w-1];for(let b=0,p=w;b<p;b+=2){let y=m[b],T=m[b+1];e.line(y,T,v,g),v=y,g=T}}}}if(this.drawBoundingBoxes){let l=this.bounds;l.update(t,!0),e.setColor(this.aabbColor),e.rect(!1,l.minX,l.minY,l.getWidth(),l.getHeight());let o=l.polygons,h=l.boundingBoxes;for(let d=0,u=o.length;d<u;d++){let f=o[d];e.setColor(h[d].color),e.polygon(f,0,f.length)}}if(this.drawPaths){let l=t.slots;for(let o=0,h=l.length;o<h;o++){let d=l[o];if(!d.bone.active)continue;let u=d.getAttachment();if(!(u instanceof $e))continue;let f=u,m=f.worldVerticesLength,x=this.temp=D.setArraySize(this.temp,m,0);f.computeWorldVertices(d,0,m,x,0,2);let w=this.pathColor,v=x[2],g=x[3],b=0,p=0;if(f.closed){e.setColor(w);let y=x[0],T=x[1],A=x[m-2],Y=x[m-1];b=x[m-4],p=x[m-3],e.curve(v,g,y,T,A,Y,b,p,32),e.setColor(Xt.LIGHT_GRAY),e.line(v,g,y,T),e.line(b,p,A,Y)}m-=4;for(let y=4;y<m;y+=6){let T=x[y],A=x[y+1],Y=x[y+2],k=x[y+3];b=x[y+4],p=x[y+5],e.setColor(w),e.curve(v,g,T,A,Y,k,b,p,32),e.setColor(Xt.LIGHT_GRAY),e.line(v,g,T,A),e.line(b,p,Y,k),v=b,g=p}}}if(this.drawBones){e.setColor(this.boneOriginColor);for(let l=0,o=a.length;l<o;l++){let h=a[l];i&&i.indexOf(h.data.name)>-1||e.circle(!0,h.worldX,h.worldY,3*this.scale,Xt.GREEN,8)}}if(this.drawClipping){let l=t.slots;e.setColor(this.clipColor);for(let o=0,h=l.length;o<h;o++){let d=l[o];if(!d.bone.active)continue;let u=d.getAttachment();if(!(u instanceof xt))continue;let f=u,m=f.worldVerticesLength,x=this.temp=D.setArraySize(this.temp,m,0);f.computeWorldVertices(d,0,m,x,0,2);for(let w=0,v=x.length;w<v;w+=2){let g=x[w],b=x[w+1],p=x[(w+2)%x.length],y=x[(w+3)%x.length];e.line(g,b,p,y)}}}}dispose(){}},Lt=Xt;Lt.LIGHT_GRAY=new V(192/255,192/255,192/255,1),Lt.GREEN=new V(0,1,0,1);var mr=class{constructor(e,t,i){this.vertices=e,this.numVertices=t,this.numFloats=i}},xs=class{constructor(e,t=!0){this.premultipliedAlpha=!1,this.vertexEffect=null,this.tempColor=new V,this.tempColor2=new V,this.vertexSize=2+2+4,this.twoColorTint=!1,this.renderable=new mr(null,0,0),this.clipper=new Yt,this.temp=new ft,this.temp2=new ft,this.temp3=new V,this.temp4=new V,this.twoColorTint=t,t&&(this.vertexSize+=4),this.vertices=D.newFloatArray(this.vertexSize*1024)}draw(e,t,i=-1,s=-1){let r=this.clipper,c=this.premultipliedAlpha,n=this.twoColorTint,a=null,l=this.temp,o=this.temp2,h=this.temp3,d=this.temp4,u=this.renderable,f=null,m=null,x=t.drawOrder,w=null,v=t.color,g=n?12:8,b=!1;i==-1&&(b=!0);for(let p=0,y=x.length;p<y;p++){let T=r.isClipping()?2:g,A=x[p];if(!A.bone.active){r.clipEndWithSlot(A);continue}if(i>=0&&i==A.data.index&&(b=!0),!b){r.clipEndWithSlot(A);continue}s>=0&&s==A.data.index&&(b=!1);let Y=A.getAttachment(),k=null;if(Y instanceof ne){let R=Y;u.vertices=this.vertices,u.numVertices=4,u.numFloats=T<<2,R.computeWorldVertices(A,u.vertices,0,T),m=xs.QUAD_TRIANGLES,f=R.uvs,k=R.region.renderObject.page.texture,w=R.color}else if(Y instanceof Ge){let R=Y;u.vertices=this.vertices,u.numVertices=R.worldVerticesLength>>1,u.numFloats=u.numVertices*T,u.numFloats>u.vertices.length&&(u.vertices=this.vertices=D.newFloatArray(u.numFloats)),R.computeWorldVertices(A,0,R.worldVerticesLength,u.vertices,0,T),m=R.triangles,k=R.region.renderObject.page.texture,f=R.uvs,w=R.color}else if(Y instanceof xt){let R=Y;r.clipStart(A,R);continue}else{r.clipEndWithSlot(A);continue}if(k){let R=A.color,P=this.tempColor;P.r=v.r*R.r*w.r,P.g=v.g*R.g*w.g,P.b=v.b*R.b*w.b,P.a=v.a*R.a*w.a,c&&(P.r*=P.a,P.g*=P.a,P.b*=P.a);let X=this.tempColor2;A.darkColor?(c?(X.r=A.darkColor.r*P.a,X.g=A.darkColor.g*P.a,X.b=A.darkColor.b*P.a):X.setFromColor(A.darkColor),X.a=c?1:0):X.set(0,0,0,1);let B=A.data.blendMode;if(B!=a&&(a=B,e.setBlendMode(Rt.getSourceColorGLBlendMode(a,c),Rt.getSourceAlphaGLBlendMode(a),Rt.getDestGLBlendMode(a))),r.isClipping()){r.clipTriangles(u.vertices,u.numFloats,m,m.length,f,P,X,n);let C=new Float32Array(r.clippedVertices),I=r.clippedTriangles;if(this.vertexEffect){let O=this.vertexEffect,E=C;if(n)for(let L=0,se=C.length;L<se;L+=g)l.x=E[L],l.y=E[L+1],h.set(E[L+2],E[L+3],E[L+4],E[L+5]),o.x=E[L+6],o.y=E[L+7],d.set(E[L+8],E[L+9],E[L+10],E[L+11]),O.transform(l,o,h,d),E[L]=l.x,E[L+1]=l.y,E[L+2]=h.r,E[L+3]=h.g,E[L+4]=h.b,E[L+5]=h.a,E[L+6]=o.x,E[L+7]=o.y,E[L+8]=d.r,E[L+9]=d.g,E[L+10]=d.b,E[L+11]=d.a;else for(let L=0,se=C.length;L<se;L+=g)l.x=E[L],l.y=E[L+1],h.set(E[L+2],E[L+3],E[L+4],E[L+5]),o.x=E[L+6],o.y=E[L+7],d.set(0,0,0,0),O.transform(l,o,h,d),E[L]=l.x,E[L+1]=l.y,E[L+2]=h.r,E[L+3]=h.g,E[L+4]=h.b,E[L+5]=h.a,E[L+6]=o.x,E[L+7]=o.y}e.draw(k,C,I)}else{let C=u.vertices;if(this.vertexEffect){let O=this.vertexEffect;if(n)for(let E=0,L=0,se=u.numFloats;E<se;E+=g,L+=2)l.x=C[E],l.y=C[E+1],o.x=f[L],o.y=f[L+1],h.setFromColor(P),d.setFromColor(X),O.transform(l,o,h,d),C[E]=l.x,C[E+1]=l.y,C[E+2]=h.r,C[E+3]=h.g,C[E+4]=h.b,C[E+5]=h.a,C[E+6]=o.x,C[E+7]=o.y,C[E+8]=d.r,C[E+9]=d.g,C[E+10]=d.b,C[E+11]=d.a;else for(let E=0,L=0,se=u.numFloats;E<se;E+=g,L+=2)l.x=C[E],l.y=C[E+1],o.x=f[L],o.y=f[L+1],h.setFromColor(P),d.set(0,0,0,0),O.transform(l,o,h,d),C[E]=l.x,C[E+1]=l.y,C[E+2]=h.r,C[E+3]=h.g,C[E+4]=h.b,C[E+5]=h.a,C[E+6]=o.x,C[E+7]=o.y}else if(n)for(let O=2,E=0,L=u.numFloats;O<L;O+=g,E+=2)C[O]=P.r,C[O+1]=P.g,C[O+2]=P.b,C[O+3]=P.a,C[O+4]=f[E],C[O+5]=f[E+1],C[O+6]=X.r,C[O+7]=X.g,C[O+8]=X.b,C[O+9]=X.a;else for(let O=2,E=0,L=u.numFloats;O<L;O+=g,E+=2)C[O]=P.r,C[O+1]=P.g,C[O+2]=P.b,C[O+3]=P.a,C[O+4]=f[E],C[O+5]=f[E+1];let I=u.vertices.subarray(0,u.numFloats);e.draw(k,I,m)}}r.clipEndWithSlot(A)}r.clipEnd()}},Bi=xs;Bi.QUAD_TRIANGLES=[0,1,2,2,3,0];var S=[0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0],Bt=[0,1,2,2,3,0],Pt=new V(1,1,1,1),bs=class{constructor(e,t,i=!0){this.twoColorTint=!1,this.canvas=e,this.context=t instanceof ve?t:new ve(t),this.twoColorTint=i,this.camera=new fs(e.width,e.height),this.batcherShader=i?be.newTwoColoredTextured(this.context):be.newColoredTextured(this.context),this.batcher=new Xi(this.context,i),this.shapesShader=be.newColored(this.context),this.shapes=new Li(this.context),this.skeletonRenderer=new Bi(this.context,i),this.skeletonDebugRenderer=new Lt(this.context)}begin(){this.camera.update(),this.enableRenderer(this.batcher)}drawSkeleton(e,t=!1,i=-1,s=-1){this.enableRenderer(this.batcher),this.skeletonRenderer.premultipliedAlpha=t,this.skeletonRenderer.draw(this.batcher,e,i,s)}drawSkeletonDebug(e,t=!1,i=null){this.enableRenderer(this.shapes),this.skeletonDebugRenderer.premultipliedAlpha=t,this.skeletonDebugRenderer.draw(this.shapes,e,i)}drawTexture(e,t,i,s,r,c=null){this.enableRenderer(this.batcher),c===null&&(c=Pt);var n=0;S[n++]=t,S[n++]=i,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=0,S[n++]=1,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n++]=0),S[n++]=t+s,S[n++]=i,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=1,S[n++]=1,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n++]=0),S[n++]=t+s,S[n++]=i+r,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=1,S[n++]=0,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n++]=0),S[n++]=t,S[n++]=i+r,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=0,S[n++]=0,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n]=0),this.batcher.draw(e,S,Bt)}drawTextureUV(e,t,i,s,r,c,n,a,l,o=null){this.enableRenderer(this.batcher),o===null&&(o=Pt);var h=0;S[h++]=t,S[h++]=i,S[h++]=o.r,S[h++]=o.g,S[h++]=o.b,S[h++]=o.a,S[h++]=c,S[h++]=n,this.twoColorTint&&(S[h++]=0,S[h++]=0,S[h++]=0,S[h++]=0),S[h++]=t+s,S[h++]=i,S[h++]=o.r,S[h++]=o.g,S[h++]=o.b,S[h++]=o.a,S[h++]=a,S[h++]=n,this.twoColorTint&&(S[h++]=0,S[h++]=0,S[h++]=0,S[h++]=0),S[h++]=t+s,S[h++]=i+r,S[h++]=o.r,S[h++]=o.g,S[h++]=o.b,S[h++]=o.a,S[h++]=a,S[h++]=l,this.twoColorTint&&(S[h++]=0,S[h++]=0,S[h++]=0,S[h++]=0),S[h++]=t,S[h++]=i+r,S[h++]=o.r,S[h++]=o.g,S[h++]=o.b,S[h++]=o.a,S[h++]=c,S[h++]=l,this.twoColorTint&&(S[h++]=0,S[h++]=0,S[h++]=0,S[h]=0),this.batcher.draw(e,S,Bt)}drawTextureRotated(e,t,i,s,r,c,n,a,l=null){this.enableRenderer(this.batcher),l===null&&(l=Pt);let o=t+c,h=i+n,d=-c,u=-n,f=s-c,m=r-n,x=d,w=u,v=d,g=m,b=f,p=m,y=f,T=u,A=0,Y=0,k=0,R=0,P=0,X=0,B=0,C=0;if(a!=0){let O=F.cosDeg(a),E=F.sinDeg(a);A=O*x-E*w,Y=E*x+O*w,B=O*v-E*g,C=E*v+O*g,P=O*b-E*p,X=E*b+O*p,k=P+(A-B),R=X+(Y-C)}else A=x,Y=w,B=v,C=g,P=b,X=p,k=y,R=T;A+=o,Y+=h,k+=o,R+=h,P+=o,X+=h,B+=o,C+=h;var I=0;S[I++]=A,S[I++]=Y,S[I++]=l.r,S[I++]=l.g,S[I++]=l.b,S[I++]=l.a,S[I++]=0,S[I++]=1,this.twoColorTint&&(S[I++]=0,S[I++]=0,S[I++]=0,S[I++]=0),S[I++]=k,S[I++]=R,S[I++]=l.r,S[I++]=l.g,S[I++]=l.b,S[I++]=l.a,S[I++]=1,S[I++]=1,this.twoColorTint&&(S[I++]=0,S[I++]=0,S[I++]=0,S[I++]=0),S[I++]=P,S[I++]=X,S[I++]=l.r,S[I++]=l.g,S[I++]=l.b,S[I++]=l.a,S[I++]=1,S[I++]=0,this.twoColorTint&&(S[I++]=0,S[I++]=0,S[I++]=0,S[I++]=0),S[I++]=B,S[I++]=C,S[I++]=l.r,S[I++]=l.g,S[I++]=l.b,S[I++]=l.a,S[I++]=0,S[I++]=0,this.twoColorTint&&(S[I++]=0,S[I++]=0,S[I++]=0,S[I]=0),this.batcher.draw(e,S,Bt)}drawRegion(e,t,i,s,r,c=null){this.enableRenderer(this.batcher),c===null&&(c=Pt);var n=0;S[n++]=t,S[n++]=i,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=e.u,S[n++]=e.v2,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n++]=0),S[n++]=t+s,S[n++]=i,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=e.u2,S[n++]=e.v2,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n++]=0),S[n++]=t+s,S[n++]=i+r,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=e.u2,S[n++]=e.v,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n++]=0),S[n++]=t,S[n++]=i+r,S[n++]=c.r,S[n++]=c.g,S[n++]=c.b,S[n++]=c.a,S[n++]=e.u,S[n++]=e.v,this.twoColorTint&&(S[n++]=0,S[n++]=0,S[n++]=0,S[n]=0),this.batcher.draw(e.page.texture,S,Bt)}line(e,t,i,s,r=null,c=null){this.enableRenderer(this.shapes),this.shapes.line(e,t,i,s,r)}triangle(e,t,i,s,r,c,n,a=null,l=null,o=null){this.enableRenderer(this.shapes),this.shapes.triangle(e,t,i,s,r,c,n,a,l,o)}quad(e,t,i,s,r,c,n,a,l,o=null,h=null,d=null,u=null){this.enableRenderer(this.shapes),this.shapes.quad(e,t,i,s,r,c,n,a,l,o,h,d,u)}rect(e,t,i,s,r,c=null){this.enableRenderer(this.shapes),this.shapes.rect(e,t,i,s,r,c)}rectLine(e,t,i,s,r,c,n=null){this.enableRenderer(this.shapes),this.shapes.rectLine(e,t,i,s,r,c,n)}polygon(e,t,i,s=null){this.enableRenderer(this.shapes),this.shapes.polygon(e,t,i,s)}circle(e,t,i,s,r=null,c=0){this.enableRenderer(this.shapes),this.shapes.circle(e,t,i,s,r,c)}curve(e,t,i,s,r,c,n,a,l,o=null){this.enableRenderer(this.shapes),this.shapes.curve(e,t,i,s,r,c,n,a,l,o)}end(){this.activeRenderer===this.batcher?this.batcher.end():this.activeRenderer===this.shapes&&this.shapes.end(),this.activeRenderer=null}resize(e){let t=this.canvas;var i=window.devicePixelRatio||1,s=Math.round(t.clientWidth*i),r=Math.round(t.clientHeight*i);if((t.width!=s||t.height!=r)&&(t.width=s,t.height=r),this.context.gl.viewport(0,0,t.width,t.height),e===lt.Expand)this.camera.setViewport(s,r);else if(e===lt.Fit){let c=t.width,n=t.height,a=this.camera.viewportWidth,l=this.camera.viewportHeight,o=l/a,h=n/c,d=o<h?a/c:l/n;this.camera.setViewport(c*d,n*d)}this.camera.update()}enableRenderer(e){this.activeRenderer!==e&&(this.end(),e instanceof Xi?(this.batcherShader.bind(),this.batcherShader.setUniform4x4f(be.MVP_MATRIX,this.camera.projectionView.values),this.batcherShader.setUniformi("u_texture",0),this.batcher.begin(this.batcherShader),this.activeRenderer=this.batcher):e instanceof Li?(this.shapesShader.bind(),this.shapesShader.setUniform4x4f(be.MVP_MATRIX,this.camera.projectionView.values),this.shapes.begin(this.shapesShader),this.activeRenderer=this.shapes):this.activeRenderer=this.skeletonDebugRenderer)}dispose(){this.batcher.dispose(),this.batcherShader.dispose(),this.shapes.dispose(),this.shapesShader.dispose(),this.skeletonDebugRenderer.dispose()}},lt;(function(e){e[e.Stretch=0]="Stretch",e[e.Expand=1]="Expand",e[e.Fit=2]="Fit"})(lt||(lt={}));var pt,ot,ps=0,gr=1,Pi=1,ws=165,vs=108,tt=163,xr=class{constructor(e){if(this.logo=null,this.spinner=null,this.angle=0,this.fadeOut=0,this.fadeIn=0,this.timeKeeper=new Nt,this.backgroundColor=new V(.135,.135,.135,1),this.tempColor=new V,this.renderer=e,this.timeKeeper.maxDelta=9,!ot){let t=navigator.userAgent.indexOf("Safari")>-1,i=()=>ps++;ot=new Image,ot.src=pr,t||(ot.crossOrigin="anonymous"),ot.onload=i,pt=new Image,pt.src=br,t||(pt.crossOrigin="anonymous"),pt.onload=i}}draw(e=!1){if(ps<2||e&&this.fadeOut>Pi)return;this.timeKeeper.update();let t=Math.abs(Math.sin(this.timeKeeper.totalTime+.25));this.angle-=this.timeKeeper.delta*200*(1+1.5*Math.pow(t,5));let i=this.tempColor,s=this.renderer,r=s.canvas,c=s.context.gl;if(s.resize(lt.Expand),s.camera.position.set(r.width/2,r.height/2,0),s.batcher.setBlendMode(c.ONE,c.ONE,c.ONE_MINUS_SRC_ALPHA),e){if(this.fadeOut+=this.timeKeeper.delta*(this.timeKeeper.totalTime<1?2:1),this.fadeOut>Pi)return;i.setFromColor(this.backgroundColor),t=1-this.fadeOut/Pi,t=1-(t-1)*(t-1),i.a*=t,i.a>0&&(s.camera.zoom=1,s.begin(),s.quad(!0,0,0,r.width,0,r.width,r.height,0,r.height,i,i,i,i),s.end())}else this.fadeIn+=this.timeKeeper.delta,this.backgroundColor.a>0&&(c.clearColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),c.clear(c.COLOR_BUFFER_BIT)),t=1;t*=Math.min(this.fadeIn/gr,1),i.set(t,t,t,t),this.logo||(this.logo=new bt(s.context,ot),this.spinner=new bt(s.context,pt)),s.camera.zoom=Math.max(1,tt/r.height),s.begin(),s.drawTexture(this.logo,(r.width-ws)/2,(r.height-vs)/2,ws,vs,i),s.drawTextureRotated(this.spinner,(r.width-tt)/2,(r.height-tt)/2,tt,tt,tt/2,tt/2,this.angle,i),s.end()}},br="data:image/png;base64,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",pr="data:image/png;base64,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",wr=class{constructor(e,t){this.time=new Nt,t.pathPrefix===void 0&&(t.pathPrefix=""),t.app===void 0&&(t.app={loadAssets:()=>{},initialize:()=>{},update:()=>{},render:()=>{},error:()=>{}}),t.webglConfig===void 0&&(t.webglConfig={alpha:!0}),this.htmlCanvas=e,this.context=new ve(e,t.webglConfig),this.renderer=new bs(e,this.context),this.gl=this.context.gl,this.assetManager=new us(this.context,t.pathPrefix),this.input=new Ri(e),t.app.loadAssets(this);let i=()=>{requestAnimationFrame(i),this.time.update(),t.app.update(this,this.time.delta),t.app.render(this)},s=()=>{if(this.assetManager.isLoadingComplete()){this.assetManager.hasErrors()?t.app.error(this,this.assetManager.getErrors()):(t.app.initialize(this),i());return}requestAnimationFrame(s)};requestAnimationFrame(s)}clear(e,t,i,s){this.gl.clearColor(e,t,i,s),this.gl.clear(this.gl.COLOR_BUFFER_BIT)}};return Ni})();