var spine;!function(t){let e,s;t.Animation=class{constructor(t,e,s){if(!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=s}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds=new t.StringSet;for(var s=0;s<e.length;s++)this.timelineIds.addAll(e[s].getPropertyIds())}hasTimeline(t){for(let e=0;e<t.length;e++)if(this.timelineIds.contains(t[e]))return!0;return!1}apply(t,e,s,a,i,r,n,l){if(!t)throw new Error("skeleton cannot be null.");a&&0!=this.duration&&(s%=this.duration,e>0&&(e%=this.duration));let o=this.timelines;for(let a=0,h=o.length;a<h;a++)o[a].apply(t,e,s,i,r,n,l)}},function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(e=t.MixBlend||(t.MixBlend={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(s=t.MixDirection||(t.MixDirection={}));const a=0,i=1,r=2,n=3,l=4,o=5,h=6,d=7,c=8,u=9,m=10,f=11,g=12,p=13,x=14,b=15,w=16,y=17,M=18;class k{constructor(e,s){this.propertyIds=s,this.frames=t.Utils.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(t,e){let s=t.length;for(let a=1;a<s;a++)if(t[a]>e)return a-1;return s-1}static search(t,e,s){let a=t.length;for(let i=s;i<a;i+=s)if(t[i]>e)return i-s;return a-s}}t.Timeline=k;class A extends k{constructor(e,s,a){super(e,a),this.curves=t.Utils.newFloatArray(e+18*s),this.curves[e-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(e){let s=this.getFrameCount()+18*e;if(this.curves.length>s){let e=t.Utils.newFloatArray(s);t.Utils.arrayCopy(this.curves,0,e,0,s),this.curves=e}}setBezier(t,e,s,a,i,r,n,l,o,h,d){let c=this.curves,u=this.getFrameCount()+18*t;0==s&&(c[e]=2+u);let m=.03*(a-2*r+l),f=.03*(i-2*n+o),g=.006*(3*(r-l)-a+h),p=.006*(3*(n-o)-i+d),x=2*m+g,b=2*f+p,w=.3*(r-a)+m+.16666667*g,y=.3*(n-i)+f+.16666667*p,M=a+w,k=i+y;for(let t=u+18;u<t;u+=2)c[u]=M,c[u+1]=k,w+=x,y+=b,x+=g,b+=p,M+=w,k+=y}getBezierValue(t,e,s,a){let i=this.curves;if(i[a]>t){let r=this.frames[e],n=this.frames[e+s];return n+(t-r)/(i[a]-r)*(i[a+1]-n)}let r=a+18;for(a+=2;a<r;a+=2)if(i[a]>=t){let e=i[a-2],s=i[a-1];return s+(t-e)/(i[a]-e)*(i[a+1]-s)}e+=this.getFrameEntries();let n=i[r-2],l=i[r-1];return l+(t-n)/(this.frames[e]-n)*(this.frames[e+s]-l)}}t.CurveTimeline=A;class S extends A{constructor(t,e,s){super(t,e,[s])}getFrameEntries(){return 2}setFrame(t,e,s){t<<=1,this.frames[t]=e,this.frames[t+1]=s}getCurveValue(t){let e=this.frames,s=e.length-2;for(let a=2;a<=s;a+=2)if(e[a]>t){s=a-2;break}let a=this.curves[s>>1];switch(a){case 0:let a=e[s],i=e[s+1];return i+(t-a)/(e[s+2]-a)*(e[s+2+1]-i);case 1:return e[s+1]}return this.getBezierValue(t,s,1,a-2)}}t.CurveTimeline1=S;class T extends A{constructor(t,e,s,a){super(t,e,[s,a])}getFrameEntries(){return 3}setFrame(t,e,s,a){t*=3,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=a}}t.CurveTimeline2=T;t.RotateTimeline=class extends S{constructor(t,e,s){super(t,e,a+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,s,a,i,r,n,l){let o=t.bones[this.boneIndex];if(!o.active)return;if(a<this.frames[0]){switch(n){case e.setup:return void(o.rotation=o.data.rotation);case e.first:o.rotation+=(o.data.rotation-o.rotation)*r}return}let h=this.getCurveValue(a);switch(n){case e.setup:o.rotation=o.data.rotation+h*r;break;case e.first:case e.replace:h+=o.data.rotation-o.rotation;case e.add:o.rotation+=h*r}}};t.TranslateTimeline=class extends T{constructor(t,e,s){super(t,e,i+"|"+s,r+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,s,a,i,r,n,l){let o=t.bones[this.boneIndex];if(!o.active)return;let h=this.frames;if(a<h[0]){switch(n){case e.setup:return o.x=o.data.x,void(o.y=o.data.y);case e.first:o.x+=(o.data.x-o.x)*r,o.y+=(o.data.y-o.y)*r}return}let d=0,c=0,u=k.search(h,a,3),m=this.curves[u/3];switch(m){case 0:let t=h[u];d=h[u+1],c=h[u+2];let e=(a-t)/(h[u+3]-t);d+=(h[u+3+1]-d)*e,c+=(h[u+3+2]-c)*e;break;case 1:d=h[u+1],c=h[u+2];break;default:d=this.getBezierValue(a,u,1,m-2),c=this.getBezierValue(a,u,2,m+18-2)}switch(n){case e.setup:o.x=o.data.x+d*r,o.y=o.data.y+c*r;break;case e.first:case e.replace:o.x+=(o.data.x+d-o.x)*r,o.y+=(o.data.y+c-o.y)*r;break;case e.add:o.x+=d*r,o.y+=c*r}}};t.TranslateXTimeline=class extends S{constructor(t,e,s){super(t,e,i+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,s,a,i,r,n,l){let o=t.bones[this.boneIndex];if(!o.active)return;if(a<this.frames[0]){switch(n){case e.setup:return void(o.x=o.data.x);case e.first:o.x+=(o.data.x-o.x)*r}return}let h=this.getCurveValue(a);switch(n){case e.setup:o.x=o.data.x+h*r;break;case e.first:case e.replace:o.x+=(o.data.x+h-o.x)*r;break;case e.add:o.x+=h*r}}};t.TranslateYTimeline=class extends S{constructor(t,e,s){super(t,e,r+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,s,a,i,r,n,l){let o=t.bones[this.boneIndex];if(!o.active)return;if(a<this.frames[0]){switch(n){case e.setup:return void(o.y=o.data.y);case e.first:o.y+=(o.data.y-o.y)*r}return}let h=this.getCurveValue(a);switch(n){case e.setup:o.y=o.data.y+h*r;break;case e.first:case e.replace:o.y+=(o.data.y+h-o.y)*r;break;case e.add:o.y+=h*r}}};t.ScaleTimeline=class extends T{constructor(t,e,s){super(t,e,n+"|"+s,l+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(a,i,r,n,l,o,h){let d=a.bones[this.boneIndex];if(!d.active)return;let c,u,m=this.frames;if(r<m[0]){switch(o){case e.setup:return d.scaleX=d.data.scaleX,void(d.scaleY=d.data.scaleY);case e.first:d.scaleX+=(d.data.scaleX-d.scaleX)*l,d.scaleY+=(d.data.scaleY-d.scaleY)*l}return}let f=k.search(m,r,3),g=this.curves[f/3];switch(g){case 0:let t=m[f];c=m[f+1],u=m[f+2];let e=(r-t)/(m[f+3]-t);c+=(m[f+3+1]-c)*e,u+=(m[f+3+2]-u)*e;break;case 1:c=m[f+1],u=m[f+2];break;default:c=this.getBezierValue(r,f,1,g-2),u=this.getBezierValue(r,f,2,g+18-2)}if(c*=d.data.scaleX,u*=d.data.scaleY,1==l)o==e.add?(d.scaleX+=c-d.data.scaleX,d.scaleY+=u-d.data.scaleY):(d.scaleX=c,d.scaleY=u);else{let a=0,i=0;if(h==s.mixOut)switch(o){case e.setup:a=d.data.scaleX,i=d.data.scaleY,d.scaleX=a+(Math.abs(c)*t.MathUtils.signum(a)-a)*l,d.scaleY=i+(Math.abs(u)*t.MathUtils.signum(i)-i)*l;break;case e.first:case e.replace:a=d.scaleX,i=d.scaleY,d.scaleX=a+(Math.abs(c)*t.MathUtils.signum(a)-a)*l,d.scaleY=i+(Math.abs(u)*t.MathUtils.signum(i)-i)*l;break;case e.add:a=d.scaleX,i=d.scaleY,d.scaleX=a+(Math.abs(c)*t.MathUtils.signum(a)-d.data.scaleX)*l,d.scaleY=i+(Math.abs(u)*t.MathUtils.signum(i)-d.data.scaleY)*l}else switch(o){case e.setup:a=Math.abs(d.data.scaleX)*t.MathUtils.signum(c),i=Math.abs(d.data.scaleY)*t.MathUtils.signum(u),d.scaleX=a+(c-a)*l,d.scaleY=i+(u-i)*l;break;case e.first:case e.replace:a=Math.abs(d.scaleX)*t.MathUtils.signum(c),i=Math.abs(d.scaleY)*t.MathUtils.signum(u),d.scaleX=a+(c-a)*l,d.scaleY=i+(u-i)*l;break;case e.add:a=t.MathUtils.signum(c),i=t.MathUtils.signum(u),d.scaleX=Math.abs(d.scaleX)*a+(c-Math.abs(d.data.scaleX)*a)*l,d.scaleY=Math.abs(d.scaleY)*i+(u-Math.abs(d.data.scaleY)*i)*l}}}};t.ScaleXTimeline=class extends S{constructor(t,e,s){super(t,e,n+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(a,i,r,n,l,o,h){let d=a.bones[this.boneIndex];if(!d.active)return;if(r<this.frames[0]){switch(o){case e.setup:return void(d.scaleX=d.data.scaleX);case e.first:d.scaleX+=(d.data.scaleX-d.scaleX)*l}return}let c=this.getCurveValue(r)*d.data.scaleX;if(1==l)o==e.add?d.scaleX+=c-d.data.scaleX:d.scaleX=c;else{let a=0;if(h==s.mixOut)switch(o){case e.setup:a=d.data.scaleX,d.scaleX=a+(Math.abs(c)*t.MathUtils.signum(a)-a)*l;break;case e.first:case e.replace:a=d.scaleX,d.scaleX=a+(Math.abs(c)*t.MathUtils.signum(a)-a)*l;break;case e.add:a=d.scaleX,d.scaleX=a+(Math.abs(c)*t.MathUtils.signum(a)-d.data.scaleX)*l}else switch(o){case e.setup:a=Math.abs(d.data.scaleX)*t.MathUtils.signum(c),d.scaleX=a+(c-a)*l;break;case e.first:case e.replace:a=Math.abs(d.scaleX)*t.MathUtils.signum(c),d.scaleX=a+(c-a)*l;break;case e.add:a=t.MathUtils.signum(c),d.scaleX=Math.abs(d.scaleX)*a+(c-Math.abs(d.data.scaleX)*a)*l}}}};t.ScaleYTimeline=class extends S{constructor(t,e,s){super(t,e,l+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(a,i,r,n,l,o,h){let d=a.bones[this.boneIndex];if(!d.active)return;if(r<this.frames[0]){switch(o){case e.setup:return void(d.scaleY=d.data.scaleY);case e.first:d.scaleY+=(d.data.scaleY-d.scaleY)*l}return}let c=this.getCurveValue(r)*d.data.scaleY;if(1==l)o==e.add?d.scaleY+=c-d.data.scaleY:d.scaleY=c;else{let a=0;if(h==s.mixOut)switch(o){case e.setup:a=d.data.scaleY,d.scaleY=a+(Math.abs(c)*t.MathUtils.signum(a)-a)*l;break;case e.first:case e.replace:a=d.scaleY,d.scaleY=a+(Math.abs(c)*t.MathUtils.signum(a)-a)*l;break;case e.add:a=d.scaleY,d.scaleY=a+(Math.abs(c)*t.MathUtils.signum(a)-d.data.scaleY)*l}else switch(o){case e.setup:a=Math.abs(d.data.scaleY)*t.MathUtils.signum(c),d.scaleY=a+(c-a)*l;break;case e.first:case e.replace:a=Math.abs(d.scaleY)*t.MathUtils.signum(c),d.scaleY=a+(c-a)*l;break;case e.add:a=t.MathUtils.signum(c),d.scaleY=Math.abs(d.scaleY)*a+(c-Math.abs(d.data.scaleY)*a)*l}}}};t.ShearTimeline=class extends T{constructor(t,e,s){super(t,e,o+"|"+s,h+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,s,a,i,r,n,l){let o=t.bones[this.boneIndex];if(!o.active)return;let h=this.frames;if(a<h[0]){switch(n){case e.setup:return o.shearX=o.data.shearX,void(o.shearY=o.data.shearY);case e.first:o.shearX+=(o.data.shearX-o.shearX)*r,o.shearY+=(o.data.shearY-o.shearY)*r}return}let d=0,c=0,u=k.search(h,a,3),m=this.curves[u/3];switch(m){case 0:let t=h[u];d=h[u+1],c=h[u+2];let e=(a-t)/(h[u+3]-t);d+=(h[u+3+1]-d)*e,c+=(h[u+3+2]-c)*e;break;case 1:d=h[u+1],c=h[u+2];break;default:d=this.getBezierValue(a,u,1,m-2),c=this.getBezierValue(a,u,2,m+18-2)}switch(n){case e.setup:o.shearX=o.data.shearX+d*r,o.shearY=o.data.shearY+c*r;break;case e.first:case e.replace:o.shearX+=(o.data.shearX+d-o.shearX)*r,o.shearY+=(o.data.shearY+c-o.shearY)*r;break;case e.add:o.shearX+=d*r,o.shearY+=c*r}}};t.ShearXTimeline=class extends S{constructor(t,e,s){super(t,e,o+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,s,a,i,r,n,l){let o=t.bones[this.boneIndex];if(!o.active)return;if(a<this.frames[0]){switch(n){case e.setup:return void(o.shearX=o.data.shearX);case e.first:o.shearX+=(o.data.shearX-o.shearX)*r}return}let h=this.getCurveValue(a);switch(n){case e.setup:o.shearX=o.data.shearX+h*r;break;case e.first:case e.replace:o.shearX+=(o.data.shearX+h-o.shearX)*r;break;case e.add:o.shearX+=h*r}}};t.ShearYTimeline=class extends S{constructor(t,e,s){super(t,e,h+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,s,a,i,r,n,l){let o=t.bones[this.boneIndex];if(!o.active)return;if(a<this.frames[0]){switch(n){case e.setup:return void(o.shearY=o.data.shearY);case e.first:o.shearY+=(o.data.shearY-o.shearY)*r}return}let h=this.getCurveValue(a);switch(n){case e.setup:o.shearY=o.data.shearY+h*r;break;case e.first:case e.replace:o.shearY+=(o.data.shearY+h-o.shearY)*r;break;case e.add:o.shearY+=h*r}}};t.RGBATimeline=class extends A{constructor(t,e,s){super(t,e,[d+"|"+s,c+"|"+s]),this.slotIndex=0,this.slotIndex=s}getFrameEntries(){return 5}setFrame(t,e,s,a,i,r){t*=5,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=a,this.frames[t+3]=i,this.frames[t+4]=r}apply(t,s,a,i,r,n,l){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,d=o.color;if(a<h[0]){let t=o.data.color;switch(n){case e.setup:return void d.setFromColor(t);case e.first:d.add((t.r-d.r)*r,(t.g-d.g)*r,(t.b-d.b)*r,(t.a-d.a)*r)}return}let c=0,u=0,m=0,f=0,g=k.search(h,a,5),p=this.curves[g/5];switch(p){case 0:let t=h[g];c=h[g+1],u=h[g+2],m=h[g+3],f=h[g+4];let e=(a-t)/(h[g+5]-t);c+=(h[g+5+1]-c)*e,u+=(h[g+5+2]-u)*e,m+=(h[g+5+3]-m)*e,f+=(h[g+5+4]-f)*e;break;case 1:c=h[g+1],u=h[g+2],m=h[g+3],f=h[g+4];break;default:c=this.getBezierValue(a,g,1,p-2),u=this.getBezierValue(a,g,2,p+18-2),m=this.getBezierValue(a,g,3,p+36-2),f=this.getBezierValue(a,g,4,p+54-2)}1==r?d.set(c,u,m,f):(n==e.setup&&d.setFromColor(o.data.color),d.add((c-d.r)*r,(u-d.g)*r,(m-d.b)*r,(f-d.a)*r))}};t.RGBTimeline=class extends A{constructor(t,e,s){super(t,e,[d+"|"+s]),this.slotIndex=0,this.slotIndex=s}getFrameEntries(){return 4}setFrame(t,e,s,a,i){t<<=2,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=a,this.frames[t+3]=i}apply(t,s,a,i,r,n,l){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,d=o.color;if(a<h[0]){let t=o.data.color;switch(n){case e.setup:return d.r=t.r,d.g=t.g,void(d.b=t.b);case e.first:d.r+=(t.r-d.r)*r,d.g+=(t.g-d.g)*r,d.b+=(t.b-d.b)*r}return}let c=0,u=0,m=0,f=k.search(h,a,4),g=this.curves[f>>2];switch(g){case 0:let t=h[f];c=h[f+1],u=h[f+2],m=h[f+3];let e=(a-t)/(h[f+4]-t);c+=(h[f+4+1]-c)*e,u+=(h[f+4+2]-u)*e,m+=(h[f+4+3]-m)*e;break;case 1:c=h[f+1],u=h[f+2],m=h[f+3];break;default:c=this.getBezierValue(a,f,1,g-2),u=this.getBezierValue(a,f,2,g+18-2),m=this.getBezierValue(a,f,3,g+36-2)}if(1==r)d.r=c,d.g=u,d.b=m;else{if(n==e.setup){let t=o.data.color;d.r=t.r,d.g=t.g,d.b=t.b}d.r+=(c-d.r)*r,d.g+=(u-d.g)*r,d.b+=(m-d.b)*r}}};t.AlphaTimeline=class extends S{constructor(t,e,s){super(t,e,c+"|"+s),this.slotIndex=0,this.slotIndex=s}apply(t,s,a,i,r,n,l){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.color;if(a<this.frames[0]){let t=o.data.color;switch(n){case e.setup:return void(h.a=t.a);case e.first:h.a+=(t.a-h.a)*r}return}let d=this.getCurveValue(a);1==r?h.a=d:(n==e.setup&&(h.a=o.data.color.a),h.a+=(d-h.a)*r)}};t.RGBA2Timeline=class extends A{constructor(t,e,s){super(t,e,[d+"|"+s,c+"|"+s,u+"|"+s]),this.slotIndex=0,this.slotIndex=s}getFrameEntries(){return 8}setFrame(t,e,s,a,i,r,n,l,o){t<<=3,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=a,this.frames[t+3]=i,this.frames[t+4]=r,this.frames[t+5]=n,this.frames[t+6]=l,this.frames[t+7]=o}apply(t,s,a,i,r,n,l){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,d=o.color,c=o.darkColor;if(a<h[0]){let t=o.data.color,s=o.data.darkColor;switch(n){case e.setup:return d.setFromColor(t),c.r=s.r,c.g=s.g,void(c.b=s.b);case e.first:d.add((t.r-d.r)*r,(t.g-d.g)*r,(t.b-d.b)*r,(t.a-d.a)*r),c.r+=(s.r-c.r)*r,c.g+=(s.g-c.g)*r,c.b+=(s.b-c.b)*r}return}let u=0,m=0,f=0,g=0,p=0,x=0,b=0,w=k.search(h,a,8),y=this.curves[w>>3];switch(y){case 0:let t=h[w];u=h[w+1],m=h[w+2],f=h[w+3],g=h[w+4],p=h[w+5],x=h[w+6],b=h[w+7];let e=(a-t)/(h[w+8]-t);u+=(h[w+8+1]-u)*e,m+=(h[w+8+2]-m)*e,f+=(h[w+8+3]-f)*e,g+=(h[w+8+4]-g)*e,p+=(h[w+8+5]-p)*e,x+=(h[w+8+6]-x)*e,b+=(h[w+8+7]-b)*e;break;case 1:u=h[w+1],m=h[w+2],f=h[w+3],g=h[w+4],p=h[w+5],x=h[w+6],b=h[w+7];break;default:u=this.getBezierValue(a,w,1,y-2),m=this.getBezierValue(a,w,2,y+18-2),f=this.getBezierValue(a,w,3,y+36-2),g=this.getBezierValue(a,w,4,y+54-2),p=this.getBezierValue(a,w,5,y+72-2),x=this.getBezierValue(a,w,6,y+90-2),b=this.getBezierValue(a,w,7,y+108-2)}if(1==r)d.set(u,m,f,g),c.r=p,c.g=x,c.b=b;else{if(n==e.setup){d.setFromColor(o.data.color);let t=o.data.darkColor;c.r=t.r,c.g=t.g,c.b=t.b}d.add((u-d.r)*r,(m-d.g)*r,(f-d.b)*r,(g-d.a)*r),c.r+=(p-c.r)*r,c.g+=(x-c.g)*r,c.b+=(b-c.b)*r}}};t.RGB2Timeline=class extends A{constructor(t,e,s){super(t,e,[d+"|"+s,u+"|"+s]),this.slotIndex=0,this.slotIndex=s}getFrameEntries(){return 7}setFrame(t,e,s,a,i,r,n,l){t*=7,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=a,this.frames[t+3]=i,this.frames[t+4]=r,this.frames[t+5]=n,this.frames[t+6]=l}apply(t,s,a,i,r,n,l){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,d=o.color,c=o.darkColor;if(a<h[0]){let t=o.data.color,s=o.data.darkColor;switch(n){case e.setup:return d.r=t.r,d.g=t.g,d.b=t.b,c.r=s.r,c.g=s.g,void(c.b=s.b);case e.first:d.r+=(t.r-d.r)*r,d.g+=(t.g-d.g)*r,d.b+=(t.b-d.b)*r,c.r+=(s.r-c.r)*r,c.g+=(s.g-c.g)*r,c.b+=(s.b-c.b)*r}return}let u=0,m=0,f=0,g=0,p=0,x=0,b=k.search(h,a,7),w=this.curves[b/7];switch(w){case 0:let t=h[b];u=h[b+1],m=h[b+2],f=h[b+3],g=h[b+4],p=h[b+5],x=h[b+6];let e=(a-t)/(h[b+7]-t);u+=(h[b+7+1]-u)*e,m+=(h[b+7+2]-m)*e,f+=(h[b+7+3]-f)*e,g+=(h[b+7+4]-g)*e,p+=(h[b+7+5]-p)*e,x+=(h[b+7+6]-x)*e;break;case 1:u=h[b+1],m=h[b+2],f=h[b+3],g=h[b+4],p=h[b+5],x=h[b+6];break;default:u=this.getBezierValue(a,b,1,w-2),m=this.getBezierValue(a,b,2,w+18-2),f=this.getBezierValue(a,b,3,w+36-2),g=this.getBezierValue(a,b,4,w+54-2),p=this.getBezierValue(a,b,5,w+72-2),x=this.getBezierValue(a,b,6,w+90-2)}if(1==r)d.r=u,d.g=m,d.b=f,c.r=g,c.g=p,c.b=x;else{if(n==e.setup){let t=o.data.color,e=o.data.darkColor;d.r=t.r,d.g=t.g,d.b=t.b,c.r=e.r,c.g=e.g,c.b=e.b}d.r+=(u-d.r)*r,d.g+=(m-d.g)*r,d.b+=(f-d.b)*r,c.r+=(g-c.r)*r,c.g+=(p-c.g)*r,c.b+=(x-c.b)*r}}};t.AttachmentTimeline=class extends k{constructor(t,e){super(t,[m+"|"+e]),this.slotIndex=0,this.slotIndex=e,this.attachmentNames=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.attachmentNames[t]=s}apply(t,a,i,r,n,l,o){let h=t.slots[this.slotIndex];h.bone.active&&(o!=s.mixOut?i<this.frames[0]?l!=e.setup&&l!=e.first||this.setAttachment(t,h,h.data.attachmentName):this.setAttachment(t,h,this.attachmentNames[k.search1(this.frames,i)]):l==e.setup&&this.setAttachment(t,h,h.data.attachmentName))}setAttachment(t,e,s){e.setAttachment(s?t.getAttachment(this.slotIndex,s):null)}};t.DeformTimeline=class extends A{constructor(t,e,s,a){super(t,e,[f+"|"+s+"|"+a.id]),this.slotIndex=0,this.slotIndex=s,this.attachment=a,this.vertices=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.vertices[t]=s}setBezier(t,e,s,a,i,r,n,l,o,h,d){let c=this.curves,u=this.getFrameCount()+18*t;0==s&&(c[e]=2+u);let m=.03*(a-2*r+l),f=.03*o-.06*n,g=.006*(3*(r-l)-a+h),p=.018*(n-o+.33333333),x=2*m+g,b=2*f+p,w=.3*(r-a)+m+.16666667*g,y=.3*n+f+.16666667*p,M=a+w,k=y;for(let t=u+18;u<t;u+=2)c[u]=M,c[u+1]=k,w+=x,y+=b,x+=g,b+=p,M+=w,k+=y}getCurvePercent(t,e){let s=this.curves,a=s[e];switch(a){case 0:let s=this.frames[e];return(t-s)/(this.frames[e+this.getFrameEntries()]-s);case 1:return 0}if(a-=2,s[a]>t){let i=this.frames[e];return s[a+1]*(t-i)/(s[a]-i)}let i=a+18;for(a+=2;a<i;a+=2)if(s[a]>=t){let e=s[a-2],i=s[a-1];return i+(t-e)/(s[a]-e)*(s[a+1]-i)}let r=s[i-2],n=s[i-1];return n+(1-n)*(t-r)/(this.frames[e+this.getFrameEntries()]-r)}apply(s,a,i,r,n,l,o){let h=s.slots[this.slotIndex];if(!h.bone.active)return;let d=h.getAttachment();if(!(d instanceof t.VertexAttachment)||d.deformAttachment!=this.attachment)return;let c=h.deform;0==c.length&&(l=e.setup);let u=this.vertices,m=u[0].length,f=this.frames;if(i<f[0]){let t=d;switch(l){case e.setup:return void(c.length=0);case e.first:if(1==n)return void(c.length=0);if(c.length=m,t.bones){n=1-n;for(g=0;g<m;g++)c[g]*=n}else{let e=t.vertices;for(var g=0;g<m;g++)c[g]+=(e[g]-c[g])*n}}return}if(c.length=m,i>=f[f.length-1]){let s=u[f.length-1];if(1==n)if(l==e.add){let t=d;if(t.bones)for(let t=0;t<m;t++)c[t]+=s[t];else{let e=t.vertices;for(let t=0;t<m;t++)c[t]+=s[t]-e[t]}}else t.Utils.arrayCopy(s,0,c,0,m);else switch(l){case e.setup:{let t=d;if(t.bones)for(let t=0;t<m;t++)c[t]=s[t]*n;else{let e=t.vertices;for(let t=0;t<m;t++){let a=e[t];c[t]=a+(s[t]-a)*n}}break}case e.first:case e.replace:for(let t=0;t<m;t++)c[t]+=(s[t]-c[t])*n;break;case e.add:let t=d;if(t.bones)for(let t=0;t<m;t++)c[t]+=s[t]*n;else{let e=t.vertices;for(let t=0;t<m;t++)c[t]+=(s[t]-e[t])*n}}return}let p=k.search1(f,i),x=this.getCurvePercent(i,p),b=u[p],w=u[p+1];if(1==n)if(l==e.add){let t=d;if(t.bones)for(let t=0;t<m;t++){let e=b[t];c[t]+=e+(w[t]-e)*x}else{let e=t.vertices;for(let t=0;t<m;t++){let s=b[t];c[t]+=s+(w[t]-s)*x-e[t]}}}else for(let t=0;t<m;t++){let e=b[t];c[t]=e+(w[t]-e)*x}else switch(l){case e.setup:{let t=d;if(t.bones)for(let t=0;t<m;t++){let e=b[t];c[t]=(e+(w[t]-e)*x)*n}else{let e=t.vertices;for(let t=0;t<m;t++){let s=b[t],a=e[t];c[t]=a+(s+(w[t]-s)*x-a)*n}}break}case e.first:case e.replace:for(let t=0;t<m;t++){let e=b[t];c[t]+=(e+(w[t]-e)*x-c[t])*n}break;case e.add:let t=d;if(t.bones)for(let t=0;t<m;t++){let e=b[t];c[t]+=(e+(w[t]-e)*x)*n}else{let e=t.vertices;for(let t=0;t<m;t++){let s=b[t];c[t]+=(s+(w[t]-s)*x-e[t])*n}}}}};class C extends k{constructor(t){super(t,C.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,s,a,i,r,n){if(!a)return;let l=this.frames,o=this.frames.length;if(e>s)this.apply(t,e,Number.MAX_VALUE,a,i,r,n),e=-1;else if(e>=l[o-1])return;if(s<l[0])return;let h=0;if(e<l[0])h=0;else{h=k.search1(l,e)+1;let t=l[h];for(;h>0&&l[h-1]==t;)h--}for(;h<o&&s>=l[h];h++)a.push(this.events[h])}}C.propertyIds=[""+g],t.EventTimeline=C;class v extends k{constructor(t){super(t,v.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.drawOrders[t]=s}apply(a,i,r,n,l,o,h){if(h==s.mixOut)return void(o==e.setup&&t.Utils.arrayCopy(a.slots,0,a.drawOrder,0,a.slots.length));if(r<this.frames[0])return void(o!=e.setup&&o!=e.first||t.Utils.arrayCopy(a.slots,0,a.drawOrder,0,a.slots.length));let d=this.drawOrders[k.search1(this.frames,r)];if(d){let t=a.drawOrder,e=a.slots;for(let s=0,a=d.length;s<a;s++)t[s]=e[d[s]]}else t.Utils.arrayCopy(a.slots,0,a.drawOrder,0,a.slots.length)}}v.propertyIds=[""+p],t.DrawOrderTimeline=v;t.IkConstraintTimeline=class extends A{constructor(t,e,s){super(t,e,[x+"|"+s]),this.ikConstraintIndex=s}getFrameEntries(){return 6}setFrame(t,e,s,a,i,r,n){t*=6,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=a,this.frames[t+3]=i,this.frames[t+4]=r?1:0,this.frames[t+5]=n?1:0}apply(t,a,i,r,n,l,o){let h=t.ikConstraints[this.ikConstraintIndex];if(!h.active)return;let d=this.frames;if(i<d[0]){switch(l){case e.setup:return h.mix=h.data.mix,h.softness=h.data.softness,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,void(h.stretch=h.data.stretch);case e.first:h.mix+=(h.data.mix-h.mix)*n,h.softness+=(h.data.softness-h.softness)*n,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch}return}let c=0,u=0,m=k.search(d,i,6),f=this.curves[m/6];switch(f){case 0:let t=d[m];c=d[m+1],u=d[m+2];let e=(i-t)/(d[m+6]-t);c+=(d[m+6+1]-c)*e,u+=(d[m+6+2]-u)*e;break;case 1:c=d[m+1],u=d[m+2];break;default:c=this.getBezierValue(i,m,1,f-2),u=this.getBezierValue(i,m,2,f+18-2)}l==e.setup?(h.mix=h.data.mix+(c-h.data.mix)*n,h.softness=h.data.softness+(u-h.data.softness)*n,o==s.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=d[m+3],h.compress=0!=d[m+4],h.stretch=0!=d[m+5])):(h.mix+=(c-h.mix)*n,h.softness+=(u-h.softness)*n,o==s.mixIn&&(h.bendDirection=d[m+3],h.compress=0!=d[m+4],h.stretch=0!=d[m+5]))}};t.TransformConstraintTimeline=class extends A{constructor(t,e,s){super(t,e,[b+"|"+s]),this.transformConstraintIndex=s}getFrameEntries(){return 7}setFrame(t,e,s,a,i,r,n,l){let o=this.frames;o[t*=7]=e,o[t+1]=s,o[t+2]=a,o[t+3]=i,o[t+4]=r,o[t+5]=n,o[t+6]=l}apply(t,s,a,i,r,n,l){let o=t.transformConstraints[this.transformConstraintIndex];if(!o.active)return;let h,d,c,u,m,f,g=this.frames;if(a<g[0]){let t=o.data;switch(n){case e.setup:return o.mixRotate=t.mixRotate,o.mixX=t.mixX,o.mixY=t.mixY,o.mixScaleX=t.mixScaleX,o.mixScaleY=t.mixScaleY,void(o.mixShearY=t.mixShearY);case e.first:o.mixRotate+=(t.mixRotate-o.mixRotate)*r,o.mixX+=(t.mixX-o.mixX)*r,o.mixY+=(t.mixY-o.mixY)*r,o.mixScaleX+=(t.mixScaleX-o.mixScaleX)*r,o.mixScaleY+=(t.mixScaleY-o.mixScaleY)*r,o.mixShearY+=(t.mixShearY-o.mixShearY)*r}return}let p=k.search(g,a,7),x=this.curves[p/7];switch(x){case 0:let t=g[p];h=g[p+1],d=g[p+2],c=g[p+3],u=g[p+4],m=g[p+5],f=g[p+6];let e=(a-t)/(g[p+7]-t);h+=(g[p+7+1]-h)*e,d+=(g[p+7+2]-d)*e,c+=(g[p+7+3]-c)*e,u+=(g[p+7+4]-u)*e,m+=(g[p+7+5]-m)*e,f+=(g[p+7+6]-f)*e;break;case 1:h=g[p+1],d=g[p+2],c=g[p+3],u=g[p+4],m=g[p+5],f=g[p+6];break;default:h=this.getBezierValue(a,p,1,x-2),d=this.getBezierValue(a,p,2,x+18-2),c=this.getBezierValue(a,p,3,x+36-2),u=this.getBezierValue(a,p,4,x+54-2),m=this.getBezierValue(a,p,5,x+72-2),f=this.getBezierValue(a,p,6,x+90-2)}if(n==e.setup){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*r,o.mixX=t.mixX+(d-t.mixX)*r,o.mixY=t.mixY+(c-t.mixY)*r,o.mixScaleX=t.mixScaleX+(u-t.mixScaleX)*r,o.mixScaleY=t.mixScaleY+(m-t.mixScaleY)*r,o.mixShearY=t.mixShearY+(f-t.mixShearY)*r}else o.mixRotate+=(h-o.mixRotate)*r,o.mixX+=(d-o.mixX)*r,o.mixY+=(c-o.mixY)*r,o.mixScaleX+=(u-o.mixScaleX)*r,o.mixScaleY+=(m-o.mixScaleY)*r,o.mixShearY+=(f-o.mixShearY)*r}};t.PathConstraintPositionTimeline=class extends S{constructor(t,e,s){super(t,e,w+"|"+s),this.pathConstraintIndex=s}apply(t,s,a,i,r,n,l){let o=t.pathConstraints[this.pathConstraintIndex];if(!o.active)return;if(a<this.frames[0]){switch(n){case e.setup:return void(o.position=o.data.position);case e.first:o.position+=(o.data.position-o.position)*r}return}let h=this.getCurveValue(a);n==e.setup?o.position=o.data.position+(h-o.data.position)*r:o.position+=(h-o.position)*r}};t.PathConstraintSpacingTimeline=class extends S{constructor(t,e,s){super(t,e,y+"|"+s),this.pathConstraintIndex=0,this.pathConstraintIndex=s}apply(t,s,a,i,r,n,l){let o=t.pathConstraints[this.pathConstraintIndex];if(!o.active)return;if(a<this.frames[0]){switch(n){case e.setup:return void(o.spacing=o.data.spacing);case e.first:o.spacing+=(o.data.spacing-o.spacing)*r}return}let h=this.getCurveValue(a);n==e.setup?o.spacing=o.data.spacing+(h-o.data.spacing)*r:o.spacing+=(h-o.spacing)*r}};t.PathConstraintMixTimeline=class extends A{constructor(t,e,s){super(t,e,[M+"|"+s]),this.pathConstraintIndex=0,this.pathConstraintIndex=s}getFrameEntries(){return 4}setFrame(t,e,s,a,i){let r=this.frames;r[t<<=2]=e,r[t+1]=s,r[t+2]=a,r[t+3]=i}apply(t,s,a,i,r,n,l){let o=t.pathConstraints[this.pathConstraintIndex];if(!o.active)return;let h,d,c,u=this.frames;if(a<u[0]){switch(n){case e.setup:return o.mixRotate=o.data.mixRotate,o.mixX=o.data.mixX,void(o.mixY=o.data.mixY);case e.first:o.mixRotate+=(o.data.mixRotate-o.mixRotate)*r,o.mixX+=(o.data.mixX-o.mixX)*r,o.mixY+=(o.data.mixY-o.mixY)*r}return}let m=k.search(u,a,4),f=this.curves[m>>2];switch(f){case 0:let t=u[m];h=u[m+1],d=u[m+2],c=u[m+3];let e=(a-t)/(u[m+4]-t);h+=(u[m+4+1]-h)*e,d+=(u[m+4+2]-d)*e,c+=(u[m+4+3]-c)*e;break;case 1:h=u[m+1],d=u[m+2],c=u[m+3];break;default:h=this.getBezierValue(a,m,1,f-2),d=this.getBezierValue(a,m,2,f+18-2),c=this.getBezierValue(a,m,3,f+36-2)}if(n==e.setup){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*r,o.mixX=t.mixX+(d-t.mixX)*r,o.mixY=t.mixY+(c-t.mixY)*r}else o.mixRotate+=(h-o.mixRotate)*r,o.mixX+=(d-o.mixX)*r,o.mixY+=(c-o.mixY)*r}}}(spine||(spine={})),function(t){class e{constructor(e){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new a(this),this.propertyIDs=new t.StringSet,this.animationsChanged=!1,this.trackEntryPool=new t.Pool(()=>new s),this.data=e}static emptyAnimation(){return u||(u=new t.Animation("<empty>",[],0)),u}update(t){t*=this.timeScale;let e=this.tracks;for(let s=0,a=e.length;s<a;s++){let a=e[s];if(!a)continue;a.animationLast=a.nextAnimationLast,a.trackLast=a.nextTrackLast;let i=t*a.timeScale;if(a.delay>0){if(a.delay-=i,a.delay>0)continue;i=-a.delay,a.delay=0}let r=a.next;if(r){let e=a.trackLast-r.delay;if(e>=0){for(r.delay=0,r.trackTime+=0==a.timeScale?0:(e/a.timeScale+t)*r.timeScale,a.trackTime+=i,this.setCurrent(s,r,!0);r.mixingFrom;)r.mixTime+=t,r=r.mixingFrom;continue}}else if(a.trackLast>=a.trackEnd&&!a.mixingFrom){e[s]=null,this.queue.end(a),this.clearNext(a);continue}if(a.mixingFrom&&this.updateMixingFrom(a,t)){let t=a.mixingFrom;for(a.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}a.trackTime+=i}this.queue.drain()}updateMixingFrom(t,e){let s=t.mixingFrom;if(!s)return!0;let a=this.updateMixingFrom(s,e);return s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=s.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=s.mixingFrom,s.mixingFrom&&(s.mixingFrom.mixingTo=t),t.interruptAlpha=s.interruptAlpha,this.queue.end(s)),a):(s.trackTime+=e*s.timeScale,t.mixTime+=e,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let s=this.events,a=this.tracks,i=!1;for(let l=0,o=a.length;l<o;l++){let o=a[l];if(!o||o.delay>0)continue;i=!0;let h=0==l?t.MixBlend.first:o.mixBlend,d=o.alpha;o.mixingFrom?d*=this.applyMixingFrom(o,e,h):o.trackTime>=o.trackEnd&&!o.next&&(d=0);let c=o.animationLast,u=o.getAnimationTime(),m=u,f=s;o.reverse&&(m=o.animation.duration-m,f=null);let g=o.animation.timelines,p=g.length;if(0==l&&1==d||h==t.MixBlend.add)for(let s=0;s<p;s++){t.Utils.webkit602BugfixHelper(d,h);var n=g[s];n instanceof t.AttachmentTimeline?this.applyAttachmentTimeline(n,e,m,h,!0):n.apply(e,c,m,f,d,h,t.MixDirection.mixIn)}else{let s=o.timelineMode,a=o.timelinesRotation.length!=p<<1;a&&(o.timelinesRotation.length=p<<1);for(let i=0;i<p;i++){let n=g[i],l=s[i]==r?h:t.MixBlend.setup;n instanceof t.RotateTimeline?this.applyRotateTimeline(n,e,m,d,l,o.timelinesRotation,i<<1,a):n instanceof t.AttachmentTimeline?this.applyAttachmentTimeline(n,e,m,h,!0):(t.Utils.webkit602BugfixHelper(d,h),n.apply(e,c,m,f,d,l,t.MixDirection.mixIn))}}this.queueEvents(o,u),s.length=0,o.nextAnimationLast=u,o.nextTrackLast=o.trackTime}for(var l=this.unkeyedState+d,o=e.slots,h=0,c=e.slots.length;h<c;h++){var u=o[h];if(u.attachmentState==l){var m=u.data.attachmentName;u.setAttachment(m?e.getAttachment(u.data.index,m):null)}}return this.unkeyedState+=2,this.queue.drain(),i}applyMixingFrom(e,s,a){let i=e.mixingFrom;i.mixingFrom&&this.applyMixingFrom(i,s,a);let h=0;0==e.mixDuration?(h=1,a==t.MixBlend.first&&(a=t.MixBlend.setup)):(h=e.mixTime/e.mixDuration,h>1&&(h=1),a!=t.MixBlend.first&&(a=i.mixBlend));let d=h<i.attachmentThreshold,c=h<i.drawOrderThreshold,u=i.animation.timelines,m=u.length,f=i.alpha*e.interruptAlpha,g=f*(1-h),p=i.animationLast,x=i.getAnimationTime(),b=x,w=null;if(i.reverse?b=i.animation.duration-b:h<i.eventThreshold&&(w=this.events),a==t.MixBlend.add)for(let e=0;e<m;e++)u[e].apply(s,p,b,w,g,a,t.MixDirection.mixOut);else{let e=i.timelineMode,h=i.timelineHoldMix,x=i.timelinesRotation.length!=m<<1;x&&(i.timelinesRotation.length=m<<1),i.totalAlpha=0;for(let y=0;y<m;y++){let m,M=u[y],k=t.MixDirection.mixOut,A=0;switch(e[y]){case r:if(!c&&M instanceof t.DrawOrderTimeline)continue;m=a,A=g;break;case n:m=t.MixBlend.setup,A=g;break;case l:m=a,A=f;break;case o:m=t.MixBlend.setup,A=f;break;default:m=t.MixBlend.setup;let e=h[y];A=f*Math.max(0,1-e.mixTime/e.mixDuration)}i.totalAlpha+=A,M instanceof t.RotateTimeline?this.applyRotateTimeline(M,s,b,A,m,i.timelinesRotation,y<<1,x):M instanceof t.AttachmentTimeline?this.applyAttachmentTimeline(M,s,b,m,d):(t.Utils.webkit602BugfixHelper(A,a),c&&M instanceof t.DrawOrderTimeline&&m==t.MixBlend.setup&&(k=t.MixDirection.mixIn),M.apply(s,p,b,w,A,m,k))}}return e.mixDuration>0&&this.queueEvents(i,x),this.events.length=0,i.nextAnimationLast=x,i.nextTrackLast=i.trackTime,h}applyAttachmentTimeline(e,s,a,i,r){var n=s.slots[e.slotIndex];n.bone.active&&(a<e.frames[0]?i!=t.MixBlend.setup&&i!=t.MixBlend.first||this.setAttachment(s,n,n.data.attachmentName,r):this.setAttachment(s,n,e.attachmentNames[t.Timeline.search1(e.frames,a)],r),n.attachmentState<=this.unkeyedState&&(n.attachmentState=this.unkeyedState+d))}setAttachment(t,e,s,a){e.setAttachment(s?t.getAttachment(e.data.index,s):null),a&&(e.attachmentState=this.unkeyedState+c)}applyRotateTimeline(e,s,a,i,r,n,l,o){if(o&&(n[l]=0),1==i)return void e.apply(s,0,a,null,1,r,t.MixDirection.mixIn);let h=s.bones[e.boneIndex];if(!h.active)return;let d=0,c=0;if(a<e.frames[0])switch(r){case t.MixBlend.setup:h.rotation=h.data.rotation;default:return;case t.MixBlend.first:d=h.rotation,c=h.data.rotation}else d=r==t.MixBlend.setup?h.data.rotation:h.rotation,c=h.data.rotation+e.getCurveValue(a);let u=0,m=c-d;if(m-=360*(16384-(16384.499999999996-m/360|0)),0==m)u=n[l];else{let e=0,s=0;o?(e=0,s=m):(e=n[l],s=n[l+1]);let a=m>0,i=e>=0;t.MathUtils.signum(s)!=t.MathUtils.signum(m)&&Math.abs(s)<=90&&(Math.abs(e)>180&&(e+=360*t.MathUtils.signum(e)),i=a),u=m+e-e%360,i!=a&&(u+=360*t.MathUtils.signum(e)),n[l]=u}n[l+1]=m,h.rotation=d+u*i}queueEvents(t,e){let s=t.animationStart,a=t.animationEnd,i=a-s,r=t.trackLast%i,n=this.events,l=0,o=n.length;for(;l<o;l++){let e=n[l];if(e.time<r)break;e.time>a||this.queue.event(t,e)}let h=!1;for(h=t.loop?0==i||r>t.trackTime%i:e>=a&&t.animationLast<a,h&&this.queue.complete(t);l<o;l++){let e=n[l];e.time<s||this.queue.event(t,e)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,e=this.tracks.length;t<e;t++)this.clearTrack(t);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 s=e;for(;;){let t=s.mixingFrom;if(!t)break;this.queue.end(t),s.mixingFrom=null,s.mixingTo=null,s=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,s){let a=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,a&&(s&&this.queue.interrupt(a),e.mixingFrom=a,a.mixingTo=e,e.mixTime=0,a.mixingFrom&&a.mixDuration>0&&(e.interruptAlpha*=Math.min(1,a.mixTime/a.mixDuration)),a.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,s=!1){let a=this.data.skeletonData.findAnimation(e);if(!a)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,a,s)}setAnimationWith(t,e,s=!1){if(!e)throw new Error("animation cannot be null.");let a=!0,i=this.expandToIndex(t);i&&(-1==i.nextTrackLast?(this.tracks[t]=i.mixingFrom,this.queue.interrupt(i),this.queue.end(i),this.clearNext(i),i=i.mixingFrom,a=!1):this.clearNext(i));let r=this.trackEntry(t,e,s,i);return this.setCurrent(t,r,a),this.queue.drain(),r}addAnimation(t,e,s=!1,a=0){let i=this.data.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,i,s,a)}addAnimationWith(t,e,s=!1,a=0){if(!e)throw new Error("animation cannot be null.");let i=this.expandToIndex(t);if(i)for(;i.next;)i=i.next;let r=this.trackEntry(t,e,s,i);return i?(i.next=r,r.previous=i,a<=0&&(a+=i.getTrackComplete()-r.mixDuration)):(this.setCurrent(t,r,!0),this.queue.drain()),r.delay=a,r}setEmptyAnimation(t,s=0){let a=this.setAnimationWith(t,e.emptyAnimation(),!1);return a.mixDuration=s,a.trackEnd=s,a}addEmptyAnimation(t,s=0,a=0){let i=this.addAnimationWith(t,e.emptyAnimation(),!1,a<=0?1:a);return i.mixDuration=s,i.trackEnd=s,a<=0&&i.previous&&(i.delay=i.previous.getTrackComplete()-i.mixDuration+a),i}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,s=this.tracks.length;e<s;e++){let s=this.tracks[e];s&&this.setEmptyAnimation(s.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()}expandToIndex(e){return e<this.tracks.length?this.tracks[e]:(t.Utils.ensureArrayCapacity(this.tracks,e+1,null),this.tracks.length=e+1,null)}trackEntry(e,s,a,i){let r=this.trackEntryPool.obtain();return r.trackIndex=e,r.animation=s,r.loop=a,r.holdPrevious=!1,r.eventThreshold=0,r.attachmentThreshold=0,r.drawOrderThreshold=0,r.animationStart=0,r.animationEnd=s.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=i?this.data.getMix(i.animation,s):0,r.mixBlend=t.MixBlend.replace,r}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 e=this.tracks;for(let s=0,a=e.length;s<a;s++){let a=e[s];if(a){for(;a.mixingFrom;)a=a.mixingFrom;do{a.mixingTo&&a.mixBlend==t.MixBlend.add||this.computeHold(a),a=a.mixingTo}while(a)}}}computeHold(e){let s=e.mixingTo,a=e.animation.timelines,i=e.animation.timelines.length,d=e.timelineMode;d.length=i;let c=e.timelineHoldMix;c.length=0;let u=this.propertyIDs;if(s&&s.holdPrevious)for(let t=0;t<i;t++)d[t]=u.addAll(a[t].getPropertyIds())?o:l;else t:for(let l=0;l<i;l++){let i=a[l],m=i.getPropertyIds();if(u.addAll(m))if(!s||i instanceof t.AttachmentTimeline||i instanceof t.DrawOrderTimeline||i instanceof t.EventTimeline||!s.animation.hasTimeline(m))d[l]=n;else{for(let t=s.mixingTo;t;t=t.mixingTo)if(!t.animation.hasTimeline(m)){if(e.mixDuration>0){d[l]=h,c[l]=t;continue t}break}d[l]=o}else d[l]=r}}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()}}t.AnimationState=e;class s{constructor(){this.mixBlend=t.MixBlend.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 0==t?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(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime}}t.TrackEntry=s;class a{constructor(t){this.objects=[],this.drainDisabled=!1,this.animState=t}start(t){this.objects.push(i.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(i.interrupt),this.objects.push(t)}end(t){this.objects.push(i.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(i.dispose),this.objects.push(t)}complete(t){this.objects.push(i.complete),this.objects.push(t)}event(t,e){this.objects.push(i.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 s=0;s<t.length;s+=2){let a=t[s],r=t[s+1];switch(a){case i.start:r.listener&&r.listener.start&&r.listener.start(r);for(let t=0;t<e.length;t++)e[t].start&&e[t].start(r);break;case i.interrupt:r.listener&&r.listener.interrupt&&r.listener.interrupt(r);for(let t=0;t<e.length;t++)e[t].interrupt&&e[t].interrupt(r);break;case i.end:r.listener&&r.listener.end&&r.listener.end(r);for(let t=0;t<e.length;t++)e[t].end&&e[t].end(r);case i.dispose:r.listener&&r.listener.dispose&&r.listener.dispose(r);for(let t=0;t<e.length;t++)e[t].dispose&&e[t].dispose(r);this.animState.trackEntryPool.free(r);break;case i.complete:r.listener&&r.listener.complete&&r.listener.complete(r);for(let t=0;t<e.length;t++)e[t].complete&&e[t].complete(r);break;case i.event:let a=t[2+s++];r.listener&&r.listener.event&&r.listener.event(r,a);for(let t=0;t<e.length;t++)e[t].event&&e[t].event(r,a)}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}}let i;t.EventQueue=a,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"}(i=t.EventType||(t.EventType={}));t.AnimationStateAdapter=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}};const r=0,n=1,l=2,o=3,h=4,d=1,c=2;let u=null}(spine||(spine={})),function(t){t.AnimationStateData=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,s){let a=this.skeletonData.findAnimation(t);if(!a)throw new Error("Animation not found: "+t);let i=this.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);this.setMixWith(a,i,s)}setMixWith(t,e,s){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let a=t.name+"."+e.name;this.animationToMixTime[a]=s}getMix(t,e){let s=t.name+"."+e.name,a=this.animationToMixTime[s];return void 0===a?this.defaultMix:a}}}(spine||(spine={})),function(t){t.AssetManager=class{constructor(t,s="",a=null){this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=s,this.downloader=a||new e}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,s){this.toLoad--,this.loaded++,this.assets[e]=s,t&&t(e,s)}error(t,e,s){this.toLoad--,this.loaded++,this.errors[e]=s,t&&t(e,s)}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=null,s=null){t=this.start(t),this.downloader.downloadBinary(t,s=>{this.success(e,t,s)},(e,a)=>{this.error(s,t,`Couldn't load binary ${t}: status ${e}, ${a}`)})}loadText(t,e=null,s=null){t=this.start(t),this.downloader.downloadText(t,s=>{this.success(e,t,s)},(e,a)=>{this.error(s,t,`Couldn't load text ${t}: status ${e}, ${a}`)})}loadJson(t,e=null,s=null){t=this.start(t),this.downloader.downloadJson(t,s=>{this.success(e,t,s)},(e,a)=>{this.error(s,t,`Couldn't load JSON ${t}: status ${e}, ${a}`)})}loadTexture(t,e=null,s=null){let a=t;t=this.start(t);let i=Laya.Laya?Laya.Laya:Laya;i.loader.load([{type:i.Loader.IMAGE,url:t}],i.Handler.create(this,r=>{if(r){let s=this.textureLoader(i.loader.getRes(t),a);this.success(e,t,s)}else this.error(s,t,"Couldn't load image: "+t)}))}loadTextureAtlas(e,s=null,a=null){let i=e.lastIndexOf("/"),r=i>=0?e.substring(0,i+1):"";e=this.start(e),this.downloader.downloadText(e,i=>{try{let n=new t.TextureAtlas(i),l=n.pages.length,o=!1;for(let t of n.pages)this.loadTexture(r+t.name,(a,i)=>{o||(t.setTexture(i),0==--l&&this.success(s,e,n))},(t,s)=>{o||this.error(a,e,`Couldn't load texture atlas ${e} page image: ${t}`),o=!0})}catch(t){this.error(a,e,`Couldn't parse texture atlas ${e}: ${t.message}`)}},(t,s)=>{this.error(a,e,`Couldn't load texture atlas ${e}: status ${t}, ${s}`)})}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let e=this.assets[t];if(e)return e;let s=this.errors[t];throw Error("Asset not found: "+t+(s?"\n"+s:""))}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 0==this.toLoad}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}};class e{constructor(){this.callbacks={},this.rawDataUris={}}downloadText(t,e,s){if(this.rawDataUris[t]&&(t=this.rawDataUris[t]),this.start(t,e,s))return;let a=Laya.Laya?Laya.Laya:Laya;a.loader.load([{type:a.Loader.TEXT,url:t}],a.Handler.create(this,e=>{e?this.finish(t,200,a.loader.getRes(t)):this.finish(t,400,"download text error: ",t)}))}downloadJson(t,e,s){this.downloadText(t,t=>{e(JSON.parse(t))},s)}downloadBinary(t,e,s){if(this.rawDataUris[t]&&(t=this.rawDataUris[t]),this.start(t,e,s))return;let a=Laya.Laya?Laya.Laya:Laya;a.loader.load([{type:a.Loader.BUFFER,url:t}],a.Handler.create(this,e=>{e?this.finish(t,200,new Uint8Array(a.loader.getRes(t))):this.finish(t,400,"Couldn't load binary "+t)}))}start(t,e,s){let a=this.callbacks[t];try{if(a)return!0;this.callbacks[t]=a=[]}finally{a.push(e,s)}}finish(t,e,s){let a=this.callbacks[t];delete this.callbacks[t];let i=200==e?[s]:[e,s];for(let t=i.length-1,e=a.length;t<e;t+=2)a[t].apply(null,i)}}t.Downloader=e}(spine||(spine={})),function(t){t.AtlasAttachmentLoader=class{constructor(t){this.atlas=t}newRegionAttachment(e,s,a){let i=this.atlas.findRegion(a);if(!i)throw new Error("Region not found in atlas: "+a+" (region attachment: "+s+")");i.renderObject=i;let r=new t.RegionAttachment(s);return r.setRegion(i),r}newMeshAttachment(e,s,a){let i=this.atlas.findRegion(a);if(!i)throw new Error("Region not found in atlas: "+a+" (mesh attachment: "+s+")");i.renderObject=i;let r=new t.MeshAttachment(s);return r.region=i,r}newBoundingBoxAttachment(e,s){return new t.BoundingBoxAttachment(s)}newPathAttachment(e,s){return new t.PathAttachment(s)}newPointAttachment(e,s){return new t.PointAttachment(s)}newClippingAttachment(e,s){return new t.ClippingAttachment(s)}}}(spine||(spine={})),function(t){t.Bone=class{constructor(t,e,s){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=s,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,s,a,i,r,n,l){this.ax=e,this.ay=s,this.arotation=a,this.ascaleX=i,this.ascaleY=r,this.ashearX=n,this.ashearY=l;let o=this.parent;if(!o){let o=this.skeleton,h=a+90+l,d=o.scaleX,c=o.scaleY;return this.a=t.MathUtils.cosDeg(a+n)*i*d,this.b=t.MathUtils.cosDeg(h)*r*d,this.c=t.MathUtils.sinDeg(a+n)*i*c,this.d=t.MathUtils.sinDeg(h)*r*c,this.worldX=e*d+o.x,void(this.worldY=s*c+o.y)}let h=o.a,d=o.b,c=o.c,u=o.d;switch(this.worldX=h*e+d*s+o.worldX,this.worldY=c*e+u*s+o.worldY,this.data.transformMode){case t.TransformMode.Normal:{let e=a+90+l,s=t.MathUtils.cosDeg(a+n)*i,o=t.MathUtils.cosDeg(e)*r,m=t.MathUtils.sinDeg(a+n)*i,f=t.MathUtils.sinDeg(e)*r;return this.a=h*s+d*m,this.b=h*o+d*f,this.c=c*s+u*m,void(this.d=c*o+u*f)}case t.TransformMode.OnlyTranslation:{let e=a+90+l;this.a=t.MathUtils.cosDeg(a+n)*i,this.b=t.MathUtils.cosDeg(e)*r,this.c=t.MathUtils.sinDeg(a+n)*i,this.d=t.MathUtils.sinDeg(e)*r;break}case t.TransformMode.NoRotationOrReflection:{let e=h*h+c*c,s=0;e>1e-4?(e=Math.abs(h*u-d*c)/e,h/=this.skeleton.scaleX,c/=this.skeleton.scaleY,d=c*e,u=h*e,s=Math.atan2(c,h)*t.MathUtils.radDeg):(h=0,c=0,s=90-Math.atan2(u,d)*t.MathUtils.radDeg);let o=a+n-s,m=a+l-s+90,f=t.MathUtils.cosDeg(o)*i,g=t.MathUtils.cosDeg(m)*r,p=t.MathUtils.sinDeg(o)*i,x=t.MathUtils.sinDeg(m)*r;this.a=h*f-d*p,this.b=h*g-d*x,this.c=c*f+u*p,this.d=c*g+u*x;break}case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:{let e=t.MathUtils.cosDeg(a),s=t.MathUtils.sinDeg(a),o=(h*e+d*s)/this.skeleton.scaleX,m=(c*e+u*s)/this.skeleton.scaleY,f=Math.sqrt(o*o+m*m);f>1e-5&&(f=1/f),o*=f,m*=f,f=Math.sqrt(o*o+m*m),this.data.transformMode==t.TransformMode.NoScale&&h*u-d*c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(f=-f);let g=Math.PI/2+Math.atan2(m,o),p=Math.cos(g)*f,x=Math.sin(g)*f,b=t.MathUtils.cosDeg(n)*i,w=t.MathUtils.cosDeg(90+l)*r,y=t.MathUtils.sinDeg(n)*i,M=t.MathUtils.sinDeg(90+l)*r;this.a=o*b+p*y,this.b=o*w+p*M,this.c=m*b+x*y,this.d=m*w+x*M;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)*t.MathUtils.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*t.MathUtils.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)return this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);let s=e.a,a=e.b,i=e.c,r=e.d,n=1/(s*r-a*i),l=this.worldX-e.worldX,o=this.worldY-e.worldY;this.ax=l*r*n-o*a*n,this.ay=o*s*n-l*i*n;let h=n*r,d=n*s,c=n*a,u=n*i,m=h*this.a-c*this.c,f=h*this.b-c*this.d,g=d*this.c-u*this.a,p=d*this.d-u*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(m*m+g*g),this.ascaleX>1e-4){let e=m*p-f*g;this.ascaleY=e/this.ascaleX,this.ashearY=Math.atan2(m*f+g*p,e)*t.MathUtils.radDeg,this.arotation=Math.atan2(g,m)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(f*f+p*p),this.ashearY=0,this.arotation=90-Math.atan2(p,f)*t.MathUtils.radDeg}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),s=t.x-this.worldX,a=t.y-this.worldY;return t.x=s*this.d*e-a*this.b*e,t.y=a*this.a*e-s*this.c*e,t}localToWorld(t){let e=t.x,s=t.y;return t.x=e*this.a+s*this.b+this.worldX,t.y=e*this.c+s*this.d+this.worldY,t}worldToLocalRotation(e){let s=t.MathUtils.sinDeg(e),a=t.MathUtils.cosDeg(e);return Math.atan2(this.a*s-this.c*a,this.d*a-this.b*s)*t.MathUtils.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let s=t.MathUtils.sinDeg(e),a=t.MathUtils.cosDeg(e);return Math.atan2(a*this.c+s*this.d,a*this.a+s*this.b)*t.MathUtils.radDeg}rotateWorld(e){let s=this.a,a=this.b,i=this.c,r=this.d,n=t.MathUtils.cosDeg(e),l=t.MathUtils.sinDeg(e);this.a=n*s-l*i,this.b=n*a-l*r,this.c=l*s+n*i,this.d=l*a+n*r}}}(spine||(spine={})),function(t){let e;t.BoneData=class{constructor(s,a,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=e.Normal,this.skinRequired=!1,this.color=new t.Color,s<0)throw new Error("index must be >= 0.");if(!a)throw new Error("name cannot be null.");this.index=s,this.name=a,this.parent=i}},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"}(e=t.TransformMode||(t.TransformMode={}))}(spine||(spine={})),function(t){t.ConstraintData=class{constructor(t,e,s){this.name=t,this.order=e,this.skinRequired=s}}}(spine||(spine={})),function(t){t.Event=class{constructor(t,e){if(!e)throw new Error("data cannot be null.");this.time=t,this.data=e}}}(spine||(spine={})),function(t){t.EventData=class{constructor(t){this.name=t}}}(spine||(spine={})),function(t){t.IkConstraint=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 s=0;s<t.bones.length;s++)this.bones.push(e.findBone(t.bones[s].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}update(){if(0==this.mix)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)}}apply1(e,s,a,i,r,n,l){let o=e.parent,h=o.a,d=o.b,c=o.c,u=o.d,m=-e.ashearX-e.arotation,f=0,g=0;switch(e.data.transformMode){case t.TransformMode.OnlyTranslation:f=s-e.worldX,g=a-e.worldY;break;case t.TransformMode.NoRotationOrReflection:let i=Math.abs(h*u-d*c)/(h*h+c*c),r=h/e.skeleton.scaleX,n=c/e.skeleton.scaleY;d=-n*i*e.skeleton.scaleX,u=r*i*e.skeleton.scaleY,m+=Math.atan2(n,r)*t.MathUtils.radDeg;default:let l=s-o.worldX,p=a-o.worldY,x=h*u-d*c;f=(l*u-p*d)/x-e.ax,g=(p*h-l*c)/x-e.ay}m+=Math.atan2(g,f)*t.MathUtils.radDeg,e.ascaleX<0&&(m+=180),m>180?m-=360:m<-180&&(m+=360);let p=e.ascaleX,x=e.ascaleY;if(i||r){switch(e.data.transformMode){case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:f=s-e.worldX,g=a-e.worldY}let o=e.data.length*p,h=Math.sqrt(f*f+g*g);if(i&&h<o||r&&h>o&&o>1e-4){let t=(h/o-1)*l+1;p*=t,n&&(x*=t)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+m*l,p,x,e.ashearX,e.ashearY)}apply2(e,s,a,i,r,n,l,o,h){let d=e.ax,c=e.ay,u=e.ascaleX,m=e.ascaleY,f=u,g=m,p=s.ascaleX,x=0,b=0,w=0;u<0?(u=-u,x=180,w=-1):(x=0,w=1),m<0&&(m=-m,w=-w),p<0?(p=-p,b=180):b=0;let y=s.ax,M=0,k=0,A=0,S=e.a,T=e.b,C=e.c,v=e.d,I=Math.abs(u-m)<=1e-4;!I||n?(M=0,k=S*y+e.worldX,A=C*y+e.worldY):(M=s.ay,k=S*y+T*M+e.worldX,A=C*y+v*M+e.worldY);let Y=e.parent;S=Y.a,T=Y.b,C=Y.c,v=Y.d;let V,X,F=1/(S*v-T*C),B=k-Y.worldX,U=A-Y.worldY,P=(B*v-U*T)*F-d,R=(U*S-B*C)*F-c,D=Math.sqrt(P*P+R*R),E=s.data.length*p;if(D<1e-4)return this.apply1(e,a,i,!1,n,!1,h),void s.updateWorldTransformWith(y,M,0,s.ascaleX,s.ascaleY,s.ashearX,s.ashearY);B=a-Y.worldX,U=i-Y.worldY;let L=(B*v-U*T)*F-d,N=(U*S-B*C)*F-c,z=L*L+N*N;if(0!=o){o*=u*(p+1)*.5;let t=Math.sqrt(z),e=t-D-E*u+o;if(e>0){let s=Math.min(1,e/(2*o))-1;s=(e-o*(1-s*s))/t,L-=s*L,N-=s*N,z=L*L+N*N}}t:if(I){E*=u;let t=(z-D*D-E*E)/(2*D*E);t<-1?(t=-1,X=Math.PI*r):t>1?(t=1,X=0,n&&(S=(Math.sqrt(z)/(D+E)-1)*h+1,f*=S,l&&(g*=S))):X=Math.acos(t)*r,S=D+E*t,T=E*Math.sin(X),V=Math.atan2(N*S-L*T,L*S+N*T)}else{S=u*E,T=m*E;let e=S*S,s=T*T,a=Math.atan2(N,L);C=s*D*D+e*z-e*s;let i=-2*s*D,n=s-e;if(v=i*i-4*n*C,v>=0){let t=Math.sqrt(v);i<0&&(t=-t),t=.5*-(i+t);let e=t/n,s=C/t,l=Math.abs(e)<Math.abs(s)?e:s;if(l*l<=z){U=Math.sqrt(z-l*l)*r,V=a-Math.atan2(U,l),X=Math.atan2(U/m,(l-D)/u);break t}}let l=t.MathUtils.PI,o=D-S,h=o*o,d=0,c=0,f=D+S,g=f*f,p=0;C=-S*D/(e-s),C>=-1&&C<=1&&(C=Math.acos(C),B=S*Math.cos(C)+D,U=T*Math.sin(C),v=B*B+U*U,v<h&&(l=C,h=v,o=B,d=U),v>g&&(c=C,g=v,f=B,p=U)),z<=.5*(h+g)?(V=a-Math.atan2(d*r,o),X=l*r):(V=a-Math.atan2(p*r,f),X=c*r)}let W=Math.atan2(M,y)*w,O=e.arotation;V=(V-W)*t.MathUtils.radDeg+x-O,V>180?V-=360:V<-180&&(V+=360),e.updateWorldTransformWith(d,c,O+V*h,f,g,0,0),O=s.arotation,X=((X+W)*t.MathUtils.radDeg-s.ashearX)*w+b-O,X>180?X-=360:X<-180&&(X+=360),s.updateWorldTransformWith(y,M,O+X*h,s.ascaleX,s.ascaleY,s.ashearX,s.ashearY)}}}(spine||(spine={})),function(t){class e extends t.ConstraintData{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}}t.IkConstraintData=e}(spine||(spine={})),function(t){class e{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 s=0,a=t.bones.length;s<a;s++)this.bones.push(e.findBone(t.bones[s].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 s=this.target.getAttachment();if(!(s instanceof t.PathAttachment))return;let a=this.mixRotate,i=this.mixX,r=this.mixY;if(0==a&&0==i&&0==r)return;let n=this.data,l=n.rotateMode==t.RotateMode.Tangent,o=n.rotateMode==t.RotateMode.ChainScale,h=this.bones,d=h.length,c=l?d:d+1,u=t.Utils.setArraySize(this.spaces,c),m=o?this.lengths=t.Utils.setArraySize(this.lengths,d):null,f=this.spacing;switch(n.spacingMode){case t.SpacingMode.Percent:if(o)for(let t=0,s=c-1;t<s;t++){let s=h[t],a=s.data.length;if(a<e.epsilon)m[t]=0;else{let e=a*s.a,i=a*s.c;m[t]=Math.sqrt(e*e+i*i)}}t.Utils.arrayFill(u,1,c,f);break;case t.SpacingMode.Proportional:let s=0;for(let t=0,a=c-1;t<a;){let a=h[t],i=a.data.length;if(i<e.epsilon)o&&(m[t]=0),u[++t]=f;else{let e=i*a.a,r=i*a.c,n=Math.sqrt(e*e+r*r);o&&(m[t]=n),u[++t]=n,s+=n}}if(s>0){s=c/s*f;for(let t=1;t<c;t++)u[t]*=s}break;default:let a=n.spacingMode==t.SpacingMode.Length;for(let t=0,s=c-1;t<s;){let s=h[t],i=s.data.length;if(i<e.epsilon)o&&(m[t]=0),u[++t]=f;else{let e=i*s.a,r=i*s.c,n=Math.sqrt(e*e+r*r);o&&(m[t]=n),u[++t]=(a?i+f:f)*n/i}}}let g=this.computeWorldPositions(s,c,l),p=g[0],x=g[1],b=n.offsetRotation,w=!1;if(0==b)w=n.rotateMode==t.RotateMode.Chain;else{w=!1;let e=this.target.bone;b*=e.a*e.d-e.b*e.c>0?t.MathUtils.degRad:-t.MathUtils.degRad}for(let e=0,s=3;e<d;e++,s+=3){let n=h[e];n.worldX+=(p-n.worldX)*i,n.worldY+=(x-n.worldY)*r;let d=g[s],c=g[s+1],f=d-p,y=c-x;if(o){let t=m[e];if(0!=t){let e=(Math.sqrt(f*f+y*y)/t-1)*a+1;n.a*=e,n.c*=e}}if(p=d,x=c,a>0){let i=n.a,r=n.b,o=n.c,h=n.d,d=0,c=0,m=0;if(d=l?g[s-1]:0==u[e+1]?g[s+2]:Math.atan2(y,f),d-=Math.atan2(o,i),w){c=Math.cos(d),m=Math.sin(d);let t=n.data.length;p+=(t*(c*i-m*o)-f)*a,x+=(t*(m*i+c*o)-y)*a}else d+=b;d>t.MathUtils.PI?d-=t.MathUtils.PI2:d<-t.MathUtils.PI&&(d+=t.MathUtils.PI2),d*=a,c=Math.cos(d),m=Math.sin(d),n.a=c*i-m*o,n.b=c*r-m*h,n.c=m*i+c*o,n.d=m*r+c*h}n.updateAppliedTransform()}}computeWorldPositions(s,a,i){let r=this.target,n=this.position,l=this.spaces,o=t.Utils.setArraySize(this.positions,3*a+2),h=null,d=s.closed,c=s.worldVerticesLength,u=c/6,m=e.NONE;if(!s.constantSpeed){let f=s.lengths;u-=d?1:2;let g,p=f[u];switch(this.data.positionMode==t.PositionMode.Percent&&(n*=p),this.data.spacingMode){case t.SpacingMode.Percent:g=p;break;case t.SpacingMode.Proportional:g=p/a;break;default:g=1}h=t.Utils.setArraySize(this.world,8);for(let t=0,x=0,b=0;t<a;t++,x+=3){let a=l[t]*g;n+=a;let w=n;if(d)w%=p,w<0&&(w+=p),b=0;else{if(w<0){m!=e.BEFORE&&(m=e.BEFORE,s.computeWorldVertices(r,2,4,h,0,2)),this.addBeforePosition(w,h,0,o,x);continue}if(w>p){m!=e.AFTER&&(m=e.AFTER,s.computeWorldVertices(r,c-6,4,h,0,2)),this.addAfterPosition(w-p,h,0,o,x);continue}}for(;;b++){let t=f[b];if(!(w>t)){if(0==b)w/=t;else{let e=f[b-1];w=(w-e)/(t-e)}break}}b!=m&&(m=b,d&&b==u?(s.computeWorldVertices(r,c-4,4,h,0,2),s.computeWorldVertices(r,0,4,h,4,2)):s.computeWorldVertices(r,6*b+2,8,h,0,2)),this.addCurvePosition(w,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],o,x,i||t>0&&0==a)}return o}d?(c+=2,h=t.Utils.setArraySize(this.world,c),s.computeWorldVertices(r,2,c-4,h,0,2),s.computeWorldVertices(r,0,2,h,c-4,2),h[c-2]=h[0],h[c-1]=h[1]):(u--,c-=4,h=t.Utils.setArraySize(this.world,c),s.computeWorldVertices(r,2,c,h,0,2));let f,g=t.Utils.setArraySize(this.curves,u),p=0,x=h[0],b=h[1],w=0,y=0,M=0,k=0,A=0,S=0,T=0,C=0,v=0,I=0,Y=0,V=0,X=0,F=0;for(let t=0,e=2;t<u;t++,e+=6)w=h[e],y=h[e+1],M=h[e+2],k=h[e+3],A=h[e+4],S=h[e+5],T=.1875*(x-2*w+M),C=.1875*(b-2*y+k),v=.09375*(3*(w-M)-x+A),I=.09375*(3*(y-k)-b+S),Y=2*T+v,V=2*C+I,X=.75*(w-x)+T+.16666667*v,F=.75*(y-b)+C+.16666667*I,p+=Math.sqrt(X*X+F*F),X+=Y,F+=V,Y+=v,V+=I,p+=Math.sqrt(X*X+F*F),X+=Y,F+=V,p+=Math.sqrt(X*X+F*F),X+=Y+v,F+=V+I,p+=Math.sqrt(X*X+F*F),g[t]=p,x=A,b=S;switch(this.data.positionMode==t.PositionMode.Percent&&(n*=p),this.data.spacingMode){case t.SpacingMode.Percent:f=p;break;case t.SpacingMode.Proportional:f=p/a;break;default:f=1}let B=this.segments,U=0;for(let t=0,e=0,s=0,r=0;t<a;t++,e+=3){let a=l[t]*f;n+=a;let u=n;if(d)u%=p,u<0&&(u+=p),s=0;else{if(u<0){this.addBeforePosition(u,h,0,o,e);continue}if(u>p){this.addAfterPosition(u-p,h,c-4,o,e);continue}}for(;;s++){let t=g[s];if(!(u>t)){if(0==s)u/=t;else{let e=g[s-1];u=(u-e)/(t-e)}break}}if(s!=m){m=s;let t=6*s;for(x=h[t],b=h[t+1],w=h[t+2],y=h[t+3],M=h[t+4],k=h[t+5],A=h[t+6],S=h[t+7],T=.03*(x-2*w+M),C=.03*(b-2*y+k),v=.006*(3*(w-M)-x+A),I=.006*(3*(y-k)-b+S),Y=2*T+v,V=2*C+I,X=.3*(w-x)+T+.16666667*v,F=.3*(y-b)+C+.16666667*I,U=Math.sqrt(X*X+F*F),B[0]=U,t=1;t<8;t++)X+=Y,F+=V,Y+=v,V+=I,U+=Math.sqrt(X*X+F*F),B[t]=U;X+=Y,F+=V,U+=Math.sqrt(X*X+F*F),B[8]=U,X+=Y+v,F+=V+I,U+=Math.sqrt(X*X+F*F),B[9]=U,r=0}for(u*=U;;r++){let t=B[r];if(!(u>t)){if(0==r)u/=t;else{let e=B[r-1];u=r+(u-e)/(t-e)}break}}this.addCurvePosition(.1*u,x,b,w,y,M,k,A,S,o,e,i||t>0&&0==a)}return o}addBeforePosition(t,e,s,a,i){let r=e[s],n=e[s+1],l=e[s+2]-r,o=e[s+3]-n,h=Math.atan2(o,l);a[i]=r+t*Math.cos(h),a[i+1]=n+t*Math.sin(h),a[i+2]=h}addAfterPosition(t,e,s,a,i){let r=e[s+2],n=e[s+3],l=r-e[s],o=n-e[s+1],h=Math.atan2(o,l);a[i]=r+t*Math.cos(h),a[i+1]=n+t*Math.sin(h),a[i+2]=h}addCurvePosition(t,e,s,a,i,r,n,l,o,h,d,c){if(0==t||isNaN(t))return h[d]=e,h[d+1]=s,void(h[d+2]=Math.atan2(i-s,a-e));let u=t*t,m=u*t,f=1-t,g=f*f,p=g*f,x=f*t,b=3*x,w=f*b,y=b*t,M=e*p+a*w+r*y+l*m,k=s*p+i*w+n*y+o*m;h[d]=M,h[d+1]=k,c&&(h[d+2]=t<.001?Math.atan2(i-s,a-e):Math.atan2(k-(s*g+i*x*2+n*u),M-(e*g+a*x*2+r*u)))}}e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,t.PathConstraint=e}(spine||(spine={})),function(t){class e extends t.ConstraintData{constructor(t){super(t,0,!1),this.bones=new Array,this.mixRotate=0,this.mixX=0,this.mixY=0}}let s,a,i;t.PathConstraintData=e,function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(s=t.PositionMode||(t.PositionMode={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"}(a=t.SpacingMode||(t.SpacingMode={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(i=t.RotateMode||(t.RotateMode={}))}(spine||(spine={})),function(t){t.Skeleton=class{constructor(e){if(this._updateCache=new Array,this.time=0,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 s=0;s<e.bones.length;s++){let a,i=e.bones[s];if(i.parent){let e=this.bones[i.parent.index];a=new t.Bone(i,this,e),e.children.push(a)}else a=new t.Bone(i,this,null);this.bones.push(a)}this.slots=new Array,this.drawOrder=new Array;for(let s=0;s<e.slots.length;s++){let a=e.slots[s],i=this.bones[a.boneData.index],r=new t.Slot(a,i);this.slots.push(r),this.drawOrder.push(r)}this.ikConstraints=new Array;for(let s=0;s<e.ikConstraints.length;s++){let a=e.ikConstraints[s];this.ikConstraints.push(new t.IkConstraint(a,this))}this.transformConstraints=new Array;for(let s=0;s<e.transformConstraints.length;s++){let a=e.transformConstraints[s];this.transformConstraints.push(new t.TransformConstraint(a,this))}this.pathConstraints=new Array;for(let s=0;s<e.pathConstraints.length;s++){let a=e.pathConstraints[s];this.pathConstraints.push(new t.PathConstraint(a,this))}this.color=new t.Color(1,1,1,1),this.updateCache()}updateCache(){this._updateCache.length=0;let t=this.bones;for(let e=0,s=t.length;e<s;e++){let s=t[e];s.sorted=s.data.skinRequired,s.active=!s.sorted}if(this.skin){let t=this.skin.bones;for(let e=0,s=this.skin.bones.length;e<s;e++){let s=this.bones[t[e].index];do{s.sorted=!1,s.active=!0,s=s.parent}while(s)}}let e=this.ikConstraints,s=this.transformConstraints,a=this.pathConstraints,i=e.length,r=s.length,n=a.length,l=i+r+n;t:for(let t=0;t<l;t++){for(let s=0;s<i;s++){let a=e[s];if(a.data.order==t){this.sortIkConstraint(a);continue t}}for(let e=0;e<r;e++){let a=s[e];if(a.data.order==t){this.sortTransformConstraint(a);continue t}}for(let e=0;e<n;e++){let s=a[e];if(s.data.order==t){this.sortPathConstraint(s);continue t}}}for(let e=0,s=t.length;e<s;e++)this.sortBone(t[e])}sortIkConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),!e.active)return;let s=e.target;this.sortBone(s);let a=e.bones,i=a[0];if(this.sortBone(i),1==a.length)this._updateCache.push(e),this.sortReset(i.children);else{let t=a[a.length-1];this.sortBone(t),this._updateCache.push(e),this.sortReset(i.children),t.sorted=!0}}sortPathConstraint(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),!e.active)return;let s=e.target,a=s.data.index,i=s.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,a,i),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,a,i);for(let t=0,e=this.data.skins.length;t<e;t++)this.sortPathConstraintAttachment(this.data.skins[t],a,i);let r=s.getAttachment();r instanceof t.PathAttachment&&this.sortPathConstraintAttachmentWith(r,i);let n=e.bones,l=n.length;for(let t=0;t<l;t++)this.sortBone(n[t]);this._updateCache.push(e);for(let t=0;t<l;t++)this.sortReset(n[t].children);for(let t=0;t<l;t++)n[t].sorted=!0}sortTransformConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),!e.active)return;this.sortBone(e.target);let s=e.bones,a=s.length;if(e.data.local)for(let t=0;t<a;t++){let e=s[t];this.sortBone(e.parent),this.sortBone(e)}else for(let t=0;t<a;t++)this.sortBone(s[t]);this._updateCache.push(e);for(let t=0;t<a;t++)this.sortReset(s[t].children);for(let t=0;t<a;t++)s[t].sorted=!0}sortPathConstraintAttachment(t,e,s){let a=t.attachments[e];if(a)for(let t in a)this.sortPathConstraintAttachmentWith(a[t],s)}sortPathConstraintAttachmentWith(e,s){if(!(e instanceof t.PathAttachment))return;let a=e.bones;if(a){let t=this.bones;for(let e=0,s=a.length;e<s;){let s=a[e++];for(s+=e;e<s;)this.sortBone(t[a[e++]])}}else this.sortBone(s)}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,s=t.length;e<s;e++){let s=t[e];s.active&&(s.sorted&&this.sortReset(s.children),s.sorted=!1)}}updateWorldTransform(){let t=this.bones;for(let e=0,s=t.length;e<s;e++){let s=t[e];s.ax=s.x,s.ay=s.y,s.arotation=s.rotation,s.ascaleX=s.scaleX,s.ascaleY=s.scaleY,s.ashearX=s.shearX,s.ashearY=s.shearY}let e=this._updateCache;for(let t=0,s=e.length;t<s;t++)e[t].update()}updateWorldTransformWith(e){let s=this.getRootBone(),a=e.a,i=e.b,r=e.c,n=e.d;s.worldX=a*this.x+i*this.y+e.worldX,s.worldY=r*this.x+n*this.y+e.worldY;let l=s.rotation+90+s.shearY,o=t.MathUtils.cosDeg(s.rotation+s.shearX)*s.scaleX,h=t.MathUtils.cosDeg(l)*s.scaleY,d=t.MathUtils.sinDeg(s.rotation+s.shearX)*s.scaleX,c=t.MathUtils.sinDeg(l)*s.scaleY;s.a=(a*o+i*d)*this.scaleX,s.b=(a*h+i*c)*this.scaleX,s.c=(r*o+n*d)*this.scaleY,s.d=(r*h+n*c)*this.scaleY;let u=this._updateCache;for(let t=0,e=u.length;t<e;t++){let e=u[t];e!=s&&e.update()}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){let t=this.bones;for(let e=0,s=t.length;e<s;e++)t[e].setToSetupPose();let e=this.ikConstraints;for(let t=0,s=e.length;t<s;t++){let s=e[t];s.mix=s.data.mix,s.softness=s.data.softness,s.bendDirection=s.data.bendDirection,s.compress=s.data.compress,s.stretch=s.data.stretch}let s=this.transformConstraints;for(let t=0,e=s.length;t<e;t++){let e=s[t],a=e.data;e.mixRotate=a.mixRotate,e.mixX=a.mixX,e.mixY=a.mixY,e.mixScaleX=a.mixScaleX,e.mixScaleY=a.mixScaleY,e.mixShearY=a.mixShearY}let a=this.pathConstraints;for(let t=0,e=a.length;t<e;t++){let e=a[t],s=e.data;e.position=s.position,e.spacing=s.spacing,e.mixRotate=s.mixRotate,e.mixX=s.mixX,e.mixY=s.mixY}}setSlotsToSetupPose(){let e=this.slots;t.Utils.arrayCopy(e,0,this.drawOrder,0,e.length);for(let t=0,s=e.length;t<s;t++)e[t].setToSetupPose()}getRootBone(){return 0==this.bones.length?null:this.bones[0]}findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let s=0,a=e.length;s<a;s++){let a=e[s];if(a.data.name==t)return a}return null}findBoneIndex(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let s=0,a=e.length;s<a;s++)if(e[s].data.name==t)return s;return-1}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,a=e.length;s<a;s++){let a=e[s];if(a.data.name==t)return a}return null}findSlotIndex(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,a=e.length;s<a;s++)if(e[s].data.name==t)return s;return-1}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 s=0,a=e.length;s<a;s++){let a=e[s],i=a.data.attachmentName;if(i){let e=t.getAttachment(s,i);e&&a.setAttachment(e)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,e){return this.getAttachment(this.data.findSlotIndex(t),e)}getAttachment(t,e){if(!e)throw new Error("attachmentName cannot be null.");if(this.skin){let s=this.skin.getAttachment(t,e);if(s)return s}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null}setAttachment(t,e){if(!t)throw new Error("slotName cannot be null.");let s=this.slots;for(let a=0,i=s.length;a<i;a++){let i=s[a];if(i.data.name==t){let s=null;if(e&&(s=this.getAttachment(a,e),!s))throw new Error("Attachment not found: "+e+", for slot: "+t);return void i.setAttachment(s)}}throw new Error("Slot not found: "+t)}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.ikConstraints;for(let s=0,a=e.length;s<a;s++){let a=e[s];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 s=0,a=e.length;s<a;s++){let a=e[s];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 s=0,a=e.length;s<a;s++){let a=e[s];if(a.data.name==t)return a}return null}getBounds(e,s,a=new Array(2)){if(!e)throw new Error("offset cannot be null.");if(!s)throw new Error("size cannot be null.");let i=this.drawOrder,r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let e=0,s=i.length;e<s;e++){let s=i[e];if(!s.bone.active)continue;let h=0,d=null,c=s.getAttachment();if(c instanceof t.RegionAttachment)h=8,d=t.Utils.setArraySize(a,h,0),c.computeWorldVertices(s.bone,d,0,2);else if(c instanceof t.MeshAttachment){let e=c;h=e.worldVerticesLength,d=t.Utils.setArraySize(a,h,0),e.computeWorldVertices(s,0,h,d,0,2)}if(d)for(let t=0,e=d.length;t<e;t+=2){let e=d[t],s=d[t+1];r=Math.min(r,e),n=Math.min(n,s),l=Math.max(l,e),o=Math.max(o,s)}}e.set(r,n),s.set(l-r,o-n)}update(t){this.time+=t}}}(spine||(spine={})),function(t){t.SkeletonBinary=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(s){let a=this.scale,i=new t.SkeletonData;i.name="";let r=new e(s),n=r.readInt32(),l=r.readInt32();i.hash=0==l&&0==n?null:l.toString(16)+n.toString(16),i.version=r.readString(),i.x=r.readFloat(),i.y=r.readFloat(),i.width=r.readFloat(),i.height=r.readFloat();let o=r.readBoolean();o&&(i.fps=r.readFloat(),i.imagesPath=r.readString(),i.audioPath=r.readString());let h=0;h=r.readInt(!0);for(let t=0;t<h;t++)r.strings.push(r.readString());h=r.readInt(!0);for(let e=0;e<h;e++){let s=r.readString(),n=0==e?null:i.bones[r.readInt(!0)],l=new t.BoneData(e,s,n);l.rotation=r.readFloat(),l.x=r.readFloat()*a,l.y=r.readFloat()*a,l.scaleX=r.readFloat(),l.scaleY=r.readFloat(),l.shearX=r.readFloat(),l.shearY=r.readFloat(),l.length=r.readFloat()*a,l.transformMode=r.readInt(!0),l.skinRequired=r.readBoolean(),o&&t.Color.rgba8888ToColor(l.color,r.readInt32()),i.bones.push(l)}h=r.readInt(!0);for(let e=0;e<h;e++){let s=r.readString(),a=i.bones[r.readInt(!0)],n=new t.SlotData(e,s,a);t.Color.rgba8888ToColor(n.color,r.readInt32());let l=r.readInt32();-1!=l&&t.Color.rgb888ToColor(n.darkColor=new t.Color,l),n.attachmentName=r.readStringRef(),n.blendMode=r.readInt(!0),i.slots.push(n)}h=r.readInt(!0);for(let e,s=0;s<h;s++){let s=new t.IkConstraintData(r.readString());s.order=r.readInt(!0),s.skinRequired=r.readBoolean(),e=r.readInt(!0);for(let t=0;t<e;t++)s.bones.push(i.bones[r.readInt(!0)]);s.target=i.bones[r.readInt(!0)],s.mix=r.readFloat(),s.softness=r.readFloat()*a,s.bendDirection=r.readByte(),s.compress=r.readBoolean(),s.stretch=r.readBoolean(),s.uniform=r.readBoolean(),i.ikConstraints.push(s)}h=r.readInt(!0);for(let e,s=0;s<h;s++){let s=new t.TransformConstraintData(r.readString());s.order=r.readInt(!0),s.skinRequired=r.readBoolean(),e=r.readInt(!0);for(let t=0;t<e;t++)s.bones.push(i.bones[r.readInt(!0)]);s.target=i.bones[r.readInt(!0)],s.local=r.readBoolean(),s.relative=r.readBoolean(),s.offsetRotation=r.readFloat(),s.offsetX=r.readFloat()*a,s.offsetY=r.readFloat()*a,s.offsetScaleX=r.readFloat(),s.offsetScaleY=r.readFloat(),s.offsetShearY=r.readFloat(),s.mixRotate=r.readFloat(),s.mixX=r.readFloat(),s.mixY=r.readFloat(),s.mixScaleX=r.readFloat(),s.mixScaleY=r.readFloat(),s.mixShearY=r.readFloat(),i.transformConstraints.push(s)}h=r.readInt(!0);for(let e,s=0;s<h;s++){let s=new t.PathConstraintData(r.readString());s.order=r.readInt(!0),s.skinRequired=r.readBoolean(),e=r.readInt(!0);for(let t=0;t<e;t++)s.bones.push(i.bones[r.readInt(!0)]);s.target=i.slots[r.readInt(!0)],s.positionMode=r.readInt(!0),s.spacingMode=r.readInt(!0),s.rotateMode=r.readInt(!0),s.offsetRotation=r.readFloat(),s.position=r.readFloat(),s.positionMode==t.PositionMode.Fixed&&(s.position*=a),s.spacing=r.readFloat(),s.spacingMode!=t.SpacingMode.Length&&s.spacingMode!=t.SpacingMode.Fixed||(s.spacing*=a),s.mixRotate=r.readFloat(),s.mixX=r.readFloat(),s.mixY=r.readFloat(),i.pathConstraints.push(s)}let d=this.readSkin(r,i,!0,o);d&&(i.defaultSkin=d,i.skins.push(d));{let e=i.skins.length;for(t.Utils.setArraySize(i.skins,h=e+r.readInt(!0));e<h;e++)i.skins[e]=this.readSkin(r,i,!1,o)}h=this.linkedMeshes.length;for(let t=0;t<h;t++){let e=this.linkedMeshes[t],s=(e.skin?i.findSkin(e.skin):i.defaultSkin).getAttachment(e.slotIndex,e.parent);e.mesh.deformAttachment=e.inheritDeform?s:e.mesh,e.mesh.setParentMesh(s),e.mesh.updateUVs()}this.linkedMeshes.length=0,h=r.readInt(!0);for(let e=0;e<h;e++){let e=new t.EventData(r.readStringRef());e.intValue=r.readInt(!1),e.floatValue=r.readFloat(),e.stringValue=r.readString(),e.audioPath=r.readString(),e.audioPath&&(e.volume=r.readFloat(),e.balance=r.readFloat()),i.events.push(e)}h=r.readInt(!0);for(let t=0;t<h;t++)i.animations.push(this.readAnimation(r,r.readString(),i));return i}readSkin(e,s,a,i){let r=null,n=0;if(a){if(n=e.readInt(!0),0==n)return null;r=new t.Skin("default")}else{r=new t.Skin(e.readStringRef()),r.bones.length=e.readInt(!0);for(let t=0,a=r.bones.length;t<a;t++)r.bones[t]=s.bones[e.readInt(!0)];for(let t=0,a=e.readInt(!0);t<a;t++)r.constraints.push(s.ikConstraints[e.readInt(!0)]);for(let t=0,a=e.readInt(!0);t<a;t++)r.constraints.push(s.transformConstraints[e.readInt(!0)]);for(let t=0,a=e.readInt(!0);t<a;t++)r.constraints.push(s.pathConstraints[e.readInt(!0)]);n=e.readInt(!0)}for(let t=0;t<n;t++){let t=e.readInt(!0);for(let a=0,n=e.readInt(!0);a<n;a++){let a=e.readStringRef(),n=this.readAttachment(e,s,r,t,a,i);n&&r.setAttachment(t,a,n)}}return r}readAttachment(e,a,r,n,l,o){let h=this.scale,d=e.readStringRef();switch(d||(d=l),e.readByte()){case i.Region:{let s=e.readStringRef(),a=e.readFloat(),i=e.readFloat(),n=e.readFloat(),l=e.readFloat(),o=e.readFloat(),c=e.readFloat(),u=e.readFloat(),m=e.readInt32();s||(s=d);let f=this.attachmentLoader.newRegionAttachment(r,d,s);return f?(f.path=s,f.x=i*h,f.y=n*h,f.scaleX=l,f.scaleY=o,f.rotation=a,f.width=c*h,f.height=u*h,t.Color.rgba8888ToColor(f.color,m),f.updateOffset(),f):null}case i.BoundingBox:{let s=e.readInt(!0),a=this.readVertices(e,s),i=o?e.readInt32():0,n=this.attachmentLoader.newBoundingBoxAttachment(r,d);return n?(n.worldVerticesLength=s<<1,n.vertices=a.vertices,n.bones=a.bones,o&&t.Color.rgba8888ToColor(n.color,i),n):null}case i.Mesh:{let s=e.readStringRef(),a=e.readInt32(),i=e.readInt(!0),n=this.readFloatArray(e,i<<1,1),l=this.readShortArray(e),c=this.readVertices(e,i),u=e.readInt(!0),m=null,f=0,g=0;o&&(m=this.readShortArray(e),f=e.readFloat(),g=e.readFloat()),s||(s=d);let p=this.attachmentLoader.newMeshAttachment(r,d,s);return p?(p.path=s,t.Color.rgba8888ToColor(p.color,a),p.bones=c.bones,p.vertices=c.vertices,p.worldVerticesLength=i<<1,p.triangles=l,p.regionUVs=n,p.updateUVs(),p.hullLength=u<<1,o&&(p.edges=m,p.width=f*h,p.height=g*h),p):null}case i.LinkedMesh:{let a=e.readStringRef(),i=e.readInt32(),l=e.readStringRef(),c=e.readStringRef(),u=e.readBoolean(),m=0,f=0;o&&(m=e.readFloat(),f=e.readFloat()),a||(a=d);let g=this.attachmentLoader.newMeshAttachment(r,d,a);return g?(g.path=a,t.Color.rgba8888ToColor(g.color,i),o&&(g.width=m*h,g.height=f*h),this.linkedMeshes.push(new s(g,l,n,c,u)),g):null}case i.Path:{let s=e.readBoolean(),a=e.readBoolean(),i=e.readInt(!0),n=this.readVertices(e,i),l=t.Utils.newArray(i/3,0);for(let t=0,s=l.length;t<s;t++)l[t]=e.readFloat()*h;let c=o?e.readInt32():0,u=this.attachmentLoader.newPathAttachment(r,d);return u?(u.closed=s,u.constantSpeed=a,u.worldVerticesLength=i<<1,u.vertices=n.vertices,u.bones=n.bones,u.lengths=l,o&&t.Color.rgba8888ToColor(u.color,c),u):null}case i.Point:{let s=e.readFloat(),a=e.readFloat(),i=e.readFloat(),n=o?e.readInt32():0,l=this.attachmentLoader.newPointAttachment(r,d);return l?(l.x=a*h,l.y=i*h,l.rotation=s,o&&t.Color.rgba8888ToColor(l.color,n),l):null}case i.Clipping:{let s=e.readInt(!0),i=e.readInt(!0),n=this.readVertices(e,i),l=o?e.readInt32():0,h=this.attachmentLoader.newClippingAttachment(r,d);return h?(h.endSlot=a.slots[s],h.worldVerticesLength=i<<1,h.vertices=n.vertices,h.bones=n.bones,o&&t.Color.rgba8888ToColor(h.color,l),h):null}}return null}readVertices(e,s){let i=this.scale,r=s<<1,n=new a;if(!e.readBoolean())return n.vertices=this.readFloatArray(e,r,i),n;let l=new Array,o=new Array;for(let t=0;t<s;t++){let t=e.readInt(!0);o.push(t);for(let s=0;s<t;s++)o.push(e.readInt(!0)),l.push(e.readFloat()*i),l.push(e.readFloat()*i),l.push(e.readFloat())}return n.vertices=t.Utils.toFloatArray(l),n.bones=o,n}readFloatArray(t,e,s){let a=new Array(e);if(1==s)for(let s=0;s<e;s++)a[s]=t.readFloat();else for(let i=0;i<e;i++)a[i]=t.readFloat()*s;return a}readShortArray(t){let e=t.readInt(!0),s=new Array(e);for(let a=0;a<e;a++)s[a]=t.readShort();return s}readAnimation(e,s,a){e.readInt(!0);let i=new Array,C=this.scale;new t.Color,new t.Color;for(let s=0,a=e.readInt(!0);s<a;s++){let s=e.readInt(!0);for(let a=0,r=e.readInt(!0);a<r;a++){let a=e.readByte(),r=e.readInt(!0),n=r-1;switch(a){case g:{let a=new t.AttachmentTimeline(r,s);for(let t=0;t<r;t++)a.setFrame(t,e.readFloat(),e.readStringRef());i.push(a);break}case p:{let a=e.readInt(!0),l=new t.RGBATimeline(r,a,s),o=e.readFloat(),h=e.readUnsignedByte()/255,d=e.readUnsignedByte()/255,c=e.readUnsignedByte()/255,u=e.readUnsignedByte()/255;for(let t=0,s=0;l.setFrame(t,o,h,d,c,u),t!=n;t++){let a=e.readFloat(),i=e.readUnsignedByte()/255,r=e.readUnsignedByte()/255,n=e.readUnsignedByte()/255,m=e.readUnsignedByte()/255;switch(e.readByte()){case S:l.setStepped(t);break;case T:setBezier(e,l,s++,t,0,o,a,h,i,1),setBezier(e,l,s++,t,1,o,a,d,r,1),setBezier(e,l,s++,t,2,o,a,c,n,1),setBezier(e,l,s++,t,3,o,a,u,m,1)}o=a,h=i,d=r,c=n,u=m}i.push(l);break}case x:{let a=e.readInt(!0),l=new t.RGBTimeline(r,a,s),o=e.readFloat(),h=e.readUnsignedByte()/255,d=e.readUnsignedByte()/255,c=e.readUnsignedByte()/255;for(let t=0,s=0;l.setFrame(t,o,h,d,c),t!=n;t++){let a=e.readFloat(),i=e.readUnsignedByte()/255,r=e.readUnsignedByte()/255,n=e.readUnsignedByte()/255;switch(e.readByte()){case S:l.setStepped(t);break;case T:setBezier(e,l,s++,t,0,o,a,h,i,1),setBezier(e,l,s++,t,1,o,a,d,r,1),setBezier(e,l,s++,t,2,o,a,c,n,1)}o=a,h=i,d=r,c=n}i.push(l);break}case b:{let a=e.readInt(!0),l=new t.RGBA2Timeline(r,a,s),o=e.readFloat(),h=e.readUnsignedByte()/255,d=e.readUnsignedByte()/255,c=e.readUnsignedByte()/255,u=e.readUnsignedByte()/255,m=e.readUnsignedByte()/255,f=e.readUnsignedByte()/255,g=e.readUnsignedByte()/255;for(let t=0,s=0;l.setFrame(t,o,h,d,c,u,m,f,g),t!=n;t++){let a=e.readFloat(),i=e.readUnsignedByte()/255,r=e.readUnsignedByte()/255,n=e.readUnsignedByte()/255,p=e.readUnsignedByte()/255,x=e.readUnsignedByte()/255,b=e.readUnsignedByte()/255,w=e.readUnsignedByte()/255;switch(e.readByte()){case S:l.setStepped(t);break;case T:setBezier(e,l,s++,t,0,o,a,h,i,1),setBezier(e,l,s++,t,1,o,a,d,r,1),setBezier(e,l,s++,t,2,o,a,c,n,1),setBezier(e,l,s++,t,3,o,a,u,p,1),setBezier(e,l,s++,t,4,o,a,m,x,1),setBezier(e,l,s++,t,5,o,a,f,b,1),setBezier(e,l,s++,t,6,o,a,g,w,1)}o=a,h=i,d=r,c=n,u=p,m=x,f=b,g=w}i.push(l);break}case w:{let a=e.readInt(!0),l=new t.RGB2Timeline(r,a,s),o=e.readFloat(),h=e.readUnsignedByte()/255,d=e.readUnsignedByte()/255,c=e.readUnsignedByte()/255,u=e.readUnsignedByte()/255,m=e.readUnsignedByte()/255,f=e.readUnsignedByte()/255;for(let t=0,s=0;l.setFrame(t,o,h,d,c,u,m,f),t!=n;t++){let a=e.readFloat(),i=e.readUnsignedByte()/255,r=e.readUnsignedByte()/255,n=e.readUnsignedByte()/255,g=e.readUnsignedByte()/255,p=e.readUnsignedByte()/255,x=e.readUnsignedByte()/255;switch(e.readByte()){case S:l.setStepped(t);break;case T:setBezier(e,l,s++,t,0,o,a,h,i,1),setBezier(e,l,s++,t,1,o,a,d,r,1),setBezier(e,l,s++,t,2,o,a,c,n,1),setBezier(e,l,s++,t,3,o,a,u,g,1),setBezier(e,l,s++,t,4,o,a,m,p,1),setBezier(e,l,s++,t,5,o,a,f,x,1)}o=a,h=i,d=r,c=n,u=g,m=p,f=x}i.push(l);break}case y:{let a=new t.AlphaTimeline(r,e.readInt(!0),s),l=e.readFloat(),o=e.readUnsignedByte()/255;for(let t=0,s=0;a.setFrame(t,l,o),t!=n;t++){let i=e.readFloat(),r=e.readUnsignedByte()/255;switch(e.readByte()){case S:a.setStepped(t);break;case T:setBezier(e,a,s++,t,0,l,i,o,r,1)}l=i,o=r}i.push(a);break}}}}for(let s=0,a=e.readInt(!0);s<a;s++){let s=e.readInt(!0);for(let a=0,g=e.readInt(!0);a<g;a++){let a=e.readByte(),g=e.readInt(!0),p=e.readInt(!0);switch(a){case r:i.push(readTimeline1(e,new t.RotateTimeline(g,p,s),1));break;case n:i.push(readTimeline2(e,new t.TranslateTimeline(g,p,s),C));break;case l:i.push(readTimeline1(e,new t.TranslateXTimeline(g,p,s),C));break;case o:i.push(readTimeline1(e,new t.TranslateYTimeline(g,p,s),C));break;case h:i.push(readTimeline2(e,new t.ScaleTimeline(g,p,s),1));break;case d:i.push(readTimeline1(e,new t.ScaleXTimeline(g,p,s),1));break;case c:i.push(readTimeline1(e,new t.ScaleYTimeline(g,p,s),1));break;case u:i.push(readTimeline2(e,new t.ShearTimeline(g,p,s),1));break;case m:i.push(readTimeline1(e,new t.ShearXTimeline(g,p,s),1));break;case f:i.push(readTimeline1(e,new t.ShearYTimeline(g,p,s),1))}}}for(let s=0,a=e.readInt(!0);s<a;s++){let s=e.readInt(!0),a=e.readInt(!0),r=a-1,n=new t.IkConstraintTimeline(a,e.readInt(!0),s),l=e.readFloat(),o=e.readFloat(),h=e.readFloat()*C;for(let t=0,s=0;n.setFrame(t,l,o,h,e.readByte(),e.readBoolean(),e.readBoolean()),t!=r;t++){let a=e.readFloat(),i=e.readFloat(),r=e.readFloat()*C;switch(e.readByte()){case S:n.setStepped(t);break;case T:setBezier(e,n,s++,t,0,l,a,o,i,1),setBezier(e,n,s++,t,1,l,a,h,r,C)}l=a,o=i,h=r}i.push(n)}for(let s=0,a=e.readInt(!0);s<a;s++){let s=e.readInt(!0),a=e.readInt(!0),r=a-1,n=new t.TransformConstraintTimeline(a,e.readInt(!0),s),l=e.readFloat(),o=e.readFloat(),h=e.readFloat(),d=e.readFloat(),c=e.readFloat(),u=e.readFloat(),m=e.readFloat();for(let t=0,s=0;n.setFrame(t,l,o,h,d,c,u,m),t!=r;t++){let a=e.readFloat(),i=e.readFloat(),r=e.readFloat(),f=e.readFloat(),g=e.readFloat(),p=e.readFloat(),x=e.readFloat();switch(e.readByte()){case S:n.setStepped(t);break;case T:setBezier(e,n,s++,t,0,l,a,o,i,1),setBezier(e,n,s++,t,1,l,a,h,r,1),setBezier(e,n,s++,t,2,l,a,d,f,1),setBezier(e,n,s++,t,3,l,a,c,g,1),setBezier(e,n,s++,t,4,l,a,u,p,1),setBezier(e,n,s++,t,5,l,a,m,x,1)}l=a,o=i,h=r,d=f,c=g,u=p,m=x}i.push(n)}for(let s=0,r=e.readInt(!0);s<r;s++){let s=e.readInt(!0),r=a.pathConstraints[s];for(let a=0,n=e.readInt(!0);a<n;a++)switch(e.readByte()){case M:i.push(readTimeline1(e,new t.PathConstraintPositionTimeline(e.readInt(!0),e.readInt(!0),s),r.positionMode==t.PositionMode.Fixed?C:1));break;case k:i.push(readTimeline1(e,new t.PathConstraintSpacingTimeline(e.readInt(!0),e.readInt(!0),s),r.spacingMode==t.SpacingMode.Length||r.spacingMode==t.SpacingMode.Fixed?C:1));break;case A:let a=new t.PathConstraintMixTimeline(e.readInt(!0),e.readInt(!0),s),n=e.readFloat(),l=e.readFloat(),o=e.readFloat(),h=e.readFloat();for(let t=0,s=0,i=a.getFrameCount()-1;a.setFrame(t,n,l,o,h),t!=i;t++){let i=e.readFloat(),r=e.readFloat(),d=e.readFloat(),c=e.readFloat();switch(e.readByte()){case S:a.setStepped(t);break;case T:setBezier(e,a,s++,t,0,n,i,l,r,1),setBezier(e,a,s++,t,1,n,i,o,d,1),setBezier(e,a,s++,t,2,n,i,h,c,1)}n=i,l=r,o=d,h=c}i.push(a)}}for(let s=0,r=e.readInt(!0);s<r;s++){let s=a.skins[e.readInt(!0)];for(let a=0,r=e.readInt(!0);a<r;a++){let a=e.readInt(!0);for(let r=0,n=e.readInt(!0);r<n;r++){let r=e.readStringRef(),n=s.getAttachment(a,r),l=n.bones,o=n.vertices,h=l?o.length/3*2:o.length,d=e.readInt(!0),c=d-1,u=e.readInt(!0),m=new t.DeformTimeline(d,u,a,n),f=e.readFloat();for(let s=0,a=0;;s++){let i,r=e.readInt(!0);if(0==r)i=l?t.Utils.newFloatArray(h):o;else{i=t.Utils.newFloatArray(h);let s=e.readInt(!0);if(r+=s,1==C)for(let t=s;t<r;t++)i[t]=e.readFloat();else for(let t=s;t<r;t++)i[t]=e.readFloat()*C;if(!l)for(let t=0,e=i.length;t<e;t++)i[t]+=o[t]}if(m.setFrame(s,f,i),s==c)break;let n=e.readFloat();switch(e.readByte()){case S:m.setStepped(s);break;case T:setBezier(e,m,a++,s,0,f,n,0,1,1)}f=n}i.push(m)}}}let v=e.readInt(!0);if(v>0){let s=new t.DrawOrderTimeline(v),r=a.slots.length;for(let a=0;a<v;a++){let i=e.readFloat(),n=e.readInt(!0),l=t.Utils.newArray(r,0);for(let t=r-1;t>=0;t--)l[t]=-1;let o=t.Utils.newArray(r-n,0),h=0,d=0;for(let t=0;t<n;t++){let t=e.readInt(!0);for(;h!=t;)o[d++]=h++;l[h+e.readInt(!0)]=h++}for(;h<r;)o[d++]=h++;for(let t=r-1;t>=0;t--)-1==l[t]&&(l[t]=o[--d]);s.setFrame(a,i,l)}i.push(s)}let I=e.readInt(!0);if(I>0){let s=new t.EventTimeline(I);for(let i=0;i<I;i++){let r=e.readFloat(),n=a.events[e.readInt(!0)],l=new t.Event(r,n);l.intValue=e.readInt(!1),l.floatValue=e.readFloat(),l.stringValue=e.readBoolean()?e.readString():n.stringValue,l.data.audioPath&&(l.volume=e.readFloat(),l.balance=e.readFloat()),s.setFrame(i,l)}i.push(s)}let Y=0;for(let t=0,e=i.length;t<e;t++)Y=Math.max(Y,i[t].getDuration());return new t.Animation(s,i,Y)}};class e{constructor(t,e=new Array,s=0,a=new DataView(t.buffer)){this.strings=e,this.index=s,this.buffer=a}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(),s=127&e;return 0!=(128&e)&&(e=this.readByte(),s|=(127&e)<<7,0!=(128&e)&&(e=this.readByte(),s|=(127&e)<<14,0!=(128&e)&&(e=this.readByte(),s|=(127&e)<<21,0!=(128&e)&&(e=this.readByte(),s|=(127&e)<<28)))),t?s:s>>>1^-(1&s)}readStringRef(){let t=this.readInt(!0);return 0==t?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let s=0;s<t;){let t=this.readByte();switch(t>>4){case 12:case 13:e+=String.fromCharCode((31&t)<<6|63&this.readByte()),s+=2;break;case 14:e+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),s+=3;break;default:e+=String.fromCharCode(t),s++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return 0!=this.readByte()}}class s{constructor(t,e,s,a,i){this.mesh=t,this.skin=e,this.slotIndex=s,this.parent=a,this.inheritDeform=i}}class a{constructor(t=null,e=null){this.bones=t,this.vertices=e}}let i;function readTimeline1(t,e,s){let a=t.readFloat(),i=t.readFloat()*s;for(let r=0,n=0,l=e.getFrameCount()-1;e.setFrame(r,a,i),r!=l;r++){let l=t.readFloat(),o=t.readFloat()*s;switch(t.readByte()){case S:e.setStepped(r);break;case T:setBezier(t,e,n++,r,0,a,l,i,o,1)}a=l,i=o}return e}function readTimeline2(t,e,s){let a=t.readFloat(),i=t.readFloat()*s,r=t.readFloat()*s;for(let n=0,l=0,o=e.getFrameCount()-1;e.setFrame(n,a,i,r),n!=o;n++){let o=t.readFloat(),h=t.readFloat()*s,d=t.readFloat()*s;switch(t.readByte()){case S:e.setStepped(n);break;case T:setBezier(t,e,l++,n,0,a,o,i,h,s),setBezier(t,e,l++,n,1,a,o,r,d,s)}a=o,i=h,r=d}return e}function setBezier(t,e,s,a,i,r,n,l,o,h){e.setBezier(s,a,i,r,l,t.readFloat(),t.readFloat()*h,t.readFloat(),t.readFloat()*h,n,o)}!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"}(i||(i={}));const r=0,n=1,l=2,o=3,h=4,d=5,c=6,u=7,m=8,f=9,g=0,p=1,x=2,b=3,w=4,y=5,M=0,k=1,A=2,S=1,T=2}(spine||(spine={})),function(t){t.SkeletonBounds=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 t.Pool(()=>t.Utils.newFloatArray(16))}update(e,s){if(!e)throw new Error("skeleton cannot be null.");let a=this.boundingBoxes,i=this.polygons,r=this.polygonPool,n=e.slots,l=n.length;a.length=0,r.freeAll(i),i.length=0;for(let e=0;e<l;e++){let s=n[e];if(!s.bone.active)continue;let l=s.getAttachment();if(l instanceof t.BoundingBoxAttachment){let e=l;a.push(e);let n=r.obtain();n.length!=e.worldVerticesLength&&(n=t.Utils.newFloatArray(e.worldVerticesLength)),i.push(n),e.computeWorldVertices(s,0,e.worldVerticesLength,n,0,2)}}s?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,s=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY,i=this.polygons;for(let r=0,n=i.length;r<n;r++){let n=i[r],l=n;for(let i=0,r=n.length;i<r;i+=2){let r=l[i],n=l[i+1];t=Math.min(t,r),e=Math.min(e,n),s=Math.max(s,r),a=Math.max(a,n)}}this.minX=t,this.minY=e,this.maxX=s,this.maxY=a}aabbContainsPoint(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,s,a){let i=this.minX,r=this.minY,n=this.maxX,l=this.maxY;if(t<=i&&s<=i||e<=r&&a<=r||t>=n&&s>=n||e>=l&&a>=l)return!1;let o=(a-e)/(s-t),h=o*(i-t)+e;if(h>r&&h<l)return!0;if(h=o*(n-t)+e,h>r&&h<l)return!0;let d=(r-e)/o+t;return d>i&&d<n||(d=(l-e)/o+t,d>i&&d<n)}aabbIntersectsSkeleton(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY}containsPoint(t,e){let s=this.polygons;for(let a=0,i=s.length;a<i;a++)if(this.containsPointPolygon(s[a],t,e))return this.boundingBoxes[a];return null}containsPointPolygon(t,e,s){let a=t,i=t.length,r=i-2,n=!1;for(let t=0;t<i;t+=2){let i=a[t+1],l=a[r+1];if(i<s&&l>=s||l<s&&i>=s){let o=a[t];o+(s-i)/(l-i)*(a[r]-o)<e&&(n=!n)}r=t}return n}intersectsSegment(t,e,s,a){let i=this.polygons;for(let r=0,n=i.length;r<n;r++)if(this.intersectsSegmentPolygon(i[r],t,e,s,a))return this.boundingBoxes[r];return null}intersectsSegmentPolygon(t,e,s,a,i){let r=t,n=t.length,l=e-a,o=s-i,h=e*i-s*a,d=r[n-2],c=r[n-1];for(let t=0;t<n;t+=2){let n=r[t],u=r[t+1],m=d*u-c*n,f=d-n,g=c-u,p=l*g-o*f,x=(h*f-l*m)/p;if((x>=d&&x<=n||x>=n&&x<=d)&&(x>=e&&x<=a||x>=a&&x<=e)){let t=(h*g-o*m)/p;if((t>=c&&t<=u||t>=u&&t<=c)&&(t>=s&&t<=i||t>=i&&t<=s))return!0}d=n,c=u}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}}}(spine||(spine={})),function(t){class e{constructor(){this.triangulator=new t.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}clipStart(s,a){if(this.clipAttachment)return 0;this.clipAttachment=a;let i=a.worldVerticesLength,r=t.Utils.setArraySize(this.clippingPolygon,i);a.computeWorldVertices(s,0,i,r,0,2);let n=this.clippingPolygon;e.makeClockwise(n);let l=this.clippingPolygons=this.triangulator.decompose(n,this.triangulator.triangulate(n));for(let t=0,s=l.length;t<s;t++){let s=l[t];e.makeClockwise(s),s.push(s[0]),s.push(s[1])}return l.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 null!=this.clipAttachment}clipTriangles(e,s,a,i,r,n,l,o){let h=this.clipOutput,d=this.clippedVertices,c=this.clippedTriangles,u=this.clippingPolygons,m=this.clippingPolygons.length,f=o?12:8,g=0;d.length=0,c.length=0;t:for(let s=0;s<i;s+=3){let i=a[s]<<1,p=e[i],x=e[i+1],b=r[i],w=r[i+1];i=a[s+1]<<1;let y=e[i],M=e[i+1],k=r[i],A=r[i+1];i=a[s+2]<<1;let S=e[i],T=e[i+1],C=r[i],v=r[i+1];for(let e=0;e<m;e++){let s=d.length;if(!this.clip(p,x,y,M,S,T,u[e],h)){let e=t.Utils.setArraySize(d,s+3*f);e[s]=p,e[s+1]=x,e[s+2]=n.r,e[s+3]=n.g,e[s+4]=n.b,e[s+5]=n.a,o?(e[s+6]=b,e[s+7]=w,e[s+8]=l.r,e[s+9]=l.g,e[s+10]=l.b,e[s+11]=l.a,e[s+12]=y,e[s+13]=M,e[s+14]=n.r,e[s+15]=n.g,e[s+16]=n.b,e[s+17]=n.a,e[s+18]=k,e[s+19]=A,e[s+20]=l.r,e[s+21]=l.g,e[s+22]=l.b,e[s+23]=l.a,e[s+24]=S,e[s+25]=T,e[s+26]=n.r,e[s+27]=n.g,e[s+28]=n.b,e[s+29]=n.a,e[s+30]=C,e[s+31]=v,e[s+32]=l.r,e[s+33]=l.g,e[s+34]=l.b,e[s+35]=l.a):(e[s+6]=b,e[s+7]=w,e[s+8]=y,e[s+9]=M,e[s+10]=n.r,e[s+11]=n.g,e[s+12]=n.b,e[s+13]=n.a,e[s+14]=k,e[s+15]=A,e[s+16]=S,e[s+17]=T,e[s+18]=n.r,e[s+19]=n.g,e[s+20]=n.b,e[s+21]=n.a,e[s+22]=C,e[s+23]=v),s=c.length;let a=t.Utils.setArraySize(c,s+3);a[s]=g,a[s+1]=g+1,a[s+2]=g+2,g+=3;continue t}{let e=h.length;if(0==e)continue;let a=M-T,i=S-y,r=p-S,u=T-x,m=1/(a*r+i*(x-T)),I=e>>1,Y=this.clipOutput,V=t.Utils.setArraySize(d,s+I*f);for(let t=0;t<e;t+=2){let e=Y[t],h=Y[t+1];V[s]=e,V[s+1]=h,V[s+2]=n.r,V[s+3]=n.g,V[s+4]=n.b,V[s+5]=n.a;let d=e-S,c=h-T,g=(a*d+i*c)*m,p=(u*d+r*c)*m,x=1-g-p;V[s+6]=b*g+k*p+C*x,V[s+7]=w*g+A*p+v*x,o&&(V[s+8]=l.r,V[s+9]=l.g,V[s+10]=l.b,V[s+11]=l.a),s+=f}s=c.length;let X=t.Utils.setArraySize(c,s+3*(I-2));I--;for(let t=1;t<I;t++)X[s]=g,X[s+1]=g+t,X[s+2]=g+t+1,s+=3;g+=I+1}}}}clip(t,e,s,a,i,r,n,l){let o=l,h=!1,d=null;n.length%4>=2?(d=l,l=this.scratch):d=this.scratch,d.length=0,d.push(t),d.push(e),d.push(s),d.push(a),d.push(i),d.push(r),d.push(t),d.push(e),l.length=0;let c=n,u=n.length-4;for(let t=0;;t+=2){let e=c[t],s=c[t+1],a=c[t+2],i=c[t+3],r=e-a,n=s-i,m=d,f=d.length-2,g=l.length;for(let t=0;t<f;t+=2){let o=m[t],d=m[t+1],c=m[t+2],u=m[t+3],f=r*(u-i)-n*(c-a)>0;if(r*(d-i)-n*(o-a)>0){if(f){l.push(c),l.push(u);continue}let t=u-d,r=c-o,n=t*(a-e)-r*(i-s);if(Math.abs(n)>1e-6){let h=(r*(s-d)-t*(e-o))/n;l.push(e+(a-e)*h),l.push(s+(i-s)*h)}else l.push(e),l.push(s)}else if(f){let t=u-d,r=c-o,n=t*(a-e)-r*(i-s);if(Math.abs(n)>1e-6){let h=(r*(s-d)-t*(e-o))/n;l.push(e+(a-e)*h),l.push(s+(i-s)*h)}else l.push(e),l.push(s);l.push(c),l.push(u)}h=!0}if(g==l.length)return o.length=0,!0;if(l.push(l[0]),l.push(l[1]),t==u)break;let p=l;(l=d).length=0,d=p}if(o!=l){o.length=0;for(let t=0,e=l.length-2;t<e;t++)o[t]=l[t]}else o.length=o.length-2;return h}static makeClockwise(t){let e=t,s=t.length,a=e[s-2]*e[1]-e[0]*e[s-1],i=0,r=0,n=0,l=0;for(let t=0,o=s-3;t<o;t+=2)i=e[t],r=e[t+1],n=e[t+2],l=e[t+3],a+=i*l-n*r;if(!(a<0))for(let t=0,a=s-2,i=s>>1;t<i;t+=2){let s=e[t],i=e[t+1],r=a-t;e[t]=e[r],e[t+1]=e[r+1],e[r]=s,e[r+1]=i}}}t.SkeletonClipping=e}(spine||(spine={})),function(t){t.SkeletonData=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 s=0,a=e.length;s<a;s++){let a=e[s];if(a.name==t)return a}return null}findBoneIndex(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let s=0,a=e.length;s<a;s++)if(e[s].name==t)return s;return-1}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,a=e.length;s<a;s++){let a=e[s];if(a.name==t)return a}return null}findSlotIndex(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,a=e.length;s<a;s++)if(e[s].name==t)return s;return-1}findSkin(t){if(!t)throw new Error("skinName cannot be null.");let e=this.skins;for(let s=0,a=e.length;s<a;s++){let a=e[s];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 s=0,a=e.length;s<a;s++){let a=e[s];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 s=0,a=e.length;s<a;s++){let a=e[s];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 s=0,a=e.length;s<a;s++){let a=e[s];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 s=0,a=e.length;s<a;s++){let a=e[s];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 s=0,a=e.length;s<a;s++){let a=e[s];if(a.name==t)return a}return null}}}(spine||(spine={})),function(t){t.SkeletonJson=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(e){let s=this.scale,a=new t.SkeletonData,i="string"==typeof e?JSON.parse(e):e,r=i.skeleton;if(r&&(a.hash=r.hash,a.version=r.spine,a.x=r.x,a.y=r.y,a.width=r.width,a.height=r.height,a.fps=r.fps,a.imagesPath=r.images),i.bones)for(let e=0;e<i.bones.length;e++){let r=i.bones[e],n=null,l=getValue(r,"parent",null);l&&(n=a.findBone(l));let o=new t.BoneData(a.bones.length,r.name,n);o.length=getValue(r,"length",0)*s,o.x=getValue(r,"x",0)*s,o.y=getValue(r,"y",0)*s,o.rotation=getValue(r,"rotation",0),o.scaleX=getValue(r,"scaleX",1),o.scaleY=getValue(r,"scaleY",1),o.shearX=getValue(r,"shearX",0),o.shearY=getValue(r,"shearY",0),o.transformMode=t.Utils.enumValue(t.TransformMode,getValue(r,"transform","Normal")),o.skinRequired=getValue(r,"skin",!1);let h=getValue(r,"color",null);h&&o.color.setFromString(h),a.bones.push(o)}if(i.slots)for(let e=0;e<i.slots.length;e++){let s=i.slots[e],r=a.findBone(s.bone),n=new t.SlotData(a.slots.length,s.name,r),l=getValue(s,"color",null);l&&n.color.setFromString(l);let o=getValue(s,"dark",null);o&&(n.darkColor=t.Color.fromString(o)),n.attachmentName=getValue(s,"attachment",null),n.blendMode=t.Utils.enumValue(t.BlendMode,getValue(s,"blend","normal")),a.slots.push(n)}if(i.ik)for(let e=0;e<i.ik.length;e++){let r=i.ik[e],n=new t.IkConstraintData(r.name);n.order=getValue(r,"order",0),n.skinRequired=getValue(r,"skin",!1);for(let t=0;t<r.bones.length;t++)n.bones.push(a.findBone(r.bones[t]));n.target=a.findBone(r.target),n.mix=getValue(r,"mix",1),n.softness=getValue(r,"softness",0)*s,n.bendDirection=getValue(r,"bendPositive",!0)?1:-1,n.compress=getValue(r,"compress",!1),n.stretch=getValue(r,"stretch",!1),n.uniform=getValue(r,"uniform",!1),a.ikConstraints.push(n)}if(i.transform)for(let e=0;e<i.transform.length;e++){let r=i.transform[e],n=new t.TransformConstraintData(r.name);n.order=getValue(r,"order",0),n.skinRequired=getValue(r,"skin",!1);for(let t=0;t<r.bones.length;t++)n.bones.push(a.findBone(r.bones[t]));let l=r.target;n.target=a.findBone(l),n.local=getValue(r,"local",!1),n.relative=getValue(r,"relative",!1),n.offsetRotation=getValue(r,"rotation",0),n.offsetX=getValue(r,"x",0)*s,n.offsetY=getValue(r,"y",0)*s,n.offsetScaleX=getValue(r,"scaleX",0),n.offsetScaleY=getValue(r,"scaleY",0),n.offsetShearY=getValue(r,"shearY",0),n.mixRotate=getValue(r,"mixRotate",1),n.mixX=getValue(r,"mixX",1),n.mixY=getValue(r,"mixY",n.mixX),n.mixScaleX=getValue(r,"mixScaleX",1),n.mixScaleY=getValue(r,"mixScaleY",n.mixScaleX),n.mixShearY=getValue(r,"mixShearY",1),a.transformConstraints.push(n)}if(i.path)for(let e=0;e<i.path.length;e++){let r=i.path[e],n=new t.PathConstraintData(r.name);n.order=getValue(r,"order",0),n.skinRequired=getValue(r,"skin",!1);for(let t=0;t<r.bones.length;t++)n.bones.push(a.findBone(r.bones[t]));let l=r.target;n.target=a.findSlot(l),n.positionMode=t.Utils.enumValue(t.PositionMode,getValue(r,"positionMode","Percent")),n.spacingMode=t.Utils.enumValue(t.SpacingMode,getValue(r,"spacingMode","Length")),n.rotateMode=t.Utils.enumValue(t.RotateMode,getValue(r,"rotateMode","Tangent")),n.offsetRotation=getValue(r,"rotation",0),n.position=getValue(r,"position",0),n.positionMode==t.PositionMode.Fixed&&(n.position*=s),n.spacing=getValue(r,"spacing",0),n.spacingMode!=t.SpacingMode.Length&&n.spacingMode!=t.SpacingMode.Fixed||(n.spacing*=s),n.mixRotate=getValue(r,"mixRotate",1),n.mixX=getValue(r,"mixX",1),n.mixY=getValue(r,"mixY",n.mixX),a.pathConstraints.push(n)}if(i.skins)for(let e=0;e<i.skins.length;e++){let s=i.skins[e],r=new t.Skin(s.name);if(s.bones)for(let t=0;t<s.bones.length;t++)r.bones.push(a.findBone(s.bones[t]));if(s.ik)for(let t=0;t<s.ik.length;t++)r.constraints.push(a.findIkConstraint(s.ik[t]));if(s.transform)for(let t=0;t<s.transform.length;t++)r.constraints.push(a.findTransformConstraint(s.transform[t]));if(s.path)for(let t=0;t<s.path.length;t++)r.constraints.push(a.findPathConstraint(s.path[t]));for(let t in s.attachments){let e=a.findSlot(t),i=s.attachments[t];for(let t in i){let s=this.readAttachment(i[t],r,e.index,t,a);s&&r.setAttachment(e.index,t,s)}}a.skins.push(r),"default"==r.name&&(a.defaultSkin=r)}for(let t=0,e=this.linkedMeshes.length;t<e;t++){let e=this.linkedMeshes[t],s=(e.skin?a.findSkin(e.skin):a.defaultSkin).getAttachment(e.slotIndex,e.parent);e.mesh.deformAttachment=e.inheritDeform?s:e.mesh,e.mesh.setParentMesh(s),e.mesh.updateUVs()}if(this.linkedMeshes.length=0,i.events)for(let e in i.events){let s=i.events[e],r=new t.EventData(e);r.intValue=getValue(s,"int",0),r.floatValue=getValue(s,"float",0),r.stringValue=getValue(s,"string",""),r.audioPath=getValue(s,"audio",null),r.audioPath&&(r.volume=getValue(s,"volume",1),r.balance=getValue(s,"balance",0)),a.events.push(r)}if(i.animations)for(let t in i.animations){let e=i.animations[t];this.readAnimation(e,t,a)}return a}readAttachment(s,a,i,r,n){let l=this.scale;switch(r=getValue(s,"name",r),getValue(s,"type","region")){case"region":{let t=getValue(s,"path",r),e=this.attachmentLoader.newRegionAttachment(a,r,t);if(!e)return null;e.path=t,e.x=getValue(s,"x",0)*l,e.y=getValue(s,"y",0)*l,e.scaleX=getValue(s,"scaleX",1),e.scaleY=getValue(s,"scaleY",1),e.rotation=getValue(s,"rotation",0),e.width=s.width*l,e.height=s.height*l;let i=getValue(s,"color",null);return i&&e.color.setFromString(i),e.updateOffset(),e}case"boundingbox":{let t=this.attachmentLoader.newBoundingBoxAttachment(a,r);if(!t)return null;this.readVertices(s,t,s.vertexCount<<1);let e=getValue(s,"color",null);return e&&t.color.setFromString(e),t}case"mesh":case"linkedmesh":{let t=getValue(s,"path",r),n=this.attachmentLoader.newMeshAttachment(a,r,t);if(!n)return null;n.path=t;let o=getValue(s,"color",null);o&&n.color.setFromString(o),n.width=getValue(s,"width",0)*l,n.height=getValue(s,"height",0)*l;let h=getValue(s,"parent",null);if(h)return this.linkedMeshes.push(new e(n,getValue(s,"skin",null),i,h,getValue(s,"deform",!0))),n;let d=s.uvs;return this.readVertices(s,n,d.length),n.triangles=s.triangles,n.regionUVs=d,n.updateUVs(),n.edges=getValue(s,"edges",null),n.hullLength=2*getValue(s,"hull",0),n}case"path":{let e=this.attachmentLoader.newPathAttachment(a,r);if(!e)return null;e.closed=getValue(s,"closed",!1),e.constantSpeed=getValue(s,"constantSpeed",!0);let i=s.vertexCount;this.readVertices(s,e,i<<1);let n=t.Utils.newArray(i/3,0);for(let t=0;t<s.lengths.length;t++)n[t]=s.lengths[t]*l;e.lengths=n;let o=getValue(s,"color",null);return o&&e.color.setFromString(o),e}case"point":{let t=this.attachmentLoader.newPointAttachment(a,r);if(!t)return null;t.x=getValue(s,"x",0)*l,t.y=getValue(s,"y",0)*l,t.rotation=getValue(s,"rotation",0);let e=getValue(s,"color",null);return e&&t.color.setFromString(e),t}case"clipping":{let t=this.attachmentLoader.newClippingAttachment(a,r);if(!t)return null;let e=getValue(s,"end",null);e&&(t.endSlot=n.findSlot(e));let i=s.vertexCount;this.readVertices(s,t,i<<1);let l=getValue(s,"color",null);return l&&t.color.setFromString(l),t}}return null}readVertices(e,s,a){let i=this.scale;s.worldVerticesLength=a;let r=e.vertices;if(a==r.length){let e=t.Utils.toFloatArray(r);if(1!=i)for(let t=0,s=r.length;t<s;t++)e[t]*=i;return void(s.vertices=e)}let n=new Array,l=new Array;for(let t=0,e=r.length;t<e;){let e=r[t++];l.push(e);for(let s=t+4*e;t<s;t+=4)l.push(r[t]),n.push(r[t+1]*i),n.push(r[t+2]*i),n.push(r[t+3])}s.bones=l,s.vertices=t.Utils.toFloatArray(n)}readAnimation(e,s,a){let i=this.scale,r=new Array;if(e.slots)for(let s in e.slots){let i=e.slots[s],n=a.findSlotIndex(s);for(let e in i){let s=i[e];if(s)if("attachment"==e){let e=new t.AttachmentTimeline(s.length,n);for(let t=0;t<s.length;t++){let a=s[t];e.setFrame(t,getValue(a,"time",0),a.name)}r.push(e)}else if("rgba"==e){let e=new t.RGBATimeline(s.length,s.length<<2,n),a=s[0],i=getValue(a,"time",0),l=t.Color.fromString(a.color);for(let r=0,n=0;;r++){e.setFrame(r,i,l.r,l.g,l.b,l.a);let o=s[r+1];if(!o){e.shrink(n);break}let h=getValue(o,"time",0),d=t.Color.fromString(o.color),c=a.curve;c&&(n=readCurve(c,e,n,r,0,i,h,l.r,d.r,1),n=readCurve(c,e,n,r,1,i,h,l.g,d.g,1),n=readCurve(c,e,n,r,2,i,h,l.b,d.b,1),n=readCurve(c,e,n,r,3,i,h,l.a,d.a,1)),i=h,l=d,a=o}r.push(e)}else if("rgb"==e){let e=new t.RGBTimeline(s.length,3*s.length,n),a=s[0],i=getValue(a,"time",0),l=t.Color.fromString(a.color);for(let r=0,n=0;;r++){e.setFrame(r,i,l.r,l.g,l.b);let o=s[r+1];if(!o){e.shrink(n);break}let h=getValue(o,"time",0),d=t.Color.fromString(o.color),c=a.curve;c&&(n=readCurve(c,e,n,r,0,i,h,l.r,d.r,1),n=readCurve(c,e,n,r,1,i,h,l.g,d.g,1),n=readCurve(c,e,n,r,2,i,h,l.b,d.b,1)),i=h,l=d,a=o}r.push(e)}else if("alpha"==e)r.push(readTimeline1(s,new t.AlphaTimeline(s.length,s.length,n),0,1));else if("rgba2"==e){let e=new t.RGBA2Timeline(s.length,7*s.length,n),a=s[0],i=getValue(a,"time",0),l=t.Color.fromString(a.light),o=t.Color.fromString(a.dark);for(let r=0,n=0;;r++){e.setFrame(r,i,l.r,l.g,l.b,l.a,o.r,o.g,o.b);let h=s[r+1];if(!h){e.shrink(n);break}let d=getValue(h,"time",0),c=t.Color.fromString(h.light),u=t.Color.fromString(h.dark),m=a.curve;m&&(n=readCurve(m,e,n,r,0,i,d,l.r,c.r,1),n=readCurve(m,e,n,r,1,i,d,l.g,c.g,1),n=readCurve(m,e,n,r,2,i,d,l.b,c.b,1),n=readCurve(m,e,n,r,3,i,d,l.a,c.a,1),n=readCurve(m,e,n,r,4,i,d,o.r,u.r,1),n=readCurve(m,e,n,r,5,i,d,o.g,u.g,1),n=readCurve(m,e,n,r,6,i,d,o.b,u.b,1)),i=d,l=c,o=u,a=h}r.push(e)}else if("rgb2"==e){let e=new t.RGB2Timeline(s.length,6*s.length,n),a=s[0],i=getValue(a,"time",0),l=t.Color.fromString(a.light),o=t.Color.fromString(a.dark);for(let r=0,n=0;;r++){e.setFrame(r,i,l.r,l.g,l.b,o.r,o.g,o.b);let h=s[r+1];if(!h){e.shrink(n);break}let d=getValue(h,"time",0),c=t.Color.fromString(h.light),u=t.Color.fromString(h.dark),m=a.curve;m&&(n=readCurve(m,e,n,r,0,i,d,l.r,c.r,1),n=readCurve(m,e,n,r,1,i,d,l.g,c.g,1),n=readCurve(m,e,n,r,2,i,d,l.b,c.b,1),n=readCurve(m,e,n,r,3,i,d,o.r,u.r,1),n=readCurve(m,e,n,r,4,i,d,o.g,u.g,1),n=readCurve(m,e,n,r,5,i,d,o.b,u.b,1)),i=d,l=c,o=u,a=h}r.push(e)}}}if(e.bones)for(let s in e.bones){let n=e.bones[s],l=a.findBoneIndex(s);for(let e in n){let s=n[e];if(0!=s.length)if("rotate"===e)r.push(readTimeline1(s,new t.RotateTimeline(s.length,s.length,l),0,1));else if("translate"===e){let e=new t.TranslateTimeline(s.length,s.length<<1,l);r.push(readTimeline2(s,e,"x","y",0,i))}else if("translatex"===e){let e=new t.TranslateXTimeline(s.length,s.length,l);r.push(readTimeline1(s,e,0,i))}else if("translatey"===e){let e=new t.TranslateYTimeline(s.length,s.length,l);r.push(readTimeline1(s,e,0,i))}else if("scale"===e){let e=new t.ScaleTimeline(s.length,s.length<<1,l);r.push(readTimeline2(s,e,"x","y",1,1))}else if("scalex"===e){let e=new t.ScaleXTimeline(s.length,s.length,l);r.push(readTimeline1(s,e,1,1))}else if("scaley"===e){let e=new t.ScaleYTimeline(s.length,s.length,l);r.push(readTimeline1(s,e,1,1))}else if("shear"===e){let e=new t.ShearTimeline(s.length,s.length<<1,l);r.push(readTimeline2(s,e,"x","y",0,1))}else if("shearx"===e){let e=new t.ShearXTimeline(s.length,s.length,l);r.push(readTimeline1(s,e,0,1))}else if("sheary"===e){let e=new t.ShearYTimeline(s.length,s.length,l);r.push(readTimeline1(s,e,0,1))}}}if(e.ik)for(let s in e.ik){let n=e.ik[s],l=n[0];if(!l)continue;let o=a.findIkConstraint(s),h=a.ikConstraints.indexOf(o),d=new t.IkConstraintTimeline(n.length,n.length<<1,h),c=getValue(l,"time",0),u=getValue(l,"mix",1),m=getValue(l,"softness",0)*i;for(let t=0,e=0;;t++){d.setFrame(t,c,u,m,getValue(l,"bendPositive",!0)?1:-1,getValue(l,"compress",!1),getValue(l,"stretch",!1));let s=n[t+1];if(!s){d.shrink(e);break}let a=getValue(s,"time",0),r=getValue(s,"mix",1),o=getValue(s,"softness",0)*i,h=l.curve;h&&(e=readCurve(h,d,e,t,0,c,a,u,r,1),e=readCurve(h,d,e,t,1,c,a,m,o,i)),c=a,u=r,m=o,l=s}r.push(d)}if(e.transform)for(let s in e.transform){let i=e.transform[s],n=i[0];if(!n)continue;let l=a.findTransformConstraint(s),o=a.transformConstraints.indexOf(l),h=new t.TransformConstraintTimeline(i.length,i.length<<2,o),d=getValue(n,"time",0),c=getValue(n,"mixRotate",1),u=getValue(n,"mixX",1),m=getValue(n,"mixY",u),f=getValue(n,"mixScaleX",1),g=getValue(n,"mixScaleY",f),p=getValue(n,"mixShearY",1);for(let t=0,e=0;;t++){h.setFrame(t,d,c,u,m,f,g,p);let s=i[t+1];if(!s){h.shrink(e);break}let a=getValue(s,"time",0),r=getValue(s,"mixRotate",1),l=getValue(s,"mixX",1),o=getValue(s,"mixY",l),x=getValue(s,"mixScaleX",1),b=getValue(s,"mixScaleY",x),w=getValue(s,"mixShearY",1),y=n.curve;y&&(e=readCurve(y,h,e,t,0,d,a,c,r,1),e=readCurve(y,h,e,t,1,d,a,u,l,1),e=readCurve(y,h,e,t,2,d,a,m,o,1),e=readCurve(y,h,e,t,3,d,a,f,x,1),e=readCurve(y,h,e,t,4,d,a,g,b,1),e=readCurve(y,h,e,t,5,d,a,p,w,1)),d=a,c=r,u=l,m=o,f=x,g=b,f=x,n=s}r.push(h)}if(e.path)for(let s in e.path){let n=e.path[s],l=a.findPathConstraint(s),o=a.pathConstraints.indexOf(l);for(let e in n){let s=n[e],a=s[0];if(a)if("position"===e){let e=new t.PathConstraintPositionTimeline(s.length,s.length,o);r.push(readTimeline1(s,e,0,l.positionMode==t.PositionMode.Fixed?i:1))}else if("spacing"===e){let e=new t.PathConstraintSpacingTimeline(s.length,s.length,o);r.push(readTimeline1(s,e,0,l.spacingMode==t.SpacingMode.Length||l.spacingMode==t.SpacingMode.Fixed?i:1))}else if("mix"===e){let e=new t.PathConstraintMixTimeline(s.size,3*s.size,o),i=getValue(a,"time",0),n=getValue(a,"mixRotate",1),l=getValue(a,"mixX",1),h=getValue(a,"mixY",l);for(let t=0,r=0;;t++){e.setFrame(t,i,n,l,h);let o=s[t+1];if(!o){e.shrink(r);break}let d=getValue(o,"time",0),c=getValue(o,"mixRotate",1),u=getValue(o,"mixX",1),m=getValue(o,"mixY",u),f=a.curve;f&&(r=readCurve(f,e,r,t,0,i,d,n,c,1),r=readCurve(f,e,r,t,1,i,d,l,u,1),r=readCurve(f,e,r,t,2,i,d,h,m,1)),i=d,n=c,l=u,h=m,a=o}r.push(e)}}}if(e.deform)for(let s in e.deform){let n=e.deform[s],l=a.findSkin(s);for(let e in n){let s=n[e],o=a.findSlotIndex(e);for(let e in s){let a=s[e],n=a[0];if(!n)continue;let h=l.getAttachment(o,e),d=h.bones,c=h.vertices,u=d?c.length/3*2:c.length,m=new t.DeformTimeline(a.length,a.length,o,h),f=getValue(n,"time",0);for(let e=0,s=0;;e++){let r,l=getValue(n,"vertices",null);if(l){r=t.Utils.newFloatArray(u);let e=getValue(n,"offset",0);if(t.Utils.arrayCopy(l,0,r,e,l.length),1!=i)for(let t=e,s=t+l.length;t<s;t++)r[t]*=i;if(!d)for(let t=0;t<u;t++)r[t]+=c[t]}else r=d?t.Utils.newFloatArray(u):c;m.setFrame(e,f,r);let o=a[e+1];if(!o){m.shrink(s);break}let h=getValue(o,"time",0),g=n.curve;g&&(s=readCurve(g,m,s,e,0,f,h,0,1,1)),f=h,n=o}r.push(m)}}}if(e.drawOrder){let s=new t.DrawOrderTimeline(e.drawOrder.length),i=a.slots.length,n=0;for(let r=0;r<e.drawOrder.length;r++,n++){let l=e.drawOrder[r],o=null,h=getValue(l,"offsets",null);if(h){o=t.Utils.newArray(i,-1);let e=t.Utils.newArray(i-h.length,0),s=0,r=0;for(let t=0;t<h.length;t++){let i=h[t],n=a.findSlotIndex(i.slot);for(;s!=n;)e[r++]=s++;o[s+i.offset]=s++}for(;s<i;)e[r++]=s++;for(let t=i-1;t>=0;t--)-1==o[t]&&(o[t]=e[--r])}s.setFrame(n,getValue(l,"time",0),o)}r.push(s)}if(e.events){let s=new t.EventTimeline(e.events.length),i=0;for(let r=0;r<e.events.length;r++,i++){let n=e.events[r],l=a.findEvent(n.name),o=new t.Event(t.Utils.toSinglePrecision(getValue(n,"time",0)),l);o.intValue=getValue(n,"int",l.intValue),o.floatValue=getValue(n,"float",l.floatValue),o.stringValue=getValue(n,"string",l.stringValue),o.data.audioPath&&(o.volume=getValue(n,"volume",1),o.balance=getValue(n,"balance",0)),s.setFrame(i,o)}r.push(s)}let n=0;for(let t=0,e=r.length;t<e;t++)n=Math.max(n,r[t].getDuration());a.animations.push(new t.Animation(s,r,n))}};class e{constructor(t,e,s,a,i){this.mesh=t,this.skin=e,this.slotIndex=s,this.parent=a,this.inheritDeform=i}}function readTimeline1(t,e,s,a){let i=t[0],r=getValue(i,"time",0),n=getValue(i,"value",s)*a,l=0;for(let o=0;;o++){e.setFrame(o,r,n);let h=t[o+1];if(!h)return e.shrink(l),e;let d=getValue(h,"time",0),c=getValue(h,"value",s)*a;i.curve&&(l=readCurve(i.curve,e,l,o,0,r,d,n,c,a)),r=d,n=c,i=h}}function readTimeline2(t,e,s,a,i,r){let n=t[0],l=getValue(n,"time",0),o=getValue(n,s,i)*r,h=getValue(n,a,i)*r,d=0;for(let c=0;;c++){e.setFrame(c,l,o,h);let u=t[c+1];if(!u)return e.shrink(d),e;let m=getValue(u,"time",0),f=getValue(u,s,i)*r,g=getValue(u,a,i)*r,p=n.curve;p&&(d=readCurve(p,e,d,c,0,l,m,o,f,r),d=readCurve(p,e,d,c,1,l,m,h,g,r)),l=m,o=f,h=g,n=u}}function readCurve(t,e,s,a,i,r,n,l,o,h){if("stepped"==t)return e.setStepped(a),s;let d=i<<2,c=t[d],u=t[d+1]*h,m=t[d+2],f=t[d+3]*h;return e.setBezier(s,a,i,r,l,c,u,m,f,n,o),s+1}function getValue(t,e,s){return void 0!==t[e]?t[e]:s}}(spine||(spine={})),function(t){class e{constructor(t,e,s){this.slotIndex=t,this.name=e,this.attachment=s}}t.SkinEntry=e;t.Skin=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,s){if(!s)throw new Error("attachment cannot be null.");let a=this.attachments;t>=a.length&&(a.length=t+1),a[t]||(a[t]={}),a[t][e]=s}addSkin(t){for(let e=0;e<t.bones.length;e++){let s=t.bones[e],a=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==s){a=!0;break}a||this.bones.push(s)}for(let e=0;e<t.constraints.length;e++){let s=t.constraints[e],a=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==s){a=!0;break}a||this.constraints.push(s)}let e=t.getAttachments();for(let t=0;t<e.length;t++){var s=e[t];this.setAttachment(s.slotIndex,s.name,s.attachment)}}copySkin(e){for(let t=0;t<e.bones.length;t++){let s=e.bones[t],a=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==s){a=!0;break}a||this.bones.push(s)}for(let t=0;t<e.constraints.length;t++){let s=e.constraints[t],a=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==s){a=!0;break}a||this.constraints.push(s)}let s=e.getAttachments();for(let e=0;e<s.length;e++){var a=s[e];a.attachment&&(a.attachment instanceof t.MeshAttachment?(a.attachment=a.attachment.newLinkedMesh(),this.setAttachment(a.slotIndex,a.name,a.attachment)):(a.attachment=a.attachment.copy(),this.setAttachment(a.slotIndex,a.name,a.attachment)))}}getAttachment(t,e){let s=this.attachments[t];return s?s[e]:null}removeAttachment(t,e){let s=this.attachments[t];s&&(s[e]=null)}getAttachments(){let t=new Array;for(var s=0;s<this.attachments.length;s++){let a=this.attachments[s];if(a)for(let i in a){let r=a[i];r&&t.push(new e(s,i,r))}}return t}getAttachmentsForSlot(t,s){let a=this.attachments[t];if(a)for(let i in a){let r=a[i];r&&s.push(new e(t,i,r))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(t,e){let s=0;for(let a=0;a<t.slots.length;a++){let i=t.slots[a],r=i.getAttachment();if(r&&s<e.attachments.length){let t=e.attachments[s];for(let e in t){if(r==t[e]){let t=this.getAttachment(s,e);t&&i.setAttachment(t);break}}}s++}}}}(spine||(spine={})),function(t){t.Slot=class{constructor(e,s){if(this.deform=new Array,!e)throw new Error("data cannot be null.");if(!s)throw new Error("bone cannot be null.");this.data=e,this.bone=s,this.color=new t.Color,this.darkColor=e.darkColor?new t.Color:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&(e instanceof t.VertexAttachment&&this.attachment instanceof t.VertexAttachment&&e.deformAttachment==this.attachment.deformAttachment||(this.deform.length=0),this.attachment=e,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}}}(spine||(spine={})),function(t){let e;t.SlotData=class{constructor(e,s,a){if(this.color=new t.Color(1,1,1,1),e<0)throw new Error("index must be >= 0.");if(!s)throw new Error("name cannot be null.");if(!a)throw new Error("boneData cannot be null.");this.index=e,this.name=s,this.boneData=a}},function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(e=t.BlendMode||(t.BlendMode={}))}(spine||(spine={})),function(t){class e{constructor(t){this._image=t}getImage(){return this._image}}let s,a;t.Texture=e,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"}(s=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(a=t.TextureWrap||(t.TextureWrap={}));t.TextureRegion=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}};t.FakeTexture=class extends e{setFilters(t,e){}setWraps(t,e){}dispose(){}}}(spine||(spine={})),function(t){t.TextureAtlas=class{constructor(i){this.pages=new Array,this.regions=new Array;let r=new e(i),n=new Array(4),l=null,o=null,h={size:()=>{l.width=parseInt(n[1]),l.height=parseInt(n[2])},format:()=>{},filter:()=>{l.minFilter=t.Utils.enumValue(t.TextureFilter,n[1]),l.magFilter=t.Utils.enumValue(t.TextureFilter,n[2])},repeat:()=>{-1!=n[1].indexOf("x")&&(l.uWrap=t.TextureWrap.Repeat),-1!=n[1].indexOf("y")&&(l.vWrap=t.TextureWrap.Repeat)},pma:()=>{l.pma="true"==n[1]}};var d={xy:()=>{o.x=parseInt(n[1]),o.y=parseInt(n[2])},size:()=>{o.width=parseInt(n[1]),o.height=parseInt(n[2])},bounds:()=>{o.x=parseInt(n[1]),o.y=parseInt(n[2]),o.width=parseInt(n[3]),o.height=parseInt(n[4])},offset:()=>{o.offsetX=parseInt(n[1]),o.offsetY=parseInt(n[2])},orig:()=>{o.originalWidth=parseInt(n[1]),o.originalHeight=parseInt(n[2])},offsets:()=>{o.offsetX=parseInt(n[1]),o.offsetY=parseInt(n[2]),o.originalWidth=parseInt(n[3]),o.originalHeight=parseInt(n[4])},rotate:()=>{let t=n[1];"true"==t?o.degrees=90:"false"!=t&&(o.degrees=parseInt(t))},index:()=>{o.index=parseInt(n[1])}};let c=r.readLine();for(;c&&0==c.trim().length;)c=r.readLine();for(;c&&0!=c.trim().length&&0!=r.readEntry(n,c);)c=r.readLine();let u=null,m=null;for(;null!==c;)if(0==c.trim().length)l=null,c=r.readLine();else if(l){for(o=new a,o.page=l,o.name=c;;){let t=r.readEntry(n,c=r.readLine());if(0==t)break;let e=d[n[0]];if(e)e();else{u||(u=[],m=[]),u.push(n[0]);let e=[];for(let s=0;s<t;s++)e.push(parseInt(n[s+1]));m.push(e)}}0==o.originalWidth&&0==o.originalHeight&&(o.originalWidth=o.width,o.originalHeight=o.height),u&&u.length>0&&(o.names=u,o.values=m,u=null,m=null),o.u=o.x/l.width,o.v=o.y/l.height,90==o.degrees?(o.u2=(o.x+o.height)/l.width,o.v2=(o.y+o.width)/l.height):(o.u2=(o.x+o.width)/l.width,o.v2=(o.y+o.height)/l.height),this.regions.push(o)}else{for(l=new s,l.name=c.trim();0!=r.readEntry(n,c=r.readLine());){let t=h[n[0]];t&&t()}this.pages.push(l)}}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 s of this.pages)s.setTexture(t.get(e+s.name))}dispose(){for(let t=0;t<this.pages.length;t++)this.pages[t].texture.dispose()}};class e{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)return 0;if(0==(e=e.trim()).length)return 0;let s=e.indexOf(":");if(-1==s)return 0;t[0]=e.substr(0,s).trim();for(let a=1,i=s+1;;a++){let s=e.indexOf(",",i);if(-1==s)return t[a]=e.substr(i).trim(),a;if(t[a]=e.substr(i,s-i).trim(),i=s+1,4==a)return 4}}}class s{constructor(){this.minFilter=t.TextureFilter.Nearest,this.magFilter=t.TextureFilter.Nearest,this.uWrap=t.TextureWrap.ClampToEdge,this.vWrap=t.TextureWrap.ClampToEdge}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}}t.TextureAtlasPage=s;class a extends t.TextureRegion{}t.TextureAtlasRegion=a}(spine||(spine={})),function(t){t.TransformConstraint=class{constructor(e,s){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new t.Vector2,this.active=!1,!e)throw new Error("data cannot be null.");if(!s)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 t=0;t<e.bones.length;t++)this.bones.push(s.findBone(e.bones[t].name));this.target=s.findBone(e.target.name)}isActive(){return this.active}update(){0==this.mixRotate&&0==this.mixX&&0==this.mixY&&0==this.mixScaleX&&0==this.mixScaleX&&0==this.mixShearY||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let e=this.mixRotate,s=this.mixX,a=this.mixY,i=this.mixScaleX,r=this.mixScaleY,n=this.mixShearY,l=0!=s||0!=a,o=this.target,h=o.a,d=o.b,c=o.c,u=o.d,m=h*u-d*c>0?t.MathUtils.degRad:-t.MathUtils.degRad,f=this.data.offsetRotation*m,g=this.data.offsetShearY*m,p=this.bones;for(let m=0,x=p.length;m<x;m++){let x=p[m];if(0!=e){let s=x.a,a=x.b,i=x.c,r=x.d,n=Math.atan2(c,h)-Math.atan2(i,s)+f;n>t.MathUtils.PI?n-=t.MathUtils.PI2:n<-t.MathUtils.PI&&(n+=t.MathUtils.PI2),n*=e;let l=Math.cos(n),o=Math.sin(n);x.a=l*s-o*i,x.b=l*a-o*r,x.c=o*s+l*i,x.d=o*a+l*r}if(l){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(t.x-x.worldX)*s,x.worldY+=(t.y-x.worldY)*a}if(0!=i){let t=Math.sqrt(x.a*x.a+x.c*x.c);0!=t&&(t=(t+(Math.sqrt(h*h+c*c)-t+this.data.offsetScaleX)*i)/t),x.a*=t,x.c*=t}if(0!=r){let t=Math.sqrt(x.b*x.b+x.d*x.d);0!=t&&(t=(t+(Math.sqrt(d*d+u*u)-t+this.data.offsetScaleY)*r)/t),x.b*=t,x.d*=t}if(n>0){let e=x.b,s=x.d,a=Math.atan2(s,e),i=Math.atan2(u,d)-Math.atan2(c,h)-(a-Math.atan2(x.c,x.a));i>t.MathUtils.PI?i-=t.MathUtils.PI2:i<-t.MathUtils.PI&&(i+=t.MathUtils.PI2),i=a+(i+g)*n;let r=Math.sqrt(e*e+s*s);x.b=Math.cos(i)*r,x.d=Math.sin(i)*r}x.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,s=this.mixX,a=this.mixY,i=this.mixScaleX,r=this.mixScaleY,n=this.mixShearY,l=0!=s||0!=a,o=this.target,h=o.a,d=o.b,c=o.c,u=o.d,m=h*u-d*c>0?t.MathUtils.degRad:-t.MathUtils.degRad,f=this.data.offsetRotation*m,g=this.data.offsetShearY*m,p=this.bones;for(let m=0,x=p.length;m<x;m++){let x=p[m];if(0!=e){let s=x.a,a=x.b,i=x.c,r=x.d,n=Math.atan2(c,h)+f;n>t.MathUtils.PI?n-=t.MathUtils.PI2:n<-t.MathUtils.PI&&(n+=t.MathUtils.PI2),n*=e;let l=Math.cos(n),o=Math.sin(n);x.a=l*s-o*i,x.b=l*a-o*r,x.c=o*s+l*i,x.d=o*a+l*r}if(l){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=t.x*s,x.worldY+=t.y*a}if(0!=i){let t=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleX)*i+1;x.a*=t,x.c*=t}if(0!=r){let t=(Math.sqrt(d*d+u*u)-1+this.data.offsetScaleY)*r+1;x.b*=t,x.d*=t}if(n>0){let e=Math.atan2(u,d)-Math.atan2(c,h);e>t.MathUtils.PI?e-=t.MathUtils.PI2:e<-t.MathUtils.PI&&(e+=t.MathUtils.PI2);let s=x.b,a=x.d;e=Math.atan2(a,s)+(e-t.MathUtils.PI/2+g)*n;let i=Math.sqrt(s*s+a*a);x.b=Math.cos(e)*i,x.d=Math.sin(e)*i}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,s=this.mixY,a=this.mixScaleX,i=this.mixScaleY,r=this.mixShearY,n=this.target,l=this.bones;for(let o=0,h=l.length;o<h;o++){let h=l[o],d=h.arotation;if(0!=t){let e=n.arotation-d+this.data.offsetRotation;e-=360*(16384-(16384.499999999996-e/360|0)),d+=e*t}let c=h.ax,u=h.ay;c+=(n.ax-c+this.data.offsetX)*e,u+=(n.ay-u+this.data.offsetY)*s;let m=h.ascaleX,f=h.ascaleY;0!=a&&0!=m&&(m=(m+(n.ascaleX-m+this.data.offsetScaleX)*a)/m),0!=i&&0!=f&&(f=(f+(n.ascaleY-f+this.data.offsetScaleY)*i)/f);let g=h.ashearY;if(0!=r){let t=n.ashearY-g+this.data.offsetShearY;t-=360*(16384-(16384.499999999996-t/360|0)),g+=t*r}h.updateWorldTransformWith(c,u,d,m,f,h.ashearX,g)}}applyRelativeLocal(){let t=this.mixRotate,e=this.mixX,s=this.mixY,a=this.mixScaleX,i=this.mixScaleY,r=this.mixShearY,n=this.target,l=this.bones;for(let o=0,h=l.length;o<h;o++){let h=l[o],d=h.arotation+(n.arotation+this.data.offsetRotation)*t,c=h.ax+(n.ax+this.data.offsetX)*e,u=h.ay+(n.ay+this.data.offsetY)*s,m=h.ascaleX*((n.ascaleX-1+this.data.offsetScaleX)*a)+1,f=h.ascaleY*((n.ascaleY-1+this.data.offsetScaleY)*i)+1,g=h.ashearY+(n.ashearY+this.data.offsetShearY)*r;h.updateWorldTransformWith(c,u,d,m,f,h.ashearX,g)}}}}(spine||(spine={})),function(t){class e extends t.ConstraintData{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}}t.TransformConstraintData=e}(spine||(spine={})),function(t){class e{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new t.Pool(()=>new Array),this.polygonIndicesPool=new t.Pool(()=>new Array)}triangulate(t){let s=t,a=t.length>>1,i=this.indicesArray;i.length=0;for(let t=0;t<a;t++)i[t]=t;let r=this.isConcaveArray;r.length=0;for(let t=0,n=a;t<n;++t)r[t]=e.isConcave(t,a,s,i);let n=this.triangles;for(n.length=0;a>3;){let t=a-1,l=0,o=1;for(;;){t:if(!r[l]){let n=i[t]<<1,h=i[l]<<1,d=i[o]<<1,c=s[n],u=s[n+1],m=s[h],f=s[h+1],g=s[d],p=s[d+1];for(let n=(o+1)%a;n!=t;n=(n+1)%a){if(!r[n])continue;let t=i[n]<<1,a=s[t],l=s[t+1];if(e.positiveArea(g,p,c,u,a,l)&&e.positiveArea(c,u,m,f,a,l)&&e.positiveArea(m,f,g,p,a,l))break t}break}if(0==o){do{if(!r[l])break;l--}while(l>0);break}t=l,l=o,o=(o+1)%a}n.push(i[(a+l-1)%a]),n.push(i[l]),n.push(i[(l+1)%a]),i.splice(l,1),r.splice(l,1),a--;let h=(a+l-1)%a,d=l==a?0:l;r[h]=e.isConcave(h,a,s,i),r[d]=e.isConcave(d,a,s,i)}return 3==a&&(n.push(i[2]),n.push(i[0]),n.push(i[1])),n}decompose(t,s){let a=t,i=this.convexPolygons;this.polygonPool.freeAll(i),i.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let n=this.polygonIndicesPool.obtain();n.length=0;let l=this.polygonPool.obtain();l.length=0;let o=-1,h=0;for(let t=0,d=s.length;t<d;t+=3){let d=s[t]<<1,c=s[t+1]<<1,u=s[t+2]<<1,m=a[d],f=a[d+1],g=a[c],p=a[c+1],x=a[u],b=a[u+1],w=!1;if(o==d){let t=l.length-4,s=e.winding(l[t],l[t+1],l[t+2],l[t+3],x,b),a=e.winding(x,b,l[0],l[1],l[2],l[3]);s==h&&a==h&&(l.push(x),l.push(b),n.push(u),w=!0)}w||(l.length>0?(i.push(l),r.push(n)):(this.polygonPool.free(l),this.polygonIndicesPool.free(n)),l=this.polygonPool.obtain(),l.length=0,l.push(m),l.push(f),l.push(g),l.push(p),l.push(x),l.push(b),n=this.polygonIndicesPool.obtain(),n.length=0,n.push(d),n.push(c),n.push(u),h=e.winding(m,f,g,p,x,b),o=d)}l.length>0&&(i.push(l),r.push(n));for(let t=0,s=i.length;t<s;t++){if(n=r[t],0==n.length)continue;let a=n[0],o=n[n.length-1];l=i[t];let h=l.length-4,d=l[h],c=l[h+1],u=l[h+2],m=l[h+3],f=l[0],g=l[1],p=l[2],x=l[3],b=e.winding(d,c,u,m,f,g);for(let h=0;h<s;h++){if(h==t)continue;let s=r[h];if(3!=s.length)continue;let w=s[0],y=s[1],M=s[2],k=i[h],A=k[k.length-2],S=k[k.length-1];if(w!=a||y!=o)continue;let T=e.winding(d,c,u,m,A,S),C=e.winding(A,S,f,g,p,x);T==b&&C==b&&(k.length=0,s.length=0,l.push(A),l.push(S),n.push(M),d=u,c=m,u=A,m=S,h=0)}}for(let t=i.length-1;t>=0;t--)l=i[t],0==l.length&&(i.splice(t,1),this.polygonPool.free(l),n=r[t],r.splice(t,1),this.polygonIndicesPool.free(n));return i}static isConcave(t,e,s,a){let i=a[(e+t-1)%e]<<1,r=a[t]<<1,n=a[(t+1)%e]<<1;return!this.positiveArea(s[i],s[i+1],s[r],s[r+1],s[n],s[n+1])}static positiveArea(t,e,s,a,i,r){return t*(r-a)+s*(e-r)+i*(a-e)>=0}static winding(t,e,s,a,i,r){let n=s-t,l=a-e;return i*l-r*n+n*e-t*l>=0?1:-1}}t.Triangulator=e}(spine||(spine={})),function(t){t.IntSet=class{constructor(){this.array=new Array}add(t){let e=this.contains(t);return this.array[0|t]=0|t,!e}contains(t){return null!=this.array[0|t]}remove(t){this.array[0|t]=void 0}clear(){this.array.length=0}};t.StringSet=class{constructor(){this.entries={},this.size=0}add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var s=0,a=t.length;s<a;s++)this.add(t[s]);return e!=this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}};class e{constructor(t=0,e=0,s=0,a=0){this.r=t,this.g=e,this.b=s,this.a=a}set(t,e,s,a){return this.r=t,this.g=e,this.b=s,this.a=a,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=8!=t.length?1:parseInt(t.substr(6,2),16)/255,this}add(t,e,s,a){return this.r+=t,this.g+=e,this.b+=s,this.a+=a,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=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}static fromString(t){return(new e).setFromString(t)}}e.WHITE=new e(1,1,1,1),e.RED=new e(1,0,0,1),e.GREEN=new e(0,1,0,1),e.BLUE=new e(0,0,1,1),e.MAGENTA=new e(1,0,1,1),t.Color=e;class s{static clamp(t,e,s){return t<e?e:t>s?s:t}static cosDeg(t){return Math.cos(t*s.degRad)}static sinDeg(t){return Math.sin(t*s.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 s.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,s){let a=Math.random(),i=e-t;return a<=(s-t)/i?t+Math.sqrt(a*i*(s-t)):e-Math.sqrt((1-a)*i*(e-s))}static isPowerOfTwo(t){return t&&0==(t&t-1)}}s.PI=3.1415927,s.PI2=2*s.PI,s.radiansToDegrees=180/s.PI,s.radDeg=s.radiansToDegrees,s.degreesToRadians=s.PI/180,s.degRad=s.degreesToRadians,t.MathUtils=s;class a{apply(t,e,s){return t+(e-t)*this.applyInternal(s)}}t.Interpolation=a;class i extends a{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}}t.Pow=i;t.PowOut=class extends i{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}};class r{static arrayCopy(t,e,s,a,i){for(let r=e,n=a;r<e+i;r++,n++)s[n]=t[r]}static arrayFill(t,e,s,a){for(let i=e;i<s;i++)t[i]=a}static setArraySize(t,e,s=0){let a=t.length;if(a==e)return t;if(t.length=e,a<e)for(let i=a;i<e;i++)t[i]=s;return t}static ensureArrayCapacity(t,e,s=0){return t.length>=e?t:r.setArraySize(t,e,s)}static newArray(t,e){let s=new Array(t);for(let a=0;a<t;a++)s[a]=e;return s}static newFloatArray(t){if(r.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static newShortArray(t){if(r.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static toFloatArray(t){return r.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return r.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,e){}static contains(t,e,s=!0){for(var a=0;a<t.length;a++)if(t[a]==e)return!0;return!1}static enumValue(t,e){return t[e[0].toUpperCase()+e.slice(1)]}}r.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array,t.Utils=r;t.DebugUtils=class{static logBones(t){for(let e=0;e<t.bones.length;e++){let s=t.bones[e];console.log(s.data.name+", "+s.a+", "+s.b+", "+s.c+", "+s.d+", "+s.worldX+", "+s.worldY)}}};t.Pool=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}};t.Vector2=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 0!=t&&(this.x/=t,this.y/=t),this}};t.TimeKeeper=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)}};t.WindowedMean=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}}}(spine||(spine={})),(()=>{var t;Math.fround||(Math.fround=(t=new Float32Array(1),function(e){return t[0]=e,t[0]}))})(),function(t){class e{constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}}t.Attachment=e;class s extends e{constructor(t){super(t),this.id=s.nextID++,this.worldVerticesLength=0,this.deformAttachment=this}computeWorldVertices(t,e,s,a,i,r){s=i+(s>>1)*r;let n=t.bone.skeleton,l=t.deform,o=this.vertices,h=this.bones;if(!h){l.length>0&&(o=l);let n=t.bone,h=n.worldX,d=n.worldY,c=n.a,u=n.b,m=n.c,f=n.d;for(let t=e,n=i;n<s;t+=2,n+=r){let e=o[t],s=o[t+1];a[n]=e*c+s*u+h,a[n+1]=e*m+s*f+d}return}let d=0,c=0;for(let t=0;t<e;t+=2){let t=h[d];d+=t+1,c+=t}let u=n.bones;if(0==l.length)for(let t=i,e=3*c;t<s;t+=r){let s=0,i=0,r=h[d++];for(r+=d;d<r;d++,e+=3){let t=u[h[d]],a=o[e],r=o[e+1],n=o[e+2];s+=(a*t.a+r*t.b+t.worldX)*n,i+=(a*t.c+r*t.d+t.worldY)*n}a[t]=s,a[t+1]=i}else{let t=l;for(let e=i,n=3*c,l=c<<1;e<s;e+=r){let s=0,i=0,r=h[d++];for(r+=d;d<r;d++,n+=3,l+=2){let e=u[h[d]],a=o[n]+t[l],r=o[n+1]+t[l+1],c=o[n+2];s+=(a*e.a+r*e.b+e.worldX)*c,i+=(a*e.c+r*e.d+e.worldY)*c}a[e]=s,a[e+1]=i}}}copyTo(e){this.bones?(e.bones=new Array(this.bones.length),t.Utils.arrayCopy(this.bones,0,e.bones,0,this.bones.length)):e.bones=null,this.vertices?(e.vertices=t.Utils.newFloatArray(this.vertices.length),t.Utils.arrayCopy(this.vertices,0,e.vertices,0,this.vertices.length)):e.vertices=null,e.worldVerticesLength=this.worldVerticesLength,e.deformAttachment=this.deformAttachment}}s.nextID=0,t.VertexAttachment=s}(spine||(spine={})),function(t){class e extends t.VertexAttachment{constructor(e){super(e),this.color=new t.Color(1,1,1,1)}copy(){let t=new e(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}}t.BoundingBoxAttachment=e}(spine||(spine={})),function(t){class e extends t.VertexAttachment{constructor(e){super(e),this.color=new t.Color(.2275,.2275,.8078,1)}copy(){let t=new e(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}}t.ClippingAttachment=e}(spine||(spine={})),function(t){class e extends t.VertexAttachment{constructor(e){super(e),this.color=new t.Color(1,1,1,1),this.tempColor=new t.Color(0,0,0,0)}updateUVs(){let e=this.regionUVs;this.uvs&&this.uvs.length==e.length||(this.uvs=t.Utils.newFloatArray(e.length));let s=this.uvs,a=this.uvs.length,i=this.region.u,r=this.region.v,n=0,l=0;if(this.region instanceof t.TextureAtlasRegion){let t=this.region,o=t.page.texture.getImage(),h=o.width,d=o.height;switch(t.degrees){case 90:i-=(t.originalHeight-t.offsetY-t.height)/h,r-=(t.originalWidth-t.offsetX-t.width)/d,n=t.originalHeight/h,l=t.originalWidth/d;for(let t=0;t<a;t+=2)s[t]=i+e[t+1]*n,s[t+1]=r+(1-e[t])*l;return;case 180:i-=(t.originalWidth-t.offsetX-t.width)/h,r-=t.offsetY/d,n=t.originalWidth/h,l=t.originalHeight/d;for(let t=0;t<a;t+=2)s[t]=i+(1-e[t])*n,s[t+1]=r+(1-e[t+1])*l;return;case 270:i-=t.offsetY/h,r-=t.offsetX/d,n=t.originalHeight/h,l=t.originalWidth/d;for(let t=0;t<a;t+=2)s[t]=i+(1-e[t+1])*n,s[t+1]=r+e[t]*l;return}i-=t.offsetX/h,r-=(t.originalHeight-t.offsetY-t.height)/d,n=t.originalWidth/h,l=t.originalHeight/d}else this.region?(n=this.region.u2-i,l=this.region.v2-r):(i=r=0,n=l=1);for(let t=0;t<a;t+=2)s[t]=i+e[t]*n,s[t+1]=r+e[t+1]*l}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 s=new e(this.name);return s.region=this.region,s.path=this.path,s.color.setFromColor(this.color),this.copyTo(s),s.regionUVs=new Array(this.regionUVs.length),t.Utils.arrayCopy(this.regionUVs,0,s.regionUVs,0,this.regionUVs.length),s.uvs=new Array(this.uvs.length),t.Utils.arrayCopy(this.uvs,0,s.uvs,0,this.uvs.length),s.triangles=new Array(this.triangles.length),t.Utils.arrayCopy(this.triangles,0,s.triangles,0,this.triangles.length),s.hullLength=this.hullLength,this.edges&&(s.edges=new Array(this.edges.length),t.Utils.arrayCopy(this.edges,0,s.edges,0,this.edges.length)),s.width=this.width,s.height=this.height,s}newLinkedMesh(){let t=new e(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}}t.MeshAttachment=e}(spine||(spine={})),function(t){class e extends t.VertexAttachment{constructor(e){super(e),this.closed=!1,this.constantSpeed=!1,this.color=new t.Color(1,1,1,1)}copy(){let s=new e(this.name);return this.copyTo(s),s.lengths=new Array(this.lengths.length),t.Utils.arrayCopy(this.lengths,0,s.lengths,0,this.lengths.length),s.closed=closed,s.constantSpeed=this.constantSpeed,s.color.setFromColor(this.color),s}}t.PathAttachment=e}(spine||(spine={})),function(t){class e extends t.VertexAttachment{constructor(e){super(e),this.color=new t.Color(.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(e){let s=t.MathUtils.cosDeg(this.rotation),a=t.MathUtils.sinDeg(this.rotation),i=s*e.a+a*e.b,r=s*e.c+a*e.d;return Math.atan2(r,i)*t.MathUtils.radDeg}copy(){let t=new e(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}}t.PointAttachment=e}(spine||(spine={})),function(t){class e extends t.Attachment{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 t.Color(1,1,1,1),this.offset=t.Utils.newFloatArray(8),this.uvs=t.Utils.newFloatArray(8),this.tempColor=new t.Color(1,1,1,1)}updateOffset(){this.region;let t=this.width/this.region.originalWidth*this.scaleX,e=this.height/this.region.originalHeight*this.scaleY,s=-this.width/2*this.scaleX+this.region.offsetX*t,a=-this.height/2*this.scaleY+this.region.offsetY*e,i=s+this.region.width*t,r=a+this.region.height*e,n=this.rotation*Math.PI/180,l=Math.cos(n),o=Math.sin(n),h=this.x,d=this.y,c=s*l+h,u=s*o,m=a*l+d,f=a*o,g=i*l+h,p=i*o,x=r*l+d,b=r*o,w=this.offset;w[0]=c-f,w[1]=m+u,w[2]=c-b,w[3]=x+u,w[4]=g-b,w[5]=x+p,w[6]=g-f,w[7]=m+p}setRegion(t){this.region=t;let e=this.uvs;90==t.degrees?(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,s,a){let i=this.offset,r=t.worldX,n=t.worldY,l=t.a,o=t.b,h=t.c,d=t.d,c=0,u=0;c=i[0],u=i[1],e[s]=c*l+u*o+r,e[s+1]=c*h+u*d+n,s+=a,c=i[2],u=i[3],e[s]=c*l+u*o+r,e[s+1]=c*h+u*d+n,s+=a,c=i[4],u=i[5],e[s]=c*l+u*o+r,e[s+1]=c*h+u*d+n,s+=a,c=i[6],u=i[7],e[s]=c*l+u*o+r,e[s+1]=c*h+u*d+n}copy(){let s=new e(this.name);return s.region=this.region,s.rendererObject=this.rendererObject,s.path=this.path,s.x=this.x,s.y=this.y,s.scaleX=this.scaleX,s.scaleY=this.scaleY,s.rotation=this.rotation,s.width=this.width,s.height=this.height,t.Utils.arrayCopy(this.uvs,0,s.uvs,0,8),t.Utils.arrayCopy(this.offset,0,s.offset,0,8),s.color.setFromColor(this.color),s}}e.X1=0,e.Y1=1,e.C1R=2,e.C1G=3,e.C1B=4,e.C1A=5,e.U1=6,e.V1=7,e.X2=8,e.Y2=9,e.C2R=10,e.C2G=11,e.C2B=12,e.C2A=13,e.U2=14,e.V2=15,e.X3=16,e.Y3=17,e.C3R=18,e.C3G=19,e.C3B=20,e.C3A=21,e.U3=22,e.V3=23,e.X4=24,e.Y4=25,e.C4R=26,e.C4G=27,e.C4B=28,e.C4A=29,e.U4=30,e.V4=31,t.RegionAttachment=e}(spine||(spine={})),function(t){t.JitterEffect=class{constructor(t,e){this.jitterX=0,this.jitterY=0,this.jitterX=t,this.jitterY=e}begin(t){}transform(e,s,a,i){e.x+=t.MathUtils.randomTriangular(-this.jitterX,this.jitterY),e.y+=t.MathUtils.randomTriangular(-this.jitterX,this.jitterY)}end(){}}}(spine||(spine={})),function(t){class e{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(s,a,i,r){let n=this.angle*t.MathUtils.degreesToRadians,l=s.x-this.worldX,o=s.y-this.worldY,h=Math.sqrt(l*l+o*o);if(h<this.radius){let t=e.interpolation.apply(0,n,(this.radius-h)/this.radius),a=Math.cos(t),i=Math.sin(t);s.x=a*l-i*o+this.worldX,s.y=i*l+a*o+this.worldY}}end(){}}e.interpolation=new t.PowOut(2),t.SwirlEffect=e}(spine||(spine={})),window.spine=spine;