lyb-pixi-js 1.0.12 → 1.0.13

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.
@@ -38,15 +38,16 @@ export declare class LibPixiSpine extends Spine {
38
38
  /** @description 设置动画
39
39
  * @param animationName 动画名称
40
40
  * @param loop 是否循环播放
41
- * @param delay 是否延迟播放
41
+ * @param hide 播完是否隐藏
42
42
  */
43
- setAnimation(animationName?: string, loop?: boolean): Promise<void>;
43
+ setAnimation(animationName?: string, loop?: boolean, hide?: boolean): Promise<void>;
44
44
  /** @description 添加动画
45
45
  * @param animationName 动画名称
46
46
  * @param loop 是否循环播放
47
47
  * @param delay 延迟播放时间
48
+ * @param hide 播完是否隐藏
48
49
  */
49
- addAnimation(animationName?: string, loop?: boolean, delay?: number): Promise<void>;
50
+ addAnimation(animationName?: string, loop?: boolean, delay?: number, hide?: boolean): Promise<void>;
50
51
  /** @description 改变骨骼数据 */
51
52
  setSkin(skinName: string): void;
52
53
  /** @description 销毁动画及挂点 */
@@ -40,14 +40,14 @@ export class LibPixiSpine extends Spine {
40
40
  /** @description 设置动画
41
41
  * @param animationName 动画名称
42
42
  * @param loop 是否循环播放
43
- * @param delay 是否延迟播放
43
+ * @param hide 播完是否隐藏
44
44
  */
45
- setAnimation(animationName = "animation", loop = false) {
45
+ setAnimation(animationName = "animation", loop = false, hide = false) {
46
46
  return new Promise((resolve) => {
47
47
  this.visible = true;
48
48
  this.state.setAnimation(0, animationName, loop).listener = {
49
49
  complete: () => {
50
- this.visible = false;
50
+ this.visible = !hide;
51
51
  requestAnimationFrame(() => {
52
52
  resolve();
53
53
  });
@@ -59,13 +59,14 @@ export class LibPixiSpine extends Spine {
59
59
  * @param animationName 动画名称
60
60
  * @param loop 是否循环播放
61
61
  * @param delay 延迟播放时间
62
+ * @param hide 播完是否隐藏
62
63
  */
63
- addAnimation(animationName = "animation", loop = false, delay = 0) {
64
+ addAnimation(animationName = "animation", loop = false, delay = 0, hide = false) {
64
65
  return new Promise((resolve) => {
65
66
  this.visible = true;
66
67
  this.state.addAnimation(0, animationName, loop, delay).listener = {
67
68
  complete: () => {
68
- this.visible = false;
69
+ this.visible = !hide;
69
70
  requestAnimationFrame(() => {
70
71
  resolve();
71
72
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lyb-pixi-js",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "自用Pixi.JS方法库",
5
5
  "license": "ISC",
6
6
  "type": "module",
package/umd/lyb-pixi.js CHANGED
@@ -1166,4 +1166,4 @@ void main(void)\r
1166
1166
  *
1167
1167
  * @pixi/particle-emitter is licensed under the MIT License.
1168
1168
  * http://www.opensource.org/licenses/mit-license
1169
- */class ui{constructor(t,e,i){this.value=t,this.time=e,this.next=null,this.isStepped=!1,i?this.ease=typeof i=="function"?i:Bm(i):this.ease=null}static createList(t){if("list"in t){const i=t.list;let s;const{value:n,time:a}=i[0],o=s=new ui(typeof n=="string"?Ja(n):n,a,t.ease);if(i.length>2||i.length===2&&i[1].value!==n)for(let h=1;h<i.length;++h){const{value:l,time:c}=i[h];s.next=new ui(typeof l=="string"?Ja(l):l,c),s=s.next}return o.isStepped=!!t.isStepped,o}const e=new ui(typeof t.start=="string"?Ja(t.start):t.start,0);return t.end!==t.start&&(e.next=new ui(typeof t.end=="string"?Ja(t.end):t.end,1)),e}}let yn=W.from;const di=Math.PI/180;function Bi(r,t){if(!r)return;const e=Math.sin(r),i=Math.cos(r),s=t.x*i-t.y*e,n=t.x*e+t.y*i;t.x=s,t.y=n}function Qa(r,t,e){return r<<16|t<<8|e}function Mm(r){return Math.sqrt(r.x*r.x+r.y*r.y)}function fE(r){const t=1/Mm(r);r.x*=t,r.y*=t}function Dm(r,t){r.x*=t,r.y*=t}function Ja(r,t){t||(t={}),r.charAt(0)==="#"?r=r.substr(1):r.indexOf("0x")===0&&(r=r.substr(2));let e;return r.length===8&&(e=r.substr(0,2),r=r.substr(2)),t.r=parseInt(r.substr(0,2),16),t.g=parseInt(r.substr(2,2),16),t.b=parseInt(r.substr(4,2),16),e&&(t.a=parseInt(e,16)),t}function Bm(r){const t=r.length,e=1/t;return function(i){const s=t*i|0,n=(i-s*e)*t,a=r[s]||r[t-1];return a.s+n*(2*(1-n)*(a.cp-a.s)+n*(a.e-a.s))}}function pE(r){return r?(r=r.toUpperCase().replace(/ /g,"_"),K[r]||K.NORMAL):K.NORMAL}class Ql extends Ci{constructor(t){super(),this.prevChild=this.nextChild=null,this.emitter=t,this.config={},this.anchor.x=this.anchor.y=.5,this.maxLife=0,this.age=0,this.agePercent=0,this.oneOverLife=0,this.next=null,this.prev=null,this.init=this.init,this.kill=this.kill}init(t){this.maxLife=t,this.age=this.agePercent=0,this.rotation=0,this.position.x=this.position.y=0,this.scale.x=this.scale.y=1,this.tint=16777215,this.alpha=1,this.oneOverLife=1/this.maxLife,this.visible=!0}kill(){this.emitter.recycle(this)}destroy(){this.parent&&this.parent.removeChild(this),this.emitter=this.next=this.prev=null,super.destroy()}}var _t;(function(r){r[r.Spawn=0]="Spawn",r[r.Normal=2]="Normal",r[r.Late=5]="Late"})(_t||(_t={}));const Jl=Wt.shared,Or=Symbol("Position particle per emitter position");class ct{constructor(t,e){this.initBehaviors=[],this.updateBehaviors=[],this.recycleBehaviors=[],this.minLifetime=0,this.maxLifetime=0,this.customEase=null,this._frequency=1,this.spawnChance=1,this.maxParticles=1e3,this.emitterLifetime=-1,this.spawnPos=new tt,this.particlesPerWave=1,this.rotation=0,this.ownerPos=new tt,this._prevEmitterPos=new tt,this._prevPosIsValid=!1,this._posChanged=!1,this._parent=null,this.addAtBack=!1,this.particleCount=0,this._emit=!1,this._spawnTimer=0,this._emitterLife=-1,this._activeParticlesFirst=null,this._activeParticlesLast=null,this._poolFirst=null,this._origConfig=null,this._autoUpdate=!1,this._destroyWhenComplete=!1,this._completeCallback=null,this.parent=t,e&&this.init(e),this.recycle=this.recycle,this.update=this.update,this.rotate=this.rotate,this.updateSpawnPos=this.updateSpawnPos,this.updateOwnerPos=this.updateOwnerPos}static registerBehavior(t){ct.knownBehaviors[t.type]=t}get frequency(){return this._frequency}set frequency(t){typeof t=="number"&&t>0?this._frequency=t:this._frequency=1}get parent(){return this._parent}set parent(t){this.cleanup(),this._parent=t}init(t){if(!t)return;this.cleanup(),this._origConfig=t,this.minLifetime=t.lifetime.min,this.maxLifetime=t.lifetime.max,t.ease?this.customEase=typeof t.ease=="function"?t.ease:Bm(t.ease):this.customEase=null,this.particlesPerWave=1,t.particlesPerWave&&t.particlesPerWave>1&&(this.particlesPerWave=t.particlesPerWave),this.frequency=t.frequency,this.spawnChance=typeof t.spawnChance=="number"&&t.spawnChance>0?t.spawnChance:1,this.emitterLifetime=t.emitterLifetime||-1,this.maxParticles=t.maxParticles>0?t.maxParticles:1e3,this.addAtBack=!!t.addAtBack,this.rotation=0,this.ownerPos.set(0),t.pos?this.spawnPos.copyFrom(t.pos):this.spawnPos.set(0),this._prevEmitterPos.copyFrom(this.spawnPos),this._prevPosIsValid=!1,this._spawnTimer=0,this.emit=t.emit===void 0?!0:!!t.emit,this.autoUpdate=!!t.autoUpdate;const e=t.behaviors.map(i=>{const s=ct.knownBehaviors[i.type];return s?new s(i.config):(console.error(`Unknown behavior: ${i.type}`),null)}).filter(i=>!!i);e.push(Or),e.sort((i,s)=>i===Or?s.order===_t.Spawn?1:-1:s===Or?i.order===_t.Spawn?-1:1:i.order-s.order),this.initBehaviors=e.slice(),this.updateBehaviors=e.filter(i=>i!==Or&&i.updateParticle),this.recycleBehaviors=e.filter(i=>i!==Or&&i.recycleParticle)}getBehavior(t){return ct.knownBehaviors[t]&&this.initBehaviors.find(e=>e instanceof ct.knownBehaviors[t])||null}fillPool(t){for(;t>0;--t){const e=new Ql(this);e.next=this._poolFirst,this._poolFirst=e}}recycle(t,e=!1){for(let i=0;i<this.recycleBehaviors.length;++i)this.recycleBehaviors[i].recycleParticle(t,!e);t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next),t===this._activeParticlesLast&&(this._activeParticlesLast=t.prev),t===this._activeParticlesFirst&&(this._activeParticlesFirst=t.next),t.prev=null,t.next=this._poolFirst,this._poolFirst=t,t.parent&&t.parent.removeChild(t),--this.particleCount}rotate(t){if(this.rotation===t)return;const e=t-this.rotation;this.rotation=t,Bi(e,this.spawnPos),this._posChanged=!0}updateSpawnPos(t,e){this._posChanged=!0,this.spawnPos.x=t,this.spawnPos.y=e}updateOwnerPos(t,e){this._posChanged=!0,this.ownerPos.x=t,this.ownerPos.y=e}resetPositionTracking(){this._prevPosIsValid=!1}get emit(){return this._emit}set emit(t){this._emit=!!t,this._emitterLife=this.emitterLifetime}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){this._autoUpdate&&!t?Jl.remove(this.update,this):!this._autoUpdate&&t&&Jl.add(this.update,this),this._autoUpdate=!!t}playOnceAndDestroy(t){this.autoUpdate=!0,this.emit=!0,this._destroyWhenComplete=!0,this._completeCallback=t}playOnce(t){this.emit=!0,this._completeCallback=t}update(t){if(this._autoUpdate&&(t=Jl.elapsedMS*.001),!this._parent)return;for(let a=this._activeParticlesFirst,o;a;a=o)if(o=a.next,a.age+=t,a.age>a.maxLife||a.age<0)this.recycle(a);else{let h=a.age*a.oneOverLife;this.customEase&&(this.customEase.length===4?h=this.customEase(h,0,1,1):h=this.customEase(h)),a.agePercent=h;for(let l=0;l<this.updateBehaviors.length;++l)if(this.updateBehaviors[l].updateParticle(a,t)){this.recycle(a);break}}let e,i;this._prevPosIsValid&&(e=this._prevEmitterPos.x,i=this._prevEmitterPos.y);const s=this.ownerPos.x+this.spawnPos.x,n=this.ownerPos.y+this.spawnPos.y;if(this._emit)for(this._spawnTimer-=t<0?0:t;this._spawnTimer<=0;){if(this._emitterLife>=0&&(this._emitterLife-=this._frequency,this._emitterLife<=0)){this._spawnTimer=0,this._emitterLife=0,this.emit=!1;break}if(this.particleCount>=this.maxParticles){this._spawnTimer+=this._frequency;continue}let a,o;if(this._prevPosIsValid&&this._posChanged){const c=1+this._spawnTimer/t;a=(s-e)*c+e,o=(n-i)*c+i}else a=s,o=n;let h=null,l=null;for(let c=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),d=0;d<c;++d){if(this.spawnChance<1&&Math.random()>=this.spawnChance)continue;let u;if(this.minLifetime===this.maxLifetime?u=this.minLifetime:u=Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer>=u)continue;let f;this._poolFirst?(f=this._poolFirst,this._poolFirst=this._poolFirst.next,f.next=null):f=new Ql(this),f.init(u),this.addAtBack?this._parent.addChildAt(f,0):this._parent.addChild(f),h?(l.next=f,f.prev=l,l=f):l=h=f,++this.particleCount}if(h){this._activeParticlesLast?(this._activeParticlesLast.next=h,h.prev=this._activeParticlesLast,this._activeParticlesLast=l):(this._activeParticlesFirst=h,this._activeParticlesLast=l);for(let c=0;c<this.initBehaviors.length;++c){const d=this.initBehaviors[c];if(d===Or)for(let u=h,f;u;u=f){f=u.next,this.rotation!==0&&(Bi(this.rotation,u.position),u.rotation+=this.rotation),u.position.x+=a,u.position.y+=o,u.age+=-this._spawnTimer;let p=u.age*u.oneOverLife;this.customEase&&(this.customEase.length===4?p=this.customEase(p,0,1,1):p=this.customEase(p)),u.agePercent=p}else d.initParticles(h)}for(let c=h,d;c;c=d){d=c.next;for(let u=0;u<this.updateBehaviors.length;++u)if(this.updateBehaviors[u].updateParticle(c,-this._spawnTimer)){this.recycle(c);break}}}this._spawnTimer+=this._frequency}if(this._posChanged&&(this._prevEmitterPos.x=s,this._prevEmitterPos.y=n,this._prevPosIsValid=!0,this._posChanged=!1),!this._emit&&!this._activeParticlesFirst){if(this._completeCallback){const a=this._completeCallback;this._completeCallback=null,a()}this._destroyWhenComplete&&this.destroy()}}emitNow(){const t=this.ownerPos.x+this.spawnPos.x,e=this.ownerPos.y+this.spawnPos.y;let i=null,s=null;for(let n=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),a=0;a<n;++a){if(this.spawnChance<1&&Math.random()>=this.spawnChance)continue;let o;this._poolFirst?(o=this._poolFirst,this._poolFirst=this._poolFirst.next,o.next=null):o=new Ql(this);let h;this.minLifetime===this.maxLifetime?h=this.minLifetime:h=Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,o.init(h),this.addAtBack?this._parent.addChildAt(o,0):this._parent.addChild(o),i?(s.next=o,o.prev=s,s=o):s=i=o,++this.particleCount}if(i){this._activeParticlesLast?(this._activeParticlesLast.next=i,i.prev=this._activeParticlesLast,this._activeParticlesLast=s):(this._activeParticlesFirst=i,this._activeParticlesLast=s);for(let n=0;n<this.initBehaviors.length;++n){const a=this.initBehaviors[n];if(a===Or)for(let o=i,h;o;o=h)h=o.next,this.rotation!==0&&(Bi(this.rotation,o.position),o.rotation+=this.rotation),o.position.x+=t,o.position.y+=e;else a.initParticles(i)}}}cleanup(){let t,e;for(t=this._activeParticlesFirst;t;t=e)e=t.next,this.recycle(t,!0);this._activeParticlesFirst=this._activeParticlesLast=null,this.particleCount=0}get destroyed(){return!(this._parent&&this.initBehaviors.length)}destroy(){this.autoUpdate=!1,this.cleanup();let t;for(let e=this._poolFirst;e;e=t)t=e.next,e.destroy();this._poolFirst=this._parent=this.spawnPos=this.ownerPos=this.customEase=this._completeCallback=null,this.initBehaviors.length=this.updateBehaviors.length=this.recycleBehaviors.length=0}}ct.knownBehaviors={};class tc{constructor(t){this.x=t.x,this.y=t.y,this.w=t.w,this.h=t.h}getRandPos(t){t.x=Math.random()*this.w+this.x,t.y=Math.random()*this.h+this.y}}tc.type="rect",tc.editorConfig=null;class to{constructor(t){this.x=t.x||0,this.y=t.y||0,this.radius=t.radius,this.innerRadius=t.innerRadius||0,this.rotation=!!t.affectRotation}getRandPos(t){this.innerRadius!==this.radius?t.x=Math.random()*(this.radius-this.innerRadius)+this.innerRadius:t.x=this.radius,t.y=0;const e=Math.random()*Math.PI*2;this.rotation&&(t.rotation+=e),Bi(e,t.position),t.position.x+=this.x,t.position.y+=this.y}}to.type="torus",to.editorConfig=null;class ec{constructor(t){this.segments=[],this.countingLengths=[],this.totalLength=0,this.init(t)}init(t){if(!t||!t.length)this.segments.push({p1:{x:0,y:0},p2:{x:0,y:0},l:0});else if(Array.isArray(t[0]))for(let e=0;e<t.length;++e){const i=t[e];let s=i[0];for(let n=1;n<i.length;++n){const a=i[n];this.segments.push({p1:s,p2:a,l:0}),s=a}}else{let e=t[0];for(let i=1;i<t.length;++i){const s=t[i];this.segments.push({p1:e,p2:s,l:0}),e=s}}for(let e=0;e<this.segments.length;++e){const{p1:i,p2:s}=this.segments[e],n=Math.sqrt((s.x-i.x)*(s.x-i.x)+(s.y-i.y)*(s.y-i.y));this.segments[e].l=n,this.totalLength+=n,this.countingLengths.push(this.totalLength)}}getRandPos(t){const e=Math.random()*this.totalLength;let i,s;if(this.segments.length===1)i=this.segments[0],s=e;else for(let o=0;o<this.countingLengths.length;++o)if(e<this.countingLengths[o]){i=this.segments[o],s=o===0?e:e-this.countingLengths[o-1];break}s/=i.l||1;const{p1:n,p2:a}=i;t.x=n.x+s*(a.x-n.x),t.y=n.y+s*(a.y-n.y)}}ec.type="polygonalChain",ec.editorConfig=null;class ic{constructor(t){var e;this.order=_t.Late,this.minStart=t.minStart,this.maxStart=t.maxStart,this.accel=t.accel,this.rotate=!!t.rotate,this.maxSpeed=(e=t.maxSpeed)!==null&&e!==void 0?e:0}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.maxStart-this.minStart)+this.minStart;e.config.velocity?e.config.velocity.set(i,0):e.config.velocity=new tt(i,0),Bi(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=t.config.velocity,s=i.x,n=i.y;if(i.x+=this.accel.x*e,i.y+=this.accel.y*e,this.maxSpeed){const a=Mm(i);a>this.maxSpeed&&Dm(i,this.maxSpeed/a)}t.x+=(s+i.x)/2*e,t.y+=(n+i.y)/2*e,this.rotate&&(t.rotation=Math.atan2(i.y,i.x))}}ic.type="moveAcceleration",ic.editorConfig=null;function mE(r){return this.ease&&(r=this.ease(r)),(this.first.next.value-this.first.value)*r+this.first.value}function gE(r){this.ease&&(r=this.ease(r));const t=this.first.value,e=this.first.next.value,i=(e.r-t.r)*r+t.r,s=(e.g-t.g)*r+t.g,n=(e.b-t.b)*r+t.b;return Qa(i,s,n)}function _E(r){this.ease&&(r=this.ease(r));let t=this.first,e=t.next;for(;r>e.time;)t=e,e=e.next;return r=(r-t.time)/(e.time-t.time),(e.value-t.value)*r+t.value}function yE(r){this.ease&&(r=this.ease(r));let t=this.first,e=t.next;for(;r>e.time;)t=e,e=e.next;r=(r-t.time)/(e.time-t.time);const i=t.value,s=e.value,n=(s.r-i.r)*r+i.r,a=(s.g-i.g)*r+i.g,o=(s.b-i.b)*r+i.b;return Qa(n,a,o)}function xE(r){this.ease&&(r=this.ease(r));let t=this.first;for(;t.next&&r>t.next.time;)t=t.next;return t.value}function vE(r){this.ease&&(r=this.ease(r));let t=this.first;for(;t.next&&r>t.next.time;)t=t.next;const e=t.value;return Qa(e.r,e.g,e.b)}class xn{constructor(t=!1){this.first=null,this.isColor=!!t,this.interpolate=null,this.ease=null}reset(t){this.first=t,t.next&&t.next.time>=1?this.interpolate=this.isColor?gE:mE:t.isStepped?this.interpolate=this.isColor?vE:xE:this.interpolate=this.isColor?yE:_E,this.ease=this.first.ease}}class rc{constructor(t){this.order=_t.Normal,this.list=new xn(!1),this.list.reset(ui.createList(t.alpha))}initParticles(t){let e=t;for(;e;)e.alpha=this.list.first.value,e=e.next}updateParticle(t){t.alpha=this.list.interpolate(t.agePercent)}}rc.type="alpha",rc.editorConfig=null;class sc{constructor(t){this.order=_t.Normal,this.value=t.alpha}initParticles(t){let e=t;for(;e;)e.alpha=this.value,e=e.next}}sc.type="alphaStatic",sc.editorConfig=null;function Om(r){const t=[];for(let e=0;e<r.length;++e){let i=r[e];if(typeof i=="string")t.push(yn(i));else if(i instanceof W)t.push(i);else{let s=i.count||1;for(typeof i.texture=="string"?i=yn(i.texture):i=i.texture;s>0;--s)t.push(i)}}return t}class nc{constructor(t){this.order=_t.Normal,this.anims=[];for(let e=0;e<t.anims.length;++e){const i=t.anims[e],s=Om(i.textures),n=i.framerate<0?-1:i.framerate>0?i.framerate:60,a={textures:s,duration:n>0?s.length/n:0,framerate:n,loop:n>0?!!i.loop:!1};this.anims.push(a)}}initParticles(t){let e=t;for(;e;){const i=Math.floor(Math.random()*this.anims.length),s=e.config.anim=this.anims[i];e.texture=s.textures[0],e.config.animElapsed=0,s.framerate===-1?(e.config.animDuration=e.maxLife,e.config.animFramerate=s.textures.length/e.maxLife):(e.config.animDuration=s.duration,e.config.animFramerate=s.framerate),e=e.next}}updateParticle(t,e){const i=t.config,s=i.anim;i.animElapsed+=e,i.animElapsed>=i.animDuration&&(i.anim.loop?i.animElapsed=i.animElapsed%i.animDuration:i.animElapsed=i.animDuration-1e-6);const n=i.animElapsed*i.animFramerate+1e-7|0;t.texture=s.textures[n]||s.textures[s.textures.length-1]||W.EMPTY}}nc.type="animatedRandom",nc.editorConfig=null;class ac{constructor(t){this.order=_t.Normal;const e=t.anim,i=Om(e.textures),s=e.framerate<0?-1:e.framerate>0?e.framerate:60;this.anim={textures:i,duration:s>0?i.length/s:0,framerate:s,loop:s>0?!!e.loop:!1}}initParticles(t){let e=t;const i=this.anim;for(;e;)e.texture=i.textures[0],e.config.animElapsed=0,i.framerate===-1?(e.config.animDuration=e.maxLife,e.config.animFramerate=i.textures.length/e.maxLife):(e.config.animDuration=i.duration,e.config.animFramerate=i.framerate),e=e.next}updateParticle(t,e){const i=this.anim,s=t.config;s.animElapsed+=e,s.animElapsed>=s.animDuration&&(i.loop?s.animElapsed=s.animElapsed%s.animDuration:s.animElapsed=s.animDuration-1e-6);const n=s.animElapsed*s.animFramerate+1e-7|0;t.texture=i.textures[n]||i.textures[i.textures.length-1]||W.EMPTY}}ac.type="animatedSingle",ac.editorConfig=null;class oc{constructor(t){this.order=_t.Normal,this.value=t.blendMode}initParticles(t){let e=t;for(;e;)e.blendMode=pE(this.value),e=e.next}}oc.type="blendMode",oc.editorConfig=null;class hc{constructor(t){this.order=_t.Spawn,this.spacing=t.spacing*di,this.start=t.start*di,this.distance=t.distance}initParticles(t){let e=0,i=t;for(;i;){let s;this.spacing?s=this.start+this.spacing*e:s=Math.random()*Math.PI*2,i.rotation=s,this.distance&&(i.position.x=this.distance,Bi(s,i.position)),i=i.next,++e}}}hc.type="spawnBurst",hc.editorConfig=null;class lc{constructor(t){this.order=_t.Normal,this.list=new xn(!0),this.list.reset(ui.createList(t.color))}initParticles(t){let e=t;const i=this.list.first.value,s=Qa(i.r,i.g,i.b);for(;e;)e.tint=s,e=e.next}updateParticle(t){t.tint=this.list.interpolate(t.agePercent)}}lc.type="color",lc.editorConfig=null;class cc{constructor(t){this.order=_t.Normal;let e=t.color;e.charAt(0)==="#"?e=e.substr(1):e.indexOf("0x")===0&&(e=e.substr(2)),this.value=parseInt(e,16)}initParticles(t){let e=t;for(;e;)e.tint=this.value,e=e.next}}cc.type="colorStatic",cc.editorConfig=null;class uc{constructor(t){this.order=_t.Normal,this.index=0,this.textures=t.textures.map(e=>typeof e=="string"?yn(e):e)}initParticles(t){let e=t;for(;e;)e.texture=this.textures[this.index],++this.index>=this.textures.length&&(this.index=0),e=e.next}}uc.type="textureOrdered",uc.editorConfig=null;const xs=new tt,Fm=["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2","abs","acos","acosh","asin","asinh","atan","atanh","atan2","cbrt","ceil","cos","cosh","exp","expm1","floor","fround","hypot","log","log1p","log10","log2","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh"],bE=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(Fm).join("|"),"g");function TE(r){const t=r.match(bE);for(let e=t.length-1;e>=0;--e)Fm.indexOf(t[e])>=0&&(t[e]=`Math.${t[e]}`);return r=t.join(""),new Function("x",`return ${r};`)}class dc{constructor(t){var e;if(this.order=_t.Late,t.path)if(typeof t.path=="function")this.path=t.path;else try{this.path=TE(t.path)}catch{this.path=null}else this.path=i=>i;this.list=new xn(!1),this.list.reset(ui.createList(t.speed)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){e.config.initRotation=e.rotation,e.config.initPosition?e.config.initPosition.copyFrom(e.position):e.config.initPosition=new tt(e.x,e.y),e.config.movement=0;const i=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=i,e=e.next}}updateParticle(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult;t.config.movement+=i*e,xs.x=t.config.movement,xs.y=this.path(xs.x),Bi(t.config.initRotation,xs),t.position.x=t.config.initPosition.x+xs.x,t.position.y=t.config.initPosition.y+xs.y}}dc.type="movePath",dc.editorConfig=null;class fc{constructor(){this.order=_t.Spawn}initParticles(t){}}fc.type="spawnPoint",fc.editorConfig=null;class pc{constructor(t){this.order=_t.Normal,this.textures=t.textures.map(e=>typeof e=="string"?yn(e):e)}initParticles(t){let e=t;for(;e;){const i=Math.floor(Math.random()*this.textures.length);e.texture=this.textures[i],e=e.next}}}pc.type="textureRandom",pc.editorConfig=null;class mc{constructor(t){this.order=_t.Normal,this.minStart=t.minStart*di,this.maxStart=t.maxStart*di,this.minSpeed=t.minSpeed*di,this.maxSpeed=t.maxSpeed*di,this.accel=t.accel*di}initParticles(t){let e=t;for(;e;)this.minStart===this.maxStart?e.rotation+=this.maxStart:e.rotation+=Math.random()*(this.maxStart-this.minStart)+this.minStart,e.config.rotSpeed=Math.random()*(this.maxSpeed-this.minSpeed)+this.minSpeed,e=e.next}updateParticle(t,e){if(this.accel){const i=t.config.rotSpeed;t.config.rotSpeed+=this.accel*e,t.rotation+=(t.config.rotSpeed+i)/2*e}else t.rotation+=t.config.rotSpeed*e}}mc.type="rotation",mc.editorConfig=null;class gc{constructor(t){this.order=_t.Normal,this.min=t.min*di,this.max=t.max*di}initParticles(t){let e=t;for(;e;)this.min===this.max?e.rotation+=this.max:e.rotation+=Math.random()*(this.max-this.min)+this.min,e=e.next}}gc.type="rotationStatic",gc.editorConfig=null;class _c{constructor(t){this.order=_t.Late+1,this.rotation=(t.rotation||0)*di}initParticles(t){let e=t;for(;e;)e.rotation=this.rotation,e=e.next}}_c.type="noRotation",_c.editorConfig=null;class yc{constructor(t){var e;this.order=_t.Normal,this.list=new xn(!1),this.list.reset(ui.createList(t.scale)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){const i=Math.random()*(1-this.minMult)+this.minMult;e.config.scaleMult=i,e.scale.x=e.scale.y=this.list.first.value*i,e=e.next}}updateParticle(t){t.scale.x=t.scale.y=this.list.interpolate(t.agePercent)*t.config.scaleMult}}yc.type="scale",yc.editorConfig=null;class xc{constructor(t){this.order=_t.Normal,this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.max-this.min)+this.min;e.scale.x=e.scale.y=i,e=e.next}}}xc.type="scaleStatic",xc.editorConfig=null;class We{constructor(t){this.order=_t.Spawn;const e=We.shapes[t.type];if(!e)throw new Error(`No shape found with type '${t.type}'`);this.shape=new e(t.data)}static registerShape(t,e){We.shapes[e||t.type]=t}initParticles(t){let e=t;for(;e;)this.shape.getRandPos(e),e=e.next}}We.type="spawnShape",We.editorConfig=null,We.shapes={},We.registerShape(ec),We.registerShape(tc),We.registerShape(to),We.registerShape(to,"circle");class vc{constructor(t){this.order=_t.Normal,this.texture=typeof t.texture=="string"?yn(t.texture):t.texture}initParticles(t){let e=t;for(;e;)e.texture=this.texture,e=e.next}}vc.type="textureSingle",vc.editorConfig=null;class bc{constructor(t){var e;this.order=_t.Late,this.list=new xn(!1),this.list.reset(ui.createList(t.speed)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){const i=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=i,e.config.velocity?e.config.velocity.set(this.list.first.value*i,0):e.config.velocity=new tt(this.list.first.value*i,0),Bi(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult,s=t.config.velocity;fE(s),Dm(s,i),t.x+=s.x*e,t.y+=s.y*e}}bc.type="moveSpeed",bc.editorConfig=null;class Tc{constructor(t){this.order=_t.Late,this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.max-this.min)+this.min;e.config.velocity?e.config.velocity.set(i,0):e.config.velocity=new tt(i,0),Bi(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=t.config.velocity;t.x+=i.x*e,t.y+=i.y*e}}Tc.type="moveSpeedStatic",Tc.editorConfig=null,ct.registerBehavior(ic),ct.registerBehavior(rc),ct.registerBehavior(sc),ct.registerBehavior(nc),ct.registerBehavior(ac),ct.registerBehavior(oc),ct.registerBehavior(hc),ct.registerBehavior(lc),ct.registerBehavior(cc),ct.registerBehavior(uc),ct.registerBehavior(dc),ct.registerBehavior(fc),ct.registerBehavior(pc),ct.registerBehavior(mc),ct.registerBehavior(gc),ct.registerBehavior(_c),ct.registerBehavior(yc),ct.registerBehavior(xc),ct.registerBehavior(We),ct.registerBehavior(vc),ct.registerBehavior(bc),ct.registerBehavior(Tc);class Lm extends sl{constructor(t){const{text:e,fontSize:i=36,fontColor:s=16777215,stroke:n,strokeColor:a,strokeThickness:o,fontFamily:h="MicrosoftYaHei",fontWeight:l="normal",wordWrap:c=!1,wordWrapWidth:d=100,lineHeight:u=1.25,align:f="left",indent:p=0,shadow:m}=t,g=new Pi({fontSize:i,wordWrap:c,wordWrapWidth:d,fontWeight:l,lineHeight:u*i,breakWords:c,fill:s,align:f,fontFamily:h,stroke:n?a:"transparent",strokeThickness:n?o:0,lineJoin:"round"});m&&(g.dropShadow=!0,g.dropShadowColor=m[0],g.dropShadowAngle=m[1]*(Math.PI/180),g.dropShadowBlur=m[2],g.dropShadowDistance=m[3]),super(e,g),this.position.x=p*i}}class EE extends $t{constructor(t){super();const{start:e,control:i,end:s,json:n,duration:a,ease:o="power1.out",showControl:h=!1,loop:l=!1}=t;this._particleContainer=new vb,this.addChild(this._particleContainer);const c=new ct(this._particleContainer,n),d=this._createBezierPoints([e,...i,s],100,h),u={pathThrough:0};_n.to(u,{duration:a,pathThrough:d.length-1,repeat:l?-1:0,ease:o,onStart:()=>{c.emit=!0},onUpdate:()=>{const p=Math.floor(u.pathThrough),m=d[p];c.updateOwnerPos(m.x,m.y)},onComplete:()=>{_n.to(this,{alpha:0,duration:.5,onComplete:()=>{c.emit=!1,f.destroy(),this.removeFromParent()}})}});const f=new Wt;f.add(()=>{c.update(1/75)}),f.start()}_createBezierPoints(t,e,i){const s=[];i&&t.forEach((n,a)=>{const o=new Lm({text:a+1,fontSize:16});o.position.set(n.x,n.y),this.addChild(o)});for(let n=0;n<e;n++){const a=this._multiPointBezier(t,n/e);s.push(a)}return s}_multiPointBezier(t,e){const i=t.length;let s=0,n=0;const a=[];for(let o=0;o<i;o++)a[o]=this._binomial(i-1,o);for(let o=0;o<i;o++){const h=t[o],l=a[o],c=Math.pow(e,o),d=Math.pow(1-e,i-1-o);s+=h.x*d*c*l,n+=h.y*d*c*l}return{x:s,y:n}}_binomial(t,e){if(e===0||e===t)return 1;let i=1;for(let s=1;s<=e;s++)i=i*(t-s+1)/s;return i}}var fi=(r=>(r[r.Region=0]="Region",r[r.BoundingBox=1]="BoundingBox",r[r.Mesh=2]="Mesh",r[r.LinkedMesh=3]="LinkedMesh",r[r.Path=4]="Path",r[r.Point=5]="Point",r[r.Clipping=6]="Clipping",r))(fi||{}),j=(r=>(r[r.setup=0]="setup",r[r.first=1]="first",r[r.replace=2]="replace",r[r.add=3]="add",r))(j||{}),ve=(r=>(r[r.mixIn=0]="mixIn",r[r.mixOut=1]="mixOut",r))(ve||{}),eo=(r=>(r[r.Fixed=0]="Fixed",r[r.Percent=1]="Percent",r))(eo||{}),Fr=(r=>(r[r.Tangent=0]="Tangent",r[r.Chain=1]="Chain",r[r.ChainScale=2]="ChainScale",r))(Fr||{}),ee=(r=>(r[r.Normal=0]="Normal",r[r.OnlyTranslation=1]="OnlyTranslation",r[r.NoRotationOrReflection=2]="NoRotationOrReflection",r[r.NoScale=3]="NoScale",r[r.NoScaleOrReflection=4]="NoScaleOrReflection",r))(ee||{});class Nm{constructor(){this.size=null,this.names=null,this.values=null,this.renderObject=null}get width(){const t=this.texture;return t.trim?t.trim.width:t.orig.width}get height(){const t=this.texture;return t.trim?t.trim.height:t.orig.height}get u(){return this.texture._uvs.x0}get v(){return this.texture._uvs.y0}get u2(){return this.texture._uvs.x2}get v2(){return this.texture._uvs.y2}get offsetX(){const t=this.texture;return t.trim?t.trim.x:0}get offsetY(){return this.spineOffsetY}get pixiOffsetY(){const t=this.texture;return t.trim?t.trim.y:0}get spineOffsetY(){const t=this.texture;return this.originalHeight-this.height-(t.trim?t.trim.y:0)}get originalWidth(){return this.texture.orig.width}get originalHeight(){return this.texture.orig.height}get x(){return this.texture.frame.x}get y(){return this.texture.frame.y}get rotate(){return this.texture.rotate!==0}get degrees(){return(360-this.texture.rotate*45)%360}}class wE{constructor(){this.array=new Array}add(t){const e=this.contains(t);return this.array[t|0]=t|0,!e}contains(t){return this.array[t|0]!=null}remove(t){this.array[t|0]=void 0}clear(){this.array.length=0}}const Lr=class{constructor(r=0,t=0,e=0,i=0){this.r=r,this.g=t,this.b=e,this.a=i}set(r,t,e,i){return this.r=r,this.g=t,this.b=e,this.a=i,this.clamp()}setFromColor(r){return this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this}setFromString(r){return r=r.charAt(0)=="#"?r.substr(1):r,this.r=parseInt(r.substr(0,2),16)/255,this.g=parseInt(r.substr(2,2),16)/255,this.b=parseInt(r.substr(4,2),16)/255,this.a=r.length!=8?1:parseInt(r.substr(6,2),16)/255,this}add(r,t,e,i){return this.r+=r,this.g+=t,this.b+=e,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(r,t){r.r=((t&4278190080)>>>24)/255,r.g=((t&16711680)>>>16)/255,r.b=((t&65280)>>>8)/255,r.a=(t&255)/255}static rgb888ToColor(r,t){r.r=((t&16711680)>>>16)/255,r.g=((t&65280)>>>8)/255,r.b=(t&255)/255}static fromString(r){return new Lr().setFromString(r)}};let be=Lr;be.WHITE=new Lr(1,1,1,1),be.RED=new Lr(1,0,0,1),be.GREEN=new Lr(0,1,0,1),be.BLUE=new Lr(0,0,1,1),be.MAGENTA=new Lr(1,0,1,1);const Oi=class{static clamp(r,t,e){return r<t?t:r>e?e:r}static cosDeg(r){return Math.cos(r*Oi.degRad)}static sinDeg(r){return Math.sin(r*Oi.degRad)}static signum(r){return Math.sign(r)}static toInt(r){return r>0?Math.floor(r):Math.ceil(r)}static cbrt(r){const t=Math.pow(Math.abs(r),.3333333333333333);return r<0?-t:t}static randomTriangular(r,t){return Oi.randomTriangularWith(r,t,(r+t)*.5)}static randomTriangularWith(r,t,e){const i=Math.random(),s=t-r;return i<=(e-r)/s?r+Math.sqrt(i*s*(e-r)):t-Math.sqrt((1-i)*s*(t-e))}static isPowerOfTwo(r){return r&&(r&r-1)===0}};let N=Oi;N.PI=3.1415927,N.PI2=Oi.PI*2,N.radiansToDegrees=180/Oi.PI,N.radDeg=Oi.radiansToDegrees,N.degreesToRadians=Oi.PI/180,N.degRad=Oi.degreesToRadians;class AE{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}}class SE extends AE{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(t*2,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2==0?-2:2)+1}}class CE extends SE{applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}const vs=class{static arrayCopy(r,t,e,i,s){for(let n=t,a=i;n<t+s;n++,a++)e[a]=r[n]}static arrayFill(r,t,e,i){for(let s=t;s<e;s++)r[s]=i}static setArraySize(r,t,e=0){const i=r.length;if(i==t)return r;if(r.length=t,i<t)for(let s=i;s<t;s++)r[s]=e;return r}static ensureArrayCapacity(r,t,e=0){return r.length>=t?r:vs.setArraySize(r,t,e)}static newArray(r,t){const e=new Array(r);for(let i=0;i<r;i++)e[i]=t;return e}static newFloatArray(r){if(vs.SUPPORTS_TYPED_ARRAYS)return new Float32Array(r);const t=new Array(r);for(let e=0;e<t.length;e++)t[e]=0;return t}static newShortArray(r){if(vs.SUPPORTS_TYPED_ARRAYS)return new Int16Array(r);const t=new Array(r);for(let e=0;e<t.length;e++)t[e]=0;return t}static toFloatArray(r){return vs.SUPPORTS_TYPED_ARRAYS?new Float32Array(r):r}static toSinglePrecision(r){return vs.SUPPORTS_TYPED_ARRAYS?Math.fround(r):r}static webkit602BugfixHelper(r,t){}static contains(r,t,e=!0){for(let i=0;i<r.length;i++)if(r[i]==t)return!0;return!1}static enumValue(r,t){return r[t[0].toUpperCase()+t.slice(1)]}};let Q=vs;Q.SUPPORTS_TYPED_ARRAYS=typeof Float32Array<"u";class PE{constructor(t){this.items=new Array,this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}}class RE{constructor(t=0,e=0){this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){const t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){const t=this.length();return t!=0&&(this.x/=t,this.y/=t),this}}const IE={yDown:!0,FAIL_ON_NON_EXISTING_SKIN:!1,GLOBAL_AUTO_UPDATE:!0,GLOBAL_DELAY_LIMIT:0},rr=[0,0,0];class ME extends Ci{constructor(){super(...arguments),this.region=null,this.attachment=null}}class DE extends xb{constructor(t,e,i,s,n){super(t,e,i,s,n),this.region=null,this.attachment=null}}const km=class extends $t{constructor(r){if(super(),!r)throw new Error("The spineData param is required.");if(typeof r=="string")throw new Error('spineData param cant be string. Please use spine.Spine.fromAtlas("YOUR_RESOURCE_NAME") from now on.');this.spineData=r,this.createSkeleton(r),this.slotContainers=[],this.tempClipContainers=[];for(let t=0,e=this.skeleton.slots.length;t<e;t++){const i=this.skeleton.slots[t],s=i.getAttachment(),n=this.newContainer();if(this.slotContainers.push(n),this.addChild(n),this.tempClipContainers.push(null),!!s)if(s.type===fi.Region){const a=s.name,o=this.createSprite(i,s,a);i.currentSprite=o,i.currentSpriteName=a,n.addChild(o)}else if(s.type===fi.Mesh){const a=this.createMesh(i,s);i.currentMesh=a,i.currentMeshId=s.id,i.currentMeshName=s.name,n.addChild(a)}else s.type===fi.Clipping&&(this.createGraphics(i,s),n.addChild(i.clippingContainer),n.addChild(i.currentGraphics))}this.tintRgb=new Float32Array([1,1,1]),this.autoUpdate=!0,this.visible=!0}get debug(){return this._debug}set debug(r){var t;r!=this._debug&&((t=this._debug)==null||t.unregisterSpine(this),r==null||r.registerSpine(this),this._debug=r)}get autoUpdate(){return this._autoUpdate}set autoUpdate(r){r!==this._autoUpdate&&(this._autoUpdate=r,this.updateTransform=r?km.prototype.autoUpdateTransform:$t.prototype.updateTransform)}get tint(){return jn(this.tintRgb)}set tint(r){this.tintRgb=Ly(r,this.tintRgb)}get delayLimit(){return(typeof this.localDelayLimit<"u"?this.localDelayLimit:IE.GLOBAL_DELAY_LIMIT)||Number.MAX_VALUE}update(r){var l;const t=this.delayLimit;if(r>t&&(r=t),this.state.update(r),this.state.apply(this.skeleton),!this.skeleton)return;this.skeleton.updateWorldTransform();const e=this.skeleton.slots,i=this.color;let s=null,n=null;i?(s=i.light,n=i.dark):s=this.tintRgb;for(let c=0,d=e.length;c<d;c++){const u=e[c],f=u.getAttachment(),p=this.slotContainers[c];if(!f){p.visible=!1;continue}let m=null;f.sequence&&f.sequence.apply(u,f);let g=f.region;const y=f.color;switch(f!=null&&f.type){case fi.Region:if(p.transform.setFromMatrix(u.bone.matrix),g=f.region,u.currentMesh&&(u.currentMesh.visible=!1,u.currentMesh=null,u.currentMeshId=void 0,u.currentMeshName=void 0),!g){u.currentSprite&&(u.currentSprite.renderable=!1);break}if(!u.currentSpriteName||u.currentSpriteName!==f.name){const x=f.name;if(u.currentSprite&&(u.currentSprite.visible=!1),u.sprites=u.sprites||{},u.sprites[x]!==void 0)u.sprites[x].visible=!0;else{const b=this.createSprite(u,f,x);p.addChild(b)}u.currentSprite=u.sprites[x],u.currentSpriteName=x}u.currentSprite.renderable=!0,u.hackRegion||this.setSpriteRegion(f,u.currentSprite,g),u.currentSprite.color?m=u.currentSprite.color:(rr[0]=s[0]*u.color.r*y.r,rr[1]=s[1]*u.color.g*y.g,rr[2]=s[2]*u.color.b*y.b,u.currentSprite.tint=jn(rr)),u.currentSprite.blendMode=u.blendMode;break;case fi.Mesh:if(u.currentSprite){u.currentSprite.visible=!1,u.currentSprite=null,u.currentSpriteName=void 0;const x=new sa;x._parentID=-1,x._worldID=p.transform._worldID,p.transform=x}if(!g){u.currentMesh&&(u.currentMesh.renderable=!1);break}const _=f.id;if(u.currentMeshId===void 0||u.currentMeshId!==_){const x=_;if(u.currentMesh&&(u.currentMesh.visible=!1),u.meshes=u.meshes||{},u.meshes[x]!==void 0)u.meshes[x].visible=!0;else{const b=this.createMesh(u,f);p.addChild(b)}u.currentMesh=u.meshes[x],u.currentMeshName=f.name,u.currentMeshId=x}u.currentMesh.renderable=!0,f.computeWorldVerticesOld(u,u.currentMesh.vertices),u.currentMesh.color?m=u.currentMesh.color:(rr[0]=s[0]*u.color.r*y.r,rr[1]=s[1]*u.color.g*y.g,rr[2]=s[2]*u.color.b*y.b,u.currentMesh.tint=jn(rr)),u.currentMesh.blendMode=u.blendMode,u.hackRegion||this.setMeshRegion(f,u.currentMesh,g);break;case fi.Clipping:u.currentGraphics||(this.createGraphics(u,f),p.addChild(u.clippingContainer),p.addChild(u.currentGraphics)),this.updateGraphics(u,f),p.alpha=1,p.visible=!0;continue;default:p.visible=!1;continue}if(p.visible=!0,m){let v=u.color.r*y.r,_=u.color.g*y.g,x=u.color.b*y.b;m.setLight(s[0]*v+n[0]*(1-v),s[1]*_+n[1]*(1-_),s[2]*x+n[2]*(1-x)),u.darkColor?(v=u.darkColor.r,_=u.darkColor.g,x=u.darkColor.b):(v=0,_=0,x=0),m.setDark(s[0]*v+n[0]*(1-v),s[1]*_+n[1]*(1-_),s[2]*x+n[2]*(1-x))}p.alpha=u.color.a}const a=this.skeleton.drawOrder;let o=null,h=null;for(let c=0,d=a.length;c<d;c++){const u=e[a[c].data.index],f=this.slotContainers[a[c].data.index];if(h||f.parent!==null&&f.parent!==this&&(f.parent.removeChild(f),f.parent=this),u.currentGraphics&&u.getAttachment())h=u.clippingContainer,o=u.getAttachment(),h.children.length=0,this.children[c]=f,o.endSlot===u.data&&(o.endSlot=null);else if(h){let p=this.tempClipContainers[c];p||(p=this.tempClipContainers[c]=this.newContainer(),p.visible=!1),this.children[c]=p,f.parent=null,h.addChild(f),o.endSlot==u.data&&(h.renderable=!0,h=null,o=null)}else this.children[c]=f}(l=this._debug)==null||l.renderDebug(this)}setSpriteRegion(r,t,e){t.attachment===r&&t.region===e||(t.region=e,t.attachment=r,t.texture=e.texture,t.rotation=r.rotation*N.degRad,t.position.x=r.x,t.position.y=r.y,t.alpha=r.color.a,e.size?(t.scale.x=e.size.width/e.originalWidth,t.scale.y=-e.size.height/e.originalHeight):(t.scale.x=r.scaleX*r.width/e.originalWidth,t.scale.y=-r.scaleY*r.height/e.originalHeight))}setMeshRegion(r,t,e){t.attachment===r&&t.region===e||(t.region=e,t.attachment=r,t.texture=e.texture,e.texture.updateUvs(),t.uvBuffer.update(r.regionUVs))}autoUpdateTransform(){{this.lastTime=this.lastTime||Date.now();const r=(Date.now()-this.lastTime)*.001;this.lastTime=Date.now(),this.update(r)}$t.prototype.updateTransform.call(this)}createSprite(r,t,e){let i=t.region;r.hackAttachment===t&&(i=r.hackRegion);const s=i?i.texture:null,n=this.newSprite(s);return n.anchor.set(.5),i&&this.setSpriteRegion(t,n,t.region),r.sprites=r.sprites||{},r.sprites[e]=n,n}createMesh(r,t){let e=t.region;r.hackAttachment===t&&(e=r.hackRegion,r.hackAttachment=null,r.hackRegion=null);const i=this.newMesh(e?e.texture:null,new Float32Array(t.regionUVs.length),t.regionUVs,new Uint16Array(t.triangles),Le.TRIANGLES);return typeof i._canvasPadding<"u"&&(i._canvasPadding=1.5),i.alpha=t.color.a,i.region=t.region,e&&this.setMeshRegion(t,i,e),r.meshes=r.meshes||{},r.meshes[t.id]=i,i}createGraphics(r,t){const e=this.newGraphics(),i=new Hi([]);return e.clear(),e.beginFill(16777215,1),e.drawPolygon(i),e.renderable=!1,r.currentGraphics=e,r.clippingContainer=this.newContainer(),r.clippingContainer.mask=r.currentGraphics,e}updateGraphics(r,t){const e=r.currentGraphics.geometry,i=e.graphicsData[0].shape.points,s=t.worldVerticesLength;i.length=s,t.computeWorldVertices(r,0,s,i,0,2),e.invalidate()}hackTextureBySlotIndex(r,t=null,e=null){const i=this.skeleton.slots[r];if(!i)return!1;const s=i.getAttachment();let n=s.region;return t?(n=new Nm,n.texture=t,n.size=e,i.hackRegion=n,i.hackAttachment=s):(i.hackRegion=null,i.hackAttachment=null),i.currentSprite?this.setSpriteRegion(s,i.currentSprite,n):i.currentMesh&&this.setMeshRegion(s,i.currentMesh,n),!0}hackTextureBySlotName(r,t=null,e=null){const i=this.skeleton.findSlotIndex(r);return i==-1?!1:this.hackTextureBySlotIndex(i,t,e)}hackTextureAttachment(r,t,e,i=null){const s=this.skeleton.findSlotIndex(r),n=this.skeleton.getAttachmentByName(r,t);n.region.texture=e;const a=this.skeleton.slots[s];if(!a)return!1;const o=a.getAttachment();if(t===o.name){let h=n.region;return e?(h=new Nm,h.texture=e,h.size=i,a.hackRegion=h,a.hackAttachment=o):(a.hackRegion=null,a.hackAttachment=null),a.currentSprite&&a.currentSprite.region!=h?(this.setSpriteRegion(o,a.currentSprite,h),a.currentSprite.region=h):a.currentMesh&&a.currentMesh.region!=h&&this.setMeshRegion(o,a.currentMesh,h),!0}return!1}newContainer(){return new $t}newSprite(r){return new ME(r)}newGraphics(){return new en}newMesh(r,t,e,i,s){return new DE(r,t,e,i,s)}transformHack(){return 1}hackAttachmentGroups(r,t,e){if(!r)return;const i=[],s=[];for(let n=0,a=this.skeleton.slots.length;n<a;n++){const o=this.skeleton.slots[n],h=o.currentSpriteName||o.currentMeshName||"",l=o.currentSprite||o.currentMesh;h.endsWith(r)?(l.parentGroup=t,s.push(l)):e&&l&&(l.parentGroup=e,i.push(l))}return[i,s]}destroy(r){this.debug=null;for(let t=0,e=this.skeleton.slots.length;t<e;t++){const i=this.skeleton.slots[t];for(const s in i.meshes)i.meshes[s].destroy(r);i.meshes=null;for(const s in i.sprites)i.sprites[s].destroy(r);i.sprites=null}for(let t=0,e=this.slotContainers.length;t<e;t++)this.slotContainers[t].destroy(r);this.spineData=null,this.skeleton=null,this.slotContainers=null,this.stateData=null,this.state=null,this.tempClipContainers=null,super.destroy(r)}};let Ec=km;Ec.clippingPolygon=[],Object.defineProperty(Ec.prototype,"visible",{get(){return this._visible},set(r){r!==this._visible&&(this._visible=r,r&&(this.lastTime=0))}});class Um{constructor(t){if(t==null)throw new Error("name cannot be null.");this.name=t}}const Gm=class extends Um{constructor(r){super(r),this.id=(Gm.nextID++&65535)<<11,this.worldVerticesLength=0,this.deformAttachment=this}computeWorldVerticesOld(r,t){this.computeWorldVertices(r,0,this.worldVerticesLength,t,0,2)}computeWorldVertices(r,t,e,i,s,n){e=s+(e>>1)*n;const a=r.bone.skeleton,o=r.deform;let h=this.vertices;const l=this.bones;if(l==null){o.length>0&&(h=o);const f=r.bone.matrix,p=f.tx,m=f.ty,g=f.a,y=f.c,v=f.b,_=f.d;for(let x=t,b=s;b<e;x+=2,b+=n){const E=h[x],T=h[x+1];i[b]=E*g+T*y+p,i[b+1]=E*v+T*_+m}return}let c=0,d=0;for(let f=0;f<t;f+=2){const p=l[c];c+=p+1,d+=p}const u=a.bones;if(o.length==0)for(let f=s,p=d*3;f<e;f+=n){let m=0,g=0,y=l[c++];for(y+=c;c<y;c++,p+=3){const v=u[l[c]].matrix,_=h[p],x=h[p+1],b=h[p+2];m+=(_*v.a+x*v.c+v.tx)*b,g+=(_*v.b+x*v.d+v.ty)*b}i[f]=m,i[f+1]=g}else{const f=o;for(let p=s,m=d*3,g=d<<1;p<e;p+=n){let y=0,v=0,_=l[c++];for(_+=c;c<_;c++,m+=3,g+=2){const x=u[l[c]].matrix,b=h[m]+f[g],E=h[m+1]+f[g+1],T=h[m+2];y+=(b*x.a+E*x.c+x.tx)*T,v+=(b*x.b+E*x.d+x.ty)*T}i[p]=y,i[p+1]=v}}}copyTo(r){this.bones!=null?(r.bones=new Array(this.bones.length),Q.arrayCopy(this.bones,0,r.bones,0,this.bones.length)):r.bones=null,this.vertices!=null?(r.vertices=Q.newFloatArray(this.vertices.length),Q.arrayCopy(this.vertices,0,r.vertices,0,this.vertices.length)):r.vertices=null,r.worldVerticesLength=this.worldVerticesLength,r.deformAttachment=this.deformAttachment}};let wc=Gm;wc.nextID=0;class io extends wc{constructor(t){super(t),this.type=fi.Mesh,this.color=new be(1,1,1,1),this.tempColor=new be(0,0,0,0)}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t!=null&&(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!=null)return this.newLinkedMesh();const t=new io(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Float32Array(this.regionUVs.length),Q.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.triangles=new Array(this.triangles.length),Q.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,this.edges!=null&&(t.edges=new Array(this.edges.length),Q.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}newLinkedMesh(){const t=new io(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),t.deformAttachment=this.deformAttachment,t.setParentMesh(this.parentMesh!=null?this.parentMesh:this),t}}class vn extends wc{constructor(t){super(t),this.type=fi.Path,this.closed=!1,this.constantSpeed=!1,this.color=new be(1,1,1,1)}copy(){const t=new vn(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),Q.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}}class Vm{constructor(t,e){if(this.deform=new Array,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new be,this.darkColor=t.darkColor==null?null:new be,this.setToSetupPose(),this.blendMode=this.data.blendMode}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.deform.length=0)}setAttachmentTime(t){this.attachmentTime=this.bone.skeleton.time-t}getAttachmentTime(){return this.bone.skeleton.time-this.attachmentTime}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor!=null&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName==null?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))}}const jt=class extends Um{constructor(r){super(r),this.type=fi.Region,this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new be(1,1,1,1),this.offset=Q.newFloatArray(8),this.uvs=Q.newFloatArray(8),this.tempColor=new be(1,1,1,1)}updateOffset(){const r=this.width/this.region.originalWidth*this.scaleX,t=this.height/this.region.originalHeight*this.scaleY,e=-this.width/2*this.scaleX+this.region.offsetX*r,i=-this.height/2*this.scaleY+this.region.offsetY*t,s=e+this.region.width*r,n=i+this.region.height*t,a=this.rotation*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=e*o+this.x,c=e*h,d=i*o+this.y,u=i*h,f=s*o+this.x,p=s*h,m=n*o+this.y,g=n*h,y=this.offset;y[jt.OX1]=l-u,y[jt.OY1]=d+c,y[jt.OX2]=l-g,y[jt.OY2]=m+c,y[jt.OX3]=f-g,y[jt.OY3]=m+p,y[jt.OX4]=f-u,y[jt.OY4]=d+p}setRegion(r){this.region=r;const t=this.uvs;r.rotate?(t[2]=r.u,t[3]=r.v2,t[4]=r.u,t[5]=r.v,t[6]=r.u2,t[7]=r.v,t[0]=r.u2,t[1]=r.v2):(t[0]=r.u,t[1]=r.v2,t[2]=r.u,t[3]=r.v,t[4]=r.u2,t[5]=r.v,t[6]=r.u2,t[7]=r.v2)}computeWorldVertices(r,t,e,i){const s=this.offset,n=r instanceof Vm?r.bone.matrix:r.matrix,a=n.tx,o=n.ty,h=n.a,l=n.c,c=n.b,d=n.d;let u=0,f=0;u=s[jt.OX1],f=s[jt.OY1],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o,e+=i,u=s[jt.OX2],f=s[jt.OY2],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o,e+=i,u=s[jt.OX3],f=s[jt.OY3],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o,e+=i,u=s[jt.OX4],f=s[jt.OY4],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o}copy(){const r=new jt(this.name);return r.region=this.region,r.rendererObject=this.rendererObject,r.path=this.path,r.x=this.x,r.y=this.y,r.scaleX=this.scaleX,r.scaleY=this.scaleY,r.rotation=this.rotation,r.width=this.width,r.height=this.height,Q.arrayCopy(this.uvs,0,r.uvs,0,8),Q.arrayCopy(this.offset,0,r.offset,0,8),r.color.setFromColor(this.color),r}};let et=jt;et.OX1=0,et.OY1=1,et.OX2=2,et.OY2=3,et.OX3=4,et.OY3=5,et.OX4=6,et.OY4=7,et.X1=0,et.Y1=1,et.C1R=2,et.C1G=3,et.C1B=4,et.C1A=5,et.U1=6,et.V1=7,et.X2=8,et.Y2=9,et.C2R=10,et.C2G=11,et.C2B=12,et.C2A=13,et.U2=14,et.V2=15,et.X3=16,et.Y3=17,et.C3R=18,et.C3G=19,et.C3B=20,et.C3A=21,et.U3=22,et.V3=23,et.X4=24,et.Y4=25,et.C4R=26,et.C4G=27,et.C4B=28,et.C4A=29,et.U4=30,et.V4=31,new CE(2);class fe{constructor(t,e,i){if(t==null)throw new Error("name cannot be null.");if(e==null)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(let s=0;s<e.length;s++)this.timelineIds[e[s].getPropertyId()]=!0;this.duration=i}hasTimeline(t){return this.timelineIds[t]==!0}apply(t,e,i,s,n,a,o,h){if(t==null)throw new Error("skeleton cannot be null.");s&&this.duration!=0&&(i%=this.duration,e>0&&(e%=this.duration));const l=this.timelines;for(let c=0,d=l.length;c<d;c++)l[c].apply(t,e,i,n,a,o,h)}static binarySearch(t,e,i=1){let s=0,n=t.length/i-2;if(n==0)return i;let a=n>>>1;for(;;){if(t[(a+1)*i]<=e?s=a+1:n=a,s==n)return(s+1)*i;a=s+n>>>1}}static linearSearch(t,e,i){for(let s=0,n=t.length-i;s<=n;s+=i)if(t[s]>e)return s;return-1}}const Lt=class{constructor(r){if(r<=0)throw new Error(`frameCount must be > 0: ${r}`);this.curves=Q.newFloatArray((r-1)*Lt.BEZIER_SIZE)}getFrameCount(){return this.curves.length/Lt.BEZIER_SIZE+1}setLinear(r){this.curves[r*Lt.BEZIER_SIZE]=Lt.LINEAR}setStepped(r){this.curves[r*Lt.BEZIER_SIZE]=Lt.STEPPED}getCurveType(r){const t=r*Lt.BEZIER_SIZE;if(t==this.curves.length)return Lt.LINEAR;const e=this.curves[t];return e==Lt.LINEAR?Lt.LINEAR:e==Lt.STEPPED?Lt.STEPPED:Lt.BEZIER}setCurve(r,t,e,i,s){const n=(-t*2+i)*.03,a=(-e*2+s)*.03,o=((t-i)*3+1)*.006,h=((e-s)*3+1)*.006;let l=n*2+o,c=a*2+h,d=t*.3+n+o*.16666667,u=e*.3+a+h*.16666667,f=r*Lt.BEZIER_SIZE;const p=this.curves;p[f++]=Lt.BEZIER;let m=d,g=u;for(let y=f+Lt.BEZIER_SIZE-1;f<y;f+=2)p[f]=m,p[f+1]=g,d+=l,u+=c,l+=o,c+=h,m+=d,g+=u}getCurvePercent(r,t){t=N.clamp(t,0,1);const e=this.curves;let i=r*Lt.BEZIER_SIZE;const s=e[i];if(s==Lt.LINEAR)return t;if(s==Lt.STEPPED)return 0;i++;let n=0;for(let o=i,h=i+Lt.BEZIER_SIZE-1;i<h;i+=2)if(n=e[i],n>=t){let l,c;return i==o?(l=0,c=0):(l=e[i-2],c=e[i-1]),c+(e[i+1]-c)*(t-l)/(n-l)}const a=e[i-1];return a+(1-a)*(t-n)/(1-n)}};let De=Lt;De.LINEAR=0,De.STEPPED=1,De.BEZIER=2,De.BEZIER_SIZE=10*2-1;const sr=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r<<1)}getPropertyId(){return 0+this.boneIndex}setFrame(r,t,e){r<<=1,this.frames[r]=t,this.frames[r+sr.ROTATION]=e}apply(r,t,e,i,s,n,a){const o=this.frames,h=r.bones[this.boneIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.rotation=h.data.rotation;return;case j.first:const p=h.data.rotation-h.rotation;h.rotation+=(p-(16384-(16384.499999999996-p/360|0))*360)*s}return}if(e>=o[o.length-sr.ENTRIES]){let p=o[o.length+sr.PREV_ROTATION];switch(n){case j.setup:h.rotation=h.data.rotation+p*s;break;case j.first:case j.replace:p+=h.data.rotation-h.rotation,p-=(16384-(16384.499999999996-p/360|0))*360;case j.add:h.rotation+=p*s}return}const l=fe.binarySearch(o,e,sr.ENTRIES),c=o[l+sr.PREV_ROTATION],d=o[l],u=this.getCurvePercent((l>>1)-1,1-(e-d)/(o[l+sr.PREV_TIME]-d));let f=o[l+sr.ROTATION]-c;switch(f=c+(f-(16384-(16384.499999999996-f/360|0))*360)*u,n){case j.setup:h.rotation=h.data.rotation+(f-(16384-(16384.499999999996-f/360|0))*360)*s;break;case j.first:case j.replace:f+=h.data.rotation-h.rotation;case j.add:h.rotation+=(f-(16384-(16384.499999999996-f/360|0))*360)*s}}};let Be=sr;Be.ENTRIES=2,Be.PREV_TIME=-2,Be.PREV_ROTATION=-1,Be.ROTATION=1;const ne=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r*ne.ENTRIES)}getPropertyId(){return(1<<24)+this.boneIndex}setFrame(r,t,e,i){r*=ne.ENTRIES,this.frames[r]=t,this.frames[r+ne.X]=e,this.frames[r+ne.Y]=i}apply(r,t,e,i,s,n,a){const o=this.frames,h=r.bones[this.boneIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.x=h.data.x,h.y=h.data.y;return;case j.first:h.x+=(h.data.x-h.x)*s,h.y+=(h.data.y-h.y)*s}return}let l=0,c=0;if(e>=o[o.length-ne.ENTRIES])l=o[o.length+ne.PREV_X],c=o[o.length+ne.PREV_Y];else{const d=fe.binarySearch(o,e,ne.ENTRIES);l=o[d+ne.PREV_X],c=o[d+ne.PREV_Y];const u=o[d],f=this.getCurvePercent(d/ne.ENTRIES-1,1-(e-u)/(o[d+ne.PREV_TIME]-u));l+=(o[d+ne.X]-l)*f,c+=(o[d+ne.Y]-c)*f}switch(n){case j.setup:h.x=h.data.x+l*s,h.y=h.data.y+c*s;break;case j.first:case j.replace:h.x+=(h.data.x+l-h.x)*s,h.y+=(h.data.y+c-h.y)*s;break;case j.add:h.x+=l*s,h.y+=c*s}}};let bs=ne;bs.ENTRIES=3,bs.PREV_TIME=-3,bs.PREV_X=-2,bs.PREV_Y=-1,bs.X=1,bs.Y=2;const St=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r*St.ENTRIES)}getPropertyId(){return(5<<24)+this.slotIndex}setFrame(r,t,e,i,s,n){r*=St.ENTRIES,this.frames[r]=t,this.frames[r+St.R]=e,this.frames[r+St.G]=i,this.frames[r+St.B]=s,this.frames[r+St.A]=n}apply(r,t,e,i,s,n,a){const o=r.slots[this.slotIndex];if(!o.bone.active)return;const h=this.frames;if(e<h[0]){switch(n){case j.setup:o.color.setFromColor(o.data.color);return;case j.first:const f=o.color,p=o.data.color;f.add((p.r-f.r)*s,(p.g-f.g)*s,(p.b-f.b)*s,(p.a-f.a)*s)}return}let l=0,c=0,d=0,u=0;if(e>=h[h.length-St.ENTRIES]){const f=h.length;l=h[f+St.PREV_R],c=h[f+St.PREV_G],d=h[f+St.PREV_B],u=h[f+St.PREV_A]}else{const f=fe.binarySearch(h,e,St.ENTRIES);l=h[f+St.PREV_R],c=h[f+St.PREV_G],d=h[f+St.PREV_B],u=h[f+St.PREV_A];const p=h[f],m=this.getCurvePercent(f/St.ENTRIES-1,1-(e-p)/(h[f+St.PREV_TIME]-p));l+=(h[f+St.R]-l)*m,c+=(h[f+St.G]-c)*m,d+=(h[f+St.B]-d)*m,u+=(h[f+St.A]-u)*m}if(s==1)o.color.set(l,c,d,u);else{const f=o.color;n==j.setup&&f.setFromColor(o.data.color),f.add((l-f.r)*s,(c-f.g)*s,(d-f.b)*s,(u-f.a)*s)}}};let pi=St;pi.ENTRIES=5,pi.PREV_TIME=-5,pi.PREV_R=-4,pi.PREV_G=-3,pi.PREV_B=-2,pi.PREV_A=-1,pi.R=1,pi.G=2,pi.B=3,pi.A=4;const ot=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r*ot.ENTRIES)}getPropertyId(){return(14<<24)+this.slotIndex}setFrame(r,t,e,i,s,n,a,o,h){r*=ot.ENTRIES,this.frames[r]=t,this.frames[r+ot.R]=e,this.frames[r+ot.G]=i,this.frames[r+ot.B]=s,this.frames[r+ot.A]=n,this.frames[r+ot.R2]=a,this.frames[r+ot.G2]=o,this.frames[r+ot.B2]=h}apply(r,t,e,i,s,n,a){const o=r.slots[this.slotIndex];if(!o.bone.active)return;const h=this.frames;if(e<h[0]){switch(n){case j.setup:o.color.setFromColor(o.data.color),o.darkColor.setFromColor(o.data.darkColor);return;case j.first:const g=o.color,y=o.darkColor,v=o.data.color,_=o.data.darkColor;g.add((v.r-g.r)*s,(v.g-g.g)*s,(v.b-g.b)*s,(v.a-g.a)*s),y.add((_.r-y.r)*s,(_.g-y.g)*s,(_.b-y.b)*s,0)}return}let l=0,c=0,d=0,u=0,f=0,p=0,m=0;if(e>=h[h.length-ot.ENTRIES]){const g=h.length;l=h[g+ot.PREV_R],c=h[g+ot.PREV_G],d=h[g+ot.PREV_B],u=h[g+ot.PREV_A],f=h[g+ot.PREV_R2],p=h[g+ot.PREV_G2],m=h[g+ot.PREV_B2]}else{const g=fe.binarySearch(h,e,ot.ENTRIES);l=h[g+ot.PREV_R],c=h[g+ot.PREV_G],d=h[g+ot.PREV_B],u=h[g+ot.PREV_A],f=h[g+ot.PREV_R2],p=h[g+ot.PREV_G2],m=h[g+ot.PREV_B2];const y=h[g],v=this.getCurvePercent(g/ot.ENTRIES-1,1-(e-y)/(h[g+ot.PREV_TIME]-y));l+=(h[g+ot.R]-l)*v,c+=(h[g+ot.G]-c)*v,d+=(h[g+ot.B]-d)*v,u+=(h[g+ot.A]-u)*v,f+=(h[g+ot.R2]-f)*v,p+=(h[g+ot.G2]-p)*v,m+=(h[g+ot.B2]-m)*v}if(s==1)o.color.set(l,c,d,u),o.darkColor.set(f,p,m,1);else{const g=o.color,y=o.darkColor;n==j.setup&&(g.setFromColor(o.data.color),y.setFromColor(o.data.darkColor)),g.add((l-g.r)*s,(c-g.g)*s,(d-g.b)*s,(u-g.a)*s),y.add((f-y.r)*s,(p-y.g)*s,(m-y.b)*s,0)}}};let ie=ot;ie.ENTRIES=8,ie.PREV_TIME=-8,ie.PREV_R=-7,ie.PREV_G=-6,ie.PREV_B=-5,ie.PREV_A=-4,ie.PREV_R2=-3,ie.PREV_G2=-2,ie.PREV_B2=-1,ie.R=1,ie.G=2,ie.B=3,ie.A=4,ie.R2=5,ie.G2=6,ie.B2=7;class ro{constructor(t){this.frames=Q.newFloatArray(t),this.attachmentNames=new Array(t)}getPropertyId(){return(4<<24)+this.slotIndex}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i}apply(t,e,i,s,n,a,o){const h=t.slots[this.slotIndex];if(!h.bone.active)return;if(o==ve.mixOut){a==j.setup&&this.setAttachment(t,h,h.data.attachmentName);return}const l=this.frames;if(i<l[0]){(a==j.setup||a==j.first)&&this.setAttachment(t,h,h.data.attachmentName);return}let c=0;i>=l[l.length-1]?c=l.length-1:c=fe.binarySearch(l,i,1)-1;const d=this.attachmentNames[c];t.slots[this.slotIndex].setAttachment(d==null?null:t.getAttachment(this.slotIndex,d))}setAttachment(t,e,i){e.setAttachment(i==null?null:t.getAttachment(this.slotIndex,i))}}class BE{constructor(t){this.frames=Q.newFloatArray(t),this.events=new Array(t)}getPropertyId(){return 7<<24}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,i,s,n,a,o){if(s==null)return;const h=this.frames,l=this.frames.length;if(e>i)this.apply(t,e,Number.MAX_VALUE,s,n,a,o),e=-1;else if(e>=h[l-1])return;if(i<h[0])return;let c=0;if(e<h[0])c=0;else{c=fe.binarySearch(h,e);const d=h[c];for(;c>0&&h[c-1]==d;)c--}for(;c<l&&i>=h[c];c++)s.push(this.events[c])}}class Ac{constructor(t){this.frames=Q.newFloatArray(t),this.drawOrders=new Array(t)}getPropertyId(){return 8<<24}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,s,n,a,o){const h=t.drawOrder,l=t.slots;if(o==ve.mixOut&&a==j.setup){Q.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}const c=this.frames;if(i<c[0]){(a==j.setup||a==j.first)&&Q.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}let d=0;i>=c[c.length-1]?d=c.length-1:d=fe.binarySearch(c,i)-1;const u=this.drawOrders[d];if(u==null)Q.arrayCopy(l,0,h,0,l.length);else for(let f=0,p=u.length;f<p;f++)h[f]=l[u[f]]}}const ht=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r*ht.ENTRIES)}getPropertyId(){return(9<<24)+this.ikConstraintIndex}setFrame(r,t,e,i,s,n,a){r*=ht.ENTRIES,this.frames[r]=t,this.frames[r+ht.MIX]=e,this.frames[r+ht.SOFTNESS]=i,this.frames[r+ht.BEND_DIRECTION]=s,this.frames[r+ht.COMPRESS]=n?1:0,this.frames[r+ht.STRETCH]=a?1:0}apply(r,t,e,i,s,n,a){const o=this.frames,h=r.ikConstraints[this.ikConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.mix=h.data.mix,h.softness=h.data.softness,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch;return;case j.first:h.mix+=(h.data.mix-h.mix)*s,h.softness+=(h.data.softness-h.softness)*s,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch}return}if(e>=o[o.length-ht.ENTRIES]){n==j.setup?(h.mix=h.data.mix+(o[o.length+ht.PREV_MIX]-h.data.mix)*s,h.softness=h.data.softness+(o[o.length+ht.PREV_SOFTNESS]-h.data.softness)*s,a==ve.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=o[o.length+ht.PREV_BEND_DIRECTION],h.compress=o[o.length+ht.PREV_COMPRESS]!=0,h.stretch=o[o.length+ht.PREV_STRETCH]!=0)):(h.mix+=(o[o.length+ht.PREV_MIX]-h.mix)*s,h.softness+=(o[o.length+ht.PREV_SOFTNESS]-h.softness)*s,a==ve.mixIn&&(h.bendDirection=o[o.length+ht.PREV_BEND_DIRECTION],h.compress=o[o.length+ht.PREV_COMPRESS]!=0,h.stretch=o[o.length+ht.PREV_STRETCH]!=0));return}const l=fe.binarySearch(o,e,ht.ENTRIES),c=o[l+ht.PREV_MIX],d=o[l+ht.PREV_SOFTNESS],u=o[l],f=this.getCurvePercent(l/ht.ENTRIES-1,1-(e-u)/(o[l+ht.PREV_TIME]-u));n==j.setup?(h.mix=h.data.mix+(c+(o[l+ht.MIX]-c)*f-h.data.mix)*s,h.softness=h.data.softness+(d+(o[l+ht.SOFTNESS]-d)*f-h.data.softness)*s,a==ve.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=o[l+ht.PREV_BEND_DIRECTION],h.compress=o[l+ht.PREV_COMPRESS]!=0,h.stretch=o[l+ht.PREV_STRETCH]!=0)):(h.mix+=(c+(o[l+ht.MIX]-c)*f-h.mix)*s,h.softness+=(d+(o[l+ht.SOFTNESS]-d)*f-h.softness)*s,a==ve.mixIn&&(h.bendDirection=o[l+ht.PREV_BEND_DIRECTION],h.compress=o[l+ht.PREV_COMPRESS]!=0,h.stretch=o[l+ht.PREV_STRETCH]!=0))}};let Oe=ht;Oe.ENTRIES=6,Oe.PREV_TIME=-6,Oe.PREV_MIX=-5,Oe.PREV_SOFTNESS=-4,Oe.PREV_BEND_DIRECTION=-3,Oe.PREV_COMPRESS=-2,Oe.PREV_STRETCH=-1,Oe.MIX=1,Oe.SOFTNESS=2,Oe.BEND_DIRECTION=3,Oe.COMPRESS=4,Oe.STRETCH=5;const Ct=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r*Ct.ENTRIES)}getPropertyId(){return(10<<24)+this.transformConstraintIndex}setFrame(r,t,e,i,s,n){r*=Ct.ENTRIES,this.frames[r]=t,this.frames[r+Ct.ROTATE]=e,this.frames[r+Ct.TRANSLATE]=i,this.frames[r+Ct.SCALE]=s,this.frames[r+Ct.SHEAR]=n}apply(r,t,e,i,s,n,a){const o=this.frames,h=r.transformConstraints[this.transformConstraintIndex];if(!h.active)return;if(e<o[0]){const f=h.data;switch(n){case j.setup:h.rotateMix=f.rotateMix,h.translateMix=f.translateMix,h.scaleMix=f.scaleMix,h.shearMix=f.shearMix;return;case j.first:h.rotateMix+=(f.rotateMix-h.rotateMix)*s,h.translateMix+=(f.translateMix-h.translateMix)*s,h.scaleMix+=(f.scaleMix-h.scaleMix)*s,h.shearMix+=(f.shearMix-h.shearMix)*s}return}let l=0,c=0,d=0,u=0;if(e>=o[o.length-Ct.ENTRIES]){const f=o.length;l=o[f+Ct.PREV_ROTATE],c=o[f+Ct.PREV_TRANSLATE],d=o[f+Ct.PREV_SCALE],u=o[f+Ct.PREV_SHEAR]}else{const f=fe.binarySearch(o,e,Ct.ENTRIES);l=o[f+Ct.PREV_ROTATE],c=o[f+Ct.PREV_TRANSLATE],d=o[f+Ct.PREV_SCALE],u=o[f+Ct.PREV_SHEAR];const p=o[f],m=this.getCurvePercent(f/Ct.ENTRIES-1,1-(e-p)/(o[f+Ct.PREV_TIME]-p));l+=(o[f+Ct.ROTATE]-l)*m,c+=(o[f+Ct.TRANSLATE]-c)*m,d+=(o[f+Ct.SCALE]-d)*m,u+=(o[f+Ct.SHEAR]-u)*m}if(n==j.setup){const f=h.data;h.rotateMix=f.rotateMix+(l-f.rotateMix)*s,h.translateMix=f.translateMix+(c-f.translateMix)*s,h.scaleMix=f.scaleMix+(d-f.scaleMix)*s,h.shearMix=f.shearMix+(u-f.shearMix)*s}else h.rotateMix+=(l-h.rotateMix)*s,h.translateMix+=(c-h.translateMix)*s,h.scaleMix+=(d-h.scaleMix)*s,h.shearMix+=(u-h.shearMix)*s}};let mi=Ct;mi.ENTRIES=5,mi.PREV_TIME=-5,mi.PREV_ROTATE=-4,mi.PREV_TRANSLATE=-3,mi.PREV_SCALE=-2,mi.PREV_SHEAR=-1,mi.ROTATE=1,mi.TRANSLATE=2,mi.SCALE=3,mi.SHEAR=4;const $e=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r*$e.ENTRIES)}getPropertyId(){return(11<<24)+this.pathConstraintIndex}setFrame(r,t,e){r*=$e.ENTRIES,this.frames[r]=t,this.frames[r+$e.VALUE]=e}apply(r,t,e,i,s,n,a){const o=this.frames,h=r.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.position=h.data.position;return;case j.first:h.position+=(h.data.position-h.position)*s}return}let l=0;if(e>=o[o.length-$e.ENTRIES])l=o[o.length+$e.PREV_VALUE];else{const c=fe.binarySearch(o,e,$e.ENTRIES);l=o[c+$e.PREV_VALUE];const d=o[c],u=this.getCurvePercent(c/$e.ENTRIES-1,1-(e-d)/(o[c+$e.PREV_TIME]-d));l+=(o[c+$e.VALUE]-l)*u}n==j.setup?h.position=h.data.position+(l-h.data.position)*s:h.position+=(l-h.position)*s}};let so=$e;so.ENTRIES=2,so.PREV_TIME=-2,so.PREV_VALUE=-1,so.VALUE=1;const ae=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r*ae.ENTRIES)}getPropertyId(){return(13<<24)+this.pathConstraintIndex}setFrame(r,t,e,i){r*=ae.ENTRIES,this.frames[r]=t,this.frames[r+ae.ROTATE]=e,this.frames[r+ae.TRANSLATE]=i}apply(r,t,e,i,s,n,a){const o=this.frames,h=r.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.rotateMix=h.data.rotateMix,h.translateMix=h.data.translateMix;return;case j.first:h.rotateMix+=(h.data.rotateMix-h.rotateMix)*s,h.translateMix+=(h.data.translateMix-h.translateMix)*s}return}let l=0,c=0;if(e>=o[o.length-ae.ENTRIES])l=o[o.length+ae.PREV_ROTATE],c=o[o.length+ae.PREV_TRANSLATE];else{const d=fe.binarySearch(o,e,ae.ENTRIES);l=o[d+ae.PREV_ROTATE],c=o[d+ae.PREV_TRANSLATE];const u=o[d],f=this.getCurvePercent(d/ae.ENTRIES-1,1-(e-u)/(o[d+ae.PREV_TIME]-u));l+=(o[d+ae.ROTATE]-l)*f,c+=(o[d+ae.TRANSLATE]-c)*f}n==j.setup?(h.rotateMix=h.data.rotateMix+(l-h.data.rotateMix)*s,h.translateMix=h.data.translateMix+(c-h.data.translateMix)*s):(h.rotateMix+=(l-h.rotateMix)*s,h.translateMix+=(c-h.translateMix)*s)}};let Ts=ae;Ts.ENTRIES=3,Ts.PREV_TIME=-3,Ts.PREV_ROTATE=-2,Ts.PREV_TRANSLATE=-1,Ts.ROTATE=1,Ts.TRANSLATE=2;const Pt=class{constructor(r){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Hm(this),this.propertyIDs=new wE,this.animationsChanged=!1,this.trackEntryPool=new PE(()=>new Sc),this.data=r}update(r){r*=this.timeScale;const t=this.tracks;for(let e=0,i=t.length;e<i;e++){const s=t[e];if(s==null)continue;s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast;let n=r*s.timeScale;if(s.delay>0){if(s.delay-=n,s.delay>0)continue;n=-s.delay,s.delay=0}let a=s.next;if(a!=null){const o=s.trackLast-a.delay;if(o>=0){for(a.delay=0,a.trackTime+=s.timeScale==0?0:(o/s.timeScale+r)*a.timeScale,s.trackTime+=n,this.setCurrent(e,a,!0);a.mixingFrom!=null;)a.mixTime+=r,a=a.mixingFrom;continue}}else if(s.trackLast>=s.trackEnd&&s.mixingFrom==null){t[e]=null,this.queue.end(s),this.disposeNext(s);continue}if(s.mixingFrom!=null&&this.updateMixingFrom(s,r)){let o=s.mixingFrom;for(s.mixingFrom=null,o!=null&&(o.mixingTo=null);o!=null;)this.queue.end(o),o=o.mixingFrom}s.trackTime+=n}this.queue.drain()}updateMixingFrom(r,t){const e=r.mixingFrom;if(e==null)return!0;const i=this.updateMixingFrom(e,t);return e.animationLast=e.nextAnimationLast,e.trackLast=e.nextTrackLast,r.mixTime>0&&r.mixTime>=r.mixDuration?((e.totalAlpha==0||r.mixDuration==0)&&(r.mixingFrom=e.mixingFrom,e.mixingFrom!=null&&(e.mixingFrom.mixingTo=r),r.interruptAlpha=e.interruptAlpha,this.queue.end(e)),i):(e.trackTime+=t*e.timeScale,r.mixTime+=t,!1)}apply(r){if(r==null)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const t=this.events,e=this.tracks;let i=!1;for(let a=0,o=e.length;a<o;a++){const h=e[a];if(h==null||h.delay>0)continue;i=!0;const l=a==0?j.first:h.mixBlend;let c=h.alpha;h.mixingFrom!=null?c*=this.applyMixingFrom(h,r,l):h.trackTime>=h.trackEnd&&h.next==null&&(c=0);const d=h.animationLast,u=h.getAnimationTime(),f=h.animation.timelines.length,p=h.animation.timelines;if(a==0&&c==1||l==j.add)for(let m=0;m<f;m++){const g=p[m];g instanceof ro?this.applyAttachmentTimeline(g,r,u,l,!0):g.apply(r,d,u,t,c,l,ve.mixIn)}else{const m=h.timelineMode,g=h.timelinesRotation.length==0;g&&Q.setArraySize(h.timelinesRotation,f<<1,null);const y=h.timelinesRotation;for(let v=0;v<f;v++){const _=p[v],x=m[v]==Pt.SUBSEQUENT?l:j.setup;_ instanceof Be?this.applyRotateTimeline(_,r,u,c,x,y,v<<1,g):_ instanceof ro?this.applyAttachmentTimeline(_,r,u,l,!0):_.apply(r,d,u,t,c,x,ve.mixIn)}}this.queueEvents(h,u),t.length=0,h.nextAnimationLast=u,h.nextTrackLast=h.trackTime}const s=this.unkeyedState+Pt.SETUP,n=r.slots;for(let a=0,o=r.slots.length;a<o;a++){const h=n[a];if(h.attachmentState==s){const l=h.data.attachmentName;h.setAttachment(l==null?null:r.getAttachment(h.data.index,l))}}return this.unkeyedState+=2,this.queue.drain(),i}applyMixingFrom(r,t,e){const i=r.mixingFrom;i.mixingFrom!=null&&this.applyMixingFrom(i,t,e);let s=0;r.mixDuration==0?(s=1,e==j.first&&(e=j.setup)):(s=r.mixTime/r.mixDuration,s>1&&(s=1),e!=j.first&&(e=i.mixBlend));const n=s<i.eventThreshold?this.events:null,a=s<i.attachmentThreshold,o=s<i.drawOrderThreshold,h=i.animationLast,l=i.getAnimationTime(),c=i.animation.timelines.length,d=i.animation.timelines,u=i.alpha*r.interruptAlpha,f=u*(1-s);if(e==j.add)for(let p=0;p<c;p++)d[p].apply(t,h,l,n,f,e,ve.mixOut);else{const p=i.timelineMode,m=i.timelineHoldMix,g=i.timelinesRotation.length==0;g&&Q.setArraySize(i.timelinesRotation,c<<1,null);const y=i.timelinesRotation;i.totalAlpha=0;for(let v=0;v<c;v++){const _=d[v];let x=ve.mixOut,b,E=0;switch(p[v]){case Pt.SUBSEQUENT:if(!o&&_ instanceof Ac)continue;b=e,E=f;break;case Pt.FIRST:b=j.setup,E=f;break;case Pt.HOLD_SUBSEQUENT:b=e,E=u;break;case Pt.HOLD_FIRST:b=j.setup,E=u;break;default:b=j.setup;const T=m[v];E=u*Math.max(0,1-T.mixTime/T.mixDuration);break}i.totalAlpha+=E,_ instanceof Be?this.applyRotateTimeline(_,t,l,E,b,y,v<<1,g):_ instanceof ro?this.applyAttachmentTimeline(_,t,l,b,a):(o&&_ instanceof Ac&&b==j.setup&&(x=ve.mixIn),_.apply(t,h,l,n,E,b,x))}}return r.mixDuration>0&&this.queueEvents(i,l),this.events.length=0,i.nextAnimationLast=l,i.nextTrackLast=i.trackTime,s}applyAttachmentTimeline(r,t,e,i,s){const n=t.slots[r.slotIndex];if(!n.bone.active)return;const a=r.frames;if(e<a[0])(i==j.setup||i==j.first)&&this.setAttachment(t,n,n.data.attachmentName,s);else{let o;e>=a[a.length-1]?o=a.length-1:o=fe.binarySearch(a,e)-1,this.setAttachment(t,n,r.attachmentNames[o],s)}n.attachmentState<=this.unkeyedState&&(n.attachmentState=this.unkeyedState+Pt.SETUP)}setAttachment(r,t,e,i){t.setAttachment(e==null?null:r.getAttachment(t.data.index,e)),i&&(t.attachmentState=this.unkeyedState+Pt.CURRENT)}applyRotateTimeline(r,t,e,i,s,n,a,o){if(o&&(n[a]=0),i==1){r.apply(t,0,e,null,1,s,ve.mixIn);return}const h=r,l=h.frames,c=t.bones[h.boneIndex];if(!c.active)return;let d=0,u=0;if(e<l[0])switch(s){case j.setup:c.rotation=c.data.rotation;default:return;case j.first:d=c.rotation,u=c.data.rotation}else if(d=s==j.setup?c.data.rotation:c.rotation,e>=l[l.length-Be.ENTRIES])u=c.data.rotation+l[l.length+Be.PREV_ROTATION];else{const m=fe.binarySearch(l,e,Be.ENTRIES),g=l[m+Be.PREV_ROTATION],y=l[m],v=h.getCurvePercent((m>>1)-1,1-(e-y)/(l[m+Be.PREV_TIME]-y));u=l[m+Be.ROTATION]-g,u-=(16384-(16384.499999999996-u/360|0))*360,u=g+u*v+c.data.rotation,u-=(16384-(16384.499999999996-u/360|0))*360}let f=0,p=u-d;if(p-=(16384-(16384.499999999996-p/360|0))*360,p==0)f=n[a];else{let m=0,g=0;o?(m=0,g=p):(m=n[a],g=n[a+1]);const y=p>0;let v=m>=0;N.signum(g)!=N.signum(p)&&Math.abs(g)<=90&&(Math.abs(m)>180&&(m+=360*N.signum(m)),v=y),f=p+m-m%360,v!=y&&(f+=360*N.signum(m)),n[a]=f}n[a+1]=p,d+=f*i,c.rotation=d-(16384-(16384.499999999996-d/360|0))*360}queueEvents(r,t){const e=r.animationStart,i=r.animationEnd,s=i-e,n=r.trackLast%s,a=this.events;let o=0;const h=a.length;for(;o<h;o++){const c=a[o];if(c.time<n)break;c.time>i||this.queue.event(r,c)}let l=!1;for(r.loop?l=s==0||n>r.trackTime%s:l=t>=i&&r.animationLast<i,l&&this.queue.complete(r);o<h;o++)a[o].time<e||this.queue.event(r,a[o])}clearTracks(){const r=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,e=this.tracks.length;t<e;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=r,this.queue.drain()}clearTrack(r){if(r>=this.tracks.length)return;const t=this.tracks[r];if(t==null)return;this.queue.end(t),this.disposeNext(t);let e=t;for(;;){const i=e.mixingFrom;if(i==null)break;this.queue.end(i),e.mixingFrom=null,e.mixingTo=null,e=i}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(r,t,e){const i=this.expandToIndex(r);this.tracks[r]=t,i!=null&&(e&&this.queue.interrupt(i),t.mixingFrom=i,i.mixingTo=t,t.mixTime=0,i.mixingFrom!=null&&i.mixDuration>0&&(t.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(t)}setAnimation(r,t,e){const i=this.data.skeletonData.findAnimation(t);if(i==null)throw new Error(`Animation not found: ${t}`);return this.setAnimationWith(r,i,e)}setAnimationWith(r,t,e){if(t==null)throw new Error("animation cannot be null.");let i=!0,s=this.expandToIndex(r);s!=null&&(s.nextTrackLast==-1?(this.tracks[r]=s.mixingFrom,this.queue.interrupt(s),this.queue.end(s),this.disposeNext(s),s=s.mixingFrom,i=!1):this.disposeNext(s));const n=this.trackEntry(r,t,e,s);return this.setCurrent(r,n,i),this.queue.drain(),n}addAnimation(r,t,e,i){const s=this.data.skeletonData.findAnimation(t);if(s==null)throw new Error(`Animation not found: ${t}`);return this.addAnimationWith(r,s,e,i)}addAnimationWith(r,t,e,i){if(t==null)throw new Error("animation cannot be null.");let s=this.expandToIndex(r);if(s!=null)for(;s.next!=null;)s=s.next;const n=this.trackEntry(r,t,e,s);if(s==null)this.setCurrent(r,n,!0),this.queue.drain();else if(s.next=n,i<=0){const a=s.animationEnd-s.animationStart;a!=0?(s.loop?i+=a*(1+(s.trackTime/a|0)):i+=Math.max(a,s.trackTime),i-=this.data.getMix(s.animation,t)):i=s.trackTime}return n.delay=i,n}setEmptyAnimation(r,t){const e=this.setAnimationWith(r,Pt.emptyAnimation,!1);return e.mixDuration=t,e.trackEnd=t,e}addEmptyAnimation(r,t,e){e<=0&&(e-=t);const i=this.addAnimationWith(r,Pt.emptyAnimation,!1,e);return i.mixDuration=t,i.trackEnd=t,i}setEmptyAnimations(r){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e<i;e++){const s=this.tracks[e];s!=null&&this.setEmptyAnimation(s.trackIndex,r)}this.queue.drainDisabled=t,this.queue.drain()}expandToIndex(r){return r<this.tracks.length?this.tracks[r]:(Q.ensureArrayCapacity(this.tracks,r+1,null),this.tracks.length=r+1,null)}trackEntry(r,t,e,i){const s=this.trackEntryPool.obtain();return s.trackIndex=r,s.animation=t,s.loop=e,s.holdPrevious=!1,s.eventThreshold=0,s.attachmentThreshold=0,s.drawOrderThreshold=0,s.animationStart=0,s.animationEnd=t.duration,s.animationLast=-1,s.nextAnimationLast=-1,s.delay=0,s.trackTime=0,s.trackLast=-1,s.nextTrackLast=-1,s.trackEnd=Number.MAX_VALUE,s.timeScale=1,s.alpha=1,s.interruptAlpha=1,s.mixTime=0,s.mixDuration=i==null?0:this.data.getMix(i.animation,t),s.mixBlend=j.replace,s}disposeNext(r){let t=r.next;for(;t!=null;)this.queue.dispose(t),t=t.next;r.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();for(let r=0,t=this.tracks.length;r<t;r++){let e=this.tracks[r];if(e!=null){for(;e.mixingFrom!=null;)e=e.mixingFrom;do(e.mixingFrom==null||e.mixBlend!=j.add)&&this.computeHold(e),e=e.mixingTo;while(e!=null)}}}computeHold(r){const t=r.mixingTo,e=r.animation.timelines,i=r.animation.timelines.length,s=Q.setArraySize(r.timelineMode,i);r.timelineHoldMix.length=0;const n=Q.setArraySize(r.timelineHoldMix,i),a=this.propertyIDs;if(t!=null&&t.holdPrevious){for(let o=0;o<i;o++)s[o]=a.add(e[o].getPropertyId())?Pt.HOLD_FIRST:Pt.HOLD_SUBSEQUENT;return}t:for(let o=0;o<i;o++){const h=e[o],l=h.getPropertyId();if(!a.add(l))s[o]=Pt.SUBSEQUENT;else if(t==null||h instanceof ro||h instanceof Ac||h instanceof BE||!t.animation.hasTimeline(l))s[o]=Pt.FIRST;else{for(let c=t.mixingTo;c!=null;c=c.mixingTo)if(!c.animation.hasTimeline(l)){if(r.mixDuration>0){s[o]=Pt.HOLD_MIX,n[o]=c;continue t}break}s[o]=Pt.HOLD_FIRST}}}getCurrent(r){return r>=this.tracks.length?null:this.tracks[r]}addListener(r){if(r==null)throw new Error("listener cannot be null.");this.listeners.push(r)}removeListener(r){const t=this.listeners.indexOf(r);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}setAnimationByName(r,t,e){Pt.deprecatedWarning1||(Pt.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.")),this.setAnimation(r,t,e)}addAnimationByName(r,t,e,i){Pt.deprecatedWarning2||(Pt.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.")),this.addAnimation(r,t,e,i)}hasAnimation(r){return this.data.skeletonData.findAnimation(r)!==null}hasAnimationByName(r){return Pt.deprecatedWarning3||(Pt.deprecatedWarning3=!0,console.warn("Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.")),this.hasAnimation(r)}};let Fe=Pt;Fe.emptyAnimation=new fe("<empty>",[],0),Fe.SUBSEQUENT=0,Fe.FIRST=1,Fe.HOLD_SUBSEQUENT=2,Fe.HOLD_FIRST=3,Fe.HOLD_MIX=4,Fe.SETUP=1,Fe.CURRENT=2,Fe.deprecatedWarning1=!1,Fe.deprecatedWarning2=!1,Fe.deprecatedWarning3=!1;const Fi=class{constructor(){this.mixBlend=j.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){const r=this.animationEnd-this.animationStart;return r==0?this.animationStart:this.trackTime%r+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(r){this.animationLast=r,this.nextAnimationLast=r}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}get time(){return Fi.deprecatedWarning1||(Fi.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime}set time(r){Fi.deprecatedWarning1||(Fi.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime=r}get endTime(){return Fi.deprecatedWarning2||(Fi.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime}set endTime(r){Fi.deprecatedWarning2||(Fi.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime=r}loopsCount(){return Math.floor(this.trackTime/this.trackEnd)}};let Sc=Fi;Sc.deprecatedWarning1=!1,Sc.deprecatedWarning2=!1;const Cc=class{constructor(r){this.objects=[],this.drainDisabled=!1,this.animState=r}start(r){this.objects.push(Te.start),this.objects.push(r),this.animState.animationsChanged=!0}interrupt(r){this.objects.push(Te.interrupt),this.objects.push(r)}end(r){this.objects.push(Te.end),this.objects.push(r),this.animState.animationsChanged=!0}dispose(r){this.objects.push(Te.dispose),this.objects.push(r)}complete(r){this.objects.push(Te.complete),this.objects.push(r)}event(r,t){this.objects.push(Te.event),this.objects.push(r),this.objects.push(t)}deprecateStuff(){return Cc.deprecatedWarning1||(Cc.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: onComplete, onStart, onEnd, onEvent art deprecated, please use listeners from now on. 'state.addListener({ complete: function(track, event) { } })'")),!0}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;const r=this.objects,t=this.animState.listeners;for(let e=0;e<r.length;e+=2){const i=r[e],s=r[e+1];switch(i){case Te.start:s.listener!=null&&s.listener.start&&s.listener.start(s);for(let o=0;o<t.length;o++)t[o].start&&t[o].start(s);s.onStart&&this.deprecateStuff()&&s.onStart(s.trackIndex),this.animState.onStart&&this.deprecateStuff()&&this.deprecateStuff&&this.animState.onStart(s.trackIndex);break;case Te.interrupt:s.listener!=null&&s.listener.interrupt&&s.listener.interrupt(s);for(let o=0;o<t.length;o++)t[o].interrupt&&t[o].interrupt(s);break;case Te.end:s.listener!=null&&s.listener.end&&s.listener.end(s);for(let o=0;o<t.length;o++)t[o].end&&t[o].end(s);s.onEnd&&this.deprecateStuff()&&s.onEnd(s.trackIndex),this.animState.onEnd&&this.deprecateStuff()&&this.animState.onEnd(s.trackIndex);case Te.dispose:s.listener!=null&&s.listener.dispose&&s.listener.dispose(s);for(let o=0;o<t.length;o++)t[o].dispose&&t[o].dispose(s);this.animState.trackEntryPool.free(s);break;case Te.complete:s.listener!=null&&s.listener.complete&&s.listener.complete(s);for(let o=0;o<t.length;o++)t[o].complete&&t[o].complete(s);const n=N.toInt(s.loopsCount());s.onComplete&&this.deprecateStuff()&&s.onComplete(s.trackIndex,n),this.animState.onComplete&&this.deprecateStuff()&&this.animState.onComplete(s.trackIndex,n);break;case Te.event:const a=r[e+++2];s.listener!=null&&s.listener.event&&s.listener.event(s,a);for(let o=0;o<t.length;o++)t[o].event&&t[o].event(s,a);s.onEvent&&this.deprecateStuff()&&s.onEvent(s.trackIndex,a),this.animState.onEvent&&this.deprecateStuff()&&this.animState.onEvent(s.trackIndex,a);break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}};let Hm=Cc;Hm.deprecatedWarning1=!1;var Te=(r=>(r[r.start=0]="start",r[r.interrupt=1]="interrupt",r[r.end=2]="end",r[r.dispose=3]="dispose",r[r.complete=4]="complete",r[r.event=5]="event",r))(Te||{});const Pc=class{constructor(r){if(this.animationToMixTime={},this.defaultMix=0,r==null)throw new Error("skeletonData cannot be null.");this.skeletonData=r}setMix(r,t,e){const i=this.skeletonData.findAnimation(r);if(i==null)throw new Error(`Animation not found: ${r}`);const s=this.skeletonData.findAnimation(t);if(s==null)throw new Error(`Animation not found: ${t}`);this.setMixWith(i,s,e)}setMixByName(r,t,e){Pc.deprecatedWarning1||(Pc.deprecatedWarning1=!0,console.warn("Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.")),this.setMix(r,t,e)}setMixWith(r,t,e){if(r==null)throw new Error("from cannot be null.");if(t==null)throw new Error("to cannot be null.");const i=`${r.name}.${t.name}`;this.animationToMixTime[i]=e}getMix(r,t){const e=`${r.name}.${t.name}`,i=this.animationToMixTime[e];return i===void 0?this.defaultMix:i}};let Xm=Pc;Xm.deprecatedWarning1=!1;class Wm{constructor(t,e,i){if(this.matrix=new mt,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.sorted=!1,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}get worldX(){return this.matrix.tx}get worldY(){return this.matrix.ty}isActive(){return this.active}update(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,s,n,a,o){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=s,this.ascaleY=n,this.ashearX=a,this.ashearY=o,this.appliedValid=!0;const h=this.parent,l=this.matrix,c=this.skeleton.scaleX,d=-this.skeleton.scaleY;if(h==null){const g=this.skeleton,y=i+90+o;l.a=N.cosDeg(i+a)*s*c,l.c=N.cosDeg(y)*n*c,l.b=N.sinDeg(i+a)*s*d,l.d=N.sinDeg(y)*n*d,l.tx=t*c+g.x,l.ty=e*d+g.y;return}let u=h.matrix.a,f=h.matrix.c,p=h.matrix.b,m=h.matrix.d;switch(l.tx=u*t+f*e+h.matrix.tx,l.ty=p*t+m*e+h.matrix.ty,this.data.transformMode){case ee.Normal:{const g=i+90+o,y=N.cosDeg(i+a)*s,v=N.cosDeg(g)*n,_=N.sinDeg(i+a)*s,x=N.sinDeg(g)*n;l.a=u*y+f*_,l.c=u*v+f*x,l.b=p*y+m*_,l.d=p*v+m*x;return}case ee.OnlyTranslation:{const g=i+90+o;l.a=N.cosDeg(i+a)*s,l.c=N.cosDeg(g)*n,l.b=N.sinDeg(i+a)*s,l.d=N.sinDeg(g)*n;break}case ee.NoRotationOrReflection:{let g=u*u+p*p,y=0;g>1e-4?(g=Math.abs(u*m-f*p)/g,u/=this.skeleton.scaleX,p/=this.skeleton.scaleY,f=p*g,m=u*g,y=Math.atan2(p,u)*N.radDeg):(u=0,p=0,y=90-Math.atan2(m,f)*N.radDeg);const v=i+a-y,_=i+o-y+90,x=N.cosDeg(v)*s,b=N.cosDeg(_)*n,E=N.sinDeg(v)*s,T=N.sinDeg(_)*n;l.a=u*x-f*E,l.c=u*b-f*T,l.b=p*x+m*E,l.d=p*b+m*T;break}case ee.NoScale:case ee.NoScaleOrReflection:{const g=N.cosDeg(i),y=N.sinDeg(i);let v=(u*g+f*y)/c,_=(p*g+m*y)/d,x=Math.sqrt(v*v+_*_);x>1e-5&&(x=1/x),v*=x,_*=x,x=Math.sqrt(v*v+_*_),this.data.transformMode==ee.NoScale&&u*m-f*p<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY>0)&&(x=-x);const b=Math.PI/2+Math.atan2(_,v),E=Math.cos(b)*x,T=Math.sin(b)*x,w=N.cosDeg(a)*s,A=N.cosDeg(90+o)*n,P=N.sinDeg(a)*s,L=N.sinDeg(90+o)*n;l.a=v*w+E*P,l.c=v*A+E*L,l.b=_*w+T*P,l.d=_*A+T*L;break}}l.a*=c,l.c*=c,l.b*=d,l.d*=d}setToSetupPose(){const t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.matrix.b,this.matrix.a)*N.radDeg}getWorldRotationY(){return Math.atan2(this.matrix.d,this.matrix.c)*N.radDeg}getWorldScaleX(){const t=this.matrix;return Math.sqrt(t.a*t.a+t.c*t.c)}getWorldScaleY(){const t=this.matrix;return Math.sqrt(t.b*t.b+t.d*t.d)}updateAppliedTransform(){this.appliedValid=!0;const t=this.parent,e=this.matrix;if(t==null){this.ax=e.tx,this.ay=e.ty,this.arotation=Math.atan2(e.b,e.a)*N.radDeg,this.ascaleX=Math.sqrt(e.a*e.a+e.b*e.b),this.ascaleY=Math.sqrt(e.c*e.c+e.d*e.d),this.ashearX=0,this.ashearY=Math.atan2(e.a*e.c+e.b*e.d,e.a*e.d-e.b*e.c)*N.radDeg;return}const i=t.matrix,s=1/(i.a*i.d-i.b*i.c),n=e.tx-i.tx,a=e.ty-i.ty;this.ax=n*i.d*s-a*i.c*s,this.ay=a*i.a*s-n*i.b*s;const o=s*i.d,h=s*i.a,l=s*i.c,c=s*i.b,d=o*e.a-l*e.b,u=o*e.c-l*e.d,f=h*e.b-c*e.a,p=h*e.d-c*e.c;if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+f*f),this.ascaleX>1e-4){const m=d*p-u*f;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(d*u+f*p,m)*N.radDeg,this.arotation=Math.atan2(f,d)*N.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+p*p),this.ashearY=0,this.arotation=90-Math.atan2(p,u)*N.radDeg}worldToLocal(t){const e=this.matrix,i=e.a,s=e.c,n=e.b,a=e.d,o=1/(i*a-s*n),h=t.x-e.tx,l=t.y-e.ty;return t.x=h*a*o-l*s*o,t.y=l*i*o-h*n*o,t}localToWorld(t){const e=this.matrix,i=t.x,s=t.y;return t.x=i*e.a+s*e.c+e.tx,t.y=i*e.b+s*e.d+e.ty,t}worldToLocalRotation(t){const e=N.sinDeg(t),i=N.cosDeg(t),s=this.matrix;return Math.atan2(s.a*e-s.b*i,s.d*i-s.c*e)*N.radDeg}localToWorldRotation(t){const e=N.sinDeg(t),i=N.cosDeg(t),s=this.matrix;return Math.atan2(i*s.b+e*s.d,i*s.a+e*s.c)*N.radDeg}rotateWorld(t){const e=this.matrix,i=e.a,s=e.c,n=e.b,a=e.d,o=N.cosDeg(t),h=N.sinDeg(t);e.a=o*i-h*n,e.c=o*s-h*a,e.b=h*i+o*n,e.d=h*s+o*a,this.appliedValid=!1}}class OE{constructor(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(let i=0;i<t.bones.length;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}apply(){this.update()}update(){const t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.softness,this.mix);break}}apply1(t,e,i,s,n,a,o){t.appliedValid||t.updateAppliedTransform();const h=t.parent.matrix,l=h.a;let c=h.c;const d=h.b;let u=h.d,f=-t.ashearX-t.arotation,p=0,m=0;switch(t.data.transformMode){case ee.OnlyTranslation:p=e-t.worldX,m=i-t.worldY;break;case ee.NoRotationOrReflection:const v=Math.abs(l*u-c*d)/(l*l+d*d),_=l/t.skeleton.scaleX,x=d/t.skeleton.scaleY;c=-x*v*t.skeleton.scaleX,u=_*v*t.skeleton.scaleY,f+=Math.atan2(x,_)*N.radDeg;default:const b=e-h.tx,E=i-h.ty,T=l*u-c*d;p=(b*u-E*c)/T-t.ax,m=(E*l-b*d)/T-t.ay}f+=Math.atan2(m,p)*N.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let g=t.ascaleX,y=t.ascaleY;if(s||n){switch(t.data.transformMode){case ee.NoScale:case ee.NoScaleOrReflection:p=e-t.worldX,m=i-t.worldY}const v=t.data.length*g,_=Math.sqrt(p*p+m*m);if(s&&_<v||n&&_>v&&v>1e-4){const x=(_/v-1)*o+1;g*=x,a&&(y*=x)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*o,g,y,t.ashearX,t.ashearY)}apply2(t,e,i,s,n,a,o,h){if(h==0){e.updateWorldTransform();return}t.appliedValid||t.updateAppliedTransform(),e.appliedValid||e.updateAppliedTransform();const l=t.ax,c=t.ay;let d=t.ascaleX,u=d,f=t.ascaleY,p=e.ascaleX;const m=t.matrix;let g=0,y=0,v=0;d<0?(d=-d,g=180,v=-1):(g=0,v=1),f<0&&(f=-f,v=-v),p<0?(p=-p,y=180):y=0;const _=e.ax;let x=0,b=0,E=0,T=m.a,w=m.c,A=m.b,P=m.d;const L=Math.abs(d-f)<=1e-4;L?(x=e.ay,b=T*_+w*x+m.tx,E=A*_+P*x+m.ty):(x=0,b=T*_+m.tx,E=A*_+m.ty);const M=t.parent.matrix;T=M.a,w=M.c,A=M.b,P=M.d;const S=1/(T*P-w*A);let C=b-M.tx,R=E-M.ty;const k=(C*P-R*w)*S-l,F=(R*T-C*A)*S-c,B=Math.sqrt(k*k+F*F);let X=e.data.length*p,I,D;if(B<1e-4){this.apply1(t,i,s,!1,a,!1,h),e.updateWorldTransformWith(_,x,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);return}C=i-M.tx,R=s-M.ty;let $=(C*P-R*w)*S-l,z=(R*T-C*A)*S-c,U=$*$+z*z;if(o!=0){o*=d*(p+1)/2;const lt=Math.sqrt(U),yt=lt-B-X*d+o;if(yt>0){let Rt=Math.min(1,yt/(o*2))-1;Rt=(yt-o*(1-Rt*Rt))/lt,$-=Rt*$,z-=Rt*z,U=$*$+z*z}}t:if(L){X*=d;let lt=(U-B*B-X*X)/(2*B*X);lt<-1?lt=-1:lt>1&&(lt=1,a&&(u*=(Math.sqrt(U)/(B+X)-1)*h+1)),D=Math.acos(lt)*n,T=B+X*lt,w=X*Math.sin(D),I=Math.atan2(z*T-$*w,$*T+z*w)}else{T=d*X,w=f*X;const lt=T*T,yt=w*w,Rt=Math.atan2(z,$);A=yt*B*B+lt*U-lt*yt;const Bt=-2*yt*B,pt=yt-lt;if(P=Bt*Bt-4*pt*A,P>=0){let As=Math.sqrt(P);Bt<0&&(As=-As),As=-(Bt+As)/2;const Ym=As/pt,jm=A/As,Ss=Math.abs(Ym)<Math.abs(jm)?Ym:jm;if(Ss*Ss<=U){R=Math.sqrt(U-Ss*Ss)*n,I=Rt-Math.atan2(R,Ss),D=Math.atan2(R/f,(Ss-B)/d);break t}}let It=N.PI,vt=B-T,pe=vt*vt,Ee=0,nr=0,ws=B+T,ar=ws*ws,zm=0;A=-T*B/(lt-yt),A>=-1&&A<=1&&(A=Math.acos(A),C=T*Math.cos(A)+B,R=w*Math.sin(A),P=C*C+R*R,P<pe&&(It=A,pe=P,vt=C,Ee=R),P>ar&&(nr=A,ar=P,ws=C,zm=R)),U<=(pe+ar)/2?(I=Rt-Math.atan2(Ee*n,vt),D=It*n):(I=Rt-Math.atan2(zm*n,ws),D=nr*n)}const rt=Math.atan2(x,_)*v;let ut=t.arotation;I=(I-rt)*N.radDeg+g-ut,I>180?I-=360:I<-180&&(I+=360),t.updateWorldTransformWith(l,c,ut+I*h,u,t.ascaleY,0,0),ut=e.arotation,D=((D+rt)*N.radDeg-e.ashearX)*v+y-ut,D>180?D-=360:D<-180&&(D+=360),e.updateWorldTransformWith(_,x,ut+D*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}var Es=(r=>(r[r.Length=0]="Length",r[r.Fixed=1]="Fixed",r[r.Percent=2]="Percent",r))(Es||{});const Nr=class{constructor(r,t){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,r==null)throw new Error("data cannot be null.");if(t==null)throw new Error("skeleton cannot be null.");this.data=r,this.bones=new Array;for(let e=0,i=r.bones.length;e<i;e++)this.bones.push(t.findBone(r.bones[e].name));this.target=t.findSlot(r.target.name),this.position=r.position,this.spacing=r.spacing,this.rotateMix=r.rotateMix,this.translateMix=r.translateMix}isActive(){return this.active}apply(){this.update()}update(){const r=this.target.getAttachment();if(!(r instanceof vn))return;const t=this.rotateMix,e=this.translateMix,i=e>0,s=t>0;if(!i&&!s)return;const n=this.data,a=n.spacingMode,o=a==Es.Length,h=n.rotateMode,l=h==Fr.Tangent,c=h==Fr.ChainScale,d=this.bones.length,u=l?d:d+1,f=this.bones,p=Q.setArraySize(this.spaces,u);let m=null;const g=this.spacing;if(c||o){c&&(m=Q.setArraySize(this.lengths,d));for(let E=0,T=u-1;E<T;){const w=f[E],A=w.data.length;if(A<Nr.epsilon)c&&(m[E]=0),p[++E]=0;else{const P=A*w.matrix.a,L=A*w.matrix.b,M=Math.sqrt(P*P+L*L);c&&(m[E]=M),p[++E]=(o?A+g:g)*M/A}}}else for(let E=1;E<u;E++)p[E]=g;const y=this.computeWorldPositions(r,u,l,n.positionMode==eo.Percent,a==Es.Percent);let v=y[0],_=y[1],x=n.offsetRotation,b=!1;if(x==0)b=h==Fr.Chain;else{b=!1;const E=this.target.bone.matrix;x*=E.a*E.d-E.b*E.c>0?N.degRad:-N.degRad}for(let E=0,T=3;E<d;E++,T+=3){const w=f[E],A=w.matrix;A.tx+=(v-A.tx)*e,A.ty+=(_-A.ty)*e;const P=y[T],L=y[T+1],M=P-v,S=L-_;if(c){const C=m[E];if(C!=0){const R=(Math.sqrt(M*M+S*S)/C-1)*t+1;A.a*=R,A.b*=R}}if(v=P,_=L,s){const C=A.a,R=A.c,k=A.b,F=A.d;let B=0,X=0,I=0;if(l&&(l?B=y[T-1]:p[E+1]==0?B=y[T+2]:B=Math.atan2(S,M)),B-=Math.atan2(k,C),b){X=Math.cos(B),I=Math.sin(B);const D=w.data.length;v+=(D*(X*C-I*k)-M)*t,_+=(D*(I*C+X*k)-S)*t}else B+=x;B>N.PI?B-=N.PI2:B<-N.PI&&(B+=N.PI2),B*=t,X=Math.cos(B),I=Math.sin(B),A.a=X*C-I*k,A.c=X*R-I*F,A.b=I*C+X*k,A.d=I*R+X*F}w.appliedValid=!1}}computeWorldPositions(r,t,e,i,s){const n=this.target;let a=this.position;const o=this.spaces,h=Q.setArraySize(this.positions,t*3+2);let l=null;const c=r.closed;let d=r.worldVerticesLength,u=d/6,f=Nr.NONE;if(!r.constantSpeed){const B=r.lengths;u-=c?1:2;const X=B[u];if(i&&(a*=X),s)for(let I=0;I<t;I++)o[I]*=X;l=Q.setArraySize(this.world,8);for(let I=0,D=0,$=0;I<t;I++,D+=3){const z=o[I];a+=z;let U=a;if(c)U%=X,U<0&&(U+=X),$=0;else if(U<0){f!=Nr.BEFORE&&(f=Nr.BEFORE,r.computeWorldVertices(n,2,4,l,0,2)),this.addBeforePosition(U,l,0,h,D);continue}else if(U>X){f!=Nr.AFTER&&(f=Nr.AFTER,r.computeWorldVertices(n,d-6,4,l,0,2)),this.addAfterPosition(U-X,l,0,h,D);continue}for(;;$++){const rt=B[$];if(!(U>rt)){if($==0)U/=rt;else{const ut=B[$-1];U=(U-ut)/(rt-ut)}break}}$!=f&&(f=$,c&&$==u?(r.computeWorldVertices(n,d-4,4,l,0,2),r.computeWorldVertices(n,0,4,l,4,2)):r.computeWorldVertices(n,$*6+2,8,l,0,2)),this.addCurvePosition(U,l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],h,D,e||I>0&&z==0)}return h}c?(d+=2,l=Q.setArraySize(this.world,d),r.computeWorldVertices(n,2,d-4,l,0,2),r.computeWorldVertices(n,0,2,l,d-4,2),l[d-2]=l[0],l[d-1]=l[1]):(u--,d-=4,l=Q.setArraySize(this.world,d),r.computeWorldVertices(n,2,d,l,0,2));const p=Q.setArraySize(this.curves,u);let m=0,g=l[0],y=l[1],v=0,_=0,x=0,b=0,E=0,T=0,w=0,A=0,P=0,L=0,M=0,S=0,C=0,R=0;for(let B=0,X=2;B<u;B++,X+=6)v=l[X],_=l[X+1],x=l[X+2],b=l[X+3],E=l[X+4],T=l[X+5],w=(g-v*2+x)*.1875,A=(y-_*2+b)*.1875,P=((v-x)*3-g+E)*.09375,L=((_-b)*3-y+T)*.09375,M=w*2+P,S=A*2+L,C=(v-g)*.75+w+P*.16666667,R=(_-y)*.75+A+L*.16666667,m+=Math.sqrt(C*C+R*R),C+=M,R+=S,M+=P,S+=L,m+=Math.sqrt(C*C+R*R),C+=M,R+=S,m+=Math.sqrt(C*C+R*R),C+=M+P,R+=S+L,m+=Math.sqrt(C*C+R*R),p[B]=m,g=E,y=T;if(i&&(a*=m),s)for(let B=0;B<t;B++)o[B]*=m;const k=this.segments;let F=0;for(let B=0,X=0,I=0,D=0;B<t;B++,X+=3){const $=o[B];a+=$;let z=a;if(c)z%=m,z<0&&(z+=m),I=0;else if(z<0){this.addBeforePosition(z,l,0,h,X);continue}else if(z>m){this.addAfterPosition(z-m,l,d-4,h,X);continue}for(;;I++){const U=p[I];if(!(z>U)){if(I==0)z/=U;else{const rt=p[I-1];z=(z-rt)/(U-rt)}break}}if(I!=f){f=I;let U=I*6;for(g=l[U],y=l[U+1],v=l[U+2],_=l[U+3],x=l[U+4],b=l[U+5],E=l[U+6],T=l[U+7],w=(g-v*2+x)*.03,A=(y-_*2+b)*.03,P=((v-x)*3-g+E)*.006,L=((_-b)*3-y+T)*.006,M=w*2+P,S=A*2+L,C=(v-g)*.3+w+P*.16666667,R=(_-y)*.3+A+L*.16666667,F=Math.sqrt(C*C+R*R),k[0]=F,U=1;U<8;U++)C+=M,R+=S,M+=P,S+=L,F+=Math.sqrt(C*C+R*R),k[U]=F;C+=M,R+=S,F+=Math.sqrt(C*C+R*R),k[8]=F,C+=M+P,R+=S+L,F+=Math.sqrt(C*C+R*R),k[9]=F,D=0}for(z*=F;;D++){const U=k[D];if(!(z>U)){if(D==0)z/=U;else{const rt=k[D-1];z=D+(z-rt)/(U-rt)}break}}this.addCurvePosition(z*.1,g,y,v,_,x,b,E,T,h,X,e||B>0&&$==0)}return h}addBeforePosition(r,t,e,i,s){const n=t[e],a=t[e+1],o=t[e+2]-n,h=t[e+3]-a,l=Math.atan2(h,o);i[s]=n+r*Math.cos(l),i[s+1]=a+r*Math.sin(l),i[s+2]=l}addAfterPosition(r,t,e,i,s){const n=t[e+2],a=t[e+3],o=n-t[e],h=a-t[e+1],l=Math.atan2(h,o);i[s]=n+r*Math.cos(l),i[s+1]=a+r*Math.sin(l),i[s+2]=l}addCurvePosition(r,t,e,i,s,n,a,o,h,l,c,d){(r==0||isNaN(r))&&(r=1e-4);const u=r*r,f=u*r,p=1-r,m=p*p,g=m*p,y=p*r,v=y*3,_=p*v,x=v*r,b=t*g+i*_+n*x+o*f,E=e*g+s*_+a*x+h*f;l[c]=b,l[c+1]=E,d&&(l[c+2]=Math.atan2(E-(e*m+s*y*2+a*u),b-(t*m+i*y*2+n*u)))}};let bn=Nr;bn.NONE=-1,bn.BEFORE=-2,bn.AFTER=-3,bn.epsilon=1e-5;class FE{constructor(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new RE,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(let i=0;i<t.bones.length;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}apply(){this.update()}update(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()}applyAbsoluteWorld(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,s=this.shearMix,n=this.target,a=n.matrix,o=a.a,h=a.c,l=a.b,c=a.d,d=o*c-h*l>0?N.degRad:-N.degRad,u=this.data.offsetRotation*d,f=this.data.offsetShearY*d,p=this.bones;for(let m=0,g=p.length;m<g;m++){const y=p[m];let v=!1;const _=y.matrix;if(t!=0){const x=_.a,b=_.c,E=_.b,T=_.d;let w=Math.atan2(l,o)-Math.atan2(E,x)+u;w>N.PI?w-=N.PI2:w<-N.PI&&(w+=N.PI2),w*=t;const A=Math.cos(w),P=Math.sin(w);_.a=A*x-P*E,_.c=A*b-P*T,_.b=P*x+A*E,_.d=P*b+A*T,v=!0}if(e!=0){const x=this.temp;n.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),_.tx+=(x.x-_.tx)*e,_.ty+=(x.y-_.ty)*e,v=!0}if(i>0){let x=Math.sqrt(_.a*_.a+_.b*_.b),b=Math.sqrt(o*o+l*l);x>1e-5&&(x=(x+(b-x+this.data.offsetScaleX)*i)/x),_.a*=x,_.b*=x,x=Math.sqrt(_.c*_.c+_.d*_.d),b=Math.sqrt(h*h+c*c),x>1e-5&&(x=(x+(b-x+this.data.offsetScaleY)*i)/x),_.c*=x,_.d*=x,v=!0}if(s>0){const x=_.c,b=_.d,E=Math.atan2(b,x);let T=Math.atan2(c,h)-Math.atan2(l,o)-(E-Math.atan2(_.b,_.a));T>N.PI?T-=N.PI2:T<-N.PI&&(T+=N.PI2),T=E+(T+f)*s;const w=Math.sqrt(x*x+b*b);_.c=Math.cos(T)*w,_.d=Math.sin(T)*w,v=!0}v&&(y.appliedValid=!1)}}applyRelativeWorld(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,s=this.shearMix,n=this.target,a=n.matrix,o=a.a,h=a.c,l=a.b,c=a.d,d=o*c-h*l>0?N.degRad:-N.degRad,u=this.data.offsetRotation*d,f=this.data.offsetShearY*d,p=this.bones;for(let m=0,g=p.length;m<g;m++){const y=p[m];let v=!1;const _=y.matrix;if(t!=0){const x=_.a,b=_.c,E=_.b,T=_.d;let w=Math.atan2(l,o)+u;w>N.PI?w-=N.PI2:w<-N.PI&&(w+=N.PI2),w*=t;const A=Math.cos(w),P=Math.sin(w);_.a=A*x-P*E,_.c=A*b-P*T,_.b=P*x+A*E,_.d=P*b+A*T,v=!0}if(e!=0){const x=this.temp;n.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),_.tx+=x.x*e,_.ty+=x.y*e,v=!0}if(i>0){let x=(Math.sqrt(o*o+l*l)-1+this.data.offsetScaleX)*i+1;_.a*=x,_.b*=x,x=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleY)*i+1,_.c*=x,_.d*=x,v=!0}if(s>0){let x=Math.atan2(c,h)-Math.atan2(l,o);x>N.PI?x-=N.PI2:x<-N.PI&&(x+=N.PI2);const b=_.c,E=_.d;x=Math.atan2(E,b)+(x-N.PI/2+f)*s;const T=Math.sqrt(b*b+E*E);_.c=Math.cos(x)*T,_.d=Math.sin(x)*T,v=!0}v&&(y.appliedValid=!1)}}applyAbsoluteLocal(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,s=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();const a=this.bones;for(let o=0,h=a.length;o<h;o++){const l=a[o];l.appliedValid||l.updateAppliedTransform();let c=l.arotation;if(t!=0){let g=n.arotation-c+this.data.offsetRotation;g-=(16384-(16384.499999999996-g/360|0))*360,c+=g*t}let d=l.ax,u=l.ay;e!=0&&(d+=(n.ax-d+this.data.offsetX)*e,u+=(n.ay-u+this.data.offsetY)*e);let f=l.ascaleX,p=l.ascaleY;i>0&&(f>1e-5&&(f=(f+(n.ascaleX-f+this.data.offsetScaleX)*i)/f),p>1e-5&&(p=(p+(n.ascaleY-p+this.data.offsetScaleY)*i)/p));const m=l.ashearY;if(s>0){let g=n.ashearY-m+this.data.offsetShearY;g-=(16384-(16384.499999999996-g/360|0))*360,l.shearY+=g*s}l.updateWorldTransformWith(d,u,c,f,p,l.ashearX,m)}}applyRelativeLocal(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,s=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();const a=this.bones;for(let o=0,h=a.length;o<h;o++){const l=a[o];l.appliedValid||l.updateAppliedTransform();let c=l.arotation;t!=0&&(c+=(n.arotation+this.data.offsetRotation)*t);let d=l.ax,u=l.ay;e!=0&&(d+=(n.ax+this.data.offsetX)*e,u+=(n.ay+this.data.offsetY)*e);let f=l.ascaleX,p=l.ascaleY;i>0&&(f>1e-5&&(f*=(n.ascaleX-1+this.data.offsetScaleX)*i+1),p>1e-5&&(p*=(n.ascaleY-1+this.data.offsetScaleY)*i+1));let m=l.ashearY;s>0&&(m+=(n.ashearY+this.data.offsetShearY)*s),l.updateWorldTransformWith(d,u,c,f,p,l.ashearX,m)}}}const Tn=class{constructor(r){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,r==null)throw new Error("data cannot be null.");this.data=r,this.bones=new Array;for(let t=0;t<r.bones.length;t++){const e=r.bones[t];let i;if(e.parent==null)i=new Wm(e,this,null);else{const s=this.bones[e.parent.index];i=new Wm(e,this,s),s.children.push(i)}this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(let t=0;t<r.slots.length;t++){const e=r.slots[t],i=this.bones[e.boneData.index],s=new Vm(e,i);this.slots.push(s),this.drawOrder.push(s)}this.ikConstraints=new Array;for(let t=0;t<r.ikConstraints.length;t++){const e=r.ikConstraints[t];this.ikConstraints.push(new OE(e,this))}this.transformConstraints=new Array;for(let t=0;t<r.transformConstraints.length;t++){const e=r.transformConstraints[t];this.transformConstraints.push(new FE(e,this))}this.pathConstraints=new Array;for(let t=0;t<r.pathConstraints.length;t++){const e=r.pathConstraints[t];this.pathConstraints.push(new bn(e,this))}this.color=new be(1,1,1,1),this.updateCache()}updateCache(){const r=this._updateCache;r.length=0,this.updateCacheReset.length=0;const t=this.bones;for(let l=0,c=t.length;l<c;l++){const d=t[l];d.sorted=d.data.skinRequired,d.active=!d.sorted}if(this.skin!=null){const l=this.skin.bones;for(let c=0,d=this.skin.bones.length;c<d;c++){let u=this.bones[l[c].index];do u.sorted=!1,u.active=!0,u=u.parent;while(u!=null)}}const e=this.ikConstraints,i=this.transformConstraints,s=this.pathConstraints,n=e.length,a=i.length,o=s.length,h=n+a+o;t:for(let l=0;l<h;l++){for(let c=0;c<n;c++){const d=e[c];if(d.data.order==l){this.sortIkConstraint(d);continue t}}for(let c=0;c<a;c++){const d=i[c];if(d.data.order==l){this.sortTransformConstraint(d);continue t}}for(let c=0;c<o;c++){const d=s[c];if(d.data.order==l){this.sortPathConstraint(d);continue t}}}for(let l=0,c=t.length;l<c;l++)this.sortBone(t[l])}sortIkConstraint(r){if(r.active=r.target.isActive()&&(!r.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,r.data,!0)),!r.active)return;const t=r.target;this.sortBone(t);const e=r.bones,i=e[0];if(this.sortBone(i),e.length>1){const s=e[e.length-1];this._updateCache.indexOf(s)>-1||this.updateCacheReset.push(s)}this._updateCache.push(r),this.sortReset(i.children),e[e.length-1].sorted=!0}sortPathConstraint(r){if(r.active=r.target.bone.isActive()&&(!r.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,r.data,!0)),!r.active)return;const t=r.target,e=t.data.index,i=t.bone;this.skin!=null&&this.sortPathConstraintAttachment(this.skin,e,i),this.data.defaultSkin!=null&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,e,i);for(let o=0,h=this.data.skins.length;o<h;o++)this.sortPathConstraintAttachment(this.data.skins[o],e,i);const s=t.getAttachment();s instanceof vn&&this.sortPathConstraintAttachmentWith(s,i);const n=r.bones,a=n.length;for(let o=0;o<a;o++)this.sortBone(n[o]);this._updateCache.push(r);for(let o=0;o<a;o++)this.sortReset(n[o].children);for(let o=0;o<a;o++)n[o].sorted=!0}sortTransformConstraint(r){if(r.active=r.target.isActive()&&(!r.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,r.data,!0)),!r.active)return;this.sortBone(r.target);const t=r.bones,e=t.length;if(r.data.local)for(let i=0;i<e;i++){const s=t[i];this.sortBone(s.parent),this._updateCache.indexOf(s)>-1||this.updateCacheReset.push(s)}else for(let i=0;i<e;i++)this.sortBone(t[i]);this._updateCache.push(r);for(let i=0;i<e;i++)this.sortReset(t[i].children);for(let i=0;i<e;i++)t[i].sorted=!0}sortPathConstraintAttachment(r,t,e){const i=r.attachments[t];if(i)for(const s in i)this.sortPathConstraintAttachmentWith(i[s],e)}sortPathConstraintAttachmentWith(r,t){if(!(r instanceof vn))return;const e=r.bones;if(e==null)this.sortBone(t);else{const i=this.bones;let s=0;for(;s<e.length;){const n=e[s++];for(let a=s+n;s<a;s++){const o=e[s];this.sortBone(i[o])}}}}sortBone(r){if(r.sorted)return;const t=r.parent;t!=null&&this.sortBone(t),r.sorted=!0,this._updateCache.push(r)}sortReset(r){for(let t=0,e=r.length;t<e;t++){const i=r[t];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}}updateWorldTransform(){const r=this.updateCacheReset;for(let e=0,i=r.length;e<i;e++){const s=r[e];s.ax=s.x,s.ay=s.y,s.arotation=s.rotation,s.ascaleX=s.scaleX,s.ascaleY=s.scaleY,s.ashearX=s.shearX,s.ashearY=s.shearY,s.appliedValid=!0}const t=this._updateCache;for(let e=0,i=t.length;e<i;e++)t[e].update()}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){const r=this.bones;for(let s=0,n=r.length;s<n;s++)r[s].setToSetupPose();const t=this.ikConstraints;for(let s=0,n=t.length;s<n;s++){const a=t[s];a.mix=a.data.mix,a.softness=a.data.softness,a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch}const e=this.transformConstraints;for(let s=0,n=e.length;s<n;s++){const a=e[s],o=a.data;a.rotateMix=o.rotateMix,a.translateMix=o.translateMix,a.scaleMix=o.scaleMix,a.shearMix=o.shearMix}const i=this.pathConstraints;for(let s=0,n=i.length;s<n;s++){const a=i[s],o=a.data;a.position=o.position,a.spacing=o.spacing,a.rotateMix=o.rotateMix,a.translateMix=o.translateMix}}setSlotsToSetupPose(){const r=this.slots;Q.arrayCopy(r,0,this.drawOrder,0,r.length);for(let t=0,e=r.length;t<e;t++)r[t].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(r){if(r==null)throw new Error("boneName cannot be null.");const t=this.bones;for(let e=0,i=t.length;e<i;e++){const s=t[e];if(s.data.name==r)return s}return null}findBoneIndex(r){if(r==null)throw new Error("boneName cannot be null.");const t=this.bones;for(let e=0,i=t.length;e<i;e++)if(t[e].data.name==r)return e;return-1}findSlot(r){if(r==null)throw new Error("slotName cannot be null.");const t=this.slots;for(let e=0,i=t.length;e<i;e++){const s=t[e];if(s.data.name==r)return s}return null}findSlotIndex(r){if(r==null)throw new Error("slotName cannot be null.");const t=this.slots;for(let e=0,i=t.length;e<i;e++)if(t[e].data.name==r)return e;return-1}setSkinByName(r){const t=this.data.findSkin(r);if(t==null)throw new Error(`Skin not found: ${r}`);this.setSkin(t)}setSkin(r){if(r!=this.skin){if(r!=null)if(this.skin!=null)r.attachAll(this,this.skin);else{const t=this.slots;for(let e=0,i=t.length;e<i;e++){const s=t[e],n=s.data.attachmentName;if(n!=null){const a=r.getAttachment(e,n);a!=null&&s.setAttachment(a)}}}this.skin=r,this.updateCache()}}getAttachmentByName(r,t){return this.getAttachment(this.data.findSlotIndex(r),t)}getAttachment(r,t){if(t==null)throw new Error("attachmentName cannot be null.");if(this.skin!=null){const e=this.skin.getAttachment(r,t);if(e!=null)return e}return this.data.defaultSkin!=null?this.data.defaultSkin.getAttachment(r,t):null}setAttachment(r,t){if(r==null)throw new Error("slotName cannot be null.");const e=this.slots;for(let i=0,s=e.length;i<s;i++){const n=e[i];if(n.data.name==r){let a=null;if(t!=null&&(a=this.getAttachment(i,t),a==null))throw new Error(`Attachment not found: ${t}, for slot: ${r}`);n.setAttachment(a);return}}throw new Error(`Slot not found: ${r}`)}findIkConstraint(r){if(r==null)throw new Error("constraintName cannot be null.");const t=this.ikConstraints;for(let e=0,i=t.length;e<i;e++){const s=t[e];if(s.data.name==r)return s}return null}findTransformConstraint(r){if(r==null)throw new Error("constraintName cannot be null.");const t=this.transformConstraints;for(let e=0,i=t.length;e<i;e++){const s=t[e];if(s.data.name==r)return s}return null}findPathConstraint(r){if(r==null)throw new Error("constraintName cannot be null.");const t=this.pathConstraints;for(let e=0,i=t.length;e<i;e++){const s=t[e];if(s.data.name==r)return s}return null}getBounds(r,t,e=new Array(2)){if(r==null)throw new Error("offset cannot be null.");if(t==null)throw new Error("size cannot be null.");const i=this.drawOrder;let s=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let h=0,l=i.length;h<l;h++){const c=i[h];if(!c.bone.active)continue;let d=0,u=null;const f=c.getAttachment();if(f instanceof et)d=8,u=Q.setArraySize(e,d,0),f.computeWorldVertices(c.bone,u,0,2);else if(f instanceof io){const p=f;d=p.worldVerticesLength,u=Q.setArraySize(e,d,0),p.computeWorldVertices(c,0,d,u,0,2)}if(u!=null)for(let p=0,m=u.length;p<m;p+=2){const g=u[p],y=u[p+1];s=Math.min(s,g),n=Math.min(n,y),a=Math.max(a,g),o=Math.max(o,y)}}r.set(s,n),t.set(a-s,o-n)}update(r){this.time+=r}get flipX(){return this.scaleX==-1}set flipX(r){Tn.deprecatedWarning1||(Tn.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleX=r?1:-1}get flipY(){return this.scaleY==-1}set flipY(r){Tn.deprecatedWarning1||(Tn.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleY=r?1:-1}};let $m=Tn;$m.deprecatedWarning1=!1,ee.Normal,ee.OnlyTranslation,ee.NoRotationOrReflection,ee.NoScale,ee.NoScaleOrReflection,eo.Fixed,eo.Percent,Es.Length,Es.Fixed,Es.Percent,Fr.Tangent,Fr.Chain,Fr.ChainScale,K.NORMAL,K.ADD,K.MULTIPLY,K.SCREEN;class LE extends Ec{createSkeleton(t){this.skeleton=new $m(t),this.skeleton.updateWorldTransform(),this.stateData=new Xm(t),this.state=new Fe(this.stateData)}}class NE extends LE{constructor(t,e){const{followPointList:i,visible:s=!1}=e||{};let n;typeof t=="string"?n=tn.get(t).spineData:n=t.spineData,super(n),this._followDots=[],this._isStart=!1,this.visible=s,this.autoUpdate=!1,i!=null&&i.length&&(i==null||i.forEach(a=>{a.follow.alpha=0,this._followDots.push({point:this.skeleton.findBone(a.boneName),follow:a.follow,onUpdate:a.onUpdate,angleFollow:a.angleFollow||!1,scaleFollow:a.scaleFollow||!0})})),this._loopFn=this._loop.bind(this),Wt.system.add(this._loopFn)}setAnimation(t="animation",e=!1){return new Promise(i=>{this.visible=!0,this.state.setAnimation(0,t,e).listener={complete:()=>{this.visible=!1,requestAnimationFrame(()=>{i()})}}})}addAnimation(t="animation",e=!1,i=0){return new Promise(s=>{this.visible=!0,this.state.addAnimation(0,t,e,i).listener={complete:()=>{this.visible=!1,requestAnimationFrame(()=>{s()})}}})}setSkin(t){this.skeleton.setSkinByName(t)}destroyAll(){Wt.system.remove(this._loopFn),this.destroy()}_loop(){this.update(Wt.system.deltaMS/1e3),this._updateFollowPoint()}_updateFollowPoint(){this._followDots.length!==0&&(this._followDots.forEach(t=>{const{worldX:e,worldY:i}=t.point,s=t.point.getWorldRotationX()*(Math.PI/180),n=t.point.getWorldScaleX(),a=t.point.getWorldScaleY();t.onUpdate?t.onUpdate({x:e,y:i,rotate:s,scaleX:n,scaleY:a}):(t.angleFollow&&(t.follow.rotation=s),t.scaleFollow&&t.follow.scale.set(n,a),t.follow.position.set(e+1920/2-t.follow.width/2,i+1080/2-t.follow.height/2))}),this._isStart||(this._isStart=!0,this._followDots.forEach(t=>{_n.to(t.follow,{alpha:1,duration:.25,delay:.15})})))}}const kE=Object.freeze(Object.defineProperty({__proto__:null,Base:{LibPixiBitText:Zb,LibPixiContainer:dE,LibPixiParticleMove:EE,LibPixiRectBgColor:Im,LibPixiSpine:NE,LibPixiText:Lm}},Symbol.toStringTag,{value:"Module"}));window.LibPixiJs=kE});
1169
+ */class ui{constructor(t,e,i){this.value=t,this.time=e,this.next=null,this.isStepped=!1,i?this.ease=typeof i=="function"?i:Bm(i):this.ease=null}static createList(t){if("list"in t){const i=t.list;let s;const{value:n,time:a}=i[0],o=s=new ui(typeof n=="string"?Ja(n):n,a,t.ease);if(i.length>2||i.length===2&&i[1].value!==n)for(let h=1;h<i.length;++h){const{value:l,time:c}=i[h];s.next=new ui(typeof l=="string"?Ja(l):l,c),s=s.next}return o.isStepped=!!t.isStepped,o}const e=new ui(typeof t.start=="string"?Ja(t.start):t.start,0);return t.end!==t.start&&(e.next=new ui(typeof t.end=="string"?Ja(t.end):t.end,1)),e}}let yn=W.from;const di=Math.PI/180;function Bi(r,t){if(!r)return;const e=Math.sin(r),i=Math.cos(r),s=t.x*i-t.y*e,n=t.x*e+t.y*i;t.x=s,t.y=n}function Qa(r,t,e){return r<<16|t<<8|e}function Mm(r){return Math.sqrt(r.x*r.x+r.y*r.y)}function fE(r){const t=1/Mm(r);r.x*=t,r.y*=t}function Dm(r,t){r.x*=t,r.y*=t}function Ja(r,t){t||(t={}),r.charAt(0)==="#"?r=r.substr(1):r.indexOf("0x")===0&&(r=r.substr(2));let e;return r.length===8&&(e=r.substr(0,2),r=r.substr(2)),t.r=parseInt(r.substr(0,2),16),t.g=parseInt(r.substr(2,2),16),t.b=parseInt(r.substr(4,2),16),e&&(t.a=parseInt(e,16)),t}function Bm(r){const t=r.length,e=1/t;return function(i){const s=t*i|0,n=(i-s*e)*t,a=r[s]||r[t-1];return a.s+n*(2*(1-n)*(a.cp-a.s)+n*(a.e-a.s))}}function pE(r){return r?(r=r.toUpperCase().replace(/ /g,"_"),K[r]||K.NORMAL):K.NORMAL}class Ql extends Ci{constructor(t){super(),this.prevChild=this.nextChild=null,this.emitter=t,this.config={},this.anchor.x=this.anchor.y=.5,this.maxLife=0,this.age=0,this.agePercent=0,this.oneOverLife=0,this.next=null,this.prev=null,this.init=this.init,this.kill=this.kill}init(t){this.maxLife=t,this.age=this.agePercent=0,this.rotation=0,this.position.x=this.position.y=0,this.scale.x=this.scale.y=1,this.tint=16777215,this.alpha=1,this.oneOverLife=1/this.maxLife,this.visible=!0}kill(){this.emitter.recycle(this)}destroy(){this.parent&&this.parent.removeChild(this),this.emitter=this.next=this.prev=null,super.destroy()}}var _t;(function(r){r[r.Spawn=0]="Spawn",r[r.Normal=2]="Normal",r[r.Late=5]="Late"})(_t||(_t={}));const Jl=Wt.shared,Or=Symbol("Position particle per emitter position");class ct{constructor(t,e){this.initBehaviors=[],this.updateBehaviors=[],this.recycleBehaviors=[],this.minLifetime=0,this.maxLifetime=0,this.customEase=null,this._frequency=1,this.spawnChance=1,this.maxParticles=1e3,this.emitterLifetime=-1,this.spawnPos=new tt,this.particlesPerWave=1,this.rotation=0,this.ownerPos=new tt,this._prevEmitterPos=new tt,this._prevPosIsValid=!1,this._posChanged=!1,this._parent=null,this.addAtBack=!1,this.particleCount=0,this._emit=!1,this._spawnTimer=0,this._emitterLife=-1,this._activeParticlesFirst=null,this._activeParticlesLast=null,this._poolFirst=null,this._origConfig=null,this._autoUpdate=!1,this._destroyWhenComplete=!1,this._completeCallback=null,this.parent=t,e&&this.init(e),this.recycle=this.recycle,this.update=this.update,this.rotate=this.rotate,this.updateSpawnPos=this.updateSpawnPos,this.updateOwnerPos=this.updateOwnerPos}static registerBehavior(t){ct.knownBehaviors[t.type]=t}get frequency(){return this._frequency}set frequency(t){typeof t=="number"&&t>0?this._frequency=t:this._frequency=1}get parent(){return this._parent}set parent(t){this.cleanup(),this._parent=t}init(t){if(!t)return;this.cleanup(),this._origConfig=t,this.minLifetime=t.lifetime.min,this.maxLifetime=t.lifetime.max,t.ease?this.customEase=typeof t.ease=="function"?t.ease:Bm(t.ease):this.customEase=null,this.particlesPerWave=1,t.particlesPerWave&&t.particlesPerWave>1&&(this.particlesPerWave=t.particlesPerWave),this.frequency=t.frequency,this.spawnChance=typeof t.spawnChance=="number"&&t.spawnChance>0?t.spawnChance:1,this.emitterLifetime=t.emitterLifetime||-1,this.maxParticles=t.maxParticles>0?t.maxParticles:1e3,this.addAtBack=!!t.addAtBack,this.rotation=0,this.ownerPos.set(0),t.pos?this.spawnPos.copyFrom(t.pos):this.spawnPos.set(0),this._prevEmitterPos.copyFrom(this.spawnPos),this._prevPosIsValid=!1,this._spawnTimer=0,this.emit=t.emit===void 0?!0:!!t.emit,this.autoUpdate=!!t.autoUpdate;const e=t.behaviors.map(i=>{const s=ct.knownBehaviors[i.type];return s?new s(i.config):(console.error(`Unknown behavior: ${i.type}`),null)}).filter(i=>!!i);e.push(Or),e.sort((i,s)=>i===Or?s.order===_t.Spawn?1:-1:s===Or?i.order===_t.Spawn?-1:1:i.order-s.order),this.initBehaviors=e.slice(),this.updateBehaviors=e.filter(i=>i!==Or&&i.updateParticle),this.recycleBehaviors=e.filter(i=>i!==Or&&i.recycleParticle)}getBehavior(t){return ct.knownBehaviors[t]&&this.initBehaviors.find(e=>e instanceof ct.knownBehaviors[t])||null}fillPool(t){for(;t>0;--t){const e=new Ql(this);e.next=this._poolFirst,this._poolFirst=e}}recycle(t,e=!1){for(let i=0;i<this.recycleBehaviors.length;++i)this.recycleBehaviors[i].recycleParticle(t,!e);t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next),t===this._activeParticlesLast&&(this._activeParticlesLast=t.prev),t===this._activeParticlesFirst&&(this._activeParticlesFirst=t.next),t.prev=null,t.next=this._poolFirst,this._poolFirst=t,t.parent&&t.parent.removeChild(t),--this.particleCount}rotate(t){if(this.rotation===t)return;const e=t-this.rotation;this.rotation=t,Bi(e,this.spawnPos),this._posChanged=!0}updateSpawnPos(t,e){this._posChanged=!0,this.spawnPos.x=t,this.spawnPos.y=e}updateOwnerPos(t,e){this._posChanged=!0,this.ownerPos.x=t,this.ownerPos.y=e}resetPositionTracking(){this._prevPosIsValid=!1}get emit(){return this._emit}set emit(t){this._emit=!!t,this._emitterLife=this.emitterLifetime}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){this._autoUpdate&&!t?Jl.remove(this.update,this):!this._autoUpdate&&t&&Jl.add(this.update,this),this._autoUpdate=!!t}playOnceAndDestroy(t){this.autoUpdate=!0,this.emit=!0,this._destroyWhenComplete=!0,this._completeCallback=t}playOnce(t){this.emit=!0,this._completeCallback=t}update(t){if(this._autoUpdate&&(t=Jl.elapsedMS*.001),!this._parent)return;for(let a=this._activeParticlesFirst,o;a;a=o)if(o=a.next,a.age+=t,a.age>a.maxLife||a.age<0)this.recycle(a);else{let h=a.age*a.oneOverLife;this.customEase&&(this.customEase.length===4?h=this.customEase(h,0,1,1):h=this.customEase(h)),a.agePercent=h;for(let l=0;l<this.updateBehaviors.length;++l)if(this.updateBehaviors[l].updateParticle(a,t)){this.recycle(a);break}}let e,i;this._prevPosIsValid&&(e=this._prevEmitterPos.x,i=this._prevEmitterPos.y);const s=this.ownerPos.x+this.spawnPos.x,n=this.ownerPos.y+this.spawnPos.y;if(this._emit)for(this._spawnTimer-=t<0?0:t;this._spawnTimer<=0;){if(this._emitterLife>=0&&(this._emitterLife-=this._frequency,this._emitterLife<=0)){this._spawnTimer=0,this._emitterLife=0,this.emit=!1;break}if(this.particleCount>=this.maxParticles){this._spawnTimer+=this._frequency;continue}let a,o;if(this._prevPosIsValid&&this._posChanged){const c=1+this._spawnTimer/t;a=(s-e)*c+e,o=(n-i)*c+i}else a=s,o=n;let h=null,l=null;for(let c=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),d=0;d<c;++d){if(this.spawnChance<1&&Math.random()>=this.spawnChance)continue;let u;if(this.minLifetime===this.maxLifetime?u=this.minLifetime:u=Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer>=u)continue;let f;this._poolFirst?(f=this._poolFirst,this._poolFirst=this._poolFirst.next,f.next=null):f=new Ql(this),f.init(u),this.addAtBack?this._parent.addChildAt(f,0):this._parent.addChild(f),h?(l.next=f,f.prev=l,l=f):l=h=f,++this.particleCount}if(h){this._activeParticlesLast?(this._activeParticlesLast.next=h,h.prev=this._activeParticlesLast,this._activeParticlesLast=l):(this._activeParticlesFirst=h,this._activeParticlesLast=l);for(let c=0;c<this.initBehaviors.length;++c){const d=this.initBehaviors[c];if(d===Or)for(let u=h,f;u;u=f){f=u.next,this.rotation!==0&&(Bi(this.rotation,u.position),u.rotation+=this.rotation),u.position.x+=a,u.position.y+=o,u.age+=-this._spawnTimer;let p=u.age*u.oneOverLife;this.customEase&&(this.customEase.length===4?p=this.customEase(p,0,1,1):p=this.customEase(p)),u.agePercent=p}else d.initParticles(h)}for(let c=h,d;c;c=d){d=c.next;for(let u=0;u<this.updateBehaviors.length;++u)if(this.updateBehaviors[u].updateParticle(c,-this._spawnTimer)){this.recycle(c);break}}}this._spawnTimer+=this._frequency}if(this._posChanged&&(this._prevEmitterPos.x=s,this._prevEmitterPos.y=n,this._prevPosIsValid=!0,this._posChanged=!1),!this._emit&&!this._activeParticlesFirst){if(this._completeCallback){const a=this._completeCallback;this._completeCallback=null,a()}this._destroyWhenComplete&&this.destroy()}}emitNow(){const t=this.ownerPos.x+this.spawnPos.x,e=this.ownerPos.y+this.spawnPos.y;let i=null,s=null;for(let n=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),a=0;a<n;++a){if(this.spawnChance<1&&Math.random()>=this.spawnChance)continue;let o;this._poolFirst?(o=this._poolFirst,this._poolFirst=this._poolFirst.next,o.next=null):o=new Ql(this);let h;this.minLifetime===this.maxLifetime?h=this.minLifetime:h=Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,o.init(h),this.addAtBack?this._parent.addChildAt(o,0):this._parent.addChild(o),i?(s.next=o,o.prev=s,s=o):s=i=o,++this.particleCount}if(i){this._activeParticlesLast?(this._activeParticlesLast.next=i,i.prev=this._activeParticlesLast,this._activeParticlesLast=s):(this._activeParticlesFirst=i,this._activeParticlesLast=s);for(let n=0;n<this.initBehaviors.length;++n){const a=this.initBehaviors[n];if(a===Or)for(let o=i,h;o;o=h)h=o.next,this.rotation!==0&&(Bi(this.rotation,o.position),o.rotation+=this.rotation),o.position.x+=t,o.position.y+=e;else a.initParticles(i)}}}cleanup(){let t,e;for(t=this._activeParticlesFirst;t;t=e)e=t.next,this.recycle(t,!0);this._activeParticlesFirst=this._activeParticlesLast=null,this.particleCount=0}get destroyed(){return!(this._parent&&this.initBehaviors.length)}destroy(){this.autoUpdate=!1,this.cleanup();let t;for(let e=this._poolFirst;e;e=t)t=e.next,e.destroy();this._poolFirst=this._parent=this.spawnPos=this.ownerPos=this.customEase=this._completeCallback=null,this.initBehaviors.length=this.updateBehaviors.length=this.recycleBehaviors.length=0}}ct.knownBehaviors={};class tc{constructor(t){this.x=t.x,this.y=t.y,this.w=t.w,this.h=t.h}getRandPos(t){t.x=Math.random()*this.w+this.x,t.y=Math.random()*this.h+this.y}}tc.type="rect",tc.editorConfig=null;class to{constructor(t){this.x=t.x||0,this.y=t.y||0,this.radius=t.radius,this.innerRadius=t.innerRadius||0,this.rotation=!!t.affectRotation}getRandPos(t){this.innerRadius!==this.radius?t.x=Math.random()*(this.radius-this.innerRadius)+this.innerRadius:t.x=this.radius,t.y=0;const e=Math.random()*Math.PI*2;this.rotation&&(t.rotation+=e),Bi(e,t.position),t.position.x+=this.x,t.position.y+=this.y}}to.type="torus",to.editorConfig=null;class ec{constructor(t){this.segments=[],this.countingLengths=[],this.totalLength=0,this.init(t)}init(t){if(!t||!t.length)this.segments.push({p1:{x:0,y:0},p2:{x:0,y:0},l:0});else if(Array.isArray(t[0]))for(let e=0;e<t.length;++e){const i=t[e];let s=i[0];for(let n=1;n<i.length;++n){const a=i[n];this.segments.push({p1:s,p2:a,l:0}),s=a}}else{let e=t[0];for(let i=1;i<t.length;++i){const s=t[i];this.segments.push({p1:e,p2:s,l:0}),e=s}}for(let e=0;e<this.segments.length;++e){const{p1:i,p2:s}=this.segments[e],n=Math.sqrt((s.x-i.x)*(s.x-i.x)+(s.y-i.y)*(s.y-i.y));this.segments[e].l=n,this.totalLength+=n,this.countingLengths.push(this.totalLength)}}getRandPos(t){const e=Math.random()*this.totalLength;let i,s;if(this.segments.length===1)i=this.segments[0],s=e;else for(let o=0;o<this.countingLengths.length;++o)if(e<this.countingLengths[o]){i=this.segments[o],s=o===0?e:e-this.countingLengths[o-1];break}s/=i.l||1;const{p1:n,p2:a}=i;t.x=n.x+s*(a.x-n.x),t.y=n.y+s*(a.y-n.y)}}ec.type="polygonalChain",ec.editorConfig=null;class ic{constructor(t){var e;this.order=_t.Late,this.minStart=t.minStart,this.maxStart=t.maxStart,this.accel=t.accel,this.rotate=!!t.rotate,this.maxSpeed=(e=t.maxSpeed)!==null&&e!==void 0?e:0}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.maxStart-this.minStart)+this.minStart;e.config.velocity?e.config.velocity.set(i,0):e.config.velocity=new tt(i,0),Bi(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=t.config.velocity,s=i.x,n=i.y;if(i.x+=this.accel.x*e,i.y+=this.accel.y*e,this.maxSpeed){const a=Mm(i);a>this.maxSpeed&&Dm(i,this.maxSpeed/a)}t.x+=(s+i.x)/2*e,t.y+=(n+i.y)/2*e,this.rotate&&(t.rotation=Math.atan2(i.y,i.x))}}ic.type="moveAcceleration",ic.editorConfig=null;function mE(r){return this.ease&&(r=this.ease(r)),(this.first.next.value-this.first.value)*r+this.first.value}function gE(r){this.ease&&(r=this.ease(r));const t=this.first.value,e=this.first.next.value,i=(e.r-t.r)*r+t.r,s=(e.g-t.g)*r+t.g,n=(e.b-t.b)*r+t.b;return Qa(i,s,n)}function _E(r){this.ease&&(r=this.ease(r));let t=this.first,e=t.next;for(;r>e.time;)t=e,e=e.next;return r=(r-t.time)/(e.time-t.time),(e.value-t.value)*r+t.value}function yE(r){this.ease&&(r=this.ease(r));let t=this.first,e=t.next;for(;r>e.time;)t=e,e=e.next;r=(r-t.time)/(e.time-t.time);const i=t.value,s=e.value,n=(s.r-i.r)*r+i.r,a=(s.g-i.g)*r+i.g,o=(s.b-i.b)*r+i.b;return Qa(n,a,o)}function xE(r){this.ease&&(r=this.ease(r));let t=this.first;for(;t.next&&r>t.next.time;)t=t.next;return t.value}function vE(r){this.ease&&(r=this.ease(r));let t=this.first;for(;t.next&&r>t.next.time;)t=t.next;const e=t.value;return Qa(e.r,e.g,e.b)}class xn{constructor(t=!1){this.first=null,this.isColor=!!t,this.interpolate=null,this.ease=null}reset(t){this.first=t,t.next&&t.next.time>=1?this.interpolate=this.isColor?gE:mE:t.isStepped?this.interpolate=this.isColor?vE:xE:this.interpolate=this.isColor?yE:_E,this.ease=this.first.ease}}class rc{constructor(t){this.order=_t.Normal,this.list=new xn(!1),this.list.reset(ui.createList(t.alpha))}initParticles(t){let e=t;for(;e;)e.alpha=this.list.first.value,e=e.next}updateParticle(t){t.alpha=this.list.interpolate(t.agePercent)}}rc.type="alpha",rc.editorConfig=null;class sc{constructor(t){this.order=_t.Normal,this.value=t.alpha}initParticles(t){let e=t;for(;e;)e.alpha=this.value,e=e.next}}sc.type="alphaStatic",sc.editorConfig=null;function Om(r){const t=[];for(let e=0;e<r.length;++e){let i=r[e];if(typeof i=="string")t.push(yn(i));else if(i instanceof W)t.push(i);else{let s=i.count||1;for(typeof i.texture=="string"?i=yn(i.texture):i=i.texture;s>0;--s)t.push(i)}}return t}class nc{constructor(t){this.order=_t.Normal,this.anims=[];for(let e=0;e<t.anims.length;++e){const i=t.anims[e],s=Om(i.textures),n=i.framerate<0?-1:i.framerate>0?i.framerate:60,a={textures:s,duration:n>0?s.length/n:0,framerate:n,loop:n>0?!!i.loop:!1};this.anims.push(a)}}initParticles(t){let e=t;for(;e;){const i=Math.floor(Math.random()*this.anims.length),s=e.config.anim=this.anims[i];e.texture=s.textures[0],e.config.animElapsed=0,s.framerate===-1?(e.config.animDuration=e.maxLife,e.config.animFramerate=s.textures.length/e.maxLife):(e.config.animDuration=s.duration,e.config.animFramerate=s.framerate),e=e.next}}updateParticle(t,e){const i=t.config,s=i.anim;i.animElapsed+=e,i.animElapsed>=i.animDuration&&(i.anim.loop?i.animElapsed=i.animElapsed%i.animDuration:i.animElapsed=i.animDuration-1e-6);const n=i.animElapsed*i.animFramerate+1e-7|0;t.texture=s.textures[n]||s.textures[s.textures.length-1]||W.EMPTY}}nc.type="animatedRandom",nc.editorConfig=null;class ac{constructor(t){this.order=_t.Normal;const e=t.anim,i=Om(e.textures),s=e.framerate<0?-1:e.framerate>0?e.framerate:60;this.anim={textures:i,duration:s>0?i.length/s:0,framerate:s,loop:s>0?!!e.loop:!1}}initParticles(t){let e=t;const i=this.anim;for(;e;)e.texture=i.textures[0],e.config.animElapsed=0,i.framerate===-1?(e.config.animDuration=e.maxLife,e.config.animFramerate=i.textures.length/e.maxLife):(e.config.animDuration=i.duration,e.config.animFramerate=i.framerate),e=e.next}updateParticle(t,e){const i=this.anim,s=t.config;s.animElapsed+=e,s.animElapsed>=s.animDuration&&(i.loop?s.animElapsed=s.animElapsed%s.animDuration:s.animElapsed=s.animDuration-1e-6);const n=s.animElapsed*s.animFramerate+1e-7|0;t.texture=i.textures[n]||i.textures[i.textures.length-1]||W.EMPTY}}ac.type="animatedSingle",ac.editorConfig=null;class oc{constructor(t){this.order=_t.Normal,this.value=t.blendMode}initParticles(t){let e=t;for(;e;)e.blendMode=pE(this.value),e=e.next}}oc.type="blendMode",oc.editorConfig=null;class hc{constructor(t){this.order=_t.Spawn,this.spacing=t.spacing*di,this.start=t.start*di,this.distance=t.distance}initParticles(t){let e=0,i=t;for(;i;){let s;this.spacing?s=this.start+this.spacing*e:s=Math.random()*Math.PI*2,i.rotation=s,this.distance&&(i.position.x=this.distance,Bi(s,i.position)),i=i.next,++e}}}hc.type="spawnBurst",hc.editorConfig=null;class lc{constructor(t){this.order=_t.Normal,this.list=new xn(!0),this.list.reset(ui.createList(t.color))}initParticles(t){let e=t;const i=this.list.first.value,s=Qa(i.r,i.g,i.b);for(;e;)e.tint=s,e=e.next}updateParticle(t){t.tint=this.list.interpolate(t.agePercent)}}lc.type="color",lc.editorConfig=null;class cc{constructor(t){this.order=_t.Normal;let e=t.color;e.charAt(0)==="#"?e=e.substr(1):e.indexOf("0x")===0&&(e=e.substr(2)),this.value=parseInt(e,16)}initParticles(t){let e=t;for(;e;)e.tint=this.value,e=e.next}}cc.type="colorStatic",cc.editorConfig=null;class uc{constructor(t){this.order=_t.Normal,this.index=0,this.textures=t.textures.map(e=>typeof e=="string"?yn(e):e)}initParticles(t){let e=t;for(;e;)e.texture=this.textures[this.index],++this.index>=this.textures.length&&(this.index=0),e=e.next}}uc.type="textureOrdered",uc.editorConfig=null;const xs=new tt,Fm=["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2","abs","acos","acosh","asin","asinh","atan","atanh","atan2","cbrt","ceil","cos","cosh","exp","expm1","floor","fround","hypot","log","log1p","log10","log2","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh"],bE=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(Fm).join("|"),"g");function TE(r){const t=r.match(bE);for(let e=t.length-1;e>=0;--e)Fm.indexOf(t[e])>=0&&(t[e]=`Math.${t[e]}`);return r=t.join(""),new Function("x",`return ${r};`)}class dc{constructor(t){var e;if(this.order=_t.Late,t.path)if(typeof t.path=="function")this.path=t.path;else try{this.path=TE(t.path)}catch{this.path=null}else this.path=i=>i;this.list=new xn(!1),this.list.reset(ui.createList(t.speed)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){e.config.initRotation=e.rotation,e.config.initPosition?e.config.initPosition.copyFrom(e.position):e.config.initPosition=new tt(e.x,e.y),e.config.movement=0;const i=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=i,e=e.next}}updateParticle(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult;t.config.movement+=i*e,xs.x=t.config.movement,xs.y=this.path(xs.x),Bi(t.config.initRotation,xs),t.position.x=t.config.initPosition.x+xs.x,t.position.y=t.config.initPosition.y+xs.y}}dc.type="movePath",dc.editorConfig=null;class fc{constructor(){this.order=_t.Spawn}initParticles(t){}}fc.type="spawnPoint",fc.editorConfig=null;class pc{constructor(t){this.order=_t.Normal,this.textures=t.textures.map(e=>typeof e=="string"?yn(e):e)}initParticles(t){let e=t;for(;e;){const i=Math.floor(Math.random()*this.textures.length);e.texture=this.textures[i],e=e.next}}}pc.type="textureRandom",pc.editorConfig=null;class mc{constructor(t){this.order=_t.Normal,this.minStart=t.minStart*di,this.maxStart=t.maxStart*di,this.minSpeed=t.minSpeed*di,this.maxSpeed=t.maxSpeed*di,this.accel=t.accel*di}initParticles(t){let e=t;for(;e;)this.minStart===this.maxStart?e.rotation+=this.maxStart:e.rotation+=Math.random()*(this.maxStart-this.minStart)+this.minStart,e.config.rotSpeed=Math.random()*(this.maxSpeed-this.minSpeed)+this.minSpeed,e=e.next}updateParticle(t,e){if(this.accel){const i=t.config.rotSpeed;t.config.rotSpeed+=this.accel*e,t.rotation+=(t.config.rotSpeed+i)/2*e}else t.rotation+=t.config.rotSpeed*e}}mc.type="rotation",mc.editorConfig=null;class gc{constructor(t){this.order=_t.Normal,this.min=t.min*di,this.max=t.max*di}initParticles(t){let e=t;for(;e;)this.min===this.max?e.rotation+=this.max:e.rotation+=Math.random()*(this.max-this.min)+this.min,e=e.next}}gc.type="rotationStatic",gc.editorConfig=null;class _c{constructor(t){this.order=_t.Late+1,this.rotation=(t.rotation||0)*di}initParticles(t){let e=t;for(;e;)e.rotation=this.rotation,e=e.next}}_c.type="noRotation",_c.editorConfig=null;class yc{constructor(t){var e;this.order=_t.Normal,this.list=new xn(!1),this.list.reset(ui.createList(t.scale)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){const i=Math.random()*(1-this.minMult)+this.minMult;e.config.scaleMult=i,e.scale.x=e.scale.y=this.list.first.value*i,e=e.next}}updateParticle(t){t.scale.x=t.scale.y=this.list.interpolate(t.agePercent)*t.config.scaleMult}}yc.type="scale",yc.editorConfig=null;class xc{constructor(t){this.order=_t.Normal,this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.max-this.min)+this.min;e.scale.x=e.scale.y=i,e=e.next}}}xc.type="scaleStatic",xc.editorConfig=null;class We{constructor(t){this.order=_t.Spawn;const e=We.shapes[t.type];if(!e)throw new Error(`No shape found with type '${t.type}'`);this.shape=new e(t.data)}static registerShape(t,e){We.shapes[e||t.type]=t}initParticles(t){let e=t;for(;e;)this.shape.getRandPos(e),e=e.next}}We.type="spawnShape",We.editorConfig=null,We.shapes={},We.registerShape(ec),We.registerShape(tc),We.registerShape(to),We.registerShape(to,"circle");class vc{constructor(t){this.order=_t.Normal,this.texture=typeof t.texture=="string"?yn(t.texture):t.texture}initParticles(t){let e=t;for(;e;)e.texture=this.texture,e=e.next}}vc.type="textureSingle",vc.editorConfig=null;class bc{constructor(t){var e;this.order=_t.Late,this.list=new xn(!1),this.list.reset(ui.createList(t.speed)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){const i=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=i,e.config.velocity?e.config.velocity.set(this.list.first.value*i,0):e.config.velocity=new tt(this.list.first.value*i,0),Bi(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult,s=t.config.velocity;fE(s),Dm(s,i),t.x+=s.x*e,t.y+=s.y*e}}bc.type="moveSpeed",bc.editorConfig=null;class Tc{constructor(t){this.order=_t.Late,this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.max-this.min)+this.min;e.config.velocity?e.config.velocity.set(i,0):e.config.velocity=new tt(i,0),Bi(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=t.config.velocity;t.x+=i.x*e,t.y+=i.y*e}}Tc.type="moveSpeedStatic",Tc.editorConfig=null,ct.registerBehavior(ic),ct.registerBehavior(rc),ct.registerBehavior(sc),ct.registerBehavior(nc),ct.registerBehavior(ac),ct.registerBehavior(oc),ct.registerBehavior(hc),ct.registerBehavior(lc),ct.registerBehavior(cc),ct.registerBehavior(uc),ct.registerBehavior(dc),ct.registerBehavior(fc),ct.registerBehavior(pc),ct.registerBehavior(mc),ct.registerBehavior(gc),ct.registerBehavior(_c),ct.registerBehavior(yc),ct.registerBehavior(xc),ct.registerBehavior(We),ct.registerBehavior(vc),ct.registerBehavior(bc),ct.registerBehavior(Tc);class Lm extends sl{constructor(t){const{text:e,fontSize:i=36,fontColor:s=16777215,stroke:n,strokeColor:a,strokeThickness:o,fontFamily:h="MicrosoftYaHei",fontWeight:l="normal",wordWrap:c=!1,wordWrapWidth:d=100,lineHeight:u=1.25,align:f="left",indent:p=0,shadow:m}=t,g=new Pi({fontSize:i,wordWrap:c,wordWrapWidth:d,fontWeight:l,lineHeight:u*i,breakWords:c,fill:s,align:f,fontFamily:h,stroke:n?a:"transparent",strokeThickness:n?o:0,lineJoin:"round"});m&&(g.dropShadow=!0,g.dropShadowColor=m[0],g.dropShadowAngle=m[1]*(Math.PI/180),g.dropShadowBlur=m[2],g.dropShadowDistance=m[3]),super(e,g),this.position.x=p*i}}class EE extends $t{constructor(t){super();const{start:e,control:i,end:s,json:n,duration:a,ease:o="power1.out",showControl:h=!1,loop:l=!1}=t;this._particleContainer=new vb,this.addChild(this._particleContainer);const c=new ct(this._particleContainer,n),d=this._createBezierPoints([e,...i,s],100,h),u={pathThrough:0};_n.to(u,{duration:a,pathThrough:d.length-1,repeat:l?-1:0,ease:o,onStart:()=>{c.emit=!0},onUpdate:()=>{const p=Math.floor(u.pathThrough),m=d[p];c.updateOwnerPos(m.x,m.y)},onComplete:()=>{_n.to(this,{alpha:0,duration:.5,onComplete:()=>{c.emit=!1,f.destroy(),this.removeFromParent()}})}});const f=new Wt;f.add(()=>{c.update(1/75)}),f.start()}_createBezierPoints(t,e,i){const s=[];i&&t.forEach((n,a)=>{const o=new Lm({text:a+1,fontSize:16});o.position.set(n.x,n.y),this.addChild(o)});for(let n=0;n<e;n++){const a=this._multiPointBezier(t,n/e);s.push(a)}return s}_multiPointBezier(t,e){const i=t.length;let s=0,n=0;const a=[];for(let o=0;o<i;o++)a[o]=this._binomial(i-1,o);for(let o=0;o<i;o++){const h=t[o],l=a[o],c=Math.pow(e,o),d=Math.pow(1-e,i-1-o);s+=h.x*d*c*l,n+=h.y*d*c*l}return{x:s,y:n}}_binomial(t,e){if(e===0||e===t)return 1;let i=1;for(let s=1;s<=e;s++)i=i*(t-s+1)/s;return i}}var fi=(r=>(r[r.Region=0]="Region",r[r.BoundingBox=1]="BoundingBox",r[r.Mesh=2]="Mesh",r[r.LinkedMesh=3]="LinkedMesh",r[r.Path=4]="Path",r[r.Point=5]="Point",r[r.Clipping=6]="Clipping",r))(fi||{}),j=(r=>(r[r.setup=0]="setup",r[r.first=1]="first",r[r.replace=2]="replace",r[r.add=3]="add",r))(j||{}),ve=(r=>(r[r.mixIn=0]="mixIn",r[r.mixOut=1]="mixOut",r))(ve||{}),eo=(r=>(r[r.Fixed=0]="Fixed",r[r.Percent=1]="Percent",r))(eo||{}),Fr=(r=>(r[r.Tangent=0]="Tangent",r[r.Chain=1]="Chain",r[r.ChainScale=2]="ChainScale",r))(Fr||{}),ee=(r=>(r[r.Normal=0]="Normal",r[r.OnlyTranslation=1]="OnlyTranslation",r[r.NoRotationOrReflection=2]="NoRotationOrReflection",r[r.NoScale=3]="NoScale",r[r.NoScaleOrReflection=4]="NoScaleOrReflection",r))(ee||{});class Nm{constructor(){this.size=null,this.names=null,this.values=null,this.renderObject=null}get width(){const t=this.texture;return t.trim?t.trim.width:t.orig.width}get height(){const t=this.texture;return t.trim?t.trim.height:t.orig.height}get u(){return this.texture._uvs.x0}get v(){return this.texture._uvs.y0}get u2(){return this.texture._uvs.x2}get v2(){return this.texture._uvs.y2}get offsetX(){const t=this.texture;return t.trim?t.trim.x:0}get offsetY(){return this.spineOffsetY}get pixiOffsetY(){const t=this.texture;return t.trim?t.trim.y:0}get spineOffsetY(){const t=this.texture;return this.originalHeight-this.height-(t.trim?t.trim.y:0)}get originalWidth(){return this.texture.orig.width}get originalHeight(){return this.texture.orig.height}get x(){return this.texture.frame.x}get y(){return this.texture.frame.y}get rotate(){return this.texture.rotate!==0}get degrees(){return(360-this.texture.rotate*45)%360}}class wE{constructor(){this.array=new Array}add(t){const e=this.contains(t);return this.array[t|0]=t|0,!e}contains(t){return this.array[t|0]!=null}remove(t){this.array[t|0]=void 0}clear(){this.array.length=0}}const Lr=class{constructor(r=0,t=0,e=0,i=0){this.r=r,this.g=t,this.b=e,this.a=i}set(r,t,e,i){return this.r=r,this.g=t,this.b=e,this.a=i,this.clamp()}setFromColor(r){return this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this}setFromString(r){return r=r.charAt(0)=="#"?r.substr(1):r,this.r=parseInt(r.substr(0,2),16)/255,this.g=parseInt(r.substr(2,2),16)/255,this.b=parseInt(r.substr(4,2),16)/255,this.a=r.length!=8?1:parseInt(r.substr(6,2),16)/255,this}add(r,t,e,i){return this.r+=r,this.g+=t,this.b+=e,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(r,t){r.r=((t&4278190080)>>>24)/255,r.g=((t&16711680)>>>16)/255,r.b=((t&65280)>>>8)/255,r.a=(t&255)/255}static rgb888ToColor(r,t){r.r=((t&16711680)>>>16)/255,r.g=((t&65280)>>>8)/255,r.b=(t&255)/255}static fromString(r){return new Lr().setFromString(r)}};let be=Lr;be.WHITE=new Lr(1,1,1,1),be.RED=new Lr(1,0,0,1),be.GREEN=new Lr(0,1,0,1),be.BLUE=new Lr(0,0,1,1),be.MAGENTA=new Lr(1,0,1,1);const Oi=class{static clamp(r,t,e){return r<t?t:r>e?e:r}static cosDeg(r){return Math.cos(r*Oi.degRad)}static sinDeg(r){return Math.sin(r*Oi.degRad)}static signum(r){return Math.sign(r)}static toInt(r){return r>0?Math.floor(r):Math.ceil(r)}static cbrt(r){const t=Math.pow(Math.abs(r),.3333333333333333);return r<0?-t:t}static randomTriangular(r,t){return Oi.randomTriangularWith(r,t,(r+t)*.5)}static randomTriangularWith(r,t,e){const i=Math.random(),s=t-r;return i<=(e-r)/s?r+Math.sqrt(i*s*(e-r)):t-Math.sqrt((1-i)*s*(t-e))}static isPowerOfTwo(r){return r&&(r&r-1)===0}};let N=Oi;N.PI=3.1415927,N.PI2=Oi.PI*2,N.radiansToDegrees=180/Oi.PI,N.radDeg=Oi.radiansToDegrees,N.degreesToRadians=Oi.PI/180,N.degRad=Oi.degreesToRadians;class AE{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}}class SE extends AE{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(t*2,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2==0?-2:2)+1}}class CE extends SE{applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}const vs=class{static arrayCopy(r,t,e,i,s){for(let n=t,a=i;n<t+s;n++,a++)e[a]=r[n]}static arrayFill(r,t,e,i){for(let s=t;s<e;s++)r[s]=i}static setArraySize(r,t,e=0){const i=r.length;if(i==t)return r;if(r.length=t,i<t)for(let s=i;s<t;s++)r[s]=e;return r}static ensureArrayCapacity(r,t,e=0){return r.length>=t?r:vs.setArraySize(r,t,e)}static newArray(r,t){const e=new Array(r);for(let i=0;i<r;i++)e[i]=t;return e}static newFloatArray(r){if(vs.SUPPORTS_TYPED_ARRAYS)return new Float32Array(r);const t=new Array(r);for(let e=0;e<t.length;e++)t[e]=0;return t}static newShortArray(r){if(vs.SUPPORTS_TYPED_ARRAYS)return new Int16Array(r);const t=new Array(r);for(let e=0;e<t.length;e++)t[e]=0;return t}static toFloatArray(r){return vs.SUPPORTS_TYPED_ARRAYS?new Float32Array(r):r}static toSinglePrecision(r){return vs.SUPPORTS_TYPED_ARRAYS?Math.fround(r):r}static webkit602BugfixHelper(r,t){}static contains(r,t,e=!0){for(let i=0;i<r.length;i++)if(r[i]==t)return!0;return!1}static enumValue(r,t){return r[t[0].toUpperCase()+t.slice(1)]}};let Q=vs;Q.SUPPORTS_TYPED_ARRAYS=typeof Float32Array<"u";class PE{constructor(t){this.items=new Array,this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}}class RE{constructor(t=0,e=0){this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){const t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){const t=this.length();return t!=0&&(this.x/=t,this.y/=t),this}}const IE={yDown:!0,FAIL_ON_NON_EXISTING_SKIN:!1,GLOBAL_AUTO_UPDATE:!0,GLOBAL_DELAY_LIMIT:0},rr=[0,0,0];class ME extends Ci{constructor(){super(...arguments),this.region=null,this.attachment=null}}class DE extends xb{constructor(t,e,i,s,n){super(t,e,i,s,n),this.region=null,this.attachment=null}}const km=class extends $t{constructor(r){if(super(),!r)throw new Error("The spineData param is required.");if(typeof r=="string")throw new Error('spineData param cant be string. Please use spine.Spine.fromAtlas("YOUR_RESOURCE_NAME") from now on.');this.spineData=r,this.createSkeleton(r),this.slotContainers=[],this.tempClipContainers=[];for(let t=0,e=this.skeleton.slots.length;t<e;t++){const i=this.skeleton.slots[t],s=i.getAttachment(),n=this.newContainer();if(this.slotContainers.push(n),this.addChild(n),this.tempClipContainers.push(null),!!s)if(s.type===fi.Region){const a=s.name,o=this.createSprite(i,s,a);i.currentSprite=o,i.currentSpriteName=a,n.addChild(o)}else if(s.type===fi.Mesh){const a=this.createMesh(i,s);i.currentMesh=a,i.currentMeshId=s.id,i.currentMeshName=s.name,n.addChild(a)}else s.type===fi.Clipping&&(this.createGraphics(i,s),n.addChild(i.clippingContainer),n.addChild(i.currentGraphics))}this.tintRgb=new Float32Array([1,1,1]),this.autoUpdate=!0,this.visible=!0}get debug(){return this._debug}set debug(r){var t;r!=this._debug&&((t=this._debug)==null||t.unregisterSpine(this),r==null||r.registerSpine(this),this._debug=r)}get autoUpdate(){return this._autoUpdate}set autoUpdate(r){r!==this._autoUpdate&&(this._autoUpdate=r,this.updateTransform=r?km.prototype.autoUpdateTransform:$t.prototype.updateTransform)}get tint(){return jn(this.tintRgb)}set tint(r){this.tintRgb=Ly(r,this.tintRgb)}get delayLimit(){return(typeof this.localDelayLimit<"u"?this.localDelayLimit:IE.GLOBAL_DELAY_LIMIT)||Number.MAX_VALUE}update(r){var l;const t=this.delayLimit;if(r>t&&(r=t),this.state.update(r),this.state.apply(this.skeleton),!this.skeleton)return;this.skeleton.updateWorldTransform();const e=this.skeleton.slots,i=this.color;let s=null,n=null;i?(s=i.light,n=i.dark):s=this.tintRgb;for(let c=0,d=e.length;c<d;c++){const u=e[c],f=u.getAttachment(),p=this.slotContainers[c];if(!f){p.visible=!1;continue}let m=null;f.sequence&&f.sequence.apply(u,f);let g=f.region;const y=f.color;switch(f!=null&&f.type){case fi.Region:if(p.transform.setFromMatrix(u.bone.matrix),g=f.region,u.currentMesh&&(u.currentMesh.visible=!1,u.currentMesh=null,u.currentMeshId=void 0,u.currentMeshName=void 0),!g){u.currentSprite&&(u.currentSprite.renderable=!1);break}if(!u.currentSpriteName||u.currentSpriteName!==f.name){const x=f.name;if(u.currentSprite&&(u.currentSprite.visible=!1),u.sprites=u.sprites||{},u.sprites[x]!==void 0)u.sprites[x].visible=!0;else{const b=this.createSprite(u,f,x);p.addChild(b)}u.currentSprite=u.sprites[x],u.currentSpriteName=x}u.currentSprite.renderable=!0,u.hackRegion||this.setSpriteRegion(f,u.currentSprite,g),u.currentSprite.color?m=u.currentSprite.color:(rr[0]=s[0]*u.color.r*y.r,rr[1]=s[1]*u.color.g*y.g,rr[2]=s[2]*u.color.b*y.b,u.currentSprite.tint=jn(rr)),u.currentSprite.blendMode=u.blendMode;break;case fi.Mesh:if(u.currentSprite){u.currentSprite.visible=!1,u.currentSprite=null,u.currentSpriteName=void 0;const x=new sa;x._parentID=-1,x._worldID=p.transform._worldID,p.transform=x}if(!g){u.currentMesh&&(u.currentMesh.renderable=!1);break}const _=f.id;if(u.currentMeshId===void 0||u.currentMeshId!==_){const x=_;if(u.currentMesh&&(u.currentMesh.visible=!1),u.meshes=u.meshes||{},u.meshes[x]!==void 0)u.meshes[x].visible=!0;else{const b=this.createMesh(u,f);p.addChild(b)}u.currentMesh=u.meshes[x],u.currentMeshName=f.name,u.currentMeshId=x}u.currentMesh.renderable=!0,f.computeWorldVerticesOld(u,u.currentMesh.vertices),u.currentMesh.color?m=u.currentMesh.color:(rr[0]=s[0]*u.color.r*y.r,rr[1]=s[1]*u.color.g*y.g,rr[2]=s[2]*u.color.b*y.b,u.currentMesh.tint=jn(rr)),u.currentMesh.blendMode=u.blendMode,u.hackRegion||this.setMeshRegion(f,u.currentMesh,g);break;case fi.Clipping:u.currentGraphics||(this.createGraphics(u,f),p.addChild(u.clippingContainer),p.addChild(u.currentGraphics)),this.updateGraphics(u,f),p.alpha=1,p.visible=!0;continue;default:p.visible=!1;continue}if(p.visible=!0,m){let v=u.color.r*y.r,_=u.color.g*y.g,x=u.color.b*y.b;m.setLight(s[0]*v+n[0]*(1-v),s[1]*_+n[1]*(1-_),s[2]*x+n[2]*(1-x)),u.darkColor?(v=u.darkColor.r,_=u.darkColor.g,x=u.darkColor.b):(v=0,_=0,x=0),m.setDark(s[0]*v+n[0]*(1-v),s[1]*_+n[1]*(1-_),s[2]*x+n[2]*(1-x))}p.alpha=u.color.a}const a=this.skeleton.drawOrder;let o=null,h=null;for(let c=0,d=a.length;c<d;c++){const u=e[a[c].data.index],f=this.slotContainers[a[c].data.index];if(h||f.parent!==null&&f.parent!==this&&(f.parent.removeChild(f),f.parent=this),u.currentGraphics&&u.getAttachment())h=u.clippingContainer,o=u.getAttachment(),h.children.length=0,this.children[c]=f,o.endSlot===u.data&&(o.endSlot=null);else if(h){let p=this.tempClipContainers[c];p||(p=this.tempClipContainers[c]=this.newContainer(),p.visible=!1),this.children[c]=p,f.parent=null,h.addChild(f),o.endSlot==u.data&&(h.renderable=!0,h=null,o=null)}else this.children[c]=f}(l=this._debug)==null||l.renderDebug(this)}setSpriteRegion(r,t,e){t.attachment===r&&t.region===e||(t.region=e,t.attachment=r,t.texture=e.texture,t.rotation=r.rotation*N.degRad,t.position.x=r.x,t.position.y=r.y,t.alpha=r.color.a,e.size?(t.scale.x=e.size.width/e.originalWidth,t.scale.y=-e.size.height/e.originalHeight):(t.scale.x=r.scaleX*r.width/e.originalWidth,t.scale.y=-r.scaleY*r.height/e.originalHeight))}setMeshRegion(r,t,e){t.attachment===r&&t.region===e||(t.region=e,t.attachment=r,t.texture=e.texture,e.texture.updateUvs(),t.uvBuffer.update(r.regionUVs))}autoUpdateTransform(){{this.lastTime=this.lastTime||Date.now();const r=(Date.now()-this.lastTime)*.001;this.lastTime=Date.now(),this.update(r)}$t.prototype.updateTransform.call(this)}createSprite(r,t,e){let i=t.region;r.hackAttachment===t&&(i=r.hackRegion);const s=i?i.texture:null,n=this.newSprite(s);return n.anchor.set(.5),i&&this.setSpriteRegion(t,n,t.region),r.sprites=r.sprites||{},r.sprites[e]=n,n}createMesh(r,t){let e=t.region;r.hackAttachment===t&&(e=r.hackRegion,r.hackAttachment=null,r.hackRegion=null);const i=this.newMesh(e?e.texture:null,new Float32Array(t.regionUVs.length),t.regionUVs,new Uint16Array(t.triangles),Le.TRIANGLES);return typeof i._canvasPadding<"u"&&(i._canvasPadding=1.5),i.alpha=t.color.a,i.region=t.region,e&&this.setMeshRegion(t,i,e),r.meshes=r.meshes||{},r.meshes[t.id]=i,i}createGraphics(r,t){const e=this.newGraphics(),i=new Hi([]);return e.clear(),e.beginFill(16777215,1),e.drawPolygon(i),e.renderable=!1,r.currentGraphics=e,r.clippingContainer=this.newContainer(),r.clippingContainer.mask=r.currentGraphics,e}updateGraphics(r,t){const e=r.currentGraphics.geometry,i=e.graphicsData[0].shape.points,s=t.worldVerticesLength;i.length=s,t.computeWorldVertices(r,0,s,i,0,2),e.invalidate()}hackTextureBySlotIndex(r,t=null,e=null){const i=this.skeleton.slots[r];if(!i)return!1;const s=i.getAttachment();let n=s.region;return t?(n=new Nm,n.texture=t,n.size=e,i.hackRegion=n,i.hackAttachment=s):(i.hackRegion=null,i.hackAttachment=null),i.currentSprite?this.setSpriteRegion(s,i.currentSprite,n):i.currentMesh&&this.setMeshRegion(s,i.currentMesh,n),!0}hackTextureBySlotName(r,t=null,e=null){const i=this.skeleton.findSlotIndex(r);return i==-1?!1:this.hackTextureBySlotIndex(i,t,e)}hackTextureAttachment(r,t,e,i=null){const s=this.skeleton.findSlotIndex(r),n=this.skeleton.getAttachmentByName(r,t);n.region.texture=e;const a=this.skeleton.slots[s];if(!a)return!1;const o=a.getAttachment();if(t===o.name){let h=n.region;return e?(h=new Nm,h.texture=e,h.size=i,a.hackRegion=h,a.hackAttachment=o):(a.hackRegion=null,a.hackAttachment=null),a.currentSprite&&a.currentSprite.region!=h?(this.setSpriteRegion(o,a.currentSprite,h),a.currentSprite.region=h):a.currentMesh&&a.currentMesh.region!=h&&this.setMeshRegion(o,a.currentMesh,h),!0}return!1}newContainer(){return new $t}newSprite(r){return new ME(r)}newGraphics(){return new en}newMesh(r,t,e,i,s){return new DE(r,t,e,i,s)}transformHack(){return 1}hackAttachmentGroups(r,t,e){if(!r)return;const i=[],s=[];for(let n=0,a=this.skeleton.slots.length;n<a;n++){const o=this.skeleton.slots[n],h=o.currentSpriteName||o.currentMeshName||"",l=o.currentSprite||o.currentMesh;h.endsWith(r)?(l.parentGroup=t,s.push(l)):e&&l&&(l.parentGroup=e,i.push(l))}return[i,s]}destroy(r){this.debug=null;for(let t=0,e=this.skeleton.slots.length;t<e;t++){const i=this.skeleton.slots[t];for(const s in i.meshes)i.meshes[s].destroy(r);i.meshes=null;for(const s in i.sprites)i.sprites[s].destroy(r);i.sprites=null}for(let t=0,e=this.slotContainers.length;t<e;t++)this.slotContainers[t].destroy(r);this.spineData=null,this.skeleton=null,this.slotContainers=null,this.stateData=null,this.state=null,this.tempClipContainers=null,super.destroy(r)}};let Ec=km;Ec.clippingPolygon=[],Object.defineProperty(Ec.prototype,"visible",{get(){return this._visible},set(r){r!==this._visible&&(this._visible=r,r&&(this.lastTime=0))}});class Um{constructor(t){if(t==null)throw new Error("name cannot be null.");this.name=t}}const Gm=class extends Um{constructor(r){super(r),this.id=(Gm.nextID++&65535)<<11,this.worldVerticesLength=0,this.deformAttachment=this}computeWorldVerticesOld(r,t){this.computeWorldVertices(r,0,this.worldVerticesLength,t,0,2)}computeWorldVertices(r,t,e,i,s,n){e=s+(e>>1)*n;const a=r.bone.skeleton,o=r.deform;let h=this.vertices;const l=this.bones;if(l==null){o.length>0&&(h=o);const f=r.bone.matrix,p=f.tx,m=f.ty,g=f.a,y=f.c,v=f.b,_=f.d;for(let x=t,b=s;b<e;x+=2,b+=n){const E=h[x],T=h[x+1];i[b]=E*g+T*y+p,i[b+1]=E*v+T*_+m}return}let c=0,d=0;for(let f=0;f<t;f+=2){const p=l[c];c+=p+1,d+=p}const u=a.bones;if(o.length==0)for(let f=s,p=d*3;f<e;f+=n){let m=0,g=0,y=l[c++];for(y+=c;c<y;c++,p+=3){const v=u[l[c]].matrix,_=h[p],x=h[p+1],b=h[p+2];m+=(_*v.a+x*v.c+v.tx)*b,g+=(_*v.b+x*v.d+v.ty)*b}i[f]=m,i[f+1]=g}else{const f=o;for(let p=s,m=d*3,g=d<<1;p<e;p+=n){let y=0,v=0,_=l[c++];for(_+=c;c<_;c++,m+=3,g+=2){const x=u[l[c]].matrix,b=h[m]+f[g],E=h[m+1]+f[g+1],T=h[m+2];y+=(b*x.a+E*x.c+x.tx)*T,v+=(b*x.b+E*x.d+x.ty)*T}i[p]=y,i[p+1]=v}}}copyTo(r){this.bones!=null?(r.bones=new Array(this.bones.length),Q.arrayCopy(this.bones,0,r.bones,0,this.bones.length)):r.bones=null,this.vertices!=null?(r.vertices=Q.newFloatArray(this.vertices.length),Q.arrayCopy(this.vertices,0,r.vertices,0,this.vertices.length)):r.vertices=null,r.worldVerticesLength=this.worldVerticesLength,r.deformAttachment=this.deformAttachment}};let wc=Gm;wc.nextID=0;class io extends wc{constructor(t){super(t),this.type=fi.Mesh,this.color=new be(1,1,1,1),this.tempColor=new be(0,0,0,0)}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t!=null&&(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!=null)return this.newLinkedMesh();const t=new io(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Float32Array(this.regionUVs.length),Q.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.triangles=new Array(this.triangles.length),Q.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,this.edges!=null&&(t.edges=new Array(this.edges.length),Q.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}newLinkedMesh(){const t=new io(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),t.deformAttachment=this.deformAttachment,t.setParentMesh(this.parentMesh!=null?this.parentMesh:this),t}}class vn extends wc{constructor(t){super(t),this.type=fi.Path,this.closed=!1,this.constantSpeed=!1,this.color=new be(1,1,1,1)}copy(){const t=new vn(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),Q.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}}class Vm{constructor(t,e){if(this.deform=new Array,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new be,this.darkColor=t.darkColor==null?null:new be,this.setToSetupPose(),this.blendMode=this.data.blendMode}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.deform.length=0)}setAttachmentTime(t){this.attachmentTime=this.bone.skeleton.time-t}getAttachmentTime(){return this.bone.skeleton.time-this.attachmentTime}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor!=null&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName==null?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))}}const jt=class extends Um{constructor(r){super(r),this.type=fi.Region,this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new be(1,1,1,1),this.offset=Q.newFloatArray(8),this.uvs=Q.newFloatArray(8),this.tempColor=new be(1,1,1,1)}updateOffset(){const r=this.width/this.region.originalWidth*this.scaleX,t=this.height/this.region.originalHeight*this.scaleY,e=-this.width/2*this.scaleX+this.region.offsetX*r,i=-this.height/2*this.scaleY+this.region.offsetY*t,s=e+this.region.width*r,n=i+this.region.height*t,a=this.rotation*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=e*o+this.x,c=e*h,d=i*o+this.y,u=i*h,f=s*o+this.x,p=s*h,m=n*o+this.y,g=n*h,y=this.offset;y[jt.OX1]=l-u,y[jt.OY1]=d+c,y[jt.OX2]=l-g,y[jt.OY2]=m+c,y[jt.OX3]=f-g,y[jt.OY3]=m+p,y[jt.OX4]=f-u,y[jt.OY4]=d+p}setRegion(r){this.region=r;const t=this.uvs;r.rotate?(t[2]=r.u,t[3]=r.v2,t[4]=r.u,t[5]=r.v,t[6]=r.u2,t[7]=r.v,t[0]=r.u2,t[1]=r.v2):(t[0]=r.u,t[1]=r.v2,t[2]=r.u,t[3]=r.v,t[4]=r.u2,t[5]=r.v,t[6]=r.u2,t[7]=r.v2)}computeWorldVertices(r,t,e,i){const s=this.offset,n=r instanceof Vm?r.bone.matrix:r.matrix,a=n.tx,o=n.ty,h=n.a,l=n.c,c=n.b,d=n.d;let u=0,f=0;u=s[jt.OX1],f=s[jt.OY1],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o,e+=i,u=s[jt.OX2],f=s[jt.OY2],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o,e+=i,u=s[jt.OX3],f=s[jt.OY3],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o,e+=i,u=s[jt.OX4],f=s[jt.OY4],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o}copy(){const r=new jt(this.name);return r.region=this.region,r.rendererObject=this.rendererObject,r.path=this.path,r.x=this.x,r.y=this.y,r.scaleX=this.scaleX,r.scaleY=this.scaleY,r.rotation=this.rotation,r.width=this.width,r.height=this.height,Q.arrayCopy(this.uvs,0,r.uvs,0,8),Q.arrayCopy(this.offset,0,r.offset,0,8),r.color.setFromColor(this.color),r}};let et=jt;et.OX1=0,et.OY1=1,et.OX2=2,et.OY2=3,et.OX3=4,et.OY3=5,et.OX4=6,et.OY4=7,et.X1=0,et.Y1=1,et.C1R=2,et.C1G=3,et.C1B=4,et.C1A=5,et.U1=6,et.V1=7,et.X2=8,et.Y2=9,et.C2R=10,et.C2G=11,et.C2B=12,et.C2A=13,et.U2=14,et.V2=15,et.X3=16,et.Y3=17,et.C3R=18,et.C3G=19,et.C3B=20,et.C3A=21,et.U3=22,et.V3=23,et.X4=24,et.Y4=25,et.C4R=26,et.C4G=27,et.C4B=28,et.C4A=29,et.U4=30,et.V4=31,new CE(2);class fe{constructor(t,e,i){if(t==null)throw new Error("name cannot be null.");if(e==null)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(let s=0;s<e.length;s++)this.timelineIds[e[s].getPropertyId()]=!0;this.duration=i}hasTimeline(t){return this.timelineIds[t]==!0}apply(t,e,i,s,n,a,o,h){if(t==null)throw new Error("skeleton cannot be null.");s&&this.duration!=0&&(i%=this.duration,e>0&&(e%=this.duration));const l=this.timelines;for(let c=0,d=l.length;c<d;c++)l[c].apply(t,e,i,n,a,o,h)}static binarySearch(t,e,i=1){let s=0,n=t.length/i-2;if(n==0)return i;let a=n>>>1;for(;;){if(t[(a+1)*i]<=e?s=a+1:n=a,s==n)return(s+1)*i;a=s+n>>>1}}static linearSearch(t,e,i){for(let s=0,n=t.length-i;s<=n;s+=i)if(t[s]>e)return s;return-1}}const Lt=class{constructor(r){if(r<=0)throw new Error(`frameCount must be > 0: ${r}`);this.curves=Q.newFloatArray((r-1)*Lt.BEZIER_SIZE)}getFrameCount(){return this.curves.length/Lt.BEZIER_SIZE+1}setLinear(r){this.curves[r*Lt.BEZIER_SIZE]=Lt.LINEAR}setStepped(r){this.curves[r*Lt.BEZIER_SIZE]=Lt.STEPPED}getCurveType(r){const t=r*Lt.BEZIER_SIZE;if(t==this.curves.length)return Lt.LINEAR;const e=this.curves[t];return e==Lt.LINEAR?Lt.LINEAR:e==Lt.STEPPED?Lt.STEPPED:Lt.BEZIER}setCurve(r,t,e,i,s){const n=(-t*2+i)*.03,a=(-e*2+s)*.03,o=((t-i)*3+1)*.006,h=((e-s)*3+1)*.006;let l=n*2+o,c=a*2+h,d=t*.3+n+o*.16666667,u=e*.3+a+h*.16666667,f=r*Lt.BEZIER_SIZE;const p=this.curves;p[f++]=Lt.BEZIER;let m=d,g=u;for(let y=f+Lt.BEZIER_SIZE-1;f<y;f+=2)p[f]=m,p[f+1]=g,d+=l,u+=c,l+=o,c+=h,m+=d,g+=u}getCurvePercent(r,t){t=N.clamp(t,0,1);const e=this.curves;let i=r*Lt.BEZIER_SIZE;const s=e[i];if(s==Lt.LINEAR)return t;if(s==Lt.STEPPED)return 0;i++;let n=0;for(let o=i,h=i+Lt.BEZIER_SIZE-1;i<h;i+=2)if(n=e[i],n>=t){let l,c;return i==o?(l=0,c=0):(l=e[i-2],c=e[i-1]),c+(e[i+1]-c)*(t-l)/(n-l)}const a=e[i-1];return a+(1-a)*(t-n)/(1-n)}};let De=Lt;De.LINEAR=0,De.STEPPED=1,De.BEZIER=2,De.BEZIER_SIZE=10*2-1;const sr=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r<<1)}getPropertyId(){return 0+this.boneIndex}setFrame(r,t,e){r<<=1,this.frames[r]=t,this.frames[r+sr.ROTATION]=e}apply(r,t,e,i,s,n,a){const o=this.frames,h=r.bones[this.boneIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.rotation=h.data.rotation;return;case j.first:const p=h.data.rotation-h.rotation;h.rotation+=(p-(16384-(16384.499999999996-p/360|0))*360)*s}return}if(e>=o[o.length-sr.ENTRIES]){let p=o[o.length+sr.PREV_ROTATION];switch(n){case j.setup:h.rotation=h.data.rotation+p*s;break;case j.first:case j.replace:p+=h.data.rotation-h.rotation,p-=(16384-(16384.499999999996-p/360|0))*360;case j.add:h.rotation+=p*s}return}const l=fe.binarySearch(o,e,sr.ENTRIES),c=o[l+sr.PREV_ROTATION],d=o[l],u=this.getCurvePercent((l>>1)-1,1-(e-d)/(o[l+sr.PREV_TIME]-d));let f=o[l+sr.ROTATION]-c;switch(f=c+(f-(16384-(16384.499999999996-f/360|0))*360)*u,n){case j.setup:h.rotation=h.data.rotation+(f-(16384-(16384.499999999996-f/360|0))*360)*s;break;case j.first:case j.replace:f+=h.data.rotation-h.rotation;case j.add:h.rotation+=(f-(16384-(16384.499999999996-f/360|0))*360)*s}}};let Be=sr;Be.ENTRIES=2,Be.PREV_TIME=-2,Be.PREV_ROTATION=-1,Be.ROTATION=1;const ne=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r*ne.ENTRIES)}getPropertyId(){return(1<<24)+this.boneIndex}setFrame(r,t,e,i){r*=ne.ENTRIES,this.frames[r]=t,this.frames[r+ne.X]=e,this.frames[r+ne.Y]=i}apply(r,t,e,i,s,n,a){const o=this.frames,h=r.bones[this.boneIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.x=h.data.x,h.y=h.data.y;return;case j.first:h.x+=(h.data.x-h.x)*s,h.y+=(h.data.y-h.y)*s}return}let l=0,c=0;if(e>=o[o.length-ne.ENTRIES])l=o[o.length+ne.PREV_X],c=o[o.length+ne.PREV_Y];else{const d=fe.binarySearch(o,e,ne.ENTRIES);l=o[d+ne.PREV_X],c=o[d+ne.PREV_Y];const u=o[d],f=this.getCurvePercent(d/ne.ENTRIES-1,1-(e-u)/(o[d+ne.PREV_TIME]-u));l+=(o[d+ne.X]-l)*f,c+=(o[d+ne.Y]-c)*f}switch(n){case j.setup:h.x=h.data.x+l*s,h.y=h.data.y+c*s;break;case j.first:case j.replace:h.x+=(h.data.x+l-h.x)*s,h.y+=(h.data.y+c-h.y)*s;break;case j.add:h.x+=l*s,h.y+=c*s}}};let bs=ne;bs.ENTRIES=3,bs.PREV_TIME=-3,bs.PREV_X=-2,bs.PREV_Y=-1,bs.X=1,bs.Y=2;const St=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r*St.ENTRIES)}getPropertyId(){return(5<<24)+this.slotIndex}setFrame(r,t,e,i,s,n){r*=St.ENTRIES,this.frames[r]=t,this.frames[r+St.R]=e,this.frames[r+St.G]=i,this.frames[r+St.B]=s,this.frames[r+St.A]=n}apply(r,t,e,i,s,n,a){const o=r.slots[this.slotIndex];if(!o.bone.active)return;const h=this.frames;if(e<h[0]){switch(n){case j.setup:o.color.setFromColor(o.data.color);return;case j.first:const f=o.color,p=o.data.color;f.add((p.r-f.r)*s,(p.g-f.g)*s,(p.b-f.b)*s,(p.a-f.a)*s)}return}let l=0,c=0,d=0,u=0;if(e>=h[h.length-St.ENTRIES]){const f=h.length;l=h[f+St.PREV_R],c=h[f+St.PREV_G],d=h[f+St.PREV_B],u=h[f+St.PREV_A]}else{const f=fe.binarySearch(h,e,St.ENTRIES);l=h[f+St.PREV_R],c=h[f+St.PREV_G],d=h[f+St.PREV_B],u=h[f+St.PREV_A];const p=h[f],m=this.getCurvePercent(f/St.ENTRIES-1,1-(e-p)/(h[f+St.PREV_TIME]-p));l+=(h[f+St.R]-l)*m,c+=(h[f+St.G]-c)*m,d+=(h[f+St.B]-d)*m,u+=(h[f+St.A]-u)*m}if(s==1)o.color.set(l,c,d,u);else{const f=o.color;n==j.setup&&f.setFromColor(o.data.color),f.add((l-f.r)*s,(c-f.g)*s,(d-f.b)*s,(u-f.a)*s)}}};let pi=St;pi.ENTRIES=5,pi.PREV_TIME=-5,pi.PREV_R=-4,pi.PREV_G=-3,pi.PREV_B=-2,pi.PREV_A=-1,pi.R=1,pi.G=2,pi.B=3,pi.A=4;const ot=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r*ot.ENTRIES)}getPropertyId(){return(14<<24)+this.slotIndex}setFrame(r,t,e,i,s,n,a,o,h){r*=ot.ENTRIES,this.frames[r]=t,this.frames[r+ot.R]=e,this.frames[r+ot.G]=i,this.frames[r+ot.B]=s,this.frames[r+ot.A]=n,this.frames[r+ot.R2]=a,this.frames[r+ot.G2]=o,this.frames[r+ot.B2]=h}apply(r,t,e,i,s,n,a){const o=r.slots[this.slotIndex];if(!o.bone.active)return;const h=this.frames;if(e<h[0]){switch(n){case j.setup:o.color.setFromColor(o.data.color),o.darkColor.setFromColor(o.data.darkColor);return;case j.first:const g=o.color,y=o.darkColor,v=o.data.color,_=o.data.darkColor;g.add((v.r-g.r)*s,(v.g-g.g)*s,(v.b-g.b)*s,(v.a-g.a)*s),y.add((_.r-y.r)*s,(_.g-y.g)*s,(_.b-y.b)*s,0)}return}let l=0,c=0,d=0,u=0,f=0,p=0,m=0;if(e>=h[h.length-ot.ENTRIES]){const g=h.length;l=h[g+ot.PREV_R],c=h[g+ot.PREV_G],d=h[g+ot.PREV_B],u=h[g+ot.PREV_A],f=h[g+ot.PREV_R2],p=h[g+ot.PREV_G2],m=h[g+ot.PREV_B2]}else{const g=fe.binarySearch(h,e,ot.ENTRIES);l=h[g+ot.PREV_R],c=h[g+ot.PREV_G],d=h[g+ot.PREV_B],u=h[g+ot.PREV_A],f=h[g+ot.PREV_R2],p=h[g+ot.PREV_G2],m=h[g+ot.PREV_B2];const y=h[g],v=this.getCurvePercent(g/ot.ENTRIES-1,1-(e-y)/(h[g+ot.PREV_TIME]-y));l+=(h[g+ot.R]-l)*v,c+=(h[g+ot.G]-c)*v,d+=(h[g+ot.B]-d)*v,u+=(h[g+ot.A]-u)*v,f+=(h[g+ot.R2]-f)*v,p+=(h[g+ot.G2]-p)*v,m+=(h[g+ot.B2]-m)*v}if(s==1)o.color.set(l,c,d,u),o.darkColor.set(f,p,m,1);else{const g=o.color,y=o.darkColor;n==j.setup&&(g.setFromColor(o.data.color),y.setFromColor(o.data.darkColor)),g.add((l-g.r)*s,(c-g.g)*s,(d-g.b)*s,(u-g.a)*s),y.add((f-y.r)*s,(p-y.g)*s,(m-y.b)*s,0)}}};let ie=ot;ie.ENTRIES=8,ie.PREV_TIME=-8,ie.PREV_R=-7,ie.PREV_G=-6,ie.PREV_B=-5,ie.PREV_A=-4,ie.PREV_R2=-3,ie.PREV_G2=-2,ie.PREV_B2=-1,ie.R=1,ie.G=2,ie.B=3,ie.A=4,ie.R2=5,ie.G2=6,ie.B2=7;class ro{constructor(t){this.frames=Q.newFloatArray(t),this.attachmentNames=new Array(t)}getPropertyId(){return(4<<24)+this.slotIndex}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i}apply(t,e,i,s,n,a,o){const h=t.slots[this.slotIndex];if(!h.bone.active)return;if(o==ve.mixOut){a==j.setup&&this.setAttachment(t,h,h.data.attachmentName);return}const l=this.frames;if(i<l[0]){(a==j.setup||a==j.first)&&this.setAttachment(t,h,h.data.attachmentName);return}let c=0;i>=l[l.length-1]?c=l.length-1:c=fe.binarySearch(l,i,1)-1;const d=this.attachmentNames[c];t.slots[this.slotIndex].setAttachment(d==null?null:t.getAttachment(this.slotIndex,d))}setAttachment(t,e,i){e.setAttachment(i==null?null:t.getAttachment(this.slotIndex,i))}}class BE{constructor(t){this.frames=Q.newFloatArray(t),this.events=new Array(t)}getPropertyId(){return 7<<24}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,i,s,n,a,o){if(s==null)return;const h=this.frames,l=this.frames.length;if(e>i)this.apply(t,e,Number.MAX_VALUE,s,n,a,o),e=-1;else if(e>=h[l-1])return;if(i<h[0])return;let c=0;if(e<h[0])c=0;else{c=fe.binarySearch(h,e);const d=h[c];for(;c>0&&h[c-1]==d;)c--}for(;c<l&&i>=h[c];c++)s.push(this.events[c])}}class Ac{constructor(t){this.frames=Q.newFloatArray(t),this.drawOrders=new Array(t)}getPropertyId(){return 8<<24}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,s,n,a,o){const h=t.drawOrder,l=t.slots;if(o==ve.mixOut&&a==j.setup){Q.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}const c=this.frames;if(i<c[0]){(a==j.setup||a==j.first)&&Q.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}let d=0;i>=c[c.length-1]?d=c.length-1:d=fe.binarySearch(c,i)-1;const u=this.drawOrders[d];if(u==null)Q.arrayCopy(l,0,h,0,l.length);else for(let f=0,p=u.length;f<p;f++)h[f]=l[u[f]]}}const ht=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r*ht.ENTRIES)}getPropertyId(){return(9<<24)+this.ikConstraintIndex}setFrame(r,t,e,i,s,n,a){r*=ht.ENTRIES,this.frames[r]=t,this.frames[r+ht.MIX]=e,this.frames[r+ht.SOFTNESS]=i,this.frames[r+ht.BEND_DIRECTION]=s,this.frames[r+ht.COMPRESS]=n?1:0,this.frames[r+ht.STRETCH]=a?1:0}apply(r,t,e,i,s,n,a){const o=this.frames,h=r.ikConstraints[this.ikConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.mix=h.data.mix,h.softness=h.data.softness,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch;return;case j.first:h.mix+=(h.data.mix-h.mix)*s,h.softness+=(h.data.softness-h.softness)*s,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch}return}if(e>=o[o.length-ht.ENTRIES]){n==j.setup?(h.mix=h.data.mix+(o[o.length+ht.PREV_MIX]-h.data.mix)*s,h.softness=h.data.softness+(o[o.length+ht.PREV_SOFTNESS]-h.data.softness)*s,a==ve.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=o[o.length+ht.PREV_BEND_DIRECTION],h.compress=o[o.length+ht.PREV_COMPRESS]!=0,h.stretch=o[o.length+ht.PREV_STRETCH]!=0)):(h.mix+=(o[o.length+ht.PREV_MIX]-h.mix)*s,h.softness+=(o[o.length+ht.PREV_SOFTNESS]-h.softness)*s,a==ve.mixIn&&(h.bendDirection=o[o.length+ht.PREV_BEND_DIRECTION],h.compress=o[o.length+ht.PREV_COMPRESS]!=0,h.stretch=o[o.length+ht.PREV_STRETCH]!=0));return}const l=fe.binarySearch(o,e,ht.ENTRIES),c=o[l+ht.PREV_MIX],d=o[l+ht.PREV_SOFTNESS],u=o[l],f=this.getCurvePercent(l/ht.ENTRIES-1,1-(e-u)/(o[l+ht.PREV_TIME]-u));n==j.setup?(h.mix=h.data.mix+(c+(o[l+ht.MIX]-c)*f-h.data.mix)*s,h.softness=h.data.softness+(d+(o[l+ht.SOFTNESS]-d)*f-h.data.softness)*s,a==ve.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=o[l+ht.PREV_BEND_DIRECTION],h.compress=o[l+ht.PREV_COMPRESS]!=0,h.stretch=o[l+ht.PREV_STRETCH]!=0)):(h.mix+=(c+(o[l+ht.MIX]-c)*f-h.mix)*s,h.softness+=(d+(o[l+ht.SOFTNESS]-d)*f-h.softness)*s,a==ve.mixIn&&(h.bendDirection=o[l+ht.PREV_BEND_DIRECTION],h.compress=o[l+ht.PREV_COMPRESS]!=0,h.stretch=o[l+ht.PREV_STRETCH]!=0))}};let Oe=ht;Oe.ENTRIES=6,Oe.PREV_TIME=-6,Oe.PREV_MIX=-5,Oe.PREV_SOFTNESS=-4,Oe.PREV_BEND_DIRECTION=-3,Oe.PREV_COMPRESS=-2,Oe.PREV_STRETCH=-1,Oe.MIX=1,Oe.SOFTNESS=2,Oe.BEND_DIRECTION=3,Oe.COMPRESS=4,Oe.STRETCH=5;const Ct=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r*Ct.ENTRIES)}getPropertyId(){return(10<<24)+this.transformConstraintIndex}setFrame(r,t,e,i,s,n){r*=Ct.ENTRIES,this.frames[r]=t,this.frames[r+Ct.ROTATE]=e,this.frames[r+Ct.TRANSLATE]=i,this.frames[r+Ct.SCALE]=s,this.frames[r+Ct.SHEAR]=n}apply(r,t,e,i,s,n,a){const o=this.frames,h=r.transformConstraints[this.transformConstraintIndex];if(!h.active)return;if(e<o[0]){const f=h.data;switch(n){case j.setup:h.rotateMix=f.rotateMix,h.translateMix=f.translateMix,h.scaleMix=f.scaleMix,h.shearMix=f.shearMix;return;case j.first:h.rotateMix+=(f.rotateMix-h.rotateMix)*s,h.translateMix+=(f.translateMix-h.translateMix)*s,h.scaleMix+=(f.scaleMix-h.scaleMix)*s,h.shearMix+=(f.shearMix-h.shearMix)*s}return}let l=0,c=0,d=0,u=0;if(e>=o[o.length-Ct.ENTRIES]){const f=o.length;l=o[f+Ct.PREV_ROTATE],c=o[f+Ct.PREV_TRANSLATE],d=o[f+Ct.PREV_SCALE],u=o[f+Ct.PREV_SHEAR]}else{const f=fe.binarySearch(o,e,Ct.ENTRIES);l=o[f+Ct.PREV_ROTATE],c=o[f+Ct.PREV_TRANSLATE],d=o[f+Ct.PREV_SCALE],u=o[f+Ct.PREV_SHEAR];const p=o[f],m=this.getCurvePercent(f/Ct.ENTRIES-1,1-(e-p)/(o[f+Ct.PREV_TIME]-p));l+=(o[f+Ct.ROTATE]-l)*m,c+=(o[f+Ct.TRANSLATE]-c)*m,d+=(o[f+Ct.SCALE]-d)*m,u+=(o[f+Ct.SHEAR]-u)*m}if(n==j.setup){const f=h.data;h.rotateMix=f.rotateMix+(l-f.rotateMix)*s,h.translateMix=f.translateMix+(c-f.translateMix)*s,h.scaleMix=f.scaleMix+(d-f.scaleMix)*s,h.shearMix=f.shearMix+(u-f.shearMix)*s}else h.rotateMix+=(l-h.rotateMix)*s,h.translateMix+=(c-h.translateMix)*s,h.scaleMix+=(d-h.scaleMix)*s,h.shearMix+=(u-h.shearMix)*s}};let mi=Ct;mi.ENTRIES=5,mi.PREV_TIME=-5,mi.PREV_ROTATE=-4,mi.PREV_TRANSLATE=-3,mi.PREV_SCALE=-2,mi.PREV_SHEAR=-1,mi.ROTATE=1,mi.TRANSLATE=2,mi.SCALE=3,mi.SHEAR=4;const $e=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r*$e.ENTRIES)}getPropertyId(){return(11<<24)+this.pathConstraintIndex}setFrame(r,t,e){r*=$e.ENTRIES,this.frames[r]=t,this.frames[r+$e.VALUE]=e}apply(r,t,e,i,s,n,a){const o=this.frames,h=r.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.position=h.data.position;return;case j.first:h.position+=(h.data.position-h.position)*s}return}let l=0;if(e>=o[o.length-$e.ENTRIES])l=o[o.length+$e.PREV_VALUE];else{const c=fe.binarySearch(o,e,$e.ENTRIES);l=o[c+$e.PREV_VALUE];const d=o[c],u=this.getCurvePercent(c/$e.ENTRIES-1,1-(e-d)/(o[c+$e.PREV_TIME]-d));l+=(o[c+$e.VALUE]-l)*u}n==j.setup?h.position=h.data.position+(l-h.data.position)*s:h.position+=(l-h.position)*s}};let so=$e;so.ENTRIES=2,so.PREV_TIME=-2,so.PREV_VALUE=-1,so.VALUE=1;const ae=class extends De{constructor(r){super(r),this.frames=Q.newFloatArray(r*ae.ENTRIES)}getPropertyId(){return(13<<24)+this.pathConstraintIndex}setFrame(r,t,e,i){r*=ae.ENTRIES,this.frames[r]=t,this.frames[r+ae.ROTATE]=e,this.frames[r+ae.TRANSLATE]=i}apply(r,t,e,i,s,n,a){const o=this.frames,h=r.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.rotateMix=h.data.rotateMix,h.translateMix=h.data.translateMix;return;case j.first:h.rotateMix+=(h.data.rotateMix-h.rotateMix)*s,h.translateMix+=(h.data.translateMix-h.translateMix)*s}return}let l=0,c=0;if(e>=o[o.length-ae.ENTRIES])l=o[o.length+ae.PREV_ROTATE],c=o[o.length+ae.PREV_TRANSLATE];else{const d=fe.binarySearch(o,e,ae.ENTRIES);l=o[d+ae.PREV_ROTATE],c=o[d+ae.PREV_TRANSLATE];const u=o[d],f=this.getCurvePercent(d/ae.ENTRIES-1,1-(e-u)/(o[d+ae.PREV_TIME]-u));l+=(o[d+ae.ROTATE]-l)*f,c+=(o[d+ae.TRANSLATE]-c)*f}n==j.setup?(h.rotateMix=h.data.rotateMix+(l-h.data.rotateMix)*s,h.translateMix=h.data.translateMix+(c-h.data.translateMix)*s):(h.rotateMix+=(l-h.rotateMix)*s,h.translateMix+=(c-h.translateMix)*s)}};let Ts=ae;Ts.ENTRIES=3,Ts.PREV_TIME=-3,Ts.PREV_ROTATE=-2,Ts.PREV_TRANSLATE=-1,Ts.ROTATE=1,Ts.TRANSLATE=2;const Pt=class{constructor(r){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Hm(this),this.propertyIDs=new wE,this.animationsChanged=!1,this.trackEntryPool=new PE(()=>new Sc),this.data=r}update(r){r*=this.timeScale;const t=this.tracks;for(let e=0,i=t.length;e<i;e++){const s=t[e];if(s==null)continue;s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast;let n=r*s.timeScale;if(s.delay>0){if(s.delay-=n,s.delay>0)continue;n=-s.delay,s.delay=0}let a=s.next;if(a!=null){const o=s.trackLast-a.delay;if(o>=0){for(a.delay=0,a.trackTime+=s.timeScale==0?0:(o/s.timeScale+r)*a.timeScale,s.trackTime+=n,this.setCurrent(e,a,!0);a.mixingFrom!=null;)a.mixTime+=r,a=a.mixingFrom;continue}}else if(s.trackLast>=s.trackEnd&&s.mixingFrom==null){t[e]=null,this.queue.end(s),this.disposeNext(s);continue}if(s.mixingFrom!=null&&this.updateMixingFrom(s,r)){let o=s.mixingFrom;for(s.mixingFrom=null,o!=null&&(o.mixingTo=null);o!=null;)this.queue.end(o),o=o.mixingFrom}s.trackTime+=n}this.queue.drain()}updateMixingFrom(r,t){const e=r.mixingFrom;if(e==null)return!0;const i=this.updateMixingFrom(e,t);return e.animationLast=e.nextAnimationLast,e.trackLast=e.nextTrackLast,r.mixTime>0&&r.mixTime>=r.mixDuration?((e.totalAlpha==0||r.mixDuration==0)&&(r.mixingFrom=e.mixingFrom,e.mixingFrom!=null&&(e.mixingFrom.mixingTo=r),r.interruptAlpha=e.interruptAlpha,this.queue.end(e)),i):(e.trackTime+=t*e.timeScale,r.mixTime+=t,!1)}apply(r){if(r==null)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const t=this.events,e=this.tracks;let i=!1;for(let a=0,o=e.length;a<o;a++){const h=e[a];if(h==null||h.delay>0)continue;i=!0;const l=a==0?j.first:h.mixBlend;let c=h.alpha;h.mixingFrom!=null?c*=this.applyMixingFrom(h,r,l):h.trackTime>=h.trackEnd&&h.next==null&&(c=0);const d=h.animationLast,u=h.getAnimationTime(),f=h.animation.timelines.length,p=h.animation.timelines;if(a==0&&c==1||l==j.add)for(let m=0;m<f;m++){const g=p[m];g instanceof ro?this.applyAttachmentTimeline(g,r,u,l,!0):g.apply(r,d,u,t,c,l,ve.mixIn)}else{const m=h.timelineMode,g=h.timelinesRotation.length==0;g&&Q.setArraySize(h.timelinesRotation,f<<1,null);const y=h.timelinesRotation;for(let v=0;v<f;v++){const _=p[v],x=m[v]==Pt.SUBSEQUENT?l:j.setup;_ instanceof Be?this.applyRotateTimeline(_,r,u,c,x,y,v<<1,g):_ instanceof ro?this.applyAttachmentTimeline(_,r,u,l,!0):_.apply(r,d,u,t,c,x,ve.mixIn)}}this.queueEvents(h,u),t.length=0,h.nextAnimationLast=u,h.nextTrackLast=h.trackTime}const s=this.unkeyedState+Pt.SETUP,n=r.slots;for(let a=0,o=r.slots.length;a<o;a++){const h=n[a];if(h.attachmentState==s){const l=h.data.attachmentName;h.setAttachment(l==null?null:r.getAttachment(h.data.index,l))}}return this.unkeyedState+=2,this.queue.drain(),i}applyMixingFrom(r,t,e){const i=r.mixingFrom;i.mixingFrom!=null&&this.applyMixingFrom(i,t,e);let s=0;r.mixDuration==0?(s=1,e==j.first&&(e=j.setup)):(s=r.mixTime/r.mixDuration,s>1&&(s=1),e!=j.first&&(e=i.mixBlend));const n=s<i.eventThreshold?this.events:null,a=s<i.attachmentThreshold,o=s<i.drawOrderThreshold,h=i.animationLast,l=i.getAnimationTime(),c=i.animation.timelines.length,d=i.animation.timelines,u=i.alpha*r.interruptAlpha,f=u*(1-s);if(e==j.add)for(let p=0;p<c;p++)d[p].apply(t,h,l,n,f,e,ve.mixOut);else{const p=i.timelineMode,m=i.timelineHoldMix,g=i.timelinesRotation.length==0;g&&Q.setArraySize(i.timelinesRotation,c<<1,null);const y=i.timelinesRotation;i.totalAlpha=0;for(let v=0;v<c;v++){const _=d[v];let x=ve.mixOut,b,E=0;switch(p[v]){case Pt.SUBSEQUENT:if(!o&&_ instanceof Ac)continue;b=e,E=f;break;case Pt.FIRST:b=j.setup,E=f;break;case Pt.HOLD_SUBSEQUENT:b=e,E=u;break;case Pt.HOLD_FIRST:b=j.setup,E=u;break;default:b=j.setup;const T=m[v];E=u*Math.max(0,1-T.mixTime/T.mixDuration);break}i.totalAlpha+=E,_ instanceof Be?this.applyRotateTimeline(_,t,l,E,b,y,v<<1,g):_ instanceof ro?this.applyAttachmentTimeline(_,t,l,b,a):(o&&_ instanceof Ac&&b==j.setup&&(x=ve.mixIn),_.apply(t,h,l,n,E,b,x))}}return r.mixDuration>0&&this.queueEvents(i,l),this.events.length=0,i.nextAnimationLast=l,i.nextTrackLast=i.trackTime,s}applyAttachmentTimeline(r,t,e,i,s){const n=t.slots[r.slotIndex];if(!n.bone.active)return;const a=r.frames;if(e<a[0])(i==j.setup||i==j.first)&&this.setAttachment(t,n,n.data.attachmentName,s);else{let o;e>=a[a.length-1]?o=a.length-1:o=fe.binarySearch(a,e)-1,this.setAttachment(t,n,r.attachmentNames[o],s)}n.attachmentState<=this.unkeyedState&&(n.attachmentState=this.unkeyedState+Pt.SETUP)}setAttachment(r,t,e,i){t.setAttachment(e==null?null:r.getAttachment(t.data.index,e)),i&&(t.attachmentState=this.unkeyedState+Pt.CURRENT)}applyRotateTimeline(r,t,e,i,s,n,a,o){if(o&&(n[a]=0),i==1){r.apply(t,0,e,null,1,s,ve.mixIn);return}const h=r,l=h.frames,c=t.bones[h.boneIndex];if(!c.active)return;let d=0,u=0;if(e<l[0])switch(s){case j.setup:c.rotation=c.data.rotation;default:return;case j.first:d=c.rotation,u=c.data.rotation}else if(d=s==j.setup?c.data.rotation:c.rotation,e>=l[l.length-Be.ENTRIES])u=c.data.rotation+l[l.length+Be.PREV_ROTATION];else{const m=fe.binarySearch(l,e,Be.ENTRIES),g=l[m+Be.PREV_ROTATION],y=l[m],v=h.getCurvePercent((m>>1)-1,1-(e-y)/(l[m+Be.PREV_TIME]-y));u=l[m+Be.ROTATION]-g,u-=(16384-(16384.499999999996-u/360|0))*360,u=g+u*v+c.data.rotation,u-=(16384-(16384.499999999996-u/360|0))*360}let f=0,p=u-d;if(p-=(16384-(16384.499999999996-p/360|0))*360,p==0)f=n[a];else{let m=0,g=0;o?(m=0,g=p):(m=n[a],g=n[a+1]);const y=p>0;let v=m>=0;N.signum(g)!=N.signum(p)&&Math.abs(g)<=90&&(Math.abs(m)>180&&(m+=360*N.signum(m)),v=y),f=p+m-m%360,v!=y&&(f+=360*N.signum(m)),n[a]=f}n[a+1]=p,d+=f*i,c.rotation=d-(16384-(16384.499999999996-d/360|0))*360}queueEvents(r,t){const e=r.animationStart,i=r.animationEnd,s=i-e,n=r.trackLast%s,a=this.events;let o=0;const h=a.length;for(;o<h;o++){const c=a[o];if(c.time<n)break;c.time>i||this.queue.event(r,c)}let l=!1;for(r.loop?l=s==0||n>r.trackTime%s:l=t>=i&&r.animationLast<i,l&&this.queue.complete(r);o<h;o++)a[o].time<e||this.queue.event(r,a[o])}clearTracks(){const r=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,e=this.tracks.length;t<e;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=r,this.queue.drain()}clearTrack(r){if(r>=this.tracks.length)return;const t=this.tracks[r];if(t==null)return;this.queue.end(t),this.disposeNext(t);let e=t;for(;;){const i=e.mixingFrom;if(i==null)break;this.queue.end(i),e.mixingFrom=null,e.mixingTo=null,e=i}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(r,t,e){const i=this.expandToIndex(r);this.tracks[r]=t,i!=null&&(e&&this.queue.interrupt(i),t.mixingFrom=i,i.mixingTo=t,t.mixTime=0,i.mixingFrom!=null&&i.mixDuration>0&&(t.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(t)}setAnimation(r,t,e){const i=this.data.skeletonData.findAnimation(t);if(i==null)throw new Error(`Animation not found: ${t}`);return this.setAnimationWith(r,i,e)}setAnimationWith(r,t,e){if(t==null)throw new Error("animation cannot be null.");let i=!0,s=this.expandToIndex(r);s!=null&&(s.nextTrackLast==-1?(this.tracks[r]=s.mixingFrom,this.queue.interrupt(s),this.queue.end(s),this.disposeNext(s),s=s.mixingFrom,i=!1):this.disposeNext(s));const n=this.trackEntry(r,t,e,s);return this.setCurrent(r,n,i),this.queue.drain(),n}addAnimation(r,t,e,i){const s=this.data.skeletonData.findAnimation(t);if(s==null)throw new Error(`Animation not found: ${t}`);return this.addAnimationWith(r,s,e,i)}addAnimationWith(r,t,e,i){if(t==null)throw new Error("animation cannot be null.");let s=this.expandToIndex(r);if(s!=null)for(;s.next!=null;)s=s.next;const n=this.trackEntry(r,t,e,s);if(s==null)this.setCurrent(r,n,!0),this.queue.drain();else if(s.next=n,i<=0){const a=s.animationEnd-s.animationStart;a!=0?(s.loop?i+=a*(1+(s.trackTime/a|0)):i+=Math.max(a,s.trackTime),i-=this.data.getMix(s.animation,t)):i=s.trackTime}return n.delay=i,n}setEmptyAnimation(r,t){const e=this.setAnimationWith(r,Pt.emptyAnimation,!1);return e.mixDuration=t,e.trackEnd=t,e}addEmptyAnimation(r,t,e){e<=0&&(e-=t);const i=this.addAnimationWith(r,Pt.emptyAnimation,!1,e);return i.mixDuration=t,i.trackEnd=t,i}setEmptyAnimations(r){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e<i;e++){const s=this.tracks[e];s!=null&&this.setEmptyAnimation(s.trackIndex,r)}this.queue.drainDisabled=t,this.queue.drain()}expandToIndex(r){return r<this.tracks.length?this.tracks[r]:(Q.ensureArrayCapacity(this.tracks,r+1,null),this.tracks.length=r+1,null)}trackEntry(r,t,e,i){const s=this.trackEntryPool.obtain();return s.trackIndex=r,s.animation=t,s.loop=e,s.holdPrevious=!1,s.eventThreshold=0,s.attachmentThreshold=0,s.drawOrderThreshold=0,s.animationStart=0,s.animationEnd=t.duration,s.animationLast=-1,s.nextAnimationLast=-1,s.delay=0,s.trackTime=0,s.trackLast=-1,s.nextTrackLast=-1,s.trackEnd=Number.MAX_VALUE,s.timeScale=1,s.alpha=1,s.interruptAlpha=1,s.mixTime=0,s.mixDuration=i==null?0:this.data.getMix(i.animation,t),s.mixBlend=j.replace,s}disposeNext(r){let t=r.next;for(;t!=null;)this.queue.dispose(t),t=t.next;r.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();for(let r=0,t=this.tracks.length;r<t;r++){let e=this.tracks[r];if(e!=null){for(;e.mixingFrom!=null;)e=e.mixingFrom;do(e.mixingFrom==null||e.mixBlend!=j.add)&&this.computeHold(e),e=e.mixingTo;while(e!=null)}}}computeHold(r){const t=r.mixingTo,e=r.animation.timelines,i=r.animation.timelines.length,s=Q.setArraySize(r.timelineMode,i);r.timelineHoldMix.length=0;const n=Q.setArraySize(r.timelineHoldMix,i),a=this.propertyIDs;if(t!=null&&t.holdPrevious){for(let o=0;o<i;o++)s[o]=a.add(e[o].getPropertyId())?Pt.HOLD_FIRST:Pt.HOLD_SUBSEQUENT;return}t:for(let o=0;o<i;o++){const h=e[o],l=h.getPropertyId();if(!a.add(l))s[o]=Pt.SUBSEQUENT;else if(t==null||h instanceof ro||h instanceof Ac||h instanceof BE||!t.animation.hasTimeline(l))s[o]=Pt.FIRST;else{for(let c=t.mixingTo;c!=null;c=c.mixingTo)if(!c.animation.hasTimeline(l)){if(r.mixDuration>0){s[o]=Pt.HOLD_MIX,n[o]=c;continue t}break}s[o]=Pt.HOLD_FIRST}}}getCurrent(r){return r>=this.tracks.length?null:this.tracks[r]}addListener(r){if(r==null)throw new Error("listener cannot be null.");this.listeners.push(r)}removeListener(r){const t=this.listeners.indexOf(r);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}setAnimationByName(r,t,e){Pt.deprecatedWarning1||(Pt.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.")),this.setAnimation(r,t,e)}addAnimationByName(r,t,e,i){Pt.deprecatedWarning2||(Pt.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.")),this.addAnimation(r,t,e,i)}hasAnimation(r){return this.data.skeletonData.findAnimation(r)!==null}hasAnimationByName(r){return Pt.deprecatedWarning3||(Pt.deprecatedWarning3=!0,console.warn("Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.")),this.hasAnimation(r)}};let Fe=Pt;Fe.emptyAnimation=new fe("<empty>",[],0),Fe.SUBSEQUENT=0,Fe.FIRST=1,Fe.HOLD_SUBSEQUENT=2,Fe.HOLD_FIRST=3,Fe.HOLD_MIX=4,Fe.SETUP=1,Fe.CURRENT=2,Fe.deprecatedWarning1=!1,Fe.deprecatedWarning2=!1,Fe.deprecatedWarning3=!1;const Fi=class{constructor(){this.mixBlend=j.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){const r=this.animationEnd-this.animationStart;return r==0?this.animationStart:this.trackTime%r+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(r){this.animationLast=r,this.nextAnimationLast=r}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}get time(){return Fi.deprecatedWarning1||(Fi.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime}set time(r){Fi.deprecatedWarning1||(Fi.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime=r}get endTime(){return Fi.deprecatedWarning2||(Fi.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime}set endTime(r){Fi.deprecatedWarning2||(Fi.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime=r}loopsCount(){return Math.floor(this.trackTime/this.trackEnd)}};let Sc=Fi;Sc.deprecatedWarning1=!1,Sc.deprecatedWarning2=!1;const Cc=class{constructor(r){this.objects=[],this.drainDisabled=!1,this.animState=r}start(r){this.objects.push(Te.start),this.objects.push(r),this.animState.animationsChanged=!0}interrupt(r){this.objects.push(Te.interrupt),this.objects.push(r)}end(r){this.objects.push(Te.end),this.objects.push(r),this.animState.animationsChanged=!0}dispose(r){this.objects.push(Te.dispose),this.objects.push(r)}complete(r){this.objects.push(Te.complete),this.objects.push(r)}event(r,t){this.objects.push(Te.event),this.objects.push(r),this.objects.push(t)}deprecateStuff(){return Cc.deprecatedWarning1||(Cc.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: onComplete, onStart, onEnd, onEvent art deprecated, please use listeners from now on. 'state.addListener({ complete: function(track, event) { } })'")),!0}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;const r=this.objects,t=this.animState.listeners;for(let e=0;e<r.length;e+=2){const i=r[e],s=r[e+1];switch(i){case Te.start:s.listener!=null&&s.listener.start&&s.listener.start(s);for(let o=0;o<t.length;o++)t[o].start&&t[o].start(s);s.onStart&&this.deprecateStuff()&&s.onStart(s.trackIndex),this.animState.onStart&&this.deprecateStuff()&&this.deprecateStuff&&this.animState.onStart(s.trackIndex);break;case Te.interrupt:s.listener!=null&&s.listener.interrupt&&s.listener.interrupt(s);for(let o=0;o<t.length;o++)t[o].interrupt&&t[o].interrupt(s);break;case Te.end:s.listener!=null&&s.listener.end&&s.listener.end(s);for(let o=0;o<t.length;o++)t[o].end&&t[o].end(s);s.onEnd&&this.deprecateStuff()&&s.onEnd(s.trackIndex),this.animState.onEnd&&this.deprecateStuff()&&this.animState.onEnd(s.trackIndex);case Te.dispose:s.listener!=null&&s.listener.dispose&&s.listener.dispose(s);for(let o=0;o<t.length;o++)t[o].dispose&&t[o].dispose(s);this.animState.trackEntryPool.free(s);break;case Te.complete:s.listener!=null&&s.listener.complete&&s.listener.complete(s);for(let o=0;o<t.length;o++)t[o].complete&&t[o].complete(s);const n=N.toInt(s.loopsCount());s.onComplete&&this.deprecateStuff()&&s.onComplete(s.trackIndex,n),this.animState.onComplete&&this.deprecateStuff()&&this.animState.onComplete(s.trackIndex,n);break;case Te.event:const a=r[e+++2];s.listener!=null&&s.listener.event&&s.listener.event(s,a);for(let o=0;o<t.length;o++)t[o].event&&t[o].event(s,a);s.onEvent&&this.deprecateStuff()&&s.onEvent(s.trackIndex,a),this.animState.onEvent&&this.deprecateStuff()&&this.animState.onEvent(s.trackIndex,a);break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}};let Hm=Cc;Hm.deprecatedWarning1=!1;var Te=(r=>(r[r.start=0]="start",r[r.interrupt=1]="interrupt",r[r.end=2]="end",r[r.dispose=3]="dispose",r[r.complete=4]="complete",r[r.event=5]="event",r))(Te||{});const Pc=class{constructor(r){if(this.animationToMixTime={},this.defaultMix=0,r==null)throw new Error("skeletonData cannot be null.");this.skeletonData=r}setMix(r,t,e){const i=this.skeletonData.findAnimation(r);if(i==null)throw new Error(`Animation not found: ${r}`);const s=this.skeletonData.findAnimation(t);if(s==null)throw new Error(`Animation not found: ${t}`);this.setMixWith(i,s,e)}setMixByName(r,t,e){Pc.deprecatedWarning1||(Pc.deprecatedWarning1=!0,console.warn("Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.")),this.setMix(r,t,e)}setMixWith(r,t,e){if(r==null)throw new Error("from cannot be null.");if(t==null)throw new Error("to cannot be null.");const i=`${r.name}.${t.name}`;this.animationToMixTime[i]=e}getMix(r,t){const e=`${r.name}.${t.name}`,i=this.animationToMixTime[e];return i===void 0?this.defaultMix:i}};let Xm=Pc;Xm.deprecatedWarning1=!1;class Wm{constructor(t,e,i){if(this.matrix=new mt,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.sorted=!1,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}get worldX(){return this.matrix.tx}get worldY(){return this.matrix.ty}isActive(){return this.active}update(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,s,n,a,o){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=s,this.ascaleY=n,this.ashearX=a,this.ashearY=o,this.appliedValid=!0;const h=this.parent,l=this.matrix,c=this.skeleton.scaleX,d=-this.skeleton.scaleY;if(h==null){const g=this.skeleton,y=i+90+o;l.a=N.cosDeg(i+a)*s*c,l.c=N.cosDeg(y)*n*c,l.b=N.sinDeg(i+a)*s*d,l.d=N.sinDeg(y)*n*d,l.tx=t*c+g.x,l.ty=e*d+g.y;return}let u=h.matrix.a,f=h.matrix.c,p=h.matrix.b,m=h.matrix.d;switch(l.tx=u*t+f*e+h.matrix.tx,l.ty=p*t+m*e+h.matrix.ty,this.data.transformMode){case ee.Normal:{const g=i+90+o,y=N.cosDeg(i+a)*s,v=N.cosDeg(g)*n,_=N.sinDeg(i+a)*s,x=N.sinDeg(g)*n;l.a=u*y+f*_,l.c=u*v+f*x,l.b=p*y+m*_,l.d=p*v+m*x;return}case ee.OnlyTranslation:{const g=i+90+o;l.a=N.cosDeg(i+a)*s,l.c=N.cosDeg(g)*n,l.b=N.sinDeg(i+a)*s,l.d=N.sinDeg(g)*n;break}case ee.NoRotationOrReflection:{let g=u*u+p*p,y=0;g>1e-4?(g=Math.abs(u*m-f*p)/g,u/=this.skeleton.scaleX,p/=this.skeleton.scaleY,f=p*g,m=u*g,y=Math.atan2(p,u)*N.radDeg):(u=0,p=0,y=90-Math.atan2(m,f)*N.radDeg);const v=i+a-y,_=i+o-y+90,x=N.cosDeg(v)*s,b=N.cosDeg(_)*n,E=N.sinDeg(v)*s,T=N.sinDeg(_)*n;l.a=u*x-f*E,l.c=u*b-f*T,l.b=p*x+m*E,l.d=p*b+m*T;break}case ee.NoScale:case ee.NoScaleOrReflection:{const g=N.cosDeg(i),y=N.sinDeg(i);let v=(u*g+f*y)/c,_=(p*g+m*y)/d,x=Math.sqrt(v*v+_*_);x>1e-5&&(x=1/x),v*=x,_*=x,x=Math.sqrt(v*v+_*_),this.data.transformMode==ee.NoScale&&u*m-f*p<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY>0)&&(x=-x);const b=Math.PI/2+Math.atan2(_,v),E=Math.cos(b)*x,T=Math.sin(b)*x,w=N.cosDeg(a)*s,A=N.cosDeg(90+o)*n,P=N.sinDeg(a)*s,L=N.sinDeg(90+o)*n;l.a=v*w+E*P,l.c=v*A+E*L,l.b=_*w+T*P,l.d=_*A+T*L;break}}l.a*=c,l.c*=c,l.b*=d,l.d*=d}setToSetupPose(){const t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.matrix.b,this.matrix.a)*N.radDeg}getWorldRotationY(){return Math.atan2(this.matrix.d,this.matrix.c)*N.radDeg}getWorldScaleX(){const t=this.matrix;return Math.sqrt(t.a*t.a+t.c*t.c)}getWorldScaleY(){const t=this.matrix;return Math.sqrt(t.b*t.b+t.d*t.d)}updateAppliedTransform(){this.appliedValid=!0;const t=this.parent,e=this.matrix;if(t==null){this.ax=e.tx,this.ay=e.ty,this.arotation=Math.atan2(e.b,e.a)*N.radDeg,this.ascaleX=Math.sqrt(e.a*e.a+e.b*e.b),this.ascaleY=Math.sqrt(e.c*e.c+e.d*e.d),this.ashearX=0,this.ashearY=Math.atan2(e.a*e.c+e.b*e.d,e.a*e.d-e.b*e.c)*N.radDeg;return}const i=t.matrix,s=1/(i.a*i.d-i.b*i.c),n=e.tx-i.tx,a=e.ty-i.ty;this.ax=n*i.d*s-a*i.c*s,this.ay=a*i.a*s-n*i.b*s;const o=s*i.d,h=s*i.a,l=s*i.c,c=s*i.b,d=o*e.a-l*e.b,u=o*e.c-l*e.d,f=h*e.b-c*e.a,p=h*e.d-c*e.c;if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+f*f),this.ascaleX>1e-4){const m=d*p-u*f;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(d*u+f*p,m)*N.radDeg,this.arotation=Math.atan2(f,d)*N.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+p*p),this.ashearY=0,this.arotation=90-Math.atan2(p,u)*N.radDeg}worldToLocal(t){const e=this.matrix,i=e.a,s=e.c,n=e.b,a=e.d,o=1/(i*a-s*n),h=t.x-e.tx,l=t.y-e.ty;return t.x=h*a*o-l*s*o,t.y=l*i*o-h*n*o,t}localToWorld(t){const e=this.matrix,i=t.x,s=t.y;return t.x=i*e.a+s*e.c+e.tx,t.y=i*e.b+s*e.d+e.ty,t}worldToLocalRotation(t){const e=N.sinDeg(t),i=N.cosDeg(t),s=this.matrix;return Math.atan2(s.a*e-s.b*i,s.d*i-s.c*e)*N.radDeg}localToWorldRotation(t){const e=N.sinDeg(t),i=N.cosDeg(t),s=this.matrix;return Math.atan2(i*s.b+e*s.d,i*s.a+e*s.c)*N.radDeg}rotateWorld(t){const e=this.matrix,i=e.a,s=e.c,n=e.b,a=e.d,o=N.cosDeg(t),h=N.sinDeg(t);e.a=o*i-h*n,e.c=o*s-h*a,e.b=h*i+o*n,e.d=h*s+o*a,this.appliedValid=!1}}class OE{constructor(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(let i=0;i<t.bones.length;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}apply(){this.update()}update(){const t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.softness,this.mix);break}}apply1(t,e,i,s,n,a,o){t.appliedValid||t.updateAppliedTransform();const h=t.parent.matrix,l=h.a;let c=h.c;const d=h.b;let u=h.d,f=-t.ashearX-t.arotation,p=0,m=0;switch(t.data.transformMode){case ee.OnlyTranslation:p=e-t.worldX,m=i-t.worldY;break;case ee.NoRotationOrReflection:const v=Math.abs(l*u-c*d)/(l*l+d*d),_=l/t.skeleton.scaleX,x=d/t.skeleton.scaleY;c=-x*v*t.skeleton.scaleX,u=_*v*t.skeleton.scaleY,f+=Math.atan2(x,_)*N.radDeg;default:const b=e-h.tx,E=i-h.ty,T=l*u-c*d;p=(b*u-E*c)/T-t.ax,m=(E*l-b*d)/T-t.ay}f+=Math.atan2(m,p)*N.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let g=t.ascaleX,y=t.ascaleY;if(s||n){switch(t.data.transformMode){case ee.NoScale:case ee.NoScaleOrReflection:p=e-t.worldX,m=i-t.worldY}const v=t.data.length*g,_=Math.sqrt(p*p+m*m);if(s&&_<v||n&&_>v&&v>1e-4){const x=(_/v-1)*o+1;g*=x,a&&(y*=x)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*o,g,y,t.ashearX,t.ashearY)}apply2(t,e,i,s,n,a,o,h){if(h==0){e.updateWorldTransform();return}t.appliedValid||t.updateAppliedTransform(),e.appliedValid||e.updateAppliedTransform();const l=t.ax,c=t.ay;let d=t.ascaleX,u=d,f=t.ascaleY,p=e.ascaleX;const m=t.matrix;let g=0,y=0,v=0;d<0?(d=-d,g=180,v=-1):(g=0,v=1),f<0&&(f=-f,v=-v),p<0?(p=-p,y=180):y=0;const _=e.ax;let x=0,b=0,E=0,T=m.a,w=m.c,A=m.b,P=m.d;const L=Math.abs(d-f)<=1e-4;L?(x=e.ay,b=T*_+w*x+m.tx,E=A*_+P*x+m.ty):(x=0,b=T*_+m.tx,E=A*_+m.ty);const M=t.parent.matrix;T=M.a,w=M.c,A=M.b,P=M.d;const S=1/(T*P-w*A);let C=b-M.tx,R=E-M.ty;const k=(C*P-R*w)*S-l,F=(R*T-C*A)*S-c,B=Math.sqrt(k*k+F*F);let X=e.data.length*p,I,D;if(B<1e-4){this.apply1(t,i,s,!1,a,!1,h),e.updateWorldTransformWith(_,x,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);return}C=i-M.tx,R=s-M.ty;let $=(C*P-R*w)*S-l,z=(R*T-C*A)*S-c,U=$*$+z*z;if(o!=0){o*=d*(p+1)/2;const lt=Math.sqrt(U),yt=lt-B-X*d+o;if(yt>0){let Rt=Math.min(1,yt/(o*2))-1;Rt=(yt-o*(1-Rt*Rt))/lt,$-=Rt*$,z-=Rt*z,U=$*$+z*z}}t:if(L){X*=d;let lt=(U-B*B-X*X)/(2*B*X);lt<-1?lt=-1:lt>1&&(lt=1,a&&(u*=(Math.sqrt(U)/(B+X)-1)*h+1)),D=Math.acos(lt)*n,T=B+X*lt,w=X*Math.sin(D),I=Math.atan2(z*T-$*w,$*T+z*w)}else{T=d*X,w=f*X;const lt=T*T,yt=w*w,Rt=Math.atan2(z,$);A=yt*B*B+lt*U-lt*yt;const Bt=-2*yt*B,pt=yt-lt;if(P=Bt*Bt-4*pt*A,P>=0){let As=Math.sqrt(P);Bt<0&&(As=-As),As=-(Bt+As)/2;const Ym=As/pt,jm=A/As,Ss=Math.abs(Ym)<Math.abs(jm)?Ym:jm;if(Ss*Ss<=U){R=Math.sqrt(U-Ss*Ss)*n,I=Rt-Math.atan2(R,Ss),D=Math.atan2(R/f,(Ss-B)/d);break t}}let It=N.PI,vt=B-T,pe=vt*vt,Ee=0,nr=0,ws=B+T,ar=ws*ws,zm=0;A=-T*B/(lt-yt),A>=-1&&A<=1&&(A=Math.acos(A),C=T*Math.cos(A)+B,R=w*Math.sin(A),P=C*C+R*R,P<pe&&(It=A,pe=P,vt=C,Ee=R),P>ar&&(nr=A,ar=P,ws=C,zm=R)),U<=(pe+ar)/2?(I=Rt-Math.atan2(Ee*n,vt),D=It*n):(I=Rt-Math.atan2(zm*n,ws),D=nr*n)}const rt=Math.atan2(x,_)*v;let ut=t.arotation;I=(I-rt)*N.radDeg+g-ut,I>180?I-=360:I<-180&&(I+=360),t.updateWorldTransformWith(l,c,ut+I*h,u,t.ascaleY,0,0),ut=e.arotation,D=((D+rt)*N.radDeg-e.ashearX)*v+y-ut,D>180?D-=360:D<-180&&(D+=360),e.updateWorldTransformWith(_,x,ut+D*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}var Es=(r=>(r[r.Length=0]="Length",r[r.Fixed=1]="Fixed",r[r.Percent=2]="Percent",r))(Es||{});const Nr=class{constructor(r,t){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,r==null)throw new Error("data cannot be null.");if(t==null)throw new Error("skeleton cannot be null.");this.data=r,this.bones=new Array;for(let e=0,i=r.bones.length;e<i;e++)this.bones.push(t.findBone(r.bones[e].name));this.target=t.findSlot(r.target.name),this.position=r.position,this.spacing=r.spacing,this.rotateMix=r.rotateMix,this.translateMix=r.translateMix}isActive(){return this.active}apply(){this.update()}update(){const r=this.target.getAttachment();if(!(r instanceof vn))return;const t=this.rotateMix,e=this.translateMix,i=e>0,s=t>0;if(!i&&!s)return;const n=this.data,a=n.spacingMode,o=a==Es.Length,h=n.rotateMode,l=h==Fr.Tangent,c=h==Fr.ChainScale,d=this.bones.length,u=l?d:d+1,f=this.bones,p=Q.setArraySize(this.spaces,u);let m=null;const g=this.spacing;if(c||o){c&&(m=Q.setArraySize(this.lengths,d));for(let E=0,T=u-1;E<T;){const w=f[E],A=w.data.length;if(A<Nr.epsilon)c&&(m[E]=0),p[++E]=0;else{const P=A*w.matrix.a,L=A*w.matrix.b,M=Math.sqrt(P*P+L*L);c&&(m[E]=M),p[++E]=(o?A+g:g)*M/A}}}else for(let E=1;E<u;E++)p[E]=g;const y=this.computeWorldPositions(r,u,l,n.positionMode==eo.Percent,a==Es.Percent);let v=y[0],_=y[1],x=n.offsetRotation,b=!1;if(x==0)b=h==Fr.Chain;else{b=!1;const E=this.target.bone.matrix;x*=E.a*E.d-E.b*E.c>0?N.degRad:-N.degRad}for(let E=0,T=3;E<d;E++,T+=3){const w=f[E],A=w.matrix;A.tx+=(v-A.tx)*e,A.ty+=(_-A.ty)*e;const P=y[T],L=y[T+1],M=P-v,S=L-_;if(c){const C=m[E];if(C!=0){const R=(Math.sqrt(M*M+S*S)/C-1)*t+1;A.a*=R,A.b*=R}}if(v=P,_=L,s){const C=A.a,R=A.c,k=A.b,F=A.d;let B=0,X=0,I=0;if(l&&(l?B=y[T-1]:p[E+1]==0?B=y[T+2]:B=Math.atan2(S,M)),B-=Math.atan2(k,C),b){X=Math.cos(B),I=Math.sin(B);const D=w.data.length;v+=(D*(X*C-I*k)-M)*t,_+=(D*(I*C+X*k)-S)*t}else B+=x;B>N.PI?B-=N.PI2:B<-N.PI&&(B+=N.PI2),B*=t,X=Math.cos(B),I=Math.sin(B),A.a=X*C-I*k,A.c=X*R-I*F,A.b=I*C+X*k,A.d=I*R+X*F}w.appliedValid=!1}}computeWorldPositions(r,t,e,i,s){const n=this.target;let a=this.position;const o=this.spaces,h=Q.setArraySize(this.positions,t*3+2);let l=null;const c=r.closed;let d=r.worldVerticesLength,u=d/6,f=Nr.NONE;if(!r.constantSpeed){const B=r.lengths;u-=c?1:2;const X=B[u];if(i&&(a*=X),s)for(let I=0;I<t;I++)o[I]*=X;l=Q.setArraySize(this.world,8);for(let I=0,D=0,$=0;I<t;I++,D+=3){const z=o[I];a+=z;let U=a;if(c)U%=X,U<0&&(U+=X),$=0;else if(U<0){f!=Nr.BEFORE&&(f=Nr.BEFORE,r.computeWorldVertices(n,2,4,l,0,2)),this.addBeforePosition(U,l,0,h,D);continue}else if(U>X){f!=Nr.AFTER&&(f=Nr.AFTER,r.computeWorldVertices(n,d-6,4,l,0,2)),this.addAfterPosition(U-X,l,0,h,D);continue}for(;;$++){const rt=B[$];if(!(U>rt)){if($==0)U/=rt;else{const ut=B[$-1];U=(U-ut)/(rt-ut)}break}}$!=f&&(f=$,c&&$==u?(r.computeWorldVertices(n,d-4,4,l,0,2),r.computeWorldVertices(n,0,4,l,4,2)):r.computeWorldVertices(n,$*6+2,8,l,0,2)),this.addCurvePosition(U,l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],h,D,e||I>0&&z==0)}return h}c?(d+=2,l=Q.setArraySize(this.world,d),r.computeWorldVertices(n,2,d-4,l,0,2),r.computeWorldVertices(n,0,2,l,d-4,2),l[d-2]=l[0],l[d-1]=l[1]):(u--,d-=4,l=Q.setArraySize(this.world,d),r.computeWorldVertices(n,2,d,l,0,2));const p=Q.setArraySize(this.curves,u);let m=0,g=l[0],y=l[1],v=0,_=0,x=0,b=0,E=0,T=0,w=0,A=0,P=0,L=0,M=0,S=0,C=0,R=0;for(let B=0,X=2;B<u;B++,X+=6)v=l[X],_=l[X+1],x=l[X+2],b=l[X+3],E=l[X+4],T=l[X+5],w=(g-v*2+x)*.1875,A=(y-_*2+b)*.1875,P=((v-x)*3-g+E)*.09375,L=((_-b)*3-y+T)*.09375,M=w*2+P,S=A*2+L,C=(v-g)*.75+w+P*.16666667,R=(_-y)*.75+A+L*.16666667,m+=Math.sqrt(C*C+R*R),C+=M,R+=S,M+=P,S+=L,m+=Math.sqrt(C*C+R*R),C+=M,R+=S,m+=Math.sqrt(C*C+R*R),C+=M+P,R+=S+L,m+=Math.sqrt(C*C+R*R),p[B]=m,g=E,y=T;if(i&&(a*=m),s)for(let B=0;B<t;B++)o[B]*=m;const k=this.segments;let F=0;for(let B=0,X=0,I=0,D=0;B<t;B++,X+=3){const $=o[B];a+=$;let z=a;if(c)z%=m,z<0&&(z+=m),I=0;else if(z<0){this.addBeforePosition(z,l,0,h,X);continue}else if(z>m){this.addAfterPosition(z-m,l,d-4,h,X);continue}for(;;I++){const U=p[I];if(!(z>U)){if(I==0)z/=U;else{const rt=p[I-1];z=(z-rt)/(U-rt)}break}}if(I!=f){f=I;let U=I*6;for(g=l[U],y=l[U+1],v=l[U+2],_=l[U+3],x=l[U+4],b=l[U+5],E=l[U+6],T=l[U+7],w=(g-v*2+x)*.03,A=(y-_*2+b)*.03,P=((v-x)*3-g+E)*.006,L=((_-b)*3-y+T)*.006,M=w*2+P,S=A*2+L,C=(v-g)*.3+w+P*.16666667,R=(_-y)*.3+A+L*.16666667,F=Math.sqrt(C*C+R*R),k[0]=F,U=1;U<8;U++)C+=M,R+=S,M+=P,S+=L,F+=Math.sqrt(C*C+R*R),k[U]=F;C+=M,R+=S,F+=Math.sqrt(C*C+R*R),k[8]=F,C+=M+P,R+=S+L,F+=Math.sqrt(C*C+R*R),k[9]=F,D=0}for(z*=F;;D++){const U=k[D];if(!(z>U)){if(D==0)z/=U;else{const rt=k[D-1];z=D+(z-rt)/(U-rt)}break}}this.addCurvePosition(z*.1,g,y,v,_,x,b,E,T,h,X,e||B>0&&$==0)}return h}addBeforePosition(r,t,e,i,s){const n=t[e],a=t[e+1],o=t[e+2]-n,h=t[e+3]-a,l=Math.atan2(h,o);i[s]=n+r*Math.cos(l),i[s+1]=a+r*Math.sin(l),i[s+2]=l}addAfterPosition(r,t,e,i,s){const n=t[e+2],a=t[e+3],o=n-t[e],h=a-t[e+1],l=Math.atan2(h,o);i[s]=n+r*Math.cos(l),i[s+1]=a+r*Math.sin(l),i[s+2]=l}addCurvePosition(r,t,e,i,s,n,a,o,h,l,c,d){(r==0||isNaN(r))&&(r=1e-4);const u=r*r,f=u*r,p=1-r,m=p*p,g=m*p,y=p*r,v=y*3,_=p*v,x=v*r,b=t*g+i*_+n*x+o*f,E=e*g+s*_+a*x+h*f;l[c]=b,l[c+1]=E,d&&(l[c+2]=Math.atan2(E-(e*m+s*y*2+a*u),b-(t*m+i*y*2+n*u)))}};let bn=Nr;bn.NONE=-1,bn.BEFORE=-2,bn.AFTER=-3,bn.epsilon=1e-5;class FE{constructor(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new RE,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(let i=0;i<t.bones.length;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}apply(){this.update()}update(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()}applyAbsoluteWorld(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,s=this.shearMix,n=this.target,a=n.matrix,o=a.a,h=a.c,l=a.b,c=a.d,d=o*c-h*l>0?N.degRad:-N.degRad,u=this.data.offsetRotation*d,f=this.data.offsetShearY*d,p=this.bones;for(let m=0,g=p.length;m<g;m++){const y=p[m];let v=!1;const _=y.matrix;if(t!=0){const x=_.a,b=_.c,E=_.b,T=_.d;let w=Math.atan2(l,o)-Math.atan2(E,x)+u;w>N.PI?w-=N.PI2:w<-N.PI&&(w+=N.PI2),w*=t;const A=Math.cos(w),P=Math.sin(w);_.a=A*x-P*E,_.c=A*b-P*T,_.b=P*x+A*E,_.d=P*b+A*T,v=!0}if(e!=0){const x=this.temp;n.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),_.tx+=(x.x-_.tx)*e,_.ty+=(x.y-_.ty)*e,v=!0}if(i>0){let x=Math.sqrt(_.a*_.a+_.b*_.b),b=Math.sqrt(o*o+l*l);x>1e-5&&(x=(x+(b-x+this.data.offsetScaleX)*i)/x),_.a*=x,_.b*=x,x=Math.sqrt(_.c*_.c+_.d*_.d),b=Math.sqrt(h*h+c*c),x>1e-5&&(x=(x+(b-x+this.data.offsetScaleY)*i)/x),_.c*=x,_.d*=x,v=!0}if(s>0){const x=_.c,b=_.d,E=Math.atan2(b,x);let T=Math.atan2(c,h)-Math.atan2(l,o)-(E-Math.atan2(_.b,_.a));T>N.PI?T-=N.PI2:T<-N.PI&&(T+=N.PI2),T=E+(T+f)*s;const w=Math.sqrt(x*x+b*b);_.c=Math.cos(T)*w,_.d=Math.sin(T)*w,v=!0}v&&(y.appliedValid=!1)}}applyRelativeWorld(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,s=this.shearMix,n=this.target,a=n.matrix,o=a.a,h=a.c,l=a.b,c=a.d,d=o*c-h*l>0?N.degRad:-N.degRad,u=this.data.offsetRotation*d,f=this.data.offsetShearY*d,p=this.bones;for(let m=0,g=p.length;m<g;m++){const y=p[m];let v=!1;const _=y.matrix;if(t!=0){const x=_.a,b=_.c,E=_.b,T=_.d;let w=Math.atan2(l,o)+u;w>N.PI?w-=N.PI2:w<-N.PI&&(w+=N.PI2),w*=t;const A=Math.cos(w),P=Math.sin(w);_.a=A*x-P*E,_.c=A*b-P*T,_.b=P*x+A*E,_.d=P*b+A*T,v=!0}if(e!=0){const x=this.temp;n.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),_.tx+=x.x*e,_.ty+=x.y*e,v=!0}if(i>0){let x=(Math.sqrt(o*o+l*l)-1+this.data.offsetScaleX)*i+1;_.a*=x,_.b*=x,x=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleY)*i+1,_.c*=x,_.d*=x,v=!0}if(s>0){let x=Math.atan2(c,h)-Math.atan2(l,o);x>N.PI?x-=N.PI2:x<-N.PI&&(x+=N.PI2);const b=_.c,E=_.d;x=Math.atan2(E,b)+(x-N.PI/2+f)*s;const T=Math.sqrt(b*b+E*E);_.c=Math.cos(x)*T,_.d=Math.sin(x)*T,v=!0}v&&(y.appliedValid=!1)}}applyAbsoluteLocal(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,s=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();const a=this.bones;for(let o=0,h=a.length;o<h;o++){const l=a[o];l.appliedValid||l.updateAppliedTransform();let c=l.arotation;if(t!=0){let g=n.arotation-c+this.data.offsetRotation;g-=(16384-(16384.499999999996-g/360|0))*360,c+=g*t}let d=l.ax,u=l.ay;e!=0&&(d+=(n.ax-d+this.data.offsetX)*e,u+=(n.ay-u+this.data.offsetY)*e);let f=l.ascaleX,p=l.ascaleY;i>0&&(f>1e-5&&(f=(f+(n.ascaleX-f+this.data.offsetScaleX)*i)/f),p>1e-5&&(p=(p+(n.ascaleY-p+this.data.offsetScaleY)*i)/p));const m=l.ashearY;if(s>0){let g=n.ashearY-m+this.data.offsetShearY;g-=(16384-(16384.499999999996-g/360|0))*360,l.shearY+=g*s}l.updateWorldTransformWith(d,u,c,f,p,l.ashearX,m)}}applyRelativeLocal(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,s=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();const a=this.bones;for(let o=0,h=a.length;o<h;o++){const l=a[o];l.appliedValid||l.updateAppliedTransform();let c=l.arotation;t!=0&&(c+=(n.arotation+this.data.offsetRotation)*t);let d=l.ax,u=l.ay;e!=0&&(d+=(n.ax+this.data.offsetX)*e,u+=(n.ay+this.data.offsetY)*e);let f=l.ascaleX,p=l.ascaleY;i>0&&(f>1e-5&&(f*=(n.ascaleX-1+this.data.offsetScaleX)*i+1),p>1e-5&&(p*=(n.ascaleY-1+this.data.offsetScaleY)*i+1));let m=l.ashearY;s>0&&(m+=(n.ashearY+this.data.offsetShearY)*s),l.updateWorldTransformWith(d,u,c,f,p,l.ashearX,m)}}}const Tn=class{constructor(r){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,r==null)throw new Error("data cannot be null.");this.data=r,this.bones=new Array;for(let t=0;t<r.bones.length;t++){const e=r.bones[t];let i;if(e.parent==null)i=new Wm(e,this,null);else{const s=this.bones[e.parent.index];i=new Wm(e,this,s),s.children.push(i)}this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(let t=0;t<r.slots.length;t++){const e=r.slots[t],i=this.bones[e.boneData.index],s=new Vm(e,i);this.slots.push(s),this.drawOrder.push(s)}this.ikConstraints=new Array;for(let t=0;t<r.ikConstraints.length;t++){const e=r.ikConstraints[t];this.ikConstraints.push(new OE(e,this))}this.transformConstraints=new Array;for(let t=0;t<r.transformConstraints.length;t++){const e=r.transformConstraints[t];this.transformConstraints.push(new FE(e,this))}this.pathConstraints=new Array;for(let t=0;t<r.pathConstraints.length;t++){const e=r.pathConstraints[t];this.pathConstraints.push(new bn(e,this))}this.color=new be(1,1,1,1),this.updateCache()}updateCache(){const r=this._updateCache;r.length=0,this.updateCacheReset.length=0;const t=this.bones;for(let l=0,c=t.length;l<c;l++){const d=t[l];d.sorted=d.data.skinRequired,d.active=!d.sorted}if(this.skin!=null){const l=this.skin.bones;for(let c=0,d=this.skin.bones.length;c<d;c++){let u=this.bones[l[c].index];do u.sorted=!1,u.active=!0,u=u.parent;while(u!=null)}}const e=this.ikConstraints,i=this.transformConstraints,s=this.pathConstraints,n=e.length,a=i.length,o=s.length,h=n+a+o;t:for(let l=0;l<h;l++){for(let c=0;c<n;c++){const d=e[c];if(d.data.order==l){this.sortIkConstraint(d);continue t}}for(let c=0;c<a;c++){const d=i[c];if(d.data.order==l){this.sortTransformConstraint(d);continue t}}for(let c=0;c<o;c++){const d=s[c];if(d.data.order==l){this.sortPathConstraint(d);continue t}}}for(let l=0,c=t.length;l<c;l++)this.sortBone(t[l])}sortIkConstraint(r){if(r.active=r.target.isActive()&&(!r.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,r.data,!0)),!r.active)return;const t=r.target;this.sortBone(t);const e=r.bones,i=e[0];if(this.sortBone(i),e.length>1){const s=e[e.length-1];this._updateCache.indexOf(s)>-1||this.updateCacheReset.push(s)}this._updateCache.push(r),this.sortReset(i.children),e[e.length-1].sorted=!0}sortPathConstraint(r){if(r.active=r.target.bone.isActive()&&(!r.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,r.data,!0)),!r.active)return;const t=r.target,e=t.data.index,i=t.bone;this.skin!=null&&this.sortPathConstraintAttachment(this.skin,e,i),this.data.defaultSkin!=null&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,e,i);for(let o=0,h=this.data.skins.length;o<h;o++)this.sortPathConstraintAttachment(this.data.skins[o],e,i);const s=t.getAttachment();s instanceof vn&&this.sortPathConstraintAttachmentWith(s,i);const n=r.bones,a=n.length;for(let o=0;o<a;o++)this.sortBone(n[o]);this._updateCache.push(r);for(let o=0;o<a;o++)this.sortReset(n[o].children);for(let o=0;o<a;o++)n[o].sorted=!0}sortTransformConstraint(r){if(r.active=r.target.isActive()&&(!r.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,r.data,!0)),!r.active)return;this.sortBone(r.target);const t=r.bones,e=t.length;if(r.data.local)for(let i=0;i<e;i++){const s=t[i];this.sortBone(s.parent),this._updateCache.indexOf(s)>-1||this.updateCacheReset.push(s)}else for(let i=0;i<e;i++)this.sortBone(t[i]);this._updateCache.push(r);for(let i=0;i<e;i++)this.sortReset(t[i].children);for(let i=0;i<e;i++)t[i].sorted=!0}sortPathConstraintAttachment(r,t,e){const i=r.attachments[t];if(i)for(const s in i)this.sortPathConstraintAttachmentWith(i[s],e)}sortPathConstraintAttachmentWith(r,t){if(!(r instanceof vn))return;const e=r.bones;if(e==null)this.sortBone(t);else{const i=this.bones;let s=0;for(;s<e.length;){const n=e[s++];for(let a=s+n;s<a;s++){const o=e[s];this.sortBone(i[o])}}}}sortBone(r){if(r.sorted)return;const t=r.parent;t!=null&&this.sortBone(t),r.sorted=!0,this._updateCache.push(r)}sortReset(r){for(let t=0,e=r.length;t<e;t++){const i=r[t];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}}updateWorldTransform(){const r=this.updateCacheReset;for(let e=0,i=r.length;e<i;e++){const s=r[e];s.ax=s.x,s.ay=s.y,s.arotation=s.rotation,s.ascaleX=s.scaleX,s.ascaleY=s.scaleY,s.ashearX=s.shearX,s.ashearY=s.shearY,s.appliedValid=!0}const t=this._updateCache;for(let e=0,i=t.length;e<i;e++)t[e].update()}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){const r=this.bones;for(let s=0,n=r.length;s<n;s++)r[s].setToSetupPose();const t=this.ikConstraints;for(let s=0,n=t.length;s<n;s++){const a=t[s];a.mix=a.data.mix,a.softness=a.data.softness,a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch}const e=this.transformConstraints;for(let s=0,n=e.length;s<n;s++){const a=e[s],o=a.data;a.rotateMix=o.rotateMix,a.translateMix=o.translateMix,a.scaleMix=o.scaleMix,a.shearMix=o.shearMix}const i=this.pathConstraints;for(let s=0,n=i.length;s<n;s++){const a=i[s],o=a.data;a.position=o.position,a.spacing=o.spacing,a.rotateMix=o.rotateMix,a.translateMix=o.translateMix}}setSlotsToSetupPose(){const r=this.slots;Q.arrayCopy(r,0,this.drawOrder,0,r.length);for(let t=0,e=r.length;t<e;t++)r[t].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(r){if(r==null)throw new Error("boneName cannot be null.");const t=this.bones;for(let e=0,i=t.length;e<i;e++){const s=t[e];if(s.data.name==r)return s}return null}findBoneIndex(r){if(r==null)throw new Error("boneName cannot be null.");const t=this.bones;for(let e=0,i=t.length;e<i;e++)if(t[e].data.name==r)return e;return-1}findSlot(r){if(r==null)throw new Error("slotName cannot be null.");const t=this.slots;for(let e=0,i=t.length;e<i;e++){const s=t[e];if(s.data.name==r)return s}return null}findSlotIndex(r){if(r==null)throw new Error("slotName cannot be null.");const t=this.slots;for(let e=0,i=t.length;e<i;e++)if(t[e].data.name==r)return e;return-1}setSkinByName(r){const t=this.data.findSkin(r);if(t==null)throw new Error(`Skin not found: ${r}`);this.setSkin(t)}setSkin(r){if(r!=this.skin){if(r!=null)if(this.skin!=null)r.attachAll(this,this.skin);else{const t=this.slots;for(let e=0,i=t.length;e<i;e++){const s=t[e],n=s.data.attachmentName;if(n!=null){const a=r.getAttachment(e,n);a!=null&&s.setAttachment(a)}}}this.skin=r,this.updateCache()}}getAttachmentByName(r,t){return this.getAttachment(this.data.findSlotIndex(r),t)}getAttachment(r,t){if(t==null)throw new Error("attachmentName cannot be null.");if(this.skin!=null){const e=this.skin.getAttachment(r,t);if(e!=null)return e}return this.data.defaultSkin!=null?this.data.defaultSkin.getAttachment(r,t):null}setAttachment(r,t){if(r==null)throw new Error("slotName cannot be null.");const e=this.slots;for(let i=0,s=e.length;i<s;i++){const n=e[i];if(n.data.name==r){let a=null;if(t!=null&&(a=this.getAttachment(i,t),a==null))throw new Error(`Attachment not found: ${t}, for slot: ${r}`);n.setAttachment(a);return}}throw new Error(`Slot not found: ${r}`)}findIkConstraint(r){if(r==null)throw new Error("constraintName cannot be null.");const t=this.ikConstraints;for(let e=0,i=t.length;e<i;e++){const s=t[e];if(s.data.name==r)return s}return null}findTransformConstraint(r){if(r==null)throw new Error("constraintName cannot be null.");const t=this.transformConstraints;for(let e=0,i=t.length;e<i;e++){const s=t[e];if(s.data.name==r)return s}return null}findPathConstraint(r){if(r==null)throw new Error("constraintName cannot be null.");const t=this.pathConstraints;for(let e=0,i=t.length;e<i;e++){const s=t[e];if(s.data.name==r)return s}return null}getBounds(r,t,e=new Array(2)){if(r==null)throw new Error("offset cannot be null.");if(t==null)throw new Error("size cannot be null.");const i=this.drawOrder;let s=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let h=0,l=i.length;h<l;h++){const c=i[h];if(!c.bone.active)continue;let d=0,u=null;const f=c.getAttachment();if(f instanceof et)d=8,u=Q.setArraySize(e,d,0),f.computeWorldVertices(c.bone,u,0,2);else if(f instanceof io){const p=f;d=p.worldVerticesLength,u=Q.setArraySize(e,d,0),p.computeWorldVertices(c,0,d,u,0,2)}if(u!=null)for(let p=0,m=u.length;p<m;p+=2){const g=u[p],y=u[p+1];s=Math.min(s,g),n=Math.min(n,y),a=Math.max(a,g),o=Math.max(o,y)}}r.set(s,n),t.set(a-s,o-n)}update(r){this.time+=r}get flipX(){return this.scaleX==-1}set flipX(r){Tn.deprecatedWarning1||(Tn.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleX=r?1:-1}get flipY(){return this.scaleY==-1}set flipY(r){Tn.deprecatedWarning1||(Tn.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleY=r?1:-1}};let $m=Tn;$m.deprecatedWarning1=!1,ee.Normal,ee.OnlyTranslation,ee.NoRotationOrReflection,ee.NoScale,ee.NoScaleOrReflection,eo.Fixed,eo.Percent,Es.Length,Es.Fixed,Es.Percent,Fr.Tangent,Fr.Chain,Fr.ChainScale,K.NORMAL,K.ADD,K.MULTIPLY,K.SCREEN;class LE extends Ec{createSkeleton(t){this.skeleton=new $m(t),this.skeleton.updateWorldTransform(),this.stateData=new Xm(t),this.state=new Fe(this.stateData)}}class NE extends LE{constructor(t,e){const{followPointList:i,visible:s=!1}=e||{};let n;typeof t=="string"?n=tn.get(t).spineData:n=t.spineData,super(n),this._followDots=[],this._isStart=!1,this.visible=s,this.autoUpdate=!1,i!=null&&i.length&&(i==null||i.forEach(a=>{a.follow.alpha=0,this._followDots.push({point:this.skeleton.findBone(a.boneName),follow:a.follow,onUpdate:a.onUpdate,angleFollow:a.angleFollow||!1,scaleFollow:a.scaleFollow||!0})})),this._loopFn=this._loop.bind(this),Wt.system.add(this._loopFn)}setAnimation(t="animation",e=!1,i=!1){return new Promise(s=>{this.visible=!0,this.state.setAnimation(0,t,e).listener={complete:()=>{this.visible=!i,requestAnimationFrame(()=>{s()})}}})}addAnimation(t="animation",e=!1,i=0,s=!1){return new Promise(n=>{this.visible=!0,this.state.addAnimation(0,t,e,i).listener={complete:()=>{this.visible=!s,requestAnimationFrame(()=>{n()})}}})}setSkin(t){this.skeleton.setSkinByName(t)}destroyAll(){Wt.system.remove(this._loopFn),this.destroy()}_loop(){this.update(Wt.system.deltaMS/1e3),this._updateFollowPoint()}_updateFollowPoint(){this._followDots.length!==0&&(this._followDots.forEach(t=>{const{worldX:e,worldY:i}=t.point,s=t.point.getWorldRotationX()*(Math.PI/180),n=t.point.getWorldScaleX(),a=t.point.getWorldScaleY();t.onUpdate?t.onUpdate({x:e,y:i,rotate:s,scaleX:n,scaleY:a}):(t.angleFollow&&(t.follow.rotation=s),t.scaleFollow&&t.follow.scale.set(n,a),t.follow.position.set(e+1920/2-t.follow.width/2,i+1080/2-t.follow.height/2))}),this._isStart||(this._isStart=!0,this._followDots.forEach(t=>{_n.to(t.follow,{alpha:1,duration:.25,delay:.15})})))}}const kE=Object.freeze(Object.defineProperty({__proto__:null,Base:{LibPixiBitText:Zb,LibPixiContainer:dE,LibPixiParticleMove:EE,LibPixiRectBgColor:Im,LibPixiSpine:NE,LibPixiText:Lm}},Symbol.toStringTag,{value:"Module"}));window.LibPixiJs=kE});