var spine;!function(t){class e{constructor(t,e,s){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.duration=s}apply(t,e,s,i,a,n,r,l){if(null==t)throw new Error("skeleton cannot be null.");i&&0!=this.duration&&(s%=this.duration,e>0&&(e%=this.duration));let o=this.timelines;for(let i=0,h=o.length;i<h;i++)o[i].apply(t,e,s,a,n,r,l)}static binarySearch(t,e,s=1){let i=0,a=t.length/s-2;if(0==a)return s;let n=a>>>1;for(;;){if(t[(n+1)*s]<=e?i=n+1:a=n,i==a)return(i+1)*s;n=i+a>>>1}}static linearSearch(t,e,s){for(let i=0,a=t.length-s;i<=a;i+=s)if(t[i]>e)return i;return-1}}let s,i,a;t.Animation=e,function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(s=t.MixBlend||(t.MixBlend={})),function(t){t[t.in=0]="in",t[t.out=1]="out"}(i=t.MixDirection||(t.MixDirection={})),function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"}(a=t.TimelineType||(t.TimelineType={}));class n{constructor(e){if(e<=0)throw new Error("frameCount must be > 0: "+e);this.curves=t.Utils.newFloatArray((e-1)*n.BEZIER_SIZE)}getFrameCount(){return this.curves.length/n.BEZIER_SIZE+1}setLinear(t){this.curves[t*n.BEZIER_SIZE]=n.LINEAR}setStepped(t){this.curves[t*n.BEZIER_SIZE]=n.STEPPED}getCurveType(t){let e=t*n.BEZIER_SIZE;if(e==this.curves.length)return n.LINEAR;let s=this.curves[e];return s==n.LINEAR?n.LINEAR:s==n.STEPPED?n.STEPPED:n.BEZIER}setCurve(t,e,s,i,a){let r=.03*(2*-e+i),l=.03*(2*-s+a),o=.006*(3*(e-i)+1),h=.006*(3*(s-a)+1),u=2*r+o,d=2*l+h,c=.3*e+r+.16666667*o,f=.3*s+l+.16666667*h,m=t*n.BEZIER_SIZE,p=this.curves;p[m++]=n.BEZIER;let g=c,x=f;for(let t=m+n.BEZIER_SIZE-1;m<t;m+=2)p[m]=g,p[m+1]=x,c+=u,f+=d,u+=o,d+=h,g+=c,x+=f}getCurvePercent(e,s){s=t.MathUtils.clamp(s,0,1);let i=this.curves,a=e*n.BEZIER_SIZE,r=i[a];if(r==n.LINEAR)return s;if(r==n.STEPPED)return 0;a++;let l=0;for(let t=a,e=a+n.BEZIER_SIZE-1;a<e;a+=2)if(l=i[a],l>=s){let e,n;return a==t?(e=0,n=0):(e=i[a-2],n=i[a-1]),n+(i[a+1]-n)*(s-e)/(l-e)}let o=i[a-1];return o+(1-o)*(s-l)/(1-l)}}n.LINEAR=0,n.STEPPED=1,n.BEZIER=2,n.BEZIER_SIZE=19,t.CurveTimeline=n;class r extends n{constructor(e){super(e),this.frames=t.Utils.newFloatArray(e<<1)}getPropertyId(){return(a.rotate<<24)+this.boneIndex}setFrame(t,e,s){t<<=1,this.frames[t]=e,this.frames[t+r.ROTATION]=s}apply(t,i,a,n,l,o,h){let u=this.frames,d=t.bones[this.boneIndex];if(a<u[0]){switch(o){case s.setup:return void(d.rotation=d.data.rotation);case s.first:let t=d.data.rotation-d.rotation;d.rotation+=(t-360*(16384-(16384.499999999996-t/360|0)))*l}return}if(a>=u[u.length-r.ENTRIES]){let t=u[u.length+r.PREV_ROTATION];switch(o){case s.setup:d.rotation=d.data.rotation+t*l;break;case s.first:case s.replace:t+=d.data.rotation-d.rotation,t-=360*(16384-(16384.499999999996-t/360|0));case s.add:d.rotation+=t*l}return}let c=e.binarySearch(u,a,r.ENTRIES),f=u[c+r.PREV_ROTATION],m=u[c],p=this.getCurvePercent((c>>1)-1,1-(a-m)/(u[c+r.PREV_TIME]-m)),g=u[c+r.ROTATION]-f;switch(g=f+(g-360*(16384-(16384.499999999996-g/360|0)))*p,o){case s.setup:d.rotation=d.data.rotation+(g-360*(16384-(16384.499999999996-g/360|0)))*l;break;case s.first:case s.replace:g+=d.data.rotation-d.rotation;case s.add:d.rotation+=(g-360*(16384-(16384.499999999996-g/360|0)))*l}}}r.ENTRIES=2,r.PREV_TIME=-2,r.PREV_ROTATION=-1,r.ROTATION=1,t.RotateTimeline=r;class l extends n{constructor(e){super(e),this.frames=t.Utils.newFloatArray(e*l.ENTRIES)}getPropertyId(){return(a.translate<<24)+this.boneIndex}setFrame(t,e,s,i){t*=l.ENTRIES,this.frames[t]=e,this.frames[t+l.X]=s,this.frames[t+l.Y]=i}apply(t,i,a,n,r,o,h){let u=this.frames,d=t.bones[this.boneIndex];if(a<u[0]){switch(o){case s.setup:return d.x=d.data.x,void(d.y=d.data.y);case s.first:d.x+=(d.data.x-d.x)*r,d.y+=(d.data.y-d.y)*r}return}let c=0,f=0;if(a>=u[u.length-l.ENTRIES])c=u[u.length+l.PREV_X],f=u[u.length+l.PREV_Y];else{let t=e.binarySearch(u,a,l.ENTRIES);c=u[t+l.PREV_X],f=u[t+l.PREV_Y];let s=u[t],i=this.getCurvePercent(t/l.ENTRIES-1,1-(a-s)/(u[t+l.PREV_TIME]-s));c+=(u[t+l.X]-c)*i,f+=(u[t+l.Y]-f)*i}switch(o){case s.setup:d.x=d.data.x+c*r,d.y=d.data.y+f*r;break;case s.first:case s.replace:d.x+=(d.data.x+c-d.x)*r,d.y+=(d.data.y+f-d.y)*r;break;case s.add:d.x+=c*r,d.y+=f*r}}}l.ENTRIES=3,l.PREV_TIME=-3,l.PREV_X=-2,l.PREV_Y=-1,l.X=1,l.Y=2,t.TranslateTimeline=l;class o extends l{constructor(t){super(t)}getPropertyId(){return(a.scale<<24)+this.boneIndex}apply(a,n,r,l,h,u,d){let c=this.frames,f=a.bones[this.boneIndex];if(r<c[0]){switch(u){case s.setup:return f.scaleX=f.data.scaleX,void(f.scaleY=f.data.scaleY);case s.first:f.scaleX+=(f.data.scaleX-f.scaleX)*h,f.scaleY+=(f.data.scaleY-f.scaleY)*h}return}let m=0,p=0;if(r>=c[c.length-o.ENTRIES])m=c[c.length+o.PREV_X]*f.data.scaleX,p=c[c.length+o.PREV_Y]*f.data.scaleY;else{let t=e.binarySearch(c,r,o.ENTRIES);m=c[t+o.PREV_X],p=c[t+o.PREV_Y];let s=c[t],i=this.getCurvePercent(t/o.ENTRIES-1,1-(r-s)/(c[t+o.PREV_TIME]-s));m=(m+(c[t+o.X]-m)*i)*f.data.scaleX,p=(p+(c[t+o.Y]-p)*i)*f.data.scaleY}if(1==h)u==s.add?(f.scaleX+=m-f.data.scaleX,f.scaleY+=p-f.data.scaleY):(f.scaleX=m,f.scaleY=p);else{let e=0,a=0;if(d==i.out)switch(u){case s.setup:e=f.data.scaleX,a=f.data.scaleY,f.scaleX=e+(Math.abs(m)*t.MathUtils.signum(e)-e)*h,f.scaleY=a+(Math.abs(p)*t.MathUtils.signum(a)-a)*h;break;case s.first:case s.replace:e=f.scaleX,a=f.scaleY,f.scaleX=e+(Math.abs(m)*t.MathUtils.signum(e)-e)*h,f.scaleY=a+(Math.abs(p)*t.MathUtils.signum(a)-a)*h;break;case s.add:e=f.scaleX,a=f.scaleY,f.scaleX=e+(Math.abs(m)*t.MathUtils.signum(e)-f.data.scaleX)*h,f.scaleY=a+(Math.abs(p)*t.MathUtils.signum(a)-f.data.scaleY)*h}else switch(u){case s.setup:e=Math.abs(f.data.scaleX)*t.MathUtils.signum(m),a=Math.abs(f.data.scaleY)*t.MathUtils.signum(p),f.scaleX=e+(m-e)*h,f.scaleY=a+(p-a)*h;break;case s.first:case s.replace:e=Math.abs(f.scaleX)*t.MathUtils.signum(m),a=Math.abs(f.scaleY)*t.MathUtils.signum(p),f.scaleX=e+(m-e)*h,f.scaleY=a+(p-a)*h;break;case s.add:e=t.MathUtils.signum(m),a=t.MathUtils.signum(p),f.scaleX=Math.abs(f.scaleX)*e+(m-Math.abs(f.data.scaleX)*e)*h,f.scaleY=Math.abs(f.scaleY)*a+(p-Math.abs(f.data.scaleY)*a)*h}}}}t.ScaleTimeline=o;class h extends l{constructor(t){super(t)}getPropertyId(){return(a.shear<<24)+this.boneIndex}apply(t,i,a,n,r,l,o){let u=this.frames,d=t.bones[this.boneIndex];if(a<u[0]){switch(l){case s.setup:return d.shearX=d.data.shearX,void(d.shearY=d.data.shearY);case s.first:d.shearX+=(d.data.shearX-d.shearX)*r,d.shearY+=(d.data.shearY-d.shearY)*r}return}let c=0,f=0;if(a>=u[u.length-h.ENTRIES])c=u[u.length+h.PREV_X],f=u[u.length+h.PREV_Y];else{let t=e.binarySearch(u,a,h.ENTRIES);c=u[t+h.PREV_X],f=u[t+h.PREV_Y];let s=u[t],i=this.getCurvePercent(t/h.ENTRIES-1,1-(a-s)/(u[t+h.PREV_TIME]-s));c+=(u[t+h.X]-c)*i,f+=(u[t+h.Y]-f)*i}switch(l){case s.setup:d.shearX=d.data.shearX+c*r,d.shearY=d.data.shearY+f*r;break;case s.first:case s.replace:d.shearX+=(d.data.shearX+c-d.shearX)*r,d.shearY+=(d.data.shearY+f-d.shearY)*r;break;case s.add:d.shearX+=c*r,d.shearY+=f*r}}}t.ShearTimeline=h;class u extends n{constructor(e){super(e),this.frames=t.Utils.newFloatArray(e*u.ENTRIES)}getPropertyId(){return(a.color<<24)+this.slotIndex}setFrame(t,e,s,i,a,n){t*=u.ENTRIES,this.frames[t]=e,this.frames[t+u.R]=s,this.frames[t+u.G]=i,this.frames[t+u.B]=a,this.frames[t+u.A]=n}apply(t,i,a,n,r,l,o){let h=t.slots[this.slotIndex],d=this.frames;if(a<d[0]){switch(l){case s.setup:return void h.color.setFromColor(h.data.color);case s.first:let t=h.color,e=h.data.color;t.add((e.r-t.r)*r,(e.g-t.g)*r,(e.b-t.b)*r,(e.a-t.a)*r)}return}let c=0,f=0,m=0,p=0;if(a>=d[d.length-u.ENTRIES]){let t=d.length;c=d[t+u.PREV_R],f=d[t+u.PREV_G],m=d[t+u.PREV_B],p=d[t+u.PREV_A]}else{let t=e.binarySearch(d,a,u.ENTRIES);c=d[t+u.PREV_R],f=d[t+u.PREV_G],m=d[t+u.PREV_B],p=d[t+u.PREV_A];let s=d[t],i=this.getCurvePercent(t/u.ENTRIES-1,1-(a-s)/(d[t+u.PREV_TIME]-s));c+=(d[t+u.R]-c)*i,f+=(d[t+u.G]-f)*i,m+=(d[t+u.B]-m)*i,p+=(d[t+u.A]-p)*i}if(1==r)h.color.set(c,f,m,p);else{let t=h.color;l==s.setup&&t.setFromColor(h.data.color),t.add((c-t.r)*r,(f-t.g)*r,(m-t.b)*r,(p-t.a)*r)}}}u.ENTRIES=5,u.PREV_TIME=-5,u.PREV_R=-4,u.PREV_G=-3,u.PREV_B=-2,u.PREV_A=-1,u.R=1,u.G=2,u.B=3,u.A=4,t.ColorTimeline=u;class d extends n{constructor(e){super(e),this.frames=t.Utils.newFloatArray(e*d.ENTRIES)}getPropertyId(){return(a.twoColor<<24)+this.slotIndex}setFrame(t,e,s,i,a,n,r,l,o){t*=d.ENTRIES,this.frames[t]=e,this.frames[t+d.R]=s,this.frames[t+d.G]=i,this.frames[t+d.B]=a,this.frames[t+d.A]=n,this.frames[t+d.R2]=r,this.frames[t+d.G2]=l,this.frames[t+d.B2]=o}apply(t,i,a,n,r,l,o){let h=t.slots[this.slotIndex],u=this.frames;if(a<u[0]){switch(l){case s.setup:return h.color.setFromColor(h.data.color),void h.darkColor.setFromColor(h.data.darkColor);case s.first:let t=h.color,e=h.darkColor,i=h.data.color,a=h.data.darkColor;t.add((i.r-t.r)*r,(i.g-t.g)*r,(i.b-t.b)*r,(i.a-t.a)*r),e.add((a.r-e.r)*r,(a.g-e.g)*r,(a.b-e.b)*r,0)}return}let c=0,f=0,m=0,p=0,g=0,x=0,M=0;if(a>=u[u.length-d.ENTRIES]){let t=u.length;c=u[t+d.PREV_R],f=u[t+d.PREV_G],m=u[t+d.PREV_B],p=u[t+d.PREV_A],g=u[t+d.PREV_R2],x=u[t+d.PREV_G2],M=u[t+d.PREV_B2]}else{let t=e.binarySearch(u,a,d.ENTRIES);c=u[t+d.PREV_R],f=u[t+d.PREV_G],m=u[t+d.PREV_B],p=u[t+d.PREV_A],g=u[t+d.PREV_R2],x=u[t+d.PREV_G2],M=u[t+d.PREV_B2];let s=u[t],i=this.getCurvePercent(t/d.ENTRIES-1,1-(a-s)/(u[t+d.PREV_TIME]-s));c+=(u[t+d.R]-c)*i,f+=(u[t+d.G]-f)*i,m+=(u[t+d.B]-m)*i,p+=(u[t+d.A]-p)*i,g+=(u[t+d.R2]-g)*i,x+=(u[t+d.G2]-x)*i,M+=(u[t+d.B2]-M)*i}if(1==r)h.color.set(c,f,m,p),h.darkColor.set(g,x,M,1);else{let t=h.color,e=h.darkColor;l==s.setup&&(t.setFromColor(h.data.color),e.setFromColor(h.data.darkColor)),t.add((c-t.r)*r,(f-t.g)*r,(m-t.b)*r,(p-t.a)*r),e.add((g-e.r)*r,(x-e.g)*r,(M-e.b)*r,0)}}}d.ENTRIES=8,d.PREV_TIME=-8,d.PREV_R=-7,d.PREV_G=-6,d.PREV_B=-5,d.PREV_A=-4,d.PREV_R2=-3,d.PREV_G2=-2,d.PREV_B2=-1,d.R=1,d.G=2,d.B=3,d.A=4,d.R2=5,d.G2=6,d.B2=7,t.TwoColorTimeline=d;t.AttachmentTimeline=class{constructor(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}getPropertyId(){return(a.attachment<<24)+this.slotIndex}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.attachmentNames[t]=s}apply(t,a,n,r,l,o,h){let u=t.slots[this.slotIndex];if(h==i.out&&o==s.setup){let e=u.data.attachmentName;return void u.setAttachment(null==e?null:t.getAttachment(this.slotIndex,e))}let d=this.frames;if(n<d[0]){if(o==s.setup||o==s.first){let e=u.data.attachmentName;u.setAttachment(null==e?null:t.getAttachment(this.slotIndex,e))}return}let c=0;c=n>=d[d.length-1]?d.length-1:e.binarySearch(d,n,1)-1;let f=this.attachmentNames[c];t.slots[this.slotIndex].setAttachment(null==f?null:t.getAttachment(this.slotIndex,f))}};let c=null;t.DeformTimeline=class extends n{constructor(e){super(e),this.frames=t.Utils.newFloatArray(e),this.frameVertices=new Array(e),null==c&&(c=t.Utils.newFloatArray(64))}getPropertyId(){return(a.deform<<27)+ +this.attachment.id+this.slotIndex}setFrame(t,e,s){this.frames[t]=e,this.frameVertices[t]=s}apply(i,a,n,r,l,o,h){let u=i.slots[this.slotIndex],d=u.getAttachment();if(!(d instanceof t.VertexAttachment&&d.applyDeform(this.attachment)))return;let c=u.attachmentVertices;0==c.length&&(o=s.setup);let f=this.frameVertices,m=f[0].length,p=this.frames;if(n<p[0]){let e=d;switch(o){case s.setup:return void(c.length=0);case s.first:if(1==l){c.length=0;break}let i=t.Utils.setArraySize(c,m);if(null==e.bones){let t=e.vertices;for(var g=0;g<m;g++)i[g]+=(t[g]-i[g])*l}else{l=1-l;for(g=0;g<m;g++)i[g]*=l}}return}let x=t.Utils.setArraySize(c,m);if(n>=p[p.length-1]){let e=f[p.length-1];if(1==l)if(o==s.add){let t=d;if(null==t.bones){let s=t.vertices;for(let t=0;t<m;t++)x[t]+=e[t]-s[t]}else for(let t=0;t<m;t++)x[t]+=e[t]}else t.Utils.arrayCopy(e,0,x,0,m);else switch(o){case s.setup:{let t=d;if(null==t.bones){let s=t.vertices;for(let t=0;t<m;t++){let i=s[t];x[t]=i+(e[t]-i)*l}}else for(let t=0;t<m;t++)x[t]=e[t]*l;break}case s.first:case s.replace:for(let t=0;t<m;t++)x[t]+=(e[t]-x[t])*l;case s.add:let t=d;if(null==t.bones){let s=t.vertices;for(let t=0;t<m;t++)x[t]+=(e[t]-s[t])*l}else for(let t=0;t<m;t++)x[t]+=e[t]*l}return}let M=e.binarySearch(p,n),w=f[M-1],E=f[M],T=p[M],b=this.getCurvePercent(M-1,1-(n-T)/(p[M-1]-T));if(1==l)if(o==s.add){let t=d;if(null==t.bones){let e=t.vertices;for(let t=0;t<m;t++){let s=w[t];x[t]+=s+(E[t]-s)*b-e[t]}}else for(let t=0;t<m;t++){let e=w[t];x[t]+=e+(E[t]-e)*b}}else for(let t=0;t<m;t++){let e=w[t];x[t]=e+(E[t]-e)*b}else switch(o){case s.setup:{let t=d;if(null==t.bones){let e=t.vertices;for(let t=0;t<m;t++){let s=w[t],i=e[t];x[t]=i+(s+(E[t]-s)*b-i)*l}}else for(let t=0;t<m;t++){let e=w[t];x[t]=(e+(E[t]-e)*b)*l}break}case s.first:case s.replace:for(let t=0;t<m;t++){let e=w[t];x[t]+=(e+(E[t]-e)*b-x[t])*l}break;case s.add:let t=d;if(null==t.bones){let e=t.vertices;for(let t=0;t<m;t++){let s=w[t];x[t]+=(s+(E[t]-s)*b-e[t])*l}}else for(let t=0;t<m;t++){let e=w[t];x[t]+=(e+(E[t]-e)*b)*l}}}};t.EventTimeline=class{constructor(e){this.frames=t.Utils.newFloatArray(e),this.events=new Array(e)}getPropertyId(){return a.event<<24}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,s,i,a,n,r,l){if(null==a)return;let o=this.frames,h=this.frames.length;if(s>i)this.apply(t,s,Number.MAX_VALUE,a,n,r,l),s=-1;else if(s>=o[h-1])return;if(i<o[0])return;let u=0;if(s<o[0])u=0;else{u=e.binarySearch(o,s);let t=o[u];for(;u>0&&o[u-1]==t;)u--}for(;u<h&&i>=o[u];u++)a.push(this.events[u])}};t.DrawOrderTimeline=class{constructor(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}getPropertyId(){return a.drawOrder<<24}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.drawOrders[t]=s}apply(a,n,r,l,o,h,u){let d=a.drawOrder,c=a.slots;if(u==i.out&&h==s.setup)return void t.Utils.arrayCopy(a.slots,0,a.drawOrder,0,a.slots.length);let f=this.frames;if(r<f[0])return void(h!=s.setup&&h!=s.first||t.Utils.arrayCopy(a.slots,0,a.drawOrder,0,a.slots.length));let m=0;m=r>=f[f.length-1]?f.length-1:e.binarySearch(f,r)-1;let p=this.drawOrders[m];if(null==p)t.Utils.arrayCopy(c,0,d,0,c.length);else for(let t=0,e=p.length;t<e;t++)d[t]=c[p[t]]}};class f extends n{constructor(e){super(e),this.frames=t.Utils.newFloatArray(e*f.ENTRIES)}getPropertyId(){return(a.ikConstraint<<24)+this.ikConstraintIndex}setFrame(t,e,s,i,a,n){t*=f.ENTRIES,this.frames[t]=e,this.frames[t+f.MIX]=s,this.frames[t+f.BEND_DIRECTION]=i,this.frames[t+f.COMPRESS]=a?1:0,this.frames[t+f.STRETCH]=n?1:0}apply(t,a,n,r,l,o,h){let u=this.frames,d=t.ikConstraints[this.ikConstraintIndex];if(n<u[0]){switch(o){case s.setup:return d.mix=d.data.mix,d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,void(d.stretch=d.data.stretch);case s.first:d.mix+=(d.data.mix-d.mix)*l,d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch}return}if(n>=u[u.length-f.ENTRIES])return void(o==s.setup?(d.mix=d.data.mix+(u[u.length+f.PREV_MIX]-d.data.mix)*l,h==i.out?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=u[u.length+f.PREV_BEND_DIRECTION],d.compress=0!=u[u.length+f.PREV_COMPRESS],d.stretch=0!=u[u.length+f.PREV_STRETCH])):(d.mix+=(u[u.length+f.PREV_MIX]-d.mix)*l,h==i.in&&(d.bendDirection=u[u.length+f.PREV_BEND_DIRECTION],d.compress=0!=u[u.length+f.PREV_COMPRESS],d.stretch=0!=u[u.length+f.PREV_STRETCH])));let c=e.binarySearch(u,n,f.ENTRIES),m=u[c+f.PREV_MIX],p=u[c],g=this.getCurvePercent(c/f.ENTRIES-1,1-(n-p)/(u[c+f.PREV_TIME]-p));o==s.setup?(d.mix=d.data.mix+(m+(u[c+f.MIX]-m)*g-d.data.mix)*l,h==i.out?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=u[c+f.PREV_BEND_DIRECTION],d.compress=0!=u[c+f.PREV_COMPRESS],d.stretch=0!=u[c+f.PREV_STRETCH])):(d.mix+=(m+(u[c+f.MIX]-m)*g-d.mix)*l,h==i.in&&(d.bendDirection=u[c+f.PREV_BEND_DIRECTION],d.compress=0!=u[c+f.PREV_COMPRESS],d.stretch=0!=u[c+f.PREV_STRETCH]))}}f.ENTRIES=5,f.PREV_TIME=-5,f.PREV_MIX=-4,f.PREV_BEND_DIRECTION=-3,f.PREV_COMPRESS=-2,f.PREV_STRETCH=-1,f.MIX=1,f.BEND_DIRECTION=2,f.COMPRESS=3,f.STRETCH=4,t.IkConstraintTimeline=f;class m extends n{constructor(e){super(e),this.frames=t.Utils.newFloatArray(e*m.ENTRIES)}getPropertyId(){return(a.transformConstraint<<24)+this.transformConstraintIndex}setFrame(t,e,s,i,a,n){t*=m.ENTRIES,this.frames[t]=e,this.frames[t+m.ROTATE]=s,this.frames[t+m.TRANSLATE]=i,this.frames[t+m.SCALE]=a,this.frames[t+m.SHEAR]=n}apply(t,i,a,n,r,l,o){let h=this.frames,u=t.transformConstraints[this.transformConstraintIndex];if(a<h[0]){let t=u.data;switch(l){case s.setup:return u.rotateMix=t.rotateMix,u.translateMix=t.translateMix,u.scaleMix=t.scaleMix,void(u.shearMix=t.shearMix);case s.first:u.rotateMix+=(t.rotateMix-u.rotateMix)*r,u.translateMix+=(t.translateMix-u.translateMix)*r,u.scaleMix+=(t.scaleMix-u.scaleMix)*r,u.shearMix+=(t.shearMix-u.shearMix)*r}return}let d=0,c=0,f=0,p=0;if(a>=h[h.length-m.ENTRIES]){let t=h.length;d=h[t+m.PREV_ROTATE],c=h[t+m.PREV_TRANSLATE],f=h[t+m.PREV_SCALE],p=h[t+m.PREV_SHEAR]}else{let t=e.binarySearch(h,a,m.ENTRIES);d=h[t+m.PREV_ROTATE],c=h[t+m.PREV_TRANSLATE],f=h[t+m.PREV_SCALE],p=h[t+m.PREV_SHEAR];let s=h[t],i=this.getCurvePercent(t/m.ENTRIES-1,1-(a-s)/(h[t+m.PREV_TIME]-s));d+=(h[t+m.ROTATE]-d)*i,c+=(h[t+m.TRANSLATE]-c)*i,f+=(h[t+m.SCALE]-f)*i,p+=(h[t+m.SHEAR]-p)*i}if(l==s.setup){let t=u.data;u.rotateMix=t.rotateMix+(d-t.rotateMix)*r,u.translateMix=t.translateMix+(c-t.translateMix)*r,u.scaleMix=t.scaleMix+(f-t.scaleMix)*r,u.shearMix=t.shearMix+(p-t.shearMix)*r}else u.rotateMix+=(d-u.rotateMix)*r,u.translateMix+=(c-u.translateMix)*r,u.scaleMix+=(f-u.scaleMix)*r,u.shearMix+=(p-u.shearMix)*r}}m.ENTRIES=5,m.PREV_TIME=-5,m.PREV_ROTATE=-4,m.PREV_TRANSLATE=-3,m.PREV_SCALE=-2,m.PREV_SHEAR=-1,m.ROTATE=1,m.TRANSLATE=2,m.SCALE=3,m.SHEAR=4,t.TransformConstraintTimeline=m;class p extends n{constructor(e){super(e),this.frames=t.Utils.newFloatArray(e*p.ENTRIES)}getPropertyId(){return(a.pathConstraintPosition<<24)+this.pathConstraintIndex}setFrame(t,e,s){t*=p.ENTRIES,this.frames[t]=e,this.frames[t+p.VALUE]=s}apply(t,i,a,n,r,l,o){let h=this.frames,u=t.pathConstraints[this.pathConstraintIndex];if(a<h[0]){switch(l){case s.setup:return void(u.position=u.data.position);case s.first:u.position+=(u.data.position-u.position)*r}return}let d=0;if(a>=h[h.length-p.ENTRIES])d=h[h.length+p.PREV_VALUE];else{let t=e.binarySearch(h,a,p.ENTRIES);d=h[t+p.PREV_VALUE];let s=h[t],i=this.getCurvePercent(t/p.ENTRIES-1,1-(a-s)/(h[t+p.PREV_TIME]-s));d+=(h[t+p.VALUE]-d)*i}l==s.setup?u.position=u.data.position+(d-u.data.position)*r:u.position+=(d-u.position)*r}}p.ENTRIES=2,p.PREV_TIME=-2,p.PREV_VALUE=-1,p.VALUE=1,t.PathConstraintPositionTimeline=p;class g extends p{constructor(t){super(t)}getPropertyId(){return(a.pathConstraintSpacing<<24)+this.pathConstraintIndex}apply(t,i,a,n,r,l,o){let h=this.frames,u=t.pathConstraints[this.pathConstraintIndex];if(a<h[0]){switch(l){case s.setup:return void(u.spacing=u.data.spacing);case s.first:u.spacing+=(u.data.spacing-u.spacing)*r}return}let d=0;if(a>=h[h.length-g.ENTRIES])d=h[h.length+g.PREV_VALUE];else{let t=e.binarySearch(h,a,g.ENTRIES);d=h[t+g.PREV_VALUE];let s=h[t],i=this.getCurvePercent(t/g.ENTRIES-1,1-(a-s)/(h[t+g.PREV_TIME]-s));d+=(h[t+g.VALUE]-d)*i}l==s.setup?u.spacing=u.data.spacing+(d-u.data.spacing)*r:u.spacing+=(d-u.spacing)*r}}t.PathConstraintSpacingTimeline=g;class x extends n{constructor(e){super(e),this.frames=t.Utils.newFloatArray(e*x.ENTRIES)}getPropertyId(){return(a.pathConstraintMix<<24)+this.pathConstraintIndex}setFrame(t,e,s,i){t*=x.ENTRIES,this.frames[t]=e,this.frames[t+x.ROTATE]=s,this.frames[t+x.TRANSLATE]=i}apply(t,i,a,n,r,l,o){let h=this.frames,u=t.pathConstraints[this.pathConstraintIndex];if(a<h[0]){switch(l){case s.setup:return u.rotateMix=u.data.rotateMix,void(u.translateMix=u.data.translateMix);case s.first:u.rotateMix+=(u.data.rotateMix-u.rotateMix)*r,u.translateMix+=(u.data.translateMix-u.translateMix)*r}return}let d=0,c=0;if(a>=h[h.length-x.ENTRIES])d=h[h.length+x.PREV_ROTATE],c=h[h.length+x.PREV_TRANSLATE];else{let t=e.binarySearch(h,a,x.ENTRIES);d=h[t+x.PREV_ROTATE],c=h[t+x.PREV_TRANSLATE];let s=h[t],i=this.getCurvePercent(t/x.ENTRIES-1,1-(a-s)/(h[t+x.PREV_TIME]-s));d+=(h[t+x.ROTATE]-d)*i,c+=(h[t+x.TRANSLATE]-c)*i}l==s.setup?(u.rotateMix=u.data.rotateMix+(d-u.data.rotateMix)*r,u.translateMix=u.data.translateMix+(c-u.data.translateMix)*r):(u.rotateMix+=(d-u.rotateMix)*r,u.translateMix+=(c-u.translateMix)*r)}}x.ENTRIES=3,x.PREV_TIME=-3,x.PREV_ROTATE=-2,x.PREV_TRANSLATE=-1,x.ROTATE=1,x.TRANSLATE=2,t.PathConstraintMixTimeline=x}(spine||(spine={})),function(t){class e{constructor(e){this.tracks=new Array,this.events=new Array,this.listeners=new Array,this.queue=new i(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.timeScale=1,this.trackEntryPool=new t.Pool(()=>new s),this.data=e}update(t){t*=this.timeScale;let e=this.tracks;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(null==i)continue;i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast;let a=t*i.timeScale;if(i.delay>0){if(i.delay-=a,i.delay>0)continue;a=-i.delay,i.delay=0}let n=i.next;if(null!=n){let e=i.trackLast-n.delay;if(e>=0){for(n.delay=0,n.trackTime=0==i.timeScale?0:(e/i.timeScale+t)*n.timeScale,i.trackTime+=a,this.setCurrent(s,n,!0);null!=n.mixingFrom;)n.mixTime+=t,n=n.mixingFrom;continue}}else if(i.trackLast>=i.trackEnd&&null==i.mixingFrom){e[s]=null,this.queue.end(i),this.disposeNext(i);continue}if(null!=i.mixingFrom&&this.updateMixingFrom(i,t)){let t=i.mixingFrom;for(i.mixingFrom=null,null!=t&&(t.mixingTo=null);null!=t;)this.queue.end(t),t=t.mixingFrom}i.trackTime+=a}this.queue.drain()}updateMixingFrom(t,e){let s=t.mixingFrom;if(null==s)return!0;let i=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,null!=s.mixingFrom&&(s.mixingFrom.mixingTo=t),t.interruptAlpha=s.interruptAlpha,this.queue.end(s)),i):(s.trackTime+=e*s.timeScale,t.mixTime+=e,!1)}apply(s){if(null==s)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let i=this.events,a=this.tracks,n=!1;for(let r=0,l=a.length;r<l;r++){let l=a[r];if(null==l||l.delay>0)continue;n=!0;let o=0==r?t.MixBlend.first:l.mixBlend,h=l.alpha;null!=l.mixingFrom?h*=this.applyMixingFrom(l,s,o):l.trackTime>=l.trackEnd&&null==l.next&&(h=0);let u=l.animationLast,d=l.getAnimationTime(),c=l.animation.timelines.length,f=l.animation.timelines;if(0==r&&1==h||o==t.MixBlend.add)for(let e=0;e<c;e++)f[e].apply(s,u,d,i,h,o,t.MixDirection.in);else{let a=l.timelineMode,n=0==l.timelinesRotation.length;n&&t.Utils.setArraySize(l.timelinesRotation,c<<1,null);let r=l.timelinesRotation;for(let l=0;l<c;l++){let c=f[l],m=a[l]==e.SUBSEQUENT?o:t.MixBlend.setup;c instanceof t.RotateTimeline?this.applyRotateTimeline(c,s,d,h,m,r,l<<1,n):(t.Utils.webkit602BugfixHelper(h,o),c.apply(s,u,d,i,h,m,t.MixDirection.in))}}this.queueEvents(l,d),i.length=0,l.nextAnimationLast=d,l.nextTrackLast=l.trackTime}return this.queue.drain(),n}applyMixingFrom(s,i,a){let n=s.mixingFrom;null!=n.mixingFrom&&this.applyMixingFrom(n,i,a);let r=0;0==s.mixDuration?(r=1,a==t.MixBlend.first&&(a=t.MixBlend.setup)):(r=s.mixTime/s.mixDuration,r>1&&(r=1),a!=t.MixBlend.first&&(a=n.mixBlend));let l=r<n.eventThreshold?this.events:null,o=r<n.attachmentThreshold,h=r<n.drawOrderThreshold,u=n.animationLast,d=n.getAnimationTime(),c=n.animation.timelines.length,f=n.animation.timelines,m=n.alpha*s.interruptAlpha,p=m*(1-r);if(a==t.MixBlend.add)for(let e=0;e<c;e++)f[e].apply(i,u,d,l,p,a,t.MixDirection.out);else{let s=n.timelineMode,r=n.timelineHoldMix,g=0==n.timelinesRotation.length;g&&t.Utils.setArraySize(n.timelinesRotation,c<<1,null);let x=n.timelinesRotation;n.totalAlpha=0;for(let M=0;M<c;M++){let c,w=f[M],E=t.MixDirection.out,T=0;switch(s[M]){case e.SUBSEQUENT:if(!o&&w instanceof t.AttachmentTimeline)continue;if(!h&&w instanceof t.DrawOrderTimeline)continue;c=a,T=p;break;case e.FIRST:c=t.MixBlend.setup,T=p;break;case e.HOLD:c=t.MixBlend.setup,T=m;break;default:c=t.MixBlend.setup;let s=r[M];T=m*Math.max(0,1-s.mixTime/s.mixDuration)}n.totalAlpha+=T,w instanceof t.RotateTimeline?this.applyRotateTimeline(w,i,d,T,c,x,M<<1,g):(t.Utils.webkit602BugfixHelper(T,a),c==t.MixBlend.setup&&(w instanceof t.AttachmentTimeline?o&&(E=t.MixDirection.out):w instanceof t.DrawOrderTimeline&&h&&(E=t.MixDirection.out)),w.apply(i,u,d,l,T,c,E))}}return s.mixDuration>0&&this.queueEvents(n,d),this.events.length=0,n.nextAnimationLast=d,n.nextTrackLast=n.trackTime,r}applyRotateTimeline(e,s,i,a,n,r,l,o){if(o&&(r[l]=0),1==a)return void e.apply(s,0,i,null,1,n,t.MixDirection.in);let h=e,u=h.frames,d=s.bones[h.boneIndex],c=0,f=0;if(i<u[0])switch(n){case t.MixBlend.setup:d.rotation=d.data.rotation;default:return;case t.MixBlend.first:c=d.rotation,f=d.data.rotation}else if(c=n==t.MixBlend.setup?d.data.rotation:d.rotation,i>=u[u.length-t.RotateTimeline.ENTRIES])f=d.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{let e=t.Animation.binarySearch(u,i,t.RotateTimeline.ENTRIES),s=u[e+t.RotateTimeline.PREV_ROTATION],a=u[e],n=h.getCurvePercent((e>>1)-1,1-(i-a)/(u[e+t.RotateTimeline.PREV_TIME]-a));f=u[e+t.RotateTimeline.ROTATION]-s,f-=360*(16384-(16384.499999999996-f/360|0)),f=s+f*n+d.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0))}let m=0,p=f-c;if(p-=360*(16384-(16384.499999999996-p/360|0)),0==p)m=r[l];else{let e=0,s=0;o?(e=0,s=p):(e=r[l],s=r[l+1]);let i=p>0,a=e>=0;t.MathUtils.signum(s)!=t.MathUtils.signum(p)&&Math.abs(s)<=90&&(Math.abs(e)>180&&(e+=360*t.MathUtils.signum(e)),a=i),m=p+e-e%360,a!=i&&(m+=360*t.MathUtils.signum(e)),r[l]=m}r[l+1]=p,c+=m*a,d.rotation=c-360*(16384-(16384.499999999996-c/360|0))}queueEvents(t,e){let s=t.animationStart,i=t.animationEnd,a=i-s,n=t.trackLast%a,r=this.events,l=0,o=r.length;for(;l<o;l++){let e=r[l];if(e.time<n)break;e.time>i||this.queue.event(t,e)}let h=!1;for(h=t.loop?0==a||n>t.trackTime%a:e>=i&&t.animationLast<i,h&&this.queue.complete(t);l<o;l++){r[l].time<s||this.queue.event(t,r[l])}}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(null==e)return;this.queue.end(e),this.disposeNext(e);let s=e;for(;;){let t=s.mixingFrom;if(null==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 i=this.expandToIndex(t);this.tracks[t]=e,null!=i&&(s&&this.queue.interrupt(i),e.mixingFrom=i,i.mixingTo=e,e.mixTime=0,null!=i.mixingFrom&&i.mixDuration>0&&(e.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,s){let i=this.data.skeletonData.findAnimation(e);if(null==i)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,i,s)}setAnimationWith(t,e,s){if(null==e)throw new Error("animation cannot be null.");let i=!0,a=this.expandToIndex(t);null!=a&&(-1==a.nextTrackLast?(this.tracks[t]=a.mixingFrom,this.queue.interrupt(a),this.queue.end(a),this.disposeNext(a),a=a.mixingFrom,i=!1):this.disposeNext(a));let n=this.trackEntry(t,e,s,a);return this.setCurrent(t,n,i),this.queue.drain(),n}addAnimation(t,e,s,i){let a=this.data.skeletonData.findAnimation(e);if(null==a)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,a,s,i)}addAnimationWith(t,e,s,i){if(null==e)throw new Error("animation cannot be null.");let a=this.expandToIndex(t);if(null!=a)for(;null!=a.next;)a=a.next;let n=this.trackEntry(t,e,s,a);if(null==a)this.setCurrent(t,n,!0),this.queue.drain();else if(a.next=n,i<=0){let t=a.animationEnd-a.animationStart;0!=t?(a.loop?i+=t*(1+(a.trackTime/t|0)):i+=Math.max(t,a.trackTime),i-=this.data.getMix(a.animation,e)):i=a.trackTime}return n.delay=i,n}setEmptyAnimation(t,s){let i=this.setAnimationWith(t,e.emptyAnimation,!1);return i.mixDuration=s,i.trackEnd=s,i}addEmptyAnimation(t,s,i){i<=0&&(i-=s);let a=this.addAnimationWith(t,e.emptyAnimation,!1,i);return a.mixDuration=s,a.trackEnd=s,a}setEmptyAnimations(t){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];null!=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(t,e,s,i){let a=this.trackEntryPool.obtain();return a.trackIndex=t,a.animation=e,a.loop=s,a.holdPrevious=!1,a.eventThreshold=0,a.attachmentThreshold=0,a.drawOrderThreshold=0,a.animationStart=0,a.animationEnd=e.duration,a.animationLast=-1,a.nextAnimationLast=-1,a.delay=0,a.trackTime=0,a.trackLast=-1,a.nextTrackLast=-1,a.trackEnd=Number.MAX_VALUE,a.timeScale=1,a.alpha=1,a.interruptAlpha=1,a.mixTime=0,a.mixDuration=null==i?0:this.data.getMix(i.animation,e),a}disposeNext(t){let e=t.next;for(;null!=e;)this.queue.dispose(e),e=e.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();for(let e=0,s=this.tracks.length;e<s;e++){let s=this.tracks[e];if(null!=s){for(;null!=s.mixingFrom;)s=s.mixingFrom;do{null!=s.mixingFrom&&s.mixBlend==t.MixBlend.add||this.setTimelineModes(s),s=s.mixingTo}while(null!=s)}}}setTimelineModes(s){let i=s.mixingTo,a=s.animation.timelines,n=s.animation.timelines.length,r=t.Utils.setArraySize(s.timelineMode,n);s.timelineHoldMix.length=0;let l=t.Utils.setArraySize(s.timelineHoldMix,n),o=this.propertyIDs;if(null!=i&&i.holdPrevious)for(let t=0;t<n;t++)o.add(a[t].getPropertyId()),r[t]=e.HOLD;else t:for(let t=0;t<n;t++){let n=a[t].getPropertyId();if(o.add(n))if(null!=i&&this.hasTimeline(i,n)){for(let a=i.mixingTo;null!=a;a=a.mixingTo)if(!this.hasTimeline(a,n)){if(s.mixDuration>0){r[t]=e.HOLD_MIX,l[t]=a;continue t}break}r[t]=e.HOLD}else r[t]=e.FIRST;else r[t]=e.SUBSEQUENT}}hasTimeline(t,e){let s=t.animation.timelines;for(let t=0,i=s.length;t<i;t++)if(s[t].getPropertyId()==e)return!0;return!1}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(null==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()}}e.emptyAnimation=new t.Animation("<empty>",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.HOLD=2,e.HOLD_MIX=3,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.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}}t.TrackEntry=s;class i{constructor(t){this.objects=[],this.drainDisabled=!1,this.animState=t}start(t){this.objects.push(a.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(a.interrupt),this.objects.push(t)}end(t){this.objects.push(a.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(a.dispose),this.objects.push(t)}complete(t){this.objects.push(a.complete),this.objects.push(t)}event(t,e){this.objects.push(a.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 i=t[s],n=t[s+1];switch(i){case a.start:null!=n.listener&&n.listener.start&&n.listener.start(n);for(let t=0;t<e.length;t++)e[t].start&&e[t].start(n);break;case a.interrupt:null!=n.listener&&n.listener.interrupt&&n.listener.interrupt(n);for(let t=0;t<e.length;t++)e[t].interrupt&&e[t].interrupt(n);break;case a.end:null!=n.listener&&n.listener.end&&n.listener.end(n);for(let t=0;t<e.length;t++)e[t].end&&e[t].end(n);case a.dispose:null!=n.listener&&n.listener.dispose&&n.listener.dispose(n);for(let t=0;t<e.length;t++)e[t].dispose&&e[t].dispose(n);this.animState.trackEntryPool.free(n);break;case a.complete:null!=n.listener&&n.listener.complete&&n.listener.complete(n);for(let t=0;t<e.length;t++)e[t].complete&&e[t].complete(n);break;case a.event:let i=t[2+s++];null!=n.listener&&n.listener.event&&n.listener.event(n,i);for(let t=0;t<e.length;t++)e[t].event&&e[t].event(n,i)}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}}let a;t.EventQueue=i,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"}(a=t.EventType||(t.EventType={}));t.AnimationStateAdapter2=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}}}(spine||(spine={})),function(t){t.AnimationStateData=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,null==t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,s){let i=this.skeletonData.findAnimation(t);if(null==i)throw new Error("Animation not found: "+t);let a=this.skeletonData.findAnimation(e);if(null==a)throw new Error("Animation not found: "+e);this.setMixWith(i,a,s)}setMixWith(t,e,s){if(null==t)throw new Error("from cannot be null.");if(null==e)throw new Error("to cannot be null.");let i=t.name+"."+e.name;this.animationToMixTime[i]=s}getMix(t,e){let s=t.name+"."+e.name,i=this.animationToMixTime[s];return void 0===i?this.defaultMix:i}}}(spine||(spine={})),function(t){class e{constructor(t,e=""){this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e}static downloadText(t,e,s){let i=Laya.Laya?Laya.Laya:Laya;i.loader.load([{type:i.Loader.TEXT,url:t}],i.Handler.create(this,a=>{a?e(i.loader.getRes(t)):s(400,"download text error: "+t)}))}static downloadBinary(t,e,s){let i=Laya.Laya?Laya.Laya:Laya;i.loader.load([{type:i.Loader.BUFFER,url:t}],i.Handler.create(this,a=>{a?e(new Uint8Array(i.loader.getRes(t))):s(400,"download binary error: "+t)}))}loadText(t,s=null,i=null){t=this.pathPrefix+t,this.toLoad++,e.downloadText(t,e=>{this.assets[t]=e,s&&s(t,e),this.toLoad--,this.loaded++},(e,s)=>{this.errors[t]=`Couldn't load text ${t}: status ${status}, ${s}`,i&&i(t,`Couldn't load text ${t}: status ${status}, ${s}`),this.toLoad--,this.loaded++})}loadTexture(t,e=null,s=null){t=this.pathPrefix+t,this.toLoad++;let i=Laya.Laya?Laya.Laya:Laya;i.loader.load([{type:i.Loader.IMAGE,url:t}],i.Handler.create(this,a=>{if(a){let s=this.textureLoader(i.loader.getRes(t));this.assets[t]=s,this.toLoad--,this.loaded++,e&&e(t,s)}else this.errors[t]="Couldn't load image "+t,this.toLoad--,this.loaded++,s&&s(t,"Couldn't load image "+t)}))}loadTextureData(t,e,s=null,i=null){t=this.pathPrefix+t,this.toLoad++;let a=new Image;a.onload=e=>{let i=this.textureLoader(a);this.assets[t]=i,this.toLoad--,this.loaded++,s&&s(t,a)},a.onerror=e=>{this.errors[t]="Couldn't load image "+t,this.toLoad--,this.loaded++,i&&i(t,"Couldn't load image "+t)},a.src=e}loadTextureAtlas(s,i=null,a=null){let n=s.lastIndexOf("/")>=0?s.substring(0,s.lastIndexOf("/")):"";s=this.pathPrefix+s,this.toLoad++,e.downloadText(s,e=>{let r={count:0},l=new Array;try{new t.TextureAtlas(e,e=>{l.push(""==n?e:n+"/"+e);let s=document.createElement("img");return new t.FakeTexture(s)})}catch(t){let e=t;return this.errors[s]=`Couldn't load texture atlas ${s}: ${e.message}`,a&&a(s,`Couldn't load texture atlas ${s}: ${e.message}`),this.toLoad--,void this.loaded++}for(let o of l){let h=!1;this.loadTexture(o,(o,u)=>{if(r.count++,r.count==l.length)if(h)this.errors[s]=`Couldn't load texture atlas page ${o}} of atlas ${s}`,a&&a(s,`Couldn't load texture atlas page ${o} of atlas ${s}`),this.toLoad--,this.loaded++;else try{let a=new t.TextureAtlas(e,t=>this.get(""==n?t:n+"/"+t));this.assets[s]=a,i&&i(s,a),this.toLoad--,this.loaded++}catch(t){let e=t;this.errors[s]=`Couldn't load texture atlas ${s}: ${e.message}`,a&&a(s,`Couldn't load texture atlas ${s}: ${e.message}`),this.toLoad--,this.loaded++}},(t,e)=>{h=!0,r.count++,r.count==l.length&&(this.errors[s]=`Couldn't load texture atlas page ${t}} of atlas ${s}`,a&&a(s,`Couldn't load texture atlas page ${t} of atlas ${s}`),this.toLoad--,this.loaded++)})}},(t,e)=>{this.errors[s]=`Couldn't load texture atlas ${s}: status ${status}, ${e}`,a&&a(s,`Couldn't load texture atlas ${s}: status ${status}, ${e}`),this.toLoad--,this.loaded++})}get(t){return t=this.pathPrefix+t,this.assets[t]}remove(t){t=this.pathPrefix+t;let e=this.assets[t];e.dispose&&e.dispose(),this.assets[t]=null}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}}t.AssetManager=e}(spine||(spine={})),function(t){t.AtlasAttachmentLoader=class{constructor(t){this.atlas=t}newRegionAttachment(e,s,i){let a=this.atlas.findRegion(i);if(null==a)throw new Error("Region not found in atlas: "+i+" (region attachment: "+s+")");a.renderObject=a;let n=new t.RegionAttachment(s);return n.setRegion(a),n}newMeshAttachment(e,s,i){let a=this.atlas.findRegion(i);if(null==a)throw new Error("Region not found in atlas: "+i+" (mesh attachment: "+s+")");a.renderObject=a;let n=new t.MeshAttachment(s);return n.region=a,n}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){let e;!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){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.appliedValid=!1,this.a=0,this.b=0,this.worldX=0,this.c=0,this.d=0,this.worldY=0,this.sorted=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=s,this.setToSetupPose()}update(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,s,i,a,n,r,l){this.ax=e,this.ay=s,this.arotation=i,this.ascaleX=a,this.ascaleY=n,this.ashearX=r,this.ashearY=l,this.appliedValid=!0;let o=this.parent;if(null==o){let o=this.skeleton,h=i+90+l,u=o.scaleX,d=o.scaleY;return this.a=t.MathUtils.cosDeg(i+r)*a*u,this.b=t.MathUtils.cosDeg(h)*n*u,this.c=t.MathUtils.sinDeg(i+r)*a*d,this.d=t.MathUtils.sinDeg(h)*n*d,this.worldX=e*u+o.x,void(this.worldY=s*d+o.y)}let h=o.a,u=o.b,d=o.c,c=o.d;switch(this.worldX=h*e+u*s+o.worldX,this.worldY=d*e+c*s+o.worldY,this.data.transformMode){case t.TransformMode.Normal:{let e=i+90+l,s=t.MathUtils.cosDeg(i+r)*a,o=t.MathUtils.cosDeg(e)*n,f=t.MathUtils.sinDeg(i+r)*a,m=t.MathUtils.sinDeg(e)*n;return this.a=h*s+u*f,this.b=h*o+u*m,this.c=d*s+c*f,void(this.d=d*o+c*m)}case t.TransformMode.OnlyTranslation:{let e=i+90+l;this.a=t.MathUtils.cosDeg(i+r)*a,this.b=t.MathUtils.cosDeg(e)*n,this.c=t.MathUtils.sinDeg(i+r)*a,this.d=t.MathUtils.sinDeg(e)*n;break}case t.TransformMode.NoRotationOrReflection:{let e=h*h+d*d,s=0;e>1e-4?(e=Math.abs(h*c-u*d)/e,u=d*e,c=h*e,s=Math.atan2(d,h)*t.MathUtils.radDeg):(h=0,d=0,s=90-Math.atan2(c,u)*t.MathUtils.radDeg);let o=i+r-s,f=i+l-s+90,m=t.MathUtils.cosDeg(o)*a,p=t.MathUtils.cosDeg(f)*n,g=t.MathUtils.sinDeg(o)*a,x=t.MathUtils.sinDeg(f)*n;this.a=h*m-u*g,this.b=h*p-u*x,this.c=d*m+c*g,this.d=d*p+c*x;break}case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:{let e=t.MathUtils.cosDeg(i),s=t.MathUtils.sinDeg(i),o=(h*e+u*s)/this.skeleton.scaleX,f=(d*e+c*s)/this.skeleton.scaleY,m=Math.sqrt(o*o+f*f);m>1e-5&&(m=1/m),o*=m,f*=m,m=Math.sqrt(o*o+f*f),this.data.transformMode==t.TransformMode.NoScale&&h*c-u*d<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(m=-m);let p=Math.PI/2+Math.atan2(f,o),g=Math.cos(p)*m,x=Math.sin(p)*m,M=t.MathUtils.cosDeg(r)*a,w=t.MathUtils.cosDeg(90+l)*n,E=t.MathUtils.sinDeg(r)*a,T=t.MathUtils.sinDeg(90+l)*n;this.a=o*M+g*E,this.b=o*w+g*T,this.c=f*M+x*E,this.d=f*w+x*T;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(){this.appliedValid=!0;let e=this.parent;if(null==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,i=e.b,a=e.c,n=e.d,r=1/(s*n-i*a),l=this.worldX-e.worldX,o=this.worldY-e.worldY;this.ax=l*n*r-o*i*r,this.ay=o*s*r-l*a*r;let h=r*n,u=r*s,d=r*i,c=r*a,f=h*this.a-d*this.c,m=h*this.b-d*this.d,p=u*this.c-c*this.a,g=u*this.d-c*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+p*p),this.ascaleX>1e-4){let e=f*g-m*p;this.ascaleY=e/this.ascaleX,this.ashearY=Math.atan2(f*m+p*g,e)*t.MathUtils.radDeg,this.arotation=Math.atan2(p,f)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(m*m+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,m)*t.MathUtils.radDeg}worldToLocal(t){let e=this.a,s=this.b,i=this.c,a=this.d,n=1/(e*a-s*i),r=t.x-this.worldX,l=t.y-this.worldY;return t.x=r*a*n-l*s*n,t.y=l*e*n-r*i*n,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),i=t.MathUtils.cosDeg(e);return Math.atan2(this.a*s-this.c*i,this.d*i-this.b*s)*t.MathUtils.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let s=t.MathUtils.sinDeg(e),i=t.MathUtils.cosDeg(e);return Math.atan2(i*this.c+s*this.d,i*this.a+s*this.b)*t.MathUtils.radDeg}rotateWorld(e){let s=this.a,i=this.b,a=this.c,n=this.d,r=t.MathUtils.cosDeg(e),l=t.MathUtils.sinDeg(e);this.a=r*s-l*a,this.b=r*i-l*n,this.c=l*s+r*a,this.d=l*i+r*n,this.appliedValid=!1}}}(spine||(spine={})),function(t){let e;t.BoneData=class{constructor(t,s,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,t<0)throw new Error("index must be >= 0.");if(null==s)throw new Error("name cannot be null.");this.index=t,this.name=s,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.Event=class{constructor(t,e){if(null==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,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,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)}getOrder(){return this.data.order}apply(){this.update()}update(){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.mix)}}apply1(e,s,i,a,n,r,l){e.appliedValid||e.updateAppliedTransform();let o=e.parent,h=1/(o.a*o.d-o.b*o.c),u=s-o.worldX,d=i-o.worldY,c=(u*o.d-d*o.b)*h-e.ax,f=(d*o.a-u*o.c)*h-e.ay,m=Math.atan2(f,c)*t.MathUtils.radDeg-e.ashearX-e.arotation;e.ascaleX<0&&(m+=180),m>180?m-=360:m<-180&&(m+=360);let p=e.ascaleX,g=e.ascaleY;if(a||n){let t=e.data.length*p,s=Math.sqrt(c*c+f*f);if(a&&s<t||n&&s>t&&t>1e-4){let e=(s/t-1)*l+1;p*=e,r&&(g*=e)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+m*l,p,g,e.ashearX,e.ashearY)}apply2(e,s,i,a,n,r,l){if(0==l)return void s.updateWorldTransform();e.appliedValid||e.updateAppliedTransform(),s.appliedValid||s.updateAppliedTransform();let o=e.ax,h=e.ay,u=e.ascaleX,d=u,c=e.ascaleY,f=s.ascaleX,m=0,p=0,g=0;u<0?(u=-u,m=180,g=-1):(m=0,g=1),c<0&&(c=-c,g=-g),f<0?(f=-f,p=180):p=0;let x=s.ax,M=0,w=0,E=0,T=e.a,b=e.b,A=e.c,y=e.d,R=Math.abs(u-c)<=1e-4;R?(M=s.ay,w=T*x+b*M+e.worldX,E=A*x+y*M+e.worldY):(M=0,w=T*x+e.worldX,E=A*x+e.worldY);let S=e.parent;T=S.a,b=S.b,A=S.c,y=S.d;let I=1/(T*y-b*A),P=i-S.worldX,C=a-S.worldY,V=(P*y-C*b)*I-o,k=(C*T-P*A)*I-h,N=V*V+k*k;P=w-S.worldX,C=E-S.worldY;let v=(P*y-C*b)*I-o,Y=(C*T-P*A)*I-h,X=Math.sqrt(v*v+Y*Y),U=s.data.length*f,L=0,D=0;t:if(R){U*=u;let t=(N-X*X-U*U)/(2*X*U);t<-1?t=-1:t>1&&(t=1,r&&X+U>1e-4&&(d*=(Math.sqrt(N)/(X+U)-1)*l+1)),D=Math.acos(t)*n,T=X+U*t,b=U*Math.sin(D),L=Math.atan2(k*T-V*b,V*T+k*b)}else{T=u*U,b=c*U;let e=T*T,s=b*b,i=Math.atan2(k,V);A=s*X*X+e*N-e*s;let a=-2*s*X,r=s-e;if(y=a*a-4*r*A,y>=0){let t=Math.sqrt(y);a<0&&(t=-t),t=-(a+t)/2;let e=t/r,s=A/t,l=Math.abs(e)<Math.abs(s)?e:s;if(l*l<=N){C=Math.sqrt(N-l*l)*n,L=i-Math.atan2(C,l),D=Math.atan2(C/c,(l-X)/u);break t}}let l=t.MathUtils.PI,o=X-T,h=o*o,d=0,f=0,m=X+T,p=m*m,g=0;A=-T*X/(e-s),A>=-1&&A<=1&&(A=Math.acos(A),P=T*Math.cos(A)+X,C=b*Math.sin(A),y=P*P+C*C,y<h&&(l=A,h=y,o=P,d=C),y>p&&(f=A,p=y,m=P,g=C)),N<=(h+p)/2?(L=i-Math.atan2(d*n,o),D=l*n):(L=i-Math.atan2(g*n,m),D=f*n)}let F=Math.atan2(M,x)*g,_=e.arotation;L=(L-F)*t.MathUtils.radDeg+m-_,L>180?L-=360:L<-180&&(L+=360),e.updateWorldTransformWith(o,h,_+L*l,d,e.ascaleY,0,0),_=s.arotation,D=((D+F)*t.MathUtils.radDeg-s.ashearX)*g+p-_,D>180?D-=360:D<-180&&(D+=360),s.updateWorldTransformWith(x,M,_+D*l,s.ascaleX,s.ascaleY,s.ashearX,s.ashearY)}}}(spine||(spine={})),function(t){t.IkConstraintData=class{constructor(t){this.order=0,this.bones=new Array,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.name=t}}}(spine||(spine={})),function(t){class e{constructor(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=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,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let s=0,i=t.bones.length;s<i;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.rotateMix=t.rotateMix,this.translateMix=t.translateMix}apply(){this.update()}update(){let s=this.target.getAttachment();if(!(s instanceof t.PathAttachment))return;let i=this.rotateMix,a=this.translateMix,n=i>0;if(!(a>0)&&!n)return;let r=this.data,l=r.spacingMode==t.SpacingMode.Percent,o=r.rotateMode,h=o==t.RotateMode.Tangent,u=o==t.RotateMode.ChainScale,d=this.bones.length,c=h?d:d+1,f=this.bones,m=t.Utils.setArraySize(this.spaces,c),p=null,g=this.spacing;if(u||!l){u&&(p=t.Utils.setArraySize(this.lengths,d));let s=r.spacingMode==t.SpacingMode.Length;for(let t=0,i=c-1;t<i;){let i=f[t],a=i.data.length;if(a<e.epsilon)u&&(p[t]=0),m[++t]=0;else if(l){if(u){let e=a*i.a,s=a*i.c,n=Math.sqrt(e*e+s*s);p[t]=n}m[++t]=g}else{let e=a*i.a,n=a*i.c,r=Math.sqrt(e*e+n*n);u&&(p[t]=r),m[++t]=(s?a+g:g)*r/a}}}else for(let t=1;t<c;t++)m[t]=g;let x=this.computeWorldPositions(s,c,h,r.positionMode==t.PositionMode.Percent,l),M=x[0],w=x[1],E=r.offsetRotation,T=!1;if(0==E)T=o==t.RotateMode.Chain;else{T=!1;let e=this.target.bone;E*=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 r=f[e];r.worldX+=(M-r.worldX)*a,r.worldY+=(w-r.worldY)*a;let l=x[s],o=x[s+1],d=l-M,c=o-w;if(u){let t=p[e];if(0!=t){let e=(Math.sqrt(d*d+c*c)/t-1)*i+1;r.a*=e,r.c*=e}}if(M=l,w=o,n){let a=r.a,n=r.b,l=r.c,o=r.d,u=0,f=0,p=0;if(u=h?x[s-1]:0==m[e+1]?x[s+2]:Math.atan2(c,d),u-=Math.atan2(l,a),T){f=Math.cos(u),p=Math.sin(u);let t=r.data.length;M+=(t*(f*a-p*l)-d)*i,w+=(t*(p*a+f*l)-c)*i}else u+=E;u>t.MathUtils.PI?u-=t.MathUtils.PI2:u<-t.MathUtils.PI&&(u+=t.MathUtils.PI2),u*=i,f=Math.cos(u),p=Math.sin(u),r.a=f*a-p*l,r.b=f*n-p*o,r.c=p*a+f*l,r.d=p*n+f*o}r.appliedValid=!1}}computeWorldPositions(s,i,a,n,r){let l=this.target,o=this.position,h=this.spaces,u=t.Utils.setArraySize(this.positions,3*i+2),d=null,c=s.closed,f=s.worldVerticesLength,m=f/6,p=e.NONE;if(!s.constantSpeed){let g=s.lengths;m-=c?1:2;let x=g[m];if(n&&(o*=x),r)for(let t=1;t<i;t++)h[t]*=x;d=t.Utils.setArraySize(this.world,8);for(let t=0,n=0,r=0;t<i;t++,n+=3){let i=h[t];o+=i;let M=o;if(c)M%=x,M<0&&(M+=x),r=0;else{if(M<0){p!=e.BEFORE&&(p=e.BEFORE,s.computeWorldVertices(l,2,4,d,0,2)),this.addBeforePosition(M,d,0,u,n);continue}if(M>x){p!=e.AFTER&&(p=e.AFTER,s.computeWorldVertices(l,f-6,4,d,0,2)),this.addAfterPosition(M-x,d,0,u,n);continue}}for(;;r++){let t=g[r];if(!(M>t)){if(0==r)M/=t;else{let e=g[r-1];M=(M-e)/(t-e)}break}}r!=p&&(p=r,c&&r==m?(s.computeWorldVertices(l,f-4,4,d,0,2),s.computeWorldVertices(l,0,4,d,4,2)):s.computeWorldVertices(l,6*r+2,8,d,0,2)),this.addCurvePosition(M,d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],u,n,a||t>0&&0==i)}return u}c?(f+=2,d=t.Utils.setArraySize(this.world,f),s.computeWorldVertices(l,2,f-4,d,0,2),s.computeWorldVertices(l,0,2,d,f-4,2),d[f-2]=d[0],d[f-1]=d[1]):(m--,f-=4,d=t.Utils.setArraySize(this.world,f),s.computeWorldVertices(l,2,f,d,0,2));let g=t.Utils.setArraySize(this.curves,m),x=0,M=d[0],w=d[1],E=0,T=0,b=0,A=0,y=0,R=0,S=0,I=0,P=0,C=0,V=0,k=0,N=0,v=0;for(let t=0,e=2;t<m;t++,e+=6)E=d[e],T=d[e+1],b=d[e+2],A=d[e+3],y=d[e+4],R=d[e+5],S=.1875*(M-2*E+b),I=.1875*(w-2*T+A),P=.09375*(3*(E-b)-M+y),C=.09375*(3*(T-A)-w+R),V=2*S+P,k=2*I+C,N=.75*(E-M)+S+.16666667*P,v=.75*(T-w)+I+.16666667*C,x+=Math.sqrt(N*N+v*v),N+=V,v+=k,V+=P,k+=C,x+=Math.sqrt(N*N+v*v),N+=V,v+=k,x+=Math.sqrt(N*N+v*v),N+=V+P,v+=k+C,x+=Math.sqrt(N*N+v*v),g[t]=x,M=y,w=R;if(o*=n?x:x/s.lengths[m-1],r)for(let t=1;t<i;t++)h[t]*=x;let Y=this.segments,X=0;for(let t=0,e=0,s=0,n=0;t<i;t++,e+=3){let i=h[t];o+=i;let r=o;if(c)r%=x,r<0&&(r+=x),s=0;else{if(r<0){this.addBeforePosition(r,d,0,u,e);continue}if(r>x){this.addAfterPosition(r-x,d,f-4,u,e);continue}}for(;;s++){let t=g[s];if(!(r>t)){if(0==s)r/=t;else{let e=g[s-1];r=(r-e)/(t-e)}break}}if(s!=p){p=s;let t=6*s;for(M=d[t],w=d[t+1],E=d[t+2],T=d[t+3],b=d[t+4],A=d[t+5],y=d[t+6],R=d[t+7],S=.03*(M-2*E+b),I=.03*(w-2*T+A),P=.006*(3*(E-b)-M+y),C=.006*(3*(T-A)-w+R),V=2*S+P,k=2*I+C,N=.3*(E-M)+S+.16666667*P,v=.3*(T-w)+I+.16666667*C,X=Math.sqrt(N*N+v*v),Y[0]=X,t=1;t<8;t++)N+=V,v+=k,V+=P,k+=C,X+=Math.sqrt(N*N+v*v),Y[t]=X;N+=V,v+=k,X+=Math.sqrt(N*N+v*v),Y[8]=X,N+=V+P,v+=k+C,X+=Math.sqrt(N*N+v*v),Y[9]=X,n=0}for(r*=X;;n++){let t=Y[n];if(!(r>t)){if(0==n)r/=t;else{let e=Y[n-1];r=n+(r-e)/(t-e)}break}}this.addCurvePosition(.1*r,M,w,E,T,b,A,y,R,u,e,a||t>0&&0==i)}return u}addBeforePosition(t,e,s,i,a){let n=e[s],r=e[s+1],l=e[s+2]-n,o=e[s+3]-r,h=Math.atan2(o,l);i[a]=n+t*Math.cos(h),i[a+1]=r+t*Math.sin(h),i[a+2]=h}addAfterPosition(t,e,s,i,a){let n=e[s+2],r=e[s+3],l=n-e[s],o=r-e[s+1],h=Math.atan2(o,l);i[a]=n+t*Math.cos(h),i[a+1]=r+t*Math.sin(h),i[a+2]=h}addCurvePosition(t,e,s,i,a,n,r,l,o,h,u,d){if(0==t||isNaN(t))return h[u]=e,h[u+1]=s,void(h[u+2]=Math.atan2(a-s,i-e));let c=t*t,f=c*t,m=1-t,p=m*m,g=p*m,x=m*t,M=3*x,w=m*M,E=M*t,T=e*g+i*w+n*E+l*f,b=s*g+a*w+r*E+o*f;h[u]=T,h[u+1]=b,d&&(h[u+2]=t<.001?Math.atan2(a-s,i-e):Math.atan2(b-(s*p+a*x*2+r*c),T-(e*p+i*x*2+n*c)))}getOrder(){return this.data.order}}e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,t.PathConstraint=e}(spine||(spine={})),function(t){let e,s,i;t.PathConstraintData=class{constructor(t){this.order=0,this.bones=new Array,this.name=t}},function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(e=t.PositionMode||(t.PositionMode={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent"}(s=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){class e{constructor(t){this.toLoad=new Array,this.assets={},this.clientId=t}loaded(){let t=0;for(let e in this.assets)t++;return t}}t.SharedAssetManager=class{constructor(t=""){this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}queueAsset(t,s,i){let a=this.clientAssets[t];return null==a&&(a=new e(t),this.clientAssets[t]=a),null!==s&&(a.textureLoader=s),a.toLoad.push(i),this.queuedAssets[i]!==i&&(this.queuedAssets[i]=i,!0)}loadText(t,e){if(e=this.pathPrefix+e,!this.queueAsset(t,null,e))return;let s=new XMLHttpRequest;s.onreadystatechange=()=>{s.readyState==XMLHttpRequest.DONE&&(s.status>=200&&s.status<300?this.rawAssets[e]=s.responseText:this.errors[e]=`Couldn't load text ${e}: status ${s.status}, ${s.responseText}`)},s.open("GET",e,!0),s.send()}loadJson(t,e){if(e=this.pathPrefix+e,!this.queueAsset(t,null,e))return;let s=new XMLHttpRequest;s.onreadystatechange=()=>{s.readyState==XMLHttpRequest.DONE&&(s.status>=200&&s.status<300?this.rawAssets[e]=JSON.parse(s.responseText):this.errors[e]=`Couldn't load text ${e}: status ${s.status}, ${s.responseText}`)},s.open("GET",e,!0),s.send()}loadTexture(t,e,s){if(s=this.pathPrefix+s,!this.queueAsset(t,e,s))return;let i=new Image;i.src=s,i.crossOrigin="anonymous",i.onload=t=>{this.rawAssets[s]=i},i.onerror=t=>{this.errors[s]="Couldn't load image "+s}}get(t,e){e=this.pathPrefix+e;let s=this.clientAssets[t];return null==s||s.assets[e]}updateClientAssets(t){for(let e=0;e<t.toLoad.length;e++){let s=t.toLoad[e],i=t.assets[s];if(null==i){let e=this.rawAssets[s];if(null==e)continue;e instanceof HTMLImageElement?t.assets[s]=t.textureLoader(e):t.assets[s]=e}}}isLoadingComplete(t){let e=this.clientAssets[t];return null==e||(this.updateClientAssets(e),e.toLoad.length==e.loaded())}dispose(){}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}}}(spine||(spine={})),function(t){t.Skeleton=class{constructor(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==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 i,a=e.bones[s];if(null==a.parent)i=new t.Bone(a,this,null);else{let e=this.bones[a.parent.index];i=new t.Bone(a,this,e),e.children.push(i)}this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(let s=0;s<e.slots.length;s++){let i=e.slots[s],a=this.bones[i.boneData.index],n=new t.Slot(i,a);this.slots.push(n),this.drawOrder.push(n)}this.ikConstraints=new Array;for(let s=0;s<e.ikConstraints.length;s++){let i=e.ikConstraints[s];this.ikConstraints.push(new t.IkConstraint(i,this))}this.transformConstraints=new Array;for(let s=0;s<e.transformConstraints.length;s++){let i=e.transformConstraints[s];this.transformConstraints.push(new t.TransformConstraint(i,this))}this.pathConstraints=new Array;for(let s=0;s<e.pathConstraints.length;s++){let i=e.pathConstraints[s];this.pathConstraints.push(new t.PathConstraint(i,this))}this.color=new t.Color(1,1,1,1),this.updateCache()}updateCache(){this._updateCache.length=0,this.updateCacheReset.length=0;let t=this.bones;for(let e=0,s=t.length;e<s;e++)t[e].sorted=!1;let e=this.ikConstraints,s=this.transformConstraints,i=this.pathConstraints,a=e.length,n=s.length,r=i.length,l=a+n+r;t:for(let t=0;t<l;t++){for(let s=0;s<a;s++){let i=e[s];if(i.data.order==t){this.sortIkConstraint(i);continue t}}for(let e=0;e<n;e++){let i=s[e];if(i.data.order==t){this.sortTransformConstraint(i);continue t}}for(let e=0;e<r;e++){let s=i[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(t){let e=t.target;this.sortBone(e);let s=t.bones,i=s[0];if(this.sortBone(i),s.length>1){let t=s[s.length-1];this._updateCache.indexOf(t)>-1||this.updateCacheReset.push(t)}this._updateCache.push(t),this.sortReset(i.children),s[s.length-1].sorted=!0}sortPathConstraint(e){let s=e.target,i=s.data.index,a=s.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,i,a),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,i,a);for(let t=0,e=this.data.skins.length;t<e;t++)this.sortPathConstraintAttachment(this.data.skins[t],i,a);let n=s.getAttachment();n instanceof t.PathAttachment&&this.sortPathConstraintAttachmentWith(n,a);let r=e.bones,l=r.length;for(let t=0;t<l;t++)this.sortBone(r[t]);this._updateCache.push(e);for(let t=0;t<l;t++)this.sortReset(r[t].children);for(let t=0;t<l;t++)r[t].sorted=!0}sortTransformConstraint(t){this.sortBone(t.target);let e=t.bones,s=e.length;if(t.data.local)for(let t=0;t<s;t++){let s=e[t];this.sortBone(s.parent),this._updateCache.indexOf(s)>-1||this.updateCacheReset.push(s)}else for(let t=0;t<s;t++)this.sortBone(e[t]);this._updateCache.push(t);for(let t=0;t<s;t++)this.sortReset(e[t].children);for(let t=0;t<s;t++)e[t].sorted=!0}sortPathConstraintAttachment(t,e,s){let i=t.attachments[e];if(i)for(let t in i)this.sortPathConstraintAttachmentWith(i[t],s)}sortPathConstraintAttachmentWith(e,s){if(!(e instanceof t.PathAttachment))return;let i=e.bones;if(null==i)this.sortBone(s);else{let t=this.bones,e=0;for(;e<i.length;){let s=i[e++];for(let a=e+s;e<a;e++){let s=i[e];this.sortBone(t[s])}}}}sortBone(t){if(t.sorted)return;let e=t.parent;null!=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.sorted&&this.sortReset(s.children),s.sorted=!1}}updateWorldTransform(){let t=this.updateCacheReset;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,s.appliedValid=!0}let e=this._updateCache;for(let t=0,s=e.length;t<s;t++)e[t].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.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],i=e.data;e.rotateMix=i.rotateMix,e.translateMix=i.translateMix,e.scaleMix=i.scaleMix,e.shearMix=i.shearMix}let i=this.pathConstraints;for(let t=0,e=i.length;t<e;t++){let e=i[t],s=e.data;e.position=s.position,e.spacing=s.spacing,e.rotateMix=s.rotateMix,e.translateMix=s.translateMix}}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(null==t)throw new Error("boneName cannot be null.");let e=this.bones;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.data.name==t)return i}return null}findBoneIndex(t){if(null==t)throw new Error("boneName cannot be null.");let e=this.bones;for(let s=0,i=e.length;s<i;s++)if(e[s].data.name==t)return s;return-1}findSlot(t){if(null==t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.data.name==t)return i}return null}findSlotIndex(t){if(null==t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,i=e.length;s<i;s++)if(e[s].data.name==t)return s;return-1}setSkinByName(t){let e=this.data.findSkin(t);if(null==e)throw new Error("Skin not found: "+t);this.setSkin(e)}setSkin(t){if(null!=t)if(null!=this.skin)t.attachAll(this,this.skin);else{let e=this.slots;for(let s=0,i=e.length;s<i;s++){let i=e[s],a=i.data.attachmentName;if(null!=a){let e=t.getAttachment(s,a);null!=e&&i.setAttachment(e)}}}this.skin=t}getAttachmentByName(t,e){return this.getAttachment(this.data.findSlotIndex(t),e)}getAttachment(t,e){if(null==e)throw new Error("attachmentName cannot be null.");if(null!=this.skin){let s=this.skin.getAttachment(t,e);if(null!=s)return s}return null!=this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null}setAttachment(t,e){if(null==t)throw new Error("slotName cannot be null.");let s=this.slots;for(let i=0,a=s.length;i<a;i++){let a=s[i];if(a.data.name==t){let s=null;if(null!=e&&(s=this.getAttachment(i,e),null==s))throw new Error("Attachment not found: "+e+", for slot: "+t);return void a.setAttachment(s)}}throw new Error("Slot not found: "+t)}findIkConstraint(t){if(null==t)throw new Error("constraintName cannot be null.");let e=this.ikConstraints;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.data.name==t)return i}return null}findTransformConstraint(t){if(null==t)throw new Error("constraintName cannot be null.");let e=this.transformConstraints;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.data.name==t)return i}return null}findPathConstraint(t){if(null==t)throw new Error("constraintName cannot be null.");let e=this.pathConstraints;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.data.name==t)return i}return null}getBounds(e,s,i=new Array(2)){if(null==e)throw new Error("offset cannot be null.");if(null==s)throw new Error("size cannot be null.");let a=this.drawOrder,n=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let e=0,s=a.length;e<s;e++){let s=a[e],h=0,u=null,d=s.getAttachment();if(d instanceof t.RegionAttachment)h=8,u=t.Utils.setArraySize(i,h,0),d.computeWorldVertices(s.bone,u,0,2);else if(d instanceof t.MeshAttachment){let e=d;h=e.worldVerticesLength,u=t.Utils.setArraySize(i,h,0),e.computeWorldVertices(s,0,h,u,0,2)}if(null!=u)for(let t=0,e=u.length;t<e;t+=2){let e=u[t],s=u[t+1];n=Math.min(n,e),r=Math.min(r,s),l=Math.max(l,e),o=Math.max(o,s)}}e.set(n,r),s.set(l-n,o-r)}update(t){this.time+=t}}}(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(null==e)throw new Error("skeleton cannot be null.");let i=this.boundingBoxes,a=this.polygons,n=this.polygonPool,r=e.slots,l=r.length;i.length=0,n.freeAll(a),a.length=0;for(let e=0;e<l;e++){let s=r[e],l=s.getAttachment();if(l instanceof t.BoundingBoxAttachment){let e=l;i.push(e);let r=n.obtain();r.length!=e.worldVerticesLength&&(r=t.Utils.newFloatArray(e.worldVerticesLength)),a.push(r),e.computeWorldVertices(s,0,e.worldVerticesLength,r,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,i=Number.NEGATIVE_INFINITY,a=this.polygons;for(let n=0,r=a.length;n<r;n++){let r=a[n],l=r;for(let a=0,n=r.length;a<n;a+=2){let n=l[a],r=l[a+1];t=Math.min(t,n),e=Math.min(e,r),s=Math.max(s,n),i=Math.max(i,r)}}this.minX=t,this.minY=e,this.maxX=s,this.maxY=i}aabbContainsPoint(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,s,i){let a=this.minX,n=this.minY,r=this.maxX,l=this.maxY;if(t<=a&&s<=a||e<=n&&i<=n||t>=r&&s>=r||e>=l&&i>=l)return!1;let o=(i-e)/(s-t),h=o*(a-t)+e;if(h>n&&h<l)return!0;if(h=o*(r-t)+e,h>n&&h<l)return!0;let u=(n-e)/o+t;return u>a&&u<r||(u=(l-e)/o+t,u>a&&u<r)}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 i=0,a=s.length;i<a;i++)if(this.containsPointPolygon(s[i],t,e))return this.boundingBoxes[i];return null}containsPointPolygon(t,e,s){let i=t,a=t.length,n=a-2,r=!1;for(let t=0;t<a;t+=2){let a=i[t+1],l=i[n+1];if(a<s&&l>=s||l<s&&a>=s){let o=i[t];o+(s-a)/(l-a)*(i[n]-o)<e&&(r=!r)}n=t}return r}intersectsSegment(t,e,s,i){let a=this.polygons;for(let n=0,r=a.length;n<r;n++)if(this.intersectsSegmentPolygon(a[n],t,e,s,i))return this.boundingBoxes[n];return null}intersectsSegmentPolygon(t,e,s,i,a){let n=t,r=t.length,l=e-i,o=s-a,h=e*a-s*i,u=n[r-2],d=n[r-1];for(let t=0;t<r;t+=2){let r=n[t],c=n[t+1],f=u*c-d*r,m=u-r,p=d-c,g=l*p-o*m,x=(h*m-l*f)/g;if((x>=u&&x<=r||x>=r&&x<=u)&&(x>=e&&x<=i||x>=i&&x<=e)){let t=(h*p-o*f)/g;if((t>=d&&t<=c||t>=c&&t<=d)&&(t>=s&&t<=a||t>=a&&t<=s))return!0}u=r,d=c}return!1}getPolygon(t){if(null==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,i){if(null!=this.clipAttachment)return 0;this.clipAttachment=i;let a=i.worldVerticesLength,n=t.Utils.setArraySize(this.clippingPolygon,a);i.computeWorldVertices(s,0,a,n,0,2);let r=this.clippingPolygon;e.makeClockwise(r);let l=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));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){null!=this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()}clipEnd(){null!=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,i,a,n,r,l,o){let h=this.clipOutput,u=this.clippedVertices,d=this.clippedTriangles,c=this.clippingPolygons,f=this.clippingPolygons.length,m=o?12:8,p=0;u.length=0,d.length=0;t:for(let s=0;s<a;s+=3){let a=i[s]<<1,g=e[a],x=e[a+1],M=n[a],w=n[a+1];a=i[s+1]<<1;let E=e[a],T=e[a+1],b=n[a],A=n[a+1];a=i[s+2]<<1;let y=e[a],R=e[a+1],S=n[a],I=n[a+1];for(let e=0;e<f;e++){let s=u.length;if(!this.clip(g,x,E,T,y,R,c[e],h)){let e=t.Utils.setArraySize(u,s+3*m);e[s]=g,e[s+1]=x,e[s+2]=r.r,e[s+3]=r.g,e[s+4]=r.b,e[s+5]=r.a,o?(e[s+6]=M,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]=E,e[s+13]=T,e[s+14]=r.r,e[s+15]=r.g,e[s+16]=r.b,e[s+17]=r.a,e[s+18]=b,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]=y,e[s+25]=R,e[s+26]=r.r,e[s+27]=r.g,e[s+28]=r.b,e[s+29]=r.a,e[s+30]=S,e[s+31]=I,e[s+32]=l.r,e[s+33]=l.g,e[s+34]=l.b,e[s+35]=l.a):(e[s+6]=M,e[s+7]=w,e[s+8]=E,e[s+9]=T,e[s+10]=r.r,e[s+11]=r.g,e[s+12]=r.b,e[s+13]=r.a,e[s+14]=b,e[s+15]=A,e[s+16]=y,e[s+17]=R,e[s+18]=r.r,e[s+19]=r.g,e[s+20]=r.b,e[s+21]=r.a,e[s+22]=S,e[s+23]=I),s=d.length;let i=t.Utils.setArraySize(d,s+3);i[s]=p,i[s+1]=p+1,i[s+2]=p+2,p+=3;continue t}{let e=h.length;if(0==e)continue;let i=T-R,a=y-E,n=g-y,c=R-x,f=1/(i*n+a*(x-R)),P=e>>1,C=this.clipOutput,V=t.Utils.setArraySize(u,s+P*m);for(let t=0;t<e;t+=2){let e=C[t],h=C[t+1];V[s]=e,V[s+1]=h,V[s+2]=r.r,V[s+3]=r.g,V[s+4]=r.b,V[s+5]=r.a;let u=e-y,d=h-R,p=(i*u+a*d)*f,g=(c*u+n*d)*f,x=1-p-g;V[s+6]=M*p+b*g+S*x,V[s+7]=w*p+A*g+I*x,o&&(V[s+8]=l.r,V[s+9]=l.g,V[s+10]=l.b,V[s+11]=l.a),s+=m}s=d.length;let k=t.Utils.setArraySize(d,s+3*(P-2));P--;for(let t=1;t<P;t++)k[s]=p,k[s+1]=p+t,k[s+2]=p+t+1,s+=3;p+=P+1}}}}clip(t,e,s,i,a,n,r,l){let o=l,h=!1,u=null;r.length%4>=2?(u=l,l=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(s),u.push(i),u.push(a),u.push(n),u.push(t),u.push(e),l.length=0;let d=r,c=r.length-4;for(let t=0;;t+=2){let e=d[t],s=d[t+1],i=d[t+2],a=d[t+3],n=e-i,r=s-a,f=u,m=u.length-2,p=l.length;for(let t=0;t<m;t+=2){let o=f[t],u=f[t+1],d=f[t+2],c=f[t+3],m=n*(c-a)-r*(d-i)>0;if(n*(u-a)-r*(o-i)>0){if(m){l.push(d),l.push(c);continue}let t=c-u,n=d-o,r=t*(i-e)-n*(a-s);if(Math.abs(r)>1e-6){let h=(n*(s-u)-t*(e-o))/r;l.push(e+(i-e)*h),l.push(s+(a-s)*h)}else l.push(e),l.push(s)}else if(m){let t=c-u,n=d-o,r=t*(i-e)-n*(a-s);if(Math.abs(r)>1e-6){let h=(n*(s-u)-t*(e-o))/r;l.push(e+(i-e)*h),l.push(s+(a-s)*h)}else l.push(e),l.push(s);l.push(d),l.push(c)}h=!0}if(p==l.length)return o.length=0,!0;if(l.push(l[0]),l.push(l[1]),t==c)break;let g=l;(l=u).length=0,u=g}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,i=e[s-2]*e[1]-e[0]*e[s-1],a=0,n=0,r=0,l=0;for(let t=0,o=s-3;t<o;t+=2)a=e[t],n=e[t+1],r=e[t+2],l=e[t+3],i+=a*l-r*n;if(!(i<0))for(let t=0,i=s-2,a=s>>1;t<a;t+=2){let s=e[t],a=e[t+1],n=i-t;e[t]=e[n],e[t+1]=e[n+1],e[n]=s,e[n+1]=a}}}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(null==t)throw new Error("boneName cannot be null.");let e=this.bones;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findBoneIndex(t){if(null==t)throw new Error("boneName cannot be null.");let e=this.bones;for(let s=0,i=e.length;s<i;s++)if(e[s].name==t)return s;return-1}findSlot(t){if(null==t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findSlotIndex(t){if(null==t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,i=e.length;s<i;s++)if(e[s].name==t)return s;return-1}findSkin(t){if(null==t)throw new Error("skinName cannot be null.");let e=this.skins;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findEvent(t){if(null==t)throw new Error("eventDataName cannot be null.");let e=this.events;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findAnimation(t){if(null==t)throw new Error("animationName cannot be null.");let e=this.animations;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findIkConstraint(t){if(null==t)throw new Error("constraintName cannot be null.");let e=this.ikConstraints;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findTransformConstraint(t){if(null==t)throw new Error("constraintName cannot be null.");let e=this.transformConstraints;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findPathConstraint(t){if(null==t)throw new Error("constraintName cannot be null.");let e=this.pathConstraints;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findPathConstraintIndex(t){if(null==t)throw new Error("pathConstraintName cannot be null.");let e=this.pathConstraints;for(let s=0,i=e.length;s<i;s++)if(e[s].name==t)return s;return-1}}}(spine||(spine={})),function(t){class e{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(s){let i=this.scale,a=new t.SkeletonData,n="string"==typeof s?JSON.parse(s):s,r=n.skeleton;if(null!=r&&(a.hash=r.hash,a.version=r.spine,a.width=r.width,a.height=r.height,a.fps=r.fps,a.imagesPath=r.images),n.bones)for(let s=0;s<n.bones.length;s++){let r=n.bones[s],l=null,o=this.getValue(r,"parent",null);if(null!=o&&(l=a.findBone(o),null==l))throw new Error("Parent bone not found: "+o);let h=new t.BoneData(a.bones.length,r.name,l);h.length=this.getValue(r,"length",0)*i,h.x=this.getValue(r,"x",0)*i,h.y=this.getValue(r,"y",0)*i,h.rotation=this.getValue(r,"rotation",0),h.scaleX=this.getValue(r,"scaleX",1),h.scaleY=this.getValue(r,"scaleY",1),h.shearX=this.getValue(r,"shearX",0),h.shearY=this.getValue(r,"shearY",0),h.transformMode=e.transformModeFromString(this.getValue(r,"transform","normal")),a.bones.push(h)}if(n.slots)for(let s=0;s<n.slots.length;s++){let i=n.slots[s],r=i.name,l=i.bone,o=a.findBone(l);if(null==o)throw new Error("Slot bone not found: "+l);let h=new t.SlotData(a.slots.length,r,o),u=this.getValue(i,"color",null);null!=u&&h.color.setFromString(u);let d=this.getValue(i,"dark",null);null!=d&&(h.darkColor=new t.Color(1,1,1,1),h.darkColor.setFromString(d)),h.attachmentName=this.getValue(i,"attachment",null),h.blendMode=e.blendModeFromString(this.getValue(i,"blend","normal")),a.slots.push(h)}if(n.ik)for(let e=0;e<n.ik.length;e++){let s=n.ik[e],i=new t.IkConstraintData(s.name);i.order=this.getValue(s,"order",0);for(let t=0;t<s.bones.length;t++){let e=s.bones[t],n=a.findBone(e);if(null==n)throw new Error("IK bone not found: "+e);i.bones.push(n)}let r=s.target;if(i.target=a.findBone(r),null==i.target)throw new Error("IK target bone not found: "+r);i.mix=this.getValue(s,"mix",1),i.bendDirection=this.getValue(s,"bendPositive",!0)?1:-1,i.compress=this.getValue(s,"compress",!1),i.stretch=this.getValue(s,"stretch",!1),i.uniform=this.getValue(s,"uniform",!1),a.ikConstraints.push(i)}if(n.transform)for(let e=0;e<n.transform.length;e++){let s=n.transform[e],r=new t.TransformConstraintData(s.name);r.order=this.getValue(s,"order",0);for(let t=0;t<s.bones.length;t++){let e=s.bones[t],i=a.findBone(e);if(null==i)throw new Error("Transform constraint bone not found: "+e);r.bones.push(i)}let l=s.target;if(r.target=a.findBone(l),null==r.target)throw new Error("Transform constraint target bone not found: "+l);r.local=this.getValue(s,"local",!1),r.relative=this.getValue(s,"relative",!1),r.offsetRotation=this.getValue(s,"rotation",0),r.offsetX=this.getValue(s,"x",0)*i,r.offsetY=this.getValue(s,"y",0)*i,r.offsetScaleX=this.getValue(s,"scaleX",0),r.offsetScaleY=this.getValue(s,"scaleY",0),r.offsetShearY=this.getValue(s,"shearY",0),r.rotateMix=this.getValue(s,"rotateMix",1),r.translateMix=this.getValue(s,"translateMix",1),r.scaleMix=this.getValue(s,"scaleMix",1),r.shearMix=this.getValue(s,"shearMix",1),a.transformConstraints.push(r)}if(n.path)for(let s=0;s<n.path.length;s++){let r=n.path[s],l=new t.PathConstraintData(r.name);l.order=this.getValue(r,"order",0);for(let t=0;t<r.bones.length;t++){let e=r.bones[t],s=a.findBone(e);if(null==s)throw new Error("Transform constraint bone not found: "+e);l.bones.push(s)}let o=r.target;if(l.target=a.findSlot(o),null==l.target)throw new Error("Path target slot not found: "+o);l.positionMode=e.positionModeFromString(this.getValue(r,"positionMode","percent")),l.spacingMode=e.spacingModeFromString(this.getValue(r,"spacingMode","length")),l.rotateMode=e.rotateModeFromString(this.getValue(r,"rotateMode","tangent")),l.offsetRotation=this.getValue(r,"rotation",0),l.position=this.getValue(r,"position",0),l.positionMode==t.PositionMode.Fixed&&(l.position*=i),l.spacing=this.getValue(r,"spacing",0),l.spacingMode!=t.SpacingMode.Length&&l.spacingMode!=t.SpacingMode.Fixed||(l.spacing*=i),l.rotateMix=this.getValue(r,"rotateMix",1),l.translateMix=this.getValue(r,"translateMix",1),a.pathConstraints.push(l)}if(n.skins)for(let e in n.skins){let s=n.skins[e],i=new t.Skin(e);for(let t in s){let e=a.findSlotIndex(t);if(-1==e)throw new Error("Slot not found: "+t);let n=s[t];for(let t in n){let s=this.readAttachment(n[t],i,e,t,a);null!=s&&i.addAttachment(e,t,s)}}a.skins.push(i),"default"==i.name&&(a.defaultSkin=i)}for(let t=0,e=this.linkedMeshes.length;t<e;t++){let e=this.linkedMeshes[t],s=null==e.skin?a.defaultSkin:a.findSkin(e.skin);if(null==s)throw new Error("Skin not found: "+e.skin);let i=s.getAttachment(e.slotIndex,e.parent);if(null==i)throw new Error("Parent mesh not found: "+e.parent);e.mesh.setParentMesh(i),e.mesh.updateUVs()}if(this.linkedMeshes.length=0,n.events)for(let e in n.events){let s=n.events[e],i=new t.EventData(e);i.intValue=this.getValue(s,"int",0),i.floatValue=this.getValue(s,"float",0),i.stringValue=this.getValue(s,"string",""),i.audioPath=this.getValue(s,"audio",null),null!=i.audioPath&&(i.volume=this.getValue(s,"volume",1),i.balance=this.getValue(s,"balance",0)),a.events.push(i)}if(n.animations)for(let t in n.animations){let e=n.animations[t];this.readAnimation(e,t,a)}return a}readAttachment(e,i,a,n,r){let l=this.scale;switch(n=this.getValue(e,"name",n),this.getValue(e,"type","region")){case"region":{let t=this.getValue(e,"path",n),s=this.attachmentLoader.newRegionAttachment(i,n,t);if(null==s)return null;s.path=t,s.x=this.getValue(e,"x",0)*l,s.y=this.getValue(e,"y",0)*l,s.scaleX=this.getValue(e,"scaleX",1),s.scaleY=this.getValue(e,"scaleY",1),s.rotation=this.getValue(e,"rotation",0),s.width=e.width*l,s.height=e.height*l;let a=this.getValue(e,"color",null);return null!=a&&s.color.setFromString(a),s.updateOffset(),s}case"boundingbox":{let t=this.attachmentLoader.newBoundingBoxAttachment(i,n);if(null==t)return null;this.readVertices(e,t,e.vertexCount<<1);let s=this.getValue(e,"color",null);return null!=s&&t.color.setFromString(s),t}case"mesh":case"linkedmesh":{let t=this.getValue(e,"path",n),r=this.attachmentLoader.newMeshAttachment(i,n,t);if(null==r)return null;r.path=t;let l=this.getValue(e,"color",null);null!=l&&r.color.setFromString(l);let o=this.getValue(e,"parent",null);if(null!=o)return r.inheritDeform=this.getValue(e,"deform",!0),this.linkedMeshes.push(new s(r,this.getValue(e,"skin",null),a,o)),r;let h=e.uvs;return this.readVertices(e,r,h.length),r.triangles=e.triangles,r.regionUVs=h,r.updateUVs(),r.hullLength=2*this.getValue(e,"hull",0),r}case"path":{let s=this.attachmentLoader.newPathAttachment(i,n);if(null==s)return null;s.closed=this.getValue(e,"closed",!1),s.constantSpeed=this.getValue(e,"constantSpeed",!0);let a=e.vertexCount;this.readVertices(e,s,a<<1);let r=t.Utils.newArray(a/3,0);for(let t=0;t<e.lengths.length;t++)r[t]=e.lengths[t]*l;s.lengths=r;let o=this.getValue(e,"color",null);return null!=o&&s.color.setFromString(o),s}case"point":{let t=this.attachmentLoader.newPointAttachment(i,n);if(null==t)return null;t.x=this.getValue(e,"x",0)*l,t.y=this.getValue(e,"y",0)*l,t.rotation=this.getValue(e,"rotation",0);let s=this.getValue(e,"color",null);return null!=s&&t.color.setFromString(s),t}case"clipping":{let t=this.attachmentLoader.newClippingAttachment(i,n);if(null==t)return null;let s=this.getValue(e,"end",null);if(null!=s){let e=r.findSlot(s);if(null==e)throw new Error("Clipping end slot not found: "+s);t.endSlot=e}let a=e.vertexCount;this.readVertices(e,t,a<<1);let l=this.getValue(e,"color",null);return null!=l&&t.color.setFromString(l),t}}return null}readVertices(e,s,i){let a=this.scale;s.worldVerticesLength=i;let n=e.vertices;if(i==n.length){let e=t.Utils.toFloatArray(n);if(1!=a)for(let t=0,s=n.length;t<s;t++)e[t]*=a;return void(s.vertices=e)}let r=new Array,l=new Array;for(let t=0,e=n.length;t<e;){let e=n[t++];l.push(e);for(let s=t+4*e;t<s;t+=4)l.push(n[t]),r.push(n[t+1]*a),r.push(n[t+2]*a),r.push(n[t+3])}s.bones=l,s.vertices=t.Utils.toFloatArray(r)}readAnimation(e,s,i){let a=this.scale,n=new Array,r=0;if(e.slots)for(let s in e.slots){let a=e.slots[s],l=i.findSlotIndex(s);if(-1==l)throw new Error("Slot not found: "+s);for(let e in a){let i=a[e];if("attachment"==e){let e=new t.AttachmentTimeline(i.length);e.slotIndex=l;let s=0;for(let t=0;t<i.length;t++){let a=i[t];e.setFrame(s++,a.time,a.name)}n.push(e),r=Math.max(r,e.frames[e.getFrameCount()-1])}else if("color"==e){let e=new t.ColorTimeline(i.length);e.slotIndex=l;let s=0;for(let a=0;a<i.length;a++){let n=i[a],r=new t.Color;r.setFromString(n.color),e.setFrame(s,n.time,r.r,r.g,r.b,r.a),this.readCurve(n,e,s),s++}n.push(e),r=Math.max(r,e.frames[(e.getFrameCount()-1)*t.ColorTimeline.ENTRIES])}else{if("twoColor"!=e)throw new Error("Invalid timeline type for a slot: "+e+" ("+s+")");{let e=new t.TwoColorTimeline(i.length);e.slotIndex=l;let s=0;for(let a=0;a<i.length;a++){let n=i[a],r=new t.Color,l=new t.Color;r.setFromString(n.light),l.setFromString(n.dark),e.setFrame(s,n.time,r.r,r.g,r.b,r.a,l.r,l.g,l.b),this.readCurve(n,e,s),s++}n.push(e),r=Math.max(r,e.frames[(e.getFrameCount()-1)*t.TwoColorTimeline.ENTRIES])}}}}if(e.bones)for(let s in e.bones){let l=e.bones[s],o=i.findBoneIndex(s);if(-1==o)throw new Error("Bone not found: "+s);for(let e in l){let i=l[e];if("rotate"===e){let e=new t.RotateTimeline(i.length);e.boneIndex=o;let s=0;for(let t=0;t<i.length;t++){let a=i[t];e.setFrame(s,a.time,a.angle),this.readCurve(a,e,s),s++}n.push(e),r=Math.max(r,e.frames[(e.getFrameCount()-1)*t.RotateTimeline.ENTRIES])}else{if("translate"!==e&&"scale"!==e&&"shear"!==e)throw new Error("Invalid timeline type for a bone: "+e+" ("+s+")");{let s=null,l=1;"scale"===e?s=new t.ScaleTimeline(i.length):"shear"===e?s=new t.ShearTimeline(i.length):(s=new t.TranslateTimeline(i.length),l=a),s.boneIndex=o;let h=0;for(let t=0;t<i.length;t++){let e=i[t],a=this.getValue(e,"x",0),n=this.getValue(e,"y",0);s.setFrame(h,e.time,a*l,n*l),this.readCurve(e,s,h),h++}n.push(s),r=Math.max(r,s.frames[(s.getFrameCount()-1)*t.TranslateTimeline.ENTRIES])}}}}if(e.ik)for(let s in e.ik){let a=e.ik[s],l=i.findIkConstraint(s),o=new t.IkConstraintTimeline(a.length);o.ikConstraintIndex=i.ikConstraints.indexOf(l);let h=0;for(let t=0;t<a.length;t++){let e=a[t];o.setFrame(h,e.time,this.getValue(e,"mix",1),this.getValue(e,"bendPositive",!0)?1:-1,this.getValue(e,"compress",!1),this.getValue(e,"stretch",!1)),this.readCurve(e,o,h),h++}n.push(o),r=Math.max(r,o.frames[(o.getFrameCount()-1)*t.IkConstraintTimeline.ENTRIES])}if(e.transform)for(let s in e.transform){let a=e.transform[s],l=i.findTransformConstraint(s),o=new t.TransformConstraintTimeline(a.length);o.transformConstraintIndex=i.transformConstraints.indexOf(l);let h=0;for(let t=0;t<a.length;t++){let e=a[t];o.setFrame(h,e.time,this.getValue(e,"rotateMix",1),this.getValue(e,"translateMix",1),this.getValue(e,"scaleMix",1),this.getValue(e,"shearMix",1)),this.readCurve(e,o,h),h++}n.push(o),r=Math.max(r,o.frames[(o.getFrameCount()-1)*t.TransformConstraintTimeline.ENTRIES])}if(e.paths)for(let s in e.paths){let l=e.paths[s],o=i.findPathConstraintIndex(s);if(-1==o)throw new Error("Path constraint not found: "+s);let h=i.pathConstraints[o];for(let e in l){let s=l[e];if("position"===e||"spacing"===e){let i=null,l=1;"spacing"===e?(i=new t.PathConstraintSpacingTimeline(s.length),h.spacingMode!=t.SpacingMode.Length&&h.spacingMode!=t.SpacingMode.Fixed||(l=a)):(i=new t.PathConstraintPositionTimeline(s.length),h.positionMode==t.PositionMode.Fixed&&(l=a)),i.pathConstraintIndex=o;let u=0;for(let t=0;t<s.length;t++){let a=s[t];i.setFrame(u,a.time,this.getValue(a,e,0)*l),this.readCurve(a,i,u),u++}n.push(i),r=Math.max(r,i.frames[(i.getFrameCount()-1)*t.PathConstraintPositionTimeline.ENTRIES])}else if("mix"===e){let e=new t.PathConstraintMixTimeline(s.length);e.pathConstraintIndex=o;let i=0;for(let t=0;t<s.length;t++){let a=s[t];e.setFrame(i,a.time,this.getValue(a,"rotateMix",1),this.getValue(a,"translateMix",1)),this.readCurve(a,e,i),i++}n.push(e),r=Math.max(r,e.frames[(e.getFrameCount()-1)*t.PathConstraintMixTimeline.ENTRIES])}}}if(e.deform)for(let s in e.deform){let l=e.deform[s],o=i.findSkin(s);if(null==o)throw new Error("Skin not found: "+s);for(let e in l){let s=l[e],h=i.findSlotIndex(e);if(-1==h)throw new Error("Slot not found: "+s.name);for(let e in s){let i=s[e],l=o.getAttachment(h,e);if(null==l)throw new Error("Deform attachment not found: "+i.name);let u=null!=l.bones,d=l.vertices,c=u?d.length/3*2:d.length,f=new t.DeformTimeline(i.length);f.slotIndex=h,f.attachment=l;let m=0;for(let e=0;e<i.length;e++){let s,n=i[e],r=this.getValue(n,"vertices",null);if(null==r)s=u?t.Utils.newFloatArray(c):d;else{s=t.Utils.newFloatArray(c);let e=this.getValue(n,"offset",0);if(t.Utils.arrayCopy(r,0,s,e,r.length),1!=a)for(let t=e,i=t+r.length;t<i;t++)s[t]*=a;if(!u)for(let t=0;t<c;t++)s[t]+=d[t]}f.setFrame(m,n.time,s),this.readCurve(n,f,m),m++}n.push(f),r=Math.max(r,f.frames[f.getFrameCount()-1])}}}let l=e.drawOrder;if(null==l&&(l=e.draworder),null!=l){let e=new t.DrawOrderTimeline(l.length),s=i.slots.length,a=0;for(let n=0;n<l.length;n++){let r=l[n],o=null,h=this.getValue(r,"offsets",null);if(null!=h){o=t.Utils.newArray(s,-1);let e=t.Utils.newArray(s-h.length,0),a=0,n=0;for(let t=0;t<h.length;t++){let s=h[t],r=i.findSlotIndex(s.slot);if(-1==r)throw new Error("Slot not found: "+s.slot);for(;a!=r;)e[n++]=a++;o[a+s.offset]=a++}for(;a<s;)e[n++]=a++;for(let t=s-1;t>=0;t--)-1==o[t]&&(o[t]=e[--n])}e.setFrame(a++,r.time,o)}n.push(e),r=Math.max(r,e.frames[e.getFrameCount()-1])}if(e.events){let s=new t.EventTimeline(e.events.length),a=0;for(let n=0;n<e.events.length;n++){let r=e.events[n],l=i.findEvent(r.name);if(null==l)throw new Error("Event not found: "+r.name);let o=new t.Event(t.Utils.toSinglePrecision(r.time),l);o.intValue=this.getValue(r,"int",l.intValue),o.floatValue=this.getValue(r,"float",l.floatValue),o.stringValue=this.getValue(r,"string",l.stringValue),null!=o.data.audioPath&&(o.volume=this.getValue(r,"volume",1),o.balance=this.getValue(r,"balance",0)),s.setFrame(a++,o)}n.push(s),r=Math.max(r,s.frames[s.getFrameCount()-1])}if(isNaN(r))throw new Error("Error while parsing animation, duration is NaN");i.animations.push(new t.Animation(s,n,r))}readCurve(t,e,s){if(t.curve)if("stepped"===t.curve)e.setStepped(s);else if("[object Array]"===Object.prototype.toString.call(t.curve)){let i=t.curve;e.setCurve(s,i[0],i[1],i[2],i[3])}}getValue(t,e,s){return void 0!==t[e]?t[e]:s}static blendModeFromString(e){if("normal"==(e=e.toLowerCase()))return t.BlendMode.Normal;if("additive"==e)return t.BlendMode.Additive;if("multiply"==e)return t.BlendMode.Multiply;if("screen"==e)return t.BlendMode.Screen;throw new Error("Unknown blend mode: "+e)}static positionModeFromString(e){if("fixed"==(e=e.toLowerCase()))return t.PositionMode.Fixed;if("percent"==e)return t.PositionMode.Percent;throw new Error("Unknown position mode: "+e)}static spacingModeFromString(e){if("length"==(e=e.toLowerCase()))return t.SpacingMode.Length;if("fixed"==e)return t.SpacingMode.Fixed;if("percent"==e)return t.SpacingMode.Percent;throw new Error("Unknown position mode: "+e)}static rotateModeFromString(e){if("tangent"==(e=e.toLowerCase()))return t.RotateMode.Tangent;if("chain"==e)return t.RotateMode.Chain;if("chainscale"==e)return t.RotateMode.ChainScale;throw new Error("Unknown rotate mode: "+e)}static transformModeFromString(e){if("normal"==(e=e.toLowerCase()))return t.TransformMode.Normal;if("onlytranslation"==e)return t.TransformMode.OnlyTranslation;if("norotationorreflection"==e)return t.TransformMode.NoRotationOrReflection;if("noscale"==e)return t.TransformMode.NoScale;if("noscaleorreflection"==e)return t.TransformMode.NoScaleOrReflection;throw new Error("Unknown transform mode: "+e)}}t.SkeletonJson=e;class s{constructor(t,e,s,i){this.mesh=t,this.skin=e,this.slotIndex=s,this.parent=i}}}(spine||(spine={})),function(t){t.Skin=class{constructor(t){if(this.attachments=new Array,null==t)throw new Error("name cannot be null.");this.name=t}addAttachment(t,e,s){if(null==s)throw new Error("attachment cannot be null.");let i=this.attachments;t>=i.length&&(i.length=t+1),i[t]||(i[t]={}),i[t][e]=s}getAttachment(t,e){let s=this.attachments[t];return s?s[e]:null}attachAll(t,e){let s=0;for(let i=0;i<t.slots.length;i++){let a=t.slots[i],n=a.getAttachment();if(n&&s<e.attachments.length){let t=e.attachments[s];for(let e in t){if(n==t[e]){let t=this.getAttachment(s,e);null!=t&&a.setAttachment(t);break}}}s++}}}}(spine||(spine={})),function(t){t.Slot=class{constructor(e,s){if(this.attachmentVertices=new Array,null==e)throw new Error("data cannot be null.");if(null==s)throw new Error("bone cannot be null.");this.data=e,this.bone=s,this.color=new t.Color,this.darkColor=null==e.darkColor?null:new t.Color,this.setToSetupPose()}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.attachmentVertices.length=0)}setAttachmentTime(t){this.attachmentTime=this.bone.skeleton.time-t}getAttachmentTime(){return this.bone.skeleton.time-this.attachmentTime}setToSetupPose(){this.color.setFromColor(this.data.color),null!=this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),null==this.data.attachmentName?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))}}}(spine||(spine={})),function(t){t.SlotData=class{constructor(e,s,i){if(this.color=new t.Color(1,1,1,1),e<0)throw new Error("index must be >= 0.");if(null==s)throw new Error("name cannot be null.");if(null==i)throw new Error("boneData cannot be null.");this.index=e,this.name=s,this.boneData=i}}}(spine||(spine={})),function(t){class e{constructor(t){this._image=t}getImage(){return this._image}static filterFromString(t){switch(t.toLowerCase()){case"nearest":return s.Nearest;case"linear":return s.Linear;case"mipmap":return s.MipMap;case"mipmapnearestnearest":return s.MipMapNearestNearest;case"mipmaplinearnearest":return s.MipMapLinearNearest;case"mipmapnearestlinear":return s.MipMapNearestLinear;case"mipmaplinearlinear":return s.MipMapLinearLinear;default:throw new Error("Unknown texture filter "+t)}}static wrapFromString(t){switch(t.toLowerCase()){case"mirroredtepeat":return i.MirroredRepeat;case"clamptoedge":return i.ClampToEdge;case"repeat":return i.Repeat;default:throw new Error("Unknown texture wrap "+t)}}}let s,i;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"}(i=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.rotate=!1,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(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}load(a,n){if(null==n)throw new Error("textureLoader cannot be null.");let r=new e(a),l=new Array(4),o=null;for(;;){let e=r.readLine();if(null==e)break;if(e=e.trim(),0==e.length)o=null;else if(o){let t=new i;t.name=e,t.page=o,t.rotate="true"==r.readValue(),r.readTuple(l);let s=parseInt(l[0]),a=parseInt(l[1]);r.readTuple(l);let n=parseInt(l[0]),h=parseInt(l[1]);t.u=s/o.width,t.v=a/o.height,t.rotate?(t.u2=(s+h)/o.width,t.v2=(a+n)/o.height):(t.u2=(s+n)/o.width,t.v2=(a+h)/o.height),t.x=s,t.y=a,t.width=Math.abs(n),t.height=Math.abs(h),4==r.readTuple(l)&&4==r.readTuple(l)&&r.readTuple(l),t.originalWidth=parseInt(l[0]),t.originalHeight=parseInt(l[1]),r.readTuple(l),t.offsetX=parseInt(l[0]),t.offsetY=parseInt(l[1]),t.index=parseInt(r.readValue()),t.texture=o.texture,this.regions.push(t)}else{o=new s,o.name=e,2==r.readTuple(l)&&(o.width=parseInt(l[0]),o.height=parseInt(l[1]),r.readTuple(l)),r.readTuple(l),o.minFilter=t.Texture.filterFromString(l[0]),o.magFilter=t.Texture.filterFromString(l[1]);let i=r.readValue();o.uWrap=t.TextureWrap.ClampToEdge,o.vWrap=t.TextureWrap.ClampToEdge,"x"==i?o.uWrap=t.TextureWrap.Repeat:"y"==i?o.vWrap=t.TextureWrap.Repeat:"xy"==i&&(o.uWrap=o.vWrap=t.TextureWrap.Repeat),o.texture=n(e),o.texture.setFilters(o.minFilter,o.magFilter),o.texture.setWraps(o.uWrap,o.vWrap),o.width=o.texture.getImage().width,o.height=o.texture.getImage().height,this.pages.push(o)}}}findRegion(t){for(let e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null}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++]}readValue(){let t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()}readTuple(t){let e=this.readLine(),s=e.indexOf(":");if(-1==s)throw new Error("Invalid line: "+e);let i=0,a=s+1;for(;i<3;i++){let s=e.indexOf(",",a);if(-1==s)break;t[i]=e.substr(a,s-a).trim(),a=s+1}return t[i]=e.substring(a).trim(),i+1}}class s{}t.TextureAtlasPage=s;class i extends t.TextureRegion{}t.TextureAtlasRegion=i}(spine||(spine={})),function(t){t.TransformConstraint=class{constructor(e,s){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,null==e)throw new Error("data cannot be null.");if(null==s)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,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)}apply(){this.update()}update(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()}applyAbsoluteWorld(){let e=this.rotateMix,s=this.translateMix,i=this.scaleMix,a=this.shearMix,n=this.target,r=n.a,l=n.b,o=n.c,h=n.d,u=r*h-l*o>0?t.MathUtils.degRad:-t.MathUtils.degRad,d=this.data.offsetRotation*u,c=this.data.offsetShearY*u,f=this.bones;for(let u=0,m=f.length;u<m;u++){let m=f[u],p=!1;if(0!=e){let s=m.a,i=m.b,a=m.c,n=m.d,l=Math.atan2(o,r)-Math.atan2(a,s)+d;l>t.MathUtils.PI?l-=t.MathUtils.PI2:l<-t.MathUtils.PI&&(l+=t.MathUtils.PI2),l*=e;let h=Math.cos(l),u=Math.sin(l);m.a=h*s-u*a,m.b=h*i-u*n,m.c=u*s+h*a,m.d=u*i+h*n,p=!0}if(0!=s){let t=this.temp;n.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),m.worldX+=(t.x-m.worldX)*s,m.worldY+=(t.y-m.worldY)*s,p=!0}if(i>0){let t=Math.sqrt(m.a*m.a+m.c*m.c),e=Math.sqrt(r*r+o*o);t>1e-5&&(t=(t+(e-t+this.data.offsetScaleX)*i)/t),m.a*=t,m.c*=t,t=Math.sqrt(m.b*m.b+m.d*m.d),e=Math.sqrt(l*l+h*h),t>1e-5&&(t=(t+(e-t+this.data.offsetScaleY)*i)/t),m.b*=t,m.d*=t,p=!0}if(a>0){let e=m.b,s=m.d,i=Math.atan2(s,e),n=Math.atan2(h,l)-Math.atan2(o,r)-(i-Math.atan2(m.c,m.a));n>t.MathUtils.PI?n-=t.MathUtils.PI2:n<-t.MathUtils.PI&&(n+=t.MathUtils.PI2),n=i+(n+c)*a;let u=Math.sqrt(e*e+s*s);m.b=Math.cos(n)*u,m.d=Math.sin(n)*u,p=!0}p&&(m.appliedValid=!1)}}applyRelativeWorld(){let e=this.rotateMix,s=this.translateMix,i=this.scaleMix,a=this.shearMix,n=this.target,r=n.a,l=n.b,o=n.c,h=n.d,u=r*h-l*o>0?t.MathUtils.degRad:-t.MathUtils.degRad,d=this.data.offsetRotation*u,c=this.data.offsetShearY*u,f=this.bones;for(let u=0,m=f.length;u<m;u++){let m=f[u],p=!1;if(0!=e){let s=m.a,i=m.b,a=m.c,n=m.d,l=Math.atan2(o,r)+d;l>t.MathUtils.PI?l-=t.MathUtils.PI2:l<-t.MathUtils.PI&&(l+=t.MathUtils.PI2),l*=e;let h=Math.cos(l),u=Math.sin(l);m.a=h*s-u*a,m.b=h*i-u*n,m.c=u*s+h*a,m.d=u*i+h*n,p=!0}if(0!=s){let t=this.temp;n.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),m.worldX+=t.x*s,m.worldY+=t.y*s,p=!0}if(i>0){let t=(Math.sqrt(r*r+o*o)-1+this.data.offsetScaleX)*i+1;m.a*=t,m.c*=t,t=(Math.sqrt(l*l+h*h)-1+this.data.offsetScaleY)*i+1,m.b*=t,m.d*=t,p=!0}if(a>0){let e=Math.atan2(h,l)-Math.atan2(o,r);e>t.MathUtils.PI?e-=t.MathUtils.PI2:e<-t.MathUtils.PI&&(e+=t.MathUtils.PI2);let s=m.b,i=m.d;e=Math.atan2(i,s)+(e-t.MathUtils.PI/2+c)*a;let n=Math.sqrt(s*s+i*i);m.b=Math.cos(e)*n,m.d=Math.sin(e)*n,p=!0}p&&(m.appliedValid=!1)}}applyAbsoluteLocal(){let t=this.rotateMix,e=this.translateMix,s=this.scaleMix,i=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();let n=this.bones;for(let r=0,l=n.length;r<l;r++){let l=n[r];l.appliedValid||l.updateAppliedTransform();let o=l.arotation;if(0!=t){let e=a.arotation-o+this.data.offsetRotation;e-=360*(16384-(16384.499999999996-e/360|0)),o+=e*t}let h=l.ax,u=l.ay;0!=e&&(h+=(a.ax-h+this.data.offsetX)*e,u+=(a.ay-u+this.data.offsetY)*e);let d=l.ascaleX,c=l.ascaleY;0!=s&&(d>1e-5&&(d=(d+(a.ascaleX-d+this.data.offsetScaleX)*s)/d),c>1e-5&&(c=(c+(a.ascaleY-c+this.data.offsetScaleY)*s)/c));let f=l.ashearY;if(0!=i){let t=a.ashearY-f+this.data.offsetShearY;t-=360*(16384-(16384.499999999996-t/360|0)),l.shearY+=t*i}l.updateWorldTransformWith(h,u,o,d,c,l.ashearX,f)}}applyRelativeLocal(){let t=this.rotateMix,e=this.translateMix,s=this.scaleMix,i=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();let n=this.bones;for(let r=0,l=n.length;r<l;r++){let l=n[r];l.appliedValid||l.updateAppliedTransform();let o=l.arotation;0!=t&&(o+=(a.arotation+this.data.offsetRotation)*t);let h=l.ax,u=l.ay;0!=e&&(h+=(a.ax+this.data.offsetX)*e,u+=(a.ay+this.data.offsetY)*e);let d=l.ascaleX,c=l.ascaleY;0!=s&&(d>1e-5&&(d*=(a.ascaleX-1+this.data.offsetScaleX)*s+1),c>1e-5&&(c*=(a.ascaleY-1+this.data.offsetScaleY)*s+1));let f=l.ashearY;0!=i&&(f+=(a.ashearY+this.data.offsetShearY)*i),l.updateWorldTransformWith(h,u,o,d,c,l.ashearX,f)}}getOrder(){return this.data.order}}}(spine||(spine={})),function(t){t.TransformConstraintData=class{constructor(t){if(this.order=0,this.bones=new Array,this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=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,null==t)throw new Error("name cannot be null.");this.name=t}}}(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,i=t.length>>1,a=this.indicesArray;a.length=0;for(let t=0;t<i;t++)a[t]=t;let n=this.isConcaveArray;n.length=0;for(let t=0,r=i;t<r;++t)n[t]=e.isConcave(t,i,s,a);let r=this.triangles;for(r.length=0;i>3;){let t=i-1,l=0,o=1;for(;;){t:if(!n[l]){let r=a[t]<<1,h=a[l]<<1,u=a[o]<<1,d=s[r],c=s[r+1],f=s[h],m=s[h+1],p=s[u],g=s[u+1];for(let r=(o+1)%i;r!=t;r=(r+1)%i){if(!n[r])continue;let t=a[r]<<1,i=s[t],l=s[t+1];if(e.positiveArea(p,g,d,c,i,l)&&e.positiveArea(d,c,f,m,i,l)&&e.positiveArea(f,m,p,g,i,l))break t}break}if(0==o){do{if(!n[l])break;l--}while(l>0);break}t=l,l=o,o=(o+1)%i}r.push(a[(i+l-1)%i]),r.push(a[l]),r.push(a[(l+1)%i]),a.splice(l,1),n.splice(l,1),i--;let h=(i+l-1)%i,u=l==i?0:l;n[h]=e.isConcave(h,i,s,a),n[u]=e.isConcave(u,i,s,a)}return 3==i&&(r.push(a[2]),r.push(a[0]),r.push(a[1])),r}decompose(t,s){let i=t,a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;let n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;let r=this.polygonIndicesPool.obtain();r.length=0;let l=this.polygonPool.obtain();l.length=0;let o=-1,h=0;for(let t=0,u=s.length;t<u;t+=3){let u=s[t]<<1,d=s[t+1]<<1,c=s[t+2]<<1,f=i[u],m=i[u+1],p=i[d],g=i[d+1],x=i[c],M=i[c+1],w=!1;if(o==u){let t=l.length-4,s=e.winding(l[t],l[t+1],l[t+2],l[t+3],x,M),i=e.winding(x,M,l[0],l[1],l[2],l[3]);s==h&&i==h&&(l.push(x),l.push(M),r.push(c),w=!0)}w||(l.length>0?(a.push(l),n.push(r)):(this.polygonPool.free(l),this.polygonIndicesPool.free(r)),l=this.polygonPool.obtain(),l.length=0,l.push(f),l.push(m),l.push(p),l.push(g),l.push(x),l.push(M),r=this.polygonIndicesPool.obtain(),r.length=0,r.push(u),r.push(d),r.push(c),h=e.winding(f,m,p,g,x,M),o=u)}l.length>0&&(a.push(l),n.push(r));for(let t=0,s=a.length;t<s;t++){if(r=n[t],0==r.length)continue;let i=r[0],o=r[r.length-1];l=a[t];let h=l.length-4,u=l[h],d=l[h+1],c=l[h+2],f=l[h+3],m=l[0],p=l[1],g=l[2],x=l[3],M=e.winding(u,d,c,f,m,p);for(let h=0;h<s;h++){if(h==t)continue;let s=n[h];if(3!=s.length)continue;let w=s[0],E=s[1],T=s[2],b=a[h],A=b[b.length-2],y=b[b.length-1];if(w!=i||E!=o)continue;let R=e.winding(u,d,c,f,A,y),S=e.winding(A,y,m,p,g,x);R==M&&S==M&&(b.length=0,s.length=0,l.push(A),l.push(y),r.push(T),u=c,d=f,c=A,f=y,h=0)}}for(let t=a.length-1;t>=0;t--)l=a[t],0==l.length&&(a.splice(t,1),this.polygonPool.free(l),r=n[t],n.splice(t,1),this.polygonIndicesPool.free(r));return a}static isConcave(t,e,s,i){let a=i[(e+t-1)%e]<<1,n=i[t]<<1,r=i[(t+1)%e]<<1;return!this.positiveArea(s[a],s[a+1],s[n],s[n+1],s[r],s[r+1])}static positiveArea(t,e,s,i,a,n){return t*(n-i)+s*(e-n)+a*(i-e)>=0}static winding(t,e,s,i,a,n){let r=s-t,l=i-e;return a*l-n*r+r*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}};class e{constructor(t=0,e=0,s=0,i=0){this.r=t,this.g=e,this.b=s,this.a=i}set(t,e,s,i){return this.r=t,this.g=e,this.b=s,this.a=i,this.clamp(),this}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?255:parseInt(t.substr(6,2),16))/255,this}add(t,e,s,i){return this.r+=t,this.g+=e,this.b+=s,this.a+=i,this.clamp(),this}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}}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 i=Math.random(),a=e-t;return i<=(s-t)/a?t+Math.sqrt(i*a*(s-t)):e-Math.sqrt((1-i)*a*(e-s))}}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 i{apply(t,e,s){return t+(e-t)*this.applyInternal(s)}}t.Interpolation=i;class a extends i{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=a;t.PowOut=class extends a{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}};class n{static arrayCopy(t,e,s,i,a){for(let n=e,r=i;n<e+a;n++,r++)s[r]=t[n]}static setArraySize(t,e,s=0){let i=t.length;if(i==e)return t;if(t.length=e,i<e)for(let a=i;a<e;a++)t[a]=s;return t}static ensureArrayCapacity(t,e,s=0){return t.length>=e?t:n.setArraySize(t,e,s)}static newArray(t,e){let s=new Array(t);for(let i=0;i<t;i++)s[i]=e;return s}static newFloatArray(t){if(n.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(n.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 n.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return n.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,e){}}n.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array,t.Utils=n;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++)t[e].reset&&t[e].reset(),this.items[e]=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(null==t)throw new Error("name cannot be null.");this.name=t}}t.Attachment=e;class s extends e{constructor(t){super(t),this.id=(65535&s.nextID++)<<11,this.worldVerticesLength=0}computeWorldVertices(t,e,s,i,a,n){s=a+(s>>1)*n;let r=t.bone.skeleton,l=t.attachmentVertices,o=this.vertices,h=this.bones;if(null==h){l.length>0&&(o=l);let r=t.bone,h=r.worldX,u=r.worldY,d=r.a,c=r.b,f=r.c,m=r.d;for(let t=e,r=a;r<s;t+=2,r+=n){let e=o[t],s=o[t+1];i[r]=e*d+s*c+h,i[r+1]=e*f+s*m+u}return}let u=0,d=0;for(let t=0;t<e;t+=2){let t=h[u];u+=t+1,d+=t}let c=r.bones;if(0==l.length)for(let t=a,e=3*d;t<s;t+=n){let s=0,a=0,n=h[u++];for(n+=u;u<n;u++,e+=3){let t=c[h[u]],i=o[e],n=o[e+1],r=o[e+2];s+=(i*t.a+n*t.b+t.worldX)*r,a+=(i*t.c+n*t.d+t.worldY)*r}i[t]=s,i[t+1]=a}else{let t=l;for(let e=a,r=3*d,l=d<<1;e<s;e+=n){let s=0,a=0,n=h[u++];for(n+=u;u<n;u++,r+=3,l+=2){let e=c[h[u]],i=o[r]+t[l],n=o[r+1]+t[l+1],d=o[r+2];s+=(i*e.a+n*e.b+e.worldX)*d,a+=(i*e.c+n*e.d+e.worldY)*d}i[e]=s,i[e+1]=a}}}applyDeform(t){return this==t}}s.nextID=0,t.VertexAttachment=s}(spine||(spine={})),function(t){let e;!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"}(e=t.AttachmentType||(t.AttachmentType={}))}(spine||(spine={})),function(t){class e extends t.VertexAttachment{constructor(e){super(e),this.color=new t.Color(1,1,1,1)}}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)}}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.inheritDeform=!1,this.tempColor=new t.Color(0,0,0,0)}updateUVs(){let e=this.regionUVs;null!=this.uvs&&this.uvs.length==e.length||(this.uvs=t.Utils.newFloatArray(e.length));let s=this.uvs,i=0,a=0,n=0,r=0;if(this.region instanceof t.TextureAtlasRegion){let t=this.region,l=t.texture.getImage().width,o=t.texture.getImage().height;if(t.rotate){i=t.u-(t.originalHeight-t.offsetY-t.height)/l,a=t.v-(t.originalWidth-t.offsetX-t.width)/o,n=t.originalHeight/l,r=t.originalWidth/o;for(let t=0,l=s.length;t<l;t+=2)s[t]=i+e[t+1]*n,s[t+1]=a+r-e[t]*r;return}i=t.u-t.offsetX/l,a=t.v-(t.originalHeight-t.offsetY-t.height)/o,n=t.originalWidth/l,r=t.originalHeight/o}else null==this.region?(i=a=0,n=r=1):(i=this.region.u,a=this.region.v,n=this.region.u2-i,r=this.region.v2-a);for(let t=0,l=s.length;t<l;t+=2)s[t]=i+e[t]*n,s[t+1]=a+e[t+1]*r}applyDeform(t){return this==t||this.inheritDeform&&this.parentMesh==t}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,null!=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)}}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)}}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),i=t.MathUtils.sinDeg(this.rotation),a=s*e.a+i*e.b,n=s*e.c+i*e.d;return Math.atan2(n,a)*t.MathUtils.radDeg}}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(){let t=this.width/this.region.originalWidth*this.scaleX,s=this.height/this.region.originalHeight*this.scaleY,i=-this.width/2*this.scaleX+this.region.offsetX*t,a=-this.height/2*this.scaleY+this.region.offsetY*s,n=i+this.region.width*t,r=a+this.region.height*s,l=this.rotation*Math.PI/180,o=Math.cos(l),h=Math.sin(l),u=i*o+this.x,d=i*h,c=a*o+this.y,f=a*h,m=n*o+this.x,p=n*h,g=r*o+this.y,x=r*h,M=this.offset;M[e.OX1]=u-f,M[e.OY1]=c+d,M[e.OX2]=u-x,M[e.OY2]=g+d,M[e.OX3]=m-x,M[e.OY3]=g+p,M[e.OX4]=m-f,M[e.OY4]=c+p}setRegion(t){this.region=t;let e=this.uvs;t.rotate?(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,s,i,a){let n=this.offset,r=t.worldX,l=t.worldY,o=t.a,h=t.b,u=t.c,d=t.d,c=0,f=0;c=n[e.OX1],f=n[e.OY1],s[i]=c*o+f*h+r,s[i+1]=c*u+f*d+l,i+=a,c=n[e.OX2],f=n[e.OY2],s[i]=c*o+f*h+r,s[i+1]=c*u+f*d+l,i+=a,c=n[e.OX3],f=n[e.OY3],s[i]=c*o+f*h+r,s[i+1]=c*u+f*d+l,i+=a,c=n[e.OX4],f=n[e.OY4],s[i]=c*o+f*h+r,s[i+1]=c*u+f*d+l}}e.OX1=0,e.OY1=1,e.OX2=2,e.OY2=3,e.OX3=4,e.OY3=5,e.OX4=6,e.OY4=7,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,i,a){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,i,a,n){let r=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,r,(this.radius-h)/this.radius),i=Math.cos(t),a=Math.sin(t);s.x=i*l-a*o+this.worldX,s.y=a*l+i*o+this.worldY}}end(){}}e.interpolation=new t.PowOut(2),t.SwirlEffect=e}(spine||(spine={})),window.spine=spine;