@esotericsoftware/spine-pixi-v8 4.2.80 → 4.2.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Spine.d.ts +2 -2
- package/dist/Spine.js +4 -3
- package/dist/esm/spine-pixi-v8.min.mjs +4 -4
- package/dist/esm/spine-pixi-v8.mjs +879 -1290
- package/dist/esm/spine-pixi-v8.mjs.map +3 -3
- package/dist/iife/spine-pixi-v8.js +881 -1291
- package/dist/iife/spine-pixi-v8.js.map +3 -3
- package/dist/iife/spine-pixi-v8.min.js +4 -4
- package/dist/require-shim.d.ts +0 -4
- package/dist/require-shim.js +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var spine=(()=>{var je=Object.defineProperty,sr=Object.getOwnPropertyDescriptor,rr=Object.getOwnPropertyNames,ir=Object.prototype.hasOwnProperty,nr=(e,t,s)=>t in e?je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,xe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,s)=>(typeof require<"u"?require:t)[s]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),ar=(e,t)=>{for(var s in t)je(e,s,{get:t[s],enumerable:!0})},or=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of rr(t))!ir.call(e,n)&&n!==s&&je(e,n,{get:()=>t[n],enumerable:!(r=sr(t,n))||r.enumerable});return e},lr=e=>or(je({},"__esModule",{value:!0}),e),R=(e,t,s)=>(nr(e,typeof t!="symbol"?t+"":t,s),s),xs={};if(ar(xs,{AABBRectangleBoundsProvider:()=>di,AlphaTimeline:()=>Ft,Animation:()=>Ke,AnimationState:()=>tt,AnimationStateAdapter:()=>gr,AnimationStateData:()=>Xs,AssetManagerBase:()=>br,AtlasAttachmentLoader:()=>_s,Attachment:()=>xt,AttachmentTimeline:()=>Me,BinaryInput:()=>zs,BlendMode:()=>ht,Bone:()=>ts,BoneData:()=>es,BoundingBoxAttachment:()=>it,CURRENT:()=>Fs,ClippingAttachment:()=>ve,Color:()=>L,ConstraintData:()=>qe,CurveTimeline:()=>fe,CurveTimeline1:()=>oe,CurveTimeline2:()=>Qe,DebugUtils:()=>fr,DeformTimeline:()=>Et,Downloader:()=>Ls,DrawOrderTimeline:()=>Ye,Event:()=>ss,EventData:()=>rs,EventQueue:()=>Ys,EventTimeline:()=>Oe,EventType:()=>re,FIRST:()=>Ht,FakeTexture:()=>pr,HOLD_FIRST:()=>rt,HOLD_MIX:()=>Ps,HOLD_SUBSEQUENT:()=>$t,IkConstraint:()=>Vs,IkConstraintData:()=>is,IkConstraintTimeline:()=>Rt,Inherit:()=>Ue,InheritTimeline:()=>Mt,IntSet:()=>cr,Interpolation:()=>bs,MathUtils:()=>X,MeshAttachment:()=>le,MixBlend:()=>Ss,MixDirection:()=>ks,PathAttachment:()=>Pe,PathConstraint:()=>Re,PathConstraintData:()=>ns,PathConstraintMixTimeline:()=>Vt,PathConstraintPositionTimeline:()=>_t,PathConstraintSpacingTimeline:()=>Lt,Physics:()=>Us,PhysicsConstraintDampingTimeline:()=>Ut,PhysicsConstraintGravityTimeline:()=>zt,PhysicsConstraintInertiaTimeline:()=>Nt,PhysicsConstraintMassTimeline:()=>qt,PhysicsConstraintMixTimeline:()=>Gt,PhysicsConstraintResetTimeline:()=>Ze,PhysicsConstraintStrengthTimeline:()=>Ot,PhysicsConstraintTimeline:()=>we,PhysicsConstraintWindTimeline:()=>Wt,PointAttachment:()=>Zt,Pool:()=>Be,PositionMode:()=>at,Pow:()=>ws,PowOut:()=>dr,RGB2Timeline:()=>Bt,RGBA2Timeline:()=>Xt,RGBATimeline:()=>Yt,RGBTimeline:()=>Pt,RegionAttachment:()=>N,RotateMode:()=>lt,RotateTimeline:()=>Ne,SETUP:()=>jt,SUBSEQUENT:()=>st,ScaleTimeline:()=>Ct,ScaleXTimeline:()=>St,ScaleYTimeline:()=>kt,SequenceTimeline:()=>Ee,SetupPoseBoundsProvider:()=>fi,ShearTimeline:()=>At,ShearXTimeline:()=>Tt,ShearYTimeline:()=>It,Skeleton:()=>Se,SkeletonBinary:()=>Ws,SkeletonBounds:()=>ds,SkeletonClipping:()=>De,SkeletonData:()=>We,SkeletonJson:()=>Gs,Skin:()=>ze,SkinEntry:()=>os,SkinsAndAnimationBoundsProvider:()=>ui,Slot:()=>Ns,SlotData:()=>ls,SpacingMode:()=>ot,Spine:()=>ms,SpineDebugRenderer:()=>mi,SpinePipe:()=>us,SpineTexture:()=>ct,StringSet:()=>pt,Texture:()=>Jt,TextureAtlas:()=>Kt,TextureAtlasPage:()=>Rs,TextureAtlasRegion:()=>Qt,TextureFilter:()=>nt,TextureRegion:()=>Es,TextureWrap:()=>Bs,TimeKeeper:()=>ur,Timeline:()=>J,TrackEntry:()=>Ms,TransformConstraint:()=>Os,TransformConstraintData:()=>hs,TransformConstraintTimeline:()=>Dt,TranslateTimeline:()=>wt,TranslateXTimeline:()=>yt,TranslateYTimeline:()=>vt,Triangulator:()=>ie,Utils:()=>B,Vector2:()=>Ve,VertexAttachment:()=>de,WindowedMean:()=>mr}),typeof window<"u"&&window.PIXI){const e=window.require;window.require=t=>{if(e)return e(t);if(t.startsWith("@pixi/")||t.startsWith("pixi.js"))return window.PIXI}}var Q=xe("pixi.js"),hr=xe("pixi.js"),cr=class{array=new Array;add(e){let t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!=null}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}},pt=class{entries={};size=0;add(e){let t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){let t=this.size;for(var s=0,r=e.length;s<r;s++)this.add(e[s]);return t!=this.size}contains(e){return this.entries[e]}clear(){this.entries={},this.size=0}},Ie=class{constructor(e=0,t=0,s=0,r=0){this.r=e,this.g=t,this.b=s,this.a=r}set(e,t,s,r){return this.r=e,this.g=t,this.b=s,this.a=r,this.clamp()}setFromColor(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}setFromString(e){return e=e.charAt(0)=="#"?e.substr(1):e,this.r=parseInt(e.substr(0,2),16)/255,this.g=parseInt(e.substr(2,2),16)/255,this.b=parseInt(e.substr(4,2),16)/255,this.a=e.length!=8?1:parseInt(e.substr(6,2),16)/255,this}add(e,t,s,r){return this.r+=e,this.g+=t,this.b+=s,this.a+=r,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}toRgb888(){const e=t=>("0"+(t*255).toString(16)).slice(-2);return Number("0x"+e(this.r)+e(this.g)+e(this.b))}static fromString(e){return new Ie().setFromString(e)}},L=Ie;R(L,"WHITE",new Ie(1,1,1,1)),R(L,"RED",new Ie(1,0,0,1)),R(L,"GREEN",new Ie(0,1,0,1)),R(L,"BLUE",new Ie(0,0,1,1)),R(L,"MAGENTA",new Ie(1,0,1,1));var ce=class{static clamp(e,t,s){return e<t?t:e>s?s:e}static cosDeg(e){return Math.cos(e*ce.degRad)}static sinDeg(e){return Math.sin(e*ce.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*ce.degRad}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){let t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return ce.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,s){let r=Math.random(),n=t-e;return r<=(s-e)/n?e+Math.sqrt(r*n*(s-e)):t-Math.sqrt((1-r)*n*(t-s))}static isPowerOfTwo(e){return e&&(e&e-1)===0}},X=ce;R(X,"PI",3.1415927),R(X,"PI2",ce.PI*2),R(X,"invPI2",1/ce.PI2),R(X,"radiansToDegrees",180/ce.PI),R(X,"radDeg",ce.radiansToDegrees),R(X,"degreesToRadians",ce.PI/180),R(X,"degRad",ce.degreesToRadians);var bs=class{apply(e,t,s){return e+(t-e)*this.applyInternal(s)}},ws=class extends bs{power=2;constructor(e){super(),this.power=e}applyInternal(e){return e<=.5?Math.pow(e*2,this.power)/2:Math.pow((e-1)*2,this.power)/(this.power%2==0?-2:2)+1}},dr=class extends ws{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2==0?-1:1)+1}},Xe=class{static arrayCopy(e,t,s,r,n){for(let h=t,a=r;h<t+n;h++,a++)s[a]=e[h]}static arrayFill(e,t,s,r){for(let n=t;n<s;n++)e[n]=r}static setArraySize(e,t,s=0){let r=e.length;if(r==t)return e;if(e.length=t,r<t)for(let n=r;n<t;n++)e[n]=s;return e}static ensureArrayCapacity(e,t,s=0){return e.length>=t?e:Xe.setArraySize(e,t,s)}static newArray(e,t){let s=new Array(e);for(let r=0;r<e;r++)s[r]=t;return s}static newFloatArray(e){if(Xe.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);{let t=new Array(e);for(let s=0;s<t.length;s++)t[s]=0;return t}}static newShortArray(e){if(Xe.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);{let t=new Array(e);for(let s=0;s<t.length;s++)t[s]=0;return t}}static toFloatArray(e){return Xe.SUPPORTS_TYPED_ARRAYS?new Float32Array(e):e}static toSinglePrecision(e){return Xe.SUPPORTS_TYPED_ARRAYS?Math.fround(e):e}static webkit602BugfixHelper(e,t){}static contains(e,t,s=!0){for(var r=0;r<e.length;r++)if(e[r]==t)return!0;return!1}static enumValue(e,t){return e[t[0].toUpperCase()+t.slice(1)]}},B=Xe;R(B,"SUPPORTS_TYPED_ARRAYS",typeof Float32Array<"u");var fr=class{static logBones(e){for(let t=0;t<e.bones.length;t++){let s=e.bones[t];console.log(s.data.name+", "+s.a+", "+s.b+", "+s.c+", "+s.d+", "+s.worldX+", "+s.worldY)}}},Be=class{items=new Array;instantiator;constructor(e){this.instantiator=e}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(e){e.reset&&e.reset(),this.items.push(e)}freeAll(e){for(let t=0;t<e.length;t++)this.free(e[t])}clear(){this.items.length=0}},Ve=class{constructor(e=0,t=0){this.x=e,this.y=t}set(e,t){return this.x=e,this.y=t,this}length(){let e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}normalize(){let e=this.length();return e!=0&&(this.x/=e,this.y/=e),this}},ur=class{maxDelta=.064;framesPerSecond=0;delta=0;totalTime=0;lastTime=Date.now()/1e3;frameCount=0;frameTime=0;update(){let e=Date.now()/1e3;this.delta=e-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},mr=class{values;addedValues=0;lastValue=0;mean=0;dirty=!0;constructor(e=32){this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=e,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t<this.values.length;t++)e+=this.values[t];this.mean=e/this.values.length,this.dirty=!1}return this.mean}return 0}},xt=class{name;constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}},ys=class extends xt{id=ys.nextID++;bones=null;vertices=[];worldVerticesLength=0;timelineAttachment=this;constructor(e){super(e)}computeWorldVertices(e,t,s,r,n,h){s=n+(s>>1)*h;let a=e.bone.skeleton,i=e.deform,l=this.vertices,o=this.bones;if(!o){i.length>0&&(l=i);let u=e.bone,m=u.worldX,p=u.worldY,w=u.a,b=u.b,g=u.c,x=u.d;for(let v=t,y=n;y<s;v+=2,y+=h){let C=l[v],S=l[v+1];r[y]=C*w+S*b+m,r[y+1]=C*g+S*x+p}return}let c=0,d=0;for(let u=0;u<t;u+=2){let m=o[c];c+=m+1,d+=m}let f=a.bones;if(i.length==0)for(let u=n,m=d*3;u<s;u+=h){let p=0,w=0,b=o[c++];for(b+=c;c<b;c++,m+=3){let g=f[o[c]],x=l[m],v=l[m+1],y=l[m+2];p+=(x*g.a+v*g.b+g.worldX)*y,w+=(x*g.c+v*g.d+g.worldY)*y}r[u]=p,r[u+1]=w}else{let u=i;for(let m=n,p=d*3,w=d<<1;m<s;m+=h){let b=0,g=0,x=o[c++];for(x+=c;c<x;c++,p+=3,w+=2){let v=f[o[c]],y=l[p]+u[w],C=l[p+1]+u[w+1],S=l[p+2];b+=(y*v.a+C*v.b+v.worldX)*S,g+=(y*v.c+C*v.d+v.worldY)*S}r[m]=b,r[m+1]=g}}}copyTo(e){this.bones?(e.bones=new Array(this.bones.length),B.arrayCopy(this.bones,0,e.bones,0,this.bones.length)):e.bones=null,this.vertices&&(e.vertices=B.newFloatArray(this.vertices.length),B.arrayCopy(this.vertices,0,e.vertices,0,this.vertices.length)),e.worldVerticesLength=this.worldVerticesLength,e.timelineAttachment=this.timelineAttachment}},de=ys;R(de,"nextID",0);var Je=class{id=Je.nextID();regions;start=0;digits=0;setupIndex=0;constructor(e){this.regions=new Array(e)}copy(){let e=new Je(this.regions.length);return B.arrayCopy(this.regions,0,e.regions,0,this.regions.length),e.start=this.start,e.digits=this.digits,e.setupIndex=this.setupIndex,e}apply(e,t){let s=e.sequenceIndex;s==-1&&(s=this.setupIndex),s>=this.regions.length&&(s=this.regions.length-1);let r=this.regions[s];t.region!=r&&(t.region=r,t.updateRegion())}getPath(e,t){let s=e,r=(this.start+t).toString();for(let n=this.digits-r.length;n>0;n--)s+="0";return s+=r,s}static nextID(){return Je._nextID++}},bt=Je;R(bt,"_nextID",0);var vs=(e=>(e[e.hold=0]="hold",e[e.once=1]="once",e[e.loop=2]="loop",e[e.pingpong=3]="pingpong",e[e.onceReverse=4]="onceReverse",e[e.loopReverse=5]="loopReverse",e[e.pingpongReverse=6]="pingpongReverse",e))(vs||{}),Cs=[0,1,2,3,4,5,6],Ke=class{name;timelines=[];timelineIds=new pt;duration;constructor(e,t,s){if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=s}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds.clear();for(var t=0;t<e.length;t++)this.timelineIds.addAll(e[t].getPropertyIds())}hasTimeline(e){for(let t=0;t<e.length;t++)if(this.timelineIds.contains(e[t]))return!0;return!1}apply(e,t,s,r,n,h,a,i){if(!e)throw new Error("skeleton cannot be null.");r&&this.duration!=0&&(s%=this.duration,t>0&&(t%=this.duration));let l=this.timelines;for(let o=0,c=l.length;o<c;o++)l[o].apply(e,t,s,n,h,a,i)}},Ss=(e=>(e[e.setup=0]="setup",e[e.first=1]="first",e[e.replace=2]="replace",e[e.add=3]="add",e))(Ss||{}),ks=(e=>(e[e.mixIn=0]="mixIn",e[e.mixOut=1]="mixOut",e))(ks||{}),O={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,inherit:7,rgb:8,alpha:9,rgb2:10,attachment:11,deform:12,event:13,drawOrder:14,ikConstraint:15,transformConstraint:16,pathConstraintPosition:17,pathConstraintSpacing:18,pathConstraintMix:19,physicsConstraintInertia:20,physicsConstraintStrength:21,physicsConstraintDamping:22,physicsConstraintMass:23,physicsConstraintWind:24,physicsConstraintGravity:25,physicsConstraintMix:26,physicsConstraintReset:27,sequence:28},J=class{propertyIds;frames;constructor(e,t){this.propertyIds=t,this.frames=B.newFloatArray(e*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(e,t){let s=e.length;for(let r=1;r<s;r++)if(e[r]>t)return r-1;return s-1}static search(e,t,s){let r=e.length;for(let n=s;n<r;n+=s)if(e[n]>t)return n-s;return r-s}},fe=class extends J{curves;constructor(e,t,s){super(e,s),this.curves=B.newFloatArray(e+t*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){let t=this.getFrameCount()+e*18;if(this.curves.length>t){let s=B.newFloatArray(t);B.arrayCopy(this.curves,0,s,0,t),this.curves=s}}setBezier(e,t,s,r,n,h,a,i,l,o,c){let d=this.curves,f=this.getFrameCount()+e*18;s==0&&(d[t]=2+f);let u=(r-h*2+i)*.03,m=(n-a*2+l)*.03,p=((h-i)*3-r+o)*.006,w=((a-l)*3-n+c)*.006,b=u*2+p,g=m*2+w,x=(h-r)*.3+u+p*.16666667,v=(a-n)*.3+m+w*.16666667,y=r+x,C=n+v;for(let S=f+18;f<S;f+=2)d[f]=y,d[f+1]=C,x+=b,v+=g,b+=p,g+=w,y+=x,C+=v}getBezierValue(e,t,s,r){let n=this.curves;if(n[r]>e){let l=this.frames[t],o=this.frames[t+s];return o+(e-l)/(n[r]-l)*(n[r+1]-o)}let h=r+18;for(r+=2;r<h;r+=2)if(n[r]>=e){let l=n[r-2],o=n[r-1];return o+(e-l)/(n[r]-l)*(n[r+1]-o)}t+=this.getFrameEntries();let a=n[h-2],i=n[h-1];return i+(e-a)/(this.frames[t]-a)*(this.frames[t+s]-i)}},oe=class extends fe{constructor(e,t,s){super(e,t,[s])}getFrameEntries(){return 2}setFrame(e,t,s){e<<=1,this.frames[e]=t,this.frames[e+1]=s}getCurveValue(e){let t=this.frames,s=t.length-2;for(let n=2;n<=s;n+=2)if(t[n]>e){s=n-2;break}let r=this.curves[s>>1];switch(r){case 0:let n=t[s],h=t[s+1];return h+(e-n)/(t[s+2]-n)*(t[s+2+1]-h);case 1:return t[s+1]}return this.getBezierValue(e,s,1,r-2)}getRelativeValue(e,t,s,r,n){if(e<this.frames[0]){switch(s){case 0:return n;case 1:return r+(n-r)*t}return r}let h=this.getCurveValue(e);switch(s){case 0:return n+h*t;case 1:case 2:h+=n-r}return r+h*t}getAbsoluteValue(e,t,s,r,n){if(e<this.frames[0]){switch(s){case 0:return n;case 1:return r+(n-r)*t}return r}let h=this.getCurveValue(e);return s==0?n+(h-n)*t:r+(h-r)*t}getAbsoluteValue2(e,t,s,r,n,h){if(e<this.frames[0]){switch(s){case 0:return n;case 1:return r+(n-r)*t}return r}return s==0?n+(h-n)*t:r+(h-r)*t}getScaleValue(e,t,s,r,n,h){const a=this.frames;if(e<a[0]){switch(s){case 0:return h;case 1:return n+(h-n)*t}return n}let i=this.getCurveValue(e)*h;if(t==1)return s==3?n+i-h:i;if(r==1)switch(s){case 0:return h+(Math.abs(i)*X.signum(h)-h)*t;case 1:case 2:return n+(Math.abs(i)*X.signum(n)-n)*t}else{let l=0;switch(s){case 0:return l=Math.abs(h)*X.signum(i),l+(i-l)*t;case 1:case 2:return l=Math.abs(n)*X.signum(i),l+(i-l)*t}}return n+(i-h)*t}},Qe=class extends fe{constructor(e,t,s,r){super(e,t,[s,r])}getFrameEntries(){return 3}setFrame(e,t,s,r){e*=3,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r}},Ne=class extends oe{boneIndex=0;constructor(e,t,s){super(e,t,O.rotate+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,a){let i=e.bones[this.boneIndex];i.active&&(i.rotation=this.getRelativeValue(s,n,h,i.rotation,i.data.rotation))}},wt=class extends Qe{boneIndex=0;constructor(e,t,s){super(e,t,O.x+"|"+s,O.y+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,a){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(s<l[0]){switch(h){case 0:i.x=i.data.x,i.y=i.data.y;return;case 1:i.x+=(i.data.x-i.x)*n,i.y+=(i.data.y-i.y)*n}return}let o=0,c=0,d=J.search(l,s,3),f=this.curves[d/3];switch(f){case 0:let u=l[d];o=l[d+1],c=l[d+2];let m=(s-u)/(l[d+3]-u);o+=(l[d+3+1]-o)*m,c+=(l[d+3+2]-c)*m;break;case 1:o=l[d+1],c=l[d+2];break;default:o=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}switch(h){case 0:i.x=i.data.x+o*n,i.y=i.data.y+c*n;break;case 1:case 2:i.x+=(i.data.x+o-i.x)*n,i.y+=(i.data.y+c-i.y)*n;break;case 3:i.x+=o*n,i.y+=c*n}}},yt=class extends oe{boneIndex=0;constructor(e,t,s){super(e,t,O.x+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,a){let i=e.bones[this.boneIndex];i.active&&(i.x=this.getRelativeValue(s,n,h,i.x,i.data.x))}},vt=class extends oe{boneIndex=0;constructor(e,t,s){super(e,t,O.y+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,a){let i=e.bones[this.boneIndex];i.active&&(i.y=this.getRelativeValue(s,n,h,i.y,i.data.y))}},Ct=class extends Qe{boneIndex=0;constructor(e,t,s){super(e,t,O.scaleX+"|"+s,O.scaleY+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,a){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(s<l[0]){switch(h){case 0:i.scaleX=i.data.scaleX,i.scaleY=i.data.scaleY;return;case 1:i.scaleX+=(i.data.scaleX-i.scaleX)*n,i.scaleY+=(i.data.scaleY-i.scaleY)*n}return}let o,c,d=J.search(l,s,3),f=this.curves[d/3];switch(f){case 0:let u=l[d];o=l[d+1],c=l[d+2];let m=(s-u)/(l[d+3]-u);o+=(l[d+3+1]-o)*m,c+=(l[d+3+2]-c)*m;break;case 1:o=l[d+1],c=l[d+2];break;default:o=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}if(o*=i.data.scaleX,c*=i.data.scaleY,n==1)h==3?(i.scaleX+=o-i.data.scaleX,i.scaleY+=c-i.data.scaleY):(i.scaleX=o,i.scaleY=c);else{let u=0,m=0;if(a==1)switch(h){case 0:u=i.data.scaleX,m=i.data.scaleY,i.scaleX=u+(Math.abs(o)*X.signum(u)-u)*n,i.scaleY=m+(Math.abs(c)*X.signum(m)-m)*n;break;case 1:case 2:u=i.scaleX,m=i.scaleY,i.scaleX=u+(Math.abs(o)*X.signum(u)-u)*n,i.scaleY=m+(Math.abs(c)*X.signum(m)-m)*n;break;case 3:i.scaleX+=(o-i.data.scaleX)*n,i.scaleY+=(c-i.data.scaleY)*n}else switch(h){case 0:u=Math.abs(i.data.scaleX)*X.signum(o),m=Math.abs(i.data.scaleY)*X.signum(c),i.scaleX=u+(o-u)*n,i.scaleY=m+(c-m)*n;break;case 1:case 2:u=Math.abs(i.scaleX)*X.signum(o),m=Math.abs(i.scaleY)*X.signum(c),i.scaleX=u+(o-u)*n,i.scaleY=m+(c-m)*n;break;case 3:i.scaleX+=(o-i.data.scaleX)*n,i.scaleY+=(c-i.data.scaleY)*n}}}},St=class extends oe{boneIndex=0;constructor(e,t,s){super(e,t,O.scaleX+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,a){let i=e.bones[this.boneIndex];i.active&&(i.scaleX=this.getScaleValue(s,n,h,a,i.scaleX,i.data.scaleX))}},kt=class extends oe{boneIndex=0;constructor(e,t,s){super(e,t,O.scaleY+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,a){let i=e.bones[this.boneIndex];i.active&&(i.scaleY=this.getScaleValue(s,n,h,a,i.scaleY,i.data.scaleY))}},At=class extends Qe{boneIndex=0;constructor(e,t,s){super(e,t,O.shearX+"|"+s,O.shearY+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,a){let i=e.bones[this.boneIndex];if(!i.active)return;let l=this.frames;if(s<l[0]){switch(h){case 0:i.shearX=i.data.shearX,i.shearY=i.data.shearY;return;case 1:i.shearX+=(i.data.shearX-i.shearX)*n,i.shearY+=(i.data.shearY-i.shearY)*n}return}let o=0,c=0,d=J.search(l,s,3),f=this.curves[d/3];switch(f){case 0:let u=l[d];o=l[d+1],c=l[d+2];let m=(s-u)/(l[d+3]-u);o+=(l[d+3+1]-o)*m,c+=(l[d+3+2]-c)*m;break;case 1:o=l[d+1],c=l[d+2];break;default:o=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}switch(h){case 0:i.shearX=i.data.shearX+o*n,i.shearY=i.data.shearY+c*n;break;case 1:case 2:i.shearX+=(i.data.shearX+o-i.shearX)*n,i.shearY+=(i.data.shearY+c-i.shearY)*n;break;case 3:i.shearX+=o*n,i.shearY+=c*n}}},Tt=class extends oe{boneIndex=0;constructor(e,t,s){super(e,t,O.shearX+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,a){let i=e.bones[this.boneIndex];i.active&&(i.shearX=this.getRelativeValue(s,n,h,i.shearX,i.data.shearX))}},It=class extends oe{boneIndex=0;constructor(e,t,s){super(e,t,O.shearY+"|"+s),this.boneIndex=s}apply(e,t,s,r,n,h,a){let i=e.bones[this.boneIndex];i.active&&(i.shearY=this.getRelativeValue(s,n,h,i.shearY,i.data.shearY))}},Mt=class extends J{boneIndex=0;constructor(e,t){super(e,[O.inherit+"|"+t]),this.boneIndex=t}getFrameEntries(){return 2}setFrame(e,t,s){e*=2,this.frames[e]=t,this.frames[e+1]=s}apply(e,t,s,r,n,h,a){let i=e.bones[this.boneIndex];if(!i.active)return;if(a==1){h==0&&(i.inherit=i.data.inherit);return}let l=this.frames;if(s<l[0]){(h==0||h==1)&&(i.inherit=i.data.inherit);return}i.inherit=this.frames[J.search(l,s,2)+1]}},Yt=class extends fe{slotIndex=0;constructor(e,t,s){super(e,t,[O.rgb+"|"+s,O.alpha+"|"+s]),this.slotIndex=s}getFrameEntries(){return 5}setFrame(e,t,s,r,n,h){e*=5,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=n,this.frames[e+4]=h}apply(e,t,s,r,n,h,a){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=this.frames,o=i.color;if(s<l[0]){let w=i.data.color;switch(h){case 0:o.setFromColor(w);return;case 1:o.add((w.r-o.r)*n,(w.g-o.g)*n,(w.b-o.b)*n,(w.a-o.a)*n)}return}let c=0,d=0,f=0,u=0,m=J.search(l,s,5),p=this.curves[m/5];switch(p){case 0:let w=l[m];c=l[m+1],d=l[m+2],f=l[m+3],u=l[m+4];let b=(s-w)/(l[m+5]-w);c+=(l[m+5+1]-c)*b,d+=(l[m+5+2]-d)*b,f+=(l[m+5+3]-f)*b,u+=(l[m+5+4]-u)*b;break;case 1:c=l[m+1],d=l[m+2],f=l[m+3],u=l[m+4];break;default:c=this.getBezierValue(s,m,1,p-2),d=this.getBezierValue(s,m,2,p+18-2),f=this.getBezierValue(s,m,3,p+18*2-2),u=this.getBezierValue(s,m,4,p+18*3-2)}n==1?o.set(c,d,f,u):(h==0&&o.setFromColor(i.data.color),o.add((c-o.r)*n,(d-o.g)*n,(f-o.b)*n,(u-o.a)*n))}},Pt=class extends fe{slotIndex=0;constructor(e,t,s){super(e,t,[O.rgb+"|"+s]),this.slotIndex=s}getFrameEntries(){return 4}setFrame(e,t,s,r,n){e<<=2,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=n}apply(e,t,s,r,n,h,a){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=this.frames,o=i.color;if(s<l[0]){let p=i.data.color;switch(h){case 0:o.r=p.r,o.g=p.g,o.b=p.b;return;case 1:o.r+=(p.r-o.r)*n,o.g+=(p.g-o.g)*n,o.b+=(p.b-o.b)*n}return}let c=0,d=0,f=0,u=J.search(l,s,4),m=this.curves[u>>2];switch(m){case 0:let p=l[u];c=l[u+1],d=l[u+2],f=l[u+3];let w=(s-p)/(l[u+4]-p);c+=(l[u+4+1]-c)*w,d+=(l[u+4+2]-d)*w,f+=(l[u+4+3]-f)*w;break;case 1:c=l[u+1],d=l[u+2],f=l[u+3];break;default:c=this.getBezierValue(s,u,1,m-2),d=this.getBezierValue(s,u,2,m+18-2),f=this.getBezierValue(s,u,3,m+18*2-2)}if(n==1)o.r=c,o.g=d,o.b=f;else{if(h==0){let p=i.data.color;o.r=p.r,o.g=p.g,o.b=p.b}o.r+=(c-o.r)*n,o.g+=(d-o.g)*n,o.b+=(f-o.b)*n}}},Ft=class extends oe{slotIndex=0;constructor(e,t,s){super(e,t,O.alpha+"|"+s),this.slotIndex=s}apply(e,t,s,r,n,h,a){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=i.color;if(s<this.frames[0]){let c=i.data.color;switch(h){case 0:l.a=c.a;return;case 1:l.a+=(c.a-l.a)*n}return}let o=this.getCurveValue(s);n==1?l.a=o:(h==0&&(l.a=i.data.color.a),l.a+=(o-l.a)*n)}},Xt=class extends fe{slotIndex=0;constructor(e,t,s){super(e,t,[O.rgb+"|"+s,O.alpha+"|"+s,O.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 8}setFrame(e,t,s,r,n,h,a,i,l){e<<=3,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=n,this.frames[e+4]=h,this.frames[e+5]=a,this.frames[e+6]=i,this.frames[e+7]=l}apply(e,t,s,r,n,h,a){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=this.frames,o=i.color,c=i.darkColor;if(s<l[0]){let v=i.data.color,y=i.data.darkColor;switch(h){case 0:o.setFromColor(v),c.r=y.r,c.g=y.g,c.b=y.b;return;case 1:o.add((v.r-o.r)*n,(v.g-o.g)*n,(v.b-o.b)*n,(v.a-o.a)*n),c.r+=(y.r-c.r)*n,c.g+=(y.g-c.g)*n,c.b+=(y.b-c.b)*n}return}let d=0,f=0,u=0,m=0,p=0,w=0,b=0,g=J.search(l,s,8),x=this.curves[g>>3];switch(x){case 0:let v=l[g];d=l[g+1],f=l[g+2],u=l[g+3],m=l[g+4],p=l[g+5],w=l[g+6],b=l[g+7];let y=(s-v)/(l[g+8]-v);d+=(l[g+8+1]-d)*y,f+=(l[g+8+2]-f)*y,u+=(l[g+8+3]-u)*y,m+=(l[g+8+4]-m)*y,p+=(l[g+8+5]-p)*y,w+=(l[g+8+6]-w)*y,b+=(l[g+8+7]-b)*y;break;case 1:d=l[g+1],f=l[g+2],u=l[g+3],m=l[g+4],p=l[g+5],w=l[g+6],b=l[g+7];break;default:d=this.getBezierValue(s,g,1,x-2),f=this.getBezierValue(s,g,2,x+18-2),u=this.getBezierValue(s,g,3,x+18*2-2),m=this.getBezierValue(s,g,4,x+18*3-2),p=this.getBezierValue(s,g,5,x+18*4-2),w=this.getBezierValue(s,g,6,x+18*5-2),b=this.getBezierValue(s,g,7,x+18*6-2)}if(n==1)o.set(d,f,u,m),c.r=p,c.g=w,c.b=b;else{if(h==0){o.setFromColor(i.data.color);let v=i.data.darkColor;c.r=v.r,c.g=v.g,c.b=v.b}o.add((d-o.r)*n,(f-o.g)*n,(u-o.b)*n,(m-o.a)*n),c.r+=(p-c.r)*n,c.g+=(w-c.g)*n,c.b+=(b-c.b)*n}}},Bt=class extends fe{slotIndex=0;constructor(e,t,s){super(e,t,[O.rgb+"|"+s,O.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 7}setFrame(e,t,s,r,n,h,a,i){e*=7,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=n,this.frames[e+4]=h,this.frames[e+5]=a,this.frames[e+6]=i}apply(e,t,s,r,n,h,a){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=this.frames,o=i.color,c=i.darkColor;if(s<l[0]){let v=i.data.color,y=i.data.darkColor;switch(h){case 0:o.r=v.r,o.g=v.g,o.b=v.b,c.r=y.r,c.g=y.g,c.b=y.b;return;case 1:o.r+=(v.r-o.r)*n,o.g+=(v.g-o.g)*n,o.b+=(v.b-o.b)*n,c.r+=(y.r-c.r)*n,c.g+=(y.g-c.g)*n,c.b+=(y.b-c.b)*n}return}let d=0,f=0,u=0,m=0,p=0,w=0,b=0,g=J.search(l,s,7),x=this.curves[g/7];switch(x){case 0:let v=l[g];d=l[g+1],f=l[g+2],u=l[g+3],p=l[g+4],w=l[g+5],b=l[g+6];let y=(s-v)/(l[g+7]-v);d+=(l[g+7+1]-d)*y,f+=(l[g+7+2]-f)*y,u+=(l[g+7+3]-u)*y,p+=(l[g+7+4]-p)*y,w+=(l[g+7+5]-w)*y,b+=(l[g+7+6]-b)*y;break;case 1:d=l[g+1],f=l[g+2],u=l[g+3],p=l[g+4],w=l[g+5],b=l[g+6];break;default:d=this.getBezierValue(s,g,1,x-2),f=this.getBezierValue(s,g,2,x+18-2),u=this.getBezierValue(s,g,3,x+18*2-2),p=this.getBezierValue(s,g,4,x+18*3-2),w=this.getBezierValue(s,g,5,x+18*4-2),b=this.getBezierValue(s,g,6,x+18*5-2)}if(n==1)o.r=d,o.g=f,o.b=u,c.r=p,c.g=w,c.b=b;else{if(h==0){let v=i.data.color,y=i.data.darkColor;o.r=v.r,o.g=v.g,o.b=v.b,c.r=y.r,c.g=y.g,c.b=y.b}o.r+=(d-o.r)*n,o.g+=(f-o.g)*n,o.b+=(u-o.b)*n,c.r+=(p-c.r)*n,c.g+=(w-c.g)*n,c.b+=(b-c.b)*n}}},Me=class extends J{slotIndex=0;attachmentNames;constructor(e,t){super(e,[O.attachment+"|"+t]),this.slotIndex=t,this.attachmentNames=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.attachmentNames[e]=s}apply(e,t,s,r,n,h,a){let i=e.slots[this.slotIndex];if(i.bone.active){if(a==1){h==0&&this.setAttachment(e,i,i.data.attachmentName);return}if(s<this.frames[0]){(h==0||h==1)&&this.setAttachment(e,i,i.data.attachmentName);return}this.setAttachment(e,i,this.attachmentNames[J.search1(this.frames,s)])}}setAttachment(e,t,s){t.setAttachment(s?e.getAttachment(this.slotIndex,s):null)}},Et=class extends fe{slotIndex=0;attachment;vertices;constructor(e,t,s,r){super(e,t,[O.deform+"|"+s+"|"+r.id]),this.slotIndex=s,this.attachment=r,this.vertices=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.vertices[e]=s}setBezier(e,t,s,r,n,h,a,i,l,o,c){let d=this.curves,f=this.getFrameCount()+e*18;s==0&&(d[t]=2+f);let u=(r-h*2+i)*.03,m=l*.03-a*.06,p=((h-i)*3-r+o)*.006,w=(a-l+.33333333)*.018,b=u*2+p,g=m*2+w,x=(h-r)*.3+u+p*.16666667,v=a*.3+m+w*.16666667,y=r+x,C=v;for(let S=f+18;f<S;f+=2)d[f]=y,d[f+1]=C,x+=b,v+=g,b+=p,g+=w,y+=x,C+=v}getCurvePercent(e,t){let s=this.curves,r=s[t];switch(r){case 0:let i=this.frames[t];return(e-i)/(this.frames[t+this.getFrameEntries()]-i);case 1:return 0}if(r-=2,s[r]>e){let i=this.frames[t];return s[r+1]*(e-i)/(s[r]-i)}let n=r+18;for(r+=2;r<n;r+=2)if(s[r]>=e){let i=s[r-2],l=s[r-1];return l+(e-i)/(s[r]-i)*(s[r+1]-l)}let h=s[n-2],a=s[n-1];return a+(1-a)*(e-h)/(this.frames[t+this.getFrameEntries()]-h)}apply(e,t,s,r,n,h,a){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=i.getAttachment();if(!l||!(l instanceof de)||l.timelineAttachment!=this.attachment)return;let o=i.deform;o.length==0&&(h=0);let c=this.vertices,d=c[0].length,f=this.frames;if(s<f[0]){switch(h){case 0:o.length=0;return;case 1:if(n==1){o.length=0;return}o.length=d;let g=l;if(g.bones){n=1-n;for(var u=0;u<d;u++)o[u]*=n}else{let x=g.vertices;for(var u=0;u<d;u++)o[u]+=(x[u]-o[u])*n}}return}if(o.length=d,s>=f[f.length-1]){let g=c[f.length-1];if(n==1)if(h==3){let x=l;if(x.bones)for(let v=0;v<d;v++)o[v]+=g[v];else{let v=x.vertices;for(let y=0;y<d;y++)o[y]+=g[y]-v[y]}}else B.arrayCopy(g,0,o,0,d);else switch(h){case 0:{let v=l;if(v.bones)for(let y=0;y<d;y++)o[y]=g[y]*n;else{let y=v.vertices;for(let C=0;C<d;C++){let S=y[C];o[C]=S+(g[C]-S)*n}}break}case 1:case 2:for(let v=0;v<d;v++)o[v]+=(g[v]-o[v])*n;break;case 3:let x=l;if(x.bones)for(let v=0;v<d;v++)o[v]+=g[v]*n;else{let v=x.vertices;for(let y=0;y<d;y++)o[y]+=(g[y]-v[y])*n}}return}let m=J.search1(f,s),p=this.getCurvePercent(s,m),w=c[m],b=c[m+1];if(n==1)if(h==3){let g=l;if(g.bones)for(let x=0;x<d;x++){let v=w[x];o[x]+=v+(b[x]-v)*p}else{let x=g.vertices;for(let v=0;v<d;v++){let y=w[v];o[v]+=y+(b[v]-y)*p-x[v]}}}else for(let g=0;g<d;g++){let x=w[g];o[g]=x+(b[g]-x)*p}else switch(h){case 0:{let x=l;if(x.bones)for(let v=0;v<d;v++){let y=w[v];o[v]=(y+(b[v]-y)*p)*n}else{let v=x.vertices;for(let y=0;y<d;y++){let C=w[y],S=v[y];o[y]=S+(C+(b[y]-C)*p-S)*n}}break}case 1:case 2:for(let x=0;x<d;x++){let v=w[x];o[x]+=(v+(b[x]-v)*p-o[x])*n}break;case 3:let g=l;if(g.bones)for(let x=0;x<d;x++){let v=w[x];o[x]+=(v+(b[x]-v)*p)*n}else{let x=g.vertices;for(let v=0;v<d;v++){let y=w[v];o[v]+=(y+(b[v]-y)*p-x[v])*n}}}}},As=class extends J{events;constructor(e){super(e,As.propertyIds),this.events=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t){this.frames[e]=t.time,this.events[e]=t}apply(e,t,s,r,n,h,a){if(!r)return;let i=this.frames,l=this.frames.length;if(t>s)this.apply(e,t,Number.MAX_VALUE,r,n,h,a),t=-1;else if(t>=i[l-1])return;if(s<i[0])return;let o=0;if(t<i[0])o=0;else{o=J.search1(i,t)+1;let c=i[o];for(;o>0&&i[o-1]==c;)o--}for(;o<l&&s>=i[o];o++)r.push(this.events[o])}},Oe=As;R(Oe,"propertyIds",[""+O.event]);var Ts=class extends J{drawOrders;constructor(e){super(e,Ts.propertyIds),this.drawOrders=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.drawOrders[e]=s}apply(e,t,s,r,n,h,a){if(a==1){h==0&&B.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}if(s<this.frames[0]){(h==0||h==1)&&B.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}let i=J.search1(this.frames,s),l=this.drawOrders[i];if(!l)B.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);else{let o=e.drawOrder,c=e.slots;for(let d=0,f=l.length;d<f;d++)o[d]=c[l[d]]}}},Ye=Ts;R(Ye,"propertyIds",[""+O.drawOrder]);var Rt=class extends fe{constraintIndex=0;constructor(e,t,s){super(e,t,[O.ikConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 6}setFrame(e,t,s,r,n,h,a){e*=6,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=n,this.frames[e+4]=h?1:0,this.frames[e+5]=a?1:0}apply(e,t,s,r,n,h,a){let i=e.ikConstraints[this.constraintIndex];if(!i.active)return;let l=this.frames;if(s<l[0]){switch(h){case 0:i.mix=i.data.mix,i.softness=i.data.softness,i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch;return;case 1:i.mix+=(i.data.mix-i.mix)*n,i.softness+=(i.data.softness-i.softness)*n,i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch}return}let o=0,c=0,d=J.search(l,s,6),f=this.curves[d/6];switch(f){case 0:let u=l[d];o=l[d+1],c=l[d+2];let m=(s-u)/(l[d+6]-u);o+=(l[d+6+1]-o)*m,c+=(l[d+6+2]-c)*m;break;case 1:o=l[d+1],c=l[d+2];break;default:o=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2)}h==0?(i.mix=i.data.mix+(o-i.data.mix)*n,i.softness=i.data.softness+(c-i.data.softness)*n,a==1?(i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch):(i.bendDirection=l[d+3],i.compress=l[d+4]!=0,i.stretch=l[d+5]!=0)):(i.mix+=(o-i.mix)*n,i.softness+=(c-i.softness)*n,a==0&&(i.bendDirection=l[d+3],i.compress=l[d+4]!=0,i.stretch=l[d+5]!=0))}},Dt=class extends fe{constraintIndex=0;constructor(e,t,s){super(e,t,[O.transformConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 7}setFrame(e,t,s,r,n,h,a,i){let l=this.frames;e*=7,l[e]=t,l[e+1]=s,l[e+2]=r,l[e+3]=n,l[e+4]=h,l[e+5]=a,l[e+6]=i}apply(e,t,s,r,n,h,a){let i=e.transformConstraints[this.constraintIndex];if(!i.active)return;let l=this.frames;if(s<l[0]){let b=i.data;switch(h){case 0:i.mixRotate=b.mixRotate,i.mixX=b.mixX,i.mixY=b.mixY,i.mixScaleX=b.mixScaleX,i.mixScaleY=b.mixScaleY,i.mixShearY=b.mixShearY;return;case 1:i.mixRotate+=(b.mixRotate-i.mixRotate)*n,i.mixX+=(b.mixX-i.mixX)*n,i.mixY+=(b.mixY-i.mixY)*n,i.mixScaleX+=(b.mixScaleX-i.mixScaleX)*n,i.mixScaleY+=(b.mixScaleY-i.mixScaleY)*n,i.mixShearY+=(b.mixShearY-i.mixShearY)*n}return}let o,c,d,f,u,m,p=J.search(l,s,7),w=this.curves[p/7];switch(w){case 0:let b=l[p];o=l[p+1],c=l[p+2],d=l[p+3],f=l[p+4],u=l[p+5],m=l[p+6];let g=(s-b)/(l[p+7]-b);o+=(l[p+7+1]-o)*g,c+=(l[p+7+2]-c)*g,d+=(l[p+7+3]-d)*g,f+=(l[p+7+4]-f)*g,u+=(l[p+7+5]-u)*g,m+=(l[p+7+6]-m)*g;break;case 1:o=l[p+1],c=l[p+2],d=l[p+3],f=l[p+4],u=l[p+5],m=l[p+6];break;default:o=this.getBezierValue(s,p,1,w-2),c=this.getBezierValue(s,p,2,w+18-2),d=this.getBezierValue(s,p,3,w+18*2-2),f=this.getBezierValue(s,p,4,w+18*3-2),u=this.getBezierValue(s,p,5,w+18*4-2),m=this.getBezierValue(s,p,6,w+18*5-2)}if(h==0){let b=i.data;i.mixRotate=b.mixRotate+(o-b.mixRotate)*n,i.mixX=b.mixX+(c-b.mixX)*n,i.mixY=b.mixY+(d-b.mixY)*n,i.mixScaleX=b.mixScaleX+(f-b.mixScaleX)*n,i.mixScaleY=b.mixScaleY+(u-b.mixScaleY)*n,i.mixShearY=b.mixShearY+(m-b.mixShearY)*n}else i.mixRotate+=(o-i.mixRotate)*n,i.mixX+=(c-i.mixX)*n,i.mixY+=(d-i.mixY)*n,i.mixScaleX+=(f-i.mixScaleX)*n,i.mixScaleY+=(u-i.mixScaleY)*n,i.mixShearY+=(m-i.mixShearY)*n}},_t=class extends oe{constraintIndex=0;constructor(e,t,s){super(e,t,O.pathConstraintPosition+"|"+s),this.constraintIndex=s}apply(e,t,s,r,n,h,a){let i=e.pathConstraints[this.constraintIndex];i.active&&(i.position=this.getAbsoluteValue(s,n,h,i.position,i.data.position))}},Lt=class extends oe{constraintIndex=0;constructor(e,t,s){super(e,t,O.pathConstraintSpacing+"|"+s),this.constraintIndex=s}apply(e,t,s,r,n,h,a){let i=e.pathConstraints[this.constraintIndex];i.active&&(i.spacing=this.getAbsoluteValue(s,n,h,i.spacing,i.data.spacing))}},Vt=class extends fe{constraintIndex=0;constructor(e,t,s){super(e,t,[O.pathConstraintMix+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 4}setFrame(e,t,s,r,n){let h=this.frames;e<<=2,h[e]=t,h[e+1]=s,h[e+2]=r,h[e+3]=n}apply(e,t,s,r,n,h,a){let i=e.pathConstraints[this.constraintIndex];if(!i.active)return;let l=this.frames;if(s<l[0]){switch(h){case 0:i.mixRotate=i.data.mixRotate,i.mixX=i.data.mixX,i.mixY=i.data.mixY;return;case 1:i.mixRotate+=(i.data.mixRotate-i.mixRotate)*n,i.mixX+=(i.data.mixX-i.mixX)*n,i.mixY+=(i.data.mixY-i.mixY)*n}return}let o,c,d,f=J.search(l,s,4),u=this.curves[f>>2];switch(u){case 0:let m=l[f];o=l[f+1],c=l[f+2],d=l[f+3];let p=(s-m)/(l[f+4]-m);o+=(l[f+4+1]-o)*p,c+=(l[f+4+2]-c)*p,d+=(l[f+4+3]-d)*p;break;case 1:o=l[f+1],c=l[f+2],d=l[f+3];break;default:o=this.getBezierValue(s,f,1,u-2),c=this.getBezierValue(s,f,2,u+18-2),d=this.getBezierValue(s,f,3,u+18*2-2)}if(h==0){let m=i.data;i.mixRotate=m.mixRotate+(o-m.mixRotate)*n,i.mixX=m.mixX+(c-m.mixX)*n,i.mixY=m.mixY+(d-m.mixY)*n}else i.mixRotate+=(o-i.mixRotate)*n,i.mixX+=(c-i.mixX)*n,i.mixY+=(d-i.mixY)*n}},we=class extends oe{constraintIndex=0;constructor(e,t,s,r){super(e,t,r+"|"+s),this.constraintIndex=s}apply(e,t,s,r,n,h,a){let i;if(this.constraintIndex==-1){const l=s>=this.frames[0]?this.getCurveValue(s):0;for(const o of e.physicsConstraints)o.active&&this.global(o.data)&&this.set(o,this.getAbsoluteValue2(s,n,h,this.get(o),this.setup(o),l))}else i=e.physicsConstraints[this.constraintIndex],i.active&&this.set(i,this.getAbsoluteValue(s,n,h,this.get(i),this.setup(i)))}},Nt=class extends we{constructor(e,t,s){super(e,t,s,O.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},Ot=class extends we{constructor(e,t,s){super(e,t,s,O.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},Ut=class extends we{constructor(e,t,s){super(e,t,s,O.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},qt=class extends we{constructor(e,t,s){super(e,t,s,O.physicsConstraintMass)}setup(e){return 1/e.data.massInverse}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}},Wt=class extends we{constructor(e,t,s){super(e,t,s,O.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},zt=class extends we{constructor(e,t,s){super(e,t,s,O.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},Gt=class extends we{constructor(e,t,s){super(e,t,s,O.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}},Is=class extends J{constraintIndex;constructor(e,t){super(e,Is.propertyIds),this.constraintIndex=t}getFrameCount(){return this.frames.length}setFrame(e,t){this.frames[e]=t}apply(e,t,s,r,n,h,a){let i;if(this.constraintIndex!=-1&&(i=e.physicsConstraints[this.constraintIndex],!i.active))return;const l=this.frames;if(t>s)this.apply(e,t,Number.MAX_VALUE,[],n,h,a),t=-1;else if(t>=l[l.length-1])return;if(!(s<l[0])&&(t<l[0]||s>=l[J.search1(l,t)+1]))if(i!=null)i.reset();else for(const o of e.physicsConstraints)o.active&&o.reset()}},Ze=Is;R(Ze,"propertyIds",[O.physicsConstraintReset.toString()]);var ye=class extends J{slotIndex;attachment;constructor(e,t,s){super(e,[O.sequence+"|"+t+"|"+s.sequence.id]),this.slotIndex=t,this.attachment=s}getFrameEntries(){return ye.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(e,t,s,r,n){let h=this.frames;e*=ye.ENTRIES,h[e]=t,h[e+ye.MODE]=s|r<<4,h[e+ye.DELAY]=n}apply(e,t,s,r,n,h,a){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let l=i.attachment,o=this.attachment;if(l!=o&&(!(l instanceof de)||l.timelineAttachment!=o))return;if(a==1){h==0&&(i.sequenceIndex=-1);return}let c=this.frames;if(s<c[0]){(h==0||h==1)&&(i.sequenceIndex=-1);return}let d=J.search(c,s,ye.ENTRIES),f=c[d],u=c[d+ye.MODE],m=c[d+ye.DELAY];if(!this.attachment.sequence)return;let p=u>>4,w=this.attachment.sequence.regions.length,b=Cs[u&15];if(b!=0)switch(p+=(s-f)/m+1e-5|0,b){case 1:p=Math.min(w-1,p);break;case 2:p%=w;break;case 3:{let g=(w<<1)-2;p=g==0?0:p%g,p>=w&&(p=g-p);break}case 4:p=Math.max(w-1-p,0);break;case 5:p=w-1-p%w;break;case 6:{let g=(w<<1)-2;p=g==0?0:(p+w-1)%g,p>=w&&(p=g-p)}}i.sequenceIndex=p}},Ee=ye;R(Ee,"ENTRIES",3),R(Ee,"MODE",1),R(Ee,"DELAY",2);var et=class{static emptyAnimation(){return et._emptyAnimation}data;tracks=new Array;timeScale=1;unkeyedState=0;events=new Array;listeners=new Array;queue=new Ys(this);propertyIDs=new pt;animationsChanged=!1;trackEntryPool=new Be(()=>new Ms);constructor(e){this.data=e}update(e){e*=this.timeScale;let t=this.tracks;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(!n)continue;n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast;let h=e*n.timeScale;if(n.delay>0){if(n.delay-=h,n.delay>0)continue;h=-n.delay,n.delay=0}let a=n.next;if(a){let i=n.trackLast-a.delay;if(i>=0){for(a.delay=0,a.trackTime+=n.timeScale==0?0:(i/n.timeScale+e)*a.timeScale,n.trackTime+=h,this.setCurrent(s,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(n.trackLast>=n.trackEnd&&!n.mixingFrom){t[s]=null,this.queue.end(n),this.clearNext(n);continue}if(n.mixingFrom&&this.updateMixingFrom(n,e)){let i=n.mixingFrom;for(n.mixingFrom=null,i&&(i.mixingTo=null);i;)this.queue.end(i),i=i.mixingFrom}n.trackTime+=h}this.queue.drain()}updateMixingFrom(e,t){let s=e.mixingFrom;if(!s)return!0;let r=this.updateMixingFrom(s,t);return s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,e.nextTrackLast!=-1&&e.mixTime>=e.mixDuration?((s.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=s.mixingFrom,s.mixingFrom!=null&&(s.mixingFrom.mixingTo=e),e.interruptAlpha=s.interruptAlpha,this.queue.end(s)),r):(s.trackTime+=t*s.timeScale,e.mixTime+=t,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let t=this.events,s=this.tracks,r=!1;for(let d=0,f=s.length;d<f;d++){let u=s[d];if(!u||u.delay>0)continue;r=!0;let m=d==0?1:u.mixBlend,p=u.alpha;u.mixingFrom?p*=this.applyMixingFrom(u,e,m):u.trackTime>=u.trackEnd&&!u.next&&(p=0);let w=p>=u.alphaAttachmentThreshold,b=u.animationLast,g=u.getAnimationTime(),x=g,v=t;u.reverse&&(x=u.animation.duration-x,v=null);let y=u.animation.timelines,C=y.length;if(d==0&&p==1||m==3){d==0&&(w=!0);for(let S=0;S<C;S++){B.webkit602BugfixHelper(p,m);var n=y[S];n instanceof Me?this.applyAttachmentTimeline(n,e,x,m,w):n.apply(e,b,x,v,p,m,0)}}else{let S=u.timelineMode,A=u.shortestRotation,M=!A&&u.timelinesRotation.length!=C<<1;M&&(u.timelinesRotation.length=C<<1);for(let T=0;T<C;T++){let F=y[T],P=S[T]==st?m:0;!A&&F instanceof Ne?this.applyRotateTimeline(F,e,x,p,P,u.timelinesRotation,T<<1,M):F instanceof Me?this.applyAttachmentTimeline(F,e,x,m,w):(B.webkit602BugfixHelper(p,m),F.apply(e,b,x,v,p,P,0))}}this.queueEvents(u,g),t.length=0,u.nextAnimationLast=g,u.nextTrackLast=u.trackTime}for(var h=this.unkeyedState+jt,a=e.slots,i=0,l=e.slots.length;i<l;i++){var o=a[i];if(o.attachmentState==h){var c=o.data.attachmentName;o.setAttachment(c?e.getAttachment(o.data.index,c):null)}}return this.unkeyedState+=2,this.queue.drain(),r}applyMixingFrom(e,t,s){let r=e.mixingFrom;r.mixingFrom&&this.applyMixingFrom(r,t,s);let n=0;e.mixDuration==0?(n=1,s==1&&(s=0)):(n=e.mixTime/e.mixDuration,n>1&&(n=1),s!=1&&(s=r.mixBlend));let h=n<r.mixAttachmentThreshold,a=n<r.mixDrawOrderThreshold,i=r.animation.timelines,l=i.length,o=r.alpha*e.interruptAlpha,c=o*(1-n),d=r.animationLast,f=r.getAnimationTime(),u=f,m=null;if(r.reverse?u=r.animation.duration-u:n<r.eventThreshold&&(m=this.events),s==3)for(let p=0;p<l;p++)i[p].apply(t,d,u,m,c,s,1);else{let p=r.timelineMode,w=r.timelineHoldMix,b=r.shortestRotation,g=!b&&r.timelinesRotation.length!=l<<1;g&&(r.timelinesRotation.length=l<<1),r.totalAlpha=0;for(let x=0;x<l;x++){let v=i[x],y=1,C,S=0;switch(p[x]){case st:if(!a&&v instanceof Ye)continue;C=s,S=c;break;case Ht:C=0,S=c;break;case $t:C=s,S=o;break;case rt:C=0,S=o;break;default:C=0;let A=w[x];S=o*Math.max(0,1-A.mixTime/A.mixDuration);break}r.totalAlpha+=S,!b&&v instanceof Ne?this.applyRotateTimeline(v,t,u,S,C,r.timelinesRotation,x<<1,g):v instanceof Me?this.applyAttachmentTimeline(v,t,u,C,h&&S>=r.alphaAttachmentThreshold):(B.webkit602BugfixHelper(S,s),a&&v instanceof Ye&&C==0&&(y=0),v.apply(t,d,u,m,S,C,y))}}return e.mixDuration>0&&this.queueEvents(r,f),this.events.length=0,r.nextAnimationLast=f,r.nextTrackLast=r.trackTime,n}applyAttachmentTimeline(e,t,s,r,n){var h=t.slots[e.slotIndex];h.bone.active&&(s<e.frames[0]?(r==0||r==1)&&this.setAttachment(t,h,h.data.attachmentName,n):this.setAttachment(t,h,e.attachmentNames[J.search1(e.frames,s)],n),h.attachmentState<=this.unkeyedState&&(h.attachmentState=this.unkeyedState+jt))}setAttachment(e,t,s,r){t.setAttachment(s?e.getAttachment(t.data.index,s):null),r&&(t.attachmentState=this.unkeyedState+Fs)}applyRotateTimeline(e,t,s,r,n,h,a,i){if(i&&(h[a]=0),r==1){e.apply(t,0,s,null,1,n,0);return}let l=t.bones[e.boneIndex];if(!l.active)return;let o=e.frames,c=0,d=0;if(s<o[0])switch(n){case 0:l.rotation=l.data.rotation;default:return;case 1:c=l.rotation,d=l.data.rotation}else c=n==0?l.data.rotation:l.rotation,d=l.data.rotation+e.getCurveValue(s);let f=0,u=d-c;if(u-=Math.ceil(u/360-.5)*360,u==0)f=h[a];else{let m=0,p=0;i?(m=0,p=u):(m=h[a],p=h[a+1]);let w=m-m%360;f=u+w;let b=u>=0,g=m>=0;Math.abs(p)<=90&&X.signum(p)!=X.signum(u)&&(Math.abs(m-w)>180?(f+=360*X.signum(m),g=b):w!=0?f-=360*X.signum(m):g=b),g!=b&&(f+=360*X.signum(m)),h[a]=f}h[a+1]=u,l.rotation=c+f*r}queueEvents(e,t){let s=e.animationStart,r=e.animationEnd,n=r-s,h=e.trackLast%n,a=this.events,i=0,l=a.length;for(;i<l;i++){let c=a[i];if(c.time<h)break;c.time>r||this.queue.event(e,c)}let o=!1;if(e.loop)if(n==0)o=!0;else{const c=Math.floor(e.trackTime/n);o=c>0&&c>Math.floor(e.trackLast/n)}else o=t>=r&&e.animationLast<r;for(o&&this.queue.complete(e);i<l;i++){let c=a[i];c.time<s||this.queue.event(e,c)}}clearTracks(){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,s=this.tracks.length;t<s;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=e,this.queue.drain()}clearTrack(e){if(e>=this.tracks.length)return;let t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let s=t;for(;;){let r=s.mixingFrom;if(!r)break;this.queue.end(r),s.mixingFrom=null,s.mixingTo=null,s=r}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(e,t,s){let r=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,r&&(s&&this.queue.interrupt(r),t.mixingFrom=r,r.mixingTo=t,t.mixTime=0,r.mixingFrom&&r.mixDuration>0&&(t.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,s=!1){let r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);return this.setAnimationWith(e,r,s)}setAnimationWith(e,t,s=!1){if(!t)throw new Error("animation cannot be null.");let r=!0,n=this.expandToIndex(e);n&&(n.nextTrackLast==-1?(this.tracks[e]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.clearNext(n),n=n.mixingFrom,r=!1):this.clearNext(n));let h=this.trackEntry(e,t,s,n);return this.setCurrent(e,h,r),this.queue.drain(),h}addAnimation(e,t,s=!1,r=0){let n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error("Animation not found: "+t);return this.addAnimationWith(e,n,s,r)}addAnimationWith(e,t,s=!1,r=0){if(!t)throw new Error("animation cannot be null.");let n=this.expandToIndex(e);if(n)for(;n.next;)n=n.next;let h=this.trackEntry(e,t,s,n);return n?(n.next=h,h.previous=n,r<=0&&(r+=n.getTrackComplete()-h.mixDuration)):(this.setCurrent(e,h,!0),this.queue.drain()),h.delay=r,h}setEmptyAnimation(e,t=0){let s=this.setAnimationWith(e,et.emptyAnimation(),!1);return s.mixDuration=t,s.trackEnd=t,s}addEmptyAnimation(e,t=0,s=0){let r=this.addAnimationWith(e,et.emptyAnimation(),!1,s);return s<=0&&(r.delay+=r.mixDuration-t),r.mixDuration=t,r.trackEnd=t,r}setEmptyAnimations(e=0){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,r=this.tracks.length;s<r;s++){let n=this.tracks[s];n&&this.setEmptyAnimation(n.trackIndex,e)}this.queue.drainDisabled=t,this.queue.drain()}expandToIndex(e){return e<this.tracks.length?this.tracks[e]:(B.ensureArrayCapacity(this.tracks,e+1,null),this.tracks.length=e+1,null)}trackEntry(e,t,s,r){let n=this.trackEntryPool.obtain();return n.reset(),n.trackIndex=e,n.animation=t,n.loop=s,n.holdPrevious=!1,n.reverse=!1,n.shortestRotation=!1,n.eventThreshold=0,n.alphaAttachmentThreshold=0,n.mixAttachmentThreshold=0,n.mixDrawOrderThreshold=0,n.animationStart=0,n.animationEnd=t.duration,n.animationLast=-1,n.nextAnimationLast=-1,n.delay=0,n.trackTime=0,n.trackLast=-1,n.nextTrackLast=-1,n.trackEnd=Number.MAX_VALUE,n.timeScale=1,n.alpha=1,n.mixTime=0,n.mixDuration=r?this.data.getMix(r.animation,t):0,n.interruptAlpha=1,n.totalAlpha=0,n.mixBlend=2,n}clearNext(e){let t=e.next;for(;t;)this.queue.dispose(t),t=t.next;e.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let e=this.tracks;for(let t=0,s=e.length;t<s;t++){let r=e[t];if(r){for(;r.mixingFrom;)r=r.mixingFrom;do(!r.mixingTo||r.mixBlend!=3)&&this.computeHold(r),r=r.mixingTo;while(r)}}}computeHold(e){let t=e.mixingTo,s=e.animation.timelines,r=e.animation.timelines.length,n=e.timelineMode;n.length=r;let h=e.timelineHoldMix;h.length=0;let a=this.propertyIDs;if(t&&t.holdPrevious){for(let i=0;i<r;i++)n[i]=a.addAll(s[i].getPropertyIds())?rt:$t;return}e:for(let i=0;i<r;i++){let l=s[i],o=l.getPropertyIds();if(!a.addAll(o))n[i]=st;else if(!t||l instanceof Me||l instanceof Ye||l instanceof Oe||!t.animation.hasTimeline(o))n[i]=Ht;else{for(let c=t.mixingTo;c;c=c.mixingTo)if(!c.animation.hasTimeline(o)){if(e.mixDuration>0){n[i]=Ps,h[i]=c;continue e}break}n[i]=rt}}}getCurrent(e){return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){let t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},tt=et;R(tt,"_emptyAnimation",new Ke("<empty>",[],0));var Ms=class{animation=null;previous=null;next=null;mixingFrom=null;mixingTo=null;listener=null;trackIndex=0;loop=!1;holdPrevious=!1;reverse=!1;shortestRotation=!1;eventThreshold=0;mixAttachmentThreshold=0;alphaAttachmentThreshold=0;mixDrawOrderThreshold=0;animationStart=0;animationEnd=0;animationLast=0;nextAnimationLast=0;delay=0;trackTime=0;trackLast=0;nextTrackLast=0;trackEnd=0;timeScale=0;alpha=0;mixTime=0;_mixDuration=0;interruptAlpha=0;totalAlpha=0;get mixDuration(){return this._mixDuration}set mixDuration(e){this._mixDuration=e}setMixDurationWithDelay(e,t){this._mixDuration=e,this.previous!=null&&t<=0&&(t+=this.previous.getTrackComplete()-e),this.delay=t}mixBlend=2;timelineMode=new Array;timelineHoldMix=new Array;timelinesRotation=new Array;reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let e=this.animationEnd-this.animationStart;return e==0?this.animationStart:this.trackTime%e+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let e=this.animationEnd-this.animationStart;if(e!=0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime<e)return e}return this.trackTime}wasApplied(){return this.nextTrackLast!=-1}isNextReady(){return this.next!=null&&this.nextTrackLast-this.next.delay>=0}},Ys=class{objects=[];drainDisabled=!1;animState;constructor(e){this.animState=e}start(e){this.objects.push(re.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(re.interrupt),this.objects.push(e)}end(e){this.objects.push(re.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(re.dispose),this.objects.push(e)}complete(e){this.objects.push(re.complete),this.objects.push(e)}event(e,t){this.objects.push(re.event),this.objects.push(e),this.objects.push(t)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects,t=this.animState.listeners;for(let s=0;s<e.length;s+=2){let r=e[s],n=e[s+1];switch(r){case re.start:n.listener&&n.listener.start&&n.listener.start(n);for(let a=0;a<t.length;a++){let i=t[a];i.start&&i.start(n)}break;case re.interrupt:n.listener&&n.listener.interrupt&&n.listener.interrupt(n);for(let a=0;a<t.length;a++){let i=t[a];i.interrupt&&i.interrupt(n)}break;case re.end:n.listener&&n.listener.end&&n.listener.end(n);for(let a=0;a<t.length;a++){let i=t[a];i.end&&i.end(n)}case re.dispose:n.listener&&n.listener.dispose&&n.listener.dispose(n);for(let a=0;a<t.length;a++){let i=t[a];i.dispose&&i.dispose(n)}this.animState.trackEntryPool.free(n);break;case re.complete:n.listener&&n.listener.complete&&n.listener.complete(n);for(let a=0;a<t.length;a++){let i=t[a];i.complete&&i.complete(n)}break;case re.event:let h=e[s+++2];n.listener&&n.listener.event&&n.listener.event(n,h);for(let a=0;a<t.length;a++){let i=t[a];i.event&&i.event(n,h)}break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},re=(e=>(e[e.start=0]="start",e[e.interrupt=1]="interrupt",e[e.end=2]="end",e[e.dispose=3]="dispose",e[e.complete=4]="complete",e[e.event=5]="event",e))(re||{}),gr=class{start(e){}interrupt(e){}end(e){}dispose(e){}complete(e){}event(e,t){}},st=0,Ht=1,$t=2,rt=3,Ps=4,jt=1,Fs=2,Xs=class{skeletonData;animationToMixTime={};defaultMix=0;constructor(e){if(!e)throw new Error("skeletonData cannot be null.");this.skeletonData=e}setMix(e,t,s){let r=this.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);let n=this.skeletonData.findAnimation(t);if(!n)throw new Error("Animation not found: "+t);this.setMixWith(r,n,s)}setMixWith(e,t,s){if(!e)throw new Error("from cannot be null.");if(!t)throw new Error("to cannot be null.");let r=e.name+"."+t.name;this.animationToMixTime[r]=s}getMix(e,t){let s=e.name+"."+t.name,r=this.animationToMixTime[s];return r===void 0?this.defaultMix:r}},it=class extends de{color=new L(1,1,1,1);constructor(e){super(e)}copy(){let e=new it(this.name);return this.copyTo(e),e.color.setFromColor(this.color),e}},ve=class extends de{endSlot=null;color=new L(.2275,.2275,.8078,1);constructor(e){super(e)}copy(){let e=new ve(this.name);return this.copyTo(e),e.endSlot=this.endSlot,e.color.setFromColor(this.color),e}},Jt=class{_image;constructor(e){this._image=e}getImage(){return this._image}},nt=(e=>(e[e.Nearest=9728]="Nearest",e[e.Linear=9729]="Linear",e[e.MipMap=9987]="MipMap",e[e.MipMapNearestNearest=9984]="MipMapNearestNearest",e[e.MipMapLinearNearest=9985]="MipMapLinearNearest",e[e.MipMapNearestLinear=9986]="MipMapNearestLinear",e[e.MipMapLinearLinear=9987]="MipMapLinearLinear",e))(nt||{}),Bs=(e=>(e[e.MirroredRepeat=33648]="MirroredRepeat",e[e.ClampToEdge=33071]="ClampToEdge",e[e.Repeat=10497]="Repeat",e))(Bs||{}),Es=class{texture;u=0;v=0;u2=0;v2=0;width=0;height=0;degrees=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0},pr=class extends Jt{setFilters(e,t){}setWraps(e,t){}dispose(){}},Kt=class{pages=new Array;regions=new Array;constructor(e){let t=new xr(e),s=new Array(4),r={};r.size=o=>{o.width=parseInt(s[1]),o.height=parseInt(s[2])},r.format=()=>{},r.filter=o=>{o.minFilter=B.enumValue(nt,s[1]),o.magFilter=B.enumValue(nt,s[2])},r.repeat=o=>{s[1].indexOf("x")!=-1&&(o.uWrap=10497),s[1].indexOf("y")!=-1&&(o.vWrap=10497)},r.pma=o=>{o.pma=s[1]=="true"};var n={};n.xy=o=>{o.x=parseInt(s[1]),o.y=parseInt(s[2])},n.size=o=>{o.width=parseInt(s[1]),o.height=parseInt(s[2])},n.bounds=o=>{o.x=parseInt(s[1]),o.y=parseInt(s[2]),o.width=parseInt(s[3]),o.height=parseInt(s[4])},n.offset=o=>{o.offsetX=parseInt(s[1]),o.offsetY=parseInt(s[2])},n.orig=o=>{o.originalWidth=parseInt(s[1]),o.originalHeight=parseInt(s[2])},n.offsets=o=>{o.offsetX=parseInt(s[1]),o.offsetY=parseInt(s[2]),o.originalWidth=parseInt(s[3]),o.originalHeight=parseInt(s[4])},n.rotate=o=>{let c=s[1];c=="true"?o.degrees=90:c!="false"&&(o.degrees=parseInt(c))},n.index=o=>{o.index=parseInt(s[1])};let h=t.readLine();for(;h&&h.trim().length==0;)h=t.readLine();for(;!(!h||h.trim().length==0||t.readEntry(s,h)==0);)h=t.readLine();let a=null,i=null,l=null;for(;h!==null;)if(h.trim().length==0)a=null,h=t.readLine();else if(a){let o=new Qt(a,h);for(;;){let c=t.readEntry(s,h=t.readLine());if(c==0)break;let d=n[s[0]];if(d)d(o);else{i||(i=[]),l||(l=[]),i.push(s[0]);let f=[];for(let u=0;u<c;u++)f.push(parseInt(s[u+1]));l.push(f)}}o.originalWidth==0&&o.originalHeight==0&&(o.originalWidth=o.width,o.originalHeight=o.height),i&&i.length>0&&l&&l.length>0&&(o.names=i,o.values=l,i=null,l=null),o.u=o.x/a.width,o.v=o.y/a.height,o.degrees==90?(o.u2=(o.x+o.height)/a.width,o.v2=(o.y+o.width)/a.height):(o.u2=(o.x+o.width)/a.width,o.v2=(o.y+o.height)/a.height),this.regions.push(o)}else{for(a=new Rs(h.trim());t.readEntry(s,h=t.readLine())!=0;){let o=r[s[0]];o&&o(a)}this.pages.push(a)}}findRegion(e){for(let t=0;t<this.regions.length;t++)if(this.regions[t].name==e)return this.regions[t];return null}setTextures(e,t=""){for(let s of this.pages)s.setTexture(e.get(t+s.name))}dispose(){for(let e=0;e<this.pages.length;e++)this.pages[e].texture?.dispose()}},xr=class{lines;index=0;constructor(e){this.lines=e.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length==0))return 0;let s=t.indexOf(":");if(s==-1)return 0;e[0]=t.substr(0,s).trim();for(let r=1,n=s+1;;r++){let h=t.indexOf(",",n);if(h==-1)return e[r]=t.substr(n).trim(),r;if(e[r]=t.substr(n,h-n).trim(),n=h+1,r==4)return 4}}},Rs=class{name;minFilter=9728;magFilter=9728;uWrap=33071;vWrap=33071;texture=null;width=0;height=0;pma=!1;regions=new Array;constructor(e){this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(let t of this.regions)t.texture=e}},Qt=class extends Es{page;name;x=0;y=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0;index=0;degrees=0;names=null;values=null;constructor(e,t){super(),this.page=e,this.name=t,e.regions.push(this)}},le=class extends de{region=null;path;regionUVs=[];uvs=[];triangles=[];color=new L(1,1,1,1);width=0;height=0;hullLength=0;edges=[];parentMesh=null;sequence=null;tempColor=new L(0,0,0,0);constructor(e,t){super(e),this.path=t}updateRegion(){if(!this.region)throw new Error("Region not set.");let e=this.regionUVs;(!this.uvs||this.uvs.length!=e.length)&&(this.uvs=B.newFloatArray(e.length));let t=this.uvs,s=this.uvs.length,r=this.region.u,n=this.region.v,h=0,a=0;if(this.region instanceof Qt){let i=this.region,l=i.page,o=l.width,c=l.height;switch(i.degrees){case 90:r-=(i.originalHeight-i.offsetY-i.height)/o,n-=(i.originalWidth-i.offsetX-i.width)/c,h=i.originalHeight/o,a=i.originalWidth/c;for(let d=0;d<s;d+=2)t[d]=r+e[d+1]*h,t[d+1]=n+(1-e[d])*a;return;case 180:r-=(i.originalWidth-i.offsetX-i.width)/o,n-=i.offsetY/c,h=i.originalWidth/o,a=i.originalHeight/c;for(let d=0;d<s;d+=2)t[d]=r+(1-e[d])*h,t[d+1]=n+(1-e[d+1])*a;return;case 270:r-=i.offsetY/o,n-=i.offsetX/c,h=i.originalHeight/o,a=i.originalWidth/c;for(let d=0;d<s;d+=2)t[d]=r+(1-e[d+1])*h,t[d+1]=n+e[d]*a;return}r-=i.offsetX/o,n-=(i.originalHeight-i.offsetY-i.height)/c,h=i.originalWidth/o,a=i.originalHeight/c}else this.region?(h=this.region.u2-r,a=this.region.v2-n):(r=n=0,h=a=1);for(let i=0;i<s;i+=2)t[i]=r+e[i]*h,t[i+1]=n+e[i+1]*a}getParentMesh(){return this.parentMesh}setParentMesh(e){this.parentMesh=e,e&&(this.bones=e.bones,this.vertices=e.vertices,this.worldVerticesLength=e.worldVerticesLength,this.regionUVs=e.regionUVs,this.triangles=e.triangles,this.hullLength=e.hullLength,this.worldVerticesLength=e.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let e=new le(this.name,this.path);return e.region=this.region,e.color.setFromColor(this.color),this.copyTo(e),e.regionUVs=new Array(this.regionUVs.length),B.arrayCopy(this.regionUVs,0,e.regionUVs,0,this.regionUVs.length),e.uvs=new Array(this.uvs.length),B.arrayCopy(this.uvs,0,e.uvs,0,this.uvs.length),e.triangles=new Array(this.triangles.length),B.arrayCopy(this.triangles,0,e.triangles,0,this.triangles.length),e.hullLength=this.hullLength,e.sequence=this.sequence!=null?this.sequence.copy():null,this.edges&&(e.edges=new Array(this.edges.length),B.arrayCopy(this.edges,0,e.edges,0,this.edges.length)),e.width=this.width,e.height=this.height,e}computeWorldVertices(e,t,s,r,n,h){this.sequence!=null&&this.sequence.apply(e,this),super.computeWorldVertices(e,t,s,r,n,h)}newLinkedMesh(){let e=new le(this.name,this.path);return e.region=this.region,e.color.setFromColor(this.color),e.timelineAttachment=this.timelineAttachment,e.setParentMesh(this.parentMesh?this.parentMesh:this),e.region!=null&&e.updateRegion(),e}},Pe=class extends de{lengths=[];closed=!1;constantSpeed=!1;color=new L(1,1,1,1);constructor(e){super(e)}copy(){let e=new Pe(this.name);return this.copyTo(e),e.lengths=new Array(this.lengths.length),B.arrayCopy(this.lengths,0,e.lengths,0,this.lengths.length),e.closed=closed,e.constantSpeed=this.constantSpeed,e.color.setFromColor(this.color),e}},Zt=class extends de{x=0;y=0;rotation=0;color=new L(.38,.94,0,1);constructor(e){super(e)}computeWorldPosition(e,t){return t.x=this.x*e.a+this.y*e.b+e.worldX,t.y=this.x*e.c+this.y*e.d+e.worldY,t}computeWorldRotation(e){const t=this.rotation*X.degRad,s=Math.cos(t),r=Math.sin(t),n=s*e.a+r*e.b,h=s*e.c+r*e.d;return X.atan2Deg(h,n)}copy(){let e=new Zt(this.name);return e.x=this.x,e.y=this.y,e.rotation=this.rotation,e.color.setFromColor(this.color),e}},Ds=class extends xt{x=0;y=0;scaleX=1;scaleY=1;rotation=0;width=0;height=0;color=new L(1,1,1,1);path;region=null;sequence=null;offset=B.newFloatArray(8);uvs=B.newFloatArray(8);tempColor=new L(1,1,1,1);constructor(e,t){super(e),this.path=t}updateRegion(){if(!this.region)throw new Error("Region not set.");let e=this.region,t=this.uvs;if(e==null){t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=1,t[5]=1,t[6]=1,t[7]=0;return}let s=this.width/this.region.originalWidth*this.scaleX,r=this.height/this.region.originalHeight*this.scaleY,n=-this.width/2*this.scaleX+this.region.offsetX*s,h=-this.height/2*this.scaleY+this.region.offsetY*r,a=n+this.region.width*s,i=h+this.region.height*r,l=this.rotation*X.degRad,o=Math.cos(l),c=Math.sin(l),d=this.x,f=this.y,u=n*o+d,m=n*c,p=h*o+f,w=h*c,b=a*o+d,g=a*c,x=i*o+f,v=i*c,y=this.offset;y[0]=u-w,y[1]=p+m,y[2]=u-v,y[3]=x+m,y[4]=b-v,y[5]=x+g,y[6]=b-w,y[7]=p+g,e.degrees==90?(t[0]=e.u2,t[1]=e.v2,t[2]=e.u,t[3]=e.v2,t[4]=e.u,t[5]=e.v,t[6]=e.u2,t[7]=e.v):(t[0]=e.u,t[1]=e.v2,t[2]=e.u,t[3]=e.v,t[4]=e.u2,t[5]=e.v,t[6]=e.u2,t[7]=e.v2)}computeWorldVertices(e,t,s,r){this.sequence!=null&&this.sequence.apply(e,this);let n=e.bone,h=this.offset,a=n.worldX,i=n.worldY,l=n.a,o=n.b,c=n.c,d=n.d,f=0,u=0;f=h[0],u=h[1],t[s]=f*l+u*o+a,t[s+1]=f*c+u*d+i,s+=r,f=h[2],u=h[3],t[s]=f*l+u*o+a,t[s+1]=f*c+u*d+i,s+=r,f=h[4],u=h[5],t[s]=f*l+u*o+a,t[s+1]=f*c+u*d+i,s+=r,f=h[6],u=h[7],t[s]=f*l+u*o+a,t[s+1]=f*c+u*d+i}copy(){let e=new Ds(this.name,this.path);return e.region=this.region,e.x=this.x,e.y=this.y,e.scaleX=this.scaleX,e.scaleY=this.scaleY,e.rotation=this.rotation,e.width=this.width,e.height=this.height,B.arrayCopy(this.uvs,0,e.uvs,0,8),B.arrayCopy(this.offset,0,e.offset,0,8),e.color.setFromColor(this.color),e.sequence=this.sequence!=null?this.sequence.copy():null,e}},N=Ds;R(N,"X1",0),R(N,"Y1",1),R(N,"C1R",2),R(N,"C1G",3),R(N,"C1B",4),R(N,"C1A",5),R(N,"U1",6),R(N,"V1",7),R(N,"X2",8),R(N,"Y2",9),R(N,"C2R",10),R(N,"C2G",11),R(N,"C2B",12),R(N,"C2A",13),R(N,"U2",14),R(N,"V2",15),R(N,"X3",16),R(N,"Y3",17),R(N,"C3R",18),R(N,"C3G",19),R(N,"C3B",20),R(N,"C3A",21),R(N,"U3",22),R(N,"V3",23),R(N,"X4",24),R(N,"Y4",25),R(N,"C4R",26),R(N,"C4G",27),R(N,"C4B",28),R(N,"C4A",29),R(N,"U4",30),R(N,"V4",31);var _s=class{atlas;constructor(e){this.atlas=e}loadSequence(e,t,s){let r=s.regions;for(let n=0,h=r.length;n<h;n++){let a=s.getPath(t,n),i=this.atlas.findRegion(a);if(i==null)throw new Error("Region not found in atlas: "+a+" (sequence: "+e+")");r[n]=i}}newRegionAttachment(e,t,s,r){let n=new N(t,s);if(r!=null)this.loadSequence(t,s,r);else{let h=this.atlas.findRegion(s);if(!h)throw new Error("Region not found in atlas: "+s+" (region attachment: "+t+")");n.region=h}return n}newMeshAttachment(e,t,s,r){let n=new le(t,s);if(r!=null)this.loadSequence(t,s,r);else{let h=this.atlas.findRegion(s);if(!h)throw new Error("Region not found in atlas: "+s+" (mesh attachment: "+t+")");n.region=h}return n}newBoundingBoxAttachment(e,t){return new it(t)}newPathAttachment(e,t){return new Pe(t)}newPointAttachment(e,t){return new Zt(t)}newClippingAttachment(e,t){return new ve(t)}},es=class{index=0;name;parent=null;length=0;x=0;y=0;rotation=0;scaleX=1;scaleY=1;shearX=0;shearY=0;inherit=Ue.Normal;skinRequired=!1;color=new L;icon;visible=!1;constructor(e,t,s){if(e<0)throw new Error("index must be >= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=s}},Ue=(e=>(e[e.Normal=0]="Normal",e[e.OnlyTranslation=1]="OnlyTranslation",e[e.NoRotationOrReflection=2]="NoRotationOrReflection",e[e.NoScale=3]="NoScale",e[e.NoScaleOrReflection=4]="NoScaleOrReflection",e))(Ue||{}),ts=class{data;skeleton;parent=null;children=new Array;x=0;y=0;rotation=0;scaleX=0;scaleY=0;shearX=0;shearY=0;ax=0;ay=0;arotation=0;ascaleX=0;ascaleY=0;ashearX=0;ashearY=0;a=0;b=0;c=0;d=0;worldY=0;worldX=0;inherit=0;sorted=!1;active=!1;constructor(e,t,s){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=t,this.parent=s,this.setToSetupPose()}isActive(){return this.active}update(e){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,t,s,r,n,h,a){this.ax=e,this.ay=t,this.arotation=s,this.ascaleX=r,this.ascaleY=n,this.ashearX=h,this.ashearY=a;let i=this.parent;if(!i){let f=this.skeleton;const u=f.scaleX,m=f.scaleY,p=(s+h)*X.degRad,w=(s+90+a)*X.degRad;this.a=Math.cos(p)*r*u,this.b=Math.cos(w)*n*u,this.c=Math.sin(p)*r*m,this.d=Math.sin(w)*n*m,this.worldX=e*u+f.x,this.worldY=t*m+f.y;return}let l=i.a,o=i.b,c=i.c,d=i.d;switch(this.worldX=l*e+o*t+i.worldX,this.worldY=c*e+d*t+i.worldY,this.inherit){case 0:{const f=(s+h)*X.degRad,u=(s+90+a)*X.degRad,m=Math.cos(f)*r,p=Math.cos(u)*n,w=Math.sin(f)*r,b=Math.sin(u)*n;this.a=l*m+o*w,this.b=l*p+o*b,this.c=c*m+d*w,this.d=c*p+d*b;return}case 1:{const f=(s+h)*X.degRad,u=(s+90+a)*X.degRad;this.a=Math.cos(f)*r,this.b=Math.cos(u)*n,this.c=Math.sin(f)*r,this.d=Math.sin(u)*n;break}case 2:{let f=1/this.skeleton.scaleX,u=1/this.skeleton.scaleY;l*=f,c*=u;let m=l*l+c*c,p=0;m>1e-4?(m=Math.abs(l*d*u-o*f*c)/m,o=c*m,d=l*m,p=Math.atan2(c,l)*X.radDeg):(l=0,c=0,p=90-Math.atan2(d,o)*X.radDeg);const w=(s+h-p)*X.degRad,b=(s+a-p+90)*X.degRad,g=Math.cos(w)*r,x=Math.cos(b)*n,v=Math.sin(w)*r,y=Math.sin(b)*n;this.a=l*g-o*v,this.b=l*x-o*y,this.c=c*g+d*v,this.d=c*x+d*y;break}case 3:case 4:{s*=X.degRad;const f=Math.cos(s),u=Math.sin(s);let m=(l*f+o*u)/this.skeleton.scaleX,p=(c*f+d*u)/this.skeleton.scaleY,w=Math.sqrt(m*m+p*p);w>1e-5&&(w=1/w),m*=w,p*=w,w=Math.sqrt(m*m+p*p),this.inherit==3&&l*d-o*c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(w=-w),s=Math.PI/2+Math.atan2(p,m);const b=Math.cos(s)*w,g=Math.sin(s)*w;h*=X.degRad,a=(90+a)*X.degRad;const x=Math.cos(h)*r,v=Math.cos(a)*n,y=Math.sin(h)*r,C=Math.sin(a)*n;this.a=m*x+b*y,this.b=m*v+b*C,this.c=p*x+g*y,this.d=p*v+g*C;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let e=this.data;this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}updateAppliedTransform(){let e=this.parent;if(!e){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*X.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*X.radDeg;return}let t=e.a,s=e.b,r=e.c,n=e.d,h=1/(t*n-s*r),a=n*h,i=s*h,l=r*h,o=t*h,c=this.worldX-e.worldX,d=this.worldY-e.worldY;this.ax=c*a-d*i,this.ay=d*o-c*l;let f,u,m,p;if(this.inherit==1)f=this.a,u=this.b,m=this.c,p=this.d;else{switch(this.inherit){case 2:{let v=Math.abs(t*n-s*r)/(t*t+r*r);s=-r*this.skeleton.scaleX*v/this.skeleton.scaleY,n=t*this.skeleton.scaleY*v/this.skeleton.scaleX,h=1/(t*n-s*r),a=n*h,i=s*h;break}case 3:case 4:let w=X.cosDeg(this.rotation),b=X.sinDeg(this.rotation);t=(t*w+s*b)/this.skeleton.scaleX,r=(r*w+n*b)/this.skeleton.scaleY;let g=Math.sqrt(t*t+r*r);g>1e-5&&(g=1/g),t*=g,r*=g,g=Math.sqrt(t*t+r*r),this.inherit==3&&h<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(g=-g);let x=X.PI/2+Math.atan2(r,t);s=Math.cos(x)*g,n=Math.sin(x)*g,h=1/(t*n-s*r),a=n*h,i=s*h,l=r*h,o=t*h}f=a*this.a-i*this.c,u=a*this.b-i*this.d,m=o*this.c-l*this.a,p=o*this.d-l*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let w=f*p-u*m;this.ascaleY=w/this.ascaleX,this.ashearY=-Math.atan2(f*u+m*p,w)*X.radDeg,this.arotation=Math.atan2(m,f)*X.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+p*p),this.ashearY=0,this.arotation=90-Math.atan2(p,u)*X.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*X.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*X.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)}worldToLocal(e){let t=1/(this.a*this.d-this.b*this.c),s=e.x-this.worldX,r=e.y-this.worldY;return e.x=s*this.d*t-r*this.b*t,e.y=r*this.a*t-s*this.c*t,e}localToWorld(e){let t=e.x,s=e.y;return e.x=t*this.a+s*this.b+this.worldX,e.y=t*this.c+s*this.d+this.worldY,e}worldToParent(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.worldToLocal(e)}parentToWorld(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.localToWorld(e)}worldToLocalRotation(e){let t=X.sinDeg(e),s=X.cosDeg(e);return Math.atan2(this.a*t-this.c*s,this.d*s-this.b*t)*X.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=X.sinDeg(e),s=X.cosDeg(e);return Math.atan2(s*this.c+t*this.d,s*this.a+t*this.b)*X.radDeg}rotateWorld(e){e*=X.degRad;const t=Math.sin(e),s=Math.cos(e),r=this.a,n=this.b;this.a=s*r-t*this.c,this.b=s*n-t*this.d,this.c=t*r+s*this.c,this.d=t*n+s*this.d}},qe=class{constructor(e,t,s){this.name=e,this.order=t,this.skinRequired=s}},br=class{pathPrefix="";textureLoader;downloader;assets={};errors={};toLoad=0;loaded=0;constructor(e,t="",s=new Ls){this.textureLoader=e,this.pathPrefix=t,this.downloader=s}start(e){return this.toLoad++,this.pathPrefix+e}success(e,t,s){this.toLoad--,this.loaded++,this.assets[t]=s,e&&e(t,s)}error(e,t,s){this.toLoad--,this.loaded++,this.errors[t]=s,e&&e(t,s)}loadAll(){return new Promise((t,s)=>{let r=()=>{if(this.isLoadingComplete()){this.hasErrors()?s(this.errors):t(this);return}requestAnimationFrame(r)};requestAnimationFrame(r)})}setRawDataURI(e,t){this.downloader.rawDataUris[this.pathPrefix+e]=t}loadBinary(e,t=()=>{},s=()=>{}){e=this.start(e),this.downloader.downloadBinary(e,r=>{this.success(t,e,r)},(r,n)=>{this.error(s,e,`Couldn't load binary ${e}: status ${r}, ${n}`)})}loadText(e,t=()=>{},s=()=>{}){e=this.start(e),this.downloader.downloadText(e,r=>{this.success(t,e,r)},(r,n)=>{this.error(s,e,`Couldn't load text ${e}: status ${r}, ${n}`)})}loadJson(e,t=()=>{},s=()=>{}){e=this.start(e),this.downloader.downloadJson(e,r=>{this.success(t,e,r)},(r,n)=>{this.error(s,e,`Couldn't load JSON ${e}: status ${r}, ${n}`)})}loadTexture(e,t=()=>{},s=()=>{}){if(e=this.start(e),!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(e,{mode:"cors"}).then(h=>h.ok?h.blob():(this.error(s,e,`Couldn't load image: ${e}`),null)).then(h=>h?createImageBitmap(h,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(h=>{h&&this.success(t,e,this.textureLoader(h))});else{let h=new Image;h.crossOrigin="anonymous",h.onload=()=>{this.success(t,e,this.textureLoader(h))},h.onerror=()=>{this.error(s,e,`Couldn't load image: ${e}`)},this.downloader.rawDataUris[e]&&(e=this.downloader.rawDataUris[e]),h.src=e}}loadTextureAtlas(e,t=()=>{},s=()=>{},r){let n=e.lastIndexOf("/"),h=n>=0?e.substring(0,n+1):"";e=this.start(e),this.downloader.downloadText(e,a=>{try{let i=new Kt(a),l=i.pages.length,o=!1;for(let c of i.pages)this.loadTexture(r?r[c.name]:h+c.name,(d,f)=>{o||(c.setTexture(f),--l==0&&this.success(t,e,i))},(d,f)=>{o||this.error(s,e,`Couldn't load texture atlas ${e} page image: ${d}`),o=!0})}catch(i){this.error(s,e,`Couldn't parse texture atlas ${e}: ${i.message}`)}},(a,i)=>{this.error(s,e,`Couldn't load texture atlas ${e}: status ${a}, ${i}`)})}get(e){return this.assets[this.pathPrefix+e]}require(e){e=this.pathPrefix+e;let t=this.assets[e];if(t)return t;let s=this.errors[e];throw Error("Asset not found: "+e+(s?`
|
|
2
|
-
`+s:""))}remove(e){e=this.pathPrefix+e;let t=this.assets[e];return t.dispose&&t.dispose(),delete this.assets[e],t}removeAll(){for(let e in this.assets){let t=this.assets[e];t.dispose&&t.dispose()}this.assets={}}isLoadingComplete(){return this.toLoad==0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},Ls=class{callbacks={};rawDataUris={};dataUriToString(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");return t!=-1?(t+=7,atob(e.substr(t))):e.substr(e.indexOf(",")+1)}base64ToUint8Array(e){for(var t=window.atob(e),s=t.length,r=new Uint8Array(s),n=0;n<s;n++)r[n]=t.charCodeAt(n);return r}dataUriToUint8Array(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");if(t==-1)throw new Error("Not a binary data URI.");return t+=7,this.base64ToUint8Array(e.substr(t))}downloadText(e,t,s){if(this.start(e,t,s))return;if(this.rawDataUris[e]){try{let h=this.rawDataUris[e];this.finish(e,200,this.dataUriToString(h))}catch(h){this.finish(e,400,JSON.stringify(h))}return}let r=new XMLHttpRequest;r.overrideMimeType("text/html"),r.open("GET",e,!0);let n=()=>{this.finish(e,r.status,r.responseText)};r.onload=n,r.onerror=n,r.send()}downloadJson(e,t,s){this.downloadText(e,r=>{t(JSON.parse(r))},s)}downloadBinary(e,t,s){if(this.start(e,t,s))return;if(this.rawDataUris[e]){try{let h=this.rawDataUris[e];this.finish(e,200,this.dataUriToUint8Array(h))}catch(h){this.finish(e,400,JSON.stringify(h))}return}let r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer";let n=()=>{this.finish(e,r.status,r.response)};r.onload=()=>{r.status==200||r.status==0?this.finish(e,200,new Uint8Array(r.response)):n()},r.onerror=n,r.send()}start(e,t,s){let r=this.callbacks[e];try{if(r)return!0;this.callbacks[e]=r=[]}finally{r.push(t,s)}}finish(e,t,s){let r=this.callbacks[e];delete this.callbacks[e];let n=t==200||t==0?[s]:[t,s];for(let h=n.length-1,a=r.length;h<a;h+=2)r[h].apply(null,n)}},ss=class{data;intValue=0;floatValue=0;stringValue=null;time=0;volume=0;balance=0;constructor(e,t){if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},rs=class{name;intValue=0;floatValue=0;stringValue=null;audioPath=null;volume=0;balance=0;constructor(e){this.name=e}},Vs=class{data;bones;target;bendDirection=0;compress=!1;stretch=!1;mix=1;softness=0;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let r=0;r<e.bones.length;r++){let n=t.findBone(e.bones[r].name);if(!n)throw new Error(`Couldn't find bone ${e.bones[r].name}`);this.bones.push(n)}let s=t.findBone(e.target.name);if(!s)throw new Error(`Couldn't find bone ${e.target.name}`);this.target=s,this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch}isActive(){return this.active}setToSetupPose(){const e=this.data;this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch}update(e){if(this.mix==0)return;let t=this.target,s=this.bones;switch(s.length){case 1:this.apply1(s[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(s[0],s[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(e,t,s,r,n,h,a){let i=e.parent;if(!i)throw new Error("IK bone must have parent.");let l=i.a,o=i.b,c=i.c,d=i.d,f=-e.ashearX-e.arotation,u=0,m=0;switch(e.inherit){case 1:u=(t-e.worldX)*X.signum(e.skeleton.scaleX),m=(s-e.worldY)*X.signum(e.skeleton.scaleY);break;case 2:let b=Math.abs(l*d-o*c)/Math.max(1e-4,l*l+c*c),g=l/e.skeleton.scaleX,x=c/e.skeleton.scaleY;o=-x*b*e.skeleton.scaleX,d=g*b*e.skeleton.scaleY,f+=Math.atan2(x,g)*X.radDeg;default:let v=t-i.worldX,y=s-i.worldY,C=l*d-o*c;Math.abs(C)<=1e-4?(u=0,m=0):(u=(v*d-y*o)/C-e.ax,m=(y*l-v*c)/C-e.ay)}f+=Math.atan2(m,u)*X.radDeg,e.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let p=e.ascaleX,w=e.ascaleY;if(r||n){switch(e.inherit){case 3:case 4:u=t-e.worldX,m=s-e.worldY}const b=e.data.length*p;if(b>1e-4){const g=u*u+m*m;if(r&&g<b*b||n&&g>b*b){const x=(Math.sqrt(g)/b-1)*a+1;p*=x,h&&(w*=x)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*a,p,w,e.ashearX,e.ashearY)}apply2(e,t,s,r,n,h,a,i,l){if(e.inherit!=0||t.inherit!=0)return;let o=e.ax,c=e.ay,d=e.ascaleX,f=e.ascaleY,u=d,m=f,p=t.ascaleX,w=0,b=0,g=0;d<0?(d=-d,w=180,g=-1):(w=0,g=1),f<0&&(f=-f,g=-g),p<0?(p=-p,b=180):b=0;let x=t.ax,v=0,y=0,C=0,S=e.a,A=e.b,M=e.c,T=e.d,F=Math.abs(d-f)<=1e-4;!F||h?(v=0,y=S*x+e.worldX,C=M*x+e.worldY):(v=t.ay,y=S*x+A*v+e.worldX,C=M*x+T*v+e.worldY);let P=e.parent;if(!P)throw new Error("IK parent must itself have a parent.");S=P.a,A=P.b,M=P.c,T=P.d;let I=S*T-A*M,Y=y-P.worldX,E=C-P.worldY;I=Math.abs(I)<=1e-4?0:1/I;let V=(Y*T-E*A)*I-o,U=(E*S-Y*M)*I-c,_=Math.sqrt(V*V+U*U),H=t.data.length*p,$,j;if(_<1e-4){this.apply1(e,s,r,!1,h,!1,l),t.updateWorldTransformWith(x,v,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}Y=s-P.worldX,E=r-P.worldY;let D=(Y*T-E*A)*I-o,q=(E*S-Y*M)*I-c,W=D*D+q*q;if(i!=0){i*=d*(p+1)*.5;let K=Math.sqrt(W),ee=K-_-H*d+i;if(ee>0){let te=Math.min(1,ee/(i*2))-1;te=(ee-i*(1-te*te))/K,D-=te*D,q-=te*q,W=D*D+q*q}}e:if(F){H*=d;let K=(W-_*_-H*H)/(2*_*H);K<-1?(K=-1,j=Math.PI*n):K>1?(K=1,j=0,h&&(S=(Math.sqrt(W)/(_+H)-1)*l+1,u*=S,a&&(m*=S))):j=Math.acos(K)*n,S=_+H*K,A=H*Math.sin(j),$=Math.atan2(q*S-D*A,D*S+q*A)}else{S=d*H,A=f*H;let K=S*S,ee=A*A,te=Math.atan2(q,D);M=ee*_*_+K*W-K*ee;let Te=-2*ee*_,He=ee-K;if(T=Te*Te-4*He*M,T>=0){let Le=Math.sqrt(T);Te<0&&(Le=-Le),Le=-(Te+Le)*.5;let $e=Le/He,tr=M/Le,gt=Math.abs($e)<Math.abs(tr)?$e:tr;if($e=W-gt*gt,$e>=0){E=Math.sqrt($e)*n,$=te-Math.atan2(E,gt),j=Math.atan2(E/f,(gt-_)/d);break e}}let Ks=X.PI,ut=_-S,gs=ut*ut,Qs=0,Zs=0,mt=_+S,ps=mt*mt,er=0;M=-S*_/(K-ee),M>=-1&&M<=1&&(M=Math.acos(M),Y=S*Math.cos(M)+_,E=A*Math.sin(M),T=Y*Y+E*E,T<gs&&(Ks=M,gs=T,ut=Y,Qs=E),T>ps&&(Zs=M,ps=T,mt=Y,er=E)),W<=(gs+ps)*.5?($=te-Math.atan2(Qs*n,ut),j=Ks*n):($=te-Math.atan2(er*n,mt),j=Zs*n)}let he=Math.atan2(v,x)*g,ae=e.arotation;$=($-he)*X.radDeg+w-ae,$>180?$-=360:$<-180&&($+=360),e.updateWorldTransformWith(o,c,ae+$*l,u,m,0,0),ae=t.arotation,j=((j+he)*X.radDeg-t.ashearX)*g+b-ae,j>180?j-=360:j<-180&&(j+=360),t.updateWorldTransformWith(x,v,ae+j*l,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},is=class extends qe{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}bendDirection=0;compress=!1;stretch=!1;uniform=!1;mix=0;softness=0;constructor(e){super(e,0,!1)}},ns=class extends qe{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}positionMode=at.Fixed;spacingMode=ot.Fixed;rotateMode=lt.Chain;offsetRotation=0;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;constructor(e){super(e,0,!1)}},at=(e=>(e[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",e))(at||{}),ot=(e=>(e[e.Length=0]="Length",e[e.Fixed=1]="Fixed",e[e.Percent=2]="Percent",e[e.Proportional=3]="Proportional",e))(ot||{}),lt=(e=>(e[e.Tangent=0]="Tangent",e[e.Chain=1]="Chain",e[e.ChainScale=2]="ChainScale",e))(lt||{}),Ce=class{data;bones;target;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;spaces=new Array;positions=new Array;world=new Array;curves=new Array;lengths=new Array;segments=new Array;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let r=0,n=e.bones.length;r<n;r++){let h=t.findBone(e.bones[r].name);if(!h)throw new Error(`Couldn't find bone ${e.bones[r].name}.`);this.bones.push(h)}let s=t.findSlot(e.target.name);if(!s)throw new Error(`Couldn't find target bone ${e.target.name}`);this.target=s,this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}isActive(){return this.active}setToSetupPose(){const e=this.data;this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}update(e){let t=this.target.getAttachment();if(!(t instanceof Pe))return;let s=this.mixRotate,r=this.mixX,n=this.mixY;if(s==0&&r==0&&n==0)return;let h=this.data,a=h.rotateMode==0,i=h.rotateMode==2,l=this.bones,o=l.length,c=a?o:o+1,d=B.setArraySize(this.spaces,c),f=i?this.lengths=B.setArraySize(this.lengths,o):[],u=this.spacing;switch(h.spacingMode){case 2:if(i)for(let y=0,C=c-1;y<C;y++){let S=l[y],A=S.data.length,M=A*S.a,T=A*S.c;f[y]=Math.sqrt(M*M+T*T)}B.arrayFill(d,1,c,u);break;case 3:let x=0;for(let y=0,C=c-1;y<C;){let S=l[y],A=S.data.length;if(A<Ce.epsilon)i&&(f[y]=0),d[++y]=u;else{let M=A*S.a,T=A*S.c,F=Math.sqrt(M*M+T*T);i&&(f[y]=F),d[++y]=F,x+=F}}if(x>0){x=c/x*u;for(let y=1;y<c;y++)d[y]*=x}break;default:let v=h.spacingMode==0;for(let y=0,C=c-1;y<C;){let S=l[y],A=S.data.length;if(A<Ce.epsilon)i&&(f[y]=0),d[++y]=u;else{let M=A*S.a,T=A*S.c,F=Math.sqrt(M*M+T*T);i&&(f[y]=F),d[++y]=(v?A+u:u)*F/A}}}let m=this.computeWorldPositions(t,c,a),p=m[0],w=m[1],b=h.offsetRotation,g=!1;if(b==0)g=h.rotateMode==1;else{g=!1;let x=this.target.bone;b*=x.a*x.d-x.b*x.c>0?X.degRad:-X.degRad}for(let x=0,v=3;x<o;x++,v+=3){let y=l[x];y.worldX+=(p-y.worldX)*r,y.worldY+=(w-y.worldY)*n;let C=m[v],S=m[v+1],A=C-p,M=S-w;if(i){let T=f[x];if(T!=0){let F=(Math.sqrt(A*A+M*M)/T-1)*s+1;y.a*=F,y.c*=F}}if(p=C,w=S,s>0){let T=y.a,F=y.b,P=y.c,I=y.d,Y=0,E=0,V=0;if(a?Y=m[v-1]:d[x+1]==0?Y=m[v+2]:Y=Math.atan2(M,A),Y-=Math.atan2(P,T),g){E=Math.cos(Y),V=Math.sin(Y);let U=y.data.length;p+=(U*(E*T-V*P)-A)*s,w+=(U*(V*T+E*P)-M)*s}else Y+=b;Y>X.PI?Y-=X.PI2:Y<-X.PI&&(Y+=X.PI2),Y*=s,E=Math.cos(Y),V=Math.sin(Y),y.a=E*T-V*P,y.b=E*F-V*I,y.c=V*T+E*P,y.d=V*F+E*I}y.updateAppliedTransform()}}computeWorldPositions(e,t,s){let r=this.target,n=this.position,h=this.spaces,a=B.setArraySize(this.positions,t*3+2),i=this.world,l=e.closed,o=e.worldVerticesLength,c=o/6,d=Ce.NONE;if(!e.constantSpeed){let U=e.lengths;c-=l?1:2;let _=U[c];this.data.positionMode==1&&(n*=_);let H;switch(this.data.spacingMode){case 2:H=_;break;case 3:H=_/t;break;default:H=1}i=B.setArraySize(this.world,8);for(let $=0,j=0,D=0;$<t;$++,j+=3){let q=h[$]*H;n+=q;let W=n;if(l)W%=_,W<0&&(W+=_),D=0;else if(W<0){d!=Ce.BEFORE&&(d=Ce.BEFORE,e.computeWorldVertices(r,2,4,i,0,2)),this.addBeforePosition(W,i,0,a,j);continue}else if(W>_){d!=Ce.AFTER&&(d=Ce.AFTER,e.computeWorldVertices(r,o-6,4,i,0,2)),this.addAfterPosition(W-_,i,0,a,j);continue}for(;;D++){let he=U[D];if(!(W>he)){if(D==0)W/=he;else{let ae=U[D-1];W=(W-ae)/(he-ae)}break}}D!=d&&(d=D,l&&D==c?(e.computeWorldVertices(r,o-4,4,i,0,2),e.computeWorldVertices(r,0,4,i,4,2)):e.computeWorldVertices(r,D*6+2,8,i,0,2)),this.addCurvePosition(W,i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],a,j,s||$>0&&q==0)}return a}l?(o+=2,i=B.setArraySize(this.world,o),e.computeWorldVertices(r,2,o-4,i,0,2),e.computeWorldVertices(r,0,2,i,o-4,2),i[o-2]=i[0],i[o-1]=i[1]):(c--,o-=4,i=B.setArraySize(this.world,o),e.computeWorldVertices(r,2,o,i,0,2));let f=B.setArraySize(this.curves,c),u=0,m=i[0],p=i[1],w=0,b=0,g=0,x=0,v=0,y=0,C=0,S=0,A=0,M=0,T=0,F=0,P=0,I=0;for(let U=0,_=2;U<c;U++,_+=6)w=i[_],b=i[_+1],g=i[_+2],x=i[_+3],v=i[_+4],y=i[_+5],C=(m-w*2+g)*.1875,S=(p-b*2+x)*.1875,A=((w-g)*3-m+v)*.09375,M=((b-x)*3-p+y)*.09375,T=C*2+A,F=S*2+M,P=(w-m)*.75+C+A*.16666667,I=(b-p)*.75+S+M*.16666667,u+=Math.sqrt(P*P+I*I),P+=T,I+=F,T+=A,F+=M,u+=Math.sqrt(P*P+I*I),P+=T,I+=F,u+=Math.sqrt(P*P+I*I),P+=T+A,I+=F+M,u+=Math.sqrt(P*P+I*I),f[U]=u,m=v,p=y;this.data.positionMode==1&&(n*=u);let Y;switch(this.data.spacingMode){case 2:Y=u;break;case 3:Y=u/t;break;default:Y=1}let E=this.segments,V=0;for(let U=0,_=0,H=0,$=0;U<t;U++,_+=3){let j=h[U]*Y;n+=j;let D=n;if(l)D%=u,D<0&&(D+=u),H=0;else if(D<0){this.addBeforePosition(D,i,0,a,_);continue}else if(D>u){this.addAfterPosition(D-u,i,o-4,a,_);continue}for(;;H++){let q=f[H];if(!(D>q)){if(H==0)D/=q;else{let W=f[H-1];D=(D-W)/(q-W)}break}}if(H!=d){d=H;let q=H*6;for(m=i[q],p=i[q+1],w=i[q+2],b=i[q+3],g=i[q+4],x=i[q+5],v=i[q+6],y=i[q+7],C=(m-w*2+g)*.03,S=(p-b*2+x)*.03,A=((w-g)*3-m+v)*.006,M=((b-x)*3-p+y)*.006,T=C*2+A,F=S*2+M,P=(w-m)*.3+C+A*.16666667,I=(b-p)*.3+S+M*.16666667,V=Math.sqrt(P*P+I*I),E[0]=V,q=1;q<8;q++)P+=T,I+=F,T+=A,F+=M,V+=Math.sqrt(P*P+I*I),E[q]=V;P+=T,I+=F,V+=Math.sqrt(P*P+I*I),E[8]=V,P+=T+A,I+=F+M,V+=Math.sqrt(P*P+I*I),E[9]=V,$=0}for(D*=V;;$++){let q=E[$];if(!(D>q)){if($==0)D/=q;else{let W=E[$-1];D=$+(D-W)/(q-W)}break}}this.addCurvePosition(D*.1,m,p,w,b,g,x,v,y,a,_,s||U>0&&j==0)}return a}addBeforePosition(e,t,s,r,n){let h=t[s],a=t[s+1],i=t[s+2]-h,l=t[s+3]-a,o=Math.atan2(l,i);r[n]=h+e*Math.cos(o),r[n+1]=a+e*Math.sin(o),r[n+2]=o}addAfterPosition(e,t,s,r,n){let h=t[s+2],a=t[s+3],i=h-t[s],l=a-t[s+1],o=Math.atan2(l,i);r[n]=h+e*Math.cos(o),r[n+1]=a+e*Math.sin(o),r[n+2]=o}addCurvePosition(e,t,s,r,n,h,a,i,l,o,c,d){if(e==0||isNaN(e)){o[c]=t,o[c+1]=s,o[c+2]=Math.atan2(n-s,r-t);return}let f=e*e,u=f*e,m=1-e,p=m*m,w=p*m,b=m*e,g=b*3,x=m*g,v=g*e,y=t*w+r*x+h*v+i*u,C=s*w+n*x+a*v+l*u;o[c]=y,o[c+1]=C,d&&(e<.001?o[c+2]=Math.atan2(n-s,r-t):o[c+2]=Math.atan2(C-(s*p+n*b*2+a*f),y-(t*p+r*b*2+h*f)))}},Re=Ce;R(Re,"NONE",-1),R(Re,"BEFORE",-2),R(Re,"AFTER",-3),R(Re,"epsilon",1e-5);var wr=class{data;_bone=null;set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}inertia=0;strength=0;damping=0;massInverse=0;wind=0;gravity=0;mix=0;_reset=!0;ux=0;uy=0;cx=0;cy=0;tx=0;ty=0;xOffset=0;xVelocity=0;yOffset=0;yVelocity=0;rotateOffset=0;rotateVelocity=0;scaleOffset=0;scaleVelocity=0;active=!1;skeleton;remaining=0;lastTime=0;constructor(e,t){this.data=e,this.skeleton=t,this.bone=t.bones[e.bone.index],this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}reset(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}setToSetupPose(){const e=this.data;this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}isActive(){return this.active}update(e){const t=this.mix;if(t==0)return;const s=this.data.x>0,r=this.data.y>0,n=this.data.rotate>0||this.data.shearX>0,h=this.data.scaleX>0,a=this.bone,i=a.data.length;switch(e){case 0:return;case 1:this.reset();case 2:const l=this.skeleton,o=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=o,this.lastTime=l.time;const c=a.worldX,d=a.worldY;if(this._reset)this._reset=!1,this.ux=c,this.uy=d;else{let f=this.remaining,u=this.inertia,m=this.data.step,p=this.skeleton.data.referenceScale,w=-1,b=this.data.limit*o,g=b*Math.abs(l.scaleY);if(b*=Math.abs(l.scaleX),s||r){if(s){const x=(this.ux-c)*u;this.xOffset+=x>b?b:x<-b?-b:x,this.ux=c}if(r){const x=(this.uy-d)*u;this.yOffset+=x>g?g:x<-g?-g:x,this.uy=d}if(f>=m){w=Math.pow(this.damping,60*m);const x=this.massInverse*m,v=this.strength,y=this.wind*p*l.scaleX,C=this.gravity*p*l.scaleY;do s&&(this.xVelocity+=(y-this.xOffset*v)*x,this.xOffset+=this.xVelocity*m,this.xVelocity*=w),r&&(this.yVelocity-=(C+this.yOffset*v)*x,this.yOffset+=this.yVelocity*m,this.yVelocity*=w),f-=m;while(f>=m)}s&&(a.worldX+=this.xOffset*t*this.data.x),r&&(a.worldY+=this.yOffset*t*this.data.y)}if(n||h){let x=Math.atan2(a.c,a.a),v=0,y=0,C=0,S=this.cx-a.worldX,A=this.cy-a.worldY;if(S>b?S=b:S<-b&&(S=-b),A>g?A=g:A<-g&&(A=-g),n){C=(this.data.rotate+this.data.shearX)*t;let M=Math.atan2(A+this.ty,S+this.tx)-x-this.rotateOffset*C;this.rotateOffset+=(M-Math.ceil(M*X.invPI2-.5)*X.PI2)*u,M=this.rotateOffset*C+x,v=Math.cos(M),y=Math.sin(M),h&&(M=i*a.getWorldScaleX(),M>0&&(this.scaleOffset+=(S*v+A*y)*u/M))}else{v=Math.cos(x),y=Math.sin(x);const M=i*a.getWorldScaleX();M>0&&(this.scaleOffset+=(S*v+A*y)*u/M)}if(f=this.remaining,f>=m){w==-1&&(w=Math.pow(this.damping,60*m));const M=this.massInverse*m,T=this.strength,F=this.wind,P=Se.yDown?-this.gravity:this.gravity,I=i/p;for(;;)if(f-=m,h&&(this.scaleVelocity+=(F*v-P*y-this.scaleOffset*T)*M,this.scaleOffset+=this.scaleVelocity*m,this.scaleVelocity*=w),n){if(this.rotateVelocity-=((F*y+P*v)*I+this.rotateOffset*T)*M,this.rotateOffset+=this.rotateVelocity*m,this.rotateVelocity*=w,f<m)break;const Y=this.rotateOffset*C+x;v=Math.cos(Y),y=Math.sin(Y)}else if(f<m)break}}this.remaining=f}this.cx=a.worldX,this.cy=a.worldY;break;case 3:s&&(a.worldX+=this.xOffset*t*this.data.x),r&&(a.worldY+=this.yOffset*t*this.data.y)}if(n){let l=this.rotateOffset*t,o=0,c=0,d=0;if(this.data.shearX>0){let f=0;this.data.rotate>0&&(f=l*this.data.rotate,o=Math.sin(f),c=Math.cos(f),d=a.b,a.b=c*d-o*a.d,a.d=o*d+c*a.d),f+=l*this.data.shearX,o=Math.sin(f),c=Math.cos(f),d=a.a,a.a=c*d-o*a.c,a.c=o*d+c*a.c}else l*=this.data.rotate,o=Math.sin(l),c=Math.cos(l),d=a.a,a.a=c*d-o*a.c,a.c=o*d+c*a.c,d=a.b,a.b=c*d-o*a.d,a.d=o*d+c*a.d}if(h){const l=1+this.scaleOffset*t*this.data.scaleX;a.a*=l,a.c*=l}e!=3&&(this.tx=i*a.a,this.ty=i*a.c),a.updateAppliedTransform()}translate(e,t){this.ux-=e,this.uy-=t,this.cx-=e,this.cy-=t}rotate(e,t,s){const r=s*X.degRad,n=Math.cos(r),h=Math.sin(r),a=this.cx-e,i=this.cy-t;this.translate(a*n-i*h-a,a*h+i*n-i)}},Ns=class{data;bone;color;darkColor=null;attachment=null;attachmentState=0;sequenceIndex=-1;deform=new Array;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("bone cannot be null.");this.data=e,this.bone=t,this.color=new L,this.darkColor=e.darkColor?new L:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof de)||!(this.attachment instanceof de)||e.timelineAttachment!=this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=e,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},Os=class{data;bones;target;mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;temp=new Ve;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let r=0;r<e.bones.length;r++){let n=t.findBone(e.bones[r].name);if(!n)throw new Error(`Couldn't find bone ${e.bones[r].name}.`);this.bones.push(n)}let s=t.findBone(e.target.name);if(!s)throw new Error(`Couldn't find target bone ${e.target.name}.`);this.target=s,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}isActive(){return this.active}setToSetupPose(){const e=this.data;this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}update(e){this.mixRotate==0&&this.mixX==0&&this.mixY==0&&this.mixScaleX==0&&this.mixScaleY==0&&this.mixShearY==0||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,n=this.mixScaleY,h=this.mixShearY,a=t!=0||s!=0,i=this.target,l=i.a,o=i.b,c=i.c,d=i.d,f=l*d-o*c>0?X.degRad:-X.degRad,u=this.data.offsetRotation*f,m=this.data.offsetShearY*f,p=this.bones;for(let w=0,b=p.length;w<b;w++){let g=p[w];if(e!=0){let x=g.a,v=g.b,y=g.c,C=g.d,S=Math.atan2(c,l)-Math.atan2(y,x)+u;S>X.PI?S-=X.PI2:S<-X.PI&&(S+=X.PI2),S*=e;let A=Math.cos(S),M=Math.sin(S);g.a=A*x-M*y,g.b=A*v-M*C,g.c=M*x+A*y,g.d=M*v+A*C}if(a){let x=this.temp;i.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(x.x-g.worldX)*t,g.worldY+=(x.y-g.worldY)*s}if(r!=0){let x=Math.sqrt(g.a*g.a+g.c*g.c);x!=0&&(x=(x+(Math.sqrt(l*l+c*c)-x+this.data.offsetScaleX)*r)/x),g.a*=x,g.c*=x}if(n!=0){let x=Math.sqrt(g.b*g.b+g.d*g.d);x!=0&&(x=(x+(Math.sqrt(o*o+d*d)-x+this.data.offsetScaleY)*n)/x),g.b*=x,g.d*=x}if(h>0){let x=g.b,v=g.d,y=Math.atan2(v,x),C=Math.atan2(d,o)-Math.atan2(c,l)-(y-Math.atan2(g.c,g.a));C>X.PI?C-=X.PI2:C<-X.PI&&(C+=X.PI2),C=y+(C+m)*h;let S=Math.sqrt(x*x+v*v);g.b=Math.cos(C)*S,g.d=Math.sin(C)*S}g.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,n=this.mixScaleY,h=this.mixShearY,a=t!=0||s!=0,i=this.target,l=i.a,o=i.b,c=i.c,d=i.d,f=l*d-o*c>0?X.degRad:-X.degRad,u=this.data.offsetRotation*f,m=this.data.offsetShearY*f,p=this.bones;for(let w=0,b=p.length;w<b;w++){let g=p[w];if(e!=0){let x=g.a,v=g.b,y=g.c,C=g.d,S=Math.atan2(c,l)+u;S>X.PI?S-=X.PI2:S<-X.PI&&(S+=X.PI2),S*=e;let A=Math.cos(S),M=Math.sin(S);g.a=A*x-M*y,g.b=A*v-M*C,g.c=M*x+A*y,g.d=M*v+A*C}if(a){let x=this.temp;i.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),g.worldX+=x.x*t,g.worldY+=x.y*s}if(r!=0){let x=(Math.sqrt(l*l+c*c)-1+this.data.offsetScaleX)*r+1;g.a*=x,g.c*=x}if(n!=0){let x=(Math.sqrt(o*o+d*d)-1+this.data.offsetScaleY)*n+1;g.b*=x,g.d*=x}if(h>0){let x=Math.atan2(d,o)-Math.atan2(c,l);x>X.PI?x-=X.PI2:x<-X.PI&&(x+=X.PI2);let v=g.b,y=g.d;x=Math.atan2(y,v)+(x-X.PI/2+m)*h;let C=Math.sqrt(v*v+y*y);g.b=Math.cos(x)*C,g.d=Math.sin(x)*C}g.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,n=this.mixScaleY,h=this.mixShearY,a=this.target,i=this.bones;for(let l=0,o=i.length;l<o;l++){let c=i[l],d=c.arotation;e!=0&&(d+=(a.arotation-d+this.data.offsetRotation)*e);let f=c.ax,u=c.ay;f+=(a.ax-f+this.data.offsetX)*t,u+=(a.ay-u+this.data.offsetY)*s;let m=c.ascaleX,p=c.ascaleY;r!=0&&m!=0&&(m=(m+(a.ascaleX-m+this.data.offsetScaleX)*r)/m),n!=0&&p!=0&&(p=(p+(a.ascaleY-p+this.data.offsetScaleY)*n)/p);let w=c.ashearY;h!=0&&(w+=(a.ashearY-w+this.data.offsetShearY)*h),c.updateWorldTransformWith(f,u,d,m,p,c.ashearX,w)}}applyRelativeLocal(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,n=this.mixScaleY,h=this.mixShearY,a=this.target,i=this.bones;for(let l=0,o=i.length;l<o;l++){let c=i[l],d=c.arotation+(a.arotation+this.data.offsetRotation)*e,f=c.ax+(a.ax+this.data.offsetX)*t,u=c.ay+(a.ay+this.data.offsetY)*s,m=c.ascaleX*((a.ascaleX-1+this.data.offsetScaleX)*r+1),p=c.ascaleY*((a.ascaleY-1+this.data.offsetScaleY)*n+1),w=c.ashearY+(a.ashearY+this.data.offsetShearY)*h;c.updateWorldTransformWith(f,u,d,m,p,c.ashearX,w)}}},as=class{data;bones;slots;drawOrder;ikConstraints;transformConstraints;pathConstraints;physicsConstraints;_updateCache=new Array;skin=null;color;scaleX=1;_scaleY=1;get scaleY(){return as.yDown?-this._scaleY:this._scaleY}set scaleY(e){this._scaleY=e}x=0;y=0;time=0;constructor(e){if(!e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(let t=0;t<e.bones.length;t++){let s=e.bones[t],r;if(!s.parent)r=new ts(s,this,null);else{let n=this.bones[s.parent.index];r=new ts(s,this,n),n.children.push(r)}this.bones.push(r)}this.slots=new Array,this.drawOrder=new Array;for(let t=0;t<e.slots.length;t++){let s=e.slots[t],r=this.bones[s.boneData.index],n=new Ns(s,r);this.slots.push(n),this.drawOrder.push(n)}this.ikConstraints=new Array;for(let t=0;t<e.ikConstraints.length;t++){let s=e.ikConstraints[t];this.ikConstraints.push(new Vs(s,this))}this.transformConstraints=new Array;for(let t=0;t<e.transformConstraints.length;t++){let s=e.transformConstraints[t];this.transformConstraints.push(new Os(s,this))}this.pathConstraints=new Array;for(let t=0;t<e.pathConstraints.length;t++){let s=e.pathConstraints[t];this.pathConstraints.push(new Re(s,this))}this.physicsConstraints=new Array;for(let t=0;t<e.physicsConstraints.length;t++){let s=e.physicsConstraints[t];this.physicsConstraints.push(new wr(s,this))}this.color=new L(1,1,1,1),this.updateCache()}updateCache(){let e=this._updateCache;e.length=0;let t=this.bones;for(let d=0,f=t.length;d<f;d++){let u=t[d];u.sorted=u.data.skinRequired,u.active=!u.sorted}if(this.skin){let d=this.skin.bones;for(let f=0,u=this.skin.bones.length;f<u;f++){let m=this.bones[d[f].index];do m.sorted=!1,m.active=!0,m=m.parent;while(m)}}let s=this.ikConstraints,r=this.transformConstraints,n=this.pathConstraints,h=this.physicsConstraints,a=s.length,i=r.length,l=n.length,o=this.physicsConstraints.length,c=a+i+l+o;e:for(let d=0;d<c;d++){for(let f=0;f<a;f++){let u=s[f];if(u.data.order==d){this.sortIkConstraint(u);continue e}}for(let f=0;f<i;f++){let u=r[f];if(u.data.order==d){this.sortTransformConstraint(u);continue e}}for(let f=0;f<l;f++){let u=n[f];if(u.data.order==d){this.sortPathConstraint(u);continue e}}for(let f=0;f<o;f++){const u=h[f];if(u.data.order==d){this.sortPhysicsConstraint(u);continue e}}}for(let d=0,f=t.length;d<f;d++)this.sortBone(t[d])}sortIkConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&B.contains(this.skin.constraints,e.data,!0)),!e.active)return;let t=e.target;this.sortBone(t);let s=e.bones,r=s[0];if(this.sortBone(r),s.length==1)this._updateCache.push(e),this.sortReset(r.children);else{let n=s[s.length-1];this.sortBone(n),this._updateCache.push(e),this.sortReset(r.children),n.sorted=!0}}sortPathConstraint(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||this.skin&&B.contains(this.skin.constraints,e.data,!0)),!e.active)return;let t=e.target,s=t.data.index,r=t.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,s,r),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,s,r);for(let i=0,l=this.data.skins.length;i<l;i++)this.sortPathConstraintAttachment(this.data.skins[i],s,r);let n=t.getAttachment();n instanceof Pe&&this.sortPathConstraintAttachmentWith(n,r);let h=e.bones,a=h.length;for(let i=0;i<a;i++)this.sortBone(h[i]);this._updateCache.push(e);for(let i=0;i<a;i++)this.sortReset(h[i].children);for(let i=0;i<a;i++)h[i].sorted=!0}sortTransformConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&B.contains(this.skin.constraints,e.data,!0)),!e.active)return;this.sortBone(e.target);let t=e.bones,s=t.length;if(e.data.local)for(let r=0;r<s;r++){let n=t[r];this.sortBone(n.parent),this.sortBone(n)}else for(let r=0;r<s;r++)this.sortBone(t[r]);this._updateCache.push(e);for(let r=0;r<s;r++)this.sortReset(t[r].children);for(let r=0;r<s;r++)t[r].sorted=!0}sortPathConstraintAttachment(e,t,s){let r=e.attachments[t];if(r)for(let n in r)this.sortPathConstraintAttachmentWith(r[n],s)}sortPathConstraintAttachmentWith(e,t){if(!(e instanceof Pe))return;let s=e.bones;if(!s)this.sortBone(t);else{let r=this.bones;for(let n=0,h=s.length;n<h;){let a=s[n++];for(a+=n;n<a;)this.sortBone(r[s[n++]])}}}sortPhysicsConstraint(e){const t=e.bone;e.active=t.active&&(!e.data.skinRequired||this.skin!=null&&B.contains(this.skin.constraints,e.data,!0)),e.active&&(this.sortBone(t),this._updateCache.push(e),this.sortReset(t.children),t.sorted=!0)}sortBone(e){if(!e||e.sorted)return;let t=e.parent;t&&this.sortBone(t),e.sorted=!0,this._updateCache.push(e)}sortReset(e){for(let t=0,s=e.length;t<s;t++){let r=e[t];r.active&&(r.sorted&&this.sortReset(r.children),r.sorted=!1)}}updateWorldTransform(e){if(e==null)throw new Error("physics is undefined");let t=this.bones;for(let r=0,n=t.length;r<n;r++){let h=t[r];h.ax=h.x,h.ay=h.y,h.arotation=h.rotation,h.ascaleX=h.scaleX,h.ascaleY=h.scaleY,h.ashearX=h.shearX,h.ashearY=h.shearY}let s=this._updateCache;for(let r=0,n=s.length;r<n;r++)s[r].update(e)}updateWorldTransformWith(e,t){if(!t)throw new Error("parent cannot be null.");let s=this.bones;for(let p=1,w=s.length;p<w;p++){let b=s[p];b.ax=b.x,b.ay=b.y,b.arotation=b.rotation,b.ascaleX=b.scaleX,b.ascaleY=b.scaleY,b.ashearX=b.shearX,b.ashearY=b.shearY}let r=this.getRootBone();if(!r)throw new Error("Root bone must not be null.");let n=t.a,h=t.b,a=t.c,i=t.d;r.worldX=n*this.x+h*this.y+t.worldX,r.worldY=a*this.x+i*this.y+t.worldY;const l=(r.rotation+r.shearX)*X.degRad,o=(r.rotation+90+r.shearY)*X.degRad,c=Math.cos(l)*r.scaleX,d=Math.cos(o)*r.scaleY,f=Math.sin(l)*r.scaleX,u=Math.sin(o)*r.scaleY;r.a=(n*c+h*f)*this.scaleX,r.b=(n*d+h*u)*this.scaleX,r.c=(a*c+i*f)*this.scaleY,r.d=(a*d+i*u)*this.scaleY;let m=this._updateCache;for(let p=0,w=m.length;p<w;p++){let b=m[p];b!=r&&b.update(e)}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){for(const e of this.bones)e.setToSetupPose();for(const e of this.ikConstraints)e.setToSetupPose();for(const e of this.transformConstraints)e.setToSetupPose();for(const e of this.pathConstraints)e.setToSetupPose();for(const e of this.physicsConstraints)e.setToSetupPose()}setSlotsToSetupPose(){let e=this.slots;B.arrayCopy(e,0,this.drawOrder,0,e.length);for(let t=0,s=e.length;t<s;t++)e[t].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(e){if(!e)throw new Error("boneName cannot be null.");let t=this.bones;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.data.name==e)return n}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let t=this.slots;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.data.name==e)return n}return null}setSkinByName(e){let t=this.data.findSkin(e);if(!t)throw new Error("Skin not found: "+e);this.setSkin(t)}setSkin(e){if(e!=this.skin){if(e)if(this.skin)e.attachAll(this,this.skin);else{let t=this.slots;for(let s=0,r=t.length;s<r;s++){let n=t[s],h=n.data.attachmentName;if(h){let a=e.getAttachment(s,h);a&&n.setAttachment(a)}}}this.skin=e,this.updateCache()}}getAttachmentByName(e,t){let s=this.data.findSlot(e);if(!s)throw new Error(`Can't find slot with name ${e}`);return this.getAttachment(s.index,t)}getAttachment(e,t){if(!t)throw new Error("attachmentName cannot be null.");if(this.skin){let s=this.skin.getAttachment(e,t);if(s)return s}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(e,t):null}setAttachment(e,t){if(!e)throw new Error("slotName cannot be null.");let s=this.slots;for(let r=0,n=s.length;r<n;r++){let h=s[r];if(h.data.name==e){let a=null;if(t&&(a=this.getAttachment(r,t),!a))throw new Error("Attachment not found: "+t+", for slot: "+e);h.setAttachment(a);return}}throw new Error("Slot not found: "+e)}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.ikConstraints.find(t=>t.data.name==e)??null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(t=>t.data.name==e)??null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(t=>t.data.name==e)??null}findPhysicsConstraint(e){if(e==null)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(t=>t.data.name==e)??null}getBoundsRect(e){let t=new Ve,s=new Ve;return this.getBounds(t,s,void 0,e),{x:t.x,y:t.y,width:s.x,height:s.y}}getBounds(e,t,s=new Array(2),r=null){if(!e)throw new Error("offset cannot be null.");if(!t)throw new Error("size cannot be null.");let n=this.drawOrder,h=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let o=0,c=n.length;o<c;o++){let d=n[o];if(!d.bone.active)continue;let f=0,u=null,m=null,p=d.getAttachment();if(p instanceof N)f=8,u=B.setArraySize(s,f,0),p.computeWorldVertices(d,u,0,2),m=as.quadTriangles;else if(p instanceof le){let w=p;f=w.worldVerticesLength,u=B.setArraySize(s,f,0),w.computeWorldVertices(d,0,f,u,0,2),m=w.triangles}else if(p instanceof ve&&r!=null){r.clipStart(d,p);continue}if(u&&m){r!=null&&r.isClipping()&&(r.clipTriangles(u,m,m.length),u=r.clippedVertices,f=r.clippedVertices.length);for(let w=0,b=u.length;w<b;w+=2){let g=u[w],x=u[w+1];h=Math.min(h,g),a=Math.min(a,x),i=Math.max(i,g),l=Math.max(l,x)}}r?.clipEndWithSlot(d)}r?.clipEnd(),e.set(h,a),t.set(i-h,l-a)}update(e){this.time+=e}physicsTranslate(e,t){const s=this.physicsConstraints;for(let r=0,n=s.length;r<n;r++)s[r].translate(e,t)}physicsRotate(e,t,s){const r=this.physicsConstraints;for(let n=0,h=r.length;n<h;n++)r[n].rotate(e,t,s)}},Se=as;R(Se,"quadTriangles",[0,1,2,2,3,0]),R(Se,"yDown",!1);var Us=(e=>(e[e.none=0]="none",e[e.reset=1]="reset",e[e.update=2]="update",e[e.pose=3]="pose",e))(Us||{}),qs=class extends qe{_bone=null;set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}x=0;y=0;rotate=0;scaleX=0;shearX=0;limit=0;step=0;inertia=0;strength=0;damping=0;massInverse=0;wind=0;gravity=0;mix=0;inertiaGlobal=!1;strengthGlobal=!1;dampingGlobal=!1;massGlobal=!1;windGlobal=!1;gravityGlobal=!1;mixGlobal=!1;constructor(e){super(e,0,!1)}},We=class{name=null;bones=new Array;slots=new Array;skins=new Array;defaultSkin=null;events=new Array;animations=new Array;ikConstraints=new Array;transformConstraints=new Array;pathConstraints=new Array;physicsConstraints=new Array;x=0;y=0;width=0;height=0;referenceScale=100;version=null;hash=null;fps=0;imagesPath=null;audioPath=null;findBone(e){if(!e)throw new Error("boneName cannot be null.");let t=this.bones;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.name==e)return n}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let t=this.slots;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.name==e)return n}return null}findSkin(e){if(!e)throw new Error("skinName cannot be null.");let t=this.skins;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.name==e)return n}return null}findEvent(e){if(!e)throw new Error("eventDataName cannot be null.");let t=this.events;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.name==e)return n}return null}findAnimation(e){if(!e)throw new Error("animationName cannot be null.");let t=this.animations;for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.name==e)return n}return null}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.ikConstraints;for(let s=0,r=t.length;s<r;s++){const n=t[s];if(n.name==e)return n}return null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.transformConstraints;for(let s=0,r=t.length;s<r;s++){const n=t[s];if(n.name==e)return n}return null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.pathConstraints;for(let s=0,r=t.length;s<r;s++){const n=t[s];if(n.name==e)return n}return null}findPhysicsConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.physicsConstraints;for(let s=0,r=t.length;s<r;s++){const n=t[s];if(n.name==e)return n}return null}},os=class{constructor(e=0,t,s){this.slotIndex=e,this.name=t,this.attachment=s}},ze=class{name;attachments=new Array;bones=Array();constraints=new Array;color=new L(.99607843,.61960787,.30980393,1);constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}setAttachment(e,t,s){if(!s)throw new Error("attachment cannot be null.");let r=this.attachments;e>=r.length&&(r.length=e+1),r[e]||(r[e]={}),r[e][t]=s}addSkin(e){for(let r=0;r<e.bones.length;r++){let n=e.bones[r],h=!1;for(let a=0;a<this.bones.length;a++)if(this.bones[a]==n){h=!0;break}h||this.bones.push(n)}for(let r=0;r<e.constraints.length;r++){let n=e.constraints[r],h=!1;for(let a=0;a<this.constraints.length;a++)if(this.constraints[a]==n){h=!0;break}h||this.constraints.push(n)}let t=e.getAttachments();for(let r=0;r<t.length;r++){var s=t[r];this.setAttachment(s.slotIndex,s.name,s.attachment)}}copySkin(e){for(let r=0;r<e.bones.length;r++){let n=e.bones[r],h=!1;for(let a=0;a<this.bones.length;a++)if(this.bones[a]==n){h=!0;break}h||this.bones.push(n)}for(let r=0;r<e.constraints.length;r++){let n=e.constraints[r],h=!1;for(let a=0;a<this.constraints.length;a++)if(this.constraints[a]==n){h=!0;break}h||this.constraints.push(n)}let t=e.getAttachments();for(let r=0;r<t.length;r++){var s=t[r];s.attachment&&(s.attachment instanceof le?(s.attachment=s.attachment.newLinkedMesh(),this.setAttachment(s.slotIndex,s.name,s.attachment)):(s.attachment=s.attachment.copy(),this.setAttachment(s.slotIndex,s.name,s.attachment)))}}getAttachment(e,t){let s=this.attachments[e];return s?s[t]:null}removeAttachment(e,t){let s=this.attachments[e];s&&delete s[t]}getAttachments(){let e=new Array;for(var t=0;t<this.attachments.length;t++){let s=this.attachments[t];if(s)for(let r in s){let n=s[r];n&&e.push(new os(t,r,n))}}return e}getAttachmentsForSlot(e,t){let s=this.attachments[e];if(s)for(let r in s){let n=s[r];n&&t.push(new os(e,r,n))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(e,t){let s=0;for(let r=0;r<e.slots.length;r++){let n=e.slots[r],h=n.getAttachment();if(h&&s<t.attachments.length){let a=t.attachments[s];for(let i in a){let l=a[i];if(h==l){let o=this.getAttachment(s,i);o&&n.setAttachment(o);break}}}s++}}},ls=class{index=0;name;boneData;color=new L(1,1,1,1);darkColor=null;attachmentName=null;blendMode=ht.Normal;visible=!0;constructor(e,t,s){if(e<0)throw new Error("index must be >= 0.");if(!t)throw new Error("name cannot be null.");if(!s)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=s}},ht=(e=>(e[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen",e))(ht||{}),hs=class extends qe{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;offsetRotation=0;offsetX=0;offsetY=0;offsetScaleX=0;offsetScaleY=0;offsetShearY=0;relative=!1;local=!1;constructor(e){super(e,0,!1)}},Ws=class{scale=1;attachmentLoader;linkedMeshes=new Array;constructor(e){this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new We;s.name="";let r=new zs(e),n=r.readInt32(),h=r.readInt32();s.hash=h==0&&n==0?null:h.toString(16)+n.toString(16),s.version=r.readString(),s.x=r.readFloat(),s.y=r.readFloat(),s.width=r.readFloat(),s.height=r.readFloat(),s.referenceScale=r.readFloat()*t;let a=r.readBoolean();a&&(s.fps=r.readFloat(),s.imagesPath=r.readString(),s.audioPath=r.readString());let i=0;i=r.readInt(!0);for(let o=0;o<i;o++){let c=r.readString();if(!c)throw new Error("String in string table must not be null.");r.strings.push(c)}i=r.readInt(!0);for(let o=0;o<i;o++){let c=r.readString();if(!c)throw new Error("Bone name must not be null.");let d=o==0?null:s.bones[r.readInt(!0)],f=new es(o,c,d);f.rotation=r.readFloat(),f.x=r.readFloat()*t,f.y=r.readFloat()*t,f.scaleX=r.readFloat(),f.scaleY=r.readFloat(),f.shearX=r.readFloat(),f.shearY=r.readFloat(),f.length=r.readFloat()*t,f.inherit=r.readByte(),f.skinRequired=r.readBoolean(),a&&(L.rgba8888ToColor(f.color,r.readInt32()),f.icon=r.readString()??void 0,f.visible=r.readBoolean()),s.bones.push(f)}i=r.readInt(!0);for(let o=0;o<i;o++){let c=r.readString();if(!c)throw new Error("Slot name must not be null.");let d=s.bones[r.readInt(!0)],f=new ls(o,c,d);L.rgba8888ToColor(f.color,r.readInt32());let u=r.readInt32();u!=-1&&L.rgb888ToColor(f.darkColor=new L,u),f.attachmentName=r.readStringRef(),f.blendMode=r.readInt(!0),a&&(f.visible=r.readBoolean()),s.slots.push(f)}i=r.readInt(!0);for(let o=0,c;o<i;o++){let d=r.readString();if(!d)throw new Error("IK constraint data name must not be null.");let f=new is(d);f.order=r.readInt(!0),c=r.readInt(!0);for(let m=0;m<c;m++)f.bones.push(s.bones[r.readInt(!0)]);f.target=s.bones[r.readInt(!0)];let u=r.readByte();f.skinRequired=(u&1)!=0,f.bendDirection=u&2?1:-1,f.compress=(u&4)!=0,f.stretch=(u&8)!=0,f.uniform=(u&16)!=0,u&32&&(f.mix=u&64?r.readFloat():1),u&128&&(f.softness=r.readFloat()*t),s.ikConstraints.push(f)}i=r.readInt(!0);for(let o=0,c;o<i;o++){let d=r.readString();if(!d)throw new Error("Transform constraint data name must not be null.");let f=new hs(d);f.order=r.readInt(!0),c=r.readInt(!0);for(let m=0;m<c;m++)f.bones.push(s.bones[r.readInt(!0)]);f.target=s.bones[r.readInt(!0)];let u=r.readByte();f.skinRequired=(u&1)!=0,f.local=(u&2)!=0,f.relative=(u&4)!=0,u&8&&(f.offsetRotation=r.readFloat()),u&16&&(f.offsetX=r.readFloat()*t),u&32&&(f.offsetY=r.readFloat()*t),u&64&&(f.offsetScaleX=r.readFloat()),u&128&&(f.offsetScaleY=r.readFloat()),u=r.readByte(),u&1&&(f.offsetShearY=r.readFloat()),u&2&&(f.mixRotate=r.readFloat()),u&4&&(f.mixX=r.readFloat()),u&8&&(f.mixY=r.readFloat()),u&16&&(f.mixScaleX=r.readFloat()),u&32&&(f.mixScaleY=r.readFloat()),u&64&&(f.mixShearY=r.readFloat()),s.transformConstraints.push(f)}i=r.readInt(!0);for(let o=0,c;o<i;o++){let d=r.readString();if(!d)throw new Error("Path constraint data name must not be null.");let f=new ns(d);f.order=r.readInt(!0),f.skinRequired=r.readBoolean(),c=r.readInt(!0);for(let m=0;m<c;m++)f.bones.push(s.bones[r.readInt(!0)]);f.target=s.slots[r.readInt(!0)];const u=r.readByte();f.positionMode=u&1,f.spacingMode=u>>1&3,f.rotateMode=u>>3&3,u&128&&(f.offsetRotation=r.readFloat()),f.position=r.readFloat(),f.positionMode==0&&(f.position*=t),f.spacing=r.readFloat(),(f.spacingMode==0||f.spacingMode==1)&&(f.spacing*=t),f.mixRotate=r.readFloat(),f.mixX=r.readFloat(),f.mixY=r.readFloat(),s.pathConstraints.push(f)}i=r.readInt(!0);for(let o=0,c;o<i;o++){const d=r.readString();if(!d)throw new Error("Physics constraint data name must not be null.");const f=new qs(d);f.order=r.readInt(!0),f.bone=s.bones[r.readInt(!0)];let u=r.readByte();f.skinRequired=(u&1)!=0,u&2&&(f.x=r.readFloat()),u&4&&(f.y=r.readFloat()),u&8&&(f.rotate=r.readFloat()),u&16&&(f.scaleX=r.readFloat()),u&32&&(f.shearX=r.readFloat()),f.limit=(u&64?r.readFloat():5e3)*t,f.step=1/r.readUnsignedByte(),f.inertia=r.readFloat(),f.strength=r.readFloat(),f.damping=r.readFloat(),f.massInverse=u&128?r.readFloat():1,f.wind=r.readFloat(),f.gravity=r.readFloat(),u=r.readByte(),u&1&&(f.inertiaGlobal=!0),u&2&&(f.strengthGlobal=!0),u&4&&(f.dampingGlobal=!0),u&8&&(f.massGlobal=!0),u&16&&(f.windGlobal=!0),u&32&&(f.gravityGlobal=!0),u&64&&(f.mixGlobal=!0),f.mix=u&128?r.readFloat():1,s.physicsConstraints.push(f)}let l=this.readSkin(r,s,!0,a);l&&(s.defaultSkin=l,s.skins.push(l));{let o=s.skins.length;for(B.setArraySize(s.skins,i=o+r.readInt(!0));o<i;o++){let c=this.readSkin(r,s,!1,a);if(!c)throw new Error("readSkin() should not have returned null.");s.skins[o]=c}}i=this.linkedMeshes.length;for(let o=0;o<i;o++){let c=this.linkedMeshes[o];const d=s.skins[c.skinIndex];if(!c.parent)throw new Error("Linked mesh parent must not be null");let f=d.getAttachment(c.slotIndex,c.parent);if(!f)throw new Error(`Parent mesh not found: ${c.parent}`);c.mesh.timelineAttachment=c.inheritTimeline?f:c.mesh,c.mesh.setParentMesh(f),c.mesh.region!=null&&c.mesh.updateRegion()}this.linkedMeshes.length=0,i=r.readInt(!0);for(let o=0;o<i;o++){let c=r.readString();if(!c)throw new Error("Event data name must not be null");let d=new rs(c);d.intValue=r.readInt(!1),d.floatValue=r.readFloat(),d.stringValue=r.readString(),d.audioPath=r.readString(),d.audioPath&&(d.volume=r.readFloat(),d.balance=r.readFloat()),s.events.push(d)}i=r.readInt(!0);for(let o=0;o<i;o++){let c=r.readString();if(!c)throw new Error("Animatio name must not be null.");s.animations.push(this.readAnimation(r,c,s))}return s}readSkin(e,t,s,r){let n=null,h=0;if(s){if(h=e.readInt(!0),h==0)return null;n=new ze("default")}else{let a=e.readString();if(!a)throw new Error("Skin name must not be null.");n=new ze(a),r&&L.rgba8888ToColor(n.color,e.readInt32()),n.bones.length=e.readInt(!0);for(let i=0,l=n.bones.length;i<l;i++)n.bones[i]=t.bones[e.readInt(!0)];for(let i=0,l=e.readInt(!0);i<l;i++)n.constraints.push(t.ikConstraints[e.readInt(!0)]);for(let i=0,l=e.readInt(!0);i<l;i++)n.constraints.push(t.transformConstraints[e.readInt(!0)]);for(let i=0,l=e.readInt(!0);i<l;i++)n.constraints.push(t.pathConstraints[e.readInt(!0)]);for(let i=0,l=e.readInt(!0);i<l;i++)n.constraints.push(t.physicsConstraints[e.readInt(!0)]);h=e.readInt(!0)}for(let a=0;a<h;a++){let i=e.readInt(!0);for(let l=0,o=e.readInt(!0);l<o;l++){let c=e.readStringRef();if(!c)throw new Error("Attachment name must not be null");let d=this.readAttachment(e,t,n,i,c,r);d&&n.setAttachment(i,c,d)}}return n}readAttachment(e,t,s,r,n,h){let a=this.scale,i=e.readByte();const l=i&8?e.readStringRef():n;if(!l)throw new Error("Attachment name must not be null");switch(i&7){case ke.Region:{let o=i&16?e.readStringRef():null;const c=i&32?e.readInt32():4294967295,d=i&64?this.readSequence(e):null;let f=i&128?e.readFloat():0,u=e.readFloat(),m=e.readFloat(),p=e.readFloat(),w=e.readFloat(),b=e.readFloat(),g=e.readFloat();o||(o=l);let x=this.attachmentLoader.newRegionAttachment(s,l,o,d);return x?(x.path=o,x.x=u*a,x.y=m*a,x.scaleX=p,x.scaleY=w,x.rotation=f,x.width=b*a,x.height=g*a,L.rgba8888ToColor(x.color,c),x.sequence=d,d==null&&x.updateRegion(),x):null}case ke.BoundingBox:{let o=this.readVertices(e,(i&16)!=0),c=h?e.readInt32():0,d=this.attachmentLoader.newBoundingBoxAttachment(s,l);return d?(d.worldVerticesLength=o.length,d.vertices=o.vertices,d.bones=o.bones,h&&L.rgba8888ToColor(d.color,c),d):null}case ke.Mesh:{let o=i&16?e.readStringRef():l;const c=i&32?e.readInt32():4294967295,d=i&64?this.readSequence(e):null,f=e.readInt(!0),u=this.readVertices(e,(i&128)!=0),m=this.readFloatArray(e,u.length,1),p=this.readShortArray(e,(u.length-f-2)*3);let w=[],b=0,g=0;h&&(w=this.readShortArray(e,e.readInt(!0)),b=e.readFloat(),g=e.readFloat()),o||(o=l);let x=this.attachmentLoader.newMeshAttachment(s,l,o,d);return x?(x.path=o,L.rgba8888ToColor(x.color,c),x.bones=u.bones,x.vertices=u.vertices,x.worldVerticesLength=u.length,x.triangles=p,x.regionUVs=m,d==null&&x.updateRegion(),x.hullLength=f<<1,x.sequence=d,h&&(x.edges=w,x.width=b*a,x.height=g*a),x):null}case ke.LinkedMesh:{const o=i&16?e.readStringRef():l;if(o==null)throw new Error("Path of linked mesh must not be null");const c=i&32?e.readInt32():4294967295,d=i&64?this.readSequence(e):null,f=(i&128)!=0,u=e.readInt(!0),m=e.readStringRef();let p=0,w=0;h&&(p=e.readFloat(),w=e.readFloat());let b=this.attachmentLoader.newMeshAttachment(s,l,o,d);return b?(b.path=o,L.rgba8888ToColor(b.color,c),b.sequence=d,h&&(b.width=p*a,b.height=w*a),this.linkedMeshes.push(new yr(b,u,r,m,f)),b):null}case ke.Path:{const o=(i&16)!=0,c=(i&32)!=0,d=this.readVertices(e,(i&64)!=0),f=B.newArray(d.length/6,0);for(let p=0,w=f.length;p<w;p++)f[p]=e.readFloat()*a;const u=h?e.readInt32():0,m=this.attachmentLoader.newPathAttachment(s,l);return m?(m.closed=o,m.constantSpeed=c,m.worldVerticesLength=d.length,m.vertices=d.vertices,m.bones=d.bones,m.lengths=f,h&&L.rgba8888ToColor(m.color,u),m):null}case ke.Point:{const o=e.readFloat(),c=e.readFloat(),d=e.readFloat(),f=h?e.readInt32():0,u=this.attachmentLoader.newPointAttachment(s,l);return u?(u.x=c*a,u.y=d*a,u.rotation=o,h&&L.rgba8888ToColor(u.color,f),u):null}case ke.Clipping:{const o=e.readInt(!0),c=this.readVertices(e,(i&16)!=0);let d=h?e.readInt32():0,f=this.attachmentLoader.newClippingAttachment(s,l);return f?(f.endSlot=t.slots[o],f.worldVerticesLength=c.length,f.vertices=c.vertices,f.bones=c.bones,h&&L.rgba8888ToColor(f.color,d),f):null}}return null}readSequence(e){let t=new bt(e.readInt(!0));return t.start=e.readInt(!0),t.digits=e.readInt(!0),t.setupIndex=e.readInt(!0),t}readVertices(e,t){const s=this.scale,r=e.readInt(!0),n=new vr;if(n.length=r<<1,!t)return n.vertices=this.readFloatArray(e,n.length,s),n;let h=new Array,a=new Array;for(let i=0;i<r;i++){let l=e.readInt(!0);a.push(l);for(let o=0;o<l;o++)a.push(e.readInt(!0)),h.push(e.readFloat()*s),h.push(e.readFloat()*s),h.push(e.readFloat())}return n.vertices=B.toFloatArray(h),n.bones=a,n}readFloatArray(e,t,s){let r=new Array(t);if(s==1)for(let n=0;n<t;n++)r[n]=e.readFloat();else for(let n=0;n<t;n++)r[n]=e.readFloat()*s;return r}readShortArray(e,t){let s=new Array(t);for(let r=0;r<t;r++)s[r]=e.readInt(!0);return s}readAnimation(e,t,s){e.readInt(!0);let r=new Array,n=this.scale;for(let l=0,o=e.readInt(!0);l<o;l++){let c=e.readInt(!0);for(let d=0,f=e.readInt(!0);d<f;d++){let u=e.readByte(),m=e.readInt(!0),p=m-1;switch(u){case Br:{let w=new Me(m,c);for(let b=0;b<m;b++)w.setFrame(b,e.readFloat(),e.readStringRef());r.push(w);break}case Er:{let w=e.readInt(!0),b=new Yt(m,w,c),g=e.readFloat(),x=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255;for(let S=0,A=0;b.setFrame(S,g,x,v,y,C),S!=p;S++){let M=e.readFloat(),T=e.readUnsignedByte()/255,F=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255;switch(e.readByte()){case me:b.setStepped(S);break;case ge:z(e,b,A++,S,0,g,M,x,T,1),z(e,b,A++,S,1,g,M,v,F,1),z(e,b,A++,S,2,g,M,y,P,1),z(e,b,A++,S,3,g,M,C,I,1)}g=M,x=T,v=F,y=P,C=I}r.push(b);break}case Rr:{let w=e.readInt(!0),b=new Pt(m,w,c),g=e.readFloat(),x=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255;for(let C=0,S=0;b.setFrame(C,g,x,v,y),C!=p;C++){let A=e.readFloat(),M=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255,F=e.readUnsignedByte()/255;switch(e.readByte()){case me:b.setStepped(C);break;case ge:z(e,b,S++,C,0,g,A,x,M,1),z(e,b,S++,C,1,g,A,v,T,1),z(e,b,S++,C,2,g,A,y,F,1)}g=A,x=M,v=T,y=F}r.push(b);break}case Dr:{let w=e.readInt(!0),b=new Xt(m,w,c),g=e.readFloat(),x=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255;for(let T=0,F=0;b.setFrame(T,g,x,v,y,C,S,A,M),T!=p;T++){let P=e.readFloat(),I=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255,V=e.readUnsignedByte()/255,U=e.readUnsignedByte()/255,_=e.readUnsignedByte()/255,H=e.readUnsignedByte()/255;switch(e.readByte()){case me:b.setStepped(T);break;case ge:z(e,b,F++,T,0,g,P,x,I,1),z(e,b,F++,T,1,g,P,v,Y,1),z(e,b,F++,T,2,g,P,y,E,1),z(e,b,F++,T,3,g,P,C,V,1),z(e,b,F++,T,4,g,P,S,U,1),z(e,b,F++,T,5,g,P,A,_,1),z(e,b,F++,T,6,g,P,M,H,1)}g=P,x=I,v=Y,y=E,C=V,S=U,A=_,M=H}r.push(b);break}case _r:{let w=e.readInt(!0),b=new Bt(m,w,c),g=e.readFloat(),x=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255;for(let M=0,T=0;b.setFrame(M,g,x,v,y,C,S,A),M!=p;M++){let F=e.readFloat(),P=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255,V=e.readUnsignedByte()/255,U=e.readUnsignedByte()/255;switch(e.readByte()){case me:b.setStepped(M);break;case ge:z(e,b,T++,M,0,g,F,x,P,1),z(e,b,T++,M,1,g,F,v,I,1),z(e,b,T++,M,2,g,F,y,Y,1),z(e,b,T++,M,3,g,F,C,E,1),z(e,b,T++,M,4,g,F,S,V,1),z(e,b,T++,M,5,g,F,A,U,1)}g=F,x=P,v=I,y=Y,C=E,S=V,A=U}r.push(b);break}case Lr:{let w=new Ft(m,e.readInt(!0),c),b=e.readFloat(),g=e.readUnsignedByte()/255;for(let x=0,v=0;w.setFrame(x,b,g),x!=p;x++){let y=e.readFloat(),C=e.readUnsignedByte()/255;switch(e.readByte()){case me:w.setStepped(x);break;case ge:z(e,w,v++,x,0,b,y,g,C,1)}b=y,g=C}r.push(w)}}}}for(let l=0,o=e.readInt(!0);l<o;l++){let c=e.readInt(!0);for(let d=0,f=e.readInt(!0);d<f;d++){let u=e.readByte(),m=e.readInt(!0);if(u==Xr){let w=new Mt(m,c);for(let b=0;b<m;b++)w.setFrame(b,e.readFloat(),e.readByte());r.push(w);continue}let p=e.readInt(!0);switch(u){case Cr:r.push(Z(e,new Ne(m,p,c),1));break;case Sr:r.push(cs(e,new wt(m,p,c),n));break;case kr:r.push(Z(e,new yt(m,p,c),n));break;case Ar:r.push(Z(e,new vt(m,p,c),n));break;case Tr:r.push(cs(e,new Ct(m,p,c),1));break;case Ir:r.push(Z(e,new St(m,p,c),1));break;case Mr:r.push(Z(e,new kt(m,p,c),1));break;case Yr:r.push(cs(e,new At(m,p,c),1));break;case Pr:r.push(Z(e,new Tt(m,p,c),1));break;case Fr:r.push(Z(e,new It(m,p,c),1))}}}for(let l=0,o=e.readInt(!0);l<o;l++){let c=e.readInt(!0),d=e.readInt(!0),f=d-1,u=new Rt(d,e.readInt(!0),c),m=e.readByte(),p=e.readFloat(),w=m&1?m&2?e.readFloat():1:0,b=m&4?e.readFloat()*n:0;for(let g=0,x=0;u.setFrame(g,p,w,b,m&8?1:-1,(m&16)!=0,(m&32)!=0),g!=f;g++){m=e.readByte();const v=e.readFloat(),y=m&1?m&2?e.readFloat():1:0,C=m&4?e.readFloat()*n:0;m&64?u.setStepped(g):m&128&&(z(e,u,x++,g,0,p,v,w,y,1),z(e,u,x++,g,1,p,v,b,C,n)),p=v,w=y,b=C}r.push(u)}for(let l=0,o=e.readInt(!0);l<o;l++){let c=e.readInt(!0),d=e.readInt(!0),f=d-1,u=new Dt(d,e.readInt(!0),c),m=e.readFloat(),p=e.readFloat(),w=e.readFloat(),b=e.readFloat(),g=e.readFloat(),x=e.readFloat(),v=e.readFloat();for(let y=0,C=0;u.setFrame(y,m,p,w,b,g,x,v),y!=f;y++){let S=e.readFloat(),A=e.readFloat(),M=e.readFloat(),T=e.readFloat(),F=e.readFloat(),P=e.readFloat(),I=e.readFloat();switch(e.readByte()){case me:u.setStepped(y);break;case ge:z(e,u,C++,y,0,m,S,p,A,1),z(e,u,C++,y,1,m,S,w,M,1),z(e,u,C++,y,2,m,S,b,T,1),z(e,u,C++,y,3,m,S,g,F,1),z(e,u,C++,y,4,m,S,x,P,1),z(e,u,C++,y,5,m,S,v,I,1)}m=S,p=A,w=M,b=T,g=F,x=P,v=I}r.push(u)}for(let l=0,o=e.readInt(!0);l<o;l++){let c=e.readInt(!0),d=s.pathConstraints[c];for(let f=0,u=e.readInt(!0);f<u;f++){const m=e.readByte(),p=e.readInt(!0),w=e.readInt(!0);switch(m){case Or:r.push(Z(e,new _t(p,w,c),d.positionMode==0?n:1));break;case Ur:r.push(Z(e,new Lt(p,w,c),d.spacingMode==0||d.spacingMode==1?n:1));break;case qr:let b=new Vt(p,w,c),g=e.readFloat(),x=e.readFloat(),v=e.readFloat(),y=e.readFloat();for(let C=0,S=0,A=b.getFrameCount()-1;b.setFrame(C,g,x,v,y),C!=A;C++){let M=e.readFloat(),T=e.readFloat(),F=e.readFloat(),P=e.readFloat();switch(e.readByte()){case me:b.setStepped(C);break;case ge:z(e,b,S++,C,0,g,M,x,T,1),z(e,b,S++,C,1,g,M,v,F,1),z(e,b,S++,C,2,g,M,y,P,1)}g=M,x=T,v=F,y=P}r.push(b)}}}for(let l=0,o=e.readInt(!0);l<o;l++){const c=e.readInt(!0)-1;for(let d=0,f=e.readInt(!0);d<f;d++){const u=e.readByte(),m=e.readInt(!0);if(u==Kr){const w=new Ze(m,c);for(let b=0;b<m;b++)w.setFrame(b,e.readFloat());r.push(w);continue}const p=e.readInt(!0);switch(u){case Wr:r.push(Z(e,new Nt(m,p,c),1));break;case zr:r.push(Z(e,new Ot(m,p,c),1));break;case Gr:r.push(Z(e,new Ut(m,p,c),1));break;case Hr:r.push(Z(e,new qt(m,p,c),1));break;case $r:r.push(Z(e,new Wt(m,p,c),1));break;case jr:r.push(Z(e,new zt(m,p,c),1));break;case Jr:r.push(Z(e,new Gt(m,p,c),1))}}}for(let l=0,o=e.readInt(!0);l<o;l++){let c=s.skins[e.readInt(!0)];for(let d=0,f=e.readInt(!0);d<f;d++){let u=e.readInt(!0);for(let m=0,p=e.readInt(!0);m<p;m++){let w=e.readStringRef();if(!w)throw new Error("attachmentName must not be null.");let b=c.getAttachment(u,w),g=e.readByte(),x=e.readInt(!0),v=x-1;switch(g){case Vr:{let y=b,C=y.bones,S=y.vertices,A=C?S.length/3*2:S.length,M=e.readInt(!0),T=new Et(x,M,u,y),F=e.readFloat();for(let P=0,I=0;;P++){let Y,E=e.readInt(!0);if(E==0)Y=C?B.newFloatArray(A):S;else{Y=B.newFloatArray(A);let U=e.readInt(!0);if(E+=U,n==1)for(let _=U;_<E;_++)Y[_]=e.readFloat();else for(let _=U;_<E;_++)Y[_]=e.readFloat()*n;if(!C)for(let _=0,H=Y.length;_<H;_++)Y[_]+=S[_]}if(T.setFrame(P,F,Y),P==v)break;let V=e.readFloat();switch(e.readByte()){case me:T.setStepped(P);break;case ge:z(e,T,I++,P,0,F,V,0,1,1)}F=V}r.push(T);break}case Nr:{let y=new Ee(x,u,b);for(let C=0;C<x;C++){let S=e.readFloat(),A=e.readInt32();y.setFrame(C,S,Cs[A&15],A>>4,e.readFloat())}r.push(y);break}}}}}let h=e.readInt(!0);if(h>0){let l=new Ye(h),o=s.slots.length;for(let c=0;c<h;c++){let d=e.readFloat(),f=e.readInt(!0),u=B.newArray(o,0);for(let b=o-1;b>=0;b--)u[b]=-1;let m=B.newArray(o-f,0),p=0,w=0;for(let b=0;b<f;b++){let g=e.readInt(!0);for(;p!=g;)m[w++]=p++;u[p+e.readInt(!0)]=p++}for(;p<o;)m[w++]=p++;for(let b=o-1;b>=0;b--)u[b]==-1&&(u[b]=m[--w]);l.setFrame(c,d,u)}r.push(l)}let a=e.readInt(!0);if(a>0){let l=new Oe(a);for(let o=0;o<a;o++){let c=e.readFloat(),d=s.events[e.readInt(!0)],f=new ss(c,d);f.intValue=e.readInt(!1),f.floatValue=e.readFloat(),f.stringValue=e.readString(),f.stringValue==null&&(f.stringValue=d.stringValue),f.data.audioPath&&(f.volume=e.readFloat(),f.balance=e.readFloat()),l.setFrame(o,f)}r.push(l)}let i=0;for(let l=0,o=r.length;l<o;l++)i=Math.max(i,r[l].getDuration());return new Ke(t,r,i)}},zs=class{constructor(e,t=new Array,s=0,r=new DataView(e instanceof ArrayBuffer?e:e.buffer)){this.strings=t,this.index=s,this.buffer=r}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let e=this.buffer.getInt16(this.index);return this.index+=2,e}readInt32(){let e=this.buffer.getInt32(this.index);return this.index+=4,e}readInt(e){let t=this.readByte(),s=t&127;return t&128&&(t=this.readByte(),s|=(t&127)<<7,t&128&&(t=this.readByte(),s|=(t&127)<<14,t&128&&(t=this.readByte(),s|=(t&127)<<21,t&128&&(t=this.readByte(),s|=(t&127)<<28)))),e?s:s>>>1^-(s&1)}readStringRef(){let e=this.readInt(!0);return e==0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="",s=0;for(let r=0;r<e;){let n=this.readUnsignedByte();switch(n>>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),r+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),r+=3;break;default:t+=String.fromCharCode(n),r++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},yr=class{parent;skinIndex;slotIndex;mesh;inheritTimeline;constructor(e,t,s,r,n){this.mesh=e,this.skinIndex=t,this.slotIndex=s,this.parent=r,this.inheritTimeline=n}},vr=class{constructor(e=null,t=null,s=0){this.bones=e,this.vertices=t,this.length=s}},ke=(e=>(e[e.Region=0]="Region",e[e.BoundingBox=1]="BoundingBox",e[e.Mesh=2]="Mesh",e[e.LinkedMesh=3]="LinkedMesh",e[e.Path=4]="Path",e[e.Point=5]="Point",e[e.Clipping=6]="Clipping",e))(ke||{});function Z(e,t,s){let r=e.readFloat(),n=e.readFloat()*s;for(let h=0,a=0,i=t.getFrameCount()-1;t.setFrame(h,r,n),h!=i;h++){let l=e.readFloat(),o=e.readFloat()*s;switch(e.readByte()){case me:t.setStepped(h);break;case ge:z(e,t,a++,h,0,r,l,n,o,s)}r=l,n=o}return t}function cs(e,t,s){let r=e.readFloat(),n=e.readFloat()*s,h=e.readFloat()*s;for(let a=0,i=0,l=t.getFrameCount()-1;t.setFrame(a,r,n,h),a!=l;a++){let o=e.readFloat(),c=e.readFloat()*s,d=e.readFloat()*s;switch(e.readByte()){case me:t.setStepped(a);break;case ge:z(e,t,i++,a,0,r,o,n,c,s),z(e,t,i++,a,1,r,o,h,d,s)}r=o,n=c,h=d}return t}function z(e,t,s,r,n,h,a,i,l,o){t.setBezier(s,r,n,h,i,e.readFloat(),e.readFloat()*o,e.readFloat(),e.readFloat()*o,a,l)}var Cr=0,Sr=1,kr=2,Ar=3,Tr=4,Ir=5,Mr=6,Yr=7,Pr=8,Fr=9,Xr=10,Br=0,Er=1,Rr=2,Dr=3,_r=4,Lr=5,Vr=0,Nr=1,Or=0,Ur=1,qr=2,Wr=0,zr=1,Gr=2,Hr=4,$r=5,jr=6,Jr=7,Kr=8,me=1,ge=2,ds=class{minX=0;minY=0;maxX=0;maxY=0;boundingBoxes=new Array;polygons=new Array;polygonPool=new Be(()=>B.newFloatArray(16));update(e,t){if(!e)throw new Error("skeleton cannot be null.");let s=this.boundingBoxes,r=this.polygons,n=this.polygonPool,h=e.slots,a=h.length;s.length=0,n.freeAll(r),r.length=0;for(let i=0;i<a;i++){let l=h[i];if(!l.bone.active)continue;let o=l.getAttachment();if(o instanceof it){let c=o;s.push(c);let d=n.obtain();d.length!=c.worldVerticesLength&&(d=B.newFloatArray(c.worldVerticesLength)),r.push(d),c.computeWorldVertices(l,0,c.worldVerticesLength,d,0,2)}}t?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,n=this.polygons;for(let h=0,a=n.length;h<a;h++){let i=n[h],l=i;for(let o=0,c=i.length;o<c;o+=2){let d=l[o],f=l[o+1];e=Math.min(e,d),t=Math.min(t,f),s=Math.max(s,d),r=Math.max(r,f)}}this.minX=e,this.minY=t,this.maxX=s,this.maxY=r}aabbContainsPoint(e,t){return e>=this.minX&&e<=this.maxX&&t>=this.minY&&t<=this.maxY}aabbIntersectsSegment(e,t,s,r){let n=this.minX,h=this.minY,a=this.maxX,i=this.maxY;if(e<=n&&s<=n||t<=h&&r<=h||e>=a&&s>=a||t>=i&&r>=i)return!1;let l=(r-t)/(s-e),o=l*(n-e)+t;if(o>h&&o<i||(o=l*(a-e)+t,o>h&&o<i))return!0;let c=(h-t)/l+e;return c>n&&c<a||(c=(i-t)/l+e,c>n&&c<a)}aabbIntersectsSkeleton(e){return this.minX<e.maxX&&this.maxX>e.minX&&this.minY<e.maxY&&this.maxY>e.minY}containsPoint(e,t){let s=this.polygons;for(let r=0,n=s.length;r<n;r++)if(this.containsPointPolygon(s[r],e,t))return this.boundingBoxes[r];return null}containsPointPolygon(e,t,s){let r=e,n=e.length,h=n-2,a=!1;for(let i=0;i<n;i+=2){let l=r[i+1],o=r[h+1];if(l<s&&o>=s||o<s&&l>=s){let c=r[i];c+(s-l)/(o-l)*(r[h]-c)<t&&(a=!a)}h=i}return a}intersectsSegment(e,t,s,r){let n=this.polygons;for(let h=0,a=n.length;h<a;h++)if(this.intersectsSegmentPolygon(n[h],e,t,s,r))return this.boundingBoxes[h];return null}intersectsSegmentPolygon(e,t,s,r,n){let h=e,a=e.length,i=t-r,l=s-n,o=t*n-s*r,c=h[a-2],d=h[a-1];for(let f=0;f<a;f+=2){let u=h[f],m=h[f+1],p=c*m-d*u,w=c-u,b=d-m,g=i*b-l*w,x=(o*w-i*p)/g;if((x>=c&&x<=u||x>=u&&x<=c)&&(x>=t&&x<=r||x>=r&&x<=t)){let v=(o*b-l*p)/g;if((v>=d&&v<=m||v>=m&&v<=d)&&(v>=s&&v<=n||v>=n&&v<=s))return!0}c=u,d=m}return!1}getPolygon(e){if(!e)throw new Error("boundingBox cannot be null.");let t=this.boundingBoxes.indexOf(e);return t==-1?null:this.polygons[t]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},ie=class{convexPolygons=new Array;convexPolygonsIndices=new Array;indicesArray=new Array;isConcaveArray=new Array;triangles=new Array;polygonPool=new Be(()=>new Array);polygonIndicesPool=new Be(()=>new Array);triangulate(e){let t=e,s=e.length>>1,r=this.indicesArray;r.length=0;for(let a=0;a<s;a++)r[a]=a;let n=this.isConcaveArray;n.length=0;for(let a=0,i=s;a<i;++a)n[a]=ie.isConcave(a,s,t,r);let h=this.triangles;for(h.length=0;s>3;){let a=s-1,i=0,l=1;for(;;){e:if(!n[i]){let d=r[a]<<1,f=r[i]<<1,u=r[l]<<1,m=t[d],p=t[d+1],w=t[f],b=t[f+1],g=t[u],x=t[u+1];for(let v=(l+1)%s;v!=a;v=(v+1)%s){if(!n[v])continue;let y=r[v]<<1,C=t[y],S=t[y+1];if(ie.positiveArea(g,x,m,p,C,S)&&ie.positiveArea(m,p,w,b,C,S)&&ie.positiveArea(w,b,g,x,C,S))break e}break}if(l==0){do{if(!n[i])break;i--}while(i>0);break}a=i,i=l,l=(l+1)%s}h.push(r[(s+i-1)%s]),h.push(r[i]),h.push(r[(i+1)%s]),r.splice(i,1),n.splice(i,1),s--;let o=(s+i-1)%s,c=i==s?0:i;n[o]=ie.isConcave(o,s,t,r),n[c]=ie.isConcave(c,s,t,r)}return s==3&&(h.push(r[2]),h.push(r[0]),h.push(r[1])),h}decompose(e,t){let s=e,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;let n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;let h=this.polygonIndicesPool.obtain();h.length=0;let a=this.polygonPool.obtain();a.length=0;let i=-1,l=0;for(let o=0,c=t.length;o<c;o+=3){let d=t[o]<<1,f=t[o+1]<<1,u=t[o+2]<<1,m=s[d],p=s[d+1],w=s[f],b=s[f+1],g=s[u],x=s[u+1],v=!1;if(i==d){let y=a.length-4,C=ie.winding(a[y],a[y+1],a[y+2],a[y+3],g,x),S=ie.winding(g,x,a[0],a[1],a[2],a[3]);C==l&&S==l&&(a.push(g),a.push(x),h.push(u),v=!0)}v||(a.length>0?(r.push(a),n.push(h)):(this.polygonPool.free(a),this.polygonIndicesPool.free(h)),a=this.polygonPool.obtain(),a.length=0,a.push(m),a.push(p),a.push(w),a.push(b),a.push(g),a.push(x),h=this.polygonIndicesPool.obtain(),h.length=0,h.push(d),h.push(f),h.push(u),l=ie.winding(m,p,w,b,g,x),i=d)}a.length>0&&(r.push(a),n.push(h));for(let o=0,c=r.length;o<c;o++){if(h=n[o],h.length==0)continue;let d=h[0],f=h[h.length-1];a=r[o];let u=a.length-4,m=a[u],p=a[u+1],w=a[u+2],b=a[u+3],g=a[0],x=a[1],v=a[2],y=a[3],C=ie.winding(m,p,w,b,g,x);for(let S=0;S<c;S++){if(S==o)continue;let A=n[S];if(A.length!=3)continue;let M=A[0],T=A[1],F=A[2],P=r[S],I=P[P.length-2],Y=P[P.length-1];if(M!=d||T!=f)continue;let E=ie.winding(m,p,w,b,I,Y),V=ie.winding(I,Y,g,x,v,y);E==C&&V==C&&(P.length=0,A.length=0,a.push(I),a.push(Y),h.push(F),m=w,p=b,w=I,b=Y,S=0)}}for(let o=r.length-1;o>=0;o--)a=r[o],a.length==0&&(r.splice(o,1),this.polygonPool.free(a),h=n[o],n.splice(o,1),this.polygonIndicesPool.free(h));return r}static isConcave(e,t,s,r){let n=r[(t+e-1)%t]<<1,h=r[e]<<1,a=r[(e+1)%t]<<1;return!this.positiveArea(s[n],s[n+1],s[h],s[h+1],s[a],s[a+1])}static positiveArea(e,t,s,r,n,h){return e*(h-r)+s*(t-h)+n*(r-t)>=0}static winding(e,t,s,r,n,h){let a=s-e,i=r-t;return n*i-h*a+a*t-e*i>=0?1:-1}},De=class{triangulator=new ie;clippingPolygon=new Array;clipOutput=new Array;clippedVertices=new Array;clippedUVs=new Array;clippedTriangles=new Array;scratch=new Array;clipAttachment=null;clippingPolygons=null;clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let s=t.worldVerticesLength,r=B.setArraySize(this.clippingPolygon,s);t.computeWorldVertices(e,0,s,r,0,2);let n=this.clippingPolygon;De.makeClockwise(n);let h=this.clippingPolygons=this.triangulator.decompose(n,this.triangulator.triangulate(n));for(let a=0,i=h.length;a<i;a++){let l=h[a];De.makeClockwise(l),l.push(l[0]),l.push(l[1])}return h.length}clipEndWithSlot(e){this.clipAttachment&&this.clipAttachment.endSlot==e.data&&this.clipEnd()}clipEnd(){this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return this.clipAttachment!=null}clipTriangles(e,t,s,r,n,h,a,i){let l,o,c,d,f,u;typeof t=="number"?(l=s,o=r,c=n,d=h,f=a,u=i):(l=t,o=s,c=r,d=n,f=h,u=a),c&&d&&f&&typeof u=="boolean"?this.clipTrianglesRender(e,l,o,c,d,f,u):this.clipTrianglesNoRender(e,l,o)}clipTrianglesNoRender(e,t,s){let r=this.clipOutput,n=this.clippedVertices,h=this.clippedTriangles,a=this.clippingPolygons,i=a.length,l=0;n.length=0,h.length=0;for(let o=0;o<s;o+=3){let c=t[o]<<1,d=e[c],f=e[c+1];c=t[o+1]<<1;let u=e[c],m=e[c+1];c=t[o+2]<<1;let p=e[c],w=e[c+1];for(let b=0;b<i;b++){let g=n.length;if(this.clip(d,f,u,m,p,w,a[b],r)){let x=r.length;if(x==0)continue;let v=x>>1,y=this.clipOutput,C=B.setArraySize(n,g+v*2);for(let A=0;A<x;A+=2,g+=2){let M=y[A],T=y[A+1];C[g]=M,C[g+1]=T}g=h.length;let S=B.setArraySize(h,g+3*(v-2));v--;for(let A=1;A<v;A++,g+=3)S[g]=l,S[g+1]=l+A,S[g+2]=l+A+1;l+=v+1}else{let x=B.setArraySize(n,g+6);x[g]=d,x[g+1]=f,x[g+2]=u,x[g+3]=m,x[g+4]=p,x[g+5]=w,g=h.length;let v=B.setArraySize(h,g+3);v[g]=l,v[g+1]=l+1,v[g+2]=l+2,l+=3;break}}}}clipTrianglesRender(e,t,s,r,n,h,a){let i=this.clipOutput,l=this.clippedVertices,o=this.clippedTriangles,c=this.clippingPolygons,d=c.length,f=a?12:8,u=0;l.length=0,o.length=0;for(let m=0;m<s;m+=3){let p=t[m]<<1,w=e[p],b=e[p+1],g=r[p],x=r[p+1];p=t[m+1]<<1;let v=e[p],y=e[p+1],C=r[p],S=r[p+1];p=t[m+2]<<1;let A=e[p],M=e[p+1],T=r[p],F=r[p+1];for(let P=0;P<d;P++){let I=l.length;if(this.clip(w,b,v,y,A,M,c[P],i)){let Y=i.length;if(Y==0)continue;let E=y-M,V=A-v,U=w-A,_=M-b,H=1/(E*U+V*(b-M)),$=Y>>1,j=this.clipOutput,D=B.setArraySize(l,I+$*f);for(let W=0;W<Y;W+=2,I+=f){let he=j[W],ae=j[W+1];D[I]=he,D[I+1]=ae,D[I+2]=n.r,D[I+3]=n.g,D[I+4]=n.b,D[I+5]=n.a;let K=he-A,ee=ae-M,te=(E*K+V*ee)*H,Te=(_*K+U*ee)*H,He=1-te-Te;D[I+6]=g*te+C*Te+T*He,D[I+7]=x*te+S*Te+F*He,a&&(D[I+8]=h.r,D[I+9]=h.g,D[I+10]=h.b,D[I+11]=h.a)}I=o.length;let q=B.setArraySize(o,I+3*($-2));$--;for(let W=1;W<$;W++,I+=3)q[I]=u,q[I+1]=u+W,q[I+2]=u+W+1;u+=$+1}else{let Y=B.setArraySize(l,I+3*f);Y[I]=w,Y[I+1]=b,Y[I+2]=n.r,Y[I+3]=n.g,Y[I+4]=n.b,Y[I+5]=n.a,a?(Y[I+6]=g,Y[I+7]=x,Y[I+8]=h.r,Y[I+9]=h.g,Y[I+10]=h.b,Y[I+11]=h.a,Y[I+12]=v,Y[I+13]=y,Y[I+14]=n.r,Y[I+15]=n.g,Y[I+16]=n.b,Y[I+17]=n.a,Y[I+18]=C,Y[I+19]=S,Y[I+20]=h.r,Y[I+21]=h.g,Y[I+22]=h.b,Y[I+23]=h.a,Y[I+24]=A,Y[I+25]=M,Y[I+26]=n.r,Y[I+27]=n.g,Y[I+28]=n.b,Y[I+29]=n.a,Y[I+30]=T,Y[I+31]=F,Y[I+32]=h.r,Y[I+33]=h.g,Y[I+34]=h.b,Y[I+35]=h.a):(Y[I+6]=g,Y[I+7]=x,Y[I+8]=v,Y[I+9]=y,Y[I+10]=n.r,Y[I+11]=n.g,Y[I+12]=n.b,Y[I+13]=n.a,Y[I+14]=C,Y[I+15]=S,Y[I+16]=A,Y[I+17]=M,Y[I+18]=n.r,Y[I+19]=n.g,Y[I+20]=n.b,Y[I+21]=n.a,Y[I+22]=T,Y[I+23]=F),I=o.length;let E=B.setArraySize(o,I+3);E[I]=u,E[I+1]=u+1,E[I+2]=u+2,u+=3;break}}}}clipTrianglesUnpacked(e,t,s,r){let n=this.clipOutput,h=this.clippedVertices,a=this.clippedUVs,i=this.clippedTriangles,l=this.clippingPolygons,o=l.length,c=0;h.length=0,a.length=0,i.length=0;for(let d=0;d<s;d+=3){let f=t[d]<<1,u=e[f],m=e[f+1],p=r[f],w=r[f+1];f=t[d+1]<<1;let b=e[f],g=e[f+1],x=r[f],v=r[f+1];f=t[d+2]<<1;let y=e[f],C=e[f+1],S=r[f],A=r[f+1];for(let M=0;M<o;M++){let T=h.length;if(this.clip(u,m,b,g,y,C,l[M],n)){let F=n.length;if(F==0)continue;let P=g-C,I=y-b,Y=u-y,E=C-m,V=1/(P*Y+I*(m-C)),U=F>>1,_=this.clipOutput,H=B.setArraySize(h,T+U*2),$=B.setArraySize(a,T+U*2);for(let D=0;D<F;D+=2,T+=2){let q=_[D],W=_[D+1];H[T]=q,H[T+1]=W;let he=q-y,ae=W-C,K=(P*he+I*ae)*V,ee=(E*he+Y*ae)*V,te=1-K-ee;$[T]=p*K+x*ee+S*te,$[T+1]=w*K+v*ee+A*te}T=i.length;let j=B.setArraySize(i,T+3*(U-2));U--;for(let D=1;D<U;D++,T+=3)j[T]=c,j[T+1]=c+D,j[T+2]=c+D+1;c+=U+1}else{let F=B.setArraySize(h,T+6);F[T]=u,F[T+1]=m,F[T+2]=b,F[T+3]=g,F[T+4]=y,F[T+5]=C;let P=B.setArraySize(a,T+3*2);P[T]=p,P[T+1]=w,P[T+2]=x,P[T+3]=v,P[T+4]=S,P[T+5]=A,T=i.length;let I=B.setArraySize(i,T+3);I[T]=c,I[T+1]=c+1,I[T+2]=c+2,c+=3;break}}}}clip(e,t,s,r,n,h,a,i){let l=i,o=!1,c;a.length%4>=2?(c=i,i=this.scratch):c=this.scratch,c.length=0,c.push(e),c.push(t),c.push(s),c.push(r),c.push(n),c.push(h),c.push(e),c.push(t),i.length=0;let d=a.length-4,f=a;for(let u=0;;u+=2){let m=f[u],p=f[u+1],w=m-f[u+2],b=p-f[u+3],g=i.length,x=c;for(let y=0,C=c.length-2;y<C;){let S=x[y],A=x[y+1];y+=2;let M=x[y],T=x[y+1],F=b*(m-M)>w*(p-T),P=b*(m-S)-w*(p-A);if(P>0){if(F){i.push(M),i.push(T);continue}let I=M-S,Y=T-A,E=P/(I*b-Y*w);if(E>=0&&E<=1)i.push(S+I*E),i.push(A+Y*E);else{i.push(M),i.push(T);continue}}else if(F){let I=M-S,Y=T-A,E=P/(I*b-Y*w);if(E>=0&&E<=1)i.push(S+I*E),i.push(A+Y*E),i.push(M),i.push(T);else{i.push(M),i.push(T);continue}}o=!0}if(g==i.length)return l.length=0,!0;if(i.push(i[0]),i.push(i[1]),u==d)break;let v=i;i=c,i.length=0,c=v}if(l!=i){l.length=0;for(let u=0,m=i.length-2;u<m;u++)l[u]=i[u]}else l.length=l.length-2;return o}static makeClockwise(e){let t=e,s=e.length,r=t[s-2]*t[1]-t[0]*t[s-1],n=0,h=0,a=0,i=0;for(let l=0,o=s-3;l<o;l+=2)n=t[l],h=t[l+1],a=t[l+2],i=t[l+3],r+=n*i-a*h;if(!(r<0))for(let l=0,o=s-2,c=s>>1;l<c;l+=2){let d=t[l],f=t[l+1],u=o-l;t[l]=t[u],t[l+1]=t[u+1],t[u]=d,t[u+1]=f}}},Gs=class{attachmentLoader;scale=1;linkedMeshes=new Array;constructor(e){this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new We,r=typeof e=="string"?JSON.parse(e):e,n=r.skeleton;if(n&&(s.hash=n.hash,s.version=n.spine,s.x=n.x,s.y=n.y,s.width=n.width,s.height=n.height,s.referenceScale=k(n,"referenceScale",100)*t,s.fps=n.fps,s.imagesPath=n.images??null,s.audioPath=n.audio??null),r.bones)for(let h=0;h<r.bones.length;h++){let a=r.bones[h],i=null,l=k(a,"parent",null);l&&(i=s.findBone(l));let o=new es(s.bones.length,a.name,i);o.length=k(a,"length",0)*t,o.x=k(a,"x",0)*t,o.y=k(a,"y",0)*t,o.rotation=k(a,"rotation",0),o.scaleX=k(a,"scaleX",1),o.scaleY=k(a,"scaleY",1),o.shearX=k(a,"shearX",0),o.shearY=k(a,"shearY",0),o.inherit=B.enumValue(Ue,k(a,"inherit","Normal")),o.skinRequired=k(a,"skin",!1);let c=k(a,"color",null);c&&o.color.setFromString(c),s.bones.push(o)}if(r.slots)for(let h=0;h<r.slots.length;h++){let a=r.slots[h],i=a.name,l=s.findBone(a.bone);if(!l)throw new Error(`Couldn't find bone ${a.bone} for slot ${i}`);let o=new ls(s.slots.length,i,l),c=k(a,"color",null);c&&o.color.setFromString(c);let d=k(a,"dark",null);d&&(o.darkColor=L.fromString(d)),o.attachmentName=k(a,"attachment",null),o.blendMode=B.enumValue(ht,k(a,"blend","normal")),o.visible=k(a,"visible",!0),s.slots.push(o)}if(r.ik)for(let h=0;h<r.ik.length;h++){let a=r.ik[h],i=new is(a.name);i.order=k(a,"order",0),i.skinRequired=k(a,"skin",!1);for(let o=0;o<a.bones.length;o++){let c=s.findBone(a.bones[o]);if(!c)throw new Error(`Couldn't find bone ${a.bones[o]} for IK constraint ${a.name}.`);i.bones.push(c)}let l=s.findBone(a.target);if(!l)throw new Error(`Couldn't find target bone ${a.target} for IK constraint ${a.name}.`);i.target=l,i.mix=k(a,"mix",1),i.softness=k(a,"softness",0)*t,i.bendDirection=k(a,"bendPositive",!0)?1:-1,i.compress=k(a,"compress",!1),i.stretch=k(a,"stretch",!1),i.uniform=k(a,"uniform",!1),s.ikConstraints.push(i)}if(r.transform)for(let h=0;h<r.transform.length;h++){let a=r.transform[h],i=new hs(a.name);i.order=k(a,"order",0),i.skinRequired=k(a,"skin",!1);for(let c=0;c<a.bones.length;c++){let d=a.bones[c],f=s.findBone(d);if(!f)throw new Error(`Couldn't find bone ${d} for transform constraint ${a.name}.`);i.bones.push(f)}let l=a.target,o=s.findBone(l);if(!o)throw new Error(`Couldn't find target bone ${l} for transform constraint ${a.name}.`);i.target=o,i.local=k(a,"local",!1),i.relative=k(a,"relative",!1),i.offsetRotation=k(a,"rotation",0),i.offsetX=k(a,"x",0)*t,i.offsetY=k(a,"y",0)*t,i.offsetScaleX=k(a,"scaleX",0),i.offsetScaleY=k(a,"scaleY",0),i.offsetShearY=k(a,"shearY",0),i.mixRotate=k(a,"mixRotate",1),i.mixX=k(a,"mixX",1),i.mixY=k(a,"mixY",i.mixX),i.mixScaleX=k(a,"mixScaleX",1),i.mixScaleY=k(a,"mixScaleY",i.mixScaleX),i.mixShearY=k(a,"mixShearY",1),s.transformConstraints.push(i)}if(r.path)for(let h=0;h<r.path.length;h++){let a=r.path[h],i=new ns(a.name);i.order=k(a,"order",0),i.skinRequired=k(a,"skin",!1);for(let c=0;c<a.bones.length;c++){let d=a.bones[c],f=s.findBone(d);if(!f)throw new Error(`Couldn't find bone ${d} for path constraint ${a.name}.`);i.bones.push(f)}let l=a.target,o=s.findSlot(l);if(!o)throw new Error(`Couldn't find target slot ${l} for path constraint ${a.name}.`);i.target=o,i.positionMode=B.enumValue(at,k(a,"positionMode","Percent")),i.spacingMode=B.enumValue(ot,k(a,"spacingMode","Length")),i.rotateMode=B.enumValue(lt,k(a,"rotateMode","Tangent")),i.offsetRotation=k(a,"rotation",0),i.position=k(a,"position",0),i.positionMode==0&&(i.position*=t),i.spacing=k(a,"spacing",0),(i.spacingMode==0||i.spacingMode==1)&&(i.spacing*=t),i.mixRotate=k(a,"mixRotate",1),i.mixX=k(a,"mixX",1),i.mixY=k(a,"mixY",i.mixX),s.pathConstraints.push(i)}if(r.physics)for(let h=0;h<r.physics.length;h++){const a=r.physics[h],i=new qs(a.name);i.order=k(a,"order",0),i.skinRequired=k(a,"skin",!1);const l=a.bone,o=s.findBone(l);if(o==null)throw new Error("Physics bone not found: "+l);i.bone=o,i.x=k(a,"x",0),i.y=k(a,"y",0),i.rotate=k(a,"rotate",0),i.scaleX=k(a,"scaleX",0),i.shearX=k(a,"shearX",0),i.limit=k(a,"limit",5e3)*t,i.step=1/k(a,"fps",60),i.inertia=k(a,"inertia",1),i.strength=k(a,"strength",100),i.damping=k(a,"damping",1),i.massInverse=1/k(a,"mass",1),i.wind=k(a,"wind",0),i.gravity=k(a,"gravity",0),i.mix=k(a,"mix",1),i.inertiaGlobal=k(a,"inertiaGlobal",!1),i.strengthGlobal=k(a,"strengthGlobal",!1),i.dampingGlobal=k(a,"dampingGlobal",!1),i.massGlobal=k(a,"massGlobal",!1),i.windGlobal=k(a,"windGlobal",!1),i.gravityGlobal=k(a,"gravityGlobal",!1),i.mixGlobal=k(a,"mixGlobal",!1),s.physicsConstraints.push(i)}if(r.skins)for(let h=0;h<r.skins.length;h++){let a=r.skins[h],i=new ze(a.name);if(a.bones)for(let l=0;l<a.bones.length;l++){let o=a.bones[l],c=s.findBone(o);if(!c)throw new Error(`Couldn't find bone ${o} for skin ${a.name}.`);i.bones.push(c)}if(a.ik)for(let l=0;l<a.ik.length;l++){let o=a.ik[l],c=s.findIkConstraint(o);if(!c)throw new Error(`Couldn't find IK constraint ${o} for skin ${a.name}.`);i.constraints.push(c)}if(a.transform)for(let l=0;l<a.transform.length;l++){let o=a.transform[l],c=s.findTransformConstraint(o);if(!c)throw new Error(`Couldn't find transform constraint ${o} for skin ${a.name}.`);i.constraints.push(c)}if(a.path)for(let l=0;l<a.path.length;l++){let o=a.path[l],c=s.findPathConstraint(o);if(!c)throw new Error(`Couldn't find path constraint ${o} for skin ${a.name}.`);i.constraints.push(c)}if(a.physics)for(let l=0;l<a.physics.length;l++){let o=a.physics[l],c=s.findPhysicsConstraint(o);if(!c)throw new Error(`Couldn't find physics constraint ${o} for skin ${a.name}.`);i.constraints.push(c)}for(let l in a.attachments){let o=s.findSlot(l);if(!o)throw new Error(`Couldn't find slot ${l} for skin ${a.name}.`);let c=a.attachments[l];for(let d in c){let f=this.readAttachment(c[d],i,o.index,d,s);f&&i.setAttachment(o.index,d,f)}}s.skins.push(i),i.name=="default"&&(s.defaultSkin=i)}for(let h=0,a=this.linkedMeshes.length;h<a;h++){let i=this.linkedMeshes[h],l=i.skin?s.findSkin(i.skin):s.defaultSkin;if(!l)throw new Error(`Skin not found: ${i.skin}`);let o=l.getAttachment(i.slotIndex,i.parent);if(!o)throw new Error(`Parent mesh not found: ${i.parent}`);i.mesh.timelineAttachment=i.inheritTimeline?o:i.mesh,i.mesh.setParentMesh(o),i.mesh.region!=null&&i.mesh.updateRegion()}if(this.linkedMeshes.length=0,r.events)for(let h in r.events){let a=r.events[h],i=new rs(h);i.intValue=k(a,"int",0),i.floatValue=k(a,"float",0),i.stringValue=k(a,"string",""),i.audioPath=k(a,"audio",null),i.audioPath&&(i.volume=k(a,"volume",1),i.balance=k(a,"balance",0)),s.events.push(i)}if(r.animations)for(let h in r.animations){let a=r.animations[h];this.readAnimation(a,h,s)}return s}readAttachment(e,t,s,r,n){let h=this.scale;switch(r=k(e,"name",r),k(e,"type","region")){case"region":{let a=k(e,"path",r),i=this.readSequence(k(e,"sequence",null)),l=this.attachmentLoader.newRegionAttachment(t,r,a,i);if(!l)return null;l.path=a,l.x=k(e,"x",0)*h,l.y=k(e,"y",0)*h,l.scaleX=k(e,"scaleX",1),l.scaleY=k(e,"scaleY",1),l.rotation=k(e,"rotation",0),l.width=e.width*h,l.height=e.height*h,l.sequence=i;let o=k(e,"color",null);return o&&l.color.setFromString(o),l.region!=null&&l.updateRegion(),l}case"boundingbox":{let a=this.attachmentLoader.newBoundingBoxAttachment(t,r);if(!a)return null;this.readVertices(e,a,e.vertexCount<<1);let i=k(e,"color",null);return i&&a.color.setFromString(i),a}case"mesh":case"linkedmesh":{let a=k(e,"path",r),i=this.readSequence(k(e,"sequence",null)),l=this.attachmentLoader.newMeshAttachment(t,r,a,i);if(!l)return null;l.path=a;let o=k(e,"color",null);o&&l.color.setFromString(o),l.width=k(e,"width",0)*h,l.height=k(e,"height",0)*h,l.sequence=i;let c=k(e,"parent",null);if(c)return this.linkedMeshes.push(new Qr(l,k(e,"skin",null),s,c,k(e,"timelines",!0))),l;let d=e.uvs;return this.readVertices(e,l,d.length),l.triangles=e.triangles,l.regionUVs=d,l.region!=null&&l.updateRegion(),l.edges=k(e,"edges",null),l.hullLength=k(e,"hull",0)*2,l}case"path":{let a=this.attachmentLoader.newPathAttachment(t,r);if(!a)return null;a.closed=k(e,"closed",!1),a.constantSpeed=k(e,"constantSpeed",!0);let i=e.vertexCount;this.readVertices(e,a,i<<1);let l=B.newArray(i/3,0);for(let c=0;c<e.lengths.length;c++)l[c]=e.lengths[c]*h;a.lengths=l;let o=k(e,"color",null);return o&&a.color.setFromString(o),a}case"point":{let a=this.attachmentLoader.newPointAttachment(t,r);if(!a)return null;a.x=k(e,"x",0)*h,a.y=k(e,"y",0)*h,a.rotation=k(e,"rotation",0);let i=k(e,"color",null);return i&&a.color.setFromString(i),a}case"clipping":{let a=this.attachmentLoader.newClippingAttachment(t,r);if(!a)return null;let i=k(e,"end",null);i&&(a.endSlot=n.findSlot(i));let l=e.vertexCount;this.readVertices(e,a,l<<1);let o=k(e,"color",null);return o&&a.color.setFromString(o),a}}return null}readSequence(e){if(e==null)return null;let t=new bt(k(e,"count",0));return t.start=k(e,"start",1),t.digits=k(e,"digits",0),t.setupIndex=k(e,"setup",0),t}readVertices(e,t,s){let r=this.scale;t.worldVerticesLength=s;let n=e.vertices;if(s==n.length){let i=B.toFloatArray(n);if(r!=1)for(let l=0,o=n.length;l<o;l++)i[l]*=r;t.vertices=i;return}let h=new Array,a=new Array;for(let i=0,l=n.length;i<l;){let o=n[i++];a.push(o);for(let c=i+o*4;i<c;i+=4)a.push(n[i]),h.push(n[i+1]*r),h.push(n[i+2]*r),h.push(n[i+3])}t.bones=a,t.vertices=B.toFloatArray(h)}readAnimation(e,t,s){let r=this.scale,n=new Array;if(e.slots)for(let a in e.slots){let i=e.slots[a],l=s.findSlot(a);if(!l)throw new Error("Slot not found: "+a);let o=l.index;for(let c in i){let d=i[c];if(!d)continue;let f=d.length;if(c=="attachment"){let u=new Me(f,o);for(let m=0;m<f;m++){let p=d[m];u.setFrame(m,k(p,"time",0),k(p,"name",null))}n.push(u)}else if(c=="rgba"){let u=new Yt(f,f<<2,o),m=d[0],p=k(m,"time",0),w=L.fromString(m.color);for(let b=0,g=0;;b++){u.setFrame(b,p,w.r,w.g,w.b,w.a);let x=d[b+1];if(!x){u.shrink(g);break}let v=k(x,"time",0),y=L.fromString(x.color),C=m.curve;C&&(g=G(C,u,g,b,0,p,v,w.r,y.r,1),g=G(C,u,g,b,1,p,v,w.g,y.g,1),g=G(C,u,g,b,2,p,v,w.b,y.b,1),g=G(C,u,g,b,3,p,v,w.a,y.a,1)),p=v,w=y,m=x}n.push(u)}else if(c=="rgb"){let u=new Pt(f,f*3,o),m=d[0],p=k(m,"time",0),w=L.fromString(m.color);for(let b=0,g=0;;b++){u.setFrame(b,p,w.r,w.g,w.b);let x=d[b+1];if(!x){u.shrink(g);break}let v=k(x,"time",0),y=L.fromString(x.color),C=m.curve;C&&(g=G(C,u,g,b,0,p,v,w.r,y.r,1),g=G(C,u,g,b,1,p,v,w.g,y.g,1),g=G(C,u,g,b,2,p,v,w.b,y.b,1)),p=v,w=y,m=x}n.push(u)}else if(c=="alpha")n.push(ue(d,new Ft(f,f,o),0,1));else if(c=="rgba2"){let u=new Xt(f,f*7,o),m=d[0],p=k(m,"time",0),w=L.fromString(m.light),b=L.fromString(m.dark);for(let g=0,x=0;;g++){u.setFrame(g,p,w.r,w.g,w.b,w.a,b.r,b.g,b.b);let v=d[g+1];if(!v){u.shrink(x);break}let y=k(v,"time",0),C=L.fromString(v.light),S=L.fromString(v.dark),A=m.curve;A&&(x=G(A,u,x,g,0,p,y,w.r,C.r,1),x=G(A,u,x,g,1,p,y,w.g,C.g,1),x=G(A,u,x,g,2,p,y,w.b,C.b,1),x=G(A,u,x,g,3,p,y,w.a,C.a,1),x=G(A,u,x,g,4,p,y,b.r,S.r,1),x=G(A,u,x,g,5,p,y,b.g,S.g,1),x=G(A,u,x,g,6,p,y,b.b,S.b,1)),p=y,w=C,b=S,m=v}n.push(u)}else if(c=="rgb2"){let u=new Bt(f,f*6,o),m=d[0],p=k(m,"time",0),w=L.fromString(m.light),b=L.fromString(m.dark);for(let g=0,x=0;;g++){u.setFrame(g,p,w.r,w.g,w.b,b.r,b.g,b.b);let v=d[g+1];if(!v){u.shrink(x);break}let y=k(v,"time",0),C=L.fromString(v.light),S=L.fromString(v.dark),A=m.curve;A&&(x=G(A,u,x,g,0,p,y,w.r,C.r,1),x=G(A,u,x,g,1,p,y,w.g,C.g,1),x=G(A,u,x,g,2,p,y,w.b,C.b,1),x=G(A,u,x,g,3,p,y,b.r,S.r,1),x=G(A,u,x,g,4,p,y,b.g,S.g,1),x=G(A,u,x,g,5,p,y,b.b,S.b,1)),p=y,w=C,b=S,m=v}n.push(u)}}}if(e.bones)for(let a in e.bones){let i=e.bones[a],l=s.findBone(a);if(!l)throw new Error("Bone not found: "+a);let o=l.index;for(let c in i){let d=i[c],f=d.length;if(f!=0){if(c==="rotate")n.push(ue(d,new Ne(f,f,o),0,1));else if(c==="translate"){let u=new wt(f,f<<1,o);n.push(fs(d,u,"x","y",0,r))}else if(c==="translatex"){let u=new yt(f,f,o);n.push(ue(d,u,0,r))}else if(c==="translatey"){let u=new vt(f,f,o);n.push(ue(d,u,0,r))}else if(c==="scale"){let u=new Ct(f,f<<1,o);n.push(fs(d,u,"x","y",1,1))}else if(c==="scalex"){let u=new St(f,f,o);n.push(ue(d,u,1,1))}else if(c==="scaley"){let u=new kt(f,f,o);n.push(ue(d,u,1,1))}else if(c==="shear"){let u=new At(f,f<<1,o);n.push(fs(d,u,"x","y",0,1))}else if(c==="shearx"){let u=new Tt(f,f,o);n.push(ue(d,u,0,1))}else if(c==="sheary"){let u=new It(f,f,o);n.push(ue(d,u,0,1))}else if(c==="inherit"){let u=new Mt(f,l.index);for(let m=0;m<d.length;m++){let p=d[m];u.setFrame(m,k(p,"time",0),B.enumValue(Ue,k(p,"inherit","Normal")))}n.push(u)}}}}if(e.ik)for(let a in e.ik){let i=e.ik[a],l=i[0];if(!l)continue;let o=s.findIkConstraint(a);if(!o)throw new Error("IK Constraint not found: "+a);let c=s.ikConstraints.indexOf(o),d=new Rt(i.length,i.length<<1,c),f=k(l,"time",0),u=k(l,"mix",1),m=k(l,"softness",0)*r;for(let p=0,w=0;;p++){d.setFrame(p,f,u,m,k(l,"bendPositive",!0)?1:-1,k(l,"compress",!1),k(l,"stretch",!1));let b=i[p+1];if(!b){d.shrink(w);break}let g=k(b,"time",0),x=k(b,"mix",1),v=k(b,"softness",0)*r,y=l.curve;y&&(w=G(y,d,w,p,0,f,g,u,x,1),w=G(y,d,w,p,1,f,g,m,v,r)),f=g,u=x,m=v,l=b}n.push(d)}if(e.transform)for(let a in e.transform){let i=e.transform[a],l=i[0];if(!l)continue;let o=s.findTransformConstraint(a);if(!o)throw new Error("Transform constraint not found: "+a);let c=s.transformConstraints.indexOf(o),d=new Dt(i.length,i.length*6,c),f=k(l,"time",0),u=k(l,"mixRotate",1),m=k(l,"mixX",1),p=k(l,"mixY",m),w=k(l,"mixScaleX",1),b=k(l,"mixScaleY",w),g=k(l,"mixShearY",1);for(let x=0,v=0;;x++){d.setFrame(x,f,u,m,p,w,b,g);let y=i[x+1];if(!y){d.shrink(v);break}let C=k(y,"time",0),S=k(y,"mixRotate",1),A=k(y,"mixX",1),M=k(y,"mixY",A),T=k(y,"mixScaleX",1),F=k(y,"mixScaleY",T),P=k(y,"mixShearY",1),I=l.curve;I&&(v=G(I,d,v,x,0,f,C,u,S,1),v=G(I,d,v,x,1,f,C,m,A,1),v=G(I,d,v,x,2,f,C,p,M,1),v=G(I,d,v,x,3,f,C,w,T,1),v=G(I,d,v,x,4,f,C,b,F,1),v=G(I,d,v,x,5,f,C,g,P,1)),f=C,u=S,m=A,p=M,w=T,b=F,w=T,l=y}n.push(d)}if(e.path)for(let a in e.path){let i=e.path[a],l=s.findPathConstraint(a);if(!l)throw new Error("Path constraint not found: "+a);let o=s.pathConstraints.indexOf(l);for(let c in i){let d=i[c],f=d[0];if(!f)continue;let u=d.length;if(c==="position"){let m=new _t(u,u,o);n.push(ue(d,m,0,l.positionMode==0?r:1))}else if(c==="spacing"){let m=new Lt(u,u,o);n.push(ue(d,m,0,l.spacingMode==0||l.spacingMode==1?r:1))}else if(c==="mix"){let m=new Vt(u,u*3,o),p=k(f,"time",0),w=k(f,"mixRotate",1),b=k(f,"mixX",1),g=k(f,"mixY",b);for(let x=0,v=0;;x++){m.setFrame(x,p,w,b,g);let y=d[x+1];if(!y){m.shrink(v);break}let C=k(y,"time",0),S=k(y,"mixRotate",1),A=k(y,"mixX",1),M=k(y,"mixY",A),T=f.curve;T&&(v=G(T,m,v,x,0,p,C,w,S,1),v=G(T,m,v,x,1,p,C,b,A,1),v=G(T,m,v,x,2,p,C,g,M,1)),p=C,w=S,b=A,g=M,f=y}n.push(m)}}}if(e.physics)for(let a in e.physics){let i=e.physics[a],l=-1;if(a.length>0){let o=s.findPhysicsConstraint(a);if(!o)throw new Error("Physics constraint not found: "+a);l=s.physicsConstraints.indexOf(o)}for(let o in i){let c=i[o],d=c[0];if(!d)continue;let f=c.length;if(o=="reset"){const m=new Ze(f,l);for(let p=0;d!=null;d=c[p+1],p++)m.setFrame(p,k(d,"time",0));n.push(m);continue}let u;if(o=="inertia")u=new Nt(f,f,l);else if(o=="strength")u=new Ot(f,f,l);else if(o=="damping")u=new Ut(f,f,l);else if(o=="mass")u=new qt(f,f,l);else if(o=="wind")u=new Wt(f,f,l);else if(o=="gravity")u=new zt(f,f,l);else if(o=="mix")u=new Gt(f,f,l);else continue;n.push(ue(c,u,0,1))}}if(e.attachments)for(let a in e.attachments){let i=e.attachments[a],l=s.findSkin(a);if(!l)throw new Error("Skin not found: "+a);for(let o in i){let c=i[o],d=s.findSlot(o);if(!d)throw new Error("Slot not found: "+o);let f=d.index;for(let u in c){let m=c[u],p=l.getAttachment(f,u);for(let w in m){let b=m[w],g=b[0];if(g){if(w=="deform"){let x=p.bones,v=p.vertices,y=x?v.length/3*2:v.length,C=new Et(b.length,b.length,f,p),S=k(g,"time",0);for(let A=0,M=0;;A++){let T,F=k(g,"vertices",null);if(!F)T=x?B.newFloatArray(y):v;else{T=B.newFloatArray(y);let E=k(g,"offset",0);if(B.arrayCopy(F,0,T,E,F.length),r!=1)for(let V=E,U=V+F.length;V<U;V++)T[V]*=r;if(!x)for(let V=0;V<y;V++)T[V]+=v[V]}C.setFrame(A,S,T);let P=b[A+1];if(!P){C.shrink(M);break}let I=k(P,"time",0),Y=g.curve;Y&&(M=G(Y,C,M,A,0,S,I,0,1,1)),S=I,g=P}n.push(C)}else if(w=="sequence"){let x=new Ee(b.length,f,p),v=0;for(let y=0;y<b.length;y++){let C=k(g,"delay",v),S=k(g,"time",0),A=vs[k(g,"mode","hold")],M=k(g,"index",0);x.setFrame(y,S,A,M,C),v=C,g=b[y+1]}n.push(x)}}}}}}if(e.drawOrder){let a=new Ye(e.drawOrder.length),i=s.slots.length,l=0;for(let o=0;o<e.drawOrder.length;o++,l++){let c=e.drawOrder[o],d=null,f=k(c,"offsets",null);if(f){d=B.newArray(i,-1);let u=B.newArray(i-f.length,0),m=0,p=0;for(let w=0;w<f.length;w++){let b=f[w],g=s.findSlot(b.slot);if(!g)throw new Error("Slot not found: "+g);let x=g.index;for(;m!=x;)u[p++]=m++;d[m+b.offset]=m++}for(;m<i;)u[p++]=m++;for(let w=i-1;w>=0;w--)d[w]==-1&&(d[w]=u[--p])}a.setFrame(l,k(c,"time",0),d)}n.push(a)}if(e.events){let a=new Oe(e.events.length),i=0;for(let l=0;l<e.events.length;l++,i++){let o=e.events[l],c=s.findEvent(o.name);if(!c)throw new Error("Event not found: "+o.name);let d=new ss(B.toSinglePrecision(k(o,"time",0)),c);d.intValue=k(o,"int",c.intValue),d.floatValue=k(o,"float",c.floatValue),d.stringValue=k(o,"string",c.stringValue),d.data.audioPath&&(d.volume=k(o,"volume",1),d.balance=k(o,"balance",0)),a.setFrame(i,d)}n.push(a)}let h=0;for(let a=0,i=n.length;a<i;a++)h=Math.max(h,n[a].getDuration());s.animations.push(new Ke(t,n,h))}},Qr=class{parent;skin;slotIndex;mesh;inheritTimeline;constructor(e,t,s,r,n){this.mesh=e,this.skin=t,this.slotIndex=s,this.parent=r,this.inheritTimeline=n}};function ue(e,t,s,r){let n=e[0],h=k(n,"time",0),a=k(n,"value",s)*r,i=0;for(let l=0;;l++){t.setFrame(l,h,a);let o=e[l+1];if(!o)return t.shrink(i),t;let c=k(o,"time",0),d=k(o,"value",s)*r;n.curve&&(i=G(n.curve,t,i,l,0,h,c,a,d,r)),h=c,a=d,n=o}}function fs(e,t,s,r,n,h){let a=e[0],i=k(a,"time",0),l=k(a,s,n)*h,o=k(a,r,n)*h,c=0;for(let d=0;;d++){t.setFrame(d,i,l,o);let f=e[d+1];if(!f)return t.shrink(c),t;let u=k(f,"time",0),m=k(f,s,n)*h,p=k(f,r,n)*h,w=a.curve;w&&(c=G(w,t,c,d,0,i,u,l,m,h),c=G(w,t,c,d,1,i,u,o,p,h)),i=u,l=m,o=p,a=f}}function G(e,t,s,r,n,h,a,i,l,o){if(e=="stepped")return t.setStepped(r),s;let c=n<<2,d=e[c],f=e[c+1]*o,u=e[c+2],m=e[c+3]*o;return t.setBezier(s,r,n,h,i,d,f,u,m,a,l),s+1}function k(e,t,s){return e[t]!==void 0?e[t]:s}typeof Math.fround>"u"&&(Math.fround=function(e){return function(t){return e[0]=t,e[0]}}(new Float32Array(1)));var be=class extends Jt{static from(e){return be.textureMap.has(e)?be.textureMap.get(e):new be(e)}texture;constructor(e){super(e.resource),this.texture=hr.Texture.from(e)}setFilters(e,t){const s=this.texture.source.style;s.minFilter=be.toPixiTextureFilter(e),s.magFilter=be.toPixiTextureFilter(t),this.texture.source.autoGenerateMipmaps=be.toPixiMipMap(e),this.texture.source.updateMipmaps()}setWraps(e,t){const s=this.texture.source.style;s.addressModeU=be.toPixiTextureWrap(e),s.addressModeV=be.toPixiTextureWrap(t)}dispose(){this.texture.destroy()}static toPixiMipMap(e){switch(e){case 9728:case 9729:return!1;case 9986:case 9984:case 9987:case 9985:return!0;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureFilter(e){switch(e){case 9728:case 9986:case 9984:return"nearest";case 9729:case 9987:case 9985:return"linear";default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case 33071:return"clamp-to-edge";case 33648:return"mirror-repeat";case 10497:return"repeat";default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case 0:return"normal";case 1:return"add";case 2:return"multiply";case 3:return"screen";default:throw new Error(`Unknown blendMode: ${String(e)}`)}}},ct=be;R(ct,"textureMap",new Map);var Zr={extension:Q.ExtensionType.Asset,resolver:{test:e=>(0,Q.checkExtension)(e,".atlas"),parse:e=>{const t=e.split(".");return{resolution:parseFloat(Q.Resolver.RETINA_PREFIX?.exec(e)?.[1]??"1"),format:t[t.length-2],src:e}}},loader:{extension:{type:Q.ExtensionType.LoadParser,priority:Q.LoaderParserPriority.Normal,name:"spineTextureAtlasLoader"},test(e){return(0,Q.checkExtension)(e,".atlas")},async load(e){return await(await Q.DOMAdapter.get().fetch(e)).text()},testParse(e,t){const s=(0,Q.checkExtension)(t.src,".atlas"),r=typeof e=="string";return Promise.resolve(s&&r)},unload(e){e.dispose()},async parse(e,t,s){const r=t.data||{};let n=Q.path.dirname(t.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");const h=new Kt(e);if(r.images instanceof Q.TextureSource||typeof r.images=="string"){const i=r.images;r.images={},r.images[h.pages[0].name]=i}const a=[];for(const i of h.pages){const l=i.name,o=r?.images?r.images[l]:void 0;if(o instanceof Q.TextureSource)i.setTexture(ct.from(o));else{const c=o??Q.path.normalize([...n.split(Q.path.sep),l].join(Q.path.sep)),d={src:(0,Q.copySearchParams)(c,t.src),data:{...r.imageMetadata,alphaMode:i.pma?"premultiplied-alpha":"premultiply-alpha-on-upload"}},f=s.load(d).then(u=>{i.setTexture(ct.from(u.source))});a.push(f)}}return await Promise.all(a),h}}};Q.extensions.add(Zr);var Ae=xe("pixi.js");function ei(e){return Object.prototype.hasOwnProperty.call(e,"bones")}function ti(e){return e instanceof Uint8Array}var si={extension:Ae.ExtensionType.Asset,loader:{extension:{type:Ae.ExtensionType.LoadParser,priority:Ae.LoaderParserPriority.Normal,name:"spineSkeletonLoader"},test(e){return(0,Ae.checkExtension)(e,".skel")},async load(e){const t=await Ae.DOMAdapter.get().fetch(e);return new Uint8Array(await t.arrayBuffer())},testParse(e,t){const s=(0,Ae.checkExtension)(t.src,".json")&&ei(e),r=(0,Ae.checkExtension)(t.src,".skel")&&ti(e);return Promise.resolve(s||r)}}};Ae.extensions.add(si);var dt=xe("pixi.js"),Fe=xe("pixi.js"),ri=new Float32Array(1),ii=new Uint32Array(1),ni=class extends Fe.Geometry{constructor(){const t=new Fe.Buffer({data:ri,label:"attribute-batch-buffer",usage:Fe.BufferUsage.VERTEX|Fe.BufferUsage.COPY_DST,shrinkToFit:!1}),s=new Fe.Buffer({data:ii,label:"index-batch-buffer",usage:Fe.BufferUsage.INDEX|Fe.BufferUsage.COPY_DST,shrinkToFit:!1}),r=7*4;super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:r,offset:0},aUV:{buffer:t,format:"float32x2",stride:r,offset:2*4},aColor:{buffer:t,format:"unorm8x4",stride:r,offset:4*4},aDarkColor:{buffer:t,format:"unorm8x4",stride:r,offset:5*4},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:r,offset:6*4}},indexBuffer:s})}},pe=xe("pixi.js"),ai={name:"color-bit",vertex:{header:`
|
|
1
|
+
"use strict";var spine=(()=>{var re=Object.defineProperty,ai=Object.getOwnPropertyDescriptor,oi=Object.getOwnPropertyNames,li=Object.prototype.hasOwnProperty,pt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,s)=>(typeof require<"u"?require:t)[s]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),hi=(e,t)=>{for(var s in t)re(e,s,{get:t[s],enumerable:!0})},ci=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of oi(t))!li.call(e,i)&&i!==s&&re(e,i,{get:()=>t[i],enumerable:!(r=ai(t,i))||r.enumerable});return e},di=e=>ci(re({},"__esModule",{value:!0}),e),fs={};if(hi(fs,{AABBRectangleBoundsProvider:()=>gr,AlphaTimeline:()=>we,Animation:()=>Ut,AnimationState:()=>Le,AnimationStateAdapter:()=>bi,AnimationStateData:()=>Ts,AssetManagerBase:()=>vi,AtlasAttachmentLoader:()=>Xs,Attachment:()=>ae,AttachmentTimeline:()=>Ct,BinaryInput:()=>Os,BlendMode:()=>es,Bone:()=>ze,BoneData:()=>We,BoundingBoxAttachment:()=>_e,CURRENT:()=>ks,ClippingAttachment:()=>St,Color:()=>V,ConstraintData:()=>Dt,CurveTimeline:()=>at,CurveTimeline1:()=>nt,CurveTimeline2:()=>qt,DebugUtils:()=>gi,DeformTimeline:()=>Ce,Downloader:()=>Fs,DrawOrderTimeline:()=>It,Event:()=>Ge,EventData:()=>He,EventQueue:()=>Cs,EventTimeline:()=>Wt,EventType:()=>Ss,FIRST:()=>Ve,FakeTexture:()=>wi,HOLD_FIRST:()=>Gt,HOLD_MIX:()=>As,HOLD_SUBSEQUENT:()=>Ne,IkConstraint:()=>Bs,IkConstraintData:()=>$e,IkConstraintTimeline:()=>Se,Inherit:()=>jt,InheritTimeline:()=>pe,IntSet:()=>fi,Interpolation:()=>ms,MathUtils:()=>B,MeshAttachment:()=>ut,MixBlend:()=>ws,MixDirection:()=>ys,PathAttachment:()=>Mt,PathConstraint:()=>Es,PathConstraintData:()=>je,PathConstraintMixTimeline:()=>Ie,PathConstraintPositionTimeline:()=>ke,PathConstraintSpacingTimeline:()=>Te,Physics:()=>Ls,PhysicsConstraintDampingTimeline:()=>Pe,PhysicsConstraintGravityTimeline:()=>Be,PhysicsConstraintInertiaTimeline:()=>Me,PhysicsConstraintMassTimeline:()=>Xe,PhysicsConstraintMixTimeline:()=>Ee,PhysicsConstraintResetTimeline:()=>Re,PhysicsConstraintStrengthTimeline:()=>Ye,PhysicsConstraintTimeline:()=>bt,PhysicsConstraintWindTimeline:()=>Fe,PointAttachment:()=>Ps,Pool:()=>Tt,PositionMode:()=>Je,Pow:()=>gs,PowOut:()=>mi,RGB2Timeline:()=>ve,RGBA2Timeline:()=>ye,RGBATimeline:()=>xe,RGBTimeline:()=>be,RegionAttachment:()=>ot,RotateMode:()=>Qe,RotateTimeline:()=>Rt,SETUP:()=>Oe,SUBSEQUENT:()=>zt,ScaleTimeline:()=>ce,ScaleXTimeline:()=>de,ScaleYTimeline:()=>ue,SequenceTimeline:()=>De,SetupPoseBoundsProvider:()=>pr,ShearTimeline:()=>fe,ShearXTimeline:()=>me,ShearYTimeline:()=>ge,Skeleton:()=>Yt,SkeletonBinary:()=>Ns,SkeletonBounds:()=>rs,SkeletonClipping:()=>Jt,SkeletonData:()=>Lt,SkeletonJson:()=>Us,Skin:()=>Vt,SkinEntry:()=>Ze,SkinsAndAnimationBoundsProvider:()=>xr,Slot:()=>Rs,SlotData:()=>ts,SpacingMode:()=>Ke,Spine:()=>br,SpineDebugRenderer:()=>wr,SpinePipe:()=>Ws,SpineTexture:()=>as,StringSet:()=>ne,Texture:()=>Ue,TextureAtlas:()=>$t,TextureAtlasPage:()=>Ys,TextureAtlasRegion:()=>qe,TextureFilter:()=>Ht,TextureRegion:()=>Ms,TextureWrap:()=>Is,TimeKeeper:()=>pi,Timeline:()=>$,TrackEntry:()=>vs,TransformConstraint:()=>Ds,TransformConstraintData:()=>ss,TransformConstraintTimeline:()=>Ae,TranslateTimeline:()=>oe,TranslateXTimeline:()=>le,TranslateYTimeline:()=>he,Triangulator:()=>_s,Utils:()=>E,Vector2:()=>Et,VertexAttachment:()=>dt,WindowedMean:()=>xi}),typeof window<"u"&&window.PIXI){const e=window.require;window.require=t=>{if(e)return e(t);if(t.startsWith("@pixi/")||t.startsWith("pixi.js"))return window.PIXI}}var K=pt("pixi.js"),ui=pt("pixi.js"),fi=class{array=new Array;add(e){let t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!=null}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}},ne=class{entries={};size=0;add(e){let t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){let t=this.size;for(var s=0,r=e.length;s<r;s++)this.add(e[s]);return t!=this.size}contains(e){return this.entries[e]}clear(){this.entries={},this.size=0}},V=class kt{constructor(t=0,s=0,r=0,i=0){this.r=t,this.g=s,this.b=r,this.a=i}static WHITE=new kt(1,1,1,1);static RED=new kt(1,0,0,1);static GREEN=new kt(0,1,0,1);static BLUE=new kt(0,0,1,1);static MAGENTA=new kt(1,0,1,1);set(t,s,r,i){return this.r=t,this.g=s,this.b=r,this.a=i,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t=t.charAt(0)=="#"?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=t.length!=8?1:parseInt(t.substr(6,2),16)/255,this}add(t,s,r,i){return this.r+=t,this.g+=s,this.b+=r,this.a+=i,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,s){t.r=((s&4278190080)>>>24)/255,t.g=((s&16711680)>>>16)/255,t.b=((s&65280)>>>8)/255,t.a=(s&255)/255}static rgb888ToColor(t,s){t.r=((s&16711680)>>>16)/255,t.g=((s&65280)>>>8)/255,t.b=(s&255)/255}toRgb888(){const t=s=>("0"+(s*255).toString(16)).slice(-2);return+("0x"+t(this.r)+t(this.g)+t(this.b))}static fromString(t,s=new kt){return s.setFromString(t)}},B=class ct{static PI=3.1415927;static PI2=ct.PI*2;static invPI2=1/ct.PI2;static radiansToDegrees=180/ct.PI;static radDeg=ct.radiansToDegrees;static degreesToRadians=ct.PI/180;static degRad=ct.degreesToRadians;static clamp(t,s,r){return t<s?s:t>r?r:t}static cosDeg(t){return Math.cos(t*ct.degRad)}static sinDeg(t){return Math.sin(t*ct.degRad)}static atan2Deg(t,s){return Math.atan2(t,s)*ct.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 s=Math.pow(Math.abs(t),.3333333333333333);return t<0?-s:s}static randomTriangular(t,s){return ct.randomTriangularWith(t,s,(t+s)*.5)}static randomTriangularWith(t,s,r){let i=Math.random(),l=s-t;return i<=(r-t)/l?t+Math.sqrt(i*l*(r-t)):s-Math.sqrt((1-i)*l*(s-r))}static isPowerOfTwo(t){return t&&(t&t-1)===0}},ms=class{apply(e,t,s){return e+(t-e)*this.applyInternal(s)}},gs=class extends ms{power=2;constructor(e){super(),this.power=e}applyInternal(e){return e<=.5?Math.pow(e*2,this.power)/2:Math.pow((e-1)*2,this.power)/(this.power%2==0?-2:2)+1}},mi=class extends gs{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2==0?-1:1)+1}},E=class Bt{static SUPPORTS_TYPED_ARRAYS=typeof Float32Array<"u";static arrayCopy(t,s,r,i,l){for(let o=s,n=i;o<s+l;o++,n++)r[n]=t[o]}static arrayFill(t,s,r,i){for(let l=s;l<r;l++)t[l]=i}static setArraySize(t,s,r=0){let i=t.length;if(i==s)return t;if(t.length=s,i<s)for(let l=i;l<s;l++)t[l]=r;return t}static ensureArrayCapacity(t,s,r=0){return t.length>=s?t:Bt.setArraySize(t,s,r)}static newArray(t,s){let r=new Array(t);for(let i=0;i<t;i++)r[i]=s;return r}static newFloatArray(t){if(Bt.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let s=new Array(t);for(let r=0;r<s.length;r++)s[r]=0;return s}}static newShortArray(t){if(Bt.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let s=new Array(t);for(let r=0;r<s.length;r++)s[r]=0;return s}}static toFloatArray(t){return Bt.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return Bt.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,s){}static contains(t,s,r=!0){for(var i=0;i<t.length;i++)if(t[i]==s)return!0;return!1}static enumValue(t,s){return t[s[0].toUpperCase()+s.slice(1)]}},gi=class{static logBones(e){for(let t=0;t<e.bones.length;t++){let s=e.bones[t];console.log(s.data.name+", "+s.a+", "+s.b+", "+s.c+", "+s.d+", "+s.worldX+", "+s.worldY)}}},Tt=class{items=new Array;instantiator;constructor(e){this.instantiator=e}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(e){e.reset&&e.reset(),this.items.push(e)}freeAll(e){for(let t=0;t<e.length;t++)this.free(e[t])}clear(){this.items.length=0}},Et=class{constructor(e=0,t=0){this.x=e,this.y=t}set(e,t){return this.x=e,this.y=t,this}length(){let e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}normalize(){let e=this.length();return e!=0&&(this.x/=e,this.y/=e),this}},pi=class{maxDelta=.064;framesPerSecond=0;delta=0;totalTime=0;lastTime=Date.now()/1e3;frameCount=0;frameTime=0;update(){let e=Date.now()/1e3;this.delta=e-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},xi=class{values;addedValues=0;lastValue=0;mean=0;dirty=!0;constructor(e=32){this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=e,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t<this.values.length;t++)e+=this.values[t];this.mean=e/this.values.length,this.dirty=!1}return this.mean}return 0}},ae=class{name;constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}},dt=class Js extends ae{static nextID=0;id=Js.nextID++;bones=null;vertices=[];worldVerticesLength=0;timelineAttachment=this;constructor(t){super(t)}computeWorldVertices(t,s,r,i,l,o){r=l+(r>>1)*o;let n=t.bone.skeleton,a=t.deform,h=this.vertices,c=this.bones;if(!c){a.length>0&&(h=a);let f=t.bone,p=f.worldX,b=f.worldY,w=f.a,g=f.b,x=f.c,y=f.d;for(let v=s,C=l;C<r;v+=2,C+=o){let S=h[v],k=h[v+1];i[C]=S*w+k*g+p,i[C+1]=S*x+k*y+b}return}let u=0,d=0;for(let f=0;f<s;f+=2){let p=c[u];u+=p+1,d+=p}let m=n.bones;if(a.length==0)for(let f=l,p=d*3;f<r;f+=o){let b=0,w=0,g=c[u++];for(g+=u;u<g;u++,p+=3){let x=m[c[u]],y=h[p],v=h[p+1],C=h[p+2];b+=(y*x.a+v*x.b+x.worldX)*C,w+=(y*x.c+v*x.d+x.worldY)*C}i[f]=b,i[f+1]=w}else{let f=a;for(let p=l,b=d*3,w=d<<1;p<r;p+=o){let g=0,x=0,y=c[u++];for(y+=u;u<y;u++,b+=3,w+=2){let v=m[c[u]],C=h[b]+f[w],S=h[b+1]+f[w+1],k=h[b+2];g+=(C*v.a+S*v.b+v.worldX)*k,x+=(C*v.c+S*v.d+v.worldY)*k}i[p]=g,i[p+1]=x}}}copyTo(t){this.bones?(t.bones=new Array(this.bones.length),E.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices&&(t.vertices=E.newFloatArray(this.vertices.length),E.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.timelineAttachment=this.timelineAttachment}},ps=class se{static _nextID=0;id=se.nextID();regions;start=0;digits=0;setupIndex=0;constructor(t){this.regions=new Array(t)}copy(){let t=new se(this.regions.length);return E.arrayCopy(this.regions,0,t.regions,0,this.regions.length),t.start=this.start,t.digits=this.digits,t.setupIndex=this.setupIndex,t}apply(t,s){let r=t.sequenceIndex;r==-1&&(r=this.setupIndex),r>=this.regions.length&&(r=this.regions.length-1);let i=this.regions[r];s.region!=i&&(s.region=i,s.updateRegion())}getPath(t,s){let r=t,i=(this.start+s).toString();for(let l=this.digits-i.length;l>0;l--)r+="0";return r+=i,r}static nextID(){return se._nextID++}},xs=(e=>(e[e.hold=0]="hold",e[e.once=1]="once",e[e.loop=2]="loop",e[e.pingpong=3]="pingpong",e[e.onceReverse=4]="onceReverse",e[e.loopReverse=5]="loopReverse",e[e.pingpongReverse=6]="pingpongReverse",e))(xs||{}),bs=[0,1,2,3,4,5,6],Ut=class{name;timelines=[];timelineIds=new ne;duration;constructor(e,t,s){if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=s}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds.clear();for(var t=0;t<e.length;t++)this.timelineIds.addAll(e[t].getPropertyIds())}hasTimeline(e){for(let t=0;t<e.length;t++)if(this.timelineIds.contains(e[t]))return!0;return!1}apply(e,t,s,r,i,l,o,n){if(!e)throw new Error("skeleton cannot be null.");r&&this.duration!=0&&(s%=this.duration,t>0&&(t%=this.duration));let a=this.timelines;for(let h=0,c=a.length;h<c;h++)a[h].apply(e,t,s,i,l,o,n)}},ws=(e=>(e[e.setup=0]="setup",e[e.first=1]="first",e[e.replace=2]="replace",e[e.add=3]="add",e))(ws||{}),ys=(e=>(e[e.mixIn=0]="mixIn",e[e.mixOut=1]="mixOut",e))(ys||{}),N={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,inherit:7,rgb:8,alpha:9,rgb2:10,attachment:11,deform:12,event:13,drawOrder:14,ikConstraint:15,transformConstraint:16,pathConstraintPosition:17,pathConstraintSpacing:18,pathConstraintMix:19,physicsConstraintInertia:20,physicsConstraintStrength:21,physicsConstraintDamping:22,physicsConstraintMass:23,physicsConstraintWind:24,physicsConstraintGravity:25,physicsConstraintMix:26,physicsConstraintReset:27,sequence:28},$=class{propertyIds;frames;constructor(e,t){this.propertyIds=t,this.frames=E.newFloatArray(e*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(e,t){let s=e.length;for(let r=1;r<s;r++)if(e[r]>t)return r-1;return s-1}static search(e,t,s){let r=e.length;for(let i=s;i<r;i+=s)if(e[i]>t)return i-s;return r-s}},at=class extends ${curves;constructor(e,t,s){super(e,s),this.curves=E.newFloatArray(e+t*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){let t=this.getFrameCount()+e*18;if(this.curves.length>t){let s=E.newFloatArray(t);E.arrayCopy(this.curves,0,s,0,t),this.curves=s}}setBezier(e,t,s,r,i,l,o,n,a,h,c){let u=this.curves,d=this.getFrameCount()+e*18;s==0&&(u[t]=2+d);let m=(r-l*2+n)*.03,f=(i-o*2+a)*.03,p=((l-n)*3-r+h)*.006,b=((o-a)*3-i+c)*.006,w=m*2+p,g=f*2+b,x=(l-r)*.3+m+p*.16666667,y=(o-i)*.3+f+b*.16666667,v=r+x,C=i+y;for(let S=d+18;d<S;d+=2)u[d]=v,u[d+1]=C,x+=w,y+=g,w+=p,g+=b,v+=x,C+=y}getBezierValue(e,t,s,r){let i=this.curves;if(i[r]>e){let a=this.frames[t],h=this.frames[t+s];return h+(e-a)/(i[r]-a)*(i[r+1]-h)}let l=r+18;for(r+=2;r<l;r+=2)if(i[r]>=e){let a=i[r-2],h=i[r-1];return h+(e-a)/(i[r]-a)*(i[r+1]-h)}t+=this.getFrameEntries();let o=i[l-2],n=i[l-1];return n+(e-o)/(this.frames[t]-o)*(this.frames[t+s]-n)}},nt=class extends at{constructor(e,t,s){super(e,t,[s])}getFrameEntries(){return 2}setFrame(e,t,s){e<<=1,this.frames[e]=t,this.frames[e+1]=s}getCurveValue(e){let t=this.frames,s=t.length-2;for(let i=2;i<=s;i+=2)if(t[i]>e){s=i-2;break}let r=this.curves[s>>1];switch(r){case 0:let i=t[s],l=t[s+1];return l+(e-i)/(t[s+2]-i)*(t[s+2+1]-l);case 1:return t[s+1]}return this.getBezierValue(e,s,1,r-2)}getRelativeValue(e,t,s,r,i){if(e<this.frames[0]){switch(s){case 0:return i;case 1:return r+(i-r)*t}return r}let l=this.getCurveValue(e);switch(s){case 0:return i+l*t;case 1:case 2:l+=i-r}return r+l*t}getAbsoluteValue(e,t,s,r,i){if(e<this.frames[0]){switch(s){case 0:return i;case 1:return r+(i-r)*t}return r}let l=this.getCurveValue(e);return s==0?i+(l-i)*t:r+(l-r)*t}getAbsoluteValue2(e,t,s,r,i,l){if(e<this.frames[0]){switch(s){case 0:return i;case 1:return r+(i-r)*t}return r}return s==0?i+(l-i)*t:r+(l-r)*t}getScaleValue(e,t,s,r,i,l){const o=this.frames;if(e<o[0]){switch(s){case 0:return l;case 1:return i+(l-i)*t}return i}let n=this.getCurveValue(e)*l;if(t==1)return s==3?i+n-l:n;if(r==1)switch(s){case 0:return l+(Math.abs(n)*B.signum(l)-l)*t;case 1:case 2:return i+(Math.abs(n)*B.signum(i)-i)*t}else{let a=0;switch(s){case 0:return a=Math.abs(l)*B.signum(n),a+(n-a)*t;case 1:case 2:return a=Math.abs(i)*B.signum(n),a+(n-a)*t}}return i+(n-l)*t}},qt=class extends at{constructor(e,t,s,r){super(e,t,[s,r])}getFrameEntries(){return 3}setFrame(e,t,s,r){e*=3,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r}},Rt=class extends nt{boneIndex=0;constructor(e,t,s){super(e,t,N.rotate+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,l,o){let n=e.bones[this.boneIndex];n.active&&(n.rotation=this.getRelativeValue(s,i,l,n.rotation,n.data.rotation))}},oe=class extends qt{boneIndex=0;constructor(e,t,s){super(e,t,N.x+"|"+s,N.y+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,l,o){let n=e.bones[this.boneIndex];if(!n.active)return;let a=this.frames;if(s<a[0]){switch(l){case 0:n.x=n.data.x,n.y=n.data.y;return;case 1:n.x+=(n.data.x-n.x)*i,n.y+=(n.data.y-n.y)*i}return}let h=0,c=0,u=$.search(a,s,3),d=this.curves[u/3];switch(d){case 0:let m=a[u];h=a[u+1],c=a[u+2];let f=(s-m)/(a[u+3]-m);h+=(a[u+3+1]-h)*f,c+=(a[u+3+2]-c)*f;break;case 1:h=a[u+1],c=a[u+2];break;default:h=this.getBezierValue(s,u,1,d-2),c=this.getBezierValue(s,u,2,d+18-2)}switch(l){case 0:n.x=n.data.x+h*i,n.y=n.data.y+c*i;break;case 1:case 2:n.x+=(n.data.x+h-n.x)*i,n.y+=(n.data.y+c-n.y)*i;break;case 3:n.x+=h*i,n.y+=c*i}}},le=class extends nt{boneIndex=0;constructor(e,t,s){super(e,t,N.x+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,l,o){let n=e.bones[this.boneIndex];n.active&&(n.x=this.getRelativeValue(s,i,l,n.x,n.data.x))}},he=class extends nt{boneIndex=0;constructor(e,t,s){super(e,t,N.y+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,l,o){let n=e.bones[this.boneIndex];n.active&&(n.y=this.getRelativeValue(s,i,l,n.y,n.data.y))}},ce=class extends qt{boneIndex=0;constructor(e,t,s){super(e,t,N.scaleX+"|"+s,N.scaleY+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,l,o){let n=e.bones[this.boneIndex];if(!n.active)return;let a=this.frames;if(s<a[0]){switch(l){case 0:n.scaleX=n.data.scaleX,n.scaleY=n.data.scaleY;return;case 1:n.scaleX+=(n.data.scaleX-n.scaleX)*i,n.scaleY+=(n.data.scaleY-n.scaleY)*i}return}let h,c,u=$.search(a,s,3),d=this.curves[u/3];switch(d){case 0:let m=a[u];h=a[u+1],c=a[u+2];let f=(s-m)/(a[u+3]-m);h+=(a[u+3+1]-h)*f,c+=(a[u+3+2]-c)*f;break;case 1:h=a[u+1],c=a[u+2];break;default:h=this.getBezierValue(s,u,1,d-2),c=this.getBezierValue(s,u,2,d+18-2)}if(h*=n.data.scaleX,c*=n.data.scaleY,i==1)l==3?(n.scaleX+=h-n.data.scaleX,n.scaleY+=c-n.data.scaleY):(n.scaleX=h,n.scaleY=c);else{let m=0,f=0;if(o==1)switch(l){case 0:m=n.data.scaleX,f=n.data.scaleY,n.scaleX=m+(Math.abs(h)*B.signum(m)-m)*i,n.scaleY=f+(Math.abs(c)*B.signum(f)-f)*i;break;case 1:case 2:m=n.scaleX,f=n.scaleY,n.scaleX=m+(Math.abs(h)*B.signum(m)-m)*i,n.scaleY=f+(Math.abs(c)*B.signum(f)-f)*i;break;case 3:n.scaleX+=(h-n.data.scaleX)*i,n.scaleY+=(c-n.data.scaleY)*i}else switch(l){case 0:m=Math.abs(n.data.scaleX)*B.signum(h),f=Math.abs(n.data.scaleY)*B.signum(c),n.scaleX=m+(h-m)*i,n.scaleY=f+(c-f)*i;break;case 1:case 2:m=Math.abs(n.scaleX)*B.signum(h),f=Math.abs(n.scaleY)*B.signum(c),n.scaleX=m+(h-m)*i,n.scaleY=f+(c-f)*i;break;case 3:n.scaleX+=(h-n.data.scaleX)*i,n.scaleY+=(c-n.data.scaleY)*i}}}},de=class extends nt{boneIndex=0;constructor(e,t,s){super(e,t,N.scaleX+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,l,o){let n=e.bones[this.boneIndex];n.active&&(n.scaleX=this.getScaleValue(s,i,l,o,n.scaleX,n.data.scaleX))}},ue=class extends nt{boneIndex=0;constructor(e,t,s){super(e,t,N.scaleY+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,l,o){let n=e.bones[this.boneIndex];n.active&&(n.scaleY=this.getScaleValue(s,i,l,o,n.scaleY,n.data.scaleY))}},fe=class extends qt{boneIndex=0;constructor(e,t,s){super(e,t,N.shearX+"|"+s,N.shearY+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,l,o){let n=e.bones[this.boneIndex];if(!n.active)return;let a=this.frames;if(s<a[0]){switch(l){case 0:n.shearX=n.data.shearX,n.shearY=n.data.shearY;return;case 1:n.shearX+=(n.data.shearX-n.shearX)*i,n.shearY+=(n.data.shearY-n.shearY)*i}return}let h=0,c=0,u=$.search(a,s,3),d=this.curves[u/3];switch(d){case 0:let m=a[u];h=a[u+1],c=a[u+2];let f=(s-m)/(a[u+3]-m);h+=(a[u+3+1]-h)*f,c+=(a[u+3+2]-c)*f;break;case 1:h=a[u+1],c=a[u+2];break;default:h=this.getBezierValue(s,u,1,d-2),c=this.getBezierValue(s,u,2,d+18-2)}switch(l){case 0:n.shearX=n.data.shearX+h*i,n.shearY=n.data.shearY+c*i;break;case 1:case 2:n.shearX+=(n.data.shearX+h-n.shearX)*i,n.shearY+=(n.data.shearY+c-n.shearY)*i;break;case 3:n.shearX+=h*i,n.shearY+=c*i}}},me=class extends nt{boneIndex=0;constructor(e,t,s){super(e,t,N.shearX+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,l,o){let n=e.bones[this.boneIndex];n.active&&(n.shearX=this.getRelativeValue(s,i,l,n.shearX,n.data.shearX))}},ge=class extends nt{boneIndex=0;constructor(e,t,s){super(e,t,N.shearY+"|"+s),this.boneIndex=s}apply(e,t,s,r,i,l,o){let n=e.bones[this.boneIndex];n.active&&(n.shearY=this.getRelativeValue(s,i,l,n.shearY,n.data.shearY))}},pe=class extends ${boneIndex=0;constructor(e,t){super(e,[N.inherit+"|"+t]),this.boneIndex=t}getFrameEntries(){return 2}setFrame(e,t,s){e*=2,this.frames[e]=t,this.frames[e+1]=s}apply(e,t,s,r,i,l,o){let n=e.bones[this.boneIndex];if(!n.active)return;if(o==1){l==0&&(n.inherit=n.data.inherit);return}let a=this.frames;if(s<a[0]){(l==0||l==1)&&(n.inherit=n.data.inherit);return}n.inherit=this.frames[$.search(a,s,2)+1]}},xe=class extends at{slotIndex=0;constructor(e,t,s){super(e,t,[N.rgb+"|"+s,N.alpha+"|"+s]),this.slotIndex=s}getFrameEntries(){return 5}setFrame(e,t,s,r,i,l){e*=5,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=i,this.frames[e+4]=l}apply(e,t,s,r,i,l,o){let n=e.slots[this.slotIndex];if(!n.bone.active)return;let a=this.frames,h=n.color;if(s<a[0]){let b=n.data.color;switch(l){case 0:h.setFromColor(b);return;case 1:h.add((b.r-h.r)*i,(b.g-h.g)*i,(b.b-h.b)*i,(b.a-h.a)*i)}return}let c=0,u=0,d=0,m=0,f=$.search(a,s,5),p=this.curves[f/5];switch(p){case 0:let b=a[f];c=a[f+1],u=a[f+2],d=a[f+3],m=a[f+4];let w=(s-b)/(a[f+5]-b);c+=(a[f+5+1]-c)*w,u+=(a[f+5+2]-u)*w,d+=(a[f+5+3]-d)*w,m+=(a[f+5+4]-m)*w;break;case 1:c=a[f+1],u=a[f+2],d=a[f+3],m=a[f+4];break;default:c=this.getBezierValue(s,f,1,p-2),u=this.getBezierValue(s,f,2,p+18-2),d=this.getBezierValue(s,f,3,p+18*2-2),m=this.getBezierValue(s,f,4,p+18*3-2)}i==1?h.set(c,u,d,m):(l==0&&h.setFromColor(n.data.color),h.add((c-h.r)*i,(u-h.g)*i,(d-h.b)*i,(m-h.a)*i))}},be=class extends at{slotIndex=0;constructor(e,t,s){super(e,t,[N.rgb+"|"+s]),this.slotIndex=s}getFrameEntries(){return 4}setFrame(e,t,s,r,i){e<<=2,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=i}apply(e,t,s,r,i,l,o){let n=e.slots[this.slotIndex];if(!n.bone.active)return;let a=this.frames,h=n.color;if(s<a[0]){let p=n.data.color;switch(l){case 0:h.r=p.r,h.g=p.g,h.b=p.b;return;case 1:h.r+=(p.r-h.r)*i,h.g+=(p.g-h.g)*i,h.b+=(p.b-h.b)*i}return}let c=0,u=0,d=0,m=$.search(a,s,4),f=this.curves[m>>2];switch(f){case 0:let p=a[m];c=a[m+1],u=a[m+2],d=a[m+3];let b=(s-p)/(a[m+4]-p);c+=(a[m+4+1]-c)*b,u+=(a[m+4+2]-u)*b,d+=(a[m+4+3]-d)*b;break;case 1:c=a[m+1],u=a[m+2],d=a[m+3];break;default:c=this.getBezierValue(s,m,1,f-2),u=this.getBezierValue(s,m,2,f+18-2),d=this.getBezierValue(s,m,3,f+18*2-2)}if(i==1)h.r=c,h.g=u,h.b=d;else{if(l==0){let p=n.data.color;h.r=p.r,h.g=p.g,h.b=p.b}h.r+=(c-h.r)*i,h.g+=(u-h.g)*i,h.b+=(d-h.b)*i}}},we=class extends nt{slotIndex=0;constructor(e,t,s){super(e,t,N.alpha+"|"+s),this.slotIndex=s}apply(e,t,s,r,i,l,o){let n=e.slots[this.slotIndex];if(!n.bone.active)return;let a=n.color;if(s<this.frames[0]){let c=n.data.color;switch(l){case 0:a.a=c.a;return;case 1:a.a+=(c.a-a.a)*i}return}let h=this.getCurveValue(s);i==1?a.a=h:(l==0&&(a.a=n.data.color.a),a.a+=(h-a.a)*i)}},ye=class extends at{slotIndex=0;constructor(e,t,s){super(e,t,[N.rgb+"|"+s,N.alpha+"|"+s,N.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 8}setFrame(e,t,s,r,i,l,o,n,a){e<<=3,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=i,this.frames[e+4]=l,this.frames[e+5]=o,this.frames[e+6]=n,this.frames[e+7]=a}apply(e,t,s,r,i,l,o){let n=e.slots[this.slotIndex];if(!n.bone.active)return;let a=this.frames,h=n.color,c=n.darkColor;if(s<a[0]){let y=n.data.color,v=n.data.darkColor;switch(l){case 0:h.setFromColor(y),c.r=v.r,c.g=v.g,c.b=v.b;return;case 1:h.add((y.r-h.r)*i,(y.g-h.g)*i,(y.b-h.b)*i,(y.a-h.a)*i),c.r+=(v.r-c.r)*i,c.g+=(v.g-c.g)*i,c.b+=(v.b-c.b)*i}return}let u=0,d=0,m=0,f=0,p=0,b=0,w=0,g=$.search(a,s,8),x=this.curves[g>>3];switch(x){case 0:let y=a[g];u=a[g+1],d=a[g+2],m=a[g+3],f=a[g+4],p=a[g+5],b=a[g+6],w=a[g+7];let v=(s-y)/(a[g+8]-y);u+=(a[g+8+1]-u)*v,d+=(a[g+8+2]-d)*v,m+=(a[g+8+3]-m)*v,f+=(a[g+8+4]-f)*v,p+=(a[g+8+5]-p)*v,b+=(a[g+8+6]-b)*v,w+=(a[g+8+7]-w)*v;break;case 1:u=a[g+1],d=a[g+2],m=a[g+3],f=a[g+4],p=a[g+5],b=a[g+6],w=a[g+7];break;default:u=this.getBezierValue(s,g,1,x-2),d=this.getBezierValue(s,g,2,x+18-2),m=this.getBezierValue(s,g,3,x+18*2-2),f=this.getBezierValue(s,g,4,x+18*3-2),p=this.getBezierValue(s,g,5,x+18*4-2),b=this.getBezierValue(s,g,6,x+18*5-2),w=this.getBezierValue(s,g,7,x+18*6-2)}if(i==1)h.set(u,d,m,f),c.r=p,c.g=b,c.b=w;else{if(l==0){h.setFromColor(n.data.color);let y=n.data.darkColor;c.r=y.r,c.g=y.g,c.b=y.b}h.add((u-h.r)*i,(d-h.g)*i,(m-h.b)*i,(f-h.a)*i),c.r+=(p-c.r)*i,c.g+=(b-c.g)*i,c.b+=(w-c.b)*i}}},ve=class extends at{slotIndex=0;constructor(e,t,s){super(e,t,[N.rgb+"|"+s,N.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 7}setFrame(e,t,s,r,i,l,o,n){e*=7,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=i,this.frames[e+4]=l,this.frames[e+5]=o,this.frames[e+6]=n}apply(e,t,s,r,i,l,o){let n=e.slots[this.slotIndex];if(!n.bone.active)return;let a=this.frames,h=n.color,c=n.darkColor;if(s<a[0]){let y=n.data.color,v=n.data.darkColor;switch(l){case 0:h.r=y.r,h.g=y.g,h.b=y.b,c.r=v.r,c.g=v.g,c.b=v.b;return;case 1:h.r+=(y.r-h.r)*i,h.g+=(y.g-h.g)*i,h.b+=(y.b-h.b)*i,c.r+=(v.r-c.r)*i,c.g+=(v.g-c.g)*i,c.b+=(v.b-c.b)*i}return}let u=0,d=0,m=0,f=0,p=0,b=0,w=0,g=$.search(a,s,7),x=this.curves[g/7];switch(x){case 0:let y=a[g];u=a[g+1],d=a[g+2],m=a[g+3],p=a[g+4],b=a[g+5],w=a[g+6];let v=(s-y)/(a[g+7]-y);u+=(a[g+7+1]-u)*v,d+=(a[g+7+2]-d)*v,m+=(a[g+7+3]-m)*v,p+=(a[g+7+4]-p)*v,b+=(a[g+7+5]-b)*v,w+=(a[g+7+6]-w)*v;break;case 1:u=a[g+1],d=a[g+2],m=a[g+3],p=a[g+4],b=a[g+5],w=a[g+6];break;default:u=this.getBezierValue(s,g,1,x-2),d=this.getBezierValue(s,g,2,x+18-2),m=this.getBezierValue(s,g,3,x+18*2-2),p=this.getBezierValue(s,g,4,x+18*3-2),b=this.getBezierValue(s,g,5,x+18*4-2),w=this.getBezierValue(s,g,6,x+18*5-2)}if(i==1)h.r=u,h.g=d,h.b=m,c.r=p,c.g=b,c.b=w;else{if(l==0){let y=n.data.color,v=n.data.darkColor;h.r=y.r,h.g=y.g,h.b=y.b,c.r=v.r,c.g=v.g,c.b=v.b}h.r+=(u-h.r)*i,h.g+=(d-h.g)*i,h.b+=(m-h.b)*i,c.r+=(p-c.r)*i,c.g+=(b-c.g)*i,c.b+=(w-c.b)*i}}},Ct=class extends ${slotIndex=0;attachmentNames;constructor(e,t){super(e,[N.attachment+"|"+t]),this.slotIndex=t,this.attachmentNames=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.attachmentNames[e]=s}apply(e,t,s,r,i,l,o){let n=e.slots[this.slotIndex];if(n.bone.active){if(o==1){l==0&&this.setAttachment(e,n,n.data.attachmentName);return}if(s<this.frames[0]){(l==0||l==1)&&this.setAttachment(e,n,n.data.attachmentName);return}this.setAttachment(e,n,this.attachmentNames[$.search1(this.frames,s)])}}setAttachment(e,t,s){t.setAttachment(s?e.getAttachment(this.slotIndex,s):null)}},Ce=class extends at{slotIndex=0;attachment;vertices;constructor(e,t,s,r){super(e,t,[N.deform+"|"+s+"|"+r.id]),this.slotIndex=s,this.attachment=r,this.vertices=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.vertices[e]=s}setBezier(e,t,s,r,i,l,o,n,a,h,c){let u=this.curves,d=this.getFrameCount()+e*18;s==0&&(u[t]=2+d);let m=(r-l*2+n)*.03,f=a*.03-o*.06,p=((l-n)*3-r+h)*.006,b=(o-a+.33333333)*.018,w=m*2+p,g=f*2+b,x=(l-r)*.3+m+p*.16666667,y=o*.3+f+b*.16666667,v=r+x,C=y;for(let S=d+18;d<S;d+=2)u[d]=v,u[d+1]=C,x+=w,y+=g,w+=p,g+=b,v+=x,C+=y}getCurvePercent(e,t){let s=this.curves,r=s[t];switch(r){case 0:let n=this.frames[t];return(e-n)/(this.frames[t+this.getFrameEntries()]-n);case 1:return 0}if(r-=2,s[r]>e){let n=this.frames[t];return s[r+1]*(e-n)/(s[r]-n)}let i=r+18;for(r+=2;r<i;r+=2)if(s[r]>=e){let n=s[r-2],a=s[r-1];return a+(e-n)/(s[r]-n)*(s[r+1]-a)}let l=s[i-2],o=s[i-1];return o+(1-o)*(e-l)/(this.frames[t+this.getFrameEntries()]-l)}apply(e,t,s,r,i,l,o){let n=e.slots[this.slotIndex];if(!n.bone.active)return;let a=n.getAttachment();if(!a||!(a instanceof dt)||a.timelineAttachment!=this.attachment)return;let h=n.deform;h.length==0&&(l=0);let c=this.vertices,u=c[0].length,d=this.frames;if(s<d[0]){switch(l){case 0:h.length=0;return;case 1:if(i==1){h.length=0;return}h.length=u;let g=a;if(g.bones){i=1-i;for(var m=0;m<u;m++)h[m]*=i}else{let x=g.vertices;for(var m=0;m<u;m++)h[m]+=(x[m]-h[m])*i}}return}if(h.length=u,s>=d[d.length-1]){let g=c[d.length-1];if(i==1)if(l==3){let x=a;if(x.bones)for(let y=0;y<u;y++)h[y]+=g[y];else{let y=x.vertices;for(let v=0;v<u;v++)h[v]+=g[v]-y[v]}}else E.arrayCopy(g,0,h,0,u);else switch(l){case 0:{let y=a;if(y.bones)for(let v=0;v<u;v++)h[v]=g[v]*i;else{let v=y.vertices;for(let C=0;C<u;C++){let S=v[C];h[C]=S+(g[C]-S)*i}}break}case 1:case 2:for(let y=0;y<u;y++)h[y]+=(g[y]-h[y])*i;break;case 3:let x=a;if(x.bones)for(let y=0;y<u;y++)h[y]+=g[y]*i;else{let y=x.vertices;for(let v=0;v<u;v++)h[v]+=(g[v]-y[v])*i}}return}let f=$.search1(d,s),p=this.getCurvePercent(s,f),b=c[f],w=c[f+1];if(i==1)if(l==3){let g=a;if(g.bones)for(let x=0;x<u;x++){let y=b[x];h[x]+=y+(w[x]-y)*p}else{let x=g.vertices;for(let y=0;y<u;y++){let v=b[y];h[y]+=v+(w[y]-v)*p-x[y]}}}else for(let g=0;g<u;g++){let x=b[g];h[g]=x+(w[g]-x)*p}else switch(l){case 0:{let x=a;if(x.bones)for(let y=0;y<u;y++){let v=b[y];h[y]=(v+(w[y]-v)*p)*i}else{let y=x.vertices;for(let v=0;v<u;v++){let C=b[v],S=y[v];h[v]=S+(C+(w[v]-C)*p-S)*i}}break}case 1:case 2:for(let x=0;x<u;x++){let y=b[x];h[x]+=(y+(w[x]-y)*p-h[x])*i}break;case 3:let g=a;if(g.bones)for(let x=0;x<u;x++){let y=b[x];h[x]+=(y+(w[x]-y)*p)*i}else{let x=g.vertices;for(let y=0;y<u;y++){let v=b[y];h[y]+=(v+(w[y]-v)*p-x[y])*i}}}}},Wt=class Ks extends ${static propertyIds=[""+N.event];events;constructor(t){super(t,Ks.propertyIds),this.events=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s.time,this.events[t]=s}apply(t,s,r,i,l,o,n){if(!i)return;let a=this.frames,h=this.frames.length;if(s>r)this.apply(t,s,Number.MAX_VALUE,i,l,o,n),s=-1;else if(s>=a[h-1])return;if(r<a[0])return;let c=0;if(s<a[0])c=0;else{c=$.search1(a,s)+1;let u=a[c];for(;c>0&&a[c-1]==u;)c--}for(;c<h&&r>=a[c];c++)i.push(this.events[c])}},It=class Qs extends ${static propertyIds=[""+N.drawOrder];drawOrders;constructor(t){super(t,Qs.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,s,r){this.frames[t]=s,this.drawOrders[t]=r}apply(t,s,r,i,l,o,n){if(n==1){o==0&&E.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(r<this.frames[0]){(o==0||o==1)&&E.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}let a=$.search1(this.frames,r),h=this.drawOrders[a];if(!h)E.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);else{let c=t.drawOrder,u=t.slots;for(let d=0,m=h.length;d<m;d++)c[d]=u[h[d]]}}},Se=class extends at{constraintIndex=0;constructor(e,t,s){super(e,t,[N.ikConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 6}setFrame(e,t,s,r,i,l,o){e*=6,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=r,this.frames[e+3]=i,this.frames[e+4]=l?1:0,this.frames[e+5]=o?1:0}apply(e,t,s,r,i,l,o){let n=e.ikConstraints[this.constraintIndex];if(!n.active)return;let a=this.frames;if(s<a[0]){switch(l){case 0:n.mix=n.data.mix,n.softness=n.data.softness,n.bendDirection=n.data.bendDirection,n.compress=n.data.compress,n.stretch=n.data.stretch;return;case 1:n.mix+=(n.data.mix-n.mix)*i,n.softness+=(n.data.softness-n.softness)*i,n.bendDirection=n.data.bendDirection,n.compress=n.data.compress,n.stretch=n.data.stretch}return}let h=0,c=0,u=$.search(a,s,6),d=this.curves[u/6];switch(d){case 0:let m=a[u];h=a[u+1],c=a[u+2];let f=(s-m)/(a[u+6]-m);h+=(a[u+6+1]-h)*f,c+=(a[u+6+2]-c)*f;break;case 1:h=a[u+1],c=a[u+2];break;default:h=this.getBezierValue(s,u,1,d-2),c=this.getBezierValue(s,u,2,d+18-2)}l==0?(n.mix=n.data.mix+(h-n.data.mix)*i,n.softness=n.data.softness+(c-n.data.softness)*i,o==1?(n.bendDirection=n.data.bendDirection,n.compress=n.data.compress,n.stretch=n.data.stretch):(n.bendDirection=a[u+3],n.compress=a[u+4]!=0,n.stretch=a[u+5]!=0)):(n.mix+=(h-n.mix)*i,n.softness+=(c-n.softness)*i,o==0&&(n.bendDirection=a[u+3],n.compress=a[u+4]!=0,n.stretch=a[u+5]!=0))}},Ae=class extends at{constraintIndex=0;constructor(e,t,s){super(e,t,[N.transformConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 7}setFrame(e,t,s,r,i,l,o,n){let a=this.frames;e*=7,a[e]=t,a[e+1]=s,a[e+2]=r,a[e+3]=i,a[e+4]=l,a[e+5]=o,a[e+6]=n}apply(e,t,s,r,i,l,o){let n=e.transformConstraints[this.constraintIndex];if(!n.active)return;let a=this.frames;if(s<a[0]){let w=n.data;switch(l){case 0:n.mixRotate=w.mixRotate,n.mixX=w.mixX,n.mixY=w.mixY,n.mixScaleX=w.mixScaleX,n.mixScaleY=w.mixScaleY,n.mixShearY=w.mixShearY;return;case 1:n.mixRotate+=(w.mixRotate-n.mixRotate)*i,n.mixX+=(w.mixX-n.mixX)*i,n.mixY+=(w.mixY-n.mixY)*i,n.mixScaleX+=(w.mixScaleX-n.mixScaleX)*i,n.mixScaleY+=(w.mixScaleY-n.mixScaleY)*i,n.mixShearY+=(w.mixShearY-n.mixShearY)*i}return}let h,c,u,d,m,f,p=$.search(a,s,7),b=this.curves[p/7];switch(b){case 0:let w=a[p];h=a[p+1],c=a[p+2],u=a[p+3],d=a[p+4],m=a[p+5],f=a[p+6];let g=(s-w)/(a[p+7]-w);h+=(a[p+7+1]-h)*g,c+=(a[p+7+2]-c)*g,u+=(a[p+7+3]-u)*g,d+=(a[p+7+4]-d)*g,m+=(a[p+7+5]-m)*g,f+=(a[p+7+6]-f)*g;break;case 1:h=a[p+1],c=a[p+2],u=a[p+3],d=a[p+4],m=a[p+5],f=a[p+6];break;default:h=this.getBezierValue(s,p,1,b-2),c=this.getBezierValue(s,p,2,b+18-2),u=this.getBezierValue(s,p,3,b+18*2-2),d=this.getBezierValue(s,p,4,b+18*3-2),m=this.getBezierValue(s,p,5,b+18*4-2),f=this.getBezierValue(s,p,6,b+18*5-2)}if(l==0){let w=n.data;n.mixRotate=w.mixRotate+(h-w.mixRotate)*i,n.mixX=w.mixX+(c-w.mixX)*i,n.mixY=w.mixY+(u-w.mixY)*i,n.mixScaleX=w.mixScaleX+(d-w.mixScaleX)*i,n.mixScaleY=w.mixScaleY+(m-w.mixScaleY)*i,n.mixShearY=w.mixShearY+(f-w.mixShearY)*i}else n.mixRotate+=(h-n.mixRotate)*i,n.mixX+=(c-n.mixX)*i,n.mixY+=(u-n.mixY)*i,n.mixScaleX+=(d-n.mixScaleX)*i,n.mixScaleY+=(m-n.mixScaleY)*i,n.mixShearY+=(f-n.mixShearY)*i}},ke=class extends nt{constraintIndex=0;constructor(e,t,s){super(e,t,N.pathConstraintPosition+"|"+s),this.constraintIndex=s}apply(e,t,s,r,i,l,o){let n=e.pathConstraints[this.constraintIndex];n.active&&(n.position=this.getAbsoluteValue(s,i,l,n.position,n.data.position))}},Te=class extends nt{constraintIndex=0;constructor(e,t,s){super(e,t,N.pathConstraintSpacing+"|"+s),this.constraintIndex=s}apply(e,t,s,r,i,l,o){let n=e.pathConstraints[this.constraintIndex];n.active&&(n.spacing=this.getAbsoluteValue(s,i,l,n.spacing,n.data.spacing))}},Ie=class extends at{constraintIndex=0;constructor(e,t,s){super(e,t,[N.pathConstraintMix+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 4}setFrame(e,t,s,r,i){let l=this.frames;e<<=2,l[e]=t,l[e+1]=s,l[e+2]=r,l[e+3]=i}apply(e,t,s,r,i,l,o){let n=e.pathConstraints[this.constraintIndex];if(!n.active)return;let a=this.frames;if(s<a[0]){switch(l){case 0:n.mixRotate=n.data.mixRotate,n.mixX=n.data.mixX,n.mixY=n.data.mixY;return;case 1:n.mixRotate+=(n.data.mixRotate-n.mixRotate)*i,n.mixX+=(n.data.mixX-n.mixX)*i,n.mixY+=(n.data.mixY-n.mixY)*i}return}let h,c,u,d=$.search(a,s,4),m=this.curves[d>>2];switch(m){case 0:let f=a[d];h=a[d+1],c=a[d+2],u=a[d+3];let p=(s-f)/(a[d+4]-f);h+=(a[d+4+1]-h)*p,c+=(a[d+4+2]-c)*p,u+=(a[d+4+3]-u)*p;break;case 1:h=a[d+1],c=a[d+2],u=a[d+3];break;default:h=this.getBezierValue(s,d,1,m-2),c=this.getBezierValue(s,d,2,m+18-2),u=this.getBezierValue(s,d,3,m+18*2-2)}if(l==0){let f=n.data;n.mixRotate=f.mixRotate+(h-f.mixRotate)*i,n.mixX=f.mixX+(c-f.mixX)*i,n.mixY=f.mixY+(u-f.mixY)*i}else n.mixRotate+=(h-n.mixRotate)*i,n.mixX+=(c-n.mixX)*i,n.mixY+=(u-n.mixY)*i}},bt=class extends nt{constraintIndex=0;constructor(e,t,s,r){super(e,t,r+"|"+s),this.constraintIndex=s}apply(e,t,s,r,i,l,o){let n;if(this.constraintIndex==-1){const a=s>=this.frames[0]?this.getCurveValue(s):0;for(const h of e.physicsConstraints)h.active&&this.global(h.data)&&this.set(h,this.getAbsoluteValue2(s,i,l,this.get(h),this.setup(h),a))}else n=e.physicsConstraints[this.constraintIndex],n.active&&this.set(n,this.getAbsoluteValue(s,i,l,this.get(n),this.setup(n)))}},Me=class extends bt{constructor(e,t,s){super(e,t,s,N.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},Ye=class extends bt{constructor(e,t,s){super(e,t,s,N.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},Pe=class extends bt{constructor(e,t,s){super(e,t,s,N.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},Xe=class extends bt{constructor(e,t,s){super(e,t,s,N.physicsConstraintMass)}setup(e){return 1/e.data.massInverse}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}},Fe=class extends bt{constructor(e,t,s){super(e,t,s,N.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},Be=class extends bt{constructor(e,t,s){super(e,t,s,N.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},Ee=class extends bt{constructor(e,t,s){super(e,t,s,N.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}},Re=class Zs extends ${static propertyIds=[N.physicsConstraintReset.toString()];constraintIndex;constructor(t,s){super(t,Zs.propertyIds),this.constraintIndex=s}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s}apply(t,s,r,i,l,o,n){let a;if(this.constraintIndex!=-1&&(a=t.physicsConstraints[this.constraintIndex],!a.active))return;const h=this.frames;if(s>r)this.apply(t,s,Number.MAX_VALUE,[],l,o,n),s=-1;else if(s>=h[h.length-1])return;if(!(r<h[0])&&(s<h[0]||r>=h[$.search1(h,s)+1]))if(a!=null)a.reset();else for(const c of t.physicsConstraints)c.active&&c.reset()}},De=class yt extends ${static ENTRIES=3;static MODE=1;static DELAY=2;slotIndex;attachment;constructor(t,s,r){super(t,[N.sequence+"|"+s+"|"+r.sequence.id]),this.slotIndex=s,this.attachment=r}getFrameEntries(){return yt.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,s,r,i,l){let o=this.frames;t*=yt.ENTRIES,o[t]=s,o[t+yt.MODE]=r|i<<4,o[t+yt.DELAY]=l}apply(t,s,r,i,l,o,n){let a=t.slots[this.slotIndex];if(!a.bone.active)return;let h=a.attachment,c=this.attachment;if(h!=c&&(!(h instanceof dt)||h.timelineAttachment!=c))return;if(n==1){o==0&&(a.sequenceIndex=-1);return}let u=this.frames;if(r<u[0]){(o==0||o==1)&&(a.sequenceIndex=-1);return}let d=$.search(u,r,yt.ENTRIES),m=u[d],f=u[d+yt.MODE],p=u[d+yt.DELAY];if(!this.attachment.sequence)return;let b=f>>4,w=this.attachment.sequence.regions.length,g=bs[f&15];if(g!=0)switch(b+=(r-m)/p+1e-5|0,g){case 1:b=Math.min(w-1,b);break;case 2:b%=w;break;case 3:{let x=(w<<1)-2;b=x==0?0:b%x,b>=w&&(b=x-b);break}case 4:b=Math.max(w-1-b,0);break;case 5:b=w-1-b%w;break;case 6:{let x=(w<<1)-2;b=x==0?0:(b+w-1)%x,b>=w&&(b=x-b)}}a.sequenceIndex=b}},Le=class ie{static _emptyAnimation=new Ut("<empty>",[],0);static emptyAnimation(){return ie._emptyAnimation}data;tracks=new Array;timeScale=1;unkeyedState=0;events=new Array;listeners=new Array;queue=new Cs(this);propertyIDs=new ne;animationsChanged=!1;trackEntryPool=new Tt(()=>new vs);constructor(t){this.data=t}update(t){t*=this.timeScale;let s=this.tracks;for(let r=0,i=s.length;r<i;r++){let l=s[r];if(!l)continue;l.animationLast=l.nextAnimationLast,l.trackLast=l.nextTrackLast;let o=t*l.timeScale;if(l.delay>0){if(l.delay-=o,l.delay>0)continue;o=-l.delay,l.delay=0}let n=l.next;if(n){let a=l.trackLast-n.delay;if(a>=0){for(n.delay=0,n.trackTime+=l.timeScale==0?0:(a/l.timeScale+t)*n.timeScale,l.trackTime+=o,this.setCurrent(r,n,!0);n.mixingFrom;)n.mixTime+=t,n=n.mixingFrom;continue}}else if(l.trackLast>=l.trackEnd&&!l.mixingFrom){s[r]=null,this.queue.end(l),this.clearNext(l);continue}if(l.mixingFrom&&this.updateMixingFrom(l,t)){let a=l.mixingFrom;for(l.mixingFrom=null,a&&(a.mixingTo=null);a;)this.queue.end(a),a=a.mixingFrom}l.trackTime+=o}this.queue.drain()}updateMixingFrom(t,s){let r=t.mixingFrom;if(!r)return!0;let i=this.updateMixingFrom(r,s);return r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast,t.nextTrackLast!=-1&&t.mixTime>=t.mixDuration?((r.totalAlpha==0||t.mixDuration==0)&&(t.mixingFrom=r.mixingFrom,r.mixingFrom!=null&&(r.mixingFrom.mixingTo=t),t.interruptAlpha=r.interruptAlpha,this.queue.end(r)),i):(r.trackTime+=s*r.timeScale,t.mixTime+=s,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let s=this.events,r=this.tracks,i=!1;for(let d=0,m=r.length;d<m;d++){let f=r[d];if(!f||f.delay>0)continue;i=!0;let p=d==0?1:f.mixBlend,b=f.alpha;f.mixingFrom?b*=this.applyMixingFrom(f,t,p):f.trackTime>=f.trackEnd&&!f.next&&(b=0);let w=b>=f.alphaAttachmentThreshold,g=f.animationLast,x=f.getAnimationTime(),y=x,v=s;f.reverse&&(y=f.animation.duration-y,v=null);let C=f.animation.timelines,S=C.length;if(d==0&&b==1||p==3){d==0&&(w=!0);for(let k=0;k<S;k++){E.webkit602BugfixHelper(b,p);var l=C[k];l instanceof Ct?this.applyAttachmentTimeline(l,t,y,p,w):l.apply(t,g,y,v,b,p,0)}}else{let k=f.timelineMode,T=f.shortestRotation,Y=!T&&f.timelinesRotation.length!=S<<1;Y&&(f.timelinesRotation.length=S<<1);for(let M=0;M<S;M++){let X=C[M],F=k[M]==zt?p:0;!T&&X instanceof Rt?this.applyRotateTimeline(X,t,y,b,F,f.timelinesRotation,M<<1,Y):X instanceof Ct?this.applyAttachmentTimeline(X,t,y,p,w):(E.webkit602BugfixHelper(b,p),X.apply(t,g,y,v,b,F,0))}}this.queueEvents(f,x),s.length=0,f.nextAnimationLast=x,f.nextTrackLast=f.trackTime}for(var o=this.unkeyedState+Oe,n=t.slots,a=0,h=t.slots.length;a<h;a++){var c=n[a];if(c.attachmentState==o){var u=c.data.attachmentName;c.setAttachment(u?t.getAttachment(c.data.index,u):null)}}return this.unkeyedState+=2,this.queue.drain(),i}applyMixingFrom(t,s,r){let i=t.mixingFrom;i.mixingFrom&&this.applyMixingFrom(i,s,r);let l=0;t.mixDuration==0?(l=1,r==1&&(r=0)):(l=t.mixTime/t.mixDuration,l>1&&(l=1),r!=1&&(r=i.mixBlend));let o=l<i.mixAttachmentThreshold,n=l<i.mixDrawOrderThreshold,a=i.animation.timelines,h=a.length,c=i.alpha*t.interruptAlpha,u=c*(1-l),d=i.animationLast,m=i.getAnimationTime(),f=m,p=null;if(i.reverse?f=i.animation.duration-f:l<i.eventThreshold&&(p=this.events),r==3)for(let b=0;b<h;b++)a[b].apply(s,d,f,p,u,r,1);else{let b=i.timelineMode,w=i.timelineHoldMix,g=i.shortestRotation,x=!g&&i.timelinesRotation.length!=h<<1;x&&(i.timelinesRotation.length=h<<1),i.totalAlpha=0;for(let y=0;y<h;y++){let v=a[y],C=1,S,k=0;switch(b[y]){case zt:if(!n&&v instanceof It)continue;S=r,k=u;break;case Ve:S=0,k=u;break;case Ne:S=r,k=c;break;case Gt:S=0,k=c;break;default:S=0;let T=w[y];k=c*Math.max(0,1-T.mixTime/T.mixDuration);break}i.totalAlpha+=k,!g&&v instanceof Rt?this.applyRotateTimeline(v,s,f,k,S,i.timelinesRotation,y<<1,x):v instanceof Ct?this.applyAttachmentTimeline(v,s,f,S,o&&k>=i.alphaAttachmentThreshold):(E.webkit602BugfixHelper(k,r),n&&v instanceof It&&S==0&&(C=0),v.apply(s,d,f,p,k,S,C))}}return t.mixDuration>0&&this.queueEvents(i,m),this.events.length=0,i.nextAnimationLast=m,i.nextTrackLast=i.trackTime,l}applyAttachmentTimeline(t,s,r,i,l){var o=s.slots[t.slotIndex];o.bone.active&&(r<t.frames[0]?(i==0||i==1)&&this.setAttachment(s,o,o.data.attachmentName,l):this.setAttachment(s,o,t.attachmentNames[$.search1(t.frames,r)],l),o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+Oe))}setAttachment(t,s,r,i){s.setAttachment(r?t.getAttachment(s.data.index,r):null),i&&(s.attachmentState=this.unkeyedState+ks)}applyRotateTimeline(t,s,r,i,l,o,n,a){if(a&&(o[n]=0),i==1){t.apply(s,0,r,null,1,l,0);return}let h=s.bones[t.boneIndex];if(!h.active)return;let c=t.frames,u=0,d=0;if(r<c[0])switch(l){case 0:h.rotation=h.data.rotation;default:return;case 1:u=h.rotation,d=h.data.rotation}else u=l==0?h.data.rotation:h.rotation,d=h.data.rotation+t.getCurveValue(r);let m=0,f=d-u;if(f-=Math.ceil(f/360-.5)*360,f==0)m=o[n];else{let p=0,b=0;a?(p=0,b=f):(p=o[n],b=o[n+1]);let w=p-p%360;m=f+w;let g=f>=0,x=p>=0;Math.abs(b)<=90&&B.signum(b)!=B.signum(f)&&(Math.abs(p-w)>180?(m+=360*B.signum(p),x=g):w!=0?m-=360*B.signum(p):x=g),x!=g&&(m+=360*B.signum(p)),o[n]=m}o[n+1]=f,h.rotation=u+m*i}queueEvents(t,s){let r=t.animationStart,i=t.animationEnd,l=i-r,o=t.trackLast%l,n=this.events,a=0,h=n.length;for(;a<h;a++){let u=n[a];if(u.time<o)break;u.time>i||this.queue.event(t,u)}let c=!1;if(t.loop)if(l==0)c=!0;else{const u=Math.floor(t.trackTime/l);c=u>0&&u>Math.floor(t.trackLast/l)}else c=s>=i&&t.animationLast<i;for(c&&this.queue.complete(t);a<h;a++){let u=n[a];u.time<r||this.queue.event(t,u)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,r=this.tracks.length;s<r;s++)this.clearTrack(s);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;let s=this.tracks[t];if(!s)return;this.queue.end(s),this.clearNext(s);let r=s;for(;;){let i=r.mixingFrom;if(!i)break;this.queue.end(i),r.mixingFrom=null,r.mixingTo=null,r=i}this.tracks[s.trackIndex]=null,this.queue.drain()}setCurrent(t,s,r){let i=this.expandToIndex(t);this.tracks[t]=s,s.previous=null,i&&(r&&this.queue.interrupt(i),s.mixingFrom=i,i.mixingTo=s,s.mixTime=0,i.mixingFrom&&i.mixDuration>0&&(s.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(s)}setAnimation(t,s,r=!1){let i=this.data.skeletonData.findAnimation(s);if(!i)throw new Error("Animation not found: "+s);return this.setAnimationWith(t,i,r)}setAnimationWith(t,s,r=!1){if(!s)throw new Error("animation cannot be null.");let i=!0,l=this.expandToIndex(t);l&&(l.nextTrackLast==-1?(this.tracks[t]=l.mixingFrom,this.queue.interrupt(l),this.queue.end(l),this.clearNext(l),l=l.mixingFrom,i=!1):this.clearNext(l));let o=this.trackEntry(t,s,r,l);return this.setCurrent(t,o,i),this.queue.drain(),o}addAnimation(t,s,r=!1,i=0){let l=this.data.skeletonData.findAnimation(s);if(!l)throw new Error("Animation not found: "+s);return this.addAnimationWith(t,l,r,i)}addAnimationWith(t,s,r=!1,i=0){if(!s)throw new Error("animation cannot be null.");let l=this.expandToIndex(t);if(l)for(;l.next;)l=l.next;let o=this.trackEntry(t,s,r,l);return l?(l.next=o,o.previous=l,i<=0&&(i=Math.max(i+l.getTrackComplete()-o.mixDuration,0))):(this.setCurrent(t,o,!0),this.queue.drain(),i<0&&(i=0)),o.delay=i,o}setEmptyAnimation(t,s=0){let r=this.setAnimationWith(t,ie.emptyAnimation(),!1);return r.mixDuration=s,r.trackEnd=s,r}addEmptyAnimation(t,s=0,r=0){let i=this.addAnimationWith(t,ie.emptyAnimation(),!1,r);return r<=0&&(i.delay=Math.max(i.delay+i.mixDuration-s,0)),i.mixDuration=s,i.trackEnd=s,i}setEmptyAnimations(t=0){let s=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let r=0,i=this.tracks.length;r<i;r++){let l=this.tracks[r];l&&this.setEmptyAnimation(l.trackIndex,t)}this.queue.drainDisabled=s,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(E.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,s,r,i){let l=this.trackEntryPool.obtain();return l.reset(),l.trackIndex=t,l.animation=s,l.loop=r,l.holdPrevious=!1,l.reverse=!1,l.shortestRotation=!1,l.eventThreshold=0,l.alphaAttachmentThreshold=0,l.mixAttachmentThreshold=0,l.mixDrawOrderThreshold=0,l.animationStart=0,l.animationEnd=s.duration,l.animationLast=-1,l.nextAnimationLast=-1,l.delay=0,l.trackTime=0,l.trackLast=-1,l.nextTrackLast=-1,l.trackEnd=Number.MAX_VALUE,l.timeScale=1,l.alpha=1,l.mixTime=0,l.mixDuration=i?this.data.getMix(i.animation,s):0,l.interruptAlpha=1,l.totalAlpha=0,l.mixBlend=2,l}clearNext(t){let s=t.next;for(;s;)this.queue.dispose(s),s=s.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let t=this.tracks;for(let s=0,r=t.length;s<r;s++){let i=t[s];if(i){for(;i.mixingFrom;)i=i.mixingFrom;do(!i.mixingTo||i.mixBlend!=3)&&this.computeHold(i),i=i.mixingTo;while(i)}}}computeHold(t){let s=t.mixingTo,r=t.animation.timelines,i=t.animation.timelines.length,l=t.timelineMode;l.length=i;let o=t.timelineHoldMix;o.length=0;let n=this.propertyIDs;if(s&&s.holdPrevious){for(let a=0;a<i;a++)l[a]=n.addAll(r[a].getPropertyIds())?Gt:Ne;return}t:for(let a=0;a<i;a++){let h=r[a],c=h.getPropertyIds();if(!n.addAll(c))l[a]=zt;else if(!s||h instanceof Ct||h instanceof It||h instanceof Wt||!s.animation.hasTimeline(c))l[a]=Ve;else{for(let u=s.mixingTo;u;u=u.mixingTo)if(!u.animation.hasTimeline(c)){if(t.mixDuration>0){l[a]=As,o[a]=u;continue t}break}l[a]=Gt}}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let s=this.listeners.indexOf(t);s>=0&&this.listeners.splice(s,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},vs=class{animation=null;previous=null;next=null;mixingFrom=null;mixingTo=null;listener=null;trackIndex=0;loop=!1;holdPrevious=!1;reverse=!1;shortestRotation=!1;eventThreshold=0;mixAttachmentThreshold=0;alphaAttachmentThreshold=0;mixDrawOrderThreshold=0;animationStart=0;animationEnd=0;animationLast=0;nextAnimationLast=0;delay=0;trackTime=0;trackLast=0;nextTrackLast=0;trackEnd=0;timeScale=0;alpha=0;mixTime=0;_mixDuration=0;interruptAlpha=0;totalAlpha=0;get mixDuration(){return this._mixDuration}set mixDuration(e){this._mixDuration=e}setMixDurationWithDelay(e,t){this._mixDuration=e,t<=0&&(this.previous!=null?t=Math.max(t+this.previous.getTrackComplete()-e,0):t=0),this.delay=t}mixBlend=2;timelineMode=new Array;timelineHoldMix=new Array;timelinesRotation=new Array;reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let e=this.animationEnd-this.animationStart;return e==0?this.animationStart:this.trackTime%e+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let e=this.animationEnd-this.animationStart;if(e!=0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime<e)return e}return this.trackTime}wasApplied(){return this.nextTrackLast!=-1}isNextReady(){return this.next!=null&&this.nextTrackLast-this.next.delay>=0}},Cs=class{objects=[];drainDisabled=!1;animState;constructor(e){this.animState=e}start(e){this.objects.push(0),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(1),this.objects.push(e)}end(e){this.objects.push(2),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(3),this.objects.push(e)}complete(e){this.objects.push(4),this.objects.push(e)}event(e,t){this.objects.push(5),this.objects.push(e),this.objects.push(t)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects,t=this.animState.listeners;for(let s=0;s<e.length;s+=2){let r=e[s],i=e[s+1];switch(r){case 0:i.listener&&i.listener.start&&i.listener.start(i);for(let o=0;o<t.length;o++){let n=t[o];n.start&&n.start(i)}break;case 1:i.listener&&i.listener.interrupt&&i.listener.interrupt(i);for(let o=0;o<t.length;o++){let n=t[o];n.interrupt&&n.interrupt(i)}break;case 2:i.listener&&i.listener.end&&i.listener.end(i);for(let o=0;o<t.length;o++){let n=t[o];n.end&&n.end(i)}case 3:i.listener&&i.listener.dispose&&i.listener.dispose(i);for(let o=0;o<t.length;o++){let n=t[o];n.dispose&&n.dispose(i)}this.animState.trackEntryPool.free(i);break;case 4:i.listener&&i.listener.complete&&i.listener.complete(i);for(let o=0;o<t.length;o++){let n=t[o];n.complete&&n.complete(i)}break;case 5:let l=e[s+++2];i.listener&&i.listener.event&&i.listener.event(i,l);for(let o=0;o<t.length;o++){let n=t[o];n.event&&n.event(i,l)}break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},Ss=(e=>(e[e.start=0]="start",e[e.interrupt=1]="interrupt",e[e.end=2]="end",e[e.dispose=3]="dispose",e[e.complete=4]="complete",e[e.event=5]="event",e))(Ss||{}),bi=class{start(e){}interrupt(e){}end(e){}dispose(e){}complete(e){}event(e,t){}},zt=0,Ve=1,Ne=2,Gt=3,As=4,Oe=1,ks=2,Ts=class{skeletonData;animationToMixTime={};defaultMix=0;constructor(e){if(!e)throw new Error("skeletonData cannot be null.");this.skeletonData=e}setMix(e,t,s){let r=this.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);let i=this.skeletonData.findAnimation(t);if(!i)throw new Error("Animation not found: "+t);this.setMixWith(r,i,s)}setMixWith(e,t,s){if(!e)throw new Error("from cannot be null.");if(!t)throw new Error("to cannot be null.");let r=e.name+"."+t.name;this.animationToMixTime[r]=s}getMix(e,t){let s=e.name+"."+t.name,r=this.animationToMixTime[s];return r===void 0?this.defaultMix:r}},_e=class ti extends dt{color=new V(1,1,1,1);constructor(t){super(t)}copy(){let t=new ti(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},St=class ei extends dt{endSlot=null;color=new V(.2275,.2275,.8078,1);constructor(t){super(t)}copy(){let t=new ei(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},Ue=class{_image;constructor(e){this._image=e}getImage(){return this._image}},Ht=(e=>(e[e.Nearest=9728]="Nearest",e[e.Linear=9729]="Linear",e[e.MipMap=9987]="MipMap",e[e.MipMapNearestNearest=9984]="MipMapNearestNearest",e[e.MipMapLinearNearest=9985]="MipMapLinearNearest",e[e.MipMapNearestLinear=9986]="MipMapNearestLinear",e[e.MipMapLinearLinear=9987]="MipMapLinearLinear",e))(Ht||{}),Is=(e=>(e[e.MirroredRepeat=33648]="MirroredRepeat",e[e.ClampToEdge=33071]="ClampToEdge",e[e.Repeat=10497]="Repeat",e))(Is||{}),Ms=class{texture;u=0;v=0;u2=0;v2=0;width=0;height=0;degrees=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0},wi=class extends Ue{setFilters(e,t){}setWraps(e,t){}dispose(){}},$t=class{pages=new Array;regions=new Array;constructor(e){let t=new yi(e),s=new Array(4),r={};r.size=h=>{h.width=parseInt(s[1]),h.height=parseInt(s[2])},r.format=()=>{},r.filter=h=>{h.minFilter=E.enumValue(Ht,s[1]),h.magFilter=E.enumValue(Ht,s[2])},r.repeat=h=>{s[1].indexOf("x")!=-1&&(h.uWrap=10497),s[1].indexOf("y")!=-1&&(h.vWrap=10497)},r.pma=h=>{h.pma=s[1]=="true"};var i={};i.xy=h=>{h.x=parseInt(s[1]),h.y=parseInt(s[2])},i.size=h=>{h.width=parseInt(s[1]),h.height=parseInt(s[2])},i.bounds=h=>{h.x=parseInt(s[1]),h.y=parseInt(s[2]),h.width=parseInt(s[3]),h.height=parseInt(s[4])},i.offset=h=>{h.offsetX=parseInt(s[1]),h.offsetY=parseInt(s[2])},i.orig=h=>{h.originalWidth=parseInt(s[1]),h.originalHeight=parseInt(s[2])},i.offsets=h=>{h.offsetX=parseInt(s[1]),h.offsetY=parseInt(s[2]),h.originalWidth=parseInt(s[3]),h.originalHeight=parseInt(s[4])},i.rotate=h=>{let c=s[1];c=="true"?h.degrees=90:c!="false"&&(h.degrees=parseInt(c))},i.index=h=>{h.index=parseInt(s[1])};let l=t.readLine();for(;l&&l.trim().length==0;)l=t.readLine();for(;!(!l||l.trim().length==0||t.readEntry(s,l)==0);)l=t.readLine();let o=null,n=null,a=null;for(;l!==null;)if(l.trim().length==0)o=null,l=t.readLine();else if(o){let h=new qe(o,l);for(;;){let c=t.readEntry(s,l=t.readLine());if(c==0)break;let u=i[s[0]];if(u)u(h);else{n||(n=[]),a||(a=[]),n.push(s[0]);let d=[];for(let m=0;m<c;m++)d.push(parseInt(s[m+1]));a.push(d)}}h.originalWidth==0&&h.originalHeight==0&&(h.originalWidth=h.width,h.originalHeight=h.height),n&&n.length>0&&a&&a.length>0&&(h.names=n,h.values=a,n=null,a=null),h.u=h.x/o.width,h.v=h.y/o.height,h.degrees==90?(h.u2=(h.x+h.height)/o.width,h.v2=(h.y+h.width)/o.height):(h.u2=(h.x+h.width)/o.width,h.v2=(h.y+h.height)/o.height),this.regions.push(h)}else{for(o=new Ys(l.trim());t.readEntry(s,l=t.readLine())!=0;){let h=r[s[0]];h&&h(o)}this.pages.push(o)}}findRegion(e){for(let t=0;t<this.regions.length;t++)if(this.regions[t].name==e)return this.regions[t];return null}setTextures(e,t=""){for(let s of this.pages)s.setTexture(e.get(t+s.name))}dispose(){for(let e=0;e<this.pages.length;e++)this.pages[e].texture?.dispose()}},yi=class{lines;index=0;constructor(e){this.lines=e.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length==0))return 0;let s=t.indexOf(":");if(s==-1)return 0;e[0]=t.substr(0,s).trim();for(let r=1,i=s+1;;r++){let l=t.indexOf(",",i);if(l==-1)return e[r]=t.substr(i).trim(),r;if(e[r]=t.substr(i,l-i).trim(),i=l+1,r==4)return 4}}},Ys=class{name;minFilter=9728;magFilter=9728;uWrap=33071;vWrap=33071;texture=null;width=0;height=0;pma=!1;regions=new Array;constructor(e){this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(let t of this.regions)t.texture=e}},qe=class extends Ms{page;name;x=0;y=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0;index=0;degrees=0;names=null;values=null;constructor(e,t){super(),this.page=e,this.name=t,e.regions.push(this)}},ut=class hs extends dt{region=null;path;regionUVs=[];uvs=[];triangles=[];color=new V(1,1,1,1);width=0;height=0;hullLength=0;edges=[];parentMesh=null;sequence=null;tempColor=new V(0,0,0,0);constructor(t,s){super(t),this.path=s}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=E.newFloatArray(t.length));let s=this.uvs,r=this.uvs.length,i=this.region.u,l=this.region.v,o=0,n=0;if(this.region instanceof qe){let a=this.region,h=a.page,c=h.width,u=h.height;switch(a.degrees){case 90:i-=(a.originalHeight-a.offsetY-a.height)/c,l-=(a.originalWidth-a.offsetX-a.width)/u,o=a.originalHeight/c,n=a.originalWidth/u;for(let d=0;d<r;d+=2)s[d]=i+t[d+1]*o,s[d+1]=l+(1-t[d])*n;return;case 180:i-=(a.originalWidth-a.offsetX-a.width)/c,l-=a.offsetY/u,o=a.originalWidth/c,n=a.originalHeight/u;for(let d=0;d<r;d+=2)s[d]=i+(1-t[d])*o,s[d+1]=l+(1-t[d+1])*n;return;case 270:i-=a.offsetY/c,l-=a.offsetX/u,o=a.originalHeight/c,n=a.originalWidth/u;for(let d=0;d<r;d+=2)s[d]=i+(1-t[d+1])*o,s[d+1]=l+t[d]*n;return}i-=a.offsetX/c,l-=(a.originalHeight-a.offsetY-a.height)/u,o=a.originalWidth/c,n=a.originalHeight/u}else this.region?(o=this.region.u2-i,n=this.region.v2-l):(i=l=0,o=n=1);for(let a=0;a<r;a+=2)s[a]=i+t[a]*o,s[a+1]=l+t[a+1]*n}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let t=new hs(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Array(this.regionUVs.length),E.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=new Array(this.uvs.length),E.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=new Array(this.triangles.length),E.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,t.sequence=this.sequence!=null?this.sequence.copy():null,this.edges&&(t.edges=new Array(this.edges.length),E.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}computeWorldVertices(t,s,r,i,l,o){this.sequence!=null&&this.sequence.apply(t,this),super.computeWorldVertices(t,s,r,i,l,o)}newLinkedMesh(){let t=new hs(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),t.timelineAttachment=this.timelineAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),t.region!=null&&t.updateRegion(),t}},Mt=class si extends dt{lengths=[];closed=!1;constantSpeed=!1;color=new V(1,1,1,1);constructor(t){super(t)}copy(){let t=new si(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),E.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}},Ps=class ii extends dt{x=0;y=0;rotation=0;color=new V(.38,.94,0,1);constructor(t){super(t)}computeWorldPosition(t,s){return s.x=this.x*t.a+this.y*t.b+t.worldX,s.y=this.x*t.c+this.y*t.d+t.worldY,s}computeWorldRotation(t){const s=this.rotation*B.degRad,r=Math.cos(s),i=Math.sin(s),l=r*t.a+i*t.b,o=r*t.c+i*t.d;return B.atan2Deg(o,l)}copy(){let t=new ii(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}},ot=class ri extends ae{x=0;y=0;scaleX=1;scaleY=1;rotation=0;width=0;height=0;color=new V(1,1,1,1);path;region=null;sequence=null;offset=E.newFloatArray(8);uvs=E.newFloatArray(8);tempColor=new V(1,1,1,1);constructor(t,s){super(t),this.path=s}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.region,s=this.uvs;if(t==null){s[0]=0,s[1]=0,s[2]=0,s[3]=1,s[4]=1,s[5]=1,s[6]=1,s[7]=0;return}let r=this.width/this.region.originalWidth*this.scaleX,i=this.height/this.region.originalHeight*this.scaleY,l=-this.width/2*this.scaleX+this.region.offsetX*r,o=-this.height/2*this.scaleY+this.region.offsetY*i,n=l+this.region.width*r,a=o+this.region.height*i,h=this.rotation*B.degRad,c=Math.cos(h),u=Math.sin(h),d=this.x,m=this.y,f=l*c+d,p=l*u,b=o*c+m,w=o*u,g=n*c+d,x=n*u,y=a*c+m,v=a*u,C=this.offset;C[0]=f-w,C[1]=b+p,C[2]=f-v,C[3]=y+p,C[4]=g-v,C[5]=y+x,C[6]=g-w,C[7]=b+x,t.degrees==90?(s[0]=t.u2,s[1]=t.v2,s[2]=t.u,s[3]=t.v2,s[4]=t.u,s[5]=t.v,s[6]=t.u2,s[7]=t.v):(s[0]=t.u,s[1]=t.v2,s[2]=t.u,s[3]=t.v,s[4]=t.u2,s[5]=t.v,s[6]=t.u2,s[7]=t.v2)}computeWorldVertices(t,s,r,i){this.sequence!=null&&this.sequence.apply(t,this);let l=t.bone,o=this.offset,n=l.worldX,a=l.worldY,h=l.a,c=l.b,u=l.c,d=l.d,m=0,f=0;m=o[0],f=o[1],s[r]=m*h+f*c+n,s[r+1]=m*u+f*d+a,r+=i,m=o[2],f=o[3],s[r]=m*h+f*c+n,s[r+1]=m*u+f*d+a,r+=i,m=o[4],f=o[5],s[r]=m*h+f*c+n,s[r+1]=m*u+f*d+a,r+=i,m=o[6],f=o[7],s[r]=m*h+f*c+n,s[r+1]=m*u+f*d+a}copy(){let t=new ri(this.name,this.path);return t.region=this.region,t.x=this.x,t.y=this.y,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.rotation=this.rotation,t.width=this.width,t.height=this.height,E.arrayCopy(this.uvs,0,t.uvs,0,8),E.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t.sequence=this.sequence!=null?this.sequence.copy():null,t}static X1=0;static Y1=1;static C1R=2;static C1G=3;static C1B=4;static C1A=5;static U1=6;static V1=7;static X2=8;static Y2=9;static C2R=10;static C2G=11;static C2B=12;static C2A=13;static U2=14;static V2=15;static X3=16;static Y3=17;static C3R=18;static C3G=19;static C3B=20;static C3A=21;static U3=22;static V3=23;static X4=24;static Y4=25;static C4R=26;static C4G=27;static C4B=28;static C4A=29;static U4=30;static V4=31},Xs=class{atlas;constructor(e){this.atlas=e}loadSequence(e,t,s){let r=s.regions;for(let i=0,l=r.length;i<l;i++){let o=s.getPath(t,i),n=this.atlas.findRegion(o);if(n==null)throw new Error("Region not found in atlas: "+o+" (sequence: "+e+")");r[i]=n}}newRegionAttachment(e,t,s,r){let i=new ot(t,s);if(r!=null)this.loadSequence(t,s,r);else{let l=this.atlas.findRegion(s);if(!l)throw new Error("Region not found in atlas: "+s+" (region attachment: "+t+")");i.region=l}return i}newMeshAttachment(e,t,s,r){let i=new ut(t,s);if(r!=null)this.loadSequence(t,s,r);else{let l=this.atlas.findRegion(s);if(!l)throw new Error("Region not found in atlas: "+s+" (mesh attachment: "+t+")");i.region=l}return i}newBoundingBoxAttachment(e,t){return new _e(t)}newPathAttachment(e,t){return new Mt(t)}newPointAttachment(e,t){return new Ps(t)}newClippingAttachment(e,t){return new St(t)}},We=class{index=0;name;parent=null;length=0;x=0;y=0;rotation=0;scaleX=1;scaleY=1;shearX=0;shearY=0;inherit=0;skinRequired=!1;color=new V;icon;visible=!1;constructor(e,t,s){if(e<0)throw new Error("index must be >= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=s}},jt=(e=>(e[e.Normal=0]="Normal",e[e.OnlyTranslation=1]="OnlyTranslation",e[e.NoRotationOrReflection=2]="NoRotationOrReflection",e[e.NoScale=3]="NoScale",e[e.NoScaleOrReflection=4]="NoScaleOrReflection",e))(jt||{}),ze=class{data;skeleton;parent=null;children=new Array;x=0;y=0;rotation=0;scaleX=0;scaleY=0;shearX=0;shearY=0;ax=0;ay=0;arotation=0;ascaleX=0;ascaleY=0;ashearX=0;ashearY=0;a=0;b=0;c=0;d=0;worldY=0;worldX=0;inherit=0;sorted=!1;active=!1;constructor(e,t,s){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=t,this.parent=s,this.setToSetupPose()}isActive(){return this.active}update(e){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,t,s,r,i,l,o){this.ax=e,this.ay=t,this.arotation=s,this.ascaleX=r,this.ascaleY=i,this.ashearX=l,this.ashearY=o;let n=this.parent;if(!n){let d=this.skeleton;const m=d.scaleX,f=d.scaleY,p=(s+l)*B.degRad,b=(s+90+o)*B.degRad;this.a=Math.cos(p)*r*m,this.b=Math.cos(b)*i*m,this.c=Math.sin(p)*r*f,this.d=Math.sin(b)*i*f,this.worldX=e*m+d.x,this.worldY=t*f+d.y;return}let a=n.a,h=n.b,c=n.c,u=n.d;switch(this.worldX=a*e+h*t+n.worldX,this.worldY=c*e+u*t+n.worldY,this.inherit){case 0:{const d=(s+l)*B.degRad,m=(s+90+o)*B.degRad,f=Math.cos(d)*r,p=Math.cos(m)*i,b=Math.sin(d)*r,w=Math.sin(m)*i;this.a=a*f+h*b,this.b=a*p+h*w,this.c=c*f+u*b,this.d=c*p+u*w;return}case 1:{const d=(s+l)*B.degRad,m=(s+90+o)*B.degRad;this.a=Math.cos(d)*r,this.b=Math.cos(m)*i,this.c=Math.sin(d)*r,this.d=Math.sin(m)*i;break}case 2:{let d=1/this.skeleton.scaleX,m=1/this.skeleton.scaleY;a*=d,c*=m;let f=a*a+c*c,p=0;f>1e-4?(f=Math.abs(a*u*m-h*d*c)/f,h=c*f,u=a*f,p=Math.atan2(c,a)*B.radDeg):(a=0,c=0,p=90-Math.atan2(u,h)*B.radDeg);const b=(s+l-p)*B.degRad,w=(s+o-p+90)*B.degRad,g=Math.cos(b)*r,x=Math.cos(w)*i,y=Math.sin(b)*r,v=Math.sin(w)*i;this.a=a*g-h*y,this.b=a*x-h*v,this.c=c*g+u*y,this.d=c*x+u*v;break}case 3:case 4:{s*=B.degRad;const d=Math.cos(s),m=Math.sin(s);let f=(a*d+h*m)/this.skeleton.scaleX,p=(c*d+u*m)/this.skeleton.scaleY,b=Math.sqrt(f*f+p*p);b>1e-5&&(b=1/b),f*=b,p*=b,b=Math.sqrt(f*f+p*p),this.inherit==3&&a*u-h*c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(b=-b),s=Math.PI/2+Math.atan2(p,f);const w=Math.cos(s)*b,g=Math.sin(s)*b;l*=B.degRad,o=(90+o)*B.degRad;const x=Math.cos(l)*r,y=Math.cos(o)*i,v=Math.sin(l)*r,C=Math.sin(o)*i;this.a=f*x+w*v,this.b=f*y+w*C,this.c=p*x+g*v,this.d=p*y+g*C;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let e=this.data;this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}updateAppliedTransform(){let e=this.parent;if(!e){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*B.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*B.radDeg;return}let t=e.a,s=e.b,r=e.c,i=e.d,l=1/(t*i-s*r),o=i*l,n=s*l,a=r*l,h=t*l,c=this.worldX-e.worldX,u=this.worldY-e.worldY;this.ax=c*o-u*n,this.ay=u*h-c*a;let d,m,f,p;if(this.inherit==1)d=this.a,m=this.b,f=this.c,p=this.d;else{switch(this.inherit){case 2:{let y=Math.abs(t*i-s*r)/(t*t+r*r);s=-r*this.skeleton.scaleX*y/this.skeleton.scaleY,i=t*this.skeleton.scaleY*y/this.skeleton.scaleX,l=1/(t*i-s*r),o=i*l,n=s*l;break}case 3:case 4:let b=B.cosDeg(this.rotation),w=B.sinDeg(this.rotation);t=(t*b+s*w)/this.skeleton.scaleX,r=(r*b+i*w)/this.skeleton.scaleY;let g=Math.sqrt(t*t+r*r);g>1e-5&&(g=1/g),t*=g,r*=g,g=Math.sqrt(t*t+r*r),this.inherit==3&&l<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(g=-g);let x=B.PI/2+Math.atan2(r,t);s=Math.cos(x)*g,i=Math.sin(x)*g,l=1/(t*i-s*r),o=i*l,n=s*l,a=r*l,h=t*l}d=o*this.a-n*this.c,m=o*this.b-n*this.d,f=h*this.c-a*this.a,p=h*this.d-a*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+f*f),this.ascaleX>1e-4){let b=d*p-m*f;this.ascaleY=b/this.ascaleX,this.ashearY=-Math.atan2(d*m+f*p,b)*B.radDeg,this.arotation=Math.atan2(f,d)*B.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(m*m+p*p),this.ashearY=0,this.arotation=90-Math.atan2(p,m)*B.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*B.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*B.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)}worldToLocal(e){let t=1/(this.a*this.d-this.b*this.c),s=e.x-this.worldX,r=e.y-this.worldY;return e.x=s*this.d*t-r*this.b*t,e.y=r*this.a*t-s*this.c*t,e}localToWorld(e){let t=e.x,s=e.y;return e.x=t*this.a+s*this.b+this.worldX,e.y=t*this.c+s*this.d+this.worldY,e}worldToParent(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.worldToLocal(e)}parentToWorld(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.localToWorld(e)}worldToLocalRotation(e){let t=B.sinDeg(e),s=B.cosDeg(e);return Math.atan2(this.a*t-this.c*s,this.d*s-this.b*t)*B.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=B.sinDeg(e),s=B.cosDeg(e);return Math.atan2(s*this.c+t*this.d,s*this.a+t*this.b)*B.radDeg}rotateWorld(e){e*=B.degRad;const t=Math.sin(e),s=Math.cos(e),r=this.a,i=this.b;this.a=s*r-t*this.c,this.b=s*i-t*this.d,this.c=t*r+s*this.c,this.d=t*i+s*this.d}},Dt=class{constructor(e,t,s){this.name=e,this.order=t,this.skinRequired=s}},vi=class{pathPrefix="";textureLoader;downloader;assets={};assetsRefCount={};assetsLoaded={};errors={};toLoad=0;loaded=0;constructor(e,t="",s=new Fs){this.textureLoader=e,this.pathPrefix=t,this.downloader=s}start(e){return this.toLoad++,this.pathPrefix+e}success(e,t,s){this.toLoad--,this.loaded++,this.assets[t]=s,this.assetsRefCount[t]=(this.assetsRefCount[t]||0)+1,e&&e(t,s)}error(e,t,s){this.toLoad--,this.loaded++,this.errors[t]=s,e&&e(t,s)}loadAll(){return new Promise((t,s)=>{let r=()=>{if(this.isLoadingComplete()){this.hasErrors()?s(this.errors):t(this);return}requestAnimationFrame(r)};requestAnimationFrame(r)})}setRawDataURI(e,t){this.downloader.rawDataUris[this.pathPrefix+e]=t}loadBinary(e,t=()=>{},s=()=>{}){e=this.start(e),!this.reuseAssets(e,t,s)&&(this.assetsLoaded[e]=new Promise((r,i)=>{this.downloader.downloadBinary(e,l=>{this.success(t,e,l),r(l)},(l,o)=>{const n=`Couldn't load binary ${e}: status ${l}, ${o}`;this.error(s,e,n),i(n)})}))}loadText(e,t=()=>{},s=()=>{}){e=this.start(e),this.downloader.downloadText(e,r=>{this.success(t,e,r)},(r,i)=>{this.error(s,e,`Couldn't load text ${e}: status ${r}, ${i}`)})}loadJson(e,t=()=>{},s=()=>{}){e=this.start(e),!this.reuseAssets(e,t,s)&&(this.assetsLoaded[e]=new Promise((r,i)=>{this.downloader.downloadJson(e,l=>{this.success(t,e,l),r(l)},(l,o)=>{const n=`Couldn't load JSON ${e}: status ${l}, ${o}`;this.error(s,e,n),i(n)})}))}reuseAssets(e,t=()=>{},s=()=>{}){const r=this.assetsLoaded[e],i=r!==void 0;return i&&r.then(l=>this.success(t,e,l)).catch(l=>this.error(s,e,l)),i}loadTexture(e,t=()=>{},s=()=>{}){e=this.start(e),!this.reuseAssets(e,t,s)&&(this.assetsLoaded[e]=new Promise((r,i)=>{if(!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(e,{mode:"cors"}).then(n=>{if(n.ok)return n.blob();const a=`Couldn't load image: ${e}`;this.error(s,e,`Couldn't load image: ${e}`),i(a)}).then(n=>n?createImageBitmap(n,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(n=>{if(n){const a=this.textureLoader(n);this.success(t,e,a),r(a)}});else{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{const a=this.textureLoader(n);this.success(t,e,a),r(a)},n.onerror=()=>{const a=`Couldn't load image: ${e}`;this.error(s,e,a),i(a)},this.downloader.rawDataUris[e]&&(e=this.downloader.rawDataUris[e]),n.src=e}}))}loadTextureAtlas(e,t=()=>{},s=()=>{},r){let i=e.lastIndexOf("/"),l=i>=0?e.substring(0,i+1):"";e=this.start(e),!this.reuseAssets(e,t,s)&&(this.assetsLoaded[e]=new Promise((o,n)=>{this.downloader.downloadText(e,a=>{try{let h=new $t(a),c=h.pages.length,u=!1;for(let d of h.pages)this.loadTexture(r?r[d.name]:l+d.name,(m,f)=>{u||(d.setTexture(f),--c==0&&(this.success(t,e,h),o(h)))},(m,f)=>{if(!u){const p=`Couldn't load texture atlas ${e} page image: ${m}`;this.error(s,e,p),n(p)}u=!0})}catch(h){const c=`Couldn't parse texture atlas ${e}: ${h.message}`;this.error(s,e,c),n(c)}},(a,h)=>{const c=`Couldn't load texture atlas ${e}: status ${a}, ${h}`;this.error(s,e,c),n(c)})}))}loadTextureAtlasButNoTextures(e,t=()=>{},s=()=>{},r){e=this.start(e),!this.reuseAssets(e,t,s)&&(this.assetsLoaded[e]=new Promise((i,l)=>{this.downloader.downloadText(e,o=>{try{const n=new $t(o);this.success(t,e,n),i(n)}catch(n){const a=`Couldn't parse texture atlas ${e}: ${n.message}`;this.error(s,e,a),l(a)}},(o,n)=>{const a=`Couldn't load texture atlas ${e}: status ${o}, ${n}`;this.error(s,e,a),l(a)})}))}async loadBinaryAsync(e){return new Promise((t,s)=>{this.loadBinary(e,(r,i)=>t(i),(r,i)=>s(i))})}async loadJsonAsync(e){return new Promise((t,s)=>{this.loadJson(e,(r,i)=>t(i),(r,i)=>s(i))})}async loadTextureAsync(e){return new Promise((t,s)=>{this.loadTexture(e,(r,i)=>t(i),(r,i)=>s(i))})}async loadTextureAtlasAsync(e){return new Promise((t,s)=>{this.loadTextureAtlas(e,(r,i)=>t(i),(r,i)=>s(i))})}async loadTextureAtlasButNoTexturesAsync(e){return new Promise((t,s)=>{this.loadTextureAtlasButNoTextures(e,(r,i)=>t(i),(r,i)=>s(i))})}get(e){return this.assets[this.pathPrefix+e]}require(e){e=this.pathPrefix+e;let t=this.assets[e];if(t)return t;let s=this.errors[e];throw Error("Asset not found: "+e+(s?`
|
|
2
|
+
`+s:""))}remove(e){e=this.pathPrefix+e;let t=this.assets[e];return t.dispose&&t.dispose(),delete this.assets[e],delete this.assetsRefCount[e],delete this.assetsLoaded[e],t}removeAll(){for(let e in this.assets){let t=this.assets[e];t.dispose&&t.dispose()}this.assets={},this.assetsLoaded={},this.assetsRefCount={}}isLoadingComplete(){return this.toLoad==0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}disposeAsset(e){--this.assetsRefCount[e]===0&&this.remove(e)}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},Fs=class{callbacks={};rawDataUris={};dataUriToString(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");return t!=-1?(t+=7,atob(e.substr(t))):e.substr(e.indexOf(",")+1)}base64ToUint8Array(e){for(var t=window.atob(e),s=t.length,r=new Uint8Array(s),i=0;i<s;i++)r[i]=t.charCodeAt(i);return r}dataUriToUint8Array(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");if(t==-1)throw new Error("Not a binary data URI.");return t+=7,this.base64ToUint8Array(e.substr(t))}downloadText(e,t,s){if(this.start(e,t,s))return;const r=this.rawDataUris[e];if(r&&!r.includes(".")){try{this.finish(e,200,this.dataUriToString(r))}catch(o){this.finish(e,400,JSON.stringify(o))}return}let i=new XMLHttpRequest;i.overrideMimeType("text/html"),i.open("GET",r||e,!0);let l=()=>{this.finish(e,i.status,i.responseText)};i.onload=l,i.onerror=l,i.send()}downloadJson(e,t,s){this.downloadText(e,r=>{t(JSON.parse(r))},s)}downloadBinary(e,t,s){if(this.start(e,t,s))return;const r=this.rawDataUris[e];if(r&&!r.includes(".")){try{this.finish(e,200,this.dataUriToUint8Array(r))}catch(o){this.finish(e,400,JSON.stringify(o))}return}let i=new XMLHttpRequest;i.open("GET",r||e,!0),i.responseType="arraybuffer";let l=()=>{this.finish(e,i.status,i.response)};i.onload=()=>{i.status==200||i.status==0?this.finish(e,200,new Uint8Array(i.response)):l()},i.onerror=l,i.send()}start(e,t,s){let r=this.callbacks[e];try{if(r)return!0;this.callbacks[e]=r=[]}finally{r.push(t,s)}}finish(e,t,s){let r=this.callbacks[e];delete this.callbacks[e];let i=t==200||t==0?[s]:[t,s];for(let l=i.length-1,o=r.length;l<o;l+=2)r[l].apply(null,i)}},Ge=class{data;intValue=0;floatValue=0;stringValue=null;time=0;volume=0;balance=0;constructor(e,t){if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},He=class{name;intValue=0;floatValue=0;stringValue=null;audioPath=null;volume=0;balance=0;constructor(e){this.name=e}},Bs=class{data;bones;target;bendDirection=0;compress=!1;stretch=!1;mix=1;softness=0;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let r=0;r<e.bones.length;r++){let i=t.findBone(e.bones[r].name);if(!i)throw new Error(`Couldn't find bone ${e.bones[r].name}`);this.bones.push(i)}let s=t.findBone(e.target.name);if(!s)throw new Error(`Couldn't find bone ${e.target.name}`);this.target=s,this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch}isActive(){return this.active}setToSetupPose(){const e=this.data;this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch}update(e){if(this.mix==0)return;let t=this.target,s=this.bones;switch(s.length){case 1:this.apply1(s[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(s[0],s[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(e,t,s,r,i,l,o){let n=e.parent;if(!n)throw new Error("IK bone must have parent.");let a=n.a,h=n.b,c=n.c,u=n.d,d=-e.ashearX-e.arotation,m=0,f=0;switch(e.inherit){case 1:m=(t-e.worldX)*B.signum(e.skeleton.scaleX),f=(s-e.worldY)*B.signum(e.skeleton.scaleY);break;case 2:let w=Math.abs(a*u-h*c)/Math.max(1e-4,a*a+c*c),g=a/e.skeleton.scaleX,x=c/e.skeleton.scaleY;h=-x*w*e.skeleton.scaleX,u=g*w*e.skeleton.scaleY,d+=Math.atan2(x,g)*B.radDeg;default:let y=t-n.worldX,v=s-n.worldY,C=a*u-h*c;Math.abs(C)<=1e-4?(m=0,f=0):(m=(y*u-v*h)/C-e.ax,f=(v*a-y*c)/C-e.ay)}d+=Math.atan2(f,m)*B.radDeg,e.ascaleX<0&&(d+=180),d>180?d-=360:d<-180&&(d+=360);let p=e.ascaleX,b=e.ascaleY;if(r||i){switch(e.inherit){case 3:case 4:m=t-e.worldX,f=s-e.worldY}const w=e.data.length*p;if(w>1e-4){const g=m*m+f*f;if(r&&g<w*w||i&&g>w*w){const x=(Math.sqrt(g)/w-1)*o+1;p*=x,l&&(b*=x)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+d*o,p,b,e.ashearX,e.ashearY)}apply2(e,t,s,r,i,l,o,n,a){if(e.inherit!=0||t.inherit!=0)return;let h=e.ax,c=e.ay,u=e.ascaleX,d=e.ascaleY,m=u,f=d,p=t.ascaleX,b=0,w=0,g=0;u<0?(u=-u,b=180,g=-1):(b=0,g=1),d<0&&(d=-d,g=-g),p<0?(p=-p,w=180):w=0;let x=t.ax,y=0,v=0,C=0,S=e.a,k=e.b,T=e.c,Y=e.d,M=Math.abs(u-d)<=1e-4;!M||l?(y=0,v=S*x+e.worldX,C=T*x+e.worldY):(y=t.ay,v=S*x+k*y+e.worldX,C=T*x+Y*y+e.worldY);let X=e.parent;if(!X)throw new Error("IK parent must itself have a parent.");S=X.a,k=X.b,T=X.c,Y=X.d;let F=S*Y-k*T,I=v-X.worldX,P=C-X.worldY;F=Math.abs(F)<=1e-4?0:1/F;let D=(I*Y-P*k)*F-h,O=(P*S-I*T)*F-c,L=Math.sqrt(D*D+O*O),_=t.data.length*p,H,z;if(L<1e-4){this.apply1(e,s,r,!1,l,!1,a),t.updateWorldTransformWith(x,y,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}I=s-X.worldX,P=r-X.worldY;let j=(I*Y-P*k)*F-h,R=(P*S-I*T)*F-c,U=j*j+R*R;if(n!=0){n*=u*(p+1)*.5;let J=Math.sqrt(U),Z=J-L-_*u+n;if(Z>0){let tt=Math.min(1,Z/(n*2))-1;tt=(Z-n*(1-tt*tt))/J,j-=tt*j,R-=tt*R,U=j*j+R*R}}t:if(M){_*=u;let J=(U-L*L-_*_)/(2*L*_);J<-1?(J=-1,z=Math.PI*i):J>1?(J=1,z=0,l&&(S=(Math.sqrt(U)/(L+_)-1)*a+1,m*=S,o&&(f*=S))):z=Math.acos(J)*i,S=L+_*J,k=_*Math.sin(z),H=Math.atan2(R*S-j*k,j*S+R*k)}else{S=u*_,k=d*_;let J=S*S,Z=k*k,tt=Math.atan2(R,j);T=Z*L*L+J*U-J*Z;let ht=-2*Z*L,Xt=Z-J;if(Y=ht*ht-4*Xt*T,Y>=0){let Ft=Math.sqrt(Y);ht<0&&(Ft=-Ft),Ft=-(ht+Ft)*.5;let _t=Ft/Xt,js=T/Ft,ee=Math.abs(_t)<Math.abs(js)?_t:js;if(_t=U-ee*ee,_t>=0){P=Math.sqrt(_t)*i,H=tt-Math.atan2(P,ee),z=Math.atan2(P/d,(ee-L)/u);break t}}let Ot=B.PI,Zt=L-S,os=Zt*Zt,Gs=0,Hs=0,te=L+S,ls=te*te,$s=0;T=-S*L/(J-Z),T>=-1&&T<=1&&(T=Math.acos(T),I=S*Math.cos(T)+L,P=k*Math.sin(T),Y=I*I+P*P,Y<os&&(Ot=T,os=Y,Zt=I,Gs=P),Y>ls&&(Hs=T,ls=Y,te=I,$s=P)),U<=(os+ls)*.5?(H=tt-Math.atan2(Gs*i,Zt),z=Ot*i):(H=tt-Math.atan2($s*i,te),z=Hs*i)}let G=Math.atan2(y,x)*g,st=e.arotation;H=(H-G)*B.radDeg+b-st,H>180?H-=360:H<-180&&(H+=360),e.updateWorldTransformWith(h,c,st+H*a,m,f,0,0),st=t.arotation,z=((z+G)*B.radDeg-t.ashearX)*g+w-st,z>180?z-=360:z<-180&&(z+=360),t.updateWorldTransformWith(x,y,st+z*a,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},$e=class extends Dt{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}bendDirection=0;compress=!1;stretch=!1;uniform=!1;mix=0;softness=0;constructor(e){super(e,0,!1)}},je=class extends Dt{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}positionMode=0;spacingMode=1;rotateMode=1;offsetRotation=0;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;constructor(e){super(e,0,!1)}},Je=(e=>(e[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",e))(Je||{}),Ke=(e=>(e[e.Length=0]="Length",e[e.Fixed=1]="Fixed",e[e.Percent=2]="Percent",e[e.Proportional=3]="Proportional",e))(Ke||{}),Qe=(e=>(e[e.Tangent=0]="Tangent",e[e.Chain=1]="Chain",e[e.ChainScale=2]="ChainScale",e))(Qe||{}),Es=class vt{static NONE=-1;static BEFORE=-2;static AFTER=-3;static epsilon=1e-5;data;bones;target;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;spaces=new Array;positions=new Array;world=new Array;curves=new Array;lengths=new Array;segments=new Array;active=!1;constructor(t,s){if(!t)throw new Error("data cannot be null.");if(!s)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0,l=t.bones.length;i<l;i++){let o=s.findBone(t.bones[i].name);if(!o)throw new Error(`Couldn't find bone ${t.bones[i].name}.`);this.bones.push(o)}let r=s.findSlot(t.target.name);if(!r)throw new Error(`Couldn't find target bone ${t.target.name}`);this.target=r,this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}isActive(){return this.active}setToSetupPose(){const t=this.data;this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}update(t){let s=this.target.getAttachment();if(!(s instanceof Mt))return;let r=this.mixRotate,i=this.mixX,l=this.mixY;if(r==0&&i==0&&l==0)return;let o=this.data,n=o.rotateMode==0,a=o.rotateMode==2,h=this.bones,c=h.length,u=n?c:c+1,d=E.setArraySize(this.spaces,u),m=a?this.lengths=E.setArraySize(this.lengths,c):[],f=this.spacing;switch(o.spacingMode){case 2:if(a)for(let C=0,S=u-1;C<S;C++){let k=h[C],T=k.data.length,Y=T*k.a,M=T*k.c;m[C]=Math.sqrt(Y*Y+M*M)}E.arrayFill(d,1,u,f);break;case 3:let y=0;for(let C=0,S=u-1;C<S;){let k=h[C],T=k.data.length;if(T<vt.epsilon)a&&(m[C]=0),d[++C]=f;else{let Y=T*k.a,M=T*k.c,X=Math.sqrt(Y*Y+M*M);a&&(m[C]=X),d[++C]=X,y+=X}}if(y>0){y=u/y*f;for(let C=1;C<u;C++)d[C]*=y}break;default:let v=o.spacingMode==0;for(let C=0,S=u-1;C<S;){let k=h[C],T=k.data.length;if(T<vt.epsilon)a&&(m[C]=0),d[++C]=f;else{let Y=T*k.a,M=T*k.c,X=Math.sqrt(Y*Y+M*M);a&&(m[C]=X),d[++C]=(v?T+f:f)*X/T}}}let p=this.computeWorldPositions(s,u,n),b=p[0],w=p[1],g=o.offsetRotation,x=!1;if(g==0)x=o.rotateMode==1;else{x=!1;let y=this.target.bone;g*=y.a*y.d-y.b*y.c>0?B.degRad:-B.degRad}for(let y=0,v=3;y<c;y++,v+=3){let C=h[y];C.worldX+=(b-C.worldX)*i,C.worldY+=(w-C.worldY)*l;let S=p[v],k=p[v+1],T=S-b,Y=k-w;if(a){let M=m[y];if(M!=0){let X=(Math.sqrt(T*T+Y*Y)/M-1)*r+1;C.a*=X,C.c*=X}}if(b=S,w=k,r>0){let M=C.a,X=C.b,F=C.c,I=C.d,P=0,D=0,O=0;if(n?P=p[v-1]:d[y+1]==0?P=p[v+2]:P=Math.atan2(Y,T),P-=Math.atan2(F,M),x){D=Math.cos(P),O=Math.sin(P);let L=C.data.length;b+=(L*(D*M-O*F)-T)*r,w+=(L*(O*M+D*F)-Y)*r}else P+=g;P>B.PI?P-=B.PI2:P<-B.PI&&(P+=B.PI2),P*=r,D=Math.cos(P),O=Math.sin(P),C.a=D*M-O*F,C.b=D*X-O*I,C.c=O*M+D*F,C.d=O*X+D*I}C.updateAppliedTransform()}}computeWorldPositions(t,s,r){let i=this.target,l=this.position,o=this.spaces,n=E.setArraySize(this.positions,s*3+2),a=this.world,h=t.closed,c=t.worldVerticesLength,u=c/6,d=vt.NONE;if(!t.constantSpeed){let L=t.lengths;u-=h?1:2;let _=L[u];this.data.positionMode==1&&(l*=_);let H;switch(this.data.spacingMode){case 2:H=_;break;case 3:H=_/s;break;default:H=1}a=E.setArraySize(this.world,8);for(let z=0,j=0,R=0;z<s;z++,j+=3){let U=o[z]*H;l+=U;let G=l;if(h)G%=_,G<0&&(G+=_),R=0;else if(G<0){d!=vt.BEFORE&&(d=vt.BEFORE,t.computeWorldVertices(i,2,4,a,0,2)),this.addBeforePosition(G,a,0,n,j);continue}else if(G>_){d!=vt.AFTER&&(d=vt.AFTER,t.computeWorldVertices(i,c-6,4,a,0,2)),this.addAfterPosition(G-_,a,0,n,j);continue}for(;;R++){let st=L[R];if(!(G>st)){if(R==0)G/=st;else{let J=L[R-1];G=(G-J)/(st-J)}break}}R!=d&&(d=R,h&&R==u?(t.computeWorldVertices(i,c-4,4,a,0,2),t.computeWorldVertices(i,0,4,a,4,2)):t.computeWorldVertices(i,R*6+2,8,a,0,2)),this.addCurvePosition(G,a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],n,j,r||z>0&&U==0)}return n}h?(c+=2,a=E.setArraySize(this.world,c),t.computeWorldVertices(i,2,c-4,a,0,2),t.computeWorldVertices(i,0,2,a,c-4,2),a[c-2]=a[0],a[c-1]=a[1]):(u--,c-=4,a=E.setArraySize(this.world,c),t.computeWorldVertices(i,2,c,a,0,2));let m=E.setArraySize(this.curves,u),f=0,p=a[0],b=a[1],w=0,g=0,x=0,y=0,v=0,C=0,S=0,k=0,T=0,Y=0,M=0,X=0,F=0,I=0;for(let L=0,_=2;L<u;L++,_+=6)w=a[_],g=a[_+1],x=a[_+2],y=a[_+3],v=a[_+4],C=a[_+5],S=(p-w*2+x)*.1875,k=(b-g*2+y)*.1875,T=((w-x)*3-p+v)*.09375,Y=((g-y)*3-b+C)*.09375,M=S*2+T,X=k*2+Y,F=(w-p)*.75+S+T*.16666667,I=(g-b)*.75+k+Y*.16666667,f+=Math.sqrt(F*F+I*I),F+=M,I+=X,M+=T,X+=Y,f+=Math.sqrt(F*F+I*I),F+=M,I+=X,f+=Math.sqrt(F*F+I*I),F+=M+T,I+=X+Y,f+=Math.sqrt(F*F+I*I),m[L]=f,p=v,b=C;this.data.positionMode==1&&(l*=f);let P;switch(this.data.spacingMode){case 2:P=f;break;case 3:P=f/s;break;default:P=1}let D=this.segments,O=0;for(let L=0,_=0,H=0,z=0;L<s;L++,_+=3){let j=o[L]*P;l+=j;let R=l;if(h)R%=f,R<0&&(R+=f),H=0;else if(R<0){this.addBeforePosition(R,a,0,n,_);continue}else if(R>f){this.addAfterPosition(R-f,a,c-4,n,_);continue}for(;;H++){let U=m[H];if(!(R>U)){if(H==0)R/=U;else{let G=m[H-1];R=(R-G)/(U-G)}break}}if(H!=d){d=H;let U=H*6;for(p=a[U],b=a[U+1],w=a[U+2],g=a[U+3],x=a[U+4],y=a[U+5],v=a[U+6],C=a[U+7],S=(p-w*2+x)*.03,k=(b-g*2+y)*.03,T=((w-x)*3-p+v)*.006,Y=((g-y)*3-b+C)*.006,M=S*2+T,X=k*2+Y,F=(w-p)*.3+S+T*.16666667,I=(g-b)*.3+k+Y*.16666667,O=Math.sqrt(F*F+I*I),D[0]=O,U=1;U<8;U++)F+=M,I+=X,M+=T,X+=Y,O+=Math.sqrt(F*F+I*I),D[U]=O;F+=M,I+=X,O+=Math.sqrt(F*F+I*I),D[8]=O,F+=M+T,I+=X+Y,O+=Math.sqrt(F*F+I*I),D[9]=O,z=0}for(R*=O;;z++){let U=D[z];if(!(R>U)){if(z==0)R/=U;else{let G=D[z-1];R=z+(R-G)/(U-G)}break}}this.addCurvePosition(R*.1,p,b,w,g,x,y,v,C,n,_,r||L>0&&j==0)}return n}addBeforePosition(t,s,r,i,l){let o=s[r],n=s[r+1],a=s[r+2]-o,h=s[r+3]-n,c=Math.atan2(h,a);i[l]=o+t*Math.cos(c),i[l+1]=n+t*Math.sin(c),i[l+2]=c}addAfterPosition(t,s,r,i,l){let o=s[r+2],n=s[r+3],a=o-s[r],h=n-s[r+1],c=Math.atan2(h,a);i[l]=o+t*Math.cos(c),i[l+1]=n+t*Math.sin(c),i[l+2]=c}addCurvePosition(t,s,r,i,l,o,n,a,h,c,u,d){if(t==0||isNaN(t)){c[u]=s,c[u+1]=r,c[u+2]=Math.atan2(l-r,i-s);return}let m=t*t,f=m*t,p=1-t,b=p*p,w=b*p,g=p*t,x=g*3,y=p*x,v=x*t,C=s*w+i*y+o*v+a*f,S=r*w+l*y+n*v+h*f;c[u]=C,c[u+1]=S,d&&(t<.001?c[u+2]=Math.atan2(l-r,i-s):c[u+2]=Math.atan2(S-(r*b+l*g*2+n*m),C-(s*b+i*g*2+o*m)))}},Ci=class{data;_bone=null;set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}inertia=0;strength=0;damping=0;massInverse=0;wind=0;gravity=0;mix=0;_reset=!0;ux=0;uy=0;cx=0;cy=0;tx=0;ty=0;xOffset=0;xVelocity=0;yOffset=0;yVelocity=0;rotateOffset=0;rotateVelocity=0;scaleOffset=0;scaleVelocity=0;active=!1;skeleton;remaining=0;lastTime=0;constructor(e,t){this.data=e,this.skeleton=t,this.bone=t.bones[e.bone.index],this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}reset(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}setToSetupPose(){const e=this.data;this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}isActive(){return this.active}update(e){const t=this.mix;if(t==0)return;const s=this.data.x>0,r=this.data.y>0,i=this.data.rotate>0||this.data.shearX>0,l=this.data.scaleX>0,o=this.bone,n=o.data.length;switch(e){case 0:return;case 1:this.reset();case 2:const a=this.skeleton,h=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=h,this.lastTime=a.time;const c=o.worldX,u=o.worldY;if(this._reset)this._reset=!1,this.ux=c,this.uy=u;else{let d=this.remaining,m=this.inertia,f=this.data.step,p=this.skeleton.data.referenceScale,b=-1,w=this.data.limit*h,g=w*Math.abs(a.scaleY);if(w*=Math.abs(a.scaleX),s||r){if(s){const x=(this.ux-c)*m;this.xOffset+=x>w?w:x<-w?-w:x,this.ux=c}if(r){const x=(this.uy-u)*m;this.yOffset+=x>g?g:x<-g?-g:x,this.uy=u}if(d>=f){b=Math.pow(this.damping,60*f);const x=this.massInverse*f,y=this.strength,v=this.wind*p*a.scaleX,C=this.gravity*p*a.scaleY;do s&&(this.xVelocity+=(v-this.xOffset*y)*x,this.xOffset+=this.xVelocity*f,this.xVelocity*=b),r&&(this.yVelocity-=(C+this.yOffset*y)*x,this.yOffset+=this.yVelocity*f,this.yVelocity*=b),d-=f;while(d>=f)}s&&(o.worldX+=this.xOffset*t*this.data.x),r&&(o.worldY+=this.yOffset*t*this.data.y)}if(i||l){let x=Math.atan2(o.c,o.a),y=0,v=0,C=0,S=this.cx-o.worldX,k=this.cy-o.worldY;if(S>w?S=w:S<-w&&(S=-w),k>g?k=g:k<-g&&(k=-g),i){C=(this.data.rotate+this.data.shearX)*t;let T=Math.atan2(k+this.ty,S+this.tx)-x-this.rotateOffset*C;this.rotateOffset+=(T-Math.ceil(T*B.invPI2-.5)*B.PI2)*m,T=this.rotateOffset*C+x,y=Math.cos(T),v=Math.sin(T),l&&(T=n*o.getWorldScaleX(),T>0&&(this.scaleOffset+=(S*y+k*v)*m/T))}else{y=Math.cos(x),v=Math.sin(x);const T=n*o.getWorldScaleX();T>0&&(this.scaleOffset+=(S*y+k*v)*m/T)}if(d=this.remaining,d>=f){b==-1&&(b=Math.pow(this.damping,60*f));const T=this.massInverse*f,Y=this.strength,M=this.wind,X=Yt.yDown?-this.gravity:this.gravity,F=n/p;for(;;)if(d-=f,l&&(this.scaleVelocity+=(M*y-X*v-this.scaleOffset*Y)*T,this.scaleOffset+=this.scaleVelocity*f,this.scaleVelocity*=b),i){if(this.rotateVelocity-=((M*v+X*y)*F+this.rotateOffset*Y)*T,this.rotateOffset+=this.rotateVelocity*f,this.rotateVelocity*=b,d<f)break;const I=this.rotateOffset*C+x;y=Math.cos(I),v=Math.sin(I)}else if(d<f)break}}this.remaining=d}this.cx=o.worldX,this.cy=o.worldY;break;case 3:s&&(o.worldX+=this.xOffset*t*this.data.x),r&&(o.worldY+=this.yOffset*t*this.data.y)}if(i){let a=this.rotateOffset*t,h=0,c=0,u=0;if(this.data.shearX>0){let d=0;this.data.rotate>0&&(d=a*this.data.rotate,h=Math.sin(d),c=Math.cos(d),u=o.b,o.b=c*u-h*o.d,o.d=h*u+c*o.d),d+=a*this.data.shearX,h=Math.sin(d),c=Math.cos(d),u=o.a,o.a=c*u-h*o.c,o.c=h*u+c*o.c}else a*=this.data.rotate,h=Math.sin(a),c=Math.cos(a),u=o.a,o.a=c*u-h*o.c,o.c=h*u+c*o.c,u=o.b,o.b=c*u-h*o.d,o.d=h*u+c*o.d}if(l){const a=1+this.scaleOffset*t*this.data.scaleX;o.a*=a,o.c*=a}e!=3&&(this.tx=n*o.a,this.ty=n*o.c),o.updateAppliedTransform()}translate(e,t){this.ux-=e,this.uy-=t,this.cx-=e,this.cy-=t}rotate(e,t,s){const r=s*B.degRad,i=Math.cos(r),l=Math.sin(r),o=this.cx-e,n=this.cy-t;this.translate(o*i-n*l-o,o*l+n*i-n)}},Rs=class{data;bone;color;darkColor=null;attachment=null;attachmentState=0;sequenceIndex=-1;deform=new Array;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("bone cannot be null.");this.data=e,this.bone=t,this.color=new V,this.darkColor=e.darkColor?new V:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof dt)||!(this.attachment instanceof dt)||e.timelineAttachment!=this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=e,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},Ds=class{data;bones;target;mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;temp=new Et;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let r=0;r<e.bones.length;r++){let i=t.findBone(e.bones[r].name);if(!i)throw new Error(`Couldn't find bone ${e.bones[r].name}.`);this.bones.push(i)}let s=t.findBone(e.target.name);if(!s)throw new Error(`Couldn't find target bone ${e.target.name}.`);this.target=s,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}isActive(){return this.active}setToSetupPose(){const e=this.data;this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}update(e){this.mixRotate==0&&this.mixX==0&&this.mixY==0&&this.mixScaleX==0&&this.mixScaleY==0&&this.mixShearY==0||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,i=this.mixScaleY,l=this.mixShearY,o=t!=0||s!=0,n=this.target,a=n.a,h=n.b,c=n.c,u=n.d,d=a*u-h*c>0?B.degRad:-B.degRad,m=this.data.offsetRotation*d,f=this.data.offsetShearY*d,p=this.bones;for(let b=0,w=p.length;b<w;b++){let g=p[b];if(e!=0){let x=g.a,y=g.b,v=g.c,C=g.d,S=Math.atan2(c,a)-Math.atan2(v,x)+m;S>B.PI?S-=B.PI2:S<-B.PI&&(S+=B.PI2),S*=e;let k=Math.cos(S),T=Math.sin(S);g.a=k*x-T*v,g.b=k*y-T*C,g.c=T*x+k*v,g.d=T*y+k*C}if(o){let x=this.temp;n.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(x.x-g.worldX)*t,g.worldY+=(x.y-g.worldY)*s}if(r!=0){let x=Math.sqrt(g.a*g.a+g.c*g.c);x!=0&&(x=(x+(Math.sqrt(a*a+c*c)-x+this.data.offsetScaleX)*r)/x),g.a*=x,g.c*=x}if(i!=0){let x=Math.sqrt(g.b*g.b+g.d*g.d);x!=0&&(x=(x+(Math.sqrt(h*h+u*u)-x+this.data.offsetScaleY)*i)/x),g.b*=x,g.d*=x}if(l>0){let x=g.b,y=g.d,v=Math.atan2(y,x),C=Math.atan2(u,h)-Math.atan2(c,a)-(v-Math.atan2(g.c,g.a));C>B.PI?C-=B.PI2:C<-B.PI&&(C+=B.PI2),C=v+(C+f)*l;let S=Math.sqrt(x*x+y*y);g.b=Math.cos(C)*S,g.d=Math.sin(C)*S}g.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,i=this.mixScaleY,l=this.mixShearY,o=t!=0||s!=0,n=this.target,a=n.a,h=n.b,c=n.c,u=n.d,d=a*u-h*c>0?B.degRad:-B.degRad,m=this.data.offsetRotation*d,f=this.data.offsetShearY*d,p=this.bones;for(let b=0,w=p.length;b<w;b++){let g=p[b];if(e!=0){let x=g.a,y=g.b,v=g.c,C=g.d,S=Math.atan2(c,a)+m;S>B.PI?S-=B.PI2:S<-B.PI&&(S+=B.PI2),S*=e;let k=Math.cos(S),T=Math.sin(S);g.a=k*x-T*v,g.b=k*y-T*C,g.c=T*x+k*v,g.d=T*y+k*C}if(o){let x=this.temp;n.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),g.worldX+=x.x*t,g.worldY+=x.y*s}if(r!=0){let x=(Math.sqrt(a*a+c*c)-1+this.data.offsetScaleX)*r+1;g.a*=x,g.c*=x}if(i!=0){let x=(Math.sqrt(h*h+u*u)-1+this.data.offsetScaleY)*i+1;g.b*=x,g.d*=x}if(l>0){let x=Math.atan2(u,h)-Math.atan2(c,a);x>B.PI?x-=B.PI2:x<-B.PI&&(x+=B.PI2);let y=g.b,v=g.d;x=Math.atan2(v,y)+(x-B.PI/2+f)*l;let C=Math.sqrt(y*y+v*v);g.b=Math.cos(x)*C,g.d=Math.sin(x)*C}g.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,i=this.mixScaleY,l=this.mixShearY,o=this.target,n=this.bones;for(let a=0,h=n.length;a<h;a++){let c=n[a],u=c.arotation;e!=0&&(u+=(o.arotation-u+this.data.offsetRotation)*e);let d=c.ax,m=c.ay;d+=(o.ax-d+this.data.offsetX)*t,m+=(o.ay-m+this.data.offsetY)*s;let f=c.ascaleX,p=c.ascaleY;r!=0&&f!=0&&(f=(f+(o.ascaleX-f+this.data.offsetScaleX)*r)/f),i!=0&&p!=0&&(p=(p+(o.ascaleY-p+this.data.offsetScaleY)*i)/p);let b=c.ashearY;l!=0&&(b+=(o.ashearY-b+this.data.offsetShearY)*l),c.updateWorldTransformWith(d,m,u,f,p,c.ashearX,b)}}applyRelativeLocal(){let e=this.mixRotate,t=this.mixX,s=this.mixY,r=this.mixScaleX,i=this.mixScaleY,l=this.mixShearY,o=this.target,n=this.bones;for(let a=0,h=n.length;a<h;a++){let c=n[a],u=c.arotation+(o.arotation+this.data.offsetRotation)*e,d=c.ax+(o.ax+this.data.offsetX)*t,m=c.ay+(o.ay+this.data.offsetY)*s,f=c.ascaleX*((o.ascaleX-1+this.data.offsetScaleX)*r+1),p=c.ascaleY*((o.ascaleY-1+this.data.offsetScaleY)*i+1),b=c.ashearY+(o.ashearY+this.data.offsetShearY)*l;c.updateWorldTransformWith(d,m,u,f,p,c.ashearX,b)}}},Yt=class cs{static quadTriangles=[0,1,2,2,3,0];static yDown=!1;data;bones;slots;drawOrder;ikConstraints;transformConstraints;pathConstraints;physicsConstraints;_updateCache=new Array;skin=null;color;scaleX=1;_scaleY=1;get scaleY(){return cs.yDown?-this._scaleY:this._scaleY}set scaleY(t){this._scaleY=t}x=0;y=0;time=0;constructor(t){if(!t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(let s=0;s<t.bones.length;s++){let r=t.bones[s],i;if(!r.parent)i=new ze(r,this,null);else{let l=this.bones[r.parent.index];i=new ze(r,this,l),l.children.push(i)}this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(let s=0;s<t.slots.length;s++){let r=t.slots[s],i=this.bones[r.boneData.index],l=new Rs(r,i);this.slots.push(l),this.drawOrder.push(l)}this.ikConstraints=new Array;for(let s=0;s<t.ikConstraints.length;s++){let r=t.ikConstraints[s];this.ikConstraints.push(new Bs(r,this))}this.transformConstraints=new Array;for(let s=0;s<t.transformConstraints.length;s++){let r=t.transformConstraints[s];this.transformConstraints.push(new Ds(r,this))}this.pathConstraints=new Array;for(let s=0;s<t.pathConstraints.length;s++){let r=t.pathConstraints[s];this.pathConstraints.push(new Es(r,this))}this.physicsConstraints=new Array;for(let s=0;s<t.physicsConstraints.length;s++){let r=t.physicsConstraints[s];this.physicsConstraints.push(new Ci(r,this))}this.color=new V(1,1,1,1),this.updateCache()}updateCache(){let t=this._updateCache;t.length=0;let s=this.bones;for(let d=0,m=s.length;d<m;d++){let f=s[d];f.sorted=f.data.skinRequired,f.active=!f.sorted}if(this.skin){let d=this.skin.bones;for(let m=0,f=this.skin.bones.length;m<f;m++){let p=this.bones[d[m].index];do p.sorted=!1,p.active=!0,p=p.parent;while(p)}}let r=this.ikConstraints,i=this.transformConstraints,l=this.pathConstraints,o=this.physicsConstraints,n=r.length,a=i.length,h=l.length,c=this.physicsConstraints.length,u=n+a+h+c;t:for(let d=0;d<u;d++){for(let m=0;m<n;m++){let f=r[m];if(f.data.order==d){this.sortIkConstraint(f);continue t}}for(let m=0;m<a;m++){let f=i[m];if(f.data.order==d){this.sortTransformConstraint(f);continue t}}for(let m=0;m<h;m++){let f=l[m];if(f.data.order==d){this.sortPathConstraint(f);continue t}}for(let m=0;m<c;m++){const f=o[m];if(f.data.order==d){this.sortPhysicsConstraint(f);continue t}}}for(let d=0,m=s.length;d<m;d++)this.sortBone(s[d])}sortIkConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&E.contains(this.skin.constraints,t.data,!0)),!t.active)return;let s=t.target;this.sortBone(s);let r=t.bones,i=r[0];if(this.sortBone(i),r.length==1)this._updateCache.push(t),this.sortReset(i.children);else{let l=r[r.length-1];this.sortBone(l),this._updateCache.push(t),this.sortReset(i.children),l.sorted=!0}}sortPathConstraint(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&E.contains(this.skin.constraints,t.data,!0)),!t.active)return;let s=t.target,r=s.data.index,i=s.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,r,i),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,i);for(let a=0,h=this.data.skins.length;a<h;a++)this.sortPathConstraintAttachment(this.data.skins[a],r,i);let l=s.getAttachment();l instanceof Mt&&this.sortPathConstraintAttachmentWith(l,i);let o=t.bones,n=o.length;for(let a=0;a<n;a++)this.sortBone(o[a]);this._updateCache.push(t);for(let a=0;a<n;a++)this.sortReset(o[a].children);for(let a=0;a<n;a++)o[a].sorted=!0}sortTransformConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&E.contains(this.skin.constraints,t.data,!0)),!t.active)return;this.sortBone(t.target);let s=t.bones,r=s.length;if(t.data.local)for(let i=0;i<r;i++){let l=s[i];this.sortBone(l.parent),this.sortBone(l)}else for(let i=0;i<r;i++)this.sortBone(s[i]);this._updateCache.push(t);for(let i=0;i<r;i++)this.sortReset(s[i].children);for(let i=0;i<r;i++)s[i].sorted=!0}sortPathConstraintAttachment(t,s,r){let i=t.attachments[s];if(i)for(let l in i)this.sortPathConstraintAttachmentWith(i[l],r)}sortPathConstraintAttachmentWith(t,s){if(!(t instanceof Mt))return;let r=t.bones;if(!r)this.sortBone(s);else{let i=this.bones;for(let l=0,o=r.length;l<o;){let n=r[l++];for(n+=l;l<n;)this.sortBone(i[r[l++]])}}}sortPhysicsConstraint(t){const s=t.bone;t.active=s.active&&(!t.data.skinRequired||this.skin!=null&&E.contains(this.skin.constraints,t.data,!0)),t.active&&(this.sortBone(s),this._updateCache.push(t),this.sortReset(s.children),s.sorted=!0)}sortBone(t){if(!t||t.sorted)return;let s=t.parent;s&&this.sortBone(s),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let s=0,r=t.length;s<r;s++){let i=t[s];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}}updateWorldTransform(t){if(t==null)throw new Error("physics is undefined");let s=this.bones;for(let i=0,l=s.length;i<l;i++){let o=s[i];o.ax=o.x,o.ay=o.y,o.arotation=o.rotation,o.ascaleX=o.scaleX,o.ascaleY=o.scaleY,o.ashearX=o.shearX,o.ashearY=o.shearY}let r=this._updateCache;for(let i=0,l=r.length;i<l;i++)r[i].update(t)}updateWorldTransformWith(t,s){if(!s)throw new Error("parent cannot be null.");let r=this.bones;for(let b=1,w=r.length;b<w;b++){let g=r[b];g.ax=g.x,g.ay=g.y,g.arotation=g.rotation,g.ascaleX=g.scaleX,g.ascaleY=g.scaleY,g.ashearX=g.shearX,g.ashearY=g.shearY}let i=this.getRootBone();if(!i)throw new Error("Root bone must not be null.");let l=s.a,o=s.b,n=s.c,a=s.d;i.worldX=l*this.x+o*this.y+s.worldX,i.worldY=n*this.x+a*this.y+s.worldY;const h=(i.rotation+i.shearX)*B.degRad,c=(i.rotation+90+i.shearY)*B.degRad,u=Math.cos(h)*i.scaleX,d=Math.cos(c)*i.scaleY,m=Math.sin(h)*i.scaleX,f=Math.sin(c)*i.scaleY;i.a=(l*u+o*m)*this.scaleX,i.b=(l*d+o*f)*this.scaleX,i.c=(n*u+a*m)*this.scaleY,i.d=(n*d+a*f)*this.scaleY;let p=this._updateCache;for(let b=0,w=p.length;b<w;b++){let g=p[b];g!=i&&g.update(t)}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){for(const t of this.bones)t.setToSetupPose();for(const t of this.ikConstraints)t.setToSetupPose();for(const t of this.transformConstraints)t.setToSetupPose();for(const t of this.pathConstraints)t.setToSetupPose();for(const t of this.physicsConstraints)t.setToSetupPose()}setSlotsToSetupPose(){let t=this.slots;E.arrayCopy(t,0,this.drawOrder,0,t.length);for(let s=0,r=t.length;s<r;s++)t[s].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(t){if(!t)throw new Error("boneName cannot be null.");let s=this.bones;for(let r=0,i=s.length;r<i;r++){let l=s[r];if(l.data.name==t)return l}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let s=this.slots;for(let r=0,i=s.length;r<i;r++){let l=s[r];if(l.data.name==t)return l}return null}setSkinByName(t){let s=this.data.findSkin(t);if(!s)throw new Error("Skin not found: "+t);this.setSkin(s)}setSkin(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else{let s=this.slots;for(let r=0,i=s.length;r<i;r++){let l=s[r],o=l.data.attachmentName;if(o){let n=t.getAttachment(r,o);n&&l.setAttachment(n)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,s){let r=this.data.findSlot(t);if(!r)throw new Error(`Can't find slot with name ${t}`);return this.getAttachment(r.index,s)}getAttachment(t,s){if(!s)throw new Error("attachmentName cannot be null.");if(this.skin){let r=this.skin.getAttachment(t,s);if(r)return r}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,s):null}setAttachment(t,s){if(!t)throw new Error("slotName cannot be null.");let r=this.slots;for(let i=0,l=r.length;i<l;i++){let o=r[i];if(o.data.name==t){let n=null;if(s&&(n=this.getAttachment(i,s),!n))throw new Error("Attachment not found: "+s+", for slot: "+t);o.setAttachment(n);return}}throw new Error("Slot not found: "+t)}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.ikConstraints.find(s=>s.data.name==t)??null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(s=>s.data.name==t)??null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(s=>s.data.name==t)??null}findPhysicsConstraint(t){if(t==null)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(s=>s.data.name==t)??null}getBoundsRect(t){let s=new Et,r=new Et;return this.getBounds(s,r,void 0,t),{x:s.x,y:s.y,width:r.x,height:r.y}}getBounds(t,s,r=new Array(2),i=null){if(!t)throw new Error("offset cannot be null.");if(!s)throw new Error("size cannot be null.");let l=this.drawOrder,o=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(let c=0,u=l.length;c<u;c++){let d=l[c];if(!d.bone.active)continue;let m=0,f=null,p=null,b=d.getAttachment();if(b instanceof ot)m=8,f=E.setArraySize(r,m,0),b.computeWorldVertices(d,f,0,2),p=cs.quadTriangles;else if(b instanceof ut){let w=b;m=w.worldVerticesLength,f=E.setArraySize(r,m,0),w.computeWorldVertices(d,0,m,f,0,2),p=w.triangles}else if(b instanceof St&&i!=null){i.clipStart(d,b);continue}if(f&&p){i!=null&&i.isClipping()&&(i.clipTriangles(f,p,p.length),f=i.clippedVertices,m=i.clippedVertices.length);for(let w=0,g=f.length;w<g;w+=2){let x=f[w],y=f[w+1];o=Math.min(o,x),n=Math.min(n,y),a=Math.max(a,x),h=Math.max(h,y)}}i?.clipEndWithSlot(d)}i?.clipEnd(),t.set(o,n),s.set(a-o,h-n)}update(t){this.time+=t}physicsTranslate(t,s){const r=this.physicsConstraints;for(let i=0,l=r.length;i<l;i++)r[i].translate(t,s)}physicsRotate(t,s,r){const i=this.physicsConstraints;for(let l=0,o=i.length;l<o;l++)i[l].rotate(t,s,r)}},Ls=(e=>(e[e.none=0]="none",e[e.reset=1]="reset",e[e.update=2]="update",e[e.pose=3]="pose",e))(Ls||{}),Vs=class extends Dt{_bone=null;set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}x=0;y=0;rotate=0;scaleX=0;shearX=0;limit=0;step=0;inertia=0;strength=0;damping=0;massInverse=0;wind=0;gravity=0;mix=0;inertiaGlobal=!1;strengthGlobal=!1;dampingGlobal=!1;massGlobal=!1;windGlobal=!1;gravityGlobal=!1;mixGlobal=!1;constructor(e){super(e,0,!1)}},Lt=class{name=null;bones=new Array;slots=new Array;skins=new Array;defaultSkin=null;events=new Array;animations=new Array;ikConstraints=new Array;transformConstraints=new Array;pathConstraints=new Array;physicsConstraints=new Array;x=0;y=0;width=0;height=0;referenceScale=100;version=null;hash=null;fps=0;imagesPath=null;audioPath=null;findBone(e){if(!e)throw new Error("boneName cannot be null.");let t=this.bones;for(let s=0,r=t.length;s<r;s++){let i=t[s];if(i.name==e)return i}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let t=this.slots;for(let s=0,r=t.length;s<r;s++){let i=t[s];if(i.name==e)return i}return null}findSkin(e){if(!e)throw new Error("skinName cannot be null.");let t=this.skins;for(let s=0,r=t.length;s<r;s++){let i=t[s];if(i.name==e)return i}return null}findEvent(e){if(!e)throw new Error("eventDataName cannot be null.");let t=this.events;for(let s=0,r=t.length;s<r;s++){let i=t[s];if(i.name==e)return i}return null}findAnimation(e){if(!e)throw new Error("animationName cannot be null.");let t=this.animations;for(let s=0,r=t.length;s<r;s++){let i=t[s];if(i.name==e)return i}return null}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.ikConstraints;for(let s=0,r=t.length;s<r;s++){const i=t[s];if(i.name==e)return i}return null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.transformConstraints;for(let s=0,r=t.length;s<r;s++){const i=t[s];if(i.name==e)return i}return null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.pathConstraints;for(let s=0,r=t.length;s<r;s++){const i=t[s];if(i.name==e)return i}return null}findPhysicsConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.physicsConstraints;for(let s=0,r=t.length;s<r;s++){const i=t[s];if(i.name==e)return i}return null}},Ze=class{constructor(e=0,t,s){this.slotIndex=e,this.name=t,this.attachment=s}},Vt=class{name;attachments=new Array;bones=Array();constraints=new Array;color=new V(.99607843,.61960787,.30980393,1);constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}setAttachment(e,t,s){if(!s)throw new Error("attachment cannot be null.");let r=this.attachments;e>=r.length&&(r.length=e+1),r[e]||(r[e]={}),r[e][t]=s}addSkin(e){for(let r=0;r<e.bones.length;r++){let i=e.bones[r],l=!1;for(let o=0;o<this.bones.length;o++)if(this.bones[o]==i){l=!0;break}l||this.bones.push(i)}for(let r=0;r<e.constraints.length;r++){let i=e.constraints[r],l=!1;for(let o=0;o<this.constraints.length;o++)if(this.constraints[o]==i){l=!0;break}l||this.constraints.push(i)}let t=e.getAttachments();for(let r=0;r<t.length;r++){var s=t[r];this.setAttachment(s.slotIndex,s.name,s.attachment)}}copySkin(e){for(let r=0;r<e.bones.length;r++){let i=e.bones[r],l=!1;for(let o=0;o<this.bones.length;o++)if(this.bones[o]==i){l=!0;break}l||this.bones.push(i)}for(let r=0;r<e.constraints.length;r++){let i=e.constraints[r],l=!1;for(let o=0;o<this.constraints.length;o++)if(this.constraints[o]==i){l=!0;break}l||this.constraints.push(i)}let t=e.getAttachments();for(let r=0;r<t.length;r++){var s=t[r];s.attachment&&(s.attachment instanceof ut?(s.attachment=s.attachment.newLinkedMesh(),this.setAttachment(s.slotIndex,s.name,s.attachment)):(s.attachment=s.attachment.copy(),this.setAttachment(s.slotIndex,s.name,s.attachment)))}}getAttachment(e,t){let s=this.attachments[e];return s?s[t]:null}removeAttachment(e,t){let s=this.attachments[e];s&&delete s[t]}getAttachments(){let e=new Array;for(var t=0;t<this.attachments.length;t++){let s=this.attachments[t];if(s)for(let r in s){let i=s[r];i&&e.push(new Ze(t,r,i))}}return e}getAttachmentsForSlot(e,t){let s=this.attachments[e];if(s)for(let r in s){let i=s[r];i&&t.push(new Ze(e,r,i))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(e,t){let s=0;for(let r=0;r<e.slots.length;r++){let i=e.slots[r],l=i.getAttachment();if(l&&s<t.attachments.length){let o=t.attachments[s];for(let n in o){let a=o[n];if(l==a){let h=this.getAttachment(s,n);h&&i.setAttachment(h);break}}}s++}}},ts=class{index=0;name;boneData;color=new V(1,1,1,1);darkColor=null;attachmentName=null;blendMode=0;visible=!0;constructor(e,t,s){if(e<0)throw new Error("index must be >= 0.");if(!t)throw new Error("name cannot be null.");if(!s)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=s}},es=(e=>(e[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen",e))(es||{}),ss=class extends Dt{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;offsetRotation=0;offsetX=0;offsetY=0;offsetScaleX=0;offsetScaleY=0;offsetShearY=0;relative=!1;local=!1;constructor(e){super(e,0,!1)}},Ns=class{scale=1;attachmentLoader;linkedMeshes=new Array;constructor(e){this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new Lt;s.name="";let r=new Os(e),i=r.readInt32(),l=r.readInt32();s.hash=l==0&&i==0?null:l.toString(16)+i.toString(16),s.version=r.readString(),s.x=r.readFloat(),s.y=r.readFloat(),s.width=r.readFloat(),s.height=r.readFloat(),s.referenceScale=r.readFloat()*t;let o=r.readBoolean();o&&(s.fps=r.readFloat(),s.imagesPath=r.readString(),s.audioPath=r.readString());let n=0;n=r.readInt(!0);for(let h=0;h<n;h++){let c=r.readString();if(!c)throw new Error("String in string table must not be null.");r.strings.push(c)}n=r.readInt(!0);for(let h=0;h<n;h++){let c=r.readString();if(!c)throw new Error("Bone name must not be null.");let u=h==0?null:s.bones[r.readInt(!0)],d=new We(h,c,u);d.rotation=r.readFloat(),d.x=r.readFloat()*t,d.y=r.readFloat()*t,d.scaleX=r.readFloat(),d.scaleY=r.readFloat(),d.shearX=r.readFloat(),d.shearY=r.readFloat(),d.length=r.readFloat()*t,d.inherit=r.readByte(),d.skinRequired=r.readBoolean(),o&&(V.rgba8888ToColor(d.color,r.readInt32()),d.icon=r.readString()??void 0,d.visible=r.readBoolean()),s.bones.push(d)}n=r.readInt(!0);for(let h=0;h<n;h++){let c=r.readString();if(!c)throw new Error("Slot name must not be null.");let u=s.bones[r.readInt(!0)],d=new ts(h,c,u);V.rgba8888ToColor(d.color,r.readInt32());let m=r.readInt32();m!=-1&&V.rgb888ToColor(d.darkColor=new V,m),d.attachmentName=r.readStringRef(),d.blendMode=r.readInt(!0),o&&(d.visible=r.readBoolean()),s.slots.push(d)}n=r.readInt(!0);for(let h=0,c;h<n;h++){let u=r.readString();if(!u)throw new Error("IK constraint data name must not be null.");let d=new $e(u);d.order=r.readInt(!0),c=r.readInt(!0);for(let f=0;f<c;f++)d.bones.push(s.bones[r.readInt(!0)]);d.target=s.bones[r.readInt(!0)];let m=r.readByte();d.skinRequired=(m&1)!=0,d.bendDirection=(m&2)!=0?1:-1,d.compress=(m&4)!=0,d.stretch=(m&8)!=0,d.uniform=(m&16)!=0,(m&32)!=0&&(d.mix=(m&64)!=0?r.readFloat():1),(m&128)!=0&&(d.softness=r.readFloat()*t),s.ikConstraints.push(d)}n=r.readInt(!0);for(let h=0,c;h<n;h++){let u=r.readString();if(!u)throw new Error("Transform constraint data name must not be null.");let d=new ss(u);d.order=r.readInt(!0),c=r.readInt(!0);for(let f=0;f<c;f++)d.bones.push(s.bones[r.readInt(!0)]);d.target=s.bones[r.readInt(!0)];let m=r.readByte();d.skinRequired=(m&1)!=0,d.local=(m&2)!=0,d.relative=(m&4)!=0,(m&8)!=0&&(d.offsetRotation=r.readFloat()),(m&16)!=0&&(d.offsetX=r.readFloat()*t),(m&32)!=0&&(d.offsetY=r.readFloat()*t),(m&64)!=0&&(d.offsetScaleX=r.readFloat()),(m&128)!=0&&(d.offsetScaleY=r.readFloat()),m=r.readByte(),(m&1)!=0&&(d.offsetShearY=r.readFloat()),(m&2)!=0&&(d.mixRotate=r.readFloat()),(m&4)!=0&&(d.mixX=r.readFloat()),(m&8)!=0&&(d.mixY=r.readFloat()),(m&16)!=0&&(d.mixScaleX=r.readFloat()),(m&32)!=0&&(d.mixScaleY=r.readFloat()),(m&64)!=0&&(d.mixShearY=r.readFloat()),s.transformConstraints.push(d)}n=r.readInt(!0);for(let h=0,c;h<n;h++){let u=r.readString();if(!u)throw new Error("Path constraint data name must not be null.");let d=new je(u);d.order=r.readInt(!0),d.skinRequired=r.readBoolean(),c=r.readInt(!0);for(let f=0;f<c;f++)d.bones.push(s.bones[r.readInt(!0)]);d.target=s.slots[r.readInt(!0)];const m=r.readByte();d.positionMode=m&1,d.spacingMode=m>>1&3,d.rotateMode=m>>3&3,(m&128)!=0&&(d.offsetRotation=r.readFloat()),d.position=r.readFloat(),d.positionMode==0&&(d.position*=t),d.spacing=r.readFloat(),(d.spacingMode==0||d.spacingMode==1)&&(d.spacing*=t),d.mixRotate=r.readFloat(),d.mixX=r.readFloat(),d.mixY=r.readFloat(),s.pathConstraints.push(d)}n=r.readInt(!0);for(let h=0,c;h<n;h++){const u=r.readString();if(!u)throw new Error("Physics constraint data name must not be null.");const d=new Vs(u);d.order=r.readInt(!0),d.bone=s.bones[r.readInt(!0)];let m=r.readByte();d.skinRequired=(m&1)!=0,(m&2)!=0&&(d.x=r.readFloat()),(m&4)!=0&&(d.y=r.readFloat()),(m&8)!=0&&(d.rotate=r.readFloat()),(m&16)!=0&&(d.scaleX=r.readFloat()),(m&32)!=0&&(d.shearX=r.readFloat()),d.limit=((m&64)!=0?r.readFloat():5e3)*t,d.step=1/r.readUnsignedByte(),d.inertia=r.readFloat(),d.strength=r.readFloat(),d.damping=r.readFloat(),d.massInverse=(m&128)!=0?r.readFloat():1,d.wind=r.readFloat(),d.gravity=r.readFloat(),m=r.readByte(),(m&1)!=0&&(d.inertiaGlobal=!0),(m&2)!=0&&(d.strengthGlobal=!0),(m&4)!=0&&(d.dampingGlobal=!0),(m&8)!=0&&(d.massGlobal=!0),(m&16)!=0&&(d.windGlobal=!0),(m&32)!=0&&(d.gravityGlobal=!0),(m&64)!=0&&(d.mixGlobal=!0),d.mix=(m&128)!=0?r.readFloat():1,s.physicsConstraints.push(d)}let a=this.readSkin(r,s,!0,o);a&&(s.defaultSkin=a,s.skins.push(a));{let h=s.skins.length;for(E.setArraySize(s.skins,n=h+r.readInt(!0));h<n;h++){let c=this.readSkin(r,s,!1,o);if(!c)throw new Error("readSkin() should not have returned null.");s.skins[h]=c}}n=this.linkedMeshes.length;for(let h=0;h<n;h++){let c=this.linkedMeshes[h];const u=s.skins[c.skinIndex];if(!c.parent)throw new Error("Linked mesh parent must not be null");let d=u.getAttachment(c.slotIndex,c.parent);if(!d)throw new Error(`Parent mesh not found: ${c.parent}`);c.mesh.timelineAttachment=c.inheritTimeline?d:c.mesh,c.mesh.setParentMesh(d),c.mesh.region!=null&&c.mesh.updateRegion()}this.linkedMeshes.length=0,n=r.readInt(!0);for(let h=0;h<n;h++){let c=r.readString();if(!c)throw new Error("Event data name must not be null");let u=new He(c);u.intValue=r.readInt(!1),u.floatValue=r.readFloat(),u.stringValue=r.readString(),u.audioPath=r.readString(),u.audioPath&&(u.volume=r.readFloat(),u.balance=r.readFloat()),s.events.push(u)}n=r.readInt(!0);for(let h=0;h<n;h++){let c=r.readString();if(!c)throw new Error("Animatio name must not be null.");s.animations.push(this.readAnimation(r,c,s))}return s}readSkin(e,t,s,r){let i=null,l=0;if(s){if(l=e.readInt(!0),l==0)return null;i=new Vt("default")}else{let o=e.readString();if(!o)throw new Error("Skin name must not be null.");i=new Vt(o),r&&V.rgba8888ToColor(i.color,e.readInt32()),i.bones.length=e.readInt(!0);for(let n=0,a=i.bones.length;n<a;n++)i.bones[n]=t.bones[e.readInt(!0)];for(let n=0,a=e.readInt(!0);n<a;n++)i.constraints.push(t.ikConstraints[e.readInt(!0)]);for(let n=0,a=e.readInt(!0);n<a;n++)i.constraints.push(t.transformConstraints[e.readInt(!0)]);for(let n=0,a=e.readInt(!0);n<a;n++)i.constraints.push(t.pathConstraints[e.readInt(!0)]);for(let n=0,a=e.readInt(!0);n<a;n++)i.constraints.push(t.physicsConstraints[e.readInt(!0)]);l=e.readInt(!0)}for(let o=0;o<l;o++){let n=e.readInt(!0);for(let a=0,h=e.readInt(!0);a<h;a++){let c=e.readStringRef();if(!c)throw new Error("Attachment name must not be null");let u=this.readAttachment(e,t,i,n,c,r);u&&i.setAttachment(n,c,u)}}return i}readAttachment(e,t,s,r,i,l){let o=this.scale,n=e.readByte();const a=(n&8)!=0?e.readStringRef():i;if(!a)throw new Error("Attachment name must not be null");switch(n&7){case 0:{let h=(n&16)!=0?e.readStringRef():null;const c=(n&32)!=0?e.readInt32():4294967295,u=(n&64)!=0?this.readSequence(e):null;let d=(n&128)!=0?e.readFloat():0,m=e.readFloat(),f=e.readFloat(),p=e.readFloat(),b=e.readFloat(),w=e.readFloat(),g=e.readFloat();h||(h=a);let x=this.attachmentLoader.newRegionAttachment(s,a,h,u);return x?(x.path=h,x.x=m*o,x.y=f*o,x.scaleX=p,x.scaleY=b,x.rotation=d,x.width=w*o,x.height=g*o,V.rgba8888ToColor(x.color,c),x.sequence=u,u==null&&x.updateRegion(),x):null}case 1:{let h=this.readVertices(e,(n&16)!=0),c=l?e.readInt32():0,u=this.attachmentLoader.newBoundingBoxAttachment(s,a);return u?(u.worldVerticesLength=h.length,u.vertices=h.vertices,u.bones=h.bones,l&&V.rgba8888ToColor(u.color,c),u):null}case 2:{let h=(n&16)!=0?e.readStringRef():a;const c=(n&32)!=0?e.readInt32():4294967295,u=(n&64)!=0?this.readSequence(e):null,d=e.readInt(!0),m=this.readVertices(e,(n&128)!=0),f=this.readFloatArray(e,m.length,1),p=this.readShortArray(e,(m.length-d-2)*3);let b=[],w=0,g=0;l&&(b=this.readShortArray(e,e.readInt(!0)),w=e.readFloat(),g=e.readFloat()),h||(h=a);let x=this.attachmentLoader.newMeshAttachment(s,a,h,u);return x?(x.path=h,V.rgba8888ToColor(x.color,c),x.bones=m.bones,x.vertices=m.vertices,x.worldVerticesLength=m.length,x.triangles=p,x.regionUVs=f,u==null&&x.updateRegion(),x.hullLength=d<<1,x.sequence=u,l&&(x.edges=b,x.width=w*o,x.height=g*o),x):null}case 3:{const h=(n&16)!=0?e.readStringRef():a;if(h==null)throw new Error("Path of linked mesh must not be null");const c=(n&32)!=0?e.readInt32():4294967295,u=(n&64)!=0?this.readSequence(e):null,d=(n&128)!=0,m=e.readInt(!0),f=e.readStringRef();let p=0,b=0;l&&(p=e.readFloat(),b=e.readFloat());let w=this.attachmentLoader.newMeshAttachment(s,a,h,u);return w?(w.path=h,V.rgba8888ToColor(w.color,c),w.sequence=u,l&&(w.width=p*o,w.height=b*o),this.linkedMeshes.push(new Si(w,m,r,f,d)),w):null}case 4:{const h=(n&16)!=0,c=(n&32)!=0,u=this.readVertices(e,(n&64)!=0),d=E.newArray(u.length/6,0);for(let p=0,b=d.length;p<b;p++)d[p]=e.readFloat()*o;const m=l?e.readInt32():0,f=this.attachmentLoader.newPathAttachment(s,a);return f?(f.closed=h,f.constantSpeed=c,f.worldVerticesLength=u.length,f.vertices=u.vertices,f.bones=u.bones,f.lengths=d,l&&V.rgba8888ToColor(f.color,m),f):null}case 5:{const h=e.readFloat(),c=e.readFloat(),u=e.readFloat(),d=l?e.readInt32():0,m=this.attachmentLoader.newPointAttachment(s,a);return m?(m.x=c*o,m.y=u*o,m.rotation=h,l&&V.rgba8888ToColor(m.color,d),m):null}case 6:{const h=e.readInt(!0),c=this.readVertices(e,(n&16)!=0);let u=l?e.readInt32():0,d=this.attachmentLoader.newClippingAttachment(s,a);return d?(d.endSlot=t.slots[h],d.worldVerticesLength=c.length,d.vertices=c.vertices,d.bones=c.bones,l&&V.rgba8888ToColor(d.color,u),d):null}}return null}readSequence(e){let t=new ps(e.readInt(!0));return t.start=e.readInt(!0),t.digits=e.readInt(!0),t.setupIndex=e.readInt(!0),t}readVertices(e,t){const s=this.scale,r=e.readInt(!0),i=new Ai;if(i.length=r<<1,!t)return i.vertices=this.readFloatArray(e,i.length,s),i;let l=new Array,o=new Array;for(let n=0;n<r;n++){let a=e.readInt(!0);o.push(a);for(let h=0;h<a;h++)o.push(e.readInt(!0)),l.push(e.readFloat()*s),l.push(e.readFloat()*s),l.push(e.readFloat())}return i.vertices=E.toFloatArray(l),i.bones=o,i}readFloatArray(e,t,s){let r=new Array(t);if(s==1)for(let i=0;i<t;i++)r[i]=e.readFloat();else for(let i=0;i<t;i++)r[i]=e.readFloat()*s;return r}readShortArray(e,t){let s=new Array(t);for(let r=0;r<t;r++)s[r]=e.readInt(!0);return s}readAnimation(e,t,s){e.readInt(!0);let r=new Array,i=this.scale;for(let a=0,h=e.readInt(!0);a<h;a++){let c=e.readInt(!0);for(let u=0,d=e.readInt(!0);u<d;u++){let m=e.readByte(),f=e.readInt(!0),p=f-1;switch(m){case Di:{let b=new Ct(f,c);for(let w=0;w<f;w++)b.setFrame(w,e.readFloat(),e.readStringRef());r.push(b);break}case Li:{let b=e.readInt(!0),w=new xe(f,b,c),g=e.readFloat(),x=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255;for(let S=0,k=0;w.setFrame(S,g,x,y,v,C),S!=p;S++){let T=e.readFloat(),Y=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255,X=e.readUnsignedByte()/255,F=e.readUnsignedByte()/255;switch(e.readByte()){case ft:w.setStepped(S);break;case mt:q(e,w,k++,S,0,g,T,x,Y,1),q(e,w,k++,S,1,g,T,y,M,1),q(e,w,k++,S,2,g,T,v,X,1),q(e,w,k++,S,3,g,T,C,F,1)}g=T,x=Y,y=M,v=X,C=F}r.push(w);break}case Vi:{let b=e.readInt(!0),w=new be(f,b,c),g=e.readFloat(),x=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255;for(let C=0,S=0;w.setFrame(C,g,x,y,v),C!=p;C++){let k=e.readFloat(),T=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255;switch(e.readByte()){case ft:w.setStepped(C);break;case mt:q(e,w,S++,C,0,g,k,x,T,1),q(e,w,S++,C,1,g,k,y,Y,1),q(e,w,S++,C,2,g,k,v,M,1)}g=k,x=T,y=Y,v=M}r.push(w);break}case Ni:{let b=e.readInt(!0),w=new ye(f,b,c),g=e.readFloat(),x=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,k=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255;for(let Y=0,M=0;w.setFrame(Y,g,x,y,v,C,S,k,T),Y!=p;Y++){let X=e.readFloat(),F=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255,D=e.readUnsignedByte()/255,O=e.readUnsignedByte()/255,L=e.readUnsignedByte()/255,_=e.readUnsignedByte()/255;switch(e.readByte()){case ft:w.setStepped(Y);break;case mt:q(e,w,M++,Y,0,g,X,x,F,1),q(e,w,M++,Y,1,g,X,y,I,1),q(e,w,M++,Y,2,g,X,v,P,1),q(e,w,M++,Y,3,g,X,C,D,1),q(e,w,M++,Y,4,g,X,S,O,1),q(e,w,M++,Y,5,g,X,k,L,1),q(e,w,M++,Y,6,g,X,T,_,1)}g=X,x=F,y=I,v=P,C=D,S=O,k=L,T=_}r.push(w);break}case Oi:{let b=e.readInt(!0),w=new ve(f,b,c),g=e.readFloat(),x=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255,v=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,k=e.readUnsignedByte()/255;for(let T=0,Y=0;w.setFrame(T,g,x,y,v,C,S,k),T!=p;T++){let M=e.readFloat(),X=e.readUnsignedByte()/255,F=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255,D=e.readUnsignedByte()/255,O=e.readUnsignedByte()/255;switch(e.readByte()){case ft:w.setStepped(T);break;case mt:q(e,w,Y++,T,0,g,M,x,X,1),q(e,w,Y++,T,1,g,M,y,F,1),q(e,w,Y++,T,2,g,M,v,I,1),q(e,w,Y++,T,3,g,M,C,P,1),q(e,w,Y++,T,4,g,M,S,D,1),q(e,w,Y++,T,5,g,M,k,O,1)}g=M,x=X,y=F,v=I,C=P,S=D,k=O}r.push(w);break}case _i:{let b=new we(f,e.readInt(!0),c),w=e.readFloat(),g=e.readUnsignedByte()/255;for(let x=0,y=0;b.setFrame(x,w,g),x!=p;x++){let v=e.readFloat(),C=e.readUnsignedByte()/255;switch(e.readByte()){case ft:b.setStepped(x);break;case mt:q(e,b,y++,x,0,w,v,g,C,1)}w=v,g=C}r.push(b)}}}}for(let a=0,h=e.readInt(!0);a<h;a++){let c=e.readInt(!0);for(let u=0,d=e.readInt(!0);u<d;u++){let m=e.readByte(),f=e.readInt(!0);if(m==Ri){let b=new pe(f,c);for(let w=0;w<f;w++)b.setFrame(w,e.readFloat(),e.readByte());r.push(b);continue}let p=e.readInt(!0);switch(m){case ki:r.push(Q(e,new Rt(f,p,c),1));break;case Ti:r.push(is(e,new oe(f,p,c),i));break;case Ii:r.push(Q(e,new le(f,p,c),i));break;case Mi:r.push(Q(e,new he(f,p,c),i));break;case Yi:r.push(is(e,new ce(f,p,c),1));break;case Pi:r.push(Q(e,new de(f,p,c),1));break;case Xi:r.push(Q(e,new ue(f,p,c),1));break;case Fi:r.push(is(e,new fe(f,p,c),1));break;case Bi:r.push(Q(e,new me(f,p,c),1));break;case Ei:r.push(Q(e,new ge(f,p,c),1))}}}for(let a=0,h=e.readInt(!0);a<h;a++){let c=e.readInt(!0),u=e.readInt(!0),d=u-1,m=new Se(u,e.readInt(!0),c),f=e.readByte(),p=e.readFloat(),b=(f&1)!=0?(f&2)!=0?e.readFloat():1:0,w=(f&4)!=0?e.readFloat()*i:0;for(let g=0,x=0;m.setFrame(g,p,b,w,(f&8)!=0?1:-1,(f&16)!=0,(f&32)!=0),g!=d;g++){f=e.readByte();const y=e.readFloat(),v=(f&1)!=0?(f&2)!=0?e.readFloat():1:0,C=(f&4)!=0?e.readFloat()*i:0;(f&64)!=0?m.setStepped(g):(f&128)!=0&&(q(e,m,x++,g,0,p,y,b,v,1),q(e,m,x++,g,1,p,y,w,C,i)),p=y,b=v,w=C}r.push(m)}for(let a=0,h=e.readInt(!0);a<h;a++){let c=e.readInt(!0),u=e.readInt(!0),d=u-1,m=new Ae(u,e.readInt(!0),c),f=e.readFloat(),p=e.readFloat(),b=e.readFloat(),w=e.readFloat(),g=e.readFloat(),x=e.readFloat(),y=e.readFloat();for(let v=0,C=0;m.setFrame(v,f,p,b,w,g,x,y),v!=d;v++){let S=e.readFloat(),k=e.readFloat(),T=e.readFloat(),Y=e.readFloat(),M=e.readFloat(),X=e.readFloat(),F=e.readFloat();switch(e.readByte()){case ft:m.setStepped(v);break;case mt:q(e,m,C++,v,0,f,S,p,k,1),q(e,m,C++,v,1,f,S,b,T,1),q(e,m,C++,v,2,f,S,w,Y,1),q(e,m,C++,v,3,f,S,g,M,1),q(e,m,C++,v,4,f,S,x,X,1),q(e,m,C++,v,5,f,S,y,F,1)}f=S,p=k,b=T,w=Y,g=M,x=X,y=F}r.push(m)}for(let a=0,h=e.readInt(!0);a<h;a++){let c=e.readInt(!0),u=s.pathConstraints[c];for(let d=0,m=e.readInt(!0);d<m;d++){const f=e.readByte(),p=e.readInt(!0),b=e.readInt(!0);switch(f){case Wi:r.push(Q(e,new ke(p,b,c),u.positionMode==0?i:1));break;case zi:r.push(Q(e,new Te(p,b,c),u.spacingMode==0||u.spacingMode==1?i:1));break;case Gi:let w=new Ie(p,b,c),g=e.readFloat(),x=e.readFloat(),y=e.readFloat(),v=e.readFloat();for(let C=0,S=0,k=w.getFrameCount()-1;w.setFrame(C,g,x,y,v),C!=k;C++){let T=e.readFloat(),Y=e.readFloat(),M=e.readFloat(),X=e.readFloat();switch(e.readByte()){case ft:w.setStepped(C);break;case mt:q(e,w,S++,C,0,g,T,x,Y,1),q(e,w,S++,C,1,g,T,y,M,1),q(e,w,S++,C,2,g,T,v,X,1)}g=T,x=Y,y=M,v=X}r.push(w)}}}for(let a=0,h=e.readInt(!0);a<h;a++){const c=e.readInt(!0)-1;for(let u=0,d=e.readInt(!0);u<d;u++){const m=e.readByte(),f=e.readInt(!0);if(m==tr){const b=new Re(f,c);for(let w=0;w<f;w++)b.setFrame(w,e.readFloat());r.push(b);continue}const p=e.readInt(!0);switch(m){case Hi:r.push(Q(e,new Me(f,p,c),1));break;case $i:r.push(Q(e,new Ye(f,p,c),1));break;case ji:r.push(Q(e,new Pe(f,p,c),1));break;case Ji:r.push(Q(e,new Xe(f,p,c),1));break;case Ki:r.push(Q(e,new Fe(f,p,c),1));break;case Qi:r.push(Q(e,new Be(f,p,c),1));break;case Zi:r.push(Q(e,new Ee(f,p,c),1))}}}for(let a=0,h=e.readInt(!0);a<h;a++){let c=s.skins[e.readInt(!0)];for(let u=0,d=e.readInt(!0);u<d;u++){let m=e.readInt(!0);for(let f=0,p=e.readInt(!0);f<p;f++){let b=e.readStringRef();if(!b)throw new Error("attachmentName must not be null.");let w=c.getAttachment(m,b),g=e.readByte(),x=e.readInt(!0),y=x-1;switch(g){case Ui:{let v=w,C=v.bones,S=v.vertices,k=C?S.length/3*2:S.length,T=e.readInt(!0),Y=new Ce(x,T,m,v),M=e.readFloat();for(let X=0,F=0;;X++){let I,P=e.readInt(!0);if(P==0)I=C?E.newFloatArray(k):S;else{I=E.newFloatArray(k);let O=e.readInt(!0);if(P+=O,i==1)for(let L=O;L<P;L++)I[L]=e.readFloat();else for(let L=O;L<P;L++)I[L]=e.readFloat()*i;if(!C)for(let L=0,_=I.length;L<_;L++)I[L]+=S[L]}if(Y.setFrame(X,M,I),X==y)break;let D=e.readFloat();switch(e.readByte()){case ft:Y.setStepped(X);break;case mt:q(e,Y,F++,X,0,M,D,0,1,1)}M=D}r.push(Y);break}case qi:{let v=new De(x,m,w);for(let C=0;C<x;C++){let S=e.readFloat(),k=e.readInt32();v.setFrame(C,S,bs[k&15],k>>4,e.readFloat())}r.push(v);break}}}}}let l=e.readInt(!0);if(l>0){let a=new It(l),h=s.slots.length;for(let c=0;c<l;c++){let u=e.readFloat(),d=e.readInt(!0),m=E.newArray(h,0);for(let w=h-1;w>=0;w--)m[w]=-1;let f=E.newArray(h-d,0),p=0,b=0;for(let w=0;w<d;w++){let g=e.readInt(!0);for(;p!=g;)f[b++]=p++;m[p+e.readInt(!0)]=p++}for(;p<h;)f[b++]=p++;for(let w=h-1;w>=0;w--)m[w]==-1&&(m[w]=f[--b]);a.setFrame(c,u,m)}r.push(a)}let o=e.readInt(!0);if(o>0){let a=new Wt(o);for(let h=0;h<o;h++){let c=e.readFloat(),u=s.events[e.readInt(!0)],d=new Ge(c,u);d.intValue=e.readInt(!1),d.floatValue=e.readFloat(),d.stringValue=e.readString(),d.stringValue==null&&(d.stringValue=u.stringValue),d.data.audioPath&&(d.volume=e.readFloat(),d.balance=e.readFloat()),a.setFrame(h,d)}r.push(a)}let n=0;for(let a=0,h=r.length;a<h;a++)n=Math.max(n,r[a].getDuration());return new Ut(t,r,n)}},Os=class{constructor(e,t=new Array,s=0,r=new DataView(e instanceof ArrayBuffer?e:e.buffer)){this.strings=t,this.index=s,this.buffer=r}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let e=this.buffer.getInt16(this.index);return this.index+=2,e}readInt32(){let e=this.buffer.getInt32(this.index);return this.index+=4,e}readInt(e){let t=this.readByte(),s=t&127;return(t&128)!=0&&(t=this.readByte(),s|=(t&127)<<7,(t&128)!=0&&(t=this.readByte(),s|=(t&127)<<14,(t&128)!=0&&(t=this.readByte(),s|=(t&127)<<21,(t&128)!=0&&(t=this.readByte(),s|=(t&127)<<28)))),e?s:s>>>1^-(s&1)}readStringRef(){let e=this.readInt(!0);return e==0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="",s=0;for(let r=0;r<e;){let i=this.readUnsignedByte();switch(i>>4){case 12:case 13:t+=String.fromCharCode((i&31)<<6|this.readByte()&63),r+=2;break;case 14:t+=String.fromCharCode((i&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),r+=3;break;default:t+=String.fromCharCode(i),r++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},Si=class{parent;skinIndex;slotIndex;mesh;inheritTimeline;constructor(e,t,s,r,i){this.mesh=e,this.skinIndex=t,this.slotIndex=s,this.parent=r,this.inheritTimeline=i}},Ai=class{constructor(e=null,t=null,s=0){this.bones=e,this.vertices=t,this.length=s}};function Q(e,t,s){let r=e.readFloat(),i=e.readFloat()*s;for(let l=0,o=0,n=t.getFrameCount()-1;t.setFrame(l,r,i),l!=n;l++){let a=e.readFloat(),h=e.readFloat()*s;switch(e.readByte()){case ft:t.setStepped(l);break;case mt:q(e,t,o++,l,0,r,a,i,h,s)}r=a,i=h}return t}function is(e,t,s){let r=e.readFloat(),i=e.readFloat()*s,l=e.readFloat()*s;for(let o=0,n=0,a=t.getFrameCount()-1;t.setFrame(o,r,i,l),o!=a;o++){let h=e.readFloat(),c=e.readFloat()*s,u=e.readFloat()*s;switch(e.readByte()){case ft:t.setStepped(o);break;case mt:q(e,t,n++,o,0,r,h,i,c,s),q(e,t,n++,o,1,r,h,l,u,s)}r=h,i=c,l=u}return t}function q(e,t,s,r,i,l,o,n,a,h){t.setBezier(s,r,i,l,n,e.readFloat(),e.readFloat()*h,e.readFloat(),e.readFloat()*h,o,a)}var ki=0,Ti=1,Ii=2,Mi=3,Yi=4,Pi=5,Xi=6,Fi=7,Bi=8,Ei=9,Ri=10,Di=0,Li=1,Vi=2,Ni=3,Oi=4,_i=5,Ui=0,qi=1,Wi=0,zi=1,Gi=2,Hi=0,$i=1,ji=2,Ji=4,Ki=5,Qi=6,Zi=7,tr=8,ft=1,mt=2,rs=class{minX=0;minY=0;maxX=0;maxY=0;boundingBoxes=new Array;polygons=new Array;polygonPool=new Tt(()=>E.newFloatArray(16));update(e,t){if(!e)throw new Error("skeleton cannot be null.");let s=this.boundingBoxes,r=this.polygons,i=this.polygonPool,l=e.slots,o=l.length;s.length=0,i.freeAll(r),r.length=0;for(let n=0;n<o;n++){let a=l[n];if(!a.bone.active)continue;let h=a.getAttachment();if(h instanceof _e){let c=h;s.push(c);let u=i.obtain();u.length!=c.worldVerticesLength&&(u=E.newFloatArray(c.worldVerticesLength)),r.push(u),c.computeWorldVertices(a,0,c.worldVerticesLength,u,0,2)}}t?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=this.polygons;for(let l=0,o=i.length;l<o;l++){let n=i[l],a=n;for(let h=0,c=n.length;h<c;h+=2){let u=a[h],d=a[h+1];e=Math.min(e,u),t=Math.min(t,d),s=Math.max(s,u),r=Math.max(r,d)}}this.minX=e,this.minY=t,this.maxX=s,this.maxY=r}aabbContainsPoint(e,t){return e>=this.minX&&e<=this.maxX&&t>=this.minY&&t<=this.maxY}aabbIntersectsSegment(e,t,s,r){let i=this.minX,l=this.minY,o=this.maxX,n=this.maxY;if(e<=i&&s<=i||t<=l&&r<=l||e>=o&&s>=o||t>=n&&r>=n)return!1;let a=(r-t)/(s-e),h=a*(i-e)+t;if(h>l&&h<n||(h=a*(o-e)+t,h>l&&h<n))return!0;let c=(l-t)/a+e;return c>i&&c<o||(c=(n-t)/a+e,c>i&&c<o)}aabbIntersectsSkeleton(e){return this.minX<e.maxX&&this.maxX>e.minX&&this.minY<e.maxY&&this.maxY>e.minY}containsPoint(e,t){let s=this.polygons;for(let r=0,i=s.length;r<i;r++)if(this.containsPointPolygon(s[r],e,t))return this.boundingBoxes[r];return null}containsPointPolygon(e,t,s){let r=e,i=e.length,l=i-2,o=!1;for(let n=0;n<i;n+=2){let a=r[n+1],h=r[l+1];if(a<s&&h>=s||h<s&&a>=s){let c=r[n];c+(s-a)/(h-a)*(r[l]-c)<t&&(o=!o)}l=n}return o}intersectsSegment(e,t,s,r){let i=this.polygons;for(let l=0,o=i.length;l<o;l++)if(this.intersectsSegmentPolygon(i[l],e,t,s,r))return this.boundingBoxes[l];return null}intersectsSegmentPolygon(e,t,s,r,i){let l=e,o=e.length,n=t-r,a=s-i,h=t*i-s*r,c=l[o-2],u=l[o-1];for(let d=0;d<o;d+=2){let m=l[d],f=l[d+1],p=c*f-u*m,b=c-m,w=u-f,g=n*w-a*b,x=(h*b-n*p)/g;if((x>=c&&x<=m||x>=m&&x<=c)&&(x>=t&&x<=r||x>=r&&x<=t)){let y=(h*w-a*p)/g;if((y>=u&&y<=f||y>=f&&y<=u)&&(y>=s&&y<=i||y>=i&&y<=s))return!0}c=m,u=f}return!1}getPolygon(e){if(!e)throw new Error("boundingBox cannot be null.");let t=this.boundingBoxes.indexOf(e);return t==-1?null:this.polygons[t]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},_s=class rt{convexPolygons=new Array;convexPolygonsIndices=new Array;indicesArray=new Array;isConcaveArray=new Array;triangles=new Array;polygonPool=new Tt(()=>new Array);polygonIndicesPool=new Tt(()=>new Array);triangulate(t){let s=t,r=t.length>>1,i=this.indicesArray;i.length=0;for(let n=0;n<r;n++)i[n]=n;let l=this.isConcaveArray;l.length=0;for(let n=0,a=r;n<a;++n)l[n]=rt.isConcave(n,r,s,i);let o=this.triangles;for(o.length=0;r>3;){let n=r-1,a=0,h=1;for(;;){t:if(!l[a]){let d=i[n]<<1,m=i[a]<<1,f=i[h]<<1,p=s[d],b=s[d+1],w=s[m],g=s[m+1],x=s[f],y=s[f+1];for(let v=(h+1)%r;v!=n;v=(v+1)%r){if(!l[v])continue;let C=i[v]<<1,S=s[C],k=s[C+1];if(rt.positiveArea(x,y,p,b,S,k)&&rt.positiveArea(p,b,w,g,S,k)&&rt.positiveArea(w,g,x,y,S,k))break t}break}if(h==0){do{if(!l[a])break;a--}while(a>0);break}n=a,a=h,h=(h+1)%r}o.push(i[(r+a-1)%r]),o.push(i[a]),o.push(i[(a+1)%r]),i.splice(a,1),l.splice(a,1),r--;let c=(r+a-1)%r,u=a==r?0:a;l[c]=rt.isConcave(c,r,s,i),l[u]=rt.isConcave(u,r,s,i)}return r==3&&(o.push(i[2]),o.push(i[0]),o.push(i[1])),o}decompose(t,s){let r=t,i=this.convexPolygons;this.polygonPool.freeAll(i),i.length=0;let l=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(l),l.length=0;let o=this.polygonIndicesPool.obtain();o.length=0;let n=this.polygonPool.obtain();n.length=0;let a=-1,h=0;for(let c=0,u=s.length;c<u;c+=3){let d=s[c]<<1,m=s[c+1]<<1,f=s[c+2]<<1,p=r[d],b=r[d+1],w=r[m],g=r[m+1],x=r[f],y=r[f+1],v=!1;if(a==d){let C=n.length-4,S=rt.winding(n[C],n[C+1],n[C+2],n[C+3],x,y),k=rt.winding(x,y,n[0],n[1],n[2],n[3]);S==h&&k==h&&(n.push(x),n.push(y),o.push(f),v=!0)}v||(n.length>0?(i.push(n),l.push(o)):(this.polygonPool.free(n),this.polygonIndicesPool.free(o)),n=this.polygonPool.obtain(),n.length=0,n.push(p),n.push(b),n.push(w),n.push(g),n.push(x),n.push(y),o=this.polygonIndicesPool.obtain(),o.length=0,o.push(d),o.push(m),o.push(f),h=rt.winding(p,b,w,g,x,y),a=d)}n.length>0&&(i.push(n),l.push(o));for(let c=0,u=i.length;c<u;c++){if(o=l[c],o.length==0)continue;let d=o[0],m=o[o.length-1];n=i[c];let f=n.length-4,p=n[f],b=n[f+1],w=n[f+2],g=n[f+3],x=n[0],y=n[1],v=n[2],C=n[3],S=rt.winding(p,b,w,g,x,y);for(let k=0;k<u;k++){if(k==c)continue;let T=l[k];if(T.length!=3)continue;let Y=T[0],M=T[1],X=T[2],F=i[k],I=F[F.length-2],P=F[F.length-1];if(Y!=d||M!=m)continue;let D=rt.winding(p,b,w,g,I,P),O=rt.winding(I,P,x,y,v,C);D==S&&O==S&&(F.length=0,T.length=0,n.push(I),n.push(P),o.push(X),p=w,b=g,w=I,g=P,k=0)}}for(let c=i.length-1;c>=0;c--)n=i[c],n.length==0&&(i.splice(c,1),this.polygonPool.free(n),o=l[c],l.splice(c,1),this.polygonIndicesPool.free(o));return i}static isConcave(t,s,r,i){let l=i[(s+t-1)%s]<<1,o=i[t]<<1,n=i[(t+1)%s]<<1;return!this.positiveArea(r[l],r[l+1],r[o],r[o+1],r[n],r[n+1])}static positiveArea(t,s,r,i,l,o){return t*(o-i)+r*(s-o)+l*(i-s)>=0}static winding(t,s,r,i,l,o){let n=r-t,a=i-s;return l*a-o*n+n*s-t*a>=0?1:-1}},Jt=class ds{triangulator=new _s;clippingPolygon=new Array;clipOutput=new Array;clippedVertices=new Array;clippedUVs=new Array;clippedTriangles=new Array;scratch=new Array;clipAttachment=null;clippingPolygons=null;clipStart(t,s){if(this.clipAttachment)return 0;this.clipAttachment=s;let r=s.worldVerticesLength,i=E.setArraySize(this.clippingPolygon,r);s.computeWorldVertices(t,0,r,i,0,2);let l=this.clippingPolygon;ds.makeClockwise(l);let o=this.clippingPolygons=this.triangulator.decompose(l,this.triangulator.triangulate(l));for(let n=0,a=o.length;n<a;n++){let h=o[n];ds.makeClockwise(h),h.push(h[0]),h.push(h[1])}return o.length}clipEndWithSlot(t){this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()}clipEnd(){this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return this.clipAttachment!=null}clipTriangles(t,s,r,i,l,o,n,a){let h,c,u,d,m,f;typeof s=="number"?(h=r,c=i,u=l,d=o,m=n,f=a):(h=s,c=r,u=i,d=l,m=o,f=n),u&&d&&m&&typeof f=="boolean"?this.clipTrianglesRender(t,h,c,u,d,m,f):this.clipTrianglesNoRender(t,h,c)}clipTrianglesNoRender(t,s,r){let i=this.clipOutput,l=this.clippedVertices,o=this.clippedTriangles,n=this.clippingPolygons,a=n.length,h=0;l.length=0,o.length=0;for(let c=0;c<r;c+=3){let u=s[c]<<1,d=t[u],m=t[u+1];u=s[c+1]<<1;let f=t[u],p=t[u+1];u=s[c+2]<<1;let b=t[u],w=t[u+1];for(let g=0;g<a;g++){let x=l.length;if(this.clip(d,m,f,p,b,w,n[g],i)){let y=i.length;if(y==0)continue;let v=y>>1,C=this.clipOutput,S=E.setArraySize(l,x+v*2);for(let T=0;T<y;T+=2,x+=2){let Y=C[T],M=C[T+1];S[x]=Y,S[x+1]=M}x=o.length;let k=E.setArraySize(o,x+3*(v-2));v--;for(let T=1;T<v;T++,x+=3)k[x]=h,k[x+1]=h+T,k[x+2]=h+T+1;h+=v+1}else{let y=E.setArraySize(l,x+6);y[x]=d,y[x+1]=m,y[x+2]=f,y[x+3]=p,y[x+4]=b,y[x+5]=w,x=o.length;let v=E.setArraySize(o,x+3);v[x]=h,v[x+1]=h+1,v[x+2]=h+2,h+=3;break}}}}clipTrianglesRender(t,s,r,i,l,o,n){let a=this.clipOutput,h=this.clippedVertices,c=this.clippedTriangles,u=this.clippingPolygons,d=u.length,m=n?12:8,f=0;h.length=0,c.length=0;for(let p=0;p<r;p+=3){let b=s[p]<<1,w=t[b],g=t[b+1],x=i[b],y=i[b+1];b=s[p+1]<<1;let v=t[b],C=t[b+1],S=i[b],k=i[b+1];b=s[p+2]<<1;let T=t[b],Y=t[b+1],M=i[b],X=i[b+1];for(let F=0;F<d;F++){let I=h.length;if(this.clip(w,g,v,C,T,Y,u[F],a)){let P=a.length;if(P==0)continue;let D=C-Y,O=T-v,L=w-T,_=Y-g,H=1/(D*L+O*(g-Y)),z=P>>1,j=this.clipOutput,R=E.setArraySize(h,I+z*m);for(let G=0;G<P;G+=2,I+=m){let st=j[G],J=j[G+1];R[I]=st,R[I+1]=J,R[I+2]=l.r,R[I+3]=l.g,R[I+4]=l.b,R[I+5]=l.a;let Z=st-T,tt=J-Y,ht=(D*Z+O*tt)*H,Xt=(_*Z+L*tt)*H,Ot=1-ht-Xt;R[I+6]=x*ht+S*Xt+M*Ot,R[I+7]=y*ht+k*Xt+X*Ot,n&&(R[I+8]=o.r,R[I+9]=o.g,R[I+10]=o.b,R[I+11]=o.a)}I=c.length;let U=E.setArraySize(c,I+3*(z-2));z--;for(let G=1;G<z;G++,I+=3)U[I]=f,U[I+1]=f+G,U[I+2]=f+G+1;f+=z+1}else{let P=E.setArraySize(h,I+3*m);P[I]=w,P[I+1]=g,P[I+2]=l.r,P[I+3]=l.g,P[I+4]=l.b,P[I+5]=l.a,n?(P[I+6]=x,P[I+7]=y,P[I+8]=o.r,P[I+9]=o.g,P[I+10]=o.b,P[I+11]=o.a,P[I+12]=v,P[I+13]=C,P[I+14]=l.r,P[I+15]=l.g,P[I+16]=l.b,P[I+17]=l.a,P[I+18]=S,P[I+19]=k,P[I+20]=o.r,P[I+21]=o.g,P[I+22]=o.b,P[I+23]=o.a,P[I+24]=T,P[I+25]=Y,P[I+26]=l.r,P[I+27]=l.g,P[I+28]=l.b,P[I+29]=l.a,P[I+30]=M,P[I+31]=X,P[I+32]=o.r,P[I+33]=o.g,P[I+34]=o.b,P[I+35]=o.a):(P[I+6]=x,P[I+7]=y,P[I+8]=v,P[I+9]=C,P[I+10]=l.r,P[I+11]=l.g,P[I+12]=l.b,P[I+13]=l.a,P[I+14]=S,P[I+15]=k,P[I+16]=T,P[I+17]=Y,P[I+18]=l.r,P[I+19]=l.g,P[I+20]=l.b,P[I+21]=l.a,P[I+22]=M,P[I+23]=X),I=c.length;let D=E.setArraySize(c,I+3);D[I]=f,D[I+1]=f+1,D[I+2]=f+2,f+=3;break}}}}clipTrianglesUnpacked(t,s,r,i){let l=this.clipOutput,o=this.clippedVertices,n=this.clippedUVs,a=this.clippedTriangles,h=this.clippingPolygons,c=h.length,u=0;o.length=0,n.length=0,a.length=0;for(let d=0;d<r;d+=3){let m=s[d]<<1,f=t[m],p=t[m+1],b=i[m],w=i[m+1];m=s[d+1]<<1;let g=t[m],x=t[m+1],y=i[m],v=i[m+1];m=s[d+2]<<1;let C=t[m],S=t[m+1],k=i[m],T=i[m+1];for(let Y=0;Y<c;Y++){let M=o.length;if(this.clip(f,p,g,x,C,S,h[Y],l)){let X=l.length;if(X==0)continue;let F=x-S,I=C-g,P=f-C,D=S-p,O=1/(F*P+I*(p-S)),L=X>>1,_=this.clipOutput,H=E.setArraySize(o,M+L*2),z=E.setArraySize(n,M+L*2);for(let R=0;R<X;R+=2,M+=2){let U=_[R],G=_[R+1];H[M]=U,H[M+1]=G;let st=U-C,J=G-S,Z=(F*st+I*J)*O,tt=(D*st+P*J)*O,ht=1-Z-tt;z[M]=b*Z+y*tt+k*ht,z[M+1]=w*Z+v*tt+T*ht}M=a.length;let j=E.setArraySize(a,M+3*(L-2));L--;for(let R=1;R<L;R++,M+=3)j[M]=u,j[M+1]=u+R,j[M+2]=u+R+1;u+=L+1}else{let X=E.setArraySize(o,M+6);X[M]=f,X[M+1]=p,X[M+2]=g,X[M+3]=x,X[M+4]=C,X[M+5]=S;let F=E.setArraySize(n,M+3*2);F[M]=b,F[M+1]=w,F[M+2]=y,F[M+3]=v,F[M+4]=k,F[M+5]=T,M=a.length;let I=E.setArraySize(a,M+3);I[M]=u,I[M+1]=u+1,I[M+2]=u+2,u+=3;break}}}}clip(t,s,r,i,l,o,n,a){let h=a,c=!1,u;n.length%4>=2?(u=a,a=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(s),u.push(r),u.push(i),u.push(l),u.push(o),u.push(t),u.push(s),a.length=0;let d=n.length-4,m=n;for(let f=0;;f+=2){let p=m[f],b=m[f+1],w=p-m[f+2],g=b-m[f+3],x=a.length,y=u;for(let C=0,S=u.length-2;C<S;){let k=y[C],T=y[C+1];C+=2;let Y=y[C],M=y[C+1],X=g*(p-Y)>w*(b-M),F=g*(p-k)-w*(b-T);if(F>0){if(X){a.push(Y),a.push(M);continue}let I=Y-k,P=M-T,D=F/(I*g-P*w);if(D>=0&&D<=1)a.push(k+I*D),a.push(T+P*D);else{a.push(Y),a.push(M);continue}}else if(X){let I=Y-k,P=M-T,D=F/(I*g-P*w);if(D>=0&&D<=1)a.push(k+I*D),a.push(T+P*D),a.push(Y),a.push(M);else{a.push(Y),a.push(M);continue}}c=!0}if(x==a.length)return h.length=0,!0;if(a.push(a[0]),a.push(a[1]),f==d)break;let v=a;a=u,a.length=0,u=v}if(h!=a){h.length=0;for(let f=0,p=a.length-2;f<p;f++)h[f]=a[f]}else h.length=h.length-2;return c}static makeClockwise(t){let s=t,r=t.length,i=s[r-2]*s[1]-s[0]*s[r-1],l=0,o=0,n=0,a=0;for(let h=0,c=r-3;h<c;h+=2)l=s[h],o=s[h+1],n=s[h+2],a=s[h+3],i+=l*a-n*o;if(!(i<0))for(let h=0,c=r-2,u=r>>1;h<u;h+=2){let d=s[h],m=s[h+1],f=c-h;s[h]=s[f],s[h+1]=s[f+1],s[f]=d,s[f+1]=m}}},Us=class{attachmentLoader;scale=1;linkedMeshes=new Array;constructor(e){this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new Lt,r=typeof e=="string"?JSON.parse(e):e,i=r.skeleton;if(i&&(s.hash=i.hash,s.version=i.spine,s.x=i.x,s.y=i.y,s.width=i.width,s.height=i.height,s.referenceScale=A(i,"referenceScale",100)*t,s.fps=i.fps,s.imagesPath=i.images??null,s.audioPath=i.audio??null),r.bones)for(let l=0;l<r.bones.length;l++){let o=r.bones[l],n=null,a=A(o,"parent",null);a&&(n=s.findBone(a));let h=new We(s.bones.length,o.name,n);h.length=A(o,"length",0)*t,h.x=A(o,"x",0)*t,h.y=A(o,"y",0)*t,h.rotation=A(o,"rotation",0),h.scaleX=A(o,"scaleX",1),h.scaleY=A(o,"scaleY",1),h.shearX=A(o,"shearX",0),h.shearY=A(o,"shearY",0),h.inherit=E.enumValue(jt,A(o,"inherit","Normal")),h.skinRequired=A(o,"skin",!1);let c=A(o,"color",null);c&&h.color.setFromString(c),s.bones.push(h)}if(r.slots)for(let l=0;l<r.slots.length;l++){let o=r.slots[l],n=o.name,a=s.findBone(o.bone);if(!a)throw new Error(`Couldn't find bone ${o.bone} for slot ${n}`);let h=new ts(s.slots.length,n,a),c=A(o,"color",null);c&&h.color.setFromString(c);let u=A(o,"dark",null);u&&(h.darkColor=V.fromString(u)),h.attachmentName=A(o,"attachment",null),h.blendMode=E.enumValue(es,A(o,"blend","normal")),h.visible=A(o,"visible",!0),s.slots.push(h)}if(r.ik)for(let l=0;l<r.ik.length;l++){let o=r.ik[l],n=new $e(o.name);n.order=A(o,"order",0),n.skinRequired=A(o,"skin",!1);for(let h=0;h<o.bones.length;h++){let c=s.findBone(o.bones[h]);if(!c)throw new Error(`Couldn't find bone ${o.bones[h]} for IK constraint ${o.name}.`);n.bones.push(c)}let a=s.findBone(o.target);if(!a)throw new Error(`Couldn't find target bone ${o.target} for IK constraint ${o.name}.`);n.target=a,n.mix=A(o,"mix",1),n.softness=A(o,"softness",0)*t,n.bendDirection=A(o,"bendPositive",!0)?1:-1,n.compress=A(o,"compress",!1),n.stretch=A(o,"stretch",!1),n.uniform=A(o,"uniform",!1),s.ikConstraints.push(n)}if(r.transform)for(let l=0;l<r.transform.length;l++){let o=r.transform[l],n=new ss(o.name);n.order=A(o,"order",0),n.skinRequired=A(o,"skin",!1);for(let c=0;c<o.bones.length;c++){let u=o.bones[c],d=s.findBone(u);if(!d)throw new Error(`Couldn't find bone ${u} for transform constraint ${o.name}.`);n.bones.push(d)}let a=o.target,h=s.findBone(a);if(!h)throw new Error(`Couldn't find target bone ${a} for transform constraint ${o.name}.`);n.target=h,n.local=A(o,"local",!1),n.relative=A(o,"relative",!1),n.offsetRotation=A(o,"rotation",0),n.offsetX=A(o,"x",0)*t,n.offsetY=A(o,"y",0)*t,n.offsetScaleX=A(o,"scaleX",0),n.offsetScaleY=A(o,"scaleY",0),n.offsetShearY=A(o,"shearY",0),n.mixRotate=A(o,"mixRotate",1),n.mixX=A(o,"mixX",1),n.mixY=A(o,"mixY",n.mixX),n.mixScaleX=A(o,"mixScaleX",1),n.mixScaleY=A(o,"mixScaleY",n.mixScaleX),n.mixShearY=A(o,"mixShearY",1),s.transformConstraints.push(n)}if(r.path)for(let l=0;l<r.path.length;l++){let o=r.path[l],n=new je(o.name);n.order=A(o,"order",0),n.skinRequired=A(o,"skin",!1);for(let c=0;c<o.bones.length;c++){let u=o.bones[c],d=s.findBone(u);if(!d)throw new Error(`Couldn't find bone ${u} for path constraint ${o.name}.`);n.bones.push(d)}let a=o.target,h=s.findSlot(a);if(!h)throw new Error(`Couldn't find target slot ${a} for path constraint ${o.name}.`);n.target=h,n.positionMode=E.enumValue(Je,A(o,"positionMode","Percent")),n.spacingMode=E.enumValue(Ke,A(o,"spacingMode","Length")),n.rotateMode=E.enumValue(Qe,A(o,"rotateMode","Tangent")),n.offsetRotation=A(o,"rotation",0),n.position=A(o,"position",0),n.positionMode==0&&(n.position*=t),n.spacing=A(o,"spacing",0),(n.spacingMode==0||n.spacingMode==1)&&(n.spacing*=t),n.mixRotate=A(o,"mixRotate",1),n.mixX=A(o,"mixX",1),n.mixY=A(o,"mixY",n.mixX),s.pathConstraints.push(n)}if(r.physics)for(let l=0;l<r.physics.length;l++){const o=r.physics[l],n=new Vs(o.name);n.order=A(o,"order",0),n.skinRequired=A(o,"skin",!1);const a=o.bone,h=s.findBone(a);if(h==null)throw new Error("Physics bone not found: "+a);n.bone=h,n.x=A(o,"x",0),n.y=A(o,"y",0),n.rotate=A(o,"rotate",0),n.scaleX=A(o,"scaleX",0),n.shearX=A(o,"shearX",0),n.limit=A(o,"limit",5e3)*t,n.step=1/A(o,"fps",60),n.inertia=A(o,"inertia",1),n.strength=A(o,"strength",100),n.damping=A(o,"damping",1),n.massInverse=1/A(o,"mass",1),n.wind=A(o,"wind",0),n.gravity=A(o,"gravity",0),n.mix=A(o,"mix",1),n.inertiaGlobal=A(o,"inertiaGlobal",!1),n.strengthGlobal=A(o,"strengthGlobal",!1),n.dampingGlobal=A(o,"dampingGlobal",!1),n.massGlobal=A(o,"massGlobal",!1),n.windGlobal=A(o,"windGlobal",!1),n.gravityGlobal=A(o,"gravityGlobal",!1),n.mixGlobal=A(o,"mixGlobal",!1),s.physicsConstraints.push(n)}if(r.skins)for(let l=0;l<r.skins.length;l++){let o=r.skins[l],n=new Vt(o.name);if(o.bones)for(let a=0;a<o.bones.length;a++){let h=o.bones[a],c=s.findBone(h);if(!c)throw new Error(`Couldn't find bone ${h} for skin ${o.name}.`);n.bones.push(c)}if(o.ik)for(let a=0;a<o.ik.length;a++){let h=o.ik[a],c=s.findIkConstraint(h);if(!c)throw new Error(`Couldn't find IK constraint ${h} for skin ${o.name}.`);n.constraints.push(c)}if(o.transform)for(let a=0;a<o.transform.length;a++){let h=o.transform[a],c=s.findTransformConstraint(h);if(!c)throw new Error(`Couldn't find transform constraint ${h} for skin ${o.name}.`);n.constraints.push(c)}if(o.path)for(let a=0;a<o.path.length;a++){let h=o.path[a],c=s.findPathConstraint(h);if(!c)throw new Error(`Couldn't find path constraint ${h} for skin ${o.name}.`);n.constraints.push(c)}if(o.physics)for(let a=0;a<o.physics.length;a++){let h=o.physics[a],c=s.findPhysicsConstraint(h);if(!c)throw new Error(`Couldn't find physics constraint ${h} for skin ${o.name}.`);n.constraints.push(c)}for(let a in o.attachments){let h=s.findSlot(a);if(!h)throw new Error(`Couldn't find slot ${a} for skin ${o.name}.`);let c=o.attachments[a];for(let u in c){let d=this.readAttachment(c[u],n,h.index,u,s);d&&n.setAttachment(h.index,u,d)}}s.skins.push(n),n.name=="default"&&(s.defaultSkin=n)}for(let l=0,o=this.linkedMeshes.length;l<o;l++){let n=this.linkedMeshes[l],a=n.skin?s.findSkin(n.skin):s.defaultSkin;if(!a)throw new Error(`Skin not found: ${n.skin}`);let h=a.getAttachment(n.slotIndex,n.parent);if(!h)throw new Error(`Parent mesh not found: ${n.parent}`);n.mesh.timelineAttachment=n.inheritTimeline?h:n.mesh,n.mesh.setParentMesh(h),n.mesh.region!=null&&n.mesh.updateRegion()}if(this.linkedMeshes.length=0,r.events)for(let l in r.events){let o=r.events[l],n=new He(l);n.intValue=A(o,"int",0),n.floatValue=A(o,"float",0),n.stringValue=A(o,"string",""),n.audioPath=A(o,"audio",null),n.audioPath&&(n.volume=A(o,"volume",1),n.balance=A(o,"balance",0)),s.events.push(n)}if(r.animations)for(let l in r.animations){let o=r.animations[l];this.readAnimation(o,l,s)}return s}readAttachment(e,t,s,r,i){let l=this.scale;switch(r=A(e,"name",r),A(e,"type","region")){case"region":{let o=A(e,"path",r),n=this.readSequence(A(e,"sequence",null)),a=this.attachmentLoader.newRegionAttachment(t,r,o,n);if(!a)return null;a.path=o,a.x=A(e,"x",0)*l,a.y=A(e,"y",0)*l,a.scaleX=A(e,"scaleX",1),a.scaleY=A(e,"scaleY",1),a.rotation=A(e,"rotation",0),a.width=e.width*l,a.height=e.height*l,a.sequence=n;let h=A(e,"color",null);return h&&a.color.setFromString(h),a.region!=null&&a.updateRegion(),a}case"boundingbox":{let o=this.attachmentLoader.newBoundingBoxAttachment(t,r);if(!o)return null;this.readVertices(e,o,e.vertexCount<<1);let n=A(e,"color",null);return n&&o.color.setFromString(n),o}case"mesh":case"linkedmesh":{let o=A(e,"path",r),n=this.readSequence(A(e,"sequence",null)),a=this.attachmentLoader.newMeshAttachment(t,r,o,n);if(!a)return null;a.path=o;let h=A(e,"color",null);h&&a.color.setFromString(h),a.width=A(e,"width",0)*l,a.height=A(e,"height",0)*l,a.sequence=n;let c=A(e,"parent",null);if(c)return this.linkedMeshes.push(new er(a,A(e,"skin",null),s,c,A(e,"timelines",!0))),a;let u=e.uvs;return this.readVertices(e,a,u.length),a.triangles=e.triangles,a.regionUVs=u,a.region!=null&&a.updateRegion(),a.edges=A(e,"edges",null),a.hullLength=A(e,"hull",0)*2,a}case"path":{let o=this.attachmentLoader.newPathAttachment(t,r);if(!o)return null;o.closed=A(e,"closed",!1),o.constantSpeed=A(e,"constantSpeed",!0);let n=e.vertexCount;this.readVertices(e,o,n<<1);let a=E.newArray(n/3,0);for(let c=0;c<e.lengths.length;c++)a[c]=e.lengths[c]*l;o.lengths=a;let h=A(e,"color",null);return h&&o.color.setFromString(h),o}case"point":{let o=this.attachmentLoader.newPointAttachment(t,r);if(!o)return null;o.x=A(e,"x",0)*l,o.y=A(e,"y",0)*l,o.rotation=A(e,"rotation",0);let n=A(e,"color",null);return n&&o.color.setFromString(n),o}case"clipping":{let o=this.attachmentLoader.newClippingAttachment(t,r);if(!o)return null;let n=A(e,"end",null);n&&(o.endSlot=i.findSlot(n));let a=e.vertexCount;this.readVertices(e,o,a<<1);let h=A(e,"color",null);return h&&o.color.setFromString(h),o}}return null}readSequence(e){if(e==null)return null;let t=new ps(A(e,"count",0));return t.start=A(e,"start",1),t.digits=A(e,"digits",0),t.setupIndex=A(e,"setup",0),t}readVertices(e,t,s){let r=this.scale;t.worldVerticesLength=s;let i=e.vertices;if(s==i.length){let n=E.toFloatArray(i);if(r!=1)for(let a=0,h=i.length;a<h;a++)n[a]*=r;t.vertices=n;return}let l=new Array,o=new Array;for(let n=0,a=i.length;n<a;){let h=i[n++];o.push(h);for(let c=n+h*4;n<c;n+=4)o.push(i[n]),l.push(i[n+1]*r),l.push(i[n+2]*r),l.push(i[n+3])}t.bones=o,t.vertices=E.toFloatArray(l)}readAnimation(e,t,s){let r=this.scale,i=new Array;if(e.slots)for(let o in e.slots){let n=e.slots[o],a=s.findSlot(o);if(!a)throw new Error("Slot not found: "+o);let h=a.index;for(let c in n){let u=n[c];if(!u)continue;let d=u.length;if(c=="attachment"){let m=new Ct(d,h);for(let f=0;f<d;f++){let p=u[f];m.setFrame(f,A(p,"time",0),A(p,"name",null))}i.push(m)}else if(c=="rgba"){let m=new xe(d,d<<2,h),f=u[0],p=A(f,"time",0),b=V.fromString(f.color);for(let w=0,g=0;;w++){m.setFrame(w,p,b.r,b.g,b.b,b.a);let x=u[w+1];if(!x){m.shrink(g);break}let y=A(x,"time",0),v=V.fromString(x.color),C=f.curve;C&&(g=W(C,m,g,w,0,p,y,b.r,v.r,1),g=W(C,m,g,w,1,p,y,b.g,v.g,1),g=W(C,m,g,w,2,p,y,b.b,v.b,1),g=W(C,m,g,w,3,p,y,b.a,v.a,1)),p=y,b=v,f=x}i.push(m)}else if(c=="rgb"){let m=new be(d,d*3,h),f=u[0],p=A(f,"time",0),b=V.fromString(f.color);for(let w=0,g=0;;w++){m.setFrame(w,p,b.r,b.g,b.b);let x=u[w+1];if(!x){m.shrink(g);break}let y=A(x,"time",0),v=V.fromString(x.color),C=f.curve;C&&(g=W(C,m,g,w,0,p,y,b.r,v.r,1),g=W(C,m,g,w,1,p,y,b.g,v.g,1),g=W(C,m,g,w,2,p,y,b.b,v.b,1)),p=y,b=v,f=x}i.push(m)}else if(c=="alpha")i.push(lt(u,new we(d,d,h),0,1));else if(c=="rgba2"){let m=new ye(d,d*7,h),f=u[0],p=A(f,"time",0),b=V.fromString(f.light),w=V.fromString(f.dark);for(let g=0,x=0;;g++){m.setFrame(g,p,b.r,b.g,b.b,b.a,w.r,w.g,w.b);let y=u[g+1];if(!y){m.shrink(x);break}let v=A(y,"time",0),C=V.fromString(y.light),S=V.fromString(y.dark),k=f.curve;k&&(x=W(k,m,x,g,0,p,v,b.r,C.r,1),x=W(k,m,x,g,1,p,v,b.g,C.g,1),x=W(k,m,x,g,2,p,v,b.b,C.b,1),x=W(k,m,x,g,3,p,v,b.a,C.a,1),x=W(k,m,x,g,4,p,v,w.r,S.r,1),x=W(k,m,x,g,5,p,v,w.g,S.g,1),x=W(k,m,x,g,6,p,v,w.b,S.b,1)),p=v,b=C,w=S,f=y}i.push(m)}else if(c=="rgb2"){let m=new ve(d,d*6,h),f=u[0],p=A(f,"time",0),b=V.fromString(f.light),w=V.fromString(f.dark);for(let g=0,x=0;;g++){m.setFrame(g,p,b.r,b.g,b.b,w.r,w.g,w.b);let y=u[g+1];if(!y){m.shrink(x);break}let v=A(y,"time",0),C=V.fromString(y.light),S=V.fromString(y.dark),k=f.curve;k&&(x=W(k,m,x,g,0,p,v,b.r,C.r,1),x=W(k,m,x,g,1,p,v,b.g,C.g,1),x=W(k,m,x,g,2,p,v,b.b,C.b,1),x=W(k,m,x,g,3,p,v,w.r,S.r,1),x=W(k,m,x,g,4,p,v,w.g,S.g,1),x=W(k,m,x,g,5,p,v,w.b,S.b,1)),p=v,b=C,w=S,f=y}i.push(m)}}}if(e.bones)for(let o in e.bones){let n=e.bones[o],a=s.findBone(o);if(!a)throw new Error("Bone not found: "+o);let h=a.index;for(let c in n){let u=n[c],d=u.length;if(d!=0){if(c==="rotate")i.push(lt(u,new Rt(d,d,h),0,1));else if(c==="translate"){let m=new oe(d,d<<1,h);i.push(ns(u,m,"x","y",0,r))}else if(c==="translatex"){let m=new le(d,d,h);i.push(lt(u,m,0,r))}else if(c==="translatey"){let m=new he(d,d,h);i.push(lt(u,m,0,r))}else if(c==="scale"){let m=new ce(d,d<<1,h);i.push(ns(u,m,"x","y",1,1))}else if(c==="scalex"){let m=new de(d,d,h);i.push(lt(u,m,1,1))}else if(c==="scaley"){let m=new ue(d,d,h);i.push(lt(u,m,1,1))}else if(c==="shear"){let m=new fe(d,d<<1,h);i.push(ns(u,m,"x","y",0,1))}else if(c==="shearx"){let m=new me(d,d,h);i.push(lt(u,m,0,1))}else if(c==="sheary"){let m=new ge(d,d,h);i.push(lt(u,m,0,1))}else if(c==="inherit"){let m=new pe(d,a.index);for(let f=0;f<u.length;f++){let p=u[f];m.setFrame(f,A(p,"time",0),E.enumValue(jt,A(p,"inherit","Normal")))}i.push(m)}}}}if(e.ik)for(let o in e.ik){let n=e.ik[o],a=n[0];if(!a)continue;let h=s.findIkConstraint(o);if(!h)throw new Error("IK Constraint not found: "+o);let c=s.ikConstraints.indexOf(h),u=new Se(n.length,n.length<<1,c),d=A(a,"time",0),m=A(a,"mix",1),f=A(a,"softness",0)*r;for(let p=0,b=0;;p++){u.setFrame(p,d,m,f,A(a,"bendPositive",!0)?1:-1,A(a,"compress",!1),A(a,"stretch",!1));let w=n[p+1];if(!w){u.shrink(b);break}let g=A(w,"time",0),x=A(w,"mix",1),y=A(w,"softness",0)*r,v=a.curve;v&&(b=W(v,u,b,p,0,d,g,m,x,1),b=W(v,u,b,p,1,d,g,f,y,r)),d=g,m=x,f=y,a=w}i.push(u)}if(e.transform)for(let o in e.transform){let n=e.transform[o],a=n[0];if(!a)continue;let h=s.findTransformConstraint(o);if(!h)throw new Error("Transform constraint not found: "+o);let c=s.transformConstraints.indexOf(h),u=new Ae(n.length,n.length*6,c),d=A(a,"time",0),m=A(a,"mixRotate",1),f=A(a,"mixX",1),p=A(a,"mixY",f),b=A(a,"mixScaleX",1),w=A(a,"mixScaleY",b),g=A(a,"mixShearY",1);for(let x=0,y=0;;x++){u.setFrame(x,d,m,f,p,b,w,g);let v=n[x+1];if(!v){u.shrink(y);break}let C=A(v,"time",0),S=A(v,"mixRotate",1),k=A(v,"mixX",1),T=A(v,"mixY",k),Y=A(v,"mixScaleX",1),M=A(v,"mixScaleY",Y),X=A(v,"mixShearY",1),F=a.curve;F&&(y=W(F,u,y,x,0,d,C,m,S,1),y=W(F,u,y,x,1,d,C,f,k,1),y=W(F,u,y,x,2,d,C,p,T,1),y=W(F,u,y,x,3,d,C,b,Y,1),y=W(F,u,y,x,4,d,C,w,M,1),y=W(F,u,y,x,5,d,C,g,X,1)),d=C,m=S,f=k,p=T,b=Y,w=M,b=Y,a=v}i.push(u)}if(e.path)for(let o in e.path){let n=e.path[o],a=s.findPathConstraint(o);if(!a)throw new Error("Path constraint not found: "+o);let h=s.pathConstraints.indexOf(a);for(let c in n){let u=n[c],d=u[0];if(!d)continue;let m=u.length;if(c==="position"){let f=new ke(m,m,h);i.push(lt(u,f,0,a.positionMode==0?r:1))}else if(c==="spacing"){let f=new Te(m,m,h);i.push(lt(u,f,0,a.spacingMode==0||a.spacingMode==1?r:1))}else if(c==="mix"){let f=new Ie(m,m*3,h),p=A(d,"time",0),b=A(d,"mixRotate",1),w=A(d,"mixX",1),g=A(d,"mixY",w);for(let x=0,y=0;;x++){f.setFrame(x,p,b,w,g);let v=u[x+1];if(!v){f.shrink(y);break}let C=A(v,"time",0),S=A(v,"mixRotate",1),k=A(v,"mixX",1),T=A(v,"mixY",k),Y=d.curve;Y&&(y=W(Y,f,y,x,0,p,C,b,S,1),y=W(Y,f,y,x,1,p,C,w,k,1),y=W(Y,f,y,x,2,p,C,g,T,1)),p=C,b=S,w=k,g=T,d=v}i.push(f)}}}if(e.physics)for(let o in e.physics){let n=e.physics[o],a=-1;if(o.length>0){let h=s.findPhysicsConstraint(o);if(!h)throw new Error("Physics constraint not found: "+o);a=s.physicsConstraints.indexOf(h)}for(let h in n){let c=n[h],u=c[0];if(!u)continue;let d=c.length;if(h=="reset"){const f=new Re(d,a);for(let p=0;u!=null;u=c[p+1],p++)f.setFrame(p,A(u,"time",0));i.push(f);continue}let m;if(h=="inertia")m=new Me(d,d,a);else if(h=="strength")m=new Ye(d,d,a);else if(h=="damping")m=new Pe(d,d,a);else if(h=="mass")m=new Xe(d,d,a);else if(h=="wind")m=new Fe(d,d,a);else if(h=="gravity")m=new Be(d,d,a);else if(h=="mix")m=new Ee(d,d,a);else continue;i.push(lt(c,m,0,1))}}if(e.attachments)for(let o in e.attachments){let n=e.attachments[o],a=s.findSkin(o);if(!a)throw new Error("Skin not found: "+o);for(let h in n){let c=n[h],u=s.findSlot(h);if(!u)throw new Error("Slot not found: "+h);let d=u.index;for(let m in c){let f=c[m],p=a.getAttachment(d,m);for(let b in f){let w=f[b],g=w[0];if(g){if(b=="deform"){let x=p.bones,y=p.vertices,v=x?y.length/3*2:y.length,C=new Ce(w.length,w.length,d,p),S=A(g,"time",0);for(let k=0,T=0;;k++){let Y,M=A(g,"vertices",null);if(!M)Y=x?E.newFloatArray(v):y;else{Y=E.newFloatArray(v);let P=A(g,"offset",0);if(E.arrayCopy(M,0,Y,P,M.length),r!=1)for(let D=P,O=D+M.length;D<O;D++)Y[D]*=r;if(!x)for(let D=0;D<v;D++)Y[D]+=y[D]}C.setFrame(k,S,Y);let X=w[k+1];if(!X){C.shrink(T);break}let F=A(X,"time",0),I=g.curve;I&&(T=W(I,C,T,k,0,S,F,0,1,1)),S=F,g=X}i.push(C)}else if(b=="sequence"){let x=new De(w.length,d,p),y=0;for(let v=0;v<w.length;v++){let C=A(g,"delay",y),S=A(g,"time",0),k=xs[A(g,"mode","hold")],T=A(g,"index",0);x.setFrame(v,S,k,T,C),y=C,g=w[v+1]}i.push(x)}}}}}}if(e.drawOrder){let o=new It(e.drawOrder.length),n=s.slots.length,a=0;for(let h=0;h<e.drawOrder.length;h++,a++){let c=e.drawOrder[h],u=null,d=A(c,"offsets",null);if(d){u=E.newArray(n,-1);let m=E.newArray(n-d.length,0),f=0,p=0;for(let b=0;b<d.length;b++){let w=d[b],g=s.findSlot(w.slot);if(!g)throw new Error("Slot not found: "+g);let x=g.index;for(;f!=x;)m[p++]=f++;u[f+w.offset]=f++}for(;f<n;)m[p++]=f++;for(let b=n-1;b>=0;b--)u[b]==-1&&(u[b]=m[--p])}o.setFrame(a,A(c,"time",0),u)}i.push(o)}if(e.events){let o=new Wt(e.events.length),n=0;for(let a=0;a<e.events.length;a++,n++){let h=e.events[a],c=s.findEvent(h.name);if(!c)throw new Error("Event not found: "+h.name);let u=new Ge(E.toSinglePrecision(A(h,"time",0)),c);u.intValue=A(h,"int",c.intValue),u.floatValue=A(h,"float",c.floatValue),u.stringValue=A(h,"string",c.stringValue),u.data.audioPath&&(u.volume=A(h,"volume",1),u.balance=A(h,"balance",0)),o.setFrame(n,u)}i.push(o)}let l=0;for(let o=0,n=i.length;o<n;o++)l=Math.max(l,i[o].getDuration());s.animations.push(new Ut(t,i,l))}},er=class{parent;skin;slotIndex;mesh;inheritTimeline;constructor(e,t,s,r,i){this.mesh=e,this.skin=t,this.slotIndex=s,this.parent=r,this.inheritTimeline=i}};function lt(e,t,s,r){let i=e[0],l=A(i,"time",0),o=A(i,"value",s)*r,n=0;for(let a=0;;a++){t.setFrame(a,l,o);let h=e[a+1];if(!h)return t.shrink(n),t;let c=A(h,"time",0),u=A(h,"value",s)*r;i.curve&&(n=W(i.curve,t,n,a,0,l,c,o,u,r)),l=c,o=u,i=h}}function ns(e,t,s,r,i,l){let o=e[0],n=A(o,"time",0),a=A(o,s,i)*l,h=A(o,r,i)*l,c=0;for(let u=0;;u++){t.setFrame(u,n,a,h);let d=e[u+1];if(!d)return t.shrink(c),t;let m=A(d,"time",0),f=A(d,s,i)*l,p=A(d,r,i)*l,b=o.curve;b&&(c=W(b,t,c,u,0,n,m,a,f,l),c=W(b,t,c,u,1,n,m,h,p,l)),n=m,a=f,h=p,o=d}}function W(e,t,s,r,i,l,o,n,a,h){if(e=="stepped")return t.setStepped(r),s;let c=i<<2,u=e[c],d=e[c+1]*h,m=e[c+2],f=e[c+3]*h;return t.setBezier(s,r,i,l,n,u,d,m,f,o,a),s+1}function A(e,t,s){return e[t]!==void 0?e[t]:s}typeof Math.fround>"u"&&(Math.fround=function(e){return function(t){return e[0]=t,e[0]}}(new Float32Array(1)));var as=class xt extends Ue{static textureMap=new Map;static from(t){return xt.textureMap.has(t)?xt.textureMap.get(t):new xt(t)}texture;constructor(t){super(t.resource),this.texture=ui.Texture.from(t)}setFilters(t,s){const r=this.texture.source.style;r.minFilter=xt.toPixiTextureFilter(t),r.magFilter=xt.toPixiTextureFilter(s),this.texture.source.autoGenerateMipmaps=xt.toPixiMipMap(t),this.texture.source.updateMipmaps()}setWraps(t,s){const r=this.texture.source.style;r.addressModeU=xt.toPixiTextureWrap(t),r.addressModeV=xt.toPixiTextureWrap(s)}dispose(){this.texture.destroy()}static toPixiMipMap(t){switch(t){case 9728:case 9729:return!1;case 9986:case 9984:case 9987:case 9985:return!0;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureFilter(t){switch(t){case 9728:case 9986:case 9984:return"nearest";case 9729:case 9987:case 9985:return"linear";default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case 33071:return"clamp-to-edge";case 33648:return"mirror-repeat";case 10497:return"repeat";default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case 0:return"normal";case 1:return"add";case 2:return"multiply";case 3:return"screen";default:throw new Error(`Unknown blendMode: ${String(t)}`)}}},sr={extension:K.ExtensionType.Asset,resolver:{test:e=>(0,K.checkExtension)(e,".atlas"),parse:e=>{const t=e.split(".");return{resolution:parseFloat(K.Resolver.RETINA_PREFIX?.exec(e)?.[1]??"1"),format:t[t.length-2],src:e}}},loader:{extension:{type:K.ExtensionType.LoadParser,priority:K.LoaderParserPriority.Normal,name:"spineTextureAtlasLoader"},test(e){return(0,K.checkExtension)(e,".atlas")},async load(e){return await(await K.DOMAdapter.get().fetch(e)).text()},testParse(e,t){const s=(0,K.checkExtension)(t.src,".atlas"),r=typeof e=="string";return Promise.resolve(s&&r)},unload(e){e.dispose()},async parse(e,t,s){const r=t.data||{};let i=K.path.dirname(t.src);i&&i.lastIndexOf("/")!==i.length-1&&(i+="/");const l=new $t(e);if(r.images instanceof K.TextureSource||typeof r.images=="string"){const n=r.images;r.images={},r.images[l.pages[0].name]=n}const o=[];for(const n of l.pages){const a=n.name,h=r?.images?r.images[a]:void 0;if(h instanceof K.TextureSource)n.setTexture(as.from(h));else{const c=h??K.path.normalize([...i.split(K.path.sep),a].join(K.path.sep)),u={src:(0,K.copySearchParams)(c,t.src),data:{...r.imageMetadata,alphaMode:n.pma?"premultiplied-alpha":"premultiply-alpha-on-upload"}},d=s.load(u).then(m=>{n.setTexture(as.from(m.source))});o.push(d)}}return await Promise.all(o),l}}};K.extensions.add(sr);var wt=pt("pixi.js");function ir(e){return Object.prototype.hasOwnProperty.call(e,"bones")}function rr(e){return e instanceof Uint8Array}var nr={extension:wt.ExtensionType.Asset,loader:{extension:{type:wt.ExtensionType.LoadParser,priority:wt.LoaderParserPriority.Normal,name:"spineSkeletonLoader"},test(e){return(0,wt.checkExtension)(e,".skel")},async load(e){const t=await wt.DOMAdapter.get().fetch(e);return new Uint8Array(await t.arrayBuffer())},testParse(e,t){const s=(0,wt.checkExtension)(t.src,".json")&&ir(e),r=(0,wt.checkExtension)(t.src,".skel")&&rr(e);return Promise.resolve(s||r)}}};wt.extensions.add(nr);var Kt=pt("pixi.js"),At=pt("pixi.js"),ar=new Float32Array(1),or=new Uint32Array(1),lr=class extends At.Geometry{constructor(){const t=new At.Buffer({data:ar,label:"attribute-batch-buffer",usage:At.BufferUsage.VERTEX|At.BufferUsage.COPY_DST,shrinkToFit:!1}),s=new At.Buffer({data:or,label:"index-batch-buffer",usage:At.BufferUsage.INDEX|At.BufferUsage.COPY_DST,shrinkToFit:!1}),r=7*4;super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:r,offset:0},aUV:{buffer:t,format:"float32x2",stride:r,offset:2*4},aColor:{buffer:t,format:"unorm8x4",stride:r,offset:4*4},aDarkColor:{buffer:t,format:"unorm8x4",stride:r,offset:5*4},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:r,offset:6*4}},indexBuffer:s})}},gt=pt("pixi.js"),hr={name:"color-bit",vertex:{header:`
|
|
3
3
|
@in aDarkColor: vec4<f32>;
|
|
4
4
|
@out vDarkColor: vec4<f32>;
|
|
5
5
|
`,main:`
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
finalColor = vec4<f32>(rgb, alpha);
|
|
15
15
|
|
|
16
|
-
`}},
|
|
16
|
+
`}},cr={name:"color-bit",vertex:{header:`
|
|
17
17
|
in vec4 aDarkColor;
|
|
18
18
|
out vec4 vDarkColor;
|
|
19
19
|
`,main:`
|
|
@@ -24,4 +24,4 @@
|
|
|
24
24
|
|
|
25
25
|
finalColor.a = outColor.a * vColor.a;
|
|
26
26
|
finalColor.rgb = ((outColor.a - 1.0) * vDarkColor.a + 1.0 - outColor.rgb) * vDarkColor.rgb + outColor.rgb * vColor.rgb;
|
|
27
|
-
`}},li=class extends pe.Shader{constructor(e){const t=(0,pe.compileHighShaderGlProgram)({name:"dark-tint-batch",bits:[pe.colorBitGl,oi,(0,pe.generateTextureBatchBitGl)(e),pe.roundPixelsBitGl]}),s=(0,pe.compileHighShaderGpuProgram)({name:"dark-tint-batch",bits:[pe.colorBit,ai,(0,pe.generateTextureBatchBit)(e),pe.roundPixelsBit]});super({glProgram:t,gpuProgram:s,resources:{batchSamplers:(0,pe.getBatchSamplersUniformGroup)(e)}})}},Hs=null,$s=class extends dt.Batcher{geometry=new ni;shader=Hs||(Hs=new li(this.maxTextures));name=$s.extension.name;vertexSize=7;packAttributes(e,t,s,r,n){const h=n<<16|e.roundPixels&65535,a=e.transform,i=a.a,l=a.b,o=a.c,c=a.d,d=a.tx,f=a.ty,{positions:u,uvs:m}=e,p=e.color,w=(p>>24&255)/255,b=dt.Color.shared.setValue(e.darkColor).premultiply(w,!0).toPremultiplied(1,!1),g=e.attributeOffset,x=g+e.attributeSize;for(let v=g;v<x;v++){const y=v*2,C=u[y],S=u[y+1];t[r++]=i*C+o*S+d,t[r++]=c*S+l*C+f,t[r++]=m[y],t[r++]=m[y+1],s[r++]=p,s[r++]=b,s[r++]=h}}packQuadAttributes(e,t,s,r,n){const h=e.texture,a=e.transform,i=a.a,l=a.b,o=a.c,c=a.d,d=a.tx,f=a.ty,u=e.bounds,m=u.maxX,p=u.minX,w=u.maxY,b=u.minY,g=h.uvs,x=e.color,v=e.darkColor,y=n<<16|e.roundPixels&65535;t[r+0]=i*p+o*b+d,t[r+1]=c*b+l*p+f,t[r+2]=g.x0,t[r+3]=g.y0,s[r+4]=x,s[r+5]=v,s[r+6]=y,t[r+7]=i*m+o*b+d,t[r+8]=c*b+l*m+f,t[r+9]=g.x1,t[r+10]=g.y1,s[r+11]=x,s[r+12]=v,s[r+13]=y,t[r+14]=i*m+o*w+d,t[r+15]=c*w+l*m+f,t[r+16]=g.x2,t[r+17]=g.y2,s[r+18]=x,s[r+19]=v,s[r+20]=y,t[r+21]=i*p+o*w+d,t[r+22]=c*w+l*p+f,t[r+23]=g.x3,t[r+24]=g.y3,s[r+25]=x,s[r+26]=v,s[r+27]=y}},js=$s;R(js,"extension",{type:[dt.ExtensionType.Batcher],name:"darkTint"}),dt.extensions.add(js);var Ge=xe("pixi.js"),hi=class{indexOffset=0;attributeOffset=0;indexSize;attributeSize;batcherName="darkTint";topology="triangle-list";packAsQuad=!1;renderable;positions;indices;uvs;roundPixels;data;blendMode;darkTint;texture;transform;_textureId;_attributeStart;_indexStart;_batcher;_batch;get color(){const e=this.data.color,t=this.renderable.groupColor,s=this.renderable.groupAlpha;let r;const n=e.a*s*255;if(t!==16777215){const h=t>>16&255,a=t>>8&255,i=t&255,l=e.r*i,o=e.g*a,c=e.b*h;r=n<<24|c<<16|o<<8|l}else r=n<<24|e.b*255<<16|e.g*255<<8|e.r*255;return r}get darkColor(){const e=this.data.darkColor;return e.b*255<<16|e.g*255<<8|e.r*255}get groupTransform(){return this.renderable.groupTransform}setData(e,t,s,r){if(this.renderable=e,this.transform=e.groupTransform,this.data=t,t.clipped){const n=t.clippedData;this.indexSize=n.indicesCount,this.attributeSize=n.vertexCount,this.positions=n.vertices,this.indices=n.indices,this.uvs=n.uvs}else this.indexSize=t.indices.length,this.attributeSize=t.vertices.length/2,this.positions=t.vertices,this.indices=t.indices,this.uvs=t.uvs;this.texture=t.texture,this.roundPixels=r,this.blendMode=s,this.batcherName=t.darkTint?"darkTint":"default"}},ci={0:"normal",1:"add",2:"multiply",3:"screen"},us=class{renderer;gpuSpineData={};_destroyRenderableBound=this.destroyRenderable.bind(this);constructor(e){this.renderer=e}validateRenderable(e){if(e._validateAndTransformAttachments(),e.spineAttachmentsDirty)return!0;if(e.spineTexturesDirty){const t=e.skeleton.drawOrder,s=this.gpuSpineData[e.uid];for(let r=0,n=t.length;r<n;r++){const h=t[r],a=h.getAttachment();if(a instanceof N||a instanceof le){const i=e._getCachedData(h,a),l=s.slotBatches[i.id],o=i.texture;if(o!==l.texture&&!l._batcher.checkAndUpdateTexture(l,o))return!0}}}return!1}addRenderable(e,t){const s=this._getSpineData(e),r=this.renderer.renderPipes.batch,n=e.skeleton.drawOrder,h=this.renderer._roundPixels|e._roundPixels;e._validateAndTransformAttachments(),e.spineAttachmentsDirty=!1,e.spineTexturesDirty=!1;for(let a=0,i=n.length;a<i;a++){const l=n[a],o=l.getAttachment(),c=ci[l.data.blendMode];if(o instanceof N||o instanceof le){const f=e._getCachedData(l,o),u=s.slotBatches[f.id]||=new hi;u.setData(e,f,c,h),f.skipRender||r.addToBatch(u,t)}const d=e._slotsObject[l.data.name];if(d){const f=d.container;f.includeInBuild=!0,(0,Ge.collectAllRenderables)(f,t,this.renderer),f.includeInBuild=!1}}}updateRenderable(e){const t=this.gpuSpineData[e.uid];e._validateAndTransformAttachments(),e.spineAttachmentsDirty=!1,e.spineTexturesDirty=!1;const s=e.skeleton.drawOrder;for(let r=0,n=s.length;r<n;r++){const h=s[r],a=h.getAttachment();if((a instanceof N||a instanceof le)&&!e._getCachedData(h,a).skipRender){const l=t.slotBatches[e._getCachedData(h,a).id];l._batcher?.updateElement(l)}}}destroyRenderable(e){this.gpuSpineData[e.uid]=null,e.off("destroyed",this._destroyRenderableBound)}destroy(){this.gpuSpineData=null,this.renderer=null}_getSpineData(e){return this.gpuSpineData[e.uid]||this._initMeshData(e)}_initMeshData(e){return this.gpuSpineData[e.uid]={slotBatches:{}},e.on("destroyed",this._destroyRenderableBound),this.gpuSpineData[e.uid]}};R(us,"extension",{type:[Ge.ExtensionType.WebGLPipes,Ge.ExtensionType.WebGPUPipes,Ge.ExtensionType.CanvasPipes],name:"spine"}),Ge.extensions.add(us);var ne=xe("pixi.js"),ft=new Ve;Se.yDown=!0;var _e=new De,di=class{constructor(e,t,s,r){this.x=e,this.y=t,this.width=s,this.height=r}calculateBounds(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},fi=class{constructor(e=!1){this.clipping=e}calculateBounds(e){if(!e.skeleton)return{x:0,y:0,width:0,height:0};const t=new Se(e.skeleton.data);t.setToSetupPose(),t.updateWorldTransform(2);const s=t.getBoundsRect(this.clipping?new De:void 0);return s.width==Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:s}},ui=class{constructor(e,t=[],s=.05,r=!1){this.animation=e,this.skins=t,this.timeStep=s,this.clipping=r}calculateBounds(e){if(!e.skeleton||!e.state)return{x:0,y:0,width:0,height:0};const t=new tt(e.state.data),s=new Se(e.skeleton.data),r=this.clipping?new De:void 0,n=s.data;if(this.skins.length>0){let a=new ze("custom-skin");for(const i of this.skins){const l=n.findSkin(i);l!=null&&a.addSkin(l)}s.setSkin(a)}s.setToSetupPose();const h=this.animation!=null?n.findAnimation(this.animation):null;if(h==null){s.updateWorldTransform(2);const a=s.getBoundsRect(r);return a.width==Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:a}else{let a=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;t.clearTracks(),t.setAnimationWith(0,h,!1);const c=Math.max(h.duration/this.timeStep,1);for(let f=0;f<c;f++){const u=f>0?this.timeStep:0;t.update(u),t.apply(s),s.update(u),s.updateWorldTransform(2);const m=s.getBoundsRect(r);a=Math.min(a,m.x),i=Math.min(i,m.y),l=Math.max(l,m.x+m.width),o=Math.max(o,m.y+m.height)}const d={x:a,y:i,width:l-a,height:o-i};return d.width==Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:d}}},Js=new Be(()=>new ne.Graphics),ms=class extends ne.ViewContainer{batched=!0;buildId=0;renderPipeId="spine";_didSpineUpdate=!1;beforeUpdateWorldTransforms=()=>{};afterUpdateWorldTransforms=()=>{};skeleton;state;skeletonBounds;darkTint=!1;_debug=void 0;_slotsObject=Object.create(null);clippingSlotToPixiMasks=Object.create(null);getSlotFromRef(e){let t;if(typeof e=="number"?t=this.skeleton.slots[e]:typeof e=="string"?t=this.skeleton.findSlot(e):t=e,!t)throw new Error(`No slot found with the given slot reference: ${e}`);return t}spineAttachmentsDirty=!0;spineTexturesDirty=!0;_lastAttachments=[];_stateChanged=!0;attachmentCacheData=[];get debug(){return this._debug}set debug(e){this._debug&&this._debug.unregisterSpine(this),e&&e.registerSpine(this),this._debug=e}_autoUpdate=!0;get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e?ne.Ticker.shared.add(this.internalUpdate,this):ne.Ticker.shared.remove(this.internalUpdate,this),this._autoUpdate=e}_boundsProvider;get boundsProvider(){return this._boundsProvider}set boundsProvider(e){this._boundsProvider=e,e&&(this._boundsDirty=!1),this.updateBounds()}hasNeverUpdated=!0;constructor(e){e instanceof We&&(e={skeletonData:e}),super({});const t=e instanceof We?e:e.skeletonData;this.skeleton=new Se(t),this.state=new tt(new Xs(t)),this.autoUpdate=e?.autoUpdate??!0,this.darkTint=e?.darkTint===void 0?this.skeleton.slots.some(r=>!!r.data.darkColor):e?.darkTint;const s=this.skeleton.slots;for(let r=0;r<s.length;r++)this.attachmentCacheData[r]=Object.create(null);this._boundsProvider=e.boundsProvider}update(e){this.internalUpdate(0,e)}internalUpdate(e,t){this._updateAndApplyState(t??ne.Ticker.shared.deltaMS/1e3)}get bounds(){return this._boundsDirty&&this.updateBounds(),this._bounds}setBonePosition(e,t){const s=e;if(typeof e=="string"&&(e=this.skeleton.findBone(e)),!e)throw Error(`Cant set bone position, bone ${String(s)} not found`);if(ft.set(t.x,t.y),e.parent){const r=e.parent.worldToLocal(ft);e.x=r.x,e.y=-r.y}else e.x=ft.x,e.y=ft.y}getBonePosition(e,t){const s=e;return typeof e=="string"&&(e=this.skeleton.findBone(e)),e?(t||(t={x:0,y:0}),t.x=e.worldX,t.y=e.worldY,t):(console.error(`Cant set bone position! Bone ${String(s)} not found`),t)}_updateAndApplyState(e){this.hasNeverUpdated=!1,this.state.update(e),this.skeleton.update(e);const{skeleton:t}=this;this.state.apply(t),this.beforeUpdateWorldTransforms(this),t.updateWorldTransform(2),this.afterUpdateWorldTransforms(this),this.updateSlotObjects(),this._stateChanged=!0,this.onViewUpdate()}_validateAndTransformAttachments(){this._stateChanged&&(this._stateChanged=!1,this.validateAttachments(),this.transformAttachments())}validateAttachments(){const e=this.skeleton.drawOrder,t=this._lastAttachments;let s=0,r=!1;for(let n=0;n<e.length;n++){const a=e[n].getAttachment();a&&(a!==t[s]&&(r=!0,t[s]=a),s++)}s!==t.length&&(r=!0,t.length=s),this.spineAttachmentsDirty||=r}currentClippingSlot;updateAndSetPixiMask(e,t){const s=e.attachment;if(s&&s instanceof ve){const h=this.clippingSlotToPixiMasks[e.data.name]||={slot:e,vertices:new Array};h.maskComputed=!1,this.currentClippingSlot=this.clippingSlotToPixiMasks[e.data.name];return}let r=this.currentClippingSlot,n=this._slotsObject[e.data.name];if(r&&n){let h=r.slot,a=h.attachment,i=r.mask;if(i||(i=Js.obtain(),r.mask=i,this.addChild(i)),!r.maskComputed){r.maskComputed=!0;const l=a.worldVerticesLength,o=r.vertices;a.computeWorldVertices(h,0,l,o,0,2),i.clear().poly(o).stroke({width:0}).fill({alpha:.25})}n.container.mask=i}else n?.container.mask&&(n.container.mask=null);if(r&&r.slot.attachment.endSlot==e.data&&(this.currentClippingSlot=void 0),t){for(const h in this.clippingSlotToPixiMasks){const a=this.clippingSlotToPixiMasks[h];(!(a.slot.attachment instanceof ve)||!a.maskComputed)&&a.mask&&(this.removeChild(a.mask),Js.free(a.mask),a.mask=void 0)}this.currentClippingSlot=void 0}}transformAttachments(){const e=this.skeleton.drawOrder;for(let t=0;t<e.length;t++){const s=e[t];this.updateAndSetPixiMask(s,t===e.length-1);const r=s.getAttachment();if(r){if(r instanceof le||r instanceof N){const n=this._getCachedData(s,r);r instanceof N?r.computeWorldVertices(s,n.vertices,0,2):r.computeWorldVertices(s,0,r.worldVerticesLength,n.vertices,0,2),n.uvs.length<r.uvs.length&&(n.uvs=new Float32Array(r.uvs.length)),(0,ne.fastCopy)(r.uvs.buffer,n.uvs.buffer);const a=s.bone.skeleton.color,i=s.color,l=r.color;n.color.set(a.r*i.r*l.r,a.g*i.g*l.g,a.b*i.b*l.b,a.a*i.a*l.a),s.darkColor&&n.darkColor.setFromColor(s.darkColor),n.skipRender=n.clipped=!1;const o=r.region?.texture.texture||ne.Texture.EMPTY;n.texture!==o&&(n.texture=o,this.spineTexturesDirty=!0),_e.isClipping()&&this.updateClippingData(n)}else if(r instanceof ve){_e.clipStart(s,r);continue}}_e.clipEndWithSlot(s)}_e.clipEnd()}updateClippingData(e){e.clipped=!0,_e.clipTrianglesUnpacked(e.vertices,e.indices,e.indices.length,e.uvs);const{clippedVertices:t,clippedUVs:s,clippedTriangles:r}=_e,n=t.length/2,h=r.length;e.clippedData||(e.clippedData={vertices:new Float32Array(n*2),uvs:new Float32Array(n*2),vertexCount:n,indices:new Uint16Array(h),indicesCount:h},this.spineAttachmentsDirty=!0);const a=e.clippedData,i=a.vertexCount!==n||h!==a.indicesCount;e.skipRender=n===0,i&&(this.spineAttachmentsDirty=!0,a.vertexCount<n&&(a.vertices=new Float32Array(n*2),a.uvs=new Float32Array(n*2)),a.indices.length<h&&(a.indices=new Uint16Array(h)));const{vertices:l,uvs:o,indices:c}=a;for(let d=0;d<n;d++)l[d*2]=t[d*2],l[d*2+1]=t[d*2+1],o[d*2]=s[d*2],o[d*2+1]=s[d*2+1];a.vertexCount=n;for(let d=0;d<h;d++)c[d]!==r[d]&&(this.spineAttachmentsDirty=!0,c[d]=r[d]);a.indicesCount=h}updateSlotObjects(){for(const e in this._slotsObject){const t=this._slotsObject[e];t&&this.updateSlotObject(t)}}updateSlotObject(e){const{slot:t,container:s}=e,r=e.followAttachmentTimeline?Boolean(t.attachment):!0;if(s.visible=this.skeleton.drawOrder.includes(t)&&r,s.visible){let n=t.bone;s.position.set(n.worldX,n.worldY),s.angle=n.getWorldRotationX();let h=1,a=1;for(;n;)h*=n.scaleX,a*=n.scaleY,n=n.parent;h<0&&(s.angle-=180),s.scale.set(t.bone.getWorldScaleX()*Math.sign(h),t.bone.getWorldScaleY()*Math.sign(a)),s.alpha=this.skeleton.color.a*t.color.a}}_getCachedData(e,t){return this.attachmentCacheData[e.data.index][t.name]||this.initCachedData(e,t)}initCachedData(e,t){let s;return t instanceof N?(s=new Float32Array(8),this.attachmentCacheData[e.data.index][t.name]={id:`${e.data.index}-${t.name}`,vertices:s,clipped:!1,indices:[0,1,2,0,2,3],uvs:new Float32Array(t.uvs.length),color:new L(1,1,1,1),darkColor:new L(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:t.region?.texture.texture}):(s=new Float32Array(t.worldVerticesLength),this.attachmentCacheData[e.data.index][t.name]={id:`${e.data.index}-${t.name}`,vertices:s,clipped:!1,indices:t.triangles,uvs:new Float32Array(t.uvs.length),color:new L(1,1,1,1),darkColor:new L(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:t.region?.texture.texture}),this.attachmentCacheData[e.data.index][t.name]}onViewUpdate(){if(this._didViewChangeTick++,this._boundsProvider||(this._boundsDirty=!0),this.didViewUpdate)return;this.didViewUpdate=!0;const e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this),this.debug?.renderDebug(this)}addSlotObject(e,t,s){e=this.getSlotFromRef(e);for(const n in this._slotsObject)this._slotsObject[n]?.container===t&&this.removeSlotObject(this._slotsObject[n].slot);this.removeSlotObject(e),t.includeInBuild=!1,this.addChild(t);const r={container:t,slot:e,followAttachmentTimeline:s?.followAttachmentTimeline||!1};this._slotsObject[e.data.name]=r,this.updateSlotObject(r)}removeSlotObject(e){let t;if(e instanceof ne.Container){for(const s in this._slotsObject)if(this._slotsObject[s]?.container===e){this._slotsObject[s]=null,t=e;break}}else{const s=this.getSlotFromRef(e);t=this._slotsObject[s.data.name]?.container,this._slotsObject[s.data.name]=null}t&&(this.removeChild(t),t.includeInBuild=!0)}removeSlotObjects(){Object.entries(this._slotsObject).forEach(([e,t])=>{t&&t.container.removeFromParent(),delete this._slotsObject[e]})}getSlotObject(e){return e=this.getSlotFromRef(e),this._slotsObject[e.data.name]?.container}updateBounds(){this._boundsDirty=!1,this.skeletonBounds||=new ds;const e=this.skeletonBounds;if(e.update(this.skeleton,!0),this._boundsProvider){const t=this._boundsProvider.calculateBounds(this),s=this._bounds;s.clear(),s.x=t.x,s.y=t.y,s.width=t.width,s.height=t.height}else if(e.minX===1/0){this.hasNeverUpdated&&(this._updateAndApplyState(0),this._boundsDirty=!1),this._validateAndTransformAttachments();const t=this.skeleton.drawOrder,s=this._bounds;s.clear();for(let r=0;r<t.length;r++){const n=t[r],h=n.getAttachment();if(h&&(h instanceof N||h instanceof le)){const a=this._getCachedData(n,h);s.addVertexData(a.vertices,0,a.vertices.length)}}}else this._bounds.minX=e.minX,this._bounds.minY=e.minY,this._bounds.maxX=e.maxX,this._bounds.maxY=e.maxY}addBounds(e){e.addBounds(this.bounds)}destroy(e=!1){super.destroy(e),ne.Ticker.shared.remove(this.internalUpdate,this),this.state.clearListeners(),this.debug=void 0,this.skeleton=null,this.state=null,this._slotsObject=null,this._lastAttachments.length=0,this.attachmentCacheData=null}skeletonToPixiWorldCoordinates(e){this.worldTransform.apply(e,e)}pixiWorldCoordinatesToSkeleton(e){this.worldTransform.applyInverse(e,e)}pixiWorldCoordinatesToBone(e,t){this.pixiWorldCoordinatesToSkeleton(e),t.parent?t.parent.worldToLocal(e):t.worldToLocal(e)}static from({skeleton:e,atlas:t,scale:s=1,darkTint:r,autoUpdate:n=!0,boundsProvider:h}){const a=`${e}-${t}-${s}`;if(ne.Cache.has(a))return new ms({skeletonData:ne.Cache.get(a),darkTint:r,autoUpdate:n,boundsProvider:h});const i=ne.Assets.get(e),l=ne.Assets.get(t),o=new _s(l),c=i instanceof Uint8Array?new Ws(o):new Gs(o);c.scale=s;const d=c.readSkeletonData(i);return ne.Cache.set(a,d),new ms({skeletonData:d,darkTint:r,autoUpdate:n,boundsProvider:h})}},se=xe("pixi.js"),mi=class{registeredSpines=new Map;drawMeshHull=!0;drawMeshTriangles=!0;drawBones=!0;drawPaths=!0;drawBoundingBoxes=!0;drawClipping=!0;drawRegionAttachments=!0;drawEvents=!0;lineWidth=1;regionAttachmentsColor=30975;meshHullColor=30975;meshTrianglesColor=16763904;clippingPolygonColor=16711935;boundingBoxesRectColor=65280;boundingBoxesPolygonColor=65280;boundingBoxesCircleColor=65280;pathsCurveColor=16711680;pathsLineColor=16711935;skeletonXYColor=16711680;bonesColor=61132;eventFontSize=24;eventFontColor=0;registerSpine(e){if(this.registeredSpines.has(e)){console.warn("SpineDebugRenderer.registerSpine() - this spine is already registered!",e);return}const t={parentDebugContainer:new se.Container,bones:new se.Container,skeletonXY:new se.Graphics,regionAttachmentsShape:new se.Graphics,meshTrianglesLine:new se.Graphics,meshHullLine:new se.Graphics,clippingPolygon:new se.Graphics,boundingBoxesRect:new se.Graphics,boundingBoxesCircle:new se.Graphics,boundingBoxesPolygon:new se.Graphics,pathsCurve:new se.Graphics,pathsLine:new se.Graphics,eventText:new se.Container,eventCallback:{event:(s,r)=>{if(this.drawEvents){const n=Math.abs(e.scale.x||e.scale.y||1),h=new se.Text({text:r.data.name,style:{fontSize:this.eventFontSize/n,fill:this.eventFontColor,fontFamily:"monospace"}});h.scale.x=Math.sign(e.scale.x),h.anchor.set(.5),t.eventText.addChild(h),setTimeout(()=>{h.destroyed||h.destroy()},250)}}}};t.parentDebugContainer.addChild(t.bones),t.parentDebugContainer.addChild(t.skeletonXY),t.parentDebugContainer.addChild(t.regionAttachmentsShape),t.parentDebugContainer.addChild(t.meshTrianglesLine),t.parentDebugContainer.addChild(t.meshHullLine),t.parentDebugContainer.addChild(t.clippingPolygon),t.parentDebugContainer.addChild(t.boundingBoxesRect),t.parentDebugContainer.addChild(t.boundingBoxesCircle),t.parentDebugContainer.addChild(t.boundingBoxesPolygon),t.parentDebugContainer.addChild(t.pathsCurve),t.parentDebugContainer.addChild(t.pathsLine),t.parentDebugContainer.addChild(t.eventText),t.parentDebugContainer.zIndex=9999999,t.parentDebugContainer.accessibleChildren=!1,t.parentDebugContainer.eventMode="none",t.parentDebugContainer.interactiveChildren=!1,e.addChild(t.parentDebugContainer),e.state.addListener(t.eventCallback),this.registeredSpines.set(e,t)}renderDebug(e){this.registeredSpines.has(e)||this.registerSpine(e);const t=this.registeredSpines.get(e);if(!t)return;e.addChild(t.parentDebugContainer),t.skeletonXY.clear(),t.regionAttachmentsShape.clear(),t.meshTrianglesLine.clear(),t.meshHullLine.clear(),t.clippingPolygon.clear(),t.boundingBoxesRect.clear(),t.boundingBoxesCircle.clear(),t.boundingBoxesPolygon.clear(),t.pathsCurve.clear(),t.pathsLine.clear();for(let n=t.bones.children.length;n>0;n--)t.bones.children[n-1].destroy({children:!0,texture:!0,textureSource:!0});const s=Math.abs(e.scale.x||e.scale.y||1),r=this.lineWidth/s;if(this.drawBones&&this.drawBonesFunc(e,t,r,s),this.drawPaths&&this.drawPathsFunc(e,t,r),this.drawBoundingBoxes&&this.drawBoundingBoxesFunc(e,t,r),this.drawClipping&&this.drawClippingFunc(e,t,r),(this.drawMeshHull||this.drawMeshTriangles)&&this.drawMeshHullAndMeshTriangles(e,t,r),this.drawRegionAttachments&&this.drawRegionAttachmentsFunc(e,t,r),this.drawEvents)for(const n of t.eventText.children)n.alpha-=.05,n.y-=2}drawBonesFunc(e,t,s,r){const n=e.skeleton,h=n.x,a=n.y,i=n.bones;t.skeletonXY.strokeStyle={width:s,color:this.skeletonXYColor};for(let o=0,c=i.length;o<c;o++){const d=i[o],f=d.data.length,u=h+d.worldX,m=a+d.worldY,p=h+f*d.a+d.worldX,w=a+f*d.b+d.worldY;if(d.data.name==="root"||d.data.parent===null)continue;const b=Math.abs(u-p),g=Math.abs(m-w),x=Math.pow(b,2),v=g,y=Math.pow(g,2),C=Math.sqrt(x+y),S=Math.pow(C,2),A=Math.PI/180,M=Math.acos((S+y-x)/(2*v*C))||0;if(C===0)continue;const T=new se.Graphics;t.bones.addChild(T);const F=C/50/r;T.context.poly([0,0,0-F,C-F*3,0,C-F,0+F,C-F*3]).fill(this.bonesColor),T.x=u,T.y=m,T.pivot.y=C;let P=0;u<p&&m<w?P=-M+180*A:u>p&&m<w?P=180*A+M:u>p&&m>w?P=-M:u<p&&m>w?P=M:m===w&&u<p?P=90*A:m===w&&u>p?P=-90*A:u===p&&m<w?P=180*A:u===p&&m>w&&(P=0),T.rotation=P,T.circle(0,C,F*1.2).fill({color:0,alpha:.6}).stroke({width:s+F/2.4,color:this.bonesColor})}const l=s*3;t.skeletonXY.context.moveTo(h-l,a-l).lineTo(h+l,a+l).moveTo(h+l,a-l).lineTo(h-l,a+l).stroke()}drawRegionAttachmentsFunc(e,t,s){const n=e.skeleton.slots;for(let h=0,a=n.length;h<a;h++){const i=n[h],l=i.getAttachment();if(l===null||!(l instanceof N))continue;const o=l,c=new Float32Array(8);o.computeWorldVertices(i,c,0,2),t.regionAttachmentsShape.poly(Array.from(c.slice(0,8)))}t.regionAttachmentsShape.stroke({color:this.regionAttachmentsColor,width:s})}drawMeshHullAndMeshTriangles(e,t,s){const n=e.skeleton.slots;for(let h=0,a=n.length;h<a;h++){const i=n[h];if(!i.bone.active)continue;const l=i.getAttachment();if(l===null||!(l instanceof le))continue;const o=l,c=new Float32Array(o.worldVerticesLength),d=o.triangles;let f=o.hullLength;if(o.computeWorldVertices(i,0,o.worldVerticesLength,c,0,2),this.drawMeshTriangles)for(let u=0,m=d.length;u<m;u+=3){const p=d[u]*2,w=d[u+1]*2,b=d[u+2]*2;t.meshTrianglesLine.context.moveTo(c[p],c[p+1]).lineTo(c[w],c[w+1]).lineTo(c[b],c[b+1])}if(this.drawMeshHull&&f>0){f=(f>>1)*2;let u=c[f-2],m=c[f-1];for(let p=0,w=f;p<w;p+=2){const b=c[p],g=c[p+1];t.meshHullLine.context.moveTo(b,g).lineTo(u,m),u=b,m=g}}}t.meshHullLine.stroke({width:s,color:this.meshHullColor}),t.meshTrianglesLine.stroke({width:s,color:this.meshTrianglesColor})}drawClippingFunc(e,t,s){const n=e.skeleton.slots;for(let h=0,a=n.length;h<a;h++){const i=n[h];if(!i.bone.active)continue;const l=i.getAttachment();if(l===null||!(l instanceof ve))continue;const o=l,c=o.worldVerticesLength,d=new Float32Array(c);o.computeWorldVertices(i,0,c,d,0,2),t.clippingPolygon.poly(Array.from(d))}t.clippingPolygon.stroke({width:s,color:this.clippingPolygonColor,alpha:1})}drawBoundingBoxesFunc(e,t,s){const r=new ds;r.update(e.skeleton,!0),r.minX!==1/0&&t.boundingBoxesRect.rect(r.minX,r.minY,r.getWidth(),r.getHeight()).stroke({width:s,color:this.boundingBoxesRectColor});const n=r.polygons,h=(a,i,l)=>{if(l<3)throw new Error("Polygon must contain at least 3 vertices");const o=[],c=s*2;for(let d=0,f=a.length;d<f;d+=2){const u=a[d],m=a[d+1];t.boundingBoxesCircle.beginFill(this.boundingBoxesCircleColor),t.boundingBoxesCircle.drawCircle(u,m,c),t.boundingBoxesCircle.fill(0),t.boundingBoxesCircle.circle(u,m,c).fill({color:this.boundingBoxesCircleColor}),o.push(u,m)}t.boundingBoxesPolygon.poly(o).fill({color:this.boundingBoxesPolygonColor,alpha:.1}).stroke({width:s,color:this.boundingBoxesPolygonColor})};for(let a=0,i=n.length;a<i;a++){const l=n[a];h(l,0,l.length)}}drawPathsFunc(e,t,s){const n=e.skeleton.slots;for(let h=0,a=n.length;h<a;h++){const i=n[h];if(!i.bone.active)continue;const l=i.getAttachment();if(l===null||!(l instanceof Pe))continue;const o=l;let c=o.worldVerticesLength;const d=new Float32Array(c);o.computeWorldVertices(i,0,c,d,0,2);let f=d[2],u=d[3],m=0,p=0;if(o.closed){const w=d[0],b=d[1],g=d[c-2],x=d[c-1];m=d[c-4],p=d[c-3],t.pathsCurve.moveTo(f,u),t.pathsCurve.bezierCurveTo(w,b,g,x,m,p),t.pathsLine.moveTo(f,u),t.pathsLine.lineTo(w,b),t.pathsLine.moveTo(m,p),t.pathsLine.lineTo(g,x)}c-=4;for(let w=4;w<c;w+=6){const b=d[w],g=d[w+1],x=d[w+2],v=d[w+3];m=d[w+4],p=d[w+5],t.pathsCurve.moveTo(f,u),t.pathsCurve.bezierCurveTo(b,g,x,v,m,p),t.pathsLine.moveTo(f,u),t.pathsLine.lineTo(b,g),t.pathsLine.moveTo(m,p),t.pathsLine.lineTo(x,v),f=m,u=p}}t.pathsCurve.stroke({width:s,color:this.pathsCurveColor}),t.pathsLine.stroke({width:s,color:this.pathsLineColor})}unregisterSpine(e){this.registeredSpines.has(e)||console.warn("SpineDebugRenderer.unregisterSpine() - spine is not registered, can't unregister!",e);const t=this.registeredSpines.get(e);t&&(e.state.removeListener(t.eventCallback),t.parentDebugContainer.destroy({textureSource:!0,children:!0,texture:!0}),this.registeredSpines.delete(e))}};return lr(xs)})();
|
|
27
|
+
`}},dr=class extends gt.Shader{constructor(e){const t=(0,gt.compileHighShaderGlProgram)({name:"dark-tint-batch",bits:[gt.colorBitGl,cr,(0,gt.generateTextureBatchBitGl)(e),gt.roundPixelsBitGl]}),s=(0,gt.compileHighShaderGpuProgram)({name:"dark-tint-batch",bits:[gt.colorBit,hr,(0,gt.generateTextureBatchBit)(e),gt.roundPixelsBit]});super({glProgram:t,gpuProgram:s,resources:{batchSamplers:(0,gt.getBatchSamplersUniformGroup)(e)}})}},qs=null,ur=class ni extends Kt.Batcher{static extension={type:[Kt.ExtensionType.Batcher],name:"darkTint"};geometry=new lr;shader=qs||(qs=new dr(this.maxTextures));name=ni.extension.name;vertexSize=7;packAttributes(t,s,r,i,l){const o=l<<16|t.roundPixels&65535,n=t.transform,a=n.a,h=n.b,c=n.c,u=n.d,d=n.tx,m=n.ty,{positions:f,uvs:p}=t,b=t.color,w=(b>>24&255)/255,g=Kt.Color.shared.setValue(t.darkColor).premultiply(w,!0).toPremultiplied(1,!1),x=t.attributeOffset,y=x+t.attributeSize;for(let v=x;v<y;v++){const C=v*2,S=f[C],k=f[C+1];s[i++]=a*S+c*k+d,s[i++]=u*k+h*S+m,s[i++]=p[C],s[i++]=p[C+1],r[i++]=b,r[i++]=g,r[i++]=o}}packQuadAttributes(t,s,r,i,l){const o=t.texture,n=t.transform,a=n.a,h=n.b,c=n.c,u=n.d,d=n.tx,m=n.ty,f=t.bounds,p=f.maxX,b=f.minX,w=f.maxY,g=f.minY,x=o.uvs,y=t.color,v=t.darkColor,C=l<<16|t.roundPixels&65535;s[i+0]=a*b+c*g+d,s[i+1]=u*g+h*b+m,s[i+2]=x.x0,s[i+3]=x.y0,r[i+4]=y,r[i+5]=v,r[i+6]=C,s[i+7]=a*p+c*g+d,s[i+8]=u*g+h*p+m,s[i+9]=x.x1,s[i+10]=x.y1,r[i+11]=y,r[i+12]=v,r[i+13]=C,s[i+14]=a*p+c*w+d,s[i+15]=u*w+h*p+m,s[i+16]=x.x2,s[i+17]=x.y2,r[i+18]=y,r[i+19]=v,r[i+20]=C,s[i+21]=a*b+c*w+d,s[i+22]=u*w+h*b+m,s[i+23]=x.x3,s[i+24]=x.y3,r[i+25]=y,r[i+26]=v,r[i+27]=C}};Kt.extensions.add(ur);var Nt=pt("pixi.js"),fr=class{indexOffset=0;attributeOffset=0;indexSize;attributeSize;batcherName="darkTint";topology="triangle-list";packAsQuad=!1;renderable;positions;indices;uvs;roundPixels;data;blendMode;darkTint;texture;transform;_textureId;_attributeStart;_indexStart;_batcher;_batch;get color(){const e=this.data.color,t=this.renderable.groupColor,s=this.renderable.groupAlpha;let r;const i=e.a*s*255;if(t!==16777215){const l=t>>16&255,o=t>>8&255,n=t&255,a=e.r*n,h=e.g*o,c=e.b*l;r=i<<24|c<<16|h<<8|a}else r=i<<24|e.b*255<<16|e.g*255<<8|e.r*255;return r}get darkColor(){const e=this.data.darkColor;return e.b*255<<16|e.g*255<<8|e.r*255}get groupTransform(){return this.renderable.groupTransform}setData(e,t,s,r){if(this.renderable=e,this.transform=e.groupTransform,this.data=t,t.clipped){const i=t.clippedData;this.indexSize=i.indicesCount,this.attributeSize=i.vertexCount,this.positions=i.vertices,this.indices=i.indices,this.uvs=i.uvs}else this.indexSize=t.indices.length,this.attributeSize=t.vertices.length/2,this.positions=t.vertices,this.indices=t.indices,this.uvs=t.uvs;this.texture=t.texture,this.roundPixels=r,this.blendMode=s,this.batcherName=t.darkTint?"darkTint":"default"}},mr={0:"normal",1:"add",2:"multiply",3:"screen"},Ws=class{static extension={type:[Nt.ExtensionType.WebGLPipes,Nt.ExtensionType.WebGPUPipes,Nt.ExtensionType.CanvasPipes],name:"spine"};renderer;gpuSpineData={};_destroyRenderableBound=this.destroyRenderable.bind(this);constructor(e){this.renderer=e}validateRenderable(e){if(e._validateAndTransformAttachments(),e.spineAttachmentsDirty)return!0;if(e.spineTexturesDirty){const t=e.skeleton.drawOrder,s=this.gpuSpineData[e.uid];for(let r=0,i=t.length;r<i;r++){const l=t[r],o=l.getAttachment();if(o instanceof ot||o instanceof ut){const n=e._getCachedData(l,o),a=s.slotBatches[n.id],h=n.texture;if(h!==a.texture&&!a._batcher.checkAndUpdateTexture(a,h))return!0}}}return!1}addRenderable(e,t){const s=this._getSpineData(e),r=this.renderer.renderPipes.batch,i=e.skeleton.drawOrder,l=this.renderer._roundPixels|e._roundPixels;e._validateAndTransformAttachments(),e.spineAttachmentsDirty=!1,e.spineTexturesDirty=!1;for(let o=0,n=i.length;o<n;o++){const a=i[o],h=a.getAttachment(),c=mr[a.data.blendMode];if(h instanceof ot||h instanceof ut){const d=e._getCachedData(a,h),m=s.slotBatches[d.id]||=new fr;m.setData(e,d,c,l),d.skipRender||r.addToBatch(m,t)}const u=e._slotsObject[a.data.name];if(u){const d=u.container;d.includeInBuild=!0,(0,Nt.collectAllRenderables)(d,t,this.renderer),d.includeInBuild=!1}}}updateRenderable(e){const t=this.gpuSpineData[e.uid];e._validateAndTransformAttachments(),e.spineAttachmentsDirty=!1,e.spineTexturesDirty=!1;const s=e.skeleton.drawOrder;for(let r=0,i=s.length;r<i;r++){const l=s[r],o=l.getAttachment();if((o instanceof ot||o instanceof ut)&&!e._getCachedData(l,o).skipRender){const a=t.slotBatches[e._getCachedData(l,o).id];a._batcher?.updateElement(a)}}}destroyRenderable(e){this.gpuSpineData[e.uid]=null,e.off("destroyed",this._destroyRenderableBound)}destroy(){this.gpuSpineData=null,this.renderer=null}_getSpineData(e){return this.gpuSpineData[e.uid]||this._initMeshData(e)}_initMeshData(e){return this.gpuSpineData[e.uid]={slotBatches:{}},e.on("destroyed",this._destroyRenderableBound),this.gpuSpineData[e.uid]}};Nt.extensions.add(Ws);var it=pt("pixi.js"),Qt=new Et;Yt.yDown=!0;var Pt=new Jt,gr=class{constructor(e,t,s,r){this.x=e,this.y=t,this.width=s,this.height=r}calculateBounds(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},pr=class{constructor(e=!1){this.clipping=e}calculateBounds(e){if(!e.skeleton)return{x:0,y:0,width:0,height:0};const t=new Yt(e.skeleton.data);t.setToSetupPose(),t.updateWorldTransform(2);const s=t.getBoundsRect(this.clipping?new Jt:void 0);return s.width==Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:s}},xr=class{constructor(e,t=[],s=.05,r=!1){this.animation=e,this.skins=t,this.timeStep=s,this.clipping=r}calculateBounds(e){if(!e.skeleton||!e.state)return{x:0,y:0,width:0,height:0};const t=new Le(e.state.data),s=new Yt(e.skeleton.data),r=this.clipping?new Jt:void 0,i=s.data;if(this.skins.length>0){let o=new Vt("custom-skin");for(const n of this.skins){const a=i.findSkin(n);a!=null&&o.addSkin(a)}s.setSkin(o)}s.setToSetupPose();const l=this.animation!=null?i.findAnimation(this.animation):null;if(l==null){s.updateWorldTransform(2);const o=s.getBoundsRect(r);return o.width==Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:o}else{let o=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY;t.clearTracks(),t.setAnimationWith(0,l,!1);const c=Math.max(l.duration/this.timeStep,1);for(let d=0;d<c;d++){const m=d>0?this.timeStep:0;t.update(m),t.apply(s),s.update(m),s.updateWorldTransform(2);const f=s.getBoundsRect(r);o=Math.min(o,f.x),n=Math.min(n,f.y),a=Math.max(a,f.x+f.width),h=Math.max(h,f.y+f.height)}const u={x:o,y:n,width:a-o,height:h-n};return u.width==Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:u}}},zs=new Tt(()=>new it.Graphics),br=class us extends it.ViewContainer{batched=!0;buildId=0;renderPipeId="spine";_didSpineUpdate=!1;beforeUpdateWorldTransforms=()=>{};afterUpdateWorldTransforms=()=>{};skeleton;state;skeletonBounds;darkTint=!1;_debug=void 0;_slotsObject=Object.create(null);clippingSlotToPixiMasks=Object.create(null);getSlotFromRef(t){let s;if(typeof t=="number"?s=this.skeleton.slots[t]:typeof t=="string"?s=this.skeleton.findSlot(t):s=t,!s)throw new Error(`No slot found with the given slot reference: ${t}`);return s}spineAttachmentsDirty=!0;spineTexturesDirty=!0;_lastAttachments=[];_stateChanged=!0;attachmentCacheData=[];get debug(){return this._debug}set debug(t){this._debug&&this._debug.unregisterSpine(this),t&&t.registerSpine(this),this._debug=t}_autoUpdate=!0;get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t?it.Ticker.shared.add(this.internalUpdate,this):it.Ticker.shared.remove(this.internalUpdate,this),this._autoUpdate=t}_boundsProvider;get boundsProvider(){return this._boundsProvider}set boundsProvider(t){this._boundsProvider=t,t&&(this._boundsDirty=!1),this.updateBounds()}hasNeverUpdated=!0;constructor(t){t instanceof Lt&&(t={skeletonData:t}),super({}),this.allowChildren=!0;const s=t instanceof Lt?t:t.skeletonData;this.skeleton=new Yt(s),this.state=new Le(new Ts(s)),this.autoUpdate=t?.autoUpdate??!0,this.darkTint=t?.darkTint===void 0?this.skeleton.slots.some(i=>!!i.data.darkColor):t?.darkTint;const r=this.skeleton.slots;for(let i=0;i<r.length;i++)this.attachmentCacheData[i]=Object.create(null);this._boundsProvider=t.boundsProvider}update(t){this.internalUpdate(0,t)}internalUpdate(t,s){this._updateAndApplyState(s??it.Ticker.shared.deltaMS/1e3)}get bounds(){return this._boundsDirty&&this.updateBounds(),this._bounds}setBonePosition(t,s){const r=t;if(typeof t=="string"&&(t=this.skeleton.findBone(t)),!t)throw Error(`Cant set bone position, bone ${String(r)} not found`);if(Qt.set(s.x,s.y),t.parent){const i=t.parent.worldToLocal(Qt);t.x=i.x,t.y=-i.y}else t.x=Qt.x,t.y=Qt.y}getBonePosition(t,s){const r=t;return typeof t=="string"&&(t=this.skeleton.findBone(t)),t?(s||(s={x:0,y:0}),s.x=t.worldX,s.y=t.worldY,s):(console.error(`Cant set bone position! Bone ${String(r)} not found`),s)}_updateAndApplyState(t){this.hasNeverUpdated=!1,this.state.update(t),this.skeleton.update(t);const{skeleton:s}=this;this.state.apply(s),this.beforeUpdateWorldTransforms(this),s.updateWorldTransform(2),this.afterUpdateWorldTransforms(this),this.updateSlotObjects(),this._stateChanged=!0,this.onViewUpdate()}_validateAndTransformAttachments(){this._stateChanged&&(this._stateChanged=!1,this.validateAttachments(),this.transformAttachments())}validateAttachments(){const t=this.skeleton.drawOrder,s=this._lastAttachments;let r=0,i=!1;for(let l=0;l<t.length;l++){const n=t[l].getAttachment();n&&(n!==s[r]&&(i=!0,s[r]=n),r++)}r!==s.length&&(i=!0,s.length=r),this.spineAttachmentsDirty||=i}currentClippingSlot;updateAndSetPixiMask(t,s){const r=t.attachment;if(r&&r instanceof St){const o=this.clippingSlotToPixiMasks[t.data.name]||={slot:t,vertices:new Array};o.maskComputed=!1,this.currentClippingSlot=this.clippingSlotToPixiMasks[t.data.name];return}let i=this.currentClippingSlot,l=this._slotsObject[t.data.name];if(i&&l){let o=i.slot,n=o.attachment,a=i.mask;if(a||(a=zs.obtain(),i.mask=a,this.addChild(a)),!i.maskComputed){i.maskComputed=!0;const h=n.worldVerticesLength,c=i.vertices;n.computeWorldVertices(o,0,h,c,0,2),a.clear().poly(c).stroke({width:0}).fill({alpha:.25})}l.container.mask=a}else l?.container.mask&&(l.container.mask=null);if(i&&i.slot.attachment.endSlot==t.data&&(this.currentClippingSlot=void 0),s){for(const o in this.clippingSlotToPixiMasks){const n=this.clippingSlotToPixiMasks[o];(!(n.slot.attachment instanceof St)||!n.maskComputed)&&n.mask&&(this.removeChild(n.mask),zs.free(n.mask),n.mask=void 0)}this.currentClippingSlot=void 0}}transformAttachments(){const t=this.skeleton.drawOrder;for(let s=0;s<t.length;s++){const r=t[s];this.updateAndSetPixiMask(r,s===t.length-1);const i=r.getAttachment();if(i){if(i instanceof ut||i instanceof ot){const l=this._getCachedData(r,i);i instanceof ot?i.computeWorldVertices(r,l.vertices,0,2):i.computeWorldVertices(r,0,i.worldVerticesLength,l.vertices,0,2),l.uvs.length<i.uvs.length&&(l.uvs=new Float32Array(i.uvs.length)),(0,it.fastCopy)(i.uvs.buffer,l.uvs.buffer);const n=r.bone.skeleton.color,a=r.color,h=i.color;l.color.set(n.r*a.r*h.r,n.g*a.g*h.g,n.b*a.b*h.b,n.a*a.a*h.a),r.darkColor&&l.darkColor.setFromColor(r.darkColor),l.skipRender=l.clipped=!1;const c=i.region?.texture.texture||it.Texture.EMPTY;l.texture!==c&&(l.texture=c,this.spineTexturesDirty=!0),Pt.isClipping()&&this.updateClippingData(l)}else if(i instanceof St){Pt.clipStart(r,i);continue}}Pt.clipEndWithSlot(r)}Pt.clipEnd()}updateClippingData(t){t.clipped=!0,Pt.clipTrianglesUnpacked(t.vertices,t.indices,t.indices.length,t.uvs);const{clippedVertices:s,clippedUVs:r,clippedTriangles:i}=Pt,l=s.length/2,o=i.length;t.clippedData||(t.clippedData={vertices:new Float32Array(l*2),uvs:new Float32Array(l*2),vertexCount:l,indices:new Uint16Array(o),indicesCount:o},this.spineAttachmentsDirty=!0);const n=t.clippedData,a=n.vertexCount!==l||o!==n.indicesCount;t.skipRender=l===0,a&&(this.spineAttachmentsDirty=!0,n.vertexCount<l&&(n.vertices=new Float32Array(l*2),n.uvs=new Float32Array(l*2)),n.indices.length<o&&(n.indices=new Uint16Array(o)));const{vertices:h,uvs:c,indices:u}=n;for(let d=0;d<l;d++)h[d*2]=s[d*2],h[d*2+1]=s[d*2+1],c[d*2]=r[d*2],c[d*2+1]=r[d*2+1];n.vertexCount=l;for(let d=0;d<o;d++)u[d]!==i[d]&&(this.spineAttachmentsDirty=!0,u[d]=i[d]);n.indicesCount=o}updateSlotObjects(){for(const t in this._slotsObject){const s=this._slotsObject[t];s&&this.updateSlotObject(s)}}updateSlotObject(t){const{slot:s,container:r}=t,i=t.followAttachmentTimeline?!!s.attachment:!0;if(r.visible=this.skeleton.drawOrder.includes(s)&&i,r.visible){let l=s.bone;r.position.set(l.worldX,l.worldY),r.angle=l.getWorldRotationX();let o=1,n=1;for(;l;)o*=l.scaleX,n*=l.scaleY,l=l.parent;o<0&&(r.angle-=180),r.scale.set(s.bone.getWorldScaleX()*Math.sign(o),s.bone.getWorldScaleY()*Math.sign(n)),r.alpha=this.skeleton.color.a*s.color.a}}_getCachedData(t,s){return this.attachmentCacheData[t.data.index][s.name]||this.initCachedData(t,s)}initCachedData(t,s){let r;return s instanceof ot?(r=new Float32Array(8),this.attachmentCacheData[t.data.index][s.name]={id:`${t.data.index}-${s.name}`,vertices:r,clipped:!1,indices:[0,1,2,0,2,3],uvs:new Float32Array(s.uvs.length),color:new V(1,1,1,1),darkColor:new V(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:s.region?.texture.texture}):(r=new Float32Array(s.worldVerticesLength),this.attachmentCacheData[t.data.index][s.name]={id:`${t.data.index}-${s.name}`,vertices:r,clipped:!1,indices:s.triangles,uvs:new Float32Array(s.uvs.length),color:new V(1,1,1,1),darkColor:new V(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:s.region?.texture.texture}),this.attachmentCacheData[t.data.index][s.name]}onViewUpdate(){if(this._didViewChangeTick++,this._boundsProvider||(this._boundsDirty=!0),this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this),this.debug?.renderDebug(this)}addSlotObject(t,s,r){t=this.getSlotFromRef(t);for(const l in this._slotsObject)this._slotsObject[l]?.container===s&&this.removeSlotObject(this._slotsObject[l].slot);this.removeSlotObject(t),s.includeInBuild=!1,this.addChild(s);const i={container:s,slot:t,followAttachmentTimeline:r?.followAttachmentTimeline||!1};this._slotsObject[t.data.name]=i,this.updateSlotObject(i)}removeSlotObject(t){let s;if(t instanceof it.Container){for(const r in this._slotsObject)if(this._slotsObject[r]?.container===t){this._slotsObject[r]=null,s=t;break}}else{const r=this.getSlotFromRef(t);s=this._slotsObject[r.data.name]?.container,this._slotsObject[r.data.name]=null}s&&(this.removeChild(s),s.includeInBuild=!0)}removeSlotObjects(){Object.entries(this._slotsObject).forEach(([t,s])=>{s&&s.container.removeFromParent(),delete this._slotsObject[t]})}getSlotObject(t){return t=this.getSlotFromRef(t),this._slotsObject[t.data.name]?.container}updateBounds(){this._boundsDirty=!1,this.skeletonBounds||=new rs;const t=this.skeletonBounds;if(t.update(this.skeleton,!0),this._boundsProvider){const s=this._boundsProvider.calculateBounds(this),r=this._bounds;r.clear(),r.x=s.x,r.y=s.y,r.width=s.width,r.height=s.height}else if(t.minX===1/0){this.hasNeverUpdated&&(this._updateAndApplyState(0),this._boundsDirty=!1),this._validateAndTransformAttachments();const s=this.skeleton.drawOrder,r=this._bounds;r.clear();for(let i=0;i<s.length;i++){const l=s[i],o=l.getAttachment();if(o&&(o instanceof ot||o instanceof ut)){const n=this._getCachedData(l,o);r.addVertexData(n.vertices,0,n.vertices.length)}}}else this._bounds.minX=t.minX,this._bounds.minY=t.minY,this._bounds.maxX=t.maxX,this._bounds.maxY=t.maxY}addBounds(t){t.addBounds(this.bounds)}destroy(t=!1){super.destroy(t),it.Ticker.shared.remove(this.internalUpdate,this),this.state.clearListeners(),this.debug=void 0,this.skeleton=null,this.state=null,this._slotsObject=null,this._lastAttachments.length=0,this.attachmentCacheData=null}skeletonToPixiWorldCoordinates(t){this.worldTransform.apply(t,t)}pixiWorldCoordinatesToSkeleton(t){this.worldTransform.applyInverse(t,t)}pixiWorldCoordinatesToBone(t,s){this.pixiWorldCoordinatesToSkeleton(t),s.parent?s.parent.worldToLocal(t):s.worldToLocal(t)}static from({skeleton:t,atlas:s,scale:r=1,darkTint:i,autoUpdate:l=!0,boundsProvider:o}){const n=`${t}-${s}-${r}`;if(it.Cache.has(n))return new us({skeletonData:it.Cache.get(n),darkTint:i,autoUpdate:l,boundsProvider:o});const a=it.Assets.get(t),h=it.Assets.get(s),c=new Xs(h),u=a instanceof Uint8Array?new Ns(c):new Us(c);u.scale=r;const d=u.readSkeletonData(a);return it.Cache.set(n,d),new us({skeletonData:d,darkTint:i,autoUpdate:l,boundsProvider:o})}},et=pt("pixi.js"),wr=class{registeredSpines=new Map;drawMeshHull=!0;drawMeshTriangles=!0;drawBones=!0;drawPaths=!0;drawBoundingBoxes=!0;drawClipping=!0;drawRegionAttachments=!0;drawEvents=!0;lineWidth=1;regionAttachmentsColor=30975;meshHullColor=30975;meshTrianglesColor=16763904;clippingPolygonColor=16711935;boundingBoxesRectColor=65280;boundingBoxesPolygonColor=65280;boundingBoxesCircleColor=65280;pathsCurveColor=16711680;pathsLineColor=16711935;skeletonXYColor=16711680;bonesColor=61132;eventFontSize=24;eventFontColor=0;registerSpine(e){if(this.registeredSpines.has(e)){console.warn("SpineDebugRenderer.registerSpine() - this spine is already registered!",e);return}const t={parentDebugContainer:new et.Container,bones:new et.Container,skeletonXY:new et.Graphics,regionAttachmentsShape:new et.Graphics,meshTrianglesLine:new et.Graphics,meshHullLine:new et.Graphics,clippingPolygon:new et.Graphics,boundingBoxesRect:new et.Graphics,boundingBoxesCircle:new et.Graphics,boundingBoxesPolygon:new et.Graphics,pathsCurve:new et.Graphics,pathsLine:new et.Graphics,eventText:new et.Container,eventCallback:{event:(s,r)=>{if(this.drawEvents){const i=Math.abs(e.scale.x||e.scale.y||1),l=new et.Text({text:r.data.name,style:{fontSize:this.eventFontSize/i,fill:this.eventFontColor,fontFamily:"monospace"}});l.scale.x=Math.sign(e.scale.x),l.anchor.set(.5),t.eventText.addChild(l),setTimeout(()=>{l.destroyed||l.destroy()},250)}}}};t.parentDebugContainer.addChild(t.bones),t.parentDebugContainer.addChild(t.skeletonXY),t.parentDebugContainer.addChild(t.regionAttachmentsShape),t.parentDebugContainer.addChild(t.meshTrianglesLine),t.parentDebugContainer.addChild(t.meshHullLine),t.parentDebugContainer.addChild(t.clippingPolygon),t.parentDebugContainer.addChild(t.boundingBoxesRect),t.parentDebugContainer.addChild(t.boundingBoxesCircle),t.parentDebugContainer.addChild(t.boundingBoxesPolygon),t.parentDebugContainer.addChild(t.pathsCurve),t.parentDebugContainer.addChild(t.pathsLine),t.parentDebugContainer.addChild(t.eventText),t.parentDebugContainer.zIndex=9999999,t.parentDebugContainer.accessibleChildren=!1,t.parentDebugContainer.eventMode="none",t.parentDebugContainer.interactiveChildren=!1,e.addChild(t.parentDebugContainer),e.state.addListener(t.eventCallback),this.registeredSpines.set(e,t)}renderDebug(e){this.registeredSpines.has(e)||this.registerSpine(e);const t=this.registeredSpines.get(e);if(!t)return;e.addChild(t.parentDebugContainer),t.skeletonXY.clear(),t.regionAttachmentsShape.clear(),t.meshTrianglesLine.clear(),t.meshHullLine.clear(),t.clippingPolygon.clear(),t.boundingBoxesRect.clear(),t.boundingBoxesCircle.clear(),t.boundingBoxesPolygon.clear(),t.pathsCurve.clear(),t.pathsLine.clear();for(let i=t.bones.children.length;i>0;i--)t.bones.children[i-1].destroy({children:!0,texture:!0,textureSource:!0});const s=Math.abs(e.scale.x||e.scale.y||1),r=this.lineWidth/s;if(this.drawBones&&this.drawBonesFunc(e,t,r,s),this.drawPaths&&this.drawPathsFunc(e,t,r),this.drawBoundingBoxes&&this.drawBoundingBoxesFunc(e,t,r),this.drawClipping&&this.drawClippingFunc(e,t,r),(this.drawMeshHull||this.drawMeshTriangles)&&this.drawMeshHullAndMeshTriangles(e,t,r),this.drawRegionAttachments&&this.drawRegionAttachmentsFunc(e,t,r),this.drawEvents)for(const i of t.eventText.children)i.alpha-=.05,i.y-=2}drawBonesFunc(e,t,s,r){const i=e.skeleton,l=i.x,o=i.y,n=i.bones;t.skeletonXY.strokeStyle={width:s,color:this.skeletonXYColor};for(let h=0,c=n.length;h<c;h++){const u=n[h],d=u.data.length,m=l+u.worldX,f=o+u.worldY,p=l+d*u.a+u.worldX,b=o+d*u.b+u.worldY;if(u.data.name==="root"||u.data.parent===null)continue;const w=Math.abs(m-p),g=Math.abs(f-b),x=Math.pow(w,2),y=g,v=Math.pow(g,2),C=Math.sqrt(x+v),S=Math.pow(C,2),k=Math.PI/180,T=Math.acos((S+v-x)/(2*y*C))||0;if(C===0)continue;const Y=new et.Graphics;t.bones.addChild(Y);const M=C/50/r;Y.context.poly([0,0,0-M,C-M*3,0,C-M,0+M,C-M*3]).fill(this.bonesColor),Y.x=m,Y.y=f,Y.pivot.y=C;let X=0;m<p&&f<b?X=-T+180*k:m>p&&f<b?X=180*k+T:m>p&&f>b?X=-T:m<p&&f>b?X=T:f===b&&m<p?X=90*k:f===b&&m>p?X=-90*k:m===p&&f<b?X=180*k:m===p&&f>b&&(X=0),Y.rotation=X,Y.circle(0,C,M*1.2).fill({color:0,alpha:.6}).stroke({width:s+M/2.4,color:this.bonesColor})}const a=s*3;t.skeletonXY.context.moveTo(l-a,o-a).lineTo(l+a,o+a).moveTo(l+a,o-a).lineTo(l-a,o+a).stroke()}drawRegionAttachmentsFunc(e,t,s){const i=e.skeleton.slots;for(let l=0,o=i.length;l<o;l++){const n=i[l],a=n.getAttachment();if(a===null||!(a instanceof ot))continue;const h=a,c=new Float32Array(8);h.computeWorldVertices(n,c,0,2),t.regionAttachmentsShape.poly(Array.from(c.slice(0,8)))}t.regionAttachmentsShape.stroke({color:this.regionAttachmentsColor,width:s})}drawMeshHullAndMeshTriangles(e,t,s){const i=e.skeleton.slots;for(let l=0,o=i.length;l<o;l++){const n=i[l];if(!n.bone.active)continue;const a=n.getAttachment();if(a===null||!(a instanceof ut))continue;const h=a,c=new Float32Array(h.worldVerticesLength),u=h.triangles;let d=h.hullLength;if(h.computeWorldVertices(n,0,h.worldVerticesLength,c,0,2),this.drawMeshTriangles)for(let m=0,f=u.length;m<f;m+=3){const p=u[m]*2,b=u[m+1]*2,w=u[m+2]*2;t.meshTrianglesLine.context.moveTo(c[p],c[p+1]).lineTo(c[b],c[b+1]).lineTo(c[w],c[w+1])}if(this.drawMeshHull&&d>0){d=(d>>1)*2;let m=c[d-2],f=c[d-1];for(let p=0,b=d;p<b;p+=2){const w=c[p],g=c[p+1];t.meshHullLine.context.moveTo(w,g).lineTo(m,f),m=w,f=g}}}t.meshHullLine.stroke({width:s,color:this.meshHullColor}),t.meshTrianglesLine.stroke({width:s,color:this.meshTrianglesColor})}drawClippingFunc(e,t,s){const i=e.skeleton.slots;for(let l=0,o=i.length;l<o;l++){const n=i[l];if(!n.bone.active)continue;const a=n.getAttachment();if(a===null||!(a instanceof St))continue;const h=a,c=h.worldVerticesLength,u=new Float32Array(c);h.computeWorldVertices(n,0,c,u,0,2),t.clippingPolygon.poly(Array.from(u))}t.clippingPolygon.stroke({width:s,color:this.clippingPolygonColor,alpha:1})}drawBoundingBoxesFunc(e,t,s){const r=new rs;r.update(e.skeleton,!0),r.minX!==1/0&&t.boundingBoxesRect.rect(r.minX,r.minY,r.getWidth(),r.getHeight()).stroke({width:s,color:this.boundingBoxesRectColor});const i=r.polygons,l=(o,n,a)=>{if(a<3)throw new Error("Polygon must contain at least 3 vertices");const h=[],c=s*2;for(let u=0,d=o.length;u<d;u+=2){const m=o[u],f=o[u+1];t.boundingBoxesCircle.beginFill(this.boundingBoxesCircleColor),t.boundingBoxesCircle.drawCircle(m,f,c),t.boundingBoxesCircle.fill(0),t.boundingBoxesCircle.circle(m,f,c).fill({color:this.boundingBoxesCircleColor}),h.push(m,f)}t.boundingBoxesPolygon.poly(h).fill({color:this.boundingBoxesPolygonColor,alpha:.1}).stroke({width:s,color:this.boundingBoxesPolygonColor})};for(let o=0,n=i.length;o<n;o++){const a=i[o];l(a,0,a.length)}}drawPathsFunc(e,t,s){const i=e.skeleton.slots;for(let l=0,o=i.length;l<o;l++){const n=i[l];if(!n.bone.active)continue;const a=n.getAttachment();if(a===null||!(a instanceof Mt))continue;const h=a;let c=h.worldVerticesLength;const u=new Float32Array(c);h.computeWorldVertices(n,0,c,u,0,2);let d=u[2],m=u[3],f=0,p=0;if(h.closed){const b=u[0],w=u[1],g=u[c-2],x=u[c-1];f=u[c-4],p=u[c-3],t.pathsCurve.moveTo(d,m),t.pathsCurve.bezierCurveTo(b,w,g,x,f,p),t.pathsLine.moveTo(d,m),t.pathsLine.lineTo(b,w),t.pathsLine.moveTo(f,p),t.pathsLine.lineTo(g,x)}c-=4;for(let b=4;b<c;b+=6){const w=u[b],g=u[b+1],x=u[b+2],y=u[b+3];f=u[b+4],p=u[b+5],t.pathsCurve.moveTo(d,m),t.pathsCurve.bezierCurveTo(w,g,x,y,f,p),t.pathsLine.moveTo(d,m),t.pathsLine.lineTo(w,g),t.pathsLine.moveTo(f,p),t.pathsLine.lineTo(x,y),d=f,m=p}}t.pathsCurve.stroke({width:s,color:this.pathsCurveColor}),t.pathsLine.stroke({width:s,color:this.pathsLineColor})}unregisterSpine(e){this.registeredSpines.has(e)||console.warn("SpineDebugRenderer.unregisterSpine() - spine is not registered, can't unregister!",e);const t=this.registeredSpines.get(e);t&&(e.state.removeListener(t.eventCallback),t.parentDebugContainer.destroy({textureSource:!0,children:!0,texture:!0}),this.registeredSpines.delete(e))}};return di(fs)})();
|