diff --git a/dist/assets/index-CyjCNKhS.js b/dist/assets/index-9ofazf7F.js similarity index 68% rename from dist/assets/index-CyjCNKhS.js rename to dist/assets/index-9ofazf7F.js index bb7b9fc..1733fd6 100644 --- a/dist/assets/index-CyjCNKhS.js +++ b/dist/assets/index-9ofazf7F.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-De2_H8wT.js","assets/index-Btg_SCRJ.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D13mN481.js","assets/index-Cz2cACyM.js"])))=>i.map(i=>d[i]); var yS=Object.defineProperty;var xS=(s,e,t)=>e in s?yS(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var w=(s,e,t)=>xS(s,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(n){if(n.ep)return;n.ep=!0;const r=t(n);fetch(n.href,r)}})();/** * @vue/shared v3.5.41 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -438,7 +438,7 @@ void main(void) vTextureCoord = aTextureCoord; vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy; } -`;class QC extends Ui{constructor(e,t,i){let n=null;typeof e!="string"&&t===void 0&&i===void 0&&(n=e,e=void 0,t=void 0,i=void 0),super(e||JC,t||ZC,i),this.maskSprite=n,this.maskMatrix=new Bt}get maskSprite(){return this._maskSprite}set maskSprite(e){this._maskSprite=e,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(e,t,i,n){const r=this._maskSprite,o=r._texture;o.valid&&(o.uvMatrix||(o.uvMatrix=new Qm(o,0)),o.uvMatrix.update(),this.uniforms.npmAlpha=o.baseTexture.alphaMode?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=e.calculateSpriteMatrix(this.maskMatrix,r).prepend(o.uvMatrix.mapCoord),this.uniforms.alpha=r.worldAlpha,this.uniforms.maskClamp=o.uvMatrix.uClampFrame,e.applyFilter(this,t,i,n))}}class eA{constructor(e=null){this.type=oi.NONE,this.autoDetect=!0,this.maskObject=e||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=Ui.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(e){e?this._filters?this._filters[0]=e:this._filters=[e]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=oi.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(e){e?(this._stencilCounter=e._stencilCounter,this._scissorCounter=e._scissorCounter,this._scissorRect=e._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class e1{constructor(e){this.renderer=e,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(e){this.maskStack=e,this.renderer.scissor.setMaskStack(e),this.renderer.stencil.setMaskStack(e)}push(e,t){let i=t;if(!i.isMaskData){const r=this.maskDataPool.pop()||new eA;r.pooled=!0,r.maskObject=t,i=r}const n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(i.copyCountersOrReset(n),i._colorMask=n?n._colorMask:15,i.autoDetect&&this.detect(i),i._target=e,i.type!==oi.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case oi.SCISSOR:this.renderer.scissor.push(i);break;case oi.STENCIL:this.renderer.stencil.push(i);break;case oi.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break;case oi.COLOR:this.pushColorMask(i);break}i.type===oi.SPRITE&&this.maskStack.push(i)}pop(e){const t=this.maskStack.pop();if(!(!t||t._target!==e)){if(t.enabled)switch(t.type){case oi.SCISSOR:this.renderer.scissor.pop(t);break;case oi.STENCIL:this.renderer.stencil.pop(t.maskObject);break;case oi.SPRITE:this.popSpriteMask(t);break;case oi.COLOR:this.popColorMask(t);break}if(t.reset(),t.pooled&&this.maskDataPool.push(t),this.maskStack.length!==0){const i=this.maskStack[this.maskStack.length-1];i.type===oi.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}}detect(e){const t=e.maskObject;t?t.isSprite?e.type=oi.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(e)?e.type=oi.SCISSOR:e.type=oi.STENCIL:e.type=oi.COLOR}pushSpriteMask(e){const{maskObject:t}=e,i=e._target;let n=e._filters;n||(n=this.alphaMaskPool[this.alphaMaskIndex],n||(n=this.alphaMaskPool[this.alphaMaskIndex]=[new QC])),n[0].resolution=e.resolution,n[0].multisample=e.multisample,n[0].maskSprite=t;const r=i.filterArea;i.filterArea=t.getBounds(!0),this.renderer.filter.push(i,n),i.filterArea=r,e._filters||this.alphaMaskIndex++}popSpriteMask(e){this.renderer.filter.pop(),e._filters?e._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(e){const t=e._colorMask,i=e._colorMask=t&e.colorMask;i!==t&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}popColorMask(e){const t=e._colorMask,i=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==t&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}destroy(){this.renderer=null}}e1.extension={type:Pe.RendererSystem,name:"mask"};Ne.add(e1);class t1{constructor(e){this.renderer=e,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(e){const{gl:t}=this.renderer,i=this.getStackLength();this.maskStack=e;const n=this.getStackLength();n!==i&&(n===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const $0=new Bt,X0=[],i1=class xc extends t1{constructor(e){super(e),this.glConst=ke.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0}calcScissorRect(e){if(e._scissorRectLocal)return;const t=e._scissorRect,{maskObject:i}=e,{renderer:n}=this,r=n.renderTexture,o=i.getBounds(!0,X0.pop()??new nt);this.roundFrameToPixels(o,r.current?r.current.resolution:n.resolution,r.sourceFrame,r.destinationFrame,n.projection.transform),t&&o.fit(t),e._scissorRectLocal=o}static isMatrixRotated(e){if(!e)return!1;const{a:t,b:i,c:n,d:r}=e;return(Math.abs(i)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(r)>1e-4)}testScissor(e){const{maskObject:t}=e;if(!t.isFastRect||!t.isFastRect()||xc.isMatrixRotated(t.worldTransform)||xc.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const i=e._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(e,t,i,n,r){xc.isMatrixRotated(r)||(r=r?$0.copyFrom(r):$0.identity(),r.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.renderer.filter.transformAABB(r,e),e.fit(n),e.x=Math.round(e.x*t),e.y=Math.round(e.y*t),e.width=Math.round(e.width*t),e.height=Math.round(e.height*t))}push(e){e._scissorRectLocal||this.calcScissorRect(e);const{gl:t}=this.renderer;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()}pop(e){const{gl:t}=this.renderer;e&&X0.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)}_useCurrent(){const e=this.maskStack[this.maskStack.length-1]._scissorRect;let t;this.renderer.renderTexture.current?t=e.y:t=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)}};i1.extension={type:Pe.RendererSystem,name:"scissor"};let tA=i1;Ne.add(tA);class s1 extends t1{constructor(e){super(e),this.glConst=ke.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0}push(e){const t=e.maskObject,{gl:i}=this.renderer,n=e._stencilCounter;n===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),e._stencilCounter++;const r=e._colorMask;r!==0&&(e._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,n,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,r!==0&&(e._colorMask=r,i.colorMask((r&1)!==0,(r&2)!==0,(r&4)!==0,(r&8)!==0)),this._useCurrent()}pop(e){const t=this.renderer.gl;if(this.getStackLength()===0)t.disable(t.STENCIL_TEST);else{const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,n=i?i._colorMask:15;n!==0&&(i._colorMask=0,t.colorMask(!1,!1,!1,!1)),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,n!==0&&(i._colorMask=n,t.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this._useCurrent()}}_useCurrent(){const e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}}s1.extension={type:Pe.RendererSystem,name:"stencil"};Ne.add(s1);class n1{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return ct("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return ct("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return ct("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),e.events}}})}init(){const e=this.rendererPlugins;for(const t in e)this.plugins[t]=new e[t](this.renderer)}destroy(){for(const e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null}}n1.extension={type:[Pe.RendererSystem,Pe.CanvasRendererSystem],name:"_plugin"};Ne.add(n1);class r1{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Bt,this.transform=null}update(e,t,i,n){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);const r=this.renderer;r.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,r.globalUniforms.update(),r.shader.shader&&r.shader.syncUniformGroup(r.shader.shader.uniforms.globals)}calculateProjection(e,t,i,n){const r=this.projectionMatrix,o=n?-1:1;r.identity(),r.a=1/t.width*2,r.d=o*(1/t.height*2),r.tx=-1-t.x*r.a,r.ty=-o-t.y*r.d}setTransform(e){}destroy(){this.renderer=null}}r1.extension={type:Pe.RendererSystem,name:"projection"};Ne.add(r1);const iA=new Zm,V0=new nt;class o1{constructor(e){this.renderer=e,this._tempMatrix=new Bt}generateTexture(e,t){const{region:i,...n}=t||{},r=(i==null?void 0:i.copyTo(V0))||e.getLocalBounds(V0,!0),o=n.resolution||this.renderer.resolution;r.width=Math.max(r.width,1/o),r.height=Math.max(r.height,1/o),n.width=r.width,n.height=r.height,n.resolution=o,n.multisample??(n.multisample=this.renderer.multisample);const a=oo.create(n);this._tempMatrix.tx=-r.x,this._tempMatrix.ty=-r.y;const c=e.transform;return e.transform=iA,this.renderer.render(e,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=c,a}destroy(){}}o1.extension={type:[Pe.RendererSystem,Pe.CanvasRendererSystem],name:"textureGenerator"};Ne.add(o1);const Er=new nt,wa=new nt;class a1{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new nt,this.destinationFrame=new nt,this.viewportFrame=new nt}contextChange(){var t;const e=(t=this.renderer)==null?void 0:t.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}bind(e=null,t,i){const n=this.renderer;this.current=e;let r,o,a;e?(r=e.baseTexture,a=r.resolution,t||(Er.width=e.frame.width,Er.height=e.frame.height,t=Er),i||(wa.x=e.frame.x,wa.y=e.frame.y,wa.width=t.width,wa.height=t.height,i=wa),o=r.framebuffer):(a=n.resolution,t||(Er.width=n._view.screen.width,Er.height=n._view.screen.height,t=Er),i||(i=Er,i.width=t.width,i.height=t.height));const c=this.viewportFrame;c.x=i.x*a,c.y=i.y*a,c.width=i.width*a,c.height=i.height*a,e||(c.y=n.view.height-(c.y+c.height)),c.ceil(),this.renderer.framebuffer.bind(o,c),this.renderer.projection.update(i,t,a,!o),e?this.renderer.mask.setMaskStack(r.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(i)}clear(e,t){const i=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,n=St.shared.setValue(e||i);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&n.premultiply(n.alpha);const r=this.destinationFrame,o=this.current?this.current.baseTexture:this.renderer._view.screen,a=r.width!==o.width||r.height!==o.height;if(a){let{x:c,y:l,width:h,height:u}=this.viewportFrame;c=Math.round(c),l=Math.round(l),h=Math.round(h),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(c,l,h,u)}this.renderer.framebuffer.clear(n.red,n.green,n.blue,n.alpha,t),a&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}a1.extension={type:Pe.RendererSystem,name:"renderTexture"};Ne.add(a1);class sA{constructor(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function nA(s,e){const t={},i=e.getProgramParameter(s,e.ACTIVE_ATTRIBUTES);for(let n=0;nl>h?1:-1);for(let l=0;l0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==t&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}destroy(){this.renderer=null}}eb.extension={type:Pe.RendererSystem,name:"mask"};Ne.add(eb);class tb{constructor(e){this.renderer=e,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(e){const{gl:t}=this.renderer,i=this.getStackLength();this.maskStack=e;const n=this.getStackLength();n!==i&&(n===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const $0=new Bt,X0=[],ib=class xc extends tb{constructor(e){super(e),this.glConst=ke.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0}calcScissorRect(e){if(e._scissorRectLocal)return;const t=e._scissorRect,{maskObject:i}=e,{renderer:n}=this,r=n.renderTexture,o=i.getBounds(!0,X0.pop()??new nt);this.roundFrameToPixels(o,r.current?r.current.resolution:n.resolution,r.sourceFrame,r.destinationFrame,n.projection.transform),t&&o.fit(t),e._scissorRectLocal=o}static isMatrixRotated(e){if(!e)return!1;const{a:t,b:i,c:n,d:r}=e;return(Math.abs(i)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(r)>1e-4)}testScissor(e){const{maskObject:t}=e;if(!t.isFastRect||!t.isFastRect()||xc.isMatrixRotated(t.worldTransform)||xc.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const i=e._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(e,t,i,n,r){xc.isMatrixRotated(r)||(r=r?$0.copyFrom(r):$0.identity(),r.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.renderer.filter.transformAABB(r,e),e.fit(n),e.x=Math.round(e.x*t),e.y=Math.round(e.y*t),e.width=Math.round(e.width*t),e.height=Math.round(e.height*t))}push(e){e._scissorRectLocal||this.calcScissorRect(e);const{gl:t}=this.renderer;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()}pop(e){const{gl:t}=this.renderer;e&&X0.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)}_useCurrent(){const e=this.maskStack[this.maskStack.length-1]._scissorRect;let t;this.renderer.renderTexture.current?t=e.y:t=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)}};ib.extension={type:Pe.RendererSystem,name:"scissor"};let tA=ib;Ne.add(tA);class sb extends tb{constructor(e){super(e),this.glConst=ke.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0}push(e){const t=e.maskObject,{gl:i}=this.renderer,n=e._stencilCounter;n===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),e._stencilCounter++;const r=e._colorMask;r!==0&&(e._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,n,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,r!==0&&(e._colorMask=r,i.colorMask((r&1)!==0,(r&2)!==0,(r&4)!==0,(r&8)!==0)),this._useCurrent()}pop(e){const t=this.renderer.gl;if(this.getStackLength()===0)t.disable(t.STENCIL_TEST);else{const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,n=i?i._colorMask:15;n!==0&&(i._colorMask=0,t.colorMask(!1,!1,!1,!1)),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,n!==0&&(i._colorMask=n,t.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this._useCurrent()}}_useCurrent(){const e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}}sb.extension={type:Pe.RendererSystem,name:"stencil"};Ne.add(sb);class nb{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return ct("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return ct("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return ct("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),e.events}}})}init(){const e=this.rendererPlugins;for(const t in e)this.plugins[t]=new e[t](this.renderer)}destroy(){for(const e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null}}nb.extension={type:[Pe.RendererSystem,Pe.CanvasRendererSystem],name:"_plugin"};Ne.add(nb);class rb{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Bt,this.transform=null}update(e,t,i,n){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);const r=this.renderer;r.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,r.globalUniforms.update(),r.shader.shader&&r.shader.syncUniformGroup(r.shader.shader.uniforms.globals)}calculateProjection(e,t,i,n){const r=this.projectionMatrix,o=n?-1:1;r.identity(),r.a=1/t.width*2,r.d=o*(1/t.height*2),r.tx=-1-t.x*r.a,r.ty=-o-t.y*r.d}setTransform(e){}destroy(){this.renderer=null}}rb.extension={type:Pe.RendererSystem,name:"projection"};Ne.add(rb);const iA=new Zm,V0=new nt;class ob{constructor(e){this.renderer=e,this._tempMatrix=new Bt}generateTexture(e,t){const{region:i,...n}=t||{},r=(i==null?void 0:i.copyTo(V0))||e.getLocalBounds(V0,!0),o=n.resolution||this.renderer.resolution;r.width=Math.max(r.width,1/o),r.height=Math.max(r.height,1/o),n.width=r.width,n.height=r.height,n.resolution=o,n.multisample??(n.multisample=this.renderer.multisample);const a=oo.create(n);this._tempMatrix.tx=-r.x,this._tempMatrix.ty=-r.y;const c=e.transform;return e.transform=iA,this.renderer.render(e,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=c,a}destroy(){}}ob.extension={type:[Pe.RendererSystem,Pe.CanvasRendererSystem],name:"textureGenerator"};Ne.add(ob);const Er=new nt,wa=new nt;class ab{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new nt,this.destinationFrame=new nt,this.viewportFrame=new nt}contextChange(){var t;const e=(t=this.renderer)==null?void 0:t.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}bind(e=null,t,i){const n=this.renderer;this.current=e;let r,o,a;e?(r=e.baseTexture,a=r.resolution,t||(Er.width=e.frame.width,Er.height=e.frame.height,t=Er),i||(wa.x=e.frame.x,wa.y=e.frame.y,wa.width=t.width,wa.height=t.height,i=wa),o=r.framebuffer):(a=n.resolution,t||(Er.width=n._view.screen.width,Er.height=n._view.screen.height,t=Er),i||(i=Er,i.width=t.width,i.height=t.height));const c=this.viewportFrame;c.x=i.x*a,c.y=i.y*a,c.width=i.width*a,c.height=i.height*a,e||(c.y=n.view.height-(c.y+c.height)),c.ceil(),this.renderer.framebuffer.bind(o,c),this.renderer.projection.update(i,t,a,!o),e?this.renderer.mask.setMaskStack(r.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(i)}clear(e,t){const i=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,n=St.shared.setValue(e||i);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&n.premultiply(n.alpha);const r=this.destinationFrame,o=this.current?this.current.baseTexture:this.renderer._view.screen,a=r.width!==o.width||r.height!==o.height;if(a){let{x:c,y:l,width:h,height:u}=this.viewportFrame;c=Math.round(c),l=Math.round(l),h=Math.round(h),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(c,l,h,u)}this.renderer.framebuffer.clear(n.red,n.green,n.blue,n.alpha,t),a&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}ab.extension={type:Pe.RendererSystem,name:"renderTexture"};Ne.add(ab);class sA{constructor(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function nA(s,e){const t={},i=e.getProgramParameter(s,e.ACTIVE_ATTRIBUTES);for(let n=0;nl>h?1:-1);for(let l=0;l({data:r,offset:0,dataLen:0,dirty:0}));let t=0,i=0,n=0;for(let r=0;r1&&(t=Math.max(t,16)*o.data.size),o.dataLen=t,i%t!==0&&i<16){const a=i%t%16;i+=a,n+=a}i+t>16?(n=Math.ceil(n/16)*16,o.offset=n,n+=t,i=t):(o.offset=n,i+=t,n+=t)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function hA(s,e){const t=[];for(const i in s)e[i]&&t.push(e[i]);return t.sort((i,n)=>i.index-n.index),t}function uA(s,e){if(!s.autoManage)return{size:0,syncFunc:aA};const t=hA(s.uniforms,e),{uboElements:i,size:n}=cA(t),r=[` + `},lb={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function cA(s){const e=s.map(r=>({data:r,offset:0,dataLen:0,dirty:0}));let t=0,i=0,n=0;for(let r=0;r1&&(t=Math.max(t,16)*o.data.size),o.dataLen=t,i%t!==0&&i<16){const a=i%t%16;i+=a,n+=a}i+t>16?(n=Math.ceil(n/16)*16,o.offset=n,n+=t,i=t):(o.offset=n,i+=t,n+=t)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function hA(s,e){const t=[];for(const i in s)e[i]&&t.push(e[i]);return t.sort((i,n)=>i.index-n.index),t}function uA(s,e){if(!s.autoManage)return{size:0,syncFunc:aA};const t=hA(s.uniforms,e),{uboElements:i,size:n}=cA(t),r=[` var v = null; var v2 = null; var cv = null; @@ -484,7 +484,7 @@ void main(void) var gl = renderer.gl var index = 0; var data = buffer.data; - `];for(let o=0;o1){const u=Yx(a.data.type),d=Math.max(l1[a.data.type]/16,1),f=u/d,p=(4-f%4)%4;r.push(` + `];for(let o=0;o1){const u=Yx(a.data.type),d=Math.max(lb[a.data.type]/16,1),f=u/d,p=(4-f%4)%4;r.push(` cv = ud.${l}.value; v = uv.${l}; offset = ${a.offset/4}; @@ -508,7 +508,7 @@ void main(void) `)}}return r.push(` renderer.buffer.update(buffer); `),{size:n,syncFunc:new Function("ud","uv","renderer","syncData","buffer",r.join(` -`))}}let dA=0;const jl={textureCount:0,uboCount:0};class c1{constructor(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=dA++}systemCheck(){if(!NC())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(e){this.gl=e,this.reset()}bind(e,t){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;const i=e.program,n=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==i&&(this.program=i,this.gl.useProgram(n.program)),t||(jl.textureCount=0,jl.uboCount=0,this.syncUniformGroup(e.uniformGroup,jl)),n}setUniforms(e){const t=this.shader.program,i=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(i.uniformData,e,this.renderer)}syncUniformGroup(e,t){const i=this.getGlProgram();(!e.static||e.dirtyId!==i.uniformDirtyGroups[e.id])&&(i.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,i,t))}syncUniforms(e,t,i){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,i)}createSyncGroups(e){const t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=FC(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[t],e.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(e,t){const i=this.getGlProgram();if(!e.static||e.dirtyId!==0||!i.uniformGroups[e.id]){e.dirtyId=0;const n=i.uniformGroups[e.id]||this.createSyncBufferGroup(e,i,t);e.buffer.update(),n(i.uniformData,e.uniforms,this.renderer,jl,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,i.uniformBufferBindings[t])}createSyncBufferGroup(e,t,i){const{gl:n}=this.renderer;this.renderer.buffer.bind(e.buffer);const r=this.gl.getUniformBlockIndex(t.program,i);t.uniformBufferBindings[i]=this.shader.uniformBindCount,n.uniformBlockBinding(t.program,r,this.shader.uniformBindCount),this.shader.uniformBindCount++;const o=this.getSignature(e,this.shader.program.uniformData,"ubo");let a=this._uboCache[o];if(a||(a=this._uboCache[o]=uA(e,this.shader.program.uniformData)),e.autoManage){const c=new Float32Array(a.size/4);e.buffer.update(c)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]}getSignature(e,t,i){const n=e.uniforms,r=[`${i}-`];for(const o in n)r.push(o),t[o]&&r.push(t[o].type);return r.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(e){const t=this.gl,i=e.program,n=oA(t,i);return i.glPrograms[this.renderer.CONTEXT_UID]=n,n}reset(){this.program=null,this.shader=null}disposeShader(e){this.shader===e&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}c1.extension={type:Pe.RendererSystem,name:"shader"};Ne.add(c1);class Kc{constructor(e){this.renderer=e}run(e){const{renderer:t}=this;t.runners.init.emit(t.options),e.hello&&console.log(`PixiJS 7.4.3 - ${t.rendererLogId} - https://pixijs.com`),t.resize(t.screen.width,t.screen.height)}destroy(){}}Kc.defaultOptions={hello:!1},Kc.extension={type:[Pe.RendererSystem,Pe.CanvasRendererSystem],name:"startup"};Ne.add(Kc);function fA(s,e=[]){return e[je.NORMAL]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.ADD]=[s.ONE,s.ONE],e[je.MULTIPLY]=[s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.SCREEN]=[s.ONE,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.OVERLAY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.DARKEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.LIGHTEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.COLOR_DODGE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.COLOR_BURN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.HARD_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.SOFT_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.DIFFERENCE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.EXCLUSION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.HUE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.SATURATION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.COLOR]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.LUMINOSITY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.NONE]=[0,0],e[je.NORMAL_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.ADD_NPM]=[s.SRC_ALPHA,s.ONE,s.ONE,s.ONE],e[je.SCREEN_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.SRC_IN]=[s.DST_ALPHA,s.ZERO],e[je.SRC_OUT]=[s.ONE_MINUS_DST_ALPHA,s.ZERO],e[je.SRC_ATOP]=[s.DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],e[je.DST_OVER]=[s.ONE_MINUS_DST_ALPHA,s.ONE],e[je.DST_IN]=[s.ZERO,s.SRC_ALPHA],e[je.DST_OUT]=[s.ZERO,s.ONE_MINUS_SRC_ALPHA],e[je.DST_ATOP]=[s.ONE_MINUS_DST_ALPHA,s.SRC_ALPHA],e[je.XOR]=[s.ONE_MINUS_DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],e[je.SUBTRACT]=[s.ONE,s.ONE,s.ONE,s.ONE,s.FUNC_REVERSE_SUBTRACT,s.FUNC_ADD],e}const mA=0,pA=1,gA=2,vA=3,yA=4,xA=5,h1=class Of{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=je.NONE,this._blendEq=!1,this.map=[],this.map[mA]=this.setBlend,this.map[pA]=this.setOffset,this.map[gA]=this.setCullFace,this.map[vA]=this.setDepthTest,this.map[yA]=this.setFrontFace,this.map[xA]=this.setDepthMask,this.checks=[],this.defaultState=new ln,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=fA(e),this.set(this.defaultState),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let t=this.stateId^e.data,i=0;for(;t;)t&1&&this.map[i].call(this,!!(e.data&1<>1,i++;this.stateId=e.data}for(let t=0;te.systems[n]),i=[...t,...Object.keys(e.systems).filter(n=>!t.includes(n))];for(const n of i)this.addSystem(e.systems[n],n)}addRunners(...e){e.forEach(t=>{this.runners[t]=new Rs(t)})}addSystem(e,t){const i=new e(this);if(this[t])throw new Error(`Whoops! The name "${t}" is already in use`);this[t]=i,this._systemsHash[t]=i;for(const n in this.runners)this.runners[n].add(i);return this}emitWithCustomOptions(e,t){const i=Object.keys(this._systemsHash);e.items.forEach(n=>{const r=i.find(o=>this._systemsHash[o]===n);n[e.name](t[r])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const Pa=class bc{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=bc.defaultMaxIdle,this.checkCountMax=bc.defaultCheckCountMax,this.mode=bc.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==Wm.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this.renderer.texture,t=e.managedTextures;let i=!1;for(let n=0;nthis.maxIdle&&(e.destroyTexture(r,!0),t[n]=null,i=!0)}if(i){let n=0;for(let r=0;r=0;n--)this.unload(e.children[n])}destroy(){this.renderer=null}};Pa.defaultMode=Wm.AUTO,Pa.defaultMaxIdle=3600,Pa.defaultCheckCountMax=600,Pa.extension={type:Pe.RendererSystem,name:"textureGC"};let Lr=Pa;Ne.add(Lr);class Od{constructor(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=De.UNSIGNED_BYTE,this.internalFormat=Se.RGBA,this.samplerType=0}}function SA(s){let e;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?e={[s.RGB]:Oe.FLOAT,[s.RGBA]:Oe.FLOAT,[s.ALPHA]:Oe.FLOAT,[s.LUMINANCE]:Oe.FLOAT,[s.LUMINANCE_ALPHA]:Oe.FLOAT,[s.R8]:Oe.FLOAT,[s.R8_SNORM]:Oe.FLOAT,[s.RG8]:Oe.FLOAT,[s.RG8_SNORM]:Oe.FLOAT,[s.RGB8]:Oe.FLOAT,[s.RGB8_SNORM]:Oe.FLOAT,[s.RGB565]:Oe.FLOAT,[s.RGBA4]:Oe.FLOAT,[s.RGB5_A1]:Oe.FLOAT,[s.RGBA8]:Oe.FLOAT,[s.RGBA8_SNORM]:Oe.FLOAT,[s.RGB10_A2]:Oe.FLOAT,[s.RGB10_A2UI]:Oe.FLOAT,[s.SRGB8]:Oe.FLOAT,[s.SRGB8_ALPHA8]:Oe.FLOAT,[s.R16F]:Oe.FLOAT,[s.RG16F]:Oe.FLOAT,[s.RGB16F]:Oe.FLOAT,[s.RGBA16F]:Oe.FLOAT,[s.R32F]:Oe.FLOAT,[s.RG32F]:Oe.FLOAT,[s.RGB32F]:Oe.FLOAT,[s.RGBA32F]:Oe.FLOAT,[s.R11F_G11F_B10F]:Oe.FLOAT,[s.RGB9_E5]:Oe.FLOAT,[s.R8I]:Oe.INT,[s.R8UI]:Oe.UINT,[s.R16I]:Oe.INT,[s.R16UI]:Oe.UINT,[s.R32I]:Oe.INT,[s.R32UI]:Oe.UINT,[s.RG8I]:Oe.INT,[s.RG8UI]:Oe.UINT,[s.RG16I]:Oe.INT,[s.RG16UI]:Oe.UINT,[s.RG32I]:Oe.INT,[s.RG32UI]:Oe.UINT,[s.RGB8I]:Oe.INT,[s.RGB8UI]:Oe.UINT,[s.RGB16I]:Oe.INT,[s.RGB16UI]:Oe.UINT,[s.RGB32I]:Oe.INT,[s.RGB32UI]:Oe.UINT,[s.RGBA8I]:Oe.INT,[s.RGBA8UI]:Oe.UINT,[s.RGBA16I]:Oe.INT,[s.RGBA16UI]:Oe.UINT,[s.RGBA32I]:Oe.INT,[s.RGBA32UI]:Oe.UINT,[s.DEPTH_COMPONENT16]:Oe.FLOAT,[s.DEPTH_COMPONENT24]:Oe.FLOAT,[s.DEPTH_COMPONENT32F]:Oe.FLOAT,[s.DEPTH_STENCIL]:Oe.FLOAT,[s.DEPTH24_STENCIL8]:Oe.FLOAT,[s.DEPTH32F_STENCIL8]:Oe.FLOAT}:e={[s.RGB]:Oe.FLOAT,[s.RGBA]:Oe.FLOAT,[s.ALPHA]:Oe.FLOAT,[s.LUMINANCE]:Oe.FLOAT,[s.LUMINANCE_ALPHA]:Oe.FLOAT,[s.DEPTH_STENCIL]:Oe.FLOAT},e}function _A(s){let e;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?e={[De.UNSIGNED_BYTE]:{[Se.RGBA]:s.RGBA8,[Se.RGB]:s.RGB8,[Se.RG]:s.RG8,[Se.RED]:s.R8,[Se.RGBA_INTEGER]:s.RGBA8UI,[Se.RGB_INTEGER]:s.RGB8UI,[Se.RG_INTEGER]:s.RG8UI,[Se.RED_INTEGER]:s.R8UI,[Se.ALPHA]:s.ALPHA,[Se.LUMINANCE]:s.LUMINANCE,[Se.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[De.BYTE]:{[Se.RGBA]:s.RGBA8_SNORM,[Se.RGB]:s.RGB8_SNORM,[Se.RG]:s.RG8_SNORM,[Se.RED]:s.R8_SNORM,[Se.RGBA_INTEGER]:s.RGBA8I,[Se.RGB_INTEGER]:s.RGB8I,[Se.RG_INTEGER]:s.RG8I,[Se.RED_INTEGER]:s.R8I},[De.UNSIGNED_SHORT]:{[Se.RGBA_INTEGER]:s.RGBA16UI,[Se.RGB_INTEGER]:s.RGB16UI,[Se.RG_INTEGER]:s.RG16UI,[Se.RED_INTEGER]:s.R16UI,[Se.DEPTH_COMPONENT]:s.DEPTH_COMPONENT16},[De.SHORT]:{[Se.RGBA_INTEGER]:s.RGBA16I,[Se.RGB_INTEGER]:s.RGB16I,[Se.RG_INTEGER]:s.RG16I,[Se.RED_INTEGER]:s.R16I},[De.UNSIGNED_INT]:{[Se.RGBA_INTEGER]:s.RGBA32UI,[Se.RGB_INTEGER]:s.RGB32UI,[Se.RG_INTEGER]:s.RG32UI,[Se.RED_INTEGER]:s.R32UI,[Se.DEPTH_COMPONENT]:s.DEPTH_COMPONENT24},[De.INT]:{[Se.RGBA_INTEGER]:s.RGBA32I,[Se.RGB_INTEGER]:s.RGB32I,[Se.RG_INTEGER]:s.RG32I,[Se.RED_INTEGER]:s.R32I},[De.FLOAT]:{[Se.RGBA]:s.RGBA32F,[Se.RGB]:s.RGB32F,[Se.RG]:s.RG32F,[Se.RED]:s.R32F,[Se.DEPTH_COMPONENT]:s.DEPTH_COMPONENT32F},[De.HALF_FLOAT]:{[Se.RGBA]:s.RGBA16F,[Se.RGB]:s.RGB16F,[Se.RG]:s.RG16F,[Se.RED]:s.R16F},[De.UNSIGNED_SHORT_5_6_5]:{[Se.RGB]:s.RGB565},[De.UNSIGNED_SHORT_4_4_4_4]:{[Se.RGBA]:s.RGBA4},[De.UNSIGNED_SHORT_5_5_5_1]:{[Se.RGBA]:s.RGB5_A1},[De.UNSIGNED_INT_2_10_10_10_REV]:{[Se.RGBA]:s.RGB10_A2,[Se.RGBA_INTEGER]:s.RGB10_A2UI},[De.UNSIGNED_INT_10F_11F_11F_REV]:{[Se.RGB]:s.R11F_G11F_B10F},[De.UNSIGNED_INT_5_9_9_9_REV]:{[Se.RGB]:s.RGB9_E5},[De.UNSIGNED_INT_24_8]:{[Se.DEPTH_STENCIL]:s.DEPTH24_STENCIL8},[De.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[Se.DEPTH_STENCIL]:s.DEPTH32F_STENCIL8}}:e={[De.UNSIGNED_BYTE]:{[Se.RGBA]:s.RGBA,[Se.RGB]:s.RGB,[Se.ALPHA]:s.ALPHA,[Se.LUMINANCE]:s.LUMINANCE,[Se.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[De.UNSIGNED_SHORT_5_6_5]:{[Se.RGB]:s.RGB},[De.UNSIGNED_SHORT_4_4_4_4]:{[Se.RGBA]:s.RGBA},[De.UNSIGNED_SHORT_5_5_5_1]:{[Se.RGBA]:s.RGBA}},e}class u1{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Je,this.hasIntegerTextures=!1}contextChange(){const e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=_A(e),this.samplerTypes=SA(e);const t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(let n=0;n=0;--r){const o=t[r];o&&o._glTextures[n].samplerType!==Oe.FLOAT&&this.renderer.texture.unbind(o)}}initTexture(e){const t=new Od(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t}initTextureType(e,t){var i;t.internalFormat=((i=this.internalFormats[e.type])==null?void 0:i[e.format])??e.format,t.samplerType=this.samplerTypes[t.internalFormat]??Oe.FLOAT,this.webGLVersion===2&&e.type===De.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type}updateTexture(e){var n;const t=e._glTextures[this.CONTEXT_UID];if(!t)return;const i=this.renderer;if(this.initTextureType(e,t),(n=e.resource)==null?void 0:n.upload(i,e,t))t.samplerType!==Oe.FLOAT&&(this.hasIntegerTextures=!0);else{const r=e.realWidth,o=e.realHeight,a=i.gl;(t.width!==r||t.height!==o||t.dirtyId<0)&&(t.width=r,t.height=o,a.texImage2D(e.target,0,t.internalFormat,r,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}destroyTexture(e,t){const{gl:i}=this;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),i.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){const n=this.managedTextures.indexOf(e);n!==-1&&Xo(this.managedTextures,n,1)}}updateTextureStyle(e){var i;const t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===gs.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Is.CLAMP:t.wrapMode=e.wrapMode,(i=e.resource)!=null&&i.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)}setStyle(e,t){const i=this.gl;if(t.mipmap&&e.mipmap!==gs.ON_MANUAL&&i.generateMipmap(e.target),i.texParameteri(e.target,i.TEXTURE_WRAP_S,t.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===Cs.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===Cs.LINEAR){const r=Math.min(e.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,r)}}else i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===Cs.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===Cs.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}u1.extension={type:Pe.RendererSystem,name:"texture"};Ne.add(u1);class d1{constructor(e){this.renderer=e}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:t,CONTEXT_UID:i}=this,n=e._glTransformFeedbacks[i]||this.createGLTransformFeedback(e);t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,n)}unbind(){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(e,t){const{gl:i,renderer:n}=this;t&&n.shader.bind(t),i.beginTransformFeedback(e)}endTransformFeedback(){const{gl:e}=this;e.endTransformFeedback()}createGLTransformFeedback(e){const{gl:t,renderer:i,CONTEXT_UID:n}=this,r=t.createTransformFeedback();e._glTransformFeedbacks[n]=r,t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,r);for(let o=0;o(s[s.INTERACTION=50]="INTERACTION",s[s.HIGH=25]="HIGH",s[s.NORMAL=0]="NORMAL",s[s.LOW=-25]="LOW",s[s.UTILITY=-50]="UTILITY",s))(to||{});class Bd{constructor(e,t=null,i=0,n=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=i,this.once=n}match(e,t=null){return this.fn===e&&this.context===t}emit(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));const t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const t=this.next;return this.next=e?null:t,this.previous=null,t}}const f1=class Ji{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Bd(null,null,1/0),this.deltaMS=1/Ji.targetFPMS,this.elapsedMS=1/Ji.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,i=to.NORMAL){return this._addListener(new Bd(e,t,i))}addOnce(e,t,i=to.NORMAL){return this._addListener(new Bd(e,t,i,!0))}_addListener(e){let t=this._head.next,i=this._head;if(!t)e.connect(i);else{for(;t;){if(e.priority>t.priority){e.connect(i);break}i=t,t=t.next}e.previous||e.connect(i)}return this._startIfPossible(),this}remove(e,t){let i=this._head.next;for(;i;)i.match(e,t)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){const r=e-this._lastFrame|0;if(r{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?$i.shared:new $i,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}m1.extension=Pe.Application;Ne.add(m1);const p1=[];Ne.handleByList(Pe.Renderer,p1);function TA(s){for(const e of p1)if(e.test(s))return new e(s);throw new Error("Unable to auto-detect a suitable renderer.")}var MA=`attribute vec2 aVertexPosition; +`))}}let dA=0;const jl={textureCount:0,uboCount:0};class cb{constructor(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=dA++}systemCheck(){if(!NC())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(e){this.gl=e,this.reset()}bind(e,t){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;const i=e.program,n=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==i&&(this.program=i,this.gl.useProgram(n.program)),t||(jl.textureCount=0,jl.uboCount=0,this.syncUniformGroup(e.uniformGroup,jl)),n}setUniforms(e){const t=this.shader.program,i=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(i.uniformData,e,this.renderer)}syncUniformGroup(e,t){const i=this.getGlProgram();(!e.static||e.dirtyId!==i.uniformDirtyGroups[e.id])&&(i.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,i,t))}syncUniforms(e,t,i){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,i)}createSyncGroups(e){const t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=FC(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[t],e.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(e,t){const i=this.getGlProgram();if(!e.static||e.dirtyId!==0||!i.uniformGroups[e.id]){e.dirtyId=0;const n=i.uniformGroups[e.id]||this.createSyncBufferGroup(e,i,t);e.buffer.update(),n(i.uniformData,e.uniforms,this.renderer,jl,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,i.uniformBufferBindings[t])}createSyncBufferGroup(e,t,i){const{gl:n}=this.renderer;this.renderer.buffer.bind(e.buffer);const r=this.gl.getUniformBlockIndex(t.program,i);t.uniformBufferBindings[i]=this.shader.uniformBindCount,n.uniformBlockBinding(t.program,r,this.shader.uniformBindCount),this.shader.uniformBindCount++;const o=this.getSignature(e,this.shader.program.uniformData,"ubo");let a=this._uboCache[o];if(a||(a=this._uboCache[o]=uA(e,this.shader.program.uniformData)),e.autoManage){const c=new Float32Array(a.size/4);e.buffer.update(c)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]}getSignature(e,t,i){const n=e.uniforms,r=[`${i}-`];for(const o in n)r.push(o),t[o]&&r.push(t[o].type);return r.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(e){const t=this.gl,i=e.program,n=oA(t,i);return i.glPrograms[this.renderer.CONTEXT_UID]=n,n}reset(){this.program=null,this.shader=null}disposeShader(e){this.shader===e&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}cb.extension={type:Pe.RendererSystem,name:"shader"};Ne.add(cb);class Kc{constructor(e){this.renderer=e}run(e){const{renderer:t}=this;t.runners.init.emit(t.options),e.hello&&console.log(`PixiJS 7.4.3 - ${t.rendererLogId} - https://pixijs.com`),t.resize(t.screen.width,t.screen.height)}destroy(){}}Kc.defaultOptions={hello:!1},Kc.extension={type:[Pe.RendererSystem,Pe.CanvasRendererSystem],name:"startup"};Ne.add(Kc);function fA(s,e=[]){return e[je.NORMAL]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.ADD]=[s.ONE,s.ONE],e[je.MULTIPLY]=[s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.SCREEN]=[s.ONE,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.OVERLAY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.DARKEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.LIGHTEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.COLOR_DODGE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.COLOR_BURN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.HARD_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.SOFT_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.DIFFERENCE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.EXCLUSION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.HUE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.SATURATION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.COLOR]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.LUMINOSITY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.NONE]=[0,0],e[je.NORMAL_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.ADD_NPM]=[s.SRC_ALPHA,s.ONE,s.ONE,s.ONE],e[je.SCREEN_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[je.SRC_IN]=[s.DST_ALPHA,s.ZERO],e[je.SRC_OUT]=[s.ONE_MINUS_DST_ALPHA,s.ZERO],e[je.SRC_ATOP]=[s.DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],e[je.DST_OVER]=[s.ONE_MINUS_DST_ALPHA,s.ONE],e[je.DST_IN]=[s.ZERO,s.SRC_ALPHA],e[je.DST_OUT]=[s.ZERO,s.ONE_MINUS_SRC_ALPHA],e[je.DST_ATOP]=[s.ONE_MINUS_DST_ALPHA,s.SRC_ALPHA],e[je.XOR]=[s.ONE_MINUS_DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],e[je.SUBTRACT]=[s.ONE,s.ONE,s.ONE,s.ONE,s.FUNC_REVERSE_SUBTRACT,s.FUNC_ADD],e}const mA=0,pA=1,gA=2,vA=3,yA=4,xA=5,hb=class Of{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=je.NONE,this._blendEq=!1,this.map=[],this.map[mA]=this.setBlend,this.map[pA]=this.setOffset,this.map[gA]=this.setCullFace,this.map[vA]=this.setDepthTest,this.map[yA]=this.setFrontFace,this.map[xA]=this.setDepthMask,this.checks=[],this.defaultState=new ln,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=fA(e),this.set(this.defaultState),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let t=this.stateId^e.data,i=0;for(;t;)t&1&&this.map[i].call(this,!!(e.data&1<>1,i++;this.stateId=e.data}for(let t=0;te.systems[n]),i=[...t,...Object.keys(e.systems).filter(n=>!t.includes(n))];for(const n of i)this.addSystem(e.systems[n],n)}addRunners(...e){e.forEach(t=>{this.runners[t]=new Rs(t)})}addSystem(e,t){const i=new e(this);if(this[t])throw new Error(`Whoops! The name "${t}" is already in use`);this[t]=i,this._systemsHash[t]=i;for(const n in this.runners)this.runners[n].add(i);return this}emitWithCustomOptions(e,t){const i=Object.keys(this._systemsHash);e.items.forEach(n=>{const r=i.find(o=>this._systemsHash[o]===n);n[e.name](t[r])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const Pa=class bc{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=bc.defaultMaxIdle,this.checkCountMax=bc.defaultCheckCountMax,this.mode=bc.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==Wm.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this.renderer.texture,t=e.managedTextures;let i=!1;for(let n=0;nthis.maxIdle&&(e.destroyTexture(r,!0),t[n]=null,i=!0)}if(i){let n=0;for(let r=0;r=0;n--)this.unload(e.children[n])}destroy(){this.renderer=null}};Pa.defaultMode=Wm.AUTO,Pa.defaultMaxIdle=3600,Pa.defaultCheckCountMax=600,Pa.extension={type:Pe.RendererSystem,name:"textureGC"};let Lr=Pa;Ne.add(Lr);class Od{constructor(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=De.UNSIGNED_BYTE,this.internalFormat=Se.RGBA,this.samplerType=0}}function SA(s){let e;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?e={[s.RGB]:Oe.FLOAT,[s.RGBA]:Oe.FLOAT,[s.ALPHA]:Oe.FLOAT,[s.LUMINANCE]:Oe.FLOAT,[s.LUMINANCE_ALPHA]:Oe.FLOAT,[s.R8]:Oe.FLOAT,[s.R8_SNORM]:Oe.FLOAT,[s.RG8]:Oe.FLOAT,[s.RG8_SNORM]:Oe.FLOAT,[s.RGB8]:Oe.FLOAT,[s.RGB8_SNORM]:Oe.FLOAT,[s.RGB565]:Oe.FLOAT,[s.RGBA4]:Oe.FLOAT,[s.RGB5_A1]:Oe.FLOAT,[s.RGBA8]:Oe.FLOAT,[s.RGBA8_SNORM]:Oe.FLOAT,[s.RGB10_A2]:Oe.FLOAT,[s.RGB10_A2UI]:Oe.FLOAT,[s.SRGB8]:Oe.FLOAT,[s.SRGB8_ALPHA8]:Oe.FLOAT,[s.R16F]:Oe.FLOAT,[s.RG16F]:Oe.FLOAT,[s.RGB16F]:Oe.FLOAT,[s.RGBA16F]:Oe.FLOAT,[s.R32F]:Oe.FLOAT,[s.RG32F]:Oe.FLOAT,[s.RGB32F]:Oe.FLOAT,[s.RGBA32F]:Oe.FLOAT,[s.R11F_G11F_B10F]:Oe.FLOAT,[s.RGB9_E5]:Oe.FLOAT,[s.R8I]:Oe.INT,[s.R8UI]:Oe.UINT,[s.R16I]:Oe.INT,[s.R16UI]:Oe.UINT,[s.R32I]:Oe.INT,[s.R32UI]:Oe.UINT,[s.RG8I]:Oe.INT,[s.RG8UI]:Oe.UINT,[s.RG16I]:Oe.INT,[s.RG16UI]:Oe.UINT,[s.RG32I]:Oe.INT,[s.RG32UI]:Oe.UINT,[s.RGB8I]:Oe.INT,[s.RGB8UI]:Oe.UINT,[s.RGB16I]:Oe.INT,[s.RGB16UI]:Oe.UINT,[s.RGB32I]:Oe.INT,[s.RGB32UI]:Oe.UINT,[s.RGBA8I]:Oe.INT,[s.RGBA8UI]:Oe.UINT,[s.RGBA16I]:Oe.INT,[s.RGBA16UI]:Oe.UINT,[s.RGBA32I]:Oe.INT,[s.RGBA32UI]:Oe.UINT,[s.DEPTH_COMPONENT16]:Oe.FLOAT,[s.DEPTH_COMPONENT24]:Oe.FLOAT,[s.DEPTH_COMPONENT32F]:Oe.FLOAT,[s.DEPTH_STENCIL]:Oe.FLOAT,[s.DEPTH24_STENCIL8]:Oe.FLOAT,[s.DEPTH32F_STENCIL8]:Oe.FLOAT}:e={[s.RGB]:Oe.FLOAT,[s.RGBA]:Oe.FLOAT,[s.ALPHA]:Oe.FLOAT,[s.LUMINANCE]:Oe.FLOAT,[s.LUMINANCE_ALPHA]:Oe.FLOAT,[s.DEPTH_STENCIL]:Oe.FLOAT},e}function _A(s){let e;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?e={[De.UNSIGNED_BYTE]:{[Se.RGBA]:s.RGBA8,[Se.RGB]:s.RGB8,[Se.RG]:s.RG8,[Se.RED]:s.R8,[Se.RGBA_INTEGER]:s.RGBA8UI,[Se.RGB_INTEGER]:s.RGB8UI,[Se.RG_INTEGER]:s.RG8UI,[Se.RED_INTEGER]:s.R8UI,[Se.ALPHA]:s.ALPHA,[Se.LUMINANCE]:s.LUMINANCE,[Se.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[De.BYTE]:{[Se.RGBA]:s.RGBA8_SNORM,[Se.RGB]:s.RGB8_SNORM,[Se.RG]:s.RG8_SNORM,[Se.RED]:s.R8_SNORM,[Se.RGBA_INTEGER]:s.RGBA8I,[Se.RGB_INTEGER]:s.RGB8I,[Se.RG_INTEGER]:s.RG8I,[Se.RED_INTEGER]:s.R8I},[De.UNSIGNED_SHORT]:{[Se.RGBA_INTEGER]:s.RGBA16UI,[Se.RGB_INTEGER]:s.RGB16UI,[Se.RG_INTEGER]:s.RG16UI,[Se.RED_INTEGER]:s.R16UI,[Se.DEPTH_COMPONENT]:s.DEPTH_COMPONENT16},[De.SHORT]:{[Se.RGBA_INTEGER]:s.RGBA16I,[Se.RGB_INTEGER]:s.RGB16I,[Se.RG_INTEGER]:s.RG16I,[Se.RED_INTEGER]:s.R16I},[De.UNSIGNED_INT]:{[Se.RGBA_INTEGER]:s.RGBA32UI,[Se.RGB_INTEGER]:s.RGB32UI,[Se.RG_INTEGER]:s.RG32UI,[Se.RED_INTEGER]:s.R32UI,[Se.DEPTH_COMPONENT]:s.DEPTH_COMPONENT24},[De.INT]:{[Se.RGBA_INTEGER]:s.RGBA32I,[Se.RGB_INTEGER]:s.RGB32I,[Se.RG_INTEGER]:s.RG32I,[Se.RED_INTEGER]:s.R32I},[De.FLOAT]:{[Se.RGBA]:s.RGBA32F,[Se.RGB]:s.RGB32F,[Se.RG]:s.RG32F,[Se.RED]:s.R32F,[Se.DEPTH_COMPONENT]:s.DEPTH_COMPONENT32F},[De.HALF_FLOAT]:{[Se.RGBA]:s.RGBA16F,[Se.RGB]:s.RGB16F,[Se.RG]:s.RG16F,[Se.RED]:s.R16F},[De.UNSIGNED_SHORT_5_6_5]:{[Se.RGB]:s.RGB565},[De.UNSIGNED_SHORT_4_4_4_4]:{[Se.RGBA]:s.RGBA4},[De.UNSIGNED_SHORT_5_5_5_1]:{[Se.RGBA]:s.RGB5_A1},[De.UNSIGNED_INT_2_10_10_10_REV]:{[Se.RGBA]:s.RGB10_A2,[Se.RGBA_INTEGER]:s.RGB10_A2UI},[De.UNSIGNED_INT_10F_11F_11F_REV]:{[Se.RGB]:s.R11F_G11F_B10F},[De.UNSIGNED_INT_5_9_9_9_REV]:{[Se.RGB]:s.RGB9_E5},[De.UNSIGNED_INT_24_8]:{[Se.DEPTH_STENCIL]:s.DEPTH24_STENCIL8},[De.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[Se.DEPTH_STENCIL]:s.DEPTH32F_STENCIL8}}:e={[De.UNSIGNED_BYTE]:{[Se.RGBA]:s.RGBA,[Se.RGB]:s.RGB,[Se.ALPHA]:s.ALPHA,[Se.LUMINANCE]:s.LUMINANCE,[Se.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[De.UNSIGNED_SHORT_5_6_5]:{[Se.RGB]:s.RGB},[De.UNSIGNED_SHORT_4_4_4_4]:{[Se.RGBA]:s.RGBA},[De.UNSIGNED_SHORT_5_5_5_1]:{[Se.RGBA]:s.RGBA}},e}class ub{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Je,this.hasIntegerTextures=!1}contextChange(){const e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=_A(e),this.samplerTypes=SA(e);const t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(let n=0;n=0;--r){const o=t[r];o&&o._glTextures[n].samplerType!==Oe.FLOAT&&this.renderer.texture.unbind(o)}}initTexture(e){const t=new Od(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t}initTextureType(e,t){var i;t.internalFormat=((i=this.internalFormats[e.type])==null?void 0:i[e.format])??e.format,t.samplerType=this.samplerTypes[t.internalFormat]??Oe.FLOAT,this.webGLVersion===2&&e.type===De.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type}updateTexture(e){var n;const t=e._glTextures[this.CONTEXT_UID];if(!t)return;const i=this.renderer;if(this.initTextureType(e,t),(n=e.resource)==null?void 0:n.upload(i,e,t))t.samplerType!==Oe.FLOAT&&(this.hasIntegerTextures=!0);else{const r=e.realWidth,o=e.realHeight,a=i.gl;(t.width!==r||t.height!==o||t.dirtyId<0)&&(t.width=r,t.height=o,a.texImage2D(e.target,0,t.internalFormat,r,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}destroyTexture(e,t){const{gl:i}=this;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),i.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){const n=this.managedTextures.indexOf(e);n!==-1&&Xo(this.managedTextures,n,1)}}updateTextureStyle(e){var i;const t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===gs.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Is.CLAMP:t.wrapMode=e.wrapMode,(i=e.resource)!=null&&i.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)}setStyle(e,t){const i=this.gl;if(t.mipmap&&e.mipmap!==gs.ON_MANUAL&&i.generateMipmap(e.target),i.texParameteri(e.target,i.TEXTURE_WRAP_S,t.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===Cs.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===Cs.LINEAR){const r=Math.min(e.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,r)}}else i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===Cs.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===Cs.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}ub.extension={type:Pe.RendererSystem,name:"texture"};Ne.add(ub);class db{constructor(e){this.renderer=e}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:t,CONTEXT_UID:i}=this,n=e._glTransformFeedbacks[i]||this.createGLTransformFeedback(e);t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,n)}unbind(){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(e,t){const{gl:i,renderer:n}=this;t&&n.shader.bind(t),i.beginTransformFeedback(e)}endTransformFeedback(){const{gl:e}=this;e.endTransformFeedback()}createGLTransformFeedback(e){const{gl:t,renderer:i,CONTEXT_UID:n}=this,r=t.createTransformFeedback();e._glTransformFeedbacks[n]=r,t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,r);for(let o=0;o(s[s.INTERACTION=50]="INTERACTION",s[s.HIGH=25]="HIGH",s[s.NORMAL=0]="NORMAL",s[s.LOW=-25]="LOW",s[s.UTILITY=-50]="UTILITY",s))(to||{});class Bd{constructor(e,t=null,i=0,n=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=i,this.once=n}match(e,t=null){return this.fn===e&&this.context===t}emit(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));const t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const t=this.next;return this.next=e?null:t,this.previous=null,t}}const fb=class Ji{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Bd(null,null,1/0),this.deltaMS=1/Ji.targetFPMS,this.elapsedMS=1/Ji.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,i=to.NORMAL){return this._addListener(new Bd(e,t,i))}addOnce(e,t,i=to.NORMAL){return this._addListener(new Bd(e,t,i,!0))}_addListener(e){let t=this._head.next,i=this._head;if(!t)e.connect(i);else{for(;t;){if(e.priority>t.priority){e.connect(i);break}i=t,t=t.next}e.previous||e.connect(i)}return this._startIfPossible(),this}remove(e,t){let i=this._head.next;for(;i;)i.match(e,t)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){const r=e-this._lastFrame|0;if(r{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?$i.shared:new $i,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}mb.extension=Pe.Application;Ne.add(mb);const pb=[];Ne.handleByList(Pe.Renderer,pb);function TA(s){for(const e of pb)if(e.test(s))return new e(s);throw new Error("Unable to auto-detect a suitable renderer.")}var MA=`attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; @@ -545,7 +545,7 @@ void main(void) gl_Position = filterVertexPosition(); vTextureCoord = filterTextureCoord(); } -`;const AA=MA,g1=CA;class v1{constructor(e){this.renderer=e}contextChange(e){let t;if(this.renderer.context.webGLVersion===1){const i=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,i)}else{const i=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,i)}t>=ni.HIGH?this.multisample=ni.HIGH:t>=ni.MEDIUM?this.multisample=ni.MEDIUM:t>=ni.LOW?this.multisample=ni.LOW:this.multisample=ni.NONE}destroy(){}}v1.extension={type:Pe.RendererSystem,name:"_multisample"};Ne.add(v1);class EA{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class y1{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:t,CONTEXT_UID:i}=this,n=e._glBuffers[i]||this.createGLBuffer(e);t.bindBuffer(e.type,n.buffer)}unbind(e){const{gl:t}=this;t.bindBuffer(e,null)}bindBufferBase(e,t){const{gl:i,CONTEXT_UID:n}=this;if(this.boundBufferBases[t]!==e){const r=e._glBuffers[n]||this.createGLBuffer(e);this.boundBufferBases[t]=e,i.bindBufferBase(i.UNIFORM_BUFFER,t,r.buffer)}}bindBufferRange(e,t,i){const{gl:n,CONTEXT_UID:r}=this;i=i||0;const o=e._glBuffers[r]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,t||0,o.buffer,i*256,256)}update(e){const{gl:t,CONTEXT_UID:i}=this,n=e._glBuffers[i]||this.createGLBuffer(e);if(e._updateID!==n.updateID)if(n.updateID=e._updateID,t.bindBuffer(e.type,n.buffer),n.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{const r=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,r)}}dispose(e,t){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];const i=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),i&&(t||n.deleteBuffer(i.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){const t=Object.keys(this.managedBuffers);for(let i=0;it.resource).filter(t=>t).map(t=>t.load());return this._load=Promise.all(e).then(()=>{const{realWidth:t,realHeight:i}=this.items[0];return this.resize(t,i),this.update(),Promise.resolve(this)}),this._load}}class IA extends b1{constructor(e,t){const{width:i,height:n}=t||{};let r,o;Array.isArray(e)?(r=e,o=e.length):o=e,super(o,{width:i,height:n}),r&&this.initFromArray(r,t)}addBaseTextureAt(e,t){if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=$o.TEXTURE_2D_ARRAY}upload(e,t,i){const{length:n,itemDirtyIds:r,items:o}=this,{gl:a}=e;i.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,n,0,t.format,i.type,null);for(let c=0;c0)if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=$o.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this}upload(e,t,i){const n=this.itemDirtyIds;for(let r=0;r{if(this.url===null){e(this);return}try{const i=await ke.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const n=await i.blob();if(this.destroyed)return;const r=await createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===mi.UNPACK?"premultiply":"none"});if(this.destroyed){r.close();return}this.source=r,this.update(),e(this)}catch(i){if(this.destroyed)return;t(i),this.onError.emit(i)}}),this._load)}upload(e,t,i){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),super.upload(e,t,i)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return Po._EMPTY=Po._EMPTY??ke.ADAPTER.createCanvas(0,0),Po._EMPTY}}const Lf=class Sc extends Nn{constructor(e,t){t=t||{},super(ke.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.update(),e(this)},Sc.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const e=new Image;Nn.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{this._resolve&&(e.onerror=null,this.onError.emit(t))},e.onload=()=>{if(!this._resolve)return;const t=e.width,i=e.height;if(!t||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=t*this.scale,r=i*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/i*t,r=this._overrideHeight||this._overrideWidth/t*i),n=Math.round(n),r=Math.round(r);const o=this.source;o.width=n,o.height=r,o._pixiId=`canvas_${eo()}`,o.getContext("2d").drawImage(e,0,0,t,i,0,0,n,r),this._resolve(),this._resolve=null}}static getSize(e){const t=Sc.SVG_SIZE.exec(e),i={};return t&&(i[t[1]]=Math.round(parseFloat(t[3])),i[t[5]]=Math.round(parseFloat(t[7]))),i}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,t){return t==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&Sc.SVG_XML.test(e)}};Lf.SVG_XML=/^(<\?xml[^?]+\?>)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let Df=Lf;class kA extends Nn{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}}const Nf=class Uf extends Nn{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){const i=document.createElement("video");t.autoLoad!==!1&&i.setAttribute("preload","auto"),t.playsinline!==!1&&(i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","")),t.muted===!0&&(i.setAttribute("muted",""),i.muted=!0),t.loop===!0&&i.setAttribute("loop",""),t.autoPlay!==!1&&i.setAttribute("autoplay",""),typeof e=="string"&&(e=[e]);const n=e[0].src||e[0];Nn.crossOrigin(i,n,t.crossorigin);for(let r=0;r{this.valid?t(this):(this._resolve=t,this._reject=i,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.source;return!e.paused&&!e.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const t=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!t&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._configureAutoUpdate();const e=this.source;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&($i.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||($i.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&($i.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||Uf.TYPES.includes(t)}};Nf.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Nf.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let S1=Nf;Mf.push(Po,zx,RA,S1,kA,Df,Kh,PA,IA);class al{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(e){return this.minX>this.maxX||this.minY>this.maxY?nt.EMPTY:(e=e||new nt(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)}addPoint(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)}addPointMatrix(e,t){const{a:i,b:n,c:r,d:o,tx:a,ty:c}=e,l=i*t.x+r*t.y+a,h=n*t.x+o*t.y+c;this.minX=Math.min(this.minX,l),this.maxX=Math.max(this.maxX,l),this.minY=Math.min(this.minY,h),this.maxY=Math.max(this.maxY,h)}addQuad(e){let t=this.minX,i=this.minY,n=this.maxX,r=this.maxY,o=e[0],a=e[1];t=on?o:n,r=a>r?a:r,o=e[2],a=e[3],t=on?o:n,r=a>r?a:r,o=e[4],a=e[5],t=on?o:n,r=a>r?a:r,o=e[6],a=e[7],t=on?o:n,r=a>r?a:r,this.minX=t,this.minY=i,this.maxX=n,this.maxY=r}addFrame(e,t,i,n,r){this.addFrameMatrix(e.worldTransform,t,i,n,r)}addFrameMatrix(e,t,i,n,r){const o=e.a,a=e.b,c=e.c,l=e.d,h=e.tx,u=e.ty;let d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,g=o*t+c*i+h,v=a*t+l*i+u;d=gp?g:p,m=v>m?v:m,g=o*n+c*i+h,v=a*n+l*i+u,d=gp?g:p,m=v>m?v:m,g=o*t+c*r+h,v=a*t+l*r+u,d=gp?g:p,m=v>m?v:m,g=o*n+c*r+h,v=a*n+l*r+u,d=gp?g:p,m=v>m?v:m,this.minX=d,this.minY=f,this.maxX=p,this.maxY=m}addVertexData(e,t,i){let n=this.minX,r=this.minY,o=this.maxX,a=this.maxY;for(let c=t;co?l:o,a=h>a?h:a}this.minX=n,this.minY=r,this.maxX=o,this.maxY=a}addVertices(e,t,i,n){this.addVerticesMatrix(e.worldTransform,t,i,n)}addVerticesMatrix(e,t,i,n,r=0,o=r){const a=e.a,c=e.b,l=e.c,h=e.d,u=e.tx,d=e.ty;let f=this.minX,p=this.minY,m=this.maxX,g=this.maxY;for(let v=i;vn?e.maxX:n,this.maxY=e.maxY>r?e.maxY:r}addBoundsMask(e,t){const i=e.minX>t.minX?e.minX:t.minX,n=e.minY>t.minY?e.minY:t.minY,r=e.maxXl?r:l,this.maxY=o>h?o:h}}addBoundsMatrix(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)}addBoundsArea(e,t){const i=e.minX>t.x?e.minX:t.x,n=e.minY>t.y?e.minY:t.y,r=e.maxXl?r:l,this.maxY=o>h?o:h}}pad(e=0,t=e){this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)}addFramePad(e,t,i,n,r,o){e-=r,t-=o,i+=r,n+=o,this.minX=this.minXi?this.maxX:i,this.minY=this.minYn?this.maxY:n}}class Wt extends yl{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Zm,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new al,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(e){const t=Object.keys(e);for(let i=0;i1)for(let t=0;tthis.children.length)throw new Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${this.children.length}`);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e}swapChildren(e,t){if(e===t)return;const i=this.getChildIndex(e),n=this.getChildIndex(t);this.children[i]=t,this.children[n]=e,this.onChildrenChange(i=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);const i=this.getChildIndex(e);Xo(this.children,i,1),this.children.splice(t,0,e),this.onChildrenChange(t)}getChildAt(e){if(e<0||e>=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]}removeChild(...e){if(e.length>1)for(let t=0;t0&&r<=n){o=this.children.splice(i,r);for(let a=0;a1&&this.children.sort(BA),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let e=0,t=this.children.length;e0&&t.height>0))return;let i,n;this.cullArea?(i=this.cullArea,n=this.worldTransform):this._render!==$f.prototype._render&&(i=this.getBounds(!0));const r=e.projection.transform;if(r&&(n?(n=OA.copyFrom(n),n.prepend(r)):n=r),i&&t.intersects(i,n))this._render(e);else if(this.cullArea)return;for(let o=0,a=this.children.length;o=n&&Sa.x=r&&Sa.y=ni.HIGH?this.multisample=ni.HIGH:t>=ni.MEDIUM?this.multisample=ni.MEDIUM:t>=ni.LOW?this.multisample=ni.LOW:this.multisample=ni.NONE}destroy(){}}vb.extension={type:Pe.RendererSystem,name:"_multisample"};Ne.add(vb);class EA{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class yb{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:t,CONTEXT_UID:i}=this,n=e._glBuffers[i]||this.createGLBuffer(e);t.bindBuffer(e.type,n.buffer)}unbind(e){const{gl:t}=this;t.bindBuffer(e,null)}bindBufferBase(e,t){const{gl:i,CONTEXT_UID:n}=this;if(this.boundBufferBases[t]!==e){const r=e._glBuffers[n]||this.createGLBuffer(e);this.boundBufferBases[t]=e,i.bindBufferBase(i.UNIFORM_BUFFER,t,r.buffer)}}bindBufferRange(e,t,i){const{gl:n,CONTEXT_UID:r}=this;i=i||0;const o=e._glBuffers[r]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,t||0,o.buffer,i*256,256)}update(e){const{gl:t,CONTEXT_UID:i}=this,n=e._glBuffers[i]||this.createGLBuffer(e);if(e._updateID!==n.updateID)if(n.updateID=e._updateID,t.bindBuffer(e.type,n.buffer),n.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{const r=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,r)}}dispose(e,t){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];const i=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),i&&(t||n.deleteBuffer(i.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){const t=Object.keys(this.managedBuffers);for(let i=0;it.resource).filter(t=>t).map(t=>t.load());return this._load=Promise.all(e).then(()=>{const{realWidth:t,realHeight:i}=this.items[0];return this.resize(t,i),this.update(),Promise.resolve(this)}),this._load}}class IA extends bb{constructor(e,t){const{width:i,height:n}=t||{};let r,o;Array.isArray(e)?(r=e,o=e.length):o=e,super(o,{width:i,height:n}),r&&this.initFromArray(r,t)}addBaseTextureAt(e,t){if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=$o.TEXTURE_2D_ARRAY}upload(e,t,i){const{length:n,itemDirtyIds:r,items:o}=this,{gl:a}=e;i.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,n,0,t.format,i.type,null);for(let c=0;c0)if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=$o.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this}upload(e,t,i){const n=this.itemDirtyIds;for(let r=0;r{if(this.url===null){e(this);return}try{const i=await ke.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const n=await i.blob();if(this.destroyed)return;const r=await createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===mi.UNPACK?"premultiply":"none"});if(this.destroyed){r.close();return}this.source=r,this.update(),e(this)}catch(i){if(this.destroyed)return;t(i),this.onError.emit(i)}}),this._load)}upload(e,t,i){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),super.upload(e,t,i)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return Po._EMPTY=Po._EMPTY??ke.ADAPTER.createCanvas(0,0),Po._EMPTY}}const Lf=class Sc extends Nn{constructor(e,t){t=t||{},super(ke.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.update(),e(this)},Sc.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const e=new Image;Nn.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{this._resolve&&(e.onerror=null,this.onError.emit(t))},e.onload=()=>{if(!this._resolve)return;const t=e.width,i=e.height;if(!t||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=t*this.scale,r=i*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/i*t,r=this._overrideHeight||this._overrideWidth/t*i),n=Math.round(n),r=Math.round(r);const o=this.source;o.width=n,o.height=r,o._pixiId=`canvas_${eo()}`,o.getContext("2d").drawImage(e,0,0,t,i,0,0,n,r),this._resolve(),this._resolve=null}}static getSize(e){const t=Sc.SVG_SIZE.exec(e),i={};return t&&(i[t[1]]=Math.round(parseFloat(t[3])),i[t[5]]=Math.round(parseFloat(t[7]))),i}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,t){return t==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&Sc.SVG_XML.test(e)}};Lf.SVG_XML=/^(<\?xml[^?]+\?>)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let Df=Lf;class kA extends Nn{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}}const Nf=class Uf extends Nn{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){const i=document.createElement("video");t.autoLoad!==!1&&i.setAttribute("preload","auto"),t.playsinline!==!1&&(i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","")),t.muted===!0&&(i.setAttribute("muted",""),i.muted=!0),t.loop===!0&&i.setAttribute("loop",""),t.autoPlay!==!1&&i.setAttribute("autoplay",""),typeof e=="string"&&(e=[e]);const n=e[0].src||e[0];Nn.crossOrigin(i,n,t.crossorigin);for(let r=0;r{this.valid?t(this):(this._resolve=t,this._reject=i,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.source;return!e.paused&&!e.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const t=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!t&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._configureAutoUpdate();const e=this.source;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&($i.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||($i.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&($i.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||Uf.TYPES.includes(t)}};Nf.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Nf.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Sb=Nf;Mf.push(Po,zx,RA,Sb,kA,Df,Kh,PA,IA);class al{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(e){return this.minX>this.maxX||this.minY>this.maxY?nt.EMPTY:(e=e||new nt(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)}addPoint(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)}addPointMatrix(e,t){const{a:i,b:n,c:r,d:o,tx:a,ty:c}=e,l=i*t.x+r*t.y+a,h=n*t.x+o*t.y+c;this.minX=Math.min(this.minX,l),this.maxX=Math.max(this.maxX,l),this.minY=Math.min(this.minY,h),this.maxY=Math.max(this.maxY,h)}addQuad(e){let t=this.minX,i=this.minY,n=this.maxX,r=this.maxY,o=e[0],a=e[1];t=on?o:n,r=a>r?a:r,o=e[2],a=e[3],t=on?o:n,r=a>r?a:r,o=e[4],a=e[5],t=on?o:n,r=a>r?a:r,o=e[6],a=e[7],t=on?o:n,r=a>r?a:r,this.minX=t,this.minY=i,this.maxX=n,this.maxY=r}addFrame(e,t,i,n,r){this.addFrameMatrix(e.worldTransform,t,i,n,r)}addFrameMatrix(e,t,i,n,r){const o=e.a,a=e.b,c=e.c,l=e.d,h=e.tx,u=e.ty;let d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,g=o*t+c*i+h,v=a*t+l*i+u;d=gp?g:p,m=v>m?v:m,g=o*n+c*i+h,v=a*n+l*i+u,d=gp?g:p,m=v>m?v:m,g=o*t+c*r+h,v=a*t+l*r+u,d=gp?g:p,m=v>m?v:m,g=o*n+c*r+h,v=a*n+l*r+u,d=gp?g:p,m=v>m?v:m,this.minX=d,this.minY=f,this.maxX=p,this.maxY=m}addVertexData(e,t,i){let n=this.minX,r=this.minY,o=this.maxX,a=this.maxY;for(let c=t;co?l:o,a=h>a?h:a}this.minX=n,this.minY=r,this.maxX=o,this.maxY=a}addVertices(e,t,i,n){this.addVerticesMatrix(e.worldTransform,t,i,n)}addVerticesMatrix(e,t,i,n,r=0,o=r){const a=e.a,c=e.b,l=e.c,h=e.d,u=e.tx,d=e.ty;let f=this.minX,p=this.minY,m=this.maxX,g=this.maxY;for(let v=i;vn?e.maxX:n,this.maxY=e.maxY>r?e.maxY:r}addBoundsMask(e,t){const i=e.minX>t.minX?e.minX:t.minX,n=e.minY>t.minY?e.minY:t.minY,r=e.maxXl?r:l,this.maxY=o>h?o:h}}addBoundsMatrix(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)}addBoundsArea(e,t){const i=e.minX>t.x?e.minX:t.x,n=e.minY>t.y?e.minY:t.y,r=e.maxXl?r:l,this.maxY=o>h?o:h}}pad(e=0,t=e){this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)}addFramePad(e,t,i,n,r,o){e-=r,t-=o,i+=r,n+=o,this.minX=this.minXi?this.maxX:i,this.minY=this.minYn?this.maxY:n}}class Wt extends yl{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Zm,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new al,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(e){const t=Object.keys(e);for(let i=0;i1)for(let t=0;tthis.children.length)throw new Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${this.children.length}`);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e}swapChildren(e,t){if(e===t)return;const i=this.getChildIndex(e),n=this.getChildIndex(t);this.children[i]=t,this.children[n]=e,this.onChildrenChange(i=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);const i=this.getChildIndex(e);Xo(this.children,i,1),this.children.splice(t,0,e),this.onChildrenChange(t)}getChildAt(e){if(e<0||e>=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]}removeChild(...e){if(e.length>1)for(let t=0;t0&&r<=n){o=this.children.splice(i,r);for(let a=0;a1&&this.children.sort(BA),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let e=0,t=this.children.length;e0&&t.height>0))return;let i,n;this.cullArea?(i=this.cullArea,n=this.worldTransform):this._render!==$f.prototype._render&&(i=this.getBounds(!0));const r=e.projection.transform;if(r&&(n?(n=OA.copyFrom(n),n.prepend(r)):n=r),i&&t.intersects(i,n))this._render(e);else if(this.cullArea)return;for(let o=0,a=this.children.length;o=n&&Sa.x=r&&Sa.y{Object.defineProperty(Y0,s,{get(){return ct("7.1.0",`filters.${s} has moved to ${s}`),e}})});class tE{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this.tickerAdded||!this.domElement||($i.system.add(this.tickerUpdate,this,to.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&($i.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events.rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY}))}tickerUpdate(e){this._deltaTime+=e,!(this._deltaTimei.priority-n.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let i=0,n=t.length;i=0;n--)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let r=i.length-1;r>=0;r--)n.forEach(o=>{e.currentTarget=i[r],this.notifyTarget(e,o)})}propagationPath(e){const t=[e];for(let i=0;i=0;u--){const d=h[u],f=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,n,r,o||r(e,i));if(f){if(f.length>0&&!f[f.length-1].parent)continue;const p=e.isInteractive();(f.length>0||p)&&(p&&this._allInteractiveElements.push(e),f.push(e)),this._hitElements.length===0&&(this._hitElements=f),a=!0}}}const c=this._isInteractive(t),l=e.isInteractive();return c&&l&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:a?this._hitElements:c&&!r(e,i)&&n(e,i)?l?[e]:[]:null}hitTestRecursive(e,t,i,n,r){if(this._interactivePrune(e)||r(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(tr.pauseUpdate=!1),e.interactiveChildren&&e.children){const c=e.children;for(let l=c.length-1;l>=0;l--){const h=c[l],u=this.hitTestRecursive(h,this._isInteractive(t)?t:h.eventMode,i,n,r);if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=e.isInteractive();return(u.length>0||d)&&u.push(e),u}}}const o=this._isInteractive(t),a=e.isInteractive();return o&&n(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!!(!e||e.isMask||!e.visible||!e.renderable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren||e.isMask)}hitPruneFn(e,t){var i;if(e.hitArea&&(e.worldTransform.applyInverse(t,Ld),!e.hitArea.contains(Ld.x,Ld.y)))return!0;if(e._mask){const n=e._mask.isMaskData?e._mask.maskObject:e._mask;if(n&&!((i=n.containsPoint)!=null&&i.call(n,t)))return!0}return!1}hitTestFn(e,t){return e.eventMode==="passive"?!1:e.hitArea?!0:e.containsPoint?e.containsPoint(t):!1}notifyTarget(e,t){var r,o;t=t??e.type;const i=`on${t}`;(o=(r=e.currentTarget)[i])==null||o.call(r,e);const n=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this.notifyListeners(e,n),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof Ss)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){const n=t.button===2;this.dispatchEvent(t,n?"rightdown":"mousedown")}const i=this.trackingData(e.pointerId);i.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){var c,l;if(!(e instanceof Ss)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const i=t.pointerType==="mouse"||t.pointerType==="pen",n=this.trackingData(e.pointerId),r=this.findMountedTarget(n.overTargets);if(((c=n.overTargets)==null?void 0:c.length)>0&&r!==t.target){const h=e.type==="mousemove"?"mouseout":"pointerout",u=this.createPointerEvent(e,h,r);if(this.dispatchEvent(u,"pointerout"),i&&this.dispatchEvent(u,"mouseout"),!t.composedPath().includes(r)){const d=this.createPointerEvent(e,"pointerleave",r);for(d.eventPhase=d.AT_TARGET;d.target&&!t.composedPath().includes(d.target);)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseleave"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(u)}if(r!==t.target){const h=e.type==="mousemove"?"mouseover":"pointerover",u=this.clonePointerEvent(t,h);this.dispatchEvent(u,"pointerover"),i&&this.dispatchEvent(u,"mouseover");let d=r==null?void 0:r.parent;for(;d&&d!==this.rootTarget.parent&&d!==t.target;)d=d.parent;if(!d||d===this.rootTarget.parent){const f=this.clonePointerEvent(t,"pointerenter");for(f.eventPhase=f.AT_TARGET;f.target&&f.target!==r&&f.target!==this.rootTarget.parent;)f.currentTarget=f.target,this.notifyTarget(f),i&&this.notifyTarget(f,"mouseenter"),f.target=f.target.parent;this.freeEvent(f)}this.freeEvent(u)}const o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&o.push("globalmousemove"),this.cursor=(l=t.target)==null?void 0:l.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){var o;if(!(e instanceof Ss)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=(o=i.target)==null?void 0:o.cursor);const r=this.clonePointerEvent(i,"pointerenter");for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),n&&this.notifyTarget(r,"mouseenter"),r.target=r.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(r)}mapPointerOut(e){if(!(e instanceof Ss)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),r=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(r),i&&this.dispatchEvent(r,"mouseout");const o=this.createPointerEvent(e,"pointerleave",n);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(r),this.freeEvent(o)}this.cursor=null}mapPointerUp(e){if(!(e instanceof Ss)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),r=this.findMountedTarget(n.pressTargetsByButton[e.button]);let o=r;if(r&&!i.composedPath().includes(r)){let a=r;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const c=i.button===2;this.notifyTarget(i,c?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[e.button],o=a}if(o){const a=this.clonePointerEvent(i,"click");a.target=o,a.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});const c=n.clicksByButton[e.button];if(c.target===a.target&&t-c.timeStamp<200?++c.clickCount:c.clickCount=1,c.target=a.target,c.timeStamp=t,a.detail=c.clickCount,a.pointerType==="mouse"){const l=a.button===2;this.dispatchEvent(a,l?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof Ss)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(i){let r=i;for(;r;)n.currentTarget=r,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),r=r.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(n)}mapWheel(e){if(!(e instanceof Yo)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[i]=n,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{view:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,Gf._defaultEventMode=e.eventMode??"auto",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this.currentCursor===e)return;this.currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this.rootPointerEvent}onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this.normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,n=t.length;i0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",n=this.normalizeToPointerData(e);for(let r=0,o=n.length;r"u"&&(r.button=0),typeof r.buttons>"u"&&(r.buttons=1),typeof r.isPrimary>"u"&&(r.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof r.width>"u"&&(r.width=r.radiusX||1),typeof r.height>"u"&&(r.height=r.radiusY||1),typeof r.tiltX>"u"&&(r.tiltX=0),typeof r.tiltY>"u"&&(r.tiltY=0),typeof r.pointerType>"u"&&(r.pointerType="touch"),typeof r.pointerId>"u"&&(r.pointerId=r.identifier||0),typeof r.pressure>"u"&&(r.pressure=r.force||.5),typeof r.twist>"u"&&(r.twist=0),typeof r.tangentialPressure>"u"&&(r.tangentialPressure=0),typeof r.layerX>"u"&&(r.layerX=r.offsetX=r.clientX),typeof r.layerY>"u"&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=e.type,t.push(r)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=rE),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,t.push(i)}else t.push(e);return t}normalizeWheelEvent(e){const t=this.rootWheelEvent;return this.transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this.transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=oE[e.type]||e.type),e}transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};Yf.extension={name:"events",type:[Pe.RendererSystem,Pe.CanvasRendererSystem]},Yf.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let Hf=Yf;Ne.add(Hf);function G0(s){return s==="dynamic"||s==="static"}const aE={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??G0(Hf.defaultEventMode)},set interactive(s){ct("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=s,this.eventMode=s?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??Hf.defaultEventMode},set eventMode(s){this._internalInteractive=G0(s),this._internalEventMode=s},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(s,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof t=="object"?t.signal:void 0,r=typeof t=="object"?t.once===!0:!1,o=typeof e=="function"?void 0:e;s=i?`${s}capture`:s;const a=typeof e=="function"?e:e.handleEvent,c=this;n&&n.addEventListener("abort",()=>{c.off(s,a,o)}),r?c.once(s,a,o):c.on(s,a,o)},removeEventListener(s,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;s=i?`${s}capture`:s,e=typeof e=="function"?e:e.handleEvent,this.off(s,e,n)},dispatchEvent(s){if(!(s instanceof xl))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return s.defaultPrevented=!1,s.path=null,s.target=this,s.manager.dispatchEvent(s),!s.defaultPrevented}};Wt.mixin(aE);const lE={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Wt.mixin(lE);const cE=9,Wl=100,hE=0,uE=0,H0=2,j0=1,dE=-1e3,fE=-1e3,mE=2;class M1{constructor(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(Tn.tablet||Tn.phone)&&this.createTouchHook();const t=document.createElement("div");t.style.width=`${Wl}px`,t.style.height=`${Wl}px`,t.style.position="absolute",t.style.top=`${hE}px`,t.style.left=`${uE}px`,t.style.zIndex=H0.toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const e=document.createElement("button");e.style.width=`${j0}px`,e.style.height=`${j0}px`,e.style.position="absolute",e.style.top=`${dE}px`,e.style.left=`${fE}px`,e.style.zIndex=mE.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(e=this.renderer.view.parentNode)==null||e.appendChild(this.div))}deactivate(){var e;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(e=this.div.parentNode)==null||e.removeChild(this.div))}updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);const t=e.children;if(t)for(let i=0;i title : ${e.title}
tabIndex: ${e.tabIndex}`}capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this.renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}addChild(e){let t=this.pool.pop();t||(t=document.createElement("button"),t.style.width=`${Wl}px`,t.style.height=`${Wl}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=H0.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`displayObject ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){const{displayObject:i}=e.target,n=this.renderer.events.rootBoundary,r=Object.assign(new xl(n),{target:i});n.rootTarget=this.renderer.lastObjectRendered,t.forEach(o=>n.dispatchEvent(r,o))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode===cE&&this.activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}M1.extension={name:"accessibility",type:[Pe.RendererPlugin,Pe.CanvasRendererPlugin]};Ne.add(M1);const C1=class jf{constructor(e){this.stage=new Si,e=Object.assign({forceCanvas:!1},e),this.renderer=TA(e),jf._plugins.forEach(t=>{t.init.call(this,e)})}render(){this.renderer.render(this.stage)}get view(){var e;return(e=this.renderer)==null?void 0:e.view}get screen(){var e;return(e=this.renderer)==null?void 0:e.screen}destroy(e,t){const i=jf._plugins.slice(0);i.reverse(),i.forEach(n=>{n.destroy.call(this)}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null}};C1._plugins=[];let A1=C1;Ne.handleByList(Pe.Application,A1._plugins);class E1{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let t,i;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:n,clientHeight:r}=this._resizeTo;t=n,i=r}this.renderer.resize(t,i),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}E1.extension=Pe.Application;Ne.add(E1);const W0={loader:Pe.LoadParser,resolver:Pe.ResolveParser,cache:Pe.CacheParser,detection:Pe.DetectionParser};Ne.handle(Pe.Asset,s=>{const e=s.ref;Object.entries(W0).filter(([t])=>!!e[t]).forEach(([t,i])=>Ne.add(Object.assign(e[t],{extension:e[t].extension??i})))},s=>{const e=s.ref;Object.keys(W0).filter(t=>!!e[t]).forEach(t=>Ne.remove(e[t]))});class pE{constructor(e,t=!1){this._loader=e,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=t}add(e){e.forEach(t=>{this._assetList.push(t)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const e=[],t=Math.min(this._assetList.length,this._maxConcurrent);for(let i=0;i(Array.isArray(s)||(s=[s]),e?s.map(i=>typeof i=="string"||t?e(i):i):s),Qc=(s,e)=>{const t=e.split("?")[1];return t&&(s+=`?${t}`),s};function I1(s,e,t,i,n){const r=e[t];for(let o=0;o{const o=r.substring(1,r.length-1).split(",");n.push(o)}),I1(s,n,0,t,i)}else i.push(s);return i}const eh=s=>!Array.isArray(s);class vE{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){const t=this._cache.get(e);return t||console.warn(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){const i=Ts(e);let n;for(let a=0;a{n[a]=t}));const r=Object.keys(n),o={cacheKeys:r,keys:i};if(i.forEach(a=>{this._cacheMap.set(a,o)}),r.forEach(a=>{const c=n?n[a]:t;this._cache.has(a)&&this._cache.get(a)!==c&&console.warn("[Cache] already has key:",a),this._cache.set(a,n[a])}),t instanceof ze){const a=t;i.forEach(c=>{a.baseTexture!==ze.EMPTY.baseTexture&&Je.addToCache(a.baseTexture,c),ze.addToCache(a,c)})}}remove(e){if(!this._cacheMap.has(e)){console.warn(`[Assets] Asset id ${e} was not found in the Cache`);return}const t=this._cacheMap.get(e);t.cacheKeys.forEach(i=>{this._cache.delete(i)}),t.keys.forEach(i=>{this._cacheMap.delete(i)})}get parsers(){return this._parsers}}const Nr=new vE;class yE{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(e,t,i)=>(this._parsersValidated=!1,e[t]=i,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(e,t){const i={promise:null,parser:null};return i.promise=(async()=>{var o,a;let n=null,r=null;if(t.loadParser&&(r=this._parserHash[t.loadParser],r||console.warn(`[Assets] specified load parser "${t.loadParser}" not found while loading ${e}`)),!r){for(let c=0;c({alias:[l],src:l})),a=o.length,c=o.map(async l=>{const h=Zt.toAbsolute(l.src);if(!n[l.src])try{this.promiseCache[h]||(this.promiseCache[h]=this._getLoadPromiseAndParser(h,l)),n[l.src]=await this.promiseCache[h].promise,t&&t(++i/a)}catch(u){throw delete this.promiseCache[h],delete n[l.src],new Error(`[Loader.load] Failed to load ${h}. +`;class eE extends Ui{constructor(e=.5,t=Math.random()){super(gb,QA,{uNoise:0,uSeed:0}),this.noise=e,this.seed=t}get noise(){return this.uniforms.uNoise}set noise(e){this.uniforms.uNoise=e}get seed(){return this.uniforms.uSeed}set seed(e){this.uniforms.uSeed=e}}const Y0={AlphaFilter:UA,BlurFilter:HA,BlurFilterPass:Xf,ColorMatrixFilter:Vf,DisplacementFilter:qA,FXAAFilter:JA,NoiseFilter:eE};Object.entries(Y0).forEach(([s,e])=>{Object.defineProperty(Y0,s,{get(){return ct("7.1.0",`filters.${s} has moved to ${s}`),e}})});class tE{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this.tickerAdded||!this.domElement||($i.system.add(this.tickerUpdate,this,to.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&($i.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events.rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY}))}tickerUpdate(e){this._deltaTime+=e,!(this._deltaTimei.priority-n.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let i=0,n=t.length;i=0;n--)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let r=i.length-1;r>=0;r--)n.forEach(o=>{e.currentTarget=i[r],this.notifyTarget(e,o)})}propagationPath(e){const t=[e];for(let i=0;i=0;u--){const d=h[u],f=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,n,r,o||r(e,i));if(f){if(f.length>0&&!f[f.length-1].parent)continue;const p=e.isInteractive();(f.length>0||p)&&(p&&this._allInteractiveElements.push(e),f.push(e)),this._hitElements.length===0&&(this._hitElements=f),a=!0}}}const c=this._isInteractive(t),l=e.isInteractive();return c&&l&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:a?this._hitElements:c&&!r(e,i)&&n(e,i)?l?[e]:[]:null}hitTestRecursive(e,t,i,n,r){if(this._interactivePrune(e)||r(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(tr.pauseUpdate=!1),e.interactiveChildren&&e.children){const c=e.children;for(let l=c.length-1;l>=0;l--){const h=c[l],u=this.hitTestRecursive(h,this._isInteractive(t)?t:h.eventMode,i,n,r);if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=e.isInteractive();return(u.length>0||d)&&u.push(e),u}}}const o=this._isInteractive(t),a=e.isInteractive();return o&&n(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!!(!e||e.isMask||!e.visible||!e.renderable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren||e.isMask)}hitPruneFn(e,t){var i;if(e.hitArea&&(e.worldTransform.applyInverse(t,Ld),!e.hitArea.contains(Ld.x,Ld.y)))return!0;if(e._mask){const n=e._mask.isMaskData?e._mask.maskObject:e._mask;if(n&&!((i=n.containsPoint)!=null&&i.call(n,t)))return!0}return!1}hitTestFn(e,t){return e.eventMode==="passive"?!1:e.hitArea?!0:e.containsPoint?e.containsPoint(t):!1}notifyTarget(e,t){var r,o;t=t??e.type;const i=`on${t}`;(o=(r=e.currentTarget)[i])==null||o.call(r,e);const n=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this.notifyListeners(e,n),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof Ss)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){const n=t.button===2;this.dispatchEvent(t,n?"rightdown":"mousedown")}const i=this.trackingData(e.pointerId);i.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){var c,l;if(!(e instanceof Ss)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const i=t.pointerType==="mouse"||t.pointerType==="pen",n=this.trackingData(e.pointerId),r=this.findMountedTarget(n.overTargets);if(((c=n.overTargets)==null?void 0:c.length)>0&&r!==t.target){const h=e.type==="mousemove"?"mouseout":"pointerout",u=this.createPointerEvent(e,h,r);if(this.dispatchEvent(u,"pointerout"),i&&this.dispatchEvent(u,"mouseout"),!t.composedPath().includes(r)){const d=this.createPointerEvent(e,"pointerleave",r);for(d.eventPhase=d.AT_TARGET;d.target&&!t.composedPath().includes(d.target);)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseleave"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(u)}if(r!==t.target){const h=e.type==="mousemove"?"mouseover":"pointerover",u=this.clonePointerEvent(t,h);this.dispatchEvent(u,"pointerover"),i&&this.dispatchEvent(u,"mouseover");let d=r==null?void 0:r.parent;for(;d&&d!==this.rootTarget.parent&&d!==t.target;)d=d.parent;if(!d||d===this.rootTarget.parent){const f=this.clonePointerEvent(t,"pointerenter");for(f.eventPhase=f.AT_TARGET;f.target&&f.target!==r&&f.target!==this.rootTarget.parent;)f.currentTarget=f.target,this.notifyTarget(f),i&&this.notifyTarget(f,"mouseenter"),f.target=f.target.parent;this.freeEvent(f)}this.freeEvent(u)}const o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&o.push("globalmousemove"),this.cursor=(l=t.target)==null?void 0:l.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){var o;if(!(e instanceof Ss)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=(o=i.target)==null?void 0:o.cursor);const r=this.clonePointerEvent(i,"pointerenter");for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),n&&this.notifyTarget(r,"mouseenter"),r.target=r.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(r)}mapPointerOut(e){if(!(e instanceof Ss)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),r=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(r),i&&this.dispatchEvent(r,"mouseout");const o=this.createPointerEvent(e,"pointerleave",n);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(r),this.freeEvent(o)}this.cursor=null}mapPointerUp(e){if(!(e instanceof Ss)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),r=this.findMountedTarget(n.pressTargetsByButton[e.button]);let o=r;if(r&&!i.composedPath().includes(r)){let a=r;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const c=i.button===2;this.notifyTarget(i,c?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[e.button],o=a}if(o){const a=this.clonePointerEvent(i,"click");a.target=o,a.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});const c=n.clicksByButton[e.button];if(c.target===a.target&&t-c.timeStamp<200?++c.clickCount:c.clickCount=1,c.target=a.target,c.timeStamp=t,a.detail=c.clickCount,a.pointerType==="mouse"){const l=a.button===2;this.dispatchEvent(a,l?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof Ss)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(i){let r=i;for(;r;)n.currentTarget=r,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),r=r.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(n)}mapWheel(e){if(!(e instanceof Yo)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[i]=n,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{view:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,Gf._defaultEventMode=e.eventMode??"auto",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this.currentCursor===e)return;this.currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this.rootPointerEvent}onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this.normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,n=t.length;i0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",n=this.normalizeToPointerData(e);for(let r=0,o=n.length;r"u"&&(r.button=0),typeof r.buttons>"u"&&(r.buttons=1),typeof r.isPrimary>"u"&&(r.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof r.width>"u"&&(r.width=r.radiusX||1),typeof r.height>"u"&&(r.height=r.radiusY||1),typeof r.tiltX>"u"&&(r.tiltX=0),typeof r.tiltY>"u"&&(r.tiltY=0),typeof r.pointerType>"u"&&(r.pointerType="touch"),typeof r.pointerId>"u"&&(r.pointerId=r.identifier||0),typeof r.pressure>"u"&&(r.pressure=r.force||.5),typeof r.twist>"u"&&(r.twist=0),typeof r.tangentialPressure>"u"&&(r.tangentialPressure=0),typeof r.layerX>"u"&&(r.layerX=r.offsetX=r.clientX),typeof r.layerY>"u"&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=e.type,t.push(r)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=rE),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,t.push(i)}else t.push(e);return t}normalizeWheelEvent(e){const t=this.rootWheelEvent;return this.transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this.transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=oE[e.type]||e.type),e}transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};Yf.extension={name:"events",type:[Pe.RendererSystem,Pe.CanvasRendererSystem]},Yf.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let Hf=Yf;Ne.add(Hf);function G0(s){return s==="dynamic"||s==="static"}const aE={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??G0(Hf.defaultEventMode)},set interactive(s){ct("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=s,this.eventMode=s?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??Hf.defaultEventMode},set eventMode(s){this._internalInteractive=G0(s),this._internalEventMode=s},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(s,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof t=="object"?t.signal:void 0,r=typeof t=="object"?t.once===!0:!1,o=typeof e=="function"?void 0:e;s=i?`${s}capture`:s;const a=typeof e=="function"?e:e.handleEvent,c=this;n&&n.addEventListener("abort",()=>{c.off(s,a,o)}),r?c.once(s,a,o):c.on(s,a,o)},removeEventListener(s,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;s=i?`${s}capture`:s,e=typeof e=="function"?e:e.handleEvent,this.off(s,e,n)},dispatchEvent(s){if(!(s instanceof xl))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return s.defaultPrevented=!1,s.path=null,s.target=this,s.manager.dispatchEvent(s),!s.defaultPrevented}};Wt.mixin(aE);const lE={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Wt.mixin(lE);const cE=9,Wl=100,hE=0,uE=0,H0=2,j0=1,dE=-1e3,fE=-1e3,mE=2;class Mb{constructor(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(Tn.tablet||Tn.phone)&&this.createTouchHook();const t=document.createElement("div");t.style.width=`${Wl}px`,t.style.height=`${Wl}px`,t.style.position="absolute",t.style.top=`${hE}px`,t.style.left=`${uE}px`,t.style.zIndex=H0.toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const e=document.createElement("button");e.style.width=`${j0}px`,e.style.height=`${j0}px`,e.style.position="absolute",e.style.top=`${dE}px`,e.style.left=`${fE}px`,e.style.zIndex=mE.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(e=this.renderer.view.parentNode)==null||e.appendChild(this.div))}deactivate(){var e;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(e=this.div.parentNode)==null||e.removeChild(this.div))}updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);const t=e.children;if(t)for(let i=0;i title : ${e.title}
tabIndex: ${e.tabIndex}`}capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this.renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}addChild(e){let t=this.pool.pop();t||(t=document.createElement("button"),t.style.width=`${Wl}px`,t.style.height=`${Wl}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=H0.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`displayObject ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){const{displayObject:i}=e.target,n=this.renderer.events.rootBoundary,r=Object.assign(new xl(n),{target:i});n.rootTarget=this.renderer.lastObjectRendered,t.forEach(o=>n.dispatchEvent(r,o))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode===cE&&this.activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}Mb.extension={name:"accessibility",type:[Pe.RendererPlugin,Pe.CanvasRendererPlugin]};Ne.add(Mb);const Cb=class jf{constructor(e){this.stage=new Si,e=Object.assign({forceCanvas:!1},e),this.renderer=TA(e),jf._plugins.forEach(t=>{t.init.call(this,e)})}render(){this.renderer.render(this.stage)}get view(){var e;return(e=this.renderer)==null?void 0:e.view}get screen(){var e;return(e=this.renderer)==null?void 0:e.screen}destroy(e,t){const i=jf._plugins.slice(0);i.reverse(),i.forEach(n=>{n.destroy.call(this)}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null}};Cb._plugins=[];let Ab=Cb;Ne.handleByList(Pe.Application,Ab._plugins);class Eb{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let t,i;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:n,clientHeight:r}=this._resizeTo;t=n,i=r}this.renderer.resize(t,i),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}Eb.extension=Pe.Application;Ne.add(Eb);const W0={loader:Pe.LoadParser,resolver:Pe.ResolveParser,cache:Pe.CacheParser,detection:Pe.DetectionParser};Ne.handle(Pe.Asset,s=>{const e=s.ref;Object.entries(W0).filter(([t])=>!!e[t]).forEach(([t,i])=>Ne.add(Object.assign(e[t],{extension:e[t].extension??i})))},s=>{const e=s.ref;Object.keys(W0).filter(t=>!!e[t]).forEach(t=>Ne.remove(e[t]))});class pE{constructor(e,t=!1){this._loader=e,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=t}add(e){e.forEach(t=>{this._assetList.push(t)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const e=[],t=Math.min(this._assetList.length,this._maxConcurrent);for(let i=0;i(Array.isArray(s)||(s=[s]),e?s.map(i=>typeof i=="string"||t?e(i):i):s),Qc=(s,e)=>{const t=e.split("?")[1];return t&&(s+=`?${t}`),s};function Ib(s,e,t,i,n){const r=e[t];for(let o=0;o{const o=r.substring(1,r.length-1).split(",");n.push(o)}),Ib(s,n,0,t,i)}else i.push(s);return i}const eh=s=>!Array.isArray(s);class vE{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){const t=this._cache.get(e);return t||console.warn(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){const i=Ts(e);let n;for(let a=0;a{n[a]=t}));const r=Object.keys(n),o={cacheKeys:r,keys:i};if(i.forEach(a=>{this._cacheMap.set(a,o)}),r.forEach(a=>{const c=n?n[a]:t;this._cache.has(a)&&this._cache.get(a)!==c&&console.warn("[Cache] already has key:",a),this._cache.set(a,n[a])}),t instanceof ze){const a=t;i.forEach(c=>{a.baseTexture!==ze.EMPTY.baseTexture&&Je.addToCache(a.baseTexture,c),ze.addToCache(a,c)})}}remove(e){if(!this._cacheMap.has(e)){console.warn(`[Assets] Asset id ${e} was not found in the Cache`);return}const t=this._cacheMap.get(e);t.cacheKeys.forEach(i=>{this._cache.delete(i)}),t.keys.forEach(i=>{this._cacheMap.delete(i)})}get parsers(){return this._parsers}}const Nr=new vE;class yE{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(e,t,i)=>(this._parsersValidated=!1,e[t]=i,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(e,t){const i={promise:null,parser:null};return i.promise=(async()=>{var o,a;let n=null,r=null;if(t.loadParser&&(r=this._parserHash[t.loadParser],r||console.warn(`[Assets] specified load parser "${t.loadParser}" not found while loading ${e}`)),!r){for(let c=0;c({alias:[l],src:l})),a=o.length,c=o.map(async l=>{const h=Zt.toAbsolute(l.src);if(!n[l.src])try{this.promiseCache[h]||(this.promiseCache[h]=this._getLoadPromiseAndParser(h,l)),n[l.src]=await this.promiseCache[h].promise,t&&t(++i/a)}catch(u){throw delete this.promiseCache[h],delete n[l.src],new Error(`[Loader.load] Failed to load ${h}. ${u}`)}});return await Promise.all(c),r?n[o[0].src]:n}async unload(e){const t=Ts(e,i=>({alias:[i],src:i})).map(async i=>{var o,a;const n=Zt.toAbsolute(i.src),r=this.promiseCache[n];if(r){const c=await r.promise;delete this.promiseCache[n],(a=(o=r.parser)==null?void 0:o.unload)==null||a.call(o,c,i,this)}});await Promise.all(t)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(e=>e.name).reduce((e,t)=>(e[t.name]&&console.warn(`[Assets] loadParser name conflict "${t.name}"`),{...e,[t.name]:t}),{})}}var ns=(s=>(s[s.Low=0]="Low",s[s.Normal=1]="Normal",s[s.High=2]="High",s))(ns||{});const xE=".json",bE="application/json",wE={extension:{type:Pe.LoadParser,priority:ns.Low},name:"loadJson",test(s){return aa(s,bE)||Ki(s,xE)},async load(s){return await(await ke.ADAPTER.fetch(s)).json()}};Ne.add(wE);const SE=".txt",_E="text/plain",TE={name:"loadTxt",extension:{type:Pe.LoadParser,priority:ns.Low},test(s){return aa(s,_E)||Ki(s,SE)},async load(s){return await(await ke.ADAPTER.fetch(s)).text()}};Ne.add(TE);const ME=["normal","bold","100","200","300","400","500","600","700","800","900"],CE=[".ttf",".otf",".woff",".woff2"],AE=["font/ttf","font/otf","font/woff","font/woff2"],EE=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function IE(s){const e=Zt.extname(s),t=Zt.basename(s,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1));let i=t.length>0;for(const r of t)if(!r.match(EE)){i=!1;break}let n=t.join(" ");return i||(n=`"${n.replace(/[\\"]/g,"\\$&")}"`),n}const RE=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function PE(s){return RE.test(s)?s:encodeURI(s)}const kE={extension:{type:Pe.LoadParser,priority:ns.Low},name:"loadWebFont",test(s){return aa(s,AE)||Ki(s,CE)},async load(s,e){var i,n,r;const t=ke.ADAPTER.getFontFaceSet();if(t){const o=[],a=((i=e.data)==null?void 0:i.family)??IE(s),c=((r=(n=e.data)==null?void 0:n.weights)==null?void 0:r.filter(h=>ME.includes(h)))??["normal"],l=e.data??{};for(let h=0;hke.ADAPTER.getFontFaceSet().delete(e))}};Ne.add(kE);const FE=`(function() { "use strict"; const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII="; @@ -929,8 +929,8 @@ ${u}`)}});return await Promise.all(c),r?n[o[0].src]:n}async unload(e){const t=Ts } }; })(); -`;let Ho=null;class R1{constructor(){Ho||(Ho=URL.createObjectURL(new Blob([OE],{type:"application/javascript"}))),this.worker=new Worker(Ho)}}R1.revokeObjectURL=function(){Ho&&(URL.revokeObjectURL(Ho),Ho=null)};let z0=0,Dd;class BE{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(e=>{const{worker:t}=new Wf;t.addEventListener("message",i=>{t.terminate(),Wf.revokeObjectURL(),e(i.data)})}),this._isImageBitmapSupported)}loadImageBitmap(e){return this._run("loadImageBitmap",[e])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){Dd===void 0&&(Dd=navigator.hardwareConcurrency||4);let e=this.workerPool.pop();return!e&&this._createdWorkers{this.complete(t.data),this.returnWorker(t.target),this.next()})),e}returnWorker(e){this.workerPool.push(e)}complete(e){e.error!==void 0?this.resolveHash[e.uuid].reject(e.error):this.resolveHash[e.uuid].resolve(e.data),this.resolveHash[e.uuid]=null}async _run(e,t){await this._initWorkers();const i=new Promise((n,r)=>{this.queue.push({id:e,arguments:t,resolve:n,reject:r})});return this.next(),i}next(){if(!this.queue.length)return;const e=this.getWorker();if(!e)return;const t=this.queue.pop(),i=t.id;this.resolveHash[z0]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:z0++,id:i})}}const q0=new BE;function bl(s,e,t){s.resource.internal=!0;const i=new ze(s),n=()=>{delete e.promiseCache[t],Nr.has(t)&&Nr.remove(t)};return i.baseTexture.once("destroyed",()=>{t in e.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),n())}),i.once("destroyed",()=>{s.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),n())}),i}const LE=[".jpeg",".jpg",".png",".webp",".avif"],DE=["image/jpeg","image/png","image/webp","image/avif"];async function NE(s){const e=await ke.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${s}: ${e.status} ${e.statusText}`);const t=await e.blob();return await createImageBitmap(t)}const tu={name:"loadTextures",extension:{type:Pe.LoadParser,priority:ns.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(s){return aa(s,DE)||Ki(s,LE)},async load(s,e,t){var a;const i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let n;i?this.config.preferWorkers&&await q0.isImageBitmapSupported()?n=await q0.loadImageBitmap(s):n=await NE(s):n=await new Promise((c,l)=>{const h=new Image;h.crossOrigin=this.config.crossOrigin,h.src=s,h.complete?c(h):(h.onload=()=>c(h),h.onerror=u=>l(u))});const r={...e.data};r.resolution??(r.resolution=Dn(s)),i&&((a=r.resourceOptions)==null?void 0:a.ownsImageBitmap)===void 0&&(r.resourceOptions={...r.resourceOptions},r.resourceOptions.ownsImageBitmap=!0);const o=new Je(n,r);return o.resource.src=s,bl(o,t,s)},unload(s){s.destroy(!0)}};Ne.add(tu);const UE=".svg",$E="image/svg+xml",XE={extension:{type:Pe.LoadParser,priority:ns.High},name:"loadSVG",test(s){return aa(s,$E)||Ki(s,UE)},async testParse(s){return Df.test(s)},async parse(s,e,t){var r;const i=new Df(s,(r=e==null?void 0:e.data)==null?void 0:r.resourceOptions);await i.load();const n=new Je(i,{resolution:Dn(s),...e==null?void 0:e.data});return n.resource.src=e.src,bl(n,t,e.src)},async load(s,e){return(await ke.ADAPTER.fetch(s)).text()},unload:tu.unload};Ne.add(XE);const VE=[".mp4",".m4v",".webm",".ogv"],YE=["video/mp4","video/webm","video/ogg"],GE={name:"loadVideo",extension:{type:Pe.LoadParser,priority:ns.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test(s){return aa(s,YE)||Ki(s,VE)},async load(s,e,t){var o;let i;const n=await(await ke.ADAPTER.fetch(s)).blob(),r=URL.createObjectURL(n);try{const a={autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...(o=e==null?void 0:e.data)==null?void 0:o.resourceOptions,autoLoad:!0},c=new S1(r,a);await c.load();const l=new Je(c,{alphaMode:await ZM(),resolution:Dn(s),...e==null?void 0:e.data});l.resource.src=s,i=bl(l,t,s),i.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(r)})}catch(a){throw URL.revokeObjectURL(r),a}return i},unload(s){s.destroy(!0)}};Ne.add(GE);class HE{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e=="string")this._defaultSearchParams=e;else{const t=e;this._defaultSearchParams=Object.keys(t).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`).join("&")}}getAlias(e){const{alias:t,name:i,src:n,srcs:r}=e;return Ts(t||i||n||r,o=>typeof o=="string"?o:Array.isArray(o)?o.map(a=>(a==null?void 0:a.src)??(a==null?void 0:a.srcs)??a):o!=null&&o.src||o!=null&&o.srcs?o.src??o.srcs:o,!0)}addManifest(e){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(t=>{this.addBundle(t.name,t.assets)})}addBundle(e,t){const i=[];Array.isArray(t)?t.forEach(n=>{const r=n.src??n.srcs,o=n.alias??n.name;let a;if(typeof o=="string"){const c=this._createBundleAssetId(e,o);i.push(c),a=[o,c]}else{const c=o.map(l=>this._createBundleAssetId(e,l));i.push(...c),a=[...o,...c]}this.add({...n,alias:a,src:r})}):Object.keys(t).forEach(n=>{const r=[n,this._createBundleAssetId(e,n)];if(typeof t[n]=="string")this.add({alias:r,src:t[n]});else if(Array.isArray(t[n]))this.add({alias:r,src:t[n]});else{const o=t[n],a=o.src??o.srcs;this.add({...o,alias:r,src:Array.isArray(a)?a:[a]})}i.push(...r)}),this._bundles[e]=i}add(e,t,i,n,r){const o=[];typeof e=="string"||Array.isArray(e)&&typeof e[0]=="string"?(ct("7.2.0",`Assets.add now uses an object instead of individual parameters. -Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),o.push({alias:e,src:t,data:i,format:n,loadParser:r})):Array.isArray(e)?o.push(...e):o.push(e);let a;a=c=>{this.hasKey(c)&&console.warn(`[Resolver] already has key: ${c} overwriting`)},Ts(o).forEach(c=>{const{src:l,srcs:h}=c;let{data:u,format:d,loadParser:f}=c;const p=Ts(l||h).map(v=>typeof v=="string"?gE(v):Array.isArray(v)?v:[v]),m=this.getAlias(c);Array.isArray(m)?m.forEach(a):a(m);const g=[];p.forEach(v=>{v.forEach(x=>{let y={};if(typeof x!="object"){y.src=x;for(let _=0;_{this._assetMap[v]=g})})}resolveBundle(e){const t=eh(e);e=Ts(e);const i={};return e.forEach(n=>{const r=this._bundles[n];if(r){const o=this.resolve(r),a={};for(const c in o){const l=o[c];a[this._extractAssetIdFromBundle(n,c)]=l}i[n]=a}}),t?i[e[0]]:i}resolveUrl(e){const t=this.resolve(e);if(typeof e!="string"){const i={};for(const n in t)i[n]=t[n].src;return i}return t.src}resolve(e){const t=eh(e);e=Ts(e);const i={};return e.forEach(n=>{if(!this._resolverHash[n])if(this._assetMap[n]){let r=this._assetMap[n];const o=r[0],a=this._getPreferredOrder(r);a==null||a.priority.forEach(c=>{a.params[c].forEach(l=>{const h=r.filter(u=>u[c]?u[c]===l:!1);h.length&&(r=h)})}),this._resolverHash[n]=r[0]??o}else this._resolverHash[n]=this.buildResolvedAsset({alias:[n],src:n},{});i[n]=this._resolverHash[n]}),t?i[e[0]]:i}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;tr.params.format.includes(i.format));if(n)return n}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const t=/\?/.test(e)?"&":"?";return`${e}${t}${this._defaultSearchParams}`}buildResolvedAsset(e,t){const{aliases:i,data:n,loadParser:r,format:o}=t;return(this._basePath||this._rootPath)&&(e.src=Zt.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=i??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...n||{},...e.data},e.loadParser=r??e.loadParser,e.format=o??e.format??Zt.extname(e.src).slice(1),e.srcs=e.src,e.name=e.alias,e}}class jE{constructor(){this._detections=[],this._initialized=!1,this.resolver=new HE,this.loader=new yE,this.cache=Nr,this._backgroundLoader=new pE(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(e={}){var r,o;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=!0,e.defaultSearchParams&&this.resolver.setDefaultSearchParams(e.defaultSearchParams),e.basePath&&(this.resolver.basePath=e.basePath),e.bundleIdentifier&&this.resolver.setBundleIdentifier(e.bundleIdentifier),e.manifest){let a=e.manifest;typeof a=="string"&&(a=await this.load(a)),this.resolver.addManifest(a)}const t=((r=e.texturePreference)==null?void 0:r.resolution)??1,i=typeof t=="number"?[t]:t,n=await this._detectFormats({preferredFormats:(o=e.texturePreference)==null?void 0:o.format,skipDetections:e.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:n,resolution:i}}),e.preferences&&this.setPreferences(e.preferences)}add(e,t,i,n,r){this.resolver.add(e,t,i,n,r)}async load(e,t){this._initialized||await this.init();const i=eh(e),n=Ts(e).map(a=>{if(typeof a!="string"){const c=this.resolver.getAlias(a);return c.some(l=>!this.resolver.hasKey(l))&&this.add(a),Array.isArray(c)?c[0]:c}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),r=this.resolver.resolve(n),o=await this._mapLoadToResolve(r,t);return i?o[n[0]]:o}addBundle(e,t){this.resolver.addBundle(e,t)}async loadBundle(e,t){this._initialized||await this.init();let i=!1;typeof e=="string"&&(i=!0,e=[e]);const n=this.resolver.resolveBundle(e),r={},o=Object.keys(n);let a=0,c=0;const l=()=>{t==null||t(++a/c)},h=o.map(u=>{const d=n[u];return c+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(f=>{r[u]=f})});return await Promise.all(h),i?r[e[0]]:r}async backgroundLoad(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const t=this.resolver.resolve(e);this._backgroundLoader.add(Object.values(t))}async backgroundLoadBundle(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const t=this.resolver.resolveBundle(e);Object.values(t).forEach(i=>{this._backgroundLoader.add(Object.values(i))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(e){if(typeof e=="string")return Nr.get(e);const t={};for(let i=0;i{const l=r[a.src],h=[a.src];a.alias&&h.push(...a.alias),o[n[c]]=l,Nr.set(h,l)}),o}async unload(e){this._initialized||await this.init();const t=Ts(e).map(n=>typeof n!="string"?n.src:n),i=this.resolver.resolve(t);await this._unloadFromResolved(i)}async unloadBundle(e){this._initialized||await this.init(),e=Ts(e);const t=this.resolver.resolveBundle(e),i=Object.keys(t).map(n=>this._unloadFromResolved(t[n]));await Promise.all(i)}async _unloadFromResolved(e){const t=Object.values(e);t.forEach(i=>{Nr.remove(i.src)}),await this.loader.unload(t)}async _detectFormats(e){let t=[];e.preferredFormats&&(t=Array.isArray(e.preferredFormats)?e.preferredFormats:[e.preferredFormats]);for(const i of e.detections)e.skipDetections||await i.test()?t=await i.add(t):e.skipDetections||(t=await i.remove(t));return t=t.filter((i,n)=>t.indexOf(i)===n),t}get detections(){return this._detections}get preferWorkers(){return tu.config.preferWorkers}set preferWorkers(e){ct("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:e})}setPreferences(e){this.loader.parsers.forEach(t=>{t.config&&Object.keys(t.config).filter(i=>i in e).forEach(i=>{t.config[i]=e[i]})})}}const tn=new jE;Ne.handleByList(Pe.LoadParser,tn.loader.parsers).handleByList(Pe.ResolveParser,tn.resolver.parsers).handleByList(Pe.CacheParser,tn.cache.parsers).handleByList(Pe.DetectionParser,tn.detections);const WE={extension:Pe.CacheParser,test:s=>Array.isArray(s)&&s.every(e=>e instanceof ze),getCacheableAssets:(s,e)=>{const t={};return s.forEach(i=>{e.forEach((n,r)=>{t[i+(r===0?"":r+1)]=n})}),t}};Ne.add(WE);async function P1(s){if("Image"in globalThis)return new Promise(e=>{const t=new Image;t.onload=()=>{e(!0)},t.onerror=()=>{e(!1)},t.src=s});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const e=await(await fetch(s)).blob();await createImageBitmap(e)}catch{return!1}return!0}return!1}const zE={extension:{type:Pe.DetectionParser,priority:1},test:async()=>P1("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async s=>[...s,"avif"],remove:async s=>s.filter(e=>e!=="avif")};Ne.add(zE);const qE={extension:{type:Pe.DetectionParser,priority:0},test:async()=>P1("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async s=>[...s,"webp"],remove:async s=>s.filter(e=>e!=="webp")};Ne.add(qE);const K0=["png","jpg","jpeg"],KE={extension:{type:Pe.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async s=>[...s,...K0],remove:async s=>s.filter(e=>!K0.includes(e))};Ne.add(KE);const ZE="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function tp(s){return ZE?!1:document.createElement("video").canPlayType(s)!==""}const JE={extension:{type:Pe.DetectionParser,priority:0},test:async()=>tp("video/webm"),add:async s=>[...s,"webm"],remove:async s=>s.filter(e=>e!=="webm")};Ne.add(JE);const QE={extension:{type:Pe.DetectionParser,priority:0},test:async()=>tp("video/mp4"),add:async s=>[...s,"mp4","m4v"],remove:async s=>s.filter(e=>e!=="mp4"&&e!=="m4v")};Ne.add(QE);const e2={extension:{type:Pe.DetectionParser,priority:0},test:async()=>tp("video/ogg"),add:async s=>[...s,"ogv"],remove:async s=>s.filter(e=>e!=="ogv")};Ne.add(e2);const t2={extension:Pe.ResolveParser,test:tu.test,parse:s=>{var e;return{resolution:parseFloat(((e=ke.RETINA_PREFIX.exec(s))==null?void 0:e[1])??"1"),format:Zt.extname(s).slice(1),src:s}}};Ne.add(t2);var gi=(s=>(s[s.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",s[s.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",s[s.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",s[s.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",s[s.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",s[s.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",s[s.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",s[s.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",s[s.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",s[s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",s[s.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",s[s.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",s[s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",s[s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",s[s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",s[s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",s[s.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",s[s.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",s[s.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",s[s.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",s[s.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",s[s.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",s[s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",s[s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",s[s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",s))(gi||{});const th={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1};let Ns,Eo;function Z0(){Eo={bptc:Ns.getExtension("EXT_texture_compression_bptc"),astc:Ns.getExtension("WEBGL_compressed_texture_astc"),etc:Ns.getExtension("WEBGL_compressed_texture_etc"),s3tc:Ns.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:Ns.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:Ns.getExtension("WEBGL_compressed_texture_pvrtc")||Ns.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:Ns.getExtension("WEBGL_compressed_texture_etc1"),atc:Ns.getExtension("WEBGL_compressed_texture_atc")}}const i2={extension:{type:Pe.DetectionParser,priority:2},test:async()=>{const s=ke.ADAPTER.createCanvas().getContext("webgl");return s?(Ns=s,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async s=>{Eo||Z0();const e=[];for(const t in Eo)Eo[t]&&e.push(t);return[...e,...s]},remove:async s=>(Eo||Z0(),s.filter(e=>!(e in Eo)))};Ne.add(i2);class s2 extends Kh{constructor(e,t={width:1,height:1,autoLoad:!0}){let i,n;typeof e=="string"?(i=e,n=new Uint8Array):(i=null,n=e),super(n,t),this.origin=i,this.buffer=n?new Tf(n):null,this._load=null,this.loaded=!1,this.origin!==null&&t.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(e){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(e=>e.blob()).then(e=>e.arrayBuffer()).then(e=>(this.data=new Uint32Array(e),this.buffer=new Tf(e),this.loaded=!0,this.onBlobLoaded(e),this.update(),this)),this._load)}}class Kr extends s2{constructor(e,t){super(e,t),this.format=t.format,this.levels=t.levels||1,this._width=t.width,this._height=t.height,this._extension=Kr._formatToExtension(this.format),(t.levelBuffers||this.buffer)&&(this._levelBuffers=t.levelBuffers||Kr._createLevelBuffers(e instanceof Uint8Array?e:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(e,t,i){const n=e.gl;if(!e.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;n.pixelStorei(n.UNPACK_ALIGNMENT,4);for(let r=0,o=this.levels;r=33776&&e<=33779)return"s3tc";if(e>=35916&&e<=35919)return"s3tc_sRGB";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e===36196)return"etc1";if(e===35986||e===35987||e===34798)return"atc";if(e>=36492&&e<=36495)return"bptc";if(e===37808)return"astc";throw new Error(`Invalid (compressed) texture format given: ${e}`)}static _createLevelBuffers(e,t,i,n,r,o,a){const c=new Array(i);let l=e.byteOffset,h=o,u=a,d=h+n-1&~(n-1),f=u+r-1&~(r-1),p=d*f*th[t];for(let m=0;m1?h:d,levelHeight:i>1?u:f,levelBuffer:new Uint8Array(e.buffer,l,p)},l+=p,h=h>>1||1,u=u>>1||1,d=h+n-1&~(n-1),f=u+r-1&~(r-1),p=d*f*th[t];return c}}const Nd=4,zl=124,n2=32,J0=20,r2=542327876,ql={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},o2={FOURCC:2},Kl={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},a2=1,l2=2,c2=4,h2=64,u2=512,d2=131072,f2=827611204,m2=861165636,p2=894720068,g2=808540228,v2=4,y2={[f2]:gi.COMPRESSED_RGBA_S3TC_DXT1_EXT,[m2]:gi.COMPRESSED_RGBA_S3TC_DXT3_EXT,[p2]:gi.COMPRESSED_RGBA_S3TC_DXT5_EXT},x2={70:gi.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:gi.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:gi.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:gi.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:gi.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:gi.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:gi.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:gi.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:gi.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:gi.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:gi.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:gi.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:gi.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function b2(s){const e=new Uint32Array(s);if(e[0]!==r2)throw new Error("Invalid DDS file magic word");const t=new Uint32Array(s,0,zl/Uint32Array.BYTES_PER_ELEMENT),i=t[ql.HEIGHT],n=t[ql.WIDTH],r=t[ql.MIPMAP_COUNT],o=new Uint32Array(s,ql.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,n2/Uint32Array.BYTES_PER_ELEMENT),a=o[a2];if(a&c2){const c=o[o2.FOURCC];if(c!==g2){const x=y2[c],y=Nd+zl,_=new Uint8Array(s,y);return[new Kr(_,{format:x,width:n,height:i,levels:r})]}const l=Nd+zl,h=new Uint32Array(e.buffer,l,J0/Uint32Array.BYTES_PER_ELEMENT),u=h[Kl.DXGI_FORMAT],d=h[Kl.RESOURCE_DIMENSION],f=h[Kl.MISC_FLAG],p=h[Kl.ARRAY_SIZE],m=x2[u];if(m===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===v2)throw new Error("DDSParser does not support cubemap textures");if(d===6)throw new Error("DDSParser does not supported 3D texture data");const g=new Array,v=Nd+zl+J0;if(p===1)g.push(new Uint8Array(s,v));else{const x=th[m];let y=0,_=n,C=i;for(let b=0;b>>1,C=C>>>1}let S=v;for(let b=0;bnew Kr(x,{format:m,width:n,height:i,levels:r}))}throw a&h2?new Error("DDSParser does not support uncompressed texture data."):a&u2?new Error("DDSParser does not supported YUV uncompressed texture data."):a&d2?new Error("DDSParser does not support single-channel (lumninance) texture data!"):a&l2?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const Q0=[171,75,84,88,32,49,49,187,13,10,26,10],w2=67305985,xs={ENDIANNESS:12,GL_TYPE:16,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},zf=64,ev={[De.UNSIGNED_BYTE]:1,[De.UNSIGNED_SHORT]:2,[De.INT]:4,[De.UNSIGNED_INT]:4,[De.FLOAT]:4,[De.HALF_FLOAT]:8},S2={[Se.RGBA]:4,[Se.RGB]:3,[Se.RG]:2,[Se.RED]:1,[Se.LUMINANCE]:1,[Se.LUMINANCE_ALPHA]:2,[Se.ALPHA]:1},_2={[De.UNSIGNED_SHORT_4_4_4_4]:2,[De.UNSIGNED_SHORT_5_5_5_1]:2,[De.UNSIGNED_SHORT_5_6_5]:2};function T2(s,e,t=!1){const i=new DataView(e);if(!M2(s,i))return null;const n=i.getUint32(xs.ENDIANNESS,!0)===w2,r=i.getUint32(xs.GL_TYPE,n),o=i.getUint32(xs.GL_FORMAT,n),a=i.getUint32(xs.GL_INTERNAL_FORMAT,n),c=i.getUint32(xs.PIXEL_WIDTH,n),l=i.getUint32(xs.PIXEL_HEIGHT,n)||1,h=i.getUint32(xs.PIXEL_DEPTH,n)||1,u=i.getUint32(xs.NUMBER_OF_ARRAY_ELEMENTS,n)||1,d=i.getUint32(xs.NUMBER_OF_FACES,n),f=i.getUint32(xs.NUMBER_OF_MIPMAP_LEVELS,n),p=i.getUint32(xs.BYTES_OF_KEY_VALUE_DATA,n);if(l===0||h!==1)throw new Error("Only 2D textures are supported");if(d!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");const m=4,g=4,v=c+3&-4,x=l+3&-4,y=new Array(u);let _=c*l;r===0&&(_=v*x);let C;if(r!==0?ev[r]?C=ev[r]*S2[o]:C=_2[r]:C=th[a],C===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const S=t?A2(i,p,n):null;let b=_*C,M=c,I=l,F=v,E=x,k=zf+p;for(let O=0;O1||r!==0?M:F,levelHeight:f>1||r!==0?I:E,levelBuffer:new Uint8Array(e,$,b)},$+=b}k+=D+4,k=k%4!==0?k+4-k%4:k,M=M>>1||1,I=I>>1||1,F=M+m-1&-4,E=I+g-1&-4,b=F*E*C}return r!==0?{uncompressed:y.map(O=>{let D=O[0].levelBuffer,$=!1;return r===De.FLOAT?D=new Float32Array(O[0].levelBuffer.buffer,O[0].levelBuffer.byteOffset,O[0].levelBuffer.byteLength/4):r===De.UNSIGNED_INT?($=!0,D=new Uint32Array(O[0].levelBuffer.buffer,O[0].levelBuffer.byteOffset,O[0].levelBuffer.byteLength/4)):r===De.INT&&($=!0,D=new Int32Array(O[0].levelBuffer.buffer,O[0].levelBuffer.byteOffset,O[0].levelBuffer.byteLength/4)),{resource:new Kh(D,{width:O[0].levelWidth,height:O[0].levelHeight}),type:r,format:$?C2(o):o}}),kvData:S}:{compressed:y.map(O=>new Kr(null,{format:a,width:c,height:l,levels:f,levelBuffers:O})),kvData:S}}function M2(s,e){for(let t=0;te-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let c=0;for(;c{const o=new Je(r,{mipmap:gs.OFF,alphaMode:mi.NO_PREMULTIPLIED_ALPHA,resolution:Dn(s),...e.data});return bl(o,t,s)});return n.length===1?n[0]:n},unload(s){Array.isArray(s)?s.forEach(e=>e.destroy(!0)):s.destroy(!0)}};Ne.add(E2);const I2={extension:{type:Pe.LoadParser,priority:ns.High},name:"loadKTX",test(s){return Ki(s,".ktx")},async load(s,e,t){const i=await(await ke.ADAPTER.fetch(s)).arrayBuffer(),{compressed:n,uncompressed:r,kvData:o}=T2(s,i),a=n??r,c={mipmap:gs.OFF,alphaMode:mi.NO_PREMULTIPLIED_ALPHA,resolution:Dn(s),...e.data},l=a.map(h=>{a===r&&Object.assign(c,{type:h.type,format:h.format});const u=h.resource??h,d=new Je(u,c);return d.ktxKeyValueData=o,bl(d,t,s)});return l.length===1?l[0]:l},unload(s){Array.isArray(s)?s.forEach(e=>e.destroy(!0)):s.destroy(!0)}};Ne.add(I2);const R2=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],P2={extension:Pe.ResolveParser,test:s=>{const e=Zt.extname(s).slice(1);return["basis","ktx","dds"].includes(e)},parse:s=>{var i,n;const e=s.split("."),t=e.pop();if(["ktx","dds"].includes(t)){const r=e.pop();if(R2.includes(r))return{resolution:parseFloat(((i=ke.RETINA_PREFIX.exec(s))==null?void 0:i[1])??"1"),format:r,src:s}}return{resolution:parseFloat(((n=ke.RETINA_PREFIX.exec(s))==null?void 0:n[1])??"1"),format:t,src:s}}};Ne.add(P2);const Zl=new nt,k2=4,k1=class Fa{constructor(e){this.renderer=e,this._rendererPremultipliedAlpha=!1}contextChange(){var t;const e=(t=this.renderer)==null?void 0:t.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}async image(e,t,i,n){const r=new Image;return r.src=await this.base64(e,t,i,n),r}async base64(e,t,i,n){const r=this.canvas(e,n);if(r.toBlob!==void 0)return new Promise((o,a)=>{r.toBlob(c=>{if(!c){a(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>o(l.result),l.onerror=a,l.readAsDataURL(c)},t,i)});if(r.toDataURL!==void 0)return r.toDataURL(t,i);if(r.convertToBlob!==void 0){const o=await r.convertToBlob({type:t,quality:i});return new Promise((a,c)=>{const l=new FileReader;l.onload=()=>a(l.result),l.onerror=c,l.readAsDataURL(o)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e,t){const{pixels:i,width:n,height:r,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,t);o&&Fa._flipY(i,n,r),a&&Fa._unpremultiplyAlpha(i);const c=new fC(n,r,1),l=new ImageData(new Uint8ClampedArray(i.buffer),n,r);return c.context.putImageData(l,0,0),c.canvas}pixels(e,t){const{pixels:i,width:n,height:r,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,t);return o&&Fa._flipY(i,n,r),a&&Fa._unpremultiplyAlpha(i),i}_rawPixels(e,t){const i=this.renderer;if(!i)throw new Error("The Extract has already been destroyed");let n,r=!1,o=!1,a,c=!1;e&&(e instanceof oo?a=e:(a=i.generateTexture(e,{region:t,resolution:i.resolution,multisample:i.multisample}),c=!0,t&&(Zl.width=t.width,Zl.height=t.height,t=Zl)));const l=i.gl;if(a){if(n=a.baseTexture.resolution,t=t??a.frame,r=!1,o=a.baseTexture.alphaMode>0&&a.baseTexture.format===Se.RGBA,!c){i.renderTexture.bind(a);const f=a.framebuffer.glFramebuffers[i.CONTEXT_UID];f.blitFramebuffer&&i.framebuffer.bind(f.blitFramebuffer)}}else n=i.resolution,t||(t=Zl,t.width=i.width/n,t.height=i.height/n),r=!0,o=this._rendererPremultipliedAlpha,i.renderTexture.bind();const h=Math.max(Math.round(t.width*n),1),u=Math.max(Math.round(t.height*n),1),d=new Uint8Array(k2*h*u);return l.readPixels(Math.round(t.x*n),Math.round(t.y*n),h,u,l.RGBA,l.UNSIGNED_BYTE,d),c&&(a==null||a.destroy(!0)),{pixels:d,width:h,height:u,flipY:r,premultipliedAlpha:o}}destroy(){this.renderer=null}static _flipY(e,t,i){const n=t<<2,r=i>>1,o=new Uint8Array(n);for(let a=0;a=0&&a>=0&&n>=0&&r>=0)){e.length=0;return}const c=Math.ceil(2.3*Math.sqrt(o+a)),l=c*8+(n?4:0)+(r?4:0);if(e.length=l,l===0)return;if(c===0){e.length=8,e[0]=e[6]=t+n,e[1]=e[3]=i+r,e[2]=e[4]=t-n,e[5]=e[7]=i-r;return}let h=0,u=c*4+(n?2:0)+2,d=u,f=l;{const p=n+o,m=r,g=t+p,v=t-p,x=i+m;if(e[h++]=g,e[h++]=x,e[--u]=x,e[--u]=v,r){const y=i-m;e[d++]=v,e[d++]=y,e[--f]=y,e[--f]=g}}for(let p=1;p0||e&&i<=0){const n=t/2;for(let r=n+n%2;r=6){tv(t,!1);const o=[];for(let l=0;l=0&&r>=0&&o.push(t,i,t+n,i,t+n,i+r,t,i+r)},triangulate(s,e){const t=s.points,i=e.points;if(t.length===0)return;const n=i.length/2;i.push(t[0],t[1],t[2],t[3],t[6],t[7],t[4],t[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},B2={build(s){ih.build(s)},triangulate(s,e){ih.triangulate(s,e)}};var cs=(s=>(s.MITER="miter",s.BEVEL="bevel",s.ROUND="round",s))(cs||{}),or=(s=>(s.BUTT="butt",s.ROUND="round",s.SQUARE="square",s))(or||{});const Jo={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(s,e=20){if(!this.adaptive||!s||isNaN(s))return e;let t=Math.ceil(s/this.maxLength);return tthis.maxSegments&&(t=this.maxSegments),t}};class iv{static curveTo(e,t,i,n,r,o){const a=o[o.length-2],c=o[o.length-1]-t,l=a-e,h=n-t,u=i-e,d=Math.abs(c*u-l*h);if(d<1e-8||r===0)return(o[o.length-2]!==e||o[o.length-1]!==t)&&o.push(e,t),null;const f=c*c+l*l,p=h*h+u*u,m=c*h+l*u,g=r*Math.sqrt(f)/d,v=r*Math.sqrt(p)/d,x=g*m/f,y=v*m/p,_=g*u+v*l,C=g*h+v*c,S=l*(v+x),b=c*(v+x),M=u*(g+y),I=h*(g+y),F=Math.atan2(b-C,S-_),E=Math.atan2(I-C,M-_);return{cx:_+e,cy:C+t,radius:r,startAngle:F,endAngle:E,anticlockwise:l*h>u*c}}static arc(e,t,i,n,r,o,a,c,l){const h=a-o,u=Jo._segmentsCount(Math.abs(h)*r,Math.ceil(Math.abs(h)/Wc)*40),d=h/(u*2),f=d*2,p=Math.cos(d),m=Math.sin(d),g=u-1,v=g%1/g;for(let x=0;x<=g;++x){const y=x+v*x,_=d+o+f*y,C=Math.cos(_),S=-Math.sin(_);l.push((p*C+m*S)*r+i,(p*-S+m*C)*r+n)}}}class L2{constructor(){this.reset()}begin(e,t,i){this.reset(),this.style=e,this.start=t,this.attribStart=i}end(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class ip{static curveLength(e,t,i,n,r,o,a,c){let l=0,h=0,u=0,d=0,f=0,p=0,m=0,g=0,v=0,x=0,y=0,_=e,C=t;for(let S=1;S<=10;++S)h=S/10,u=h*h,d=u*h,f=1-h,p=f*f,m=p*f,g=m*e+3*p*h*i+3*f*u*r+d*a,v=m*t+3*p*h*n+3*f*u*o+d*c,x=_-g,y=C-v,_=g,C=v,l+=Math.sqrt(x*x+y*y);return l}static curveTo(e,t,i,n,r,o,a){const c=a[a.length-2],l=a[a.length-1];a.length-=2;const h=Jo._segmentsCount(ip.curveLength(c,l,e,t,i,n,r,o));let u=0,d=0,f=0,p=0,m=0;a.push(c,l);for(let g=1,v=0;g<=h;++g)v=g/h,u=1-v,d=u*u,f=d*u,p=v*v,m=p*v,a.push(f*c+3*d*v*e+3*u*p*i+m*r,f*l+3*d*v*t+3*u*p*n+m*o)}}function sv(s,e,t,i,n,r,o,a){const c=s-t*n,l=e-i*n,h=s+t*r,u=e+i*r;let d,f;o?(d=i,f=-t):(d=-i,f=t);const p=c+d,m=l+f,g=h+d,v=u+f;return a.push(p,m,g,v),2}function Ir(s,e,t,i,n,r,o,a){const c=t-s,l=i-e;let h=Math.atan2(c,l),u=Math.atan2(n-s,r-e);a&&hu&&(u+=Math.PI*2);let d=h;const f=u-h,p=Math.abs(f),m=Math.sqrt(c*c+l*l),g=(15*p*Math.sqrt(m)/Math.PI>>0)+1,v=f/g;if(d+=v,a){o.push(s,e,t,i);for(let x=1,y=d;x=0&&(r.join===cs.ROUND?d+=Ir(y,_,y-b*O,_-M*O,y-I*O,_-F*O,h,!1)+4:d+=2,h.push(y-I*D,_-F*D,y+I*O,_+F*O));continue}const W=(-b+v)*(-M+_)-(-b+y)*(-M+x),ne=(-I+C)*(-F+_)-(-I+y)*(-F+S),re=(A*ne-L*W)/V,le=(B*W-P*ne)/V,ue=(re-y)*(re-y)+(le-_)*(le-_),ae=y+(re-y)*O,xe=_+(le-_)*O,Y=y-(re-y)*D,j=_-(le-_)*D,H=Math.min(A*A+P*P,L*L+B*B),G=q?O:D,z=H+G*G*m,ie=ue<=z;let fe=r.join;if(fe===cs.MITER&&ue/m>g&&(fe=cs.BEVEL),ie)switch(fe){case cs.MITER:{h.push(ae,xe,Y,j);break}case cs.BEVEL:{q?h.push(ae,xe,y+b*D,_+M*D,ae,xe,y+I*D,_+F*D):h.push(y-b*O,_-M*O,Y,j,y-I*O,_-F*O,Y,j),d+=2;break}case cs.ROUND:{q?(h.push(ae,xe,y+b*D,_+M*D),d+=Ir(y,_,y+b*D,_+M*D,y+I*D,_+F*D,h,!0)+4,h.push(ae,xe,y+I*D,_+F*D)):(h.push(y-b*O,_-M*O,Y,j),d+=Ir(y,_,y-b*O,_-M*O,y-I*O,_-F*O,h,!1)+4,h.push(y-I*O,_-F*O,Y,j));break}}else{switch(h.push(y-b*O,_-M*O,y+b*D,_+M*D),fe){case cs.MITER:{q?h.push(Y,j,Y,j):h.push(ae,xe,ae,xe),d+=2;break}case cs.ROUND:{q?d+=Ir(y,_,y+b*D,_+M*D,y+I*D,_+F*D,h,!0)+2:d+=Ir(y,_,y-b*O,_-M*O,y-I*O,_-F*O,h,!1)+2;break}}h.push(y-I*O,_-F*O,y+I*D,_+F*D),d+=2}}v=i[(u-2)*2],x=i[(u-2)*2+1],y=i[(u-1)*2],_=i[(u-1)*2+1],b=-(x-_),M=v-y,E=Math.sqrt(b*b+M*M),b/=E,M/=E,b*=p,M*=p,h.push(y-b*O,_-M*O,y+b*D,_+M*D),c||(r.cap===or.ROUND?d+=Ir(y-b*(O-D)*.5,_-M*(O-D)*.5,y-b*O,_-M*O,y+b*D,_+M*D,h,!1)+2:r.cap===or.SQUARE&&(d+=sv(y,_,b,M,O,D,!1,h)));const $=e.indices,N=Jo.epsilon*Jo.epsilon;for(let U=f;U0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,t=null,i=null,n=null){const r=new sh(e,t,i,n);return this.graphicsData.push(r),this.dirty++,this}drawHole(e,t=null){if(!this.graphicsData.length)return null;const i=new sh(e,null,null,t),n=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=n.lineStyle,n.holes.push(i),this.dirty++,this}destroy(){super.destroy();for(let e=0;e0&&(i=this.batches[this.batches.length-1],n=i.style);for(let c=this.shapeIndex;c65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(e,t){return!(!e||!t||e.texture.baseTexture!==t.texture.baseTexture||e.color+e.alpha!==t.color+t.alpha||!!e.native!=!!t.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let e=0,t=this.graphicsData.length;e65535*2)return!1;const e=this.batches;for(let t=0;t0&&(n=Jl.pop(),n||(n=new Af,n.texArray=new Pf),this.drawCalls.push(n)),n.start=h,n.size=0,n.texArray.count=0,n.type=l),m.touched=1,m._batchEnabled=e,m._batchLocation=r,m.wrapMode=Is.REPEAT,n.texArray.elements[n.texArray.count++]=m,r++)),n.size+=d.size,h+=d.size,a=m._batchLocation,this.addColors(t,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(i,a,d.attribSize,d.attribStart)}Je._globalBatch=e,this.packAttributes()}packAttributes(){const e=this.points,t=this.uvs,i=this.colors,n=this.textureIds,r=new ArrayBuffer(e.length*3*4),o=new Float32Array(r),a=new Uint32Array(r);let c=0;for(let l=0;l0&&e.alpha>0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:i},e)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new qr,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new qr,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this}lineTo(e,t){this.currentPath||this.moveTo(0,0);const i=this.currentPath.points,n=i[i.length-2],r=i[i.length-1];return(n!==e||r!==t)&&i.push(e,t),this}_initCurve(e=0,t=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,t]):this.moveTo(e,t)}quadraticCurveTo(e,t,i,n){this._initCurve();const r=this.currentPath.points;return r.length===0&&this.moveTo(0,0),sp.curveTo(e,t,i,n,r),this}bezierCurveTo(e,t,i,n,r,o){return this._initCurve(),ip.curveTo(e,t,i,n,r,o,this.currentPath.points),this}arcTo(e,t,i,n,r){this._initCurve(e,t);const o=this.currentPath.points,a=iv.curveTo(e,t,i,n,r,o);if(a){const{cx:c,cy:l,radius:h,startAngle:u,endAngle:d,anticlockwise:f}=a;this.arc(c,l,h,u,d,f)}return this}arc(e,t,i,n,r,o=!1){if(n===r)return this;if(!o&&r<=n?r+=Wc:o&&n<=r&&(n+=Wc),r-n===0)return this;const a=e+Math.cos(n)*i,c=t+Math.sin(n)*i,l=this._geometry.closePointEps;let h=this.currentPath?this.currentPath.points:null;if(h){const u=Math.abs(h[h.length-2]-a),d=Math.abs(h[h.length-1]-c);u0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:i},e)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(e,t,i,n){return this.drawShape(new nt(e,t,i,n))}drawRoundedRect(e,t,i,n,r){return this.drawShape(new Qh(e,t,i,n,r))}drawCircle(e,t,i){return this.drawShape(new Zh(e,t,i))}drawEllipse(e,t,i,n){return this.drawShape(new Jh(e,t,i,n))}drawPolygon(...e){let t,i=!0;const n=e[0];n.points?(i=n.closeStroke,t=n.points):Array.isArray(e[0])?t=e[0]:t=e;const r=new qr(t);return r.closeStroke=i,this.drawShape(r),this}drawShape(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===wi.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)}_render(e){this.finishPoly();const t=this._geometry;t.updateBatches(),t.batchable?(this.batchDirty!==t.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))}_populateBatches(){const e=this._geometry,t=this.blendMode,i=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(e.points);for(let n=0;n{const{worker:t}=new Wf;t.addEventListener("message",i=>{t.terminate(),Wf.revokeObjectURL(),e(i.data)})}),this._isImageBitmapSupported)}loadImageBitmap(e){return this._run("loadImageBitmap",[e])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){Dd===void 0&&(Dd=navigator.hardwareConcurrency||4);let e=this.workerPool.pop();return!e&&this._createdWorkers{this.complete(t.data),this.returnWorker(t.target),this.next()})),e}returnWorker(e){this.workerPool.push(e)}complete(e){e.error!==void 0?this.resolveHash[e.uuid].reject(e.error):this.resolveHash[e.uuid].resolve(e.data),this.resolveHash[e.uuid]=null}async _run(e,t){await this._initWorkers();const i=new Promise((n,r)=>{this.queue.push({id:e,arguments:t,resolve:n,reject:r})});return this.next(),i}next(){if(!this.queue.length)return;const e=this.getWorker();if(!e)return;const t=this.queue.pop(),i=t.id;this.resolveHash[z0]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:z0++,id:i})}}const q0=new BE;function bl(s,e,t){s.resource.internal=!0;const i=new ze(s),n=()=>{delete e.promiseCache[t],Nr.has(t)&&Nr.remove(t)};return i.baseTexture.once("destroyed",()=>{t in e.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),n())}),i.once("destroyed",()=>{s.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),n())}),i}const LE=[".jpeg",".jpg",".png",".webp",".avif"],DE=["image/jpeg","image/png","image/webp","image/avif"];async function NE(s){const e=await ke.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${s}: ${e.status} ${e.statusText}`);const t=await e.blob();return await createImageBitmap(t)}const tu={name:"loadTextures",extension:{type:Pe.LoadParser,priority:ns.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(s){return aa(s,DE)||Ki(s,LE)},async load(s,e,t){var a;const i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let n;i?this.config.preferWorkers&&await q0.isImageBitmapSupported()?n=await q0.loadImageBitmap(s):n=await NE(s):n=await new Promise((c,l)=>{const h=new Image;h.crossOrigin=this.config.crossOrigin,h.src=s,h.complete?c(h):(h.onload=()=>c(h),h.onerror=u=>l(u))});const r={...e.data};r.resolution??(r.resolution=Dn(s)),i&&((a=r.resourceOptions)==null?void 0:a.ownsImageBitmap)===void 0&&(r.resourceOptions={...r.resourceOptions},r.resourceOptions.ownsImageBitmap=!0);const o=new Je(n,r);return o.resource.src=s,bl(o,t,s)},unload(s){s.destroy(!0)}};Ne.add(tu);const UE=".svg",$E="image/svg+xml",XE={extension:{type:Pe.LoadParser,priority:ns.High},name:"loadSVG",test(s){return aa(s,$E)||Ki(s,UE)},async testParse(s){return Df.test(s)},async parse(s,e,t){var r;const i=new Df(s,(r=e==null?void 0:e.data)==null?void 0:r.resourceOptions);await i.load();const n=new Je(i,{resolution:Dn(s),...e==null?void 0:e.data});return n.resource.src=e.src,bl(n,t,e.src)},async load(s,e){return(await ke.ADAPTER.fetch(s)).text()},unload:tu.unload};Ne.add(XE);const VE=[".mp4",".m4v",".webm",".ogv"],YE=["video/mp4","video/webm","video/ogg"],GE={name:"loadVideo",extension:{type:Pe.LoadParser,priority:ns.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test(s){return aa(s,YE)||Ki(s,VE)},async load(s,e,t){var o;let i;const n=await(await ke.ADAPTER.fetch(s)).blob(),r=URL.createObjectURL(n);try{const a={autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...(o=e==null?void 0:e.data)==null?void 0:o.resourceOptions,autoLoad:!0},c=new Sb(r,a);await c.load();const l=new Je(c,{alphaMode:await ZM(),resolution:Dn(s),...e==null?void 0:e.data});l.resource.src=s,i=bl(l,t,s),i.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(r)})}catch(a){throw URL.revokeObjectURL(r),a}return i},unload(s){s.destroy(!0)}};Ne.add(GE);class HE{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e=="string")this._defaultSearchParams=e;else{const t=e;this._defaultSearchParams=Object.keys(t).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`).join("&")}}getAlias(e){const{alias:t,name:i,src:n,srcs:r}=e;return Ts(t||i||n||r,o=>typeof o=="string"?o:Array.isArray(o)?o.map(a=>(a==null?void 0:a.src)??(a==null?void 0:a.srcs)??a):o!=null&&o.src||o!=null&&o.srcs?o.src??o.srcs:o,!0)}addManifest(e){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(t=>{this.addBundle(t.name,t.assets)})}addBundle(e,t){const i=[];Array.isArray(t)?t.forEach(n=>{const r=n.src??n.srcs,o=n.alias??n.name;let a;if(typeof o=="string"){const c=this._createBundleAssetId(e,o);i.push(c),a=[o,c]}else{const c=o.map(l=>this._createBundleAssetId(e,l));i.push(...c),a=[...o,...c]}this.add({...n,alias:a,src:r})}):Object.keys(t).forEach(n=>{const r=[n,this._createBundleAssetId(e,n)];if(typeof t[n]=="string")this.add({alias:r,src:t[n]});else if(Array.isArray(t[n]))this.add({alias:r,src:t[n]});else{const o=t[n],a=o.src??o.srcs;this.add({...o,alias:r,src:Array.isArray(a)?a:[a]})}i.push(...r)}),this._bundles[e]=i}add(e,t,i,n,r){const o=[];typeof e=="string"||Array.isArray(e)&&typeof e[0]=="string"?(ct("7.2.0",`Assets.add now uses an object instead of individual parameters. +Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),o.push({alias:e,src:t,data:i,format:n,loadParser:r})):Array.isArray(e)?o.push(...e):o.push(e);let a;a=c=>{this.hasKey(c)&&console.warn(`[Resolver] already has key: ${c} overwriting`)},Ts(o).forEach(c=>{const{src:l,srcs:h}=c;let{data:u,format:d,loadParser:f}=c;const p=Ts(l||h).map(v=>typeof v=="string"?gE(v):Array.isArray(v)?v:[v]),m=this.getAlias(c);Array.isArray(m)?m.forEach(a):a(m);const g=[];p.forEach(v=>{v.forEach(x=>{let y={};if(typeof x!="object"){y.src=x;for(let _=0;_{this._assetMap[v]=g})})}resolveBundle(e){const t=eh(e);e=Ts(e);const i={};return e.forEach(n=>{const r=this._bundles[n];if(r){const o=this.resolve(r),a={};for(const c in o){const l=o[c];a[this._extractAssetIdFromBundle(n,c)]=l}i[n]=a}}),t?i[e[0]]:i}resolveUrl(e){const t=this.resolve(e);if(typeof e!="string"){const i={};for(const n in t)i[n]=t[n].src;return i}return t.src}resolve(e){const t=eh(e);e=Ts(e);const i={};return e.forEach(n=>{if(!this._resolverHash[n])if(this._assetMap[n]){let r=this._assetMap[n];const o=r[0],a=this._getPreferredOrder(r);a==null||a.priority.forEach(c=>{a.params[c].forEach(l=>{const h=r.filter(u=>u[c]?u[c]===l:!1);h.length&&(r=h)})}),this._resolverHash[n]=r[0]??o}else this._resolverHash[n]=this.buildResolvedAsset({alias:[n],src:n},{});i[n]=this._resolverHash[n]}),t?i[e[0]]:i}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;tr.params.format.includes(i.format));if(n)return n}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const t=/\?/.test(e)?"&":"?";return`${e}${t}${this._defaultSearchParams}`}buildResolvedAsset(e,t){const{aliases:i,data:n,loadParser:r,format:o}=t;return(this._basePath||this._rootPath)&&(e.src=Zt.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=i??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...n||{},...e.data},e.loadParser=r??e.loadParser,e.format=o??e.format??Zt.extname(e.src).slice(1),e.srcs=e.src,e.name=e.alias,e}}class jE{constructor(){this._detections=[],this._initialized=!1,this.resolver=new HE,this.loader=new yE,this.cache=Nr,this._backgroundLoader=new pE(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(e={}){var r,o;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=!0,e.defaultSearchParams&&this.resolver.setDefaultSearchParams(e.defaultSearchParams),e.basePath&&(this.resolver.basePath=e.basePath),e.bundleIdentifier&&this.resolver.setBundleIdentifier(e.bundleIdentifier),e.manifest){let a=e.manifest;typeof a=="string"&&(a=await this.load(a)),this.resolver.addManifest(a)}const t=((r=e.texturePreference)==null?void 0:r.resolution)??1,i=typeof t=="number"?[t]:t,n=await this._detectFormats({preferredFormats:(o=e.texturePreference)==null?void 0:o.format,skipDetections:e.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:n,resolution:i}}),e.preferences&&this.setPreferences(e.preferences)}add(e,t,i,n,r){this.resolver.add(e,t,i,n,r)}async load(e,t){this._initialized||await this.init();const i=eh(e),n=Ts(e).map(a=>{if(typeof a!="string"){const c=this.resolver.getAlias(a);return c.some(l=>!this.resolver.hasKey(l))&&this.add(a),Array.isArray(c)?c[0]:c}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),r=this.resolver.resolve(n),o=await this._mapLoadToResolve(r,t);return i?o[n[0]]:o}addBundle(e,t){this.resolver.addBundle(e,t)}async loadBundle(e,t){this._initialized||await this.init();let i=!1;typeof e=="string"&&(i=!0,e=[e]);const n=this.resolver.resolveBundle(e),r={},o=Object.keys(n);let a=0,c=0;const l=()=>{t==null||t(++a/c)},h=o.map(u=>{const d=n[u];return c+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(f=>{r[u]=f})});return await Promise.all(h),i?r[e[0]]:r}async backgroundLoad(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const t=this.resolver.resolve(e);this._backgroundLoader.add(Object.values(t))}async backgroundLoadBundle(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const t=this.resolver.resolveBundle(e);Object.values(t).forEach(i=>{this._backgroundLoader.add(Object.values(i))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(e){if(typeof e=="string")return Nr.get(e);const t={};for(let i=0;i{const l=r[a.src],h=[a.src];a.alias&&h.push(...a.alias),o[n[c]]=l,Nr.set(h,l)}),o}async unload(e){this._initialized||await this.init();const t=Ts(e).map(n=>typeof n!="string"?n.src:n),i=this.resolver.resolve(t);await this._unloadFromResolved(i)}async unloadBundle(e){this._initialized||await this.init(),e=Ts(e);const t=this.resolver.resolveBundle(e),i=Object.keys(t).map(n=>this._unloadFromResolved(t[n]));await Promise.all(i)}async _unloadFromResolved(e){const t=Object.values(e);t.forEach(i=>{Nr.remove(i.src)}),await this.loader.unload(t)}async _detectFormats(e){let t=[];e.preferredFormats&&(t=Array.isArray(e.preferredFormats)?e.preferredFormats:[e.preferredFormats]);for(const i of e.detections)e.skipDetections||await i.test()?t=await i.add(t):e.skipDetections||(t=await i.remove(t));return t=t.filter((i,n)=>t.indexOf(i)===n),t}get detections(){return this._detections}get preferWorkers(){return tu.config.preferWorkers}set preferWorkers(e){ct("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:e})}setPreferences(e){this.loader.parsers.forEach(t=>{t.config&&Object.keys(t.config).filter(i=>i in e).forEach(i=>{t.config[i]=e[i]})})}}const tn=new jE;Ne.handleByList(Pe.LoadParser,tn.loader.parsers).handleByList(Pe.ResolveParser,tn.resolver.parsers).handleByList(Pe.CacheParser,tn.cache.parsers).handleByList(Pe.DetectionParser,tn.detections);const WE={extension:Pe.CacheParser,test:s=>Array.isArray(s)&&s.every(e=>e instanceof ze),getCacheableAssets:(s,e)=>{const t={};return s.forEach(i=>{e.forEach((n,r)=>{t[i+(r===0?"":r+1)]=n})}),t}};Ne.add(WE);async function Pb(s){if("Image"in globalThis)return new Promise(e=>{const t=new Image;t.onload=()=>{e(!0)},t.onerror=()=>{e(!1)},t.src=s});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const e=await(await fetch(s)).blob();await createImageBitmap(e)}catch{return!1}return!0}return!1}const zE={extension:{type:Pe.DetectionParser,priority:1},test:async()=>Pb("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async s=>[...s,"avif"],remove:async s=>s.filter(e=>e!=="avif")};Ne.add(zE);const qE={extension:{type:Pe.DetectionParser,priority:0},test:async()=>Pb("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async s=>[...s,"webp"],remove:async s=>s.filter(e=>e!=="webp")};Ne.add(qE);const K0=["png","jpg","jpeg"],KE={extension:{type:Pe.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async s=>[...s,...K0],remove:async s=>s.filter(e=>!K0.includes(e))};Ne.add(KE);const ZE="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function tp(s){return ZE?!1:document.createElement("video").canPlayType(s)!==""}const JE={extension:{type:Pe.DetectionParser,priority:0},test:async()=>tp("video/webm"),add:async s=>[...s,"webm"],remove:async s=>s.filter(e=>e!=="webm")};Ne.add(JE);const QE={extension:{type:Pe.DetectionParser,priority:0},test:async()=>tp("video/mp4"),add:async s=>[...s,"mp4","m4v"],remove:async s=>s.filter(e=>e!=="mp4"&&e!=="m4v")};Ne.add(QE);const e2={extension:{type:Pe.DetectionParser,priority:0},test:async()=>tp("video/ogg"),add:async s=>[...s,"ogv"],remove:async s=>s.filter(e=>e!=="ogv")};Ne.add(e2);const t2={extension:Pe.ResolveParser,test:tu.test,parse:s=>{var e;return{resolution:parseFloat(((e=ke.RETINA_PREFIX.exec(s))==null?void 0:e[1])??"1"),format:Zt.extname(s).slice(1),src:s}}};Ne.add(t2);var gi=(s=>(s[s.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",s[s.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",s[s.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",s[s.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",s[s.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",s[s.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",s[s.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",s[s.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",s[s.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",s[s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",s[s.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",s[s.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",s[s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",s[s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",s[s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",s[s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",s[s.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",s[s.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",s[s.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",s[s.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",s[s.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",s[s.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",s[s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",s[s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",s[s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",s))(gi||{});const th={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1};let Ns,Eo;function Z0(){Eo={bptc:Ns.getExtension("EXT_texture_compression_bptc"),astc:Ns.getExtension("WEBGL_compressed_texture_astc"),etc:Ns.getExtension("WEBGL_compressed_texture_etc"),s3tc:Ns.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:Ns.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:Ns.getExtension("WEBGL_compressed_texture_pvrtc")||Ns.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:Ns.getExtension("WEBGL_compressed_texture_etc1"),atc:Ns.getExtension("WEBGL_compressed_texture_atc")}}const i2={extension:{type:Pe.DetectionParser,priority:2},test:async()=>{const s=ke.ADAPTER.createCanvas().getContext("webgl");return s?(Ns=s,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async s=>{Eo||Z0();const e=[];for(const t in Eo)Eo[t]&&e.push(t);return[...e,...s]},remove:async s=>(Eo||Z0(),s.filter(e=>!(e in Eo)))};Ne.add(i2);class s2 extends Kh{constructor(e,t={width:1,height:1,autoLoad:!0}){let i,n;typeof e=="string"?(i=e,n=new Uint8Array):(i=null,n=e),super(n,t),this.origin=i,this.buffer=n?new Tf(n):null,this._load=null,this.loaded=!1,this.origin!==null&&t.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(e){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(e=>e.blob()).then(e=>e.arrayBuffer()).then(e=>(this.data=new Uint32Array(e),this.buffer=new Tf(e),this.loaded=!0,this.onBlobLoaded(e),this.update(),this)),this._load)}}class Kr extends s2{constructor(e,t){super(e,t),this.format=t.format,this.levels=t.levels||1,this._width=t.width,this._height=t.height,this._extension=Kr._formatToExtension(this.format),(t.levelBuffers||this.buffer)&&(this._levelBuffers=t.levelBuffers||Kr._createLevelBuffers(e instanceof Uint8Array?e:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(e,t,i){const n=e.gl;if(!e.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;n.pixelStorei(n.UNPACK_ALIGNMENT,4);for(let r=0,o=this.levels;r=33776&&e<=33779)return"s3tc";if(e>=35916&&e<=35919)return"s3tc_sRGB";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e===36196)return"etc1";if(e===35986||e===35987||e===34798)return"atc";if(e>=36492&&e<=36495)return"bptc";if(e===37808)return"astc";throw new Error(`Invalid (compressed) texture format given: ${e}`)}static _createLevelBuffers(e,t,i,n,r,o,a){const c=new Array(i);let l=e.byteOffset,h=o,u=a,d=h+n-1&~(n-1),f=u+r-1&~(r-1),p=d*f*th[t];for(let m=0;m1?h:d,levelHeight:i>1?u:f,levelBuffer:new Uint8Array(e.buffer,l,p)},l+=p,h=h>>1||1,u=u>>1||1,d=h+n-1&~(n-1),f=u+r-1&~(r-1),p=d*f*th[t];return c}}const Nd=4,zl=124,n2=32,J0=20,r2=542327876,ql={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},o2={FOURCC:2},Kl={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},a2=1,l2=2,c2=4,h2=64,u2=512,d2=131072,f2=827611204,m2=861165636,p2=894720068,g2=808540228,v2=4,y2={[f2]:gi.COMPRESSED_RGBA_S3TC_DXT1_EXT,[m2]:gi.COMPRESSED_RGBA_S3TC_DXT3_EXT,[p2]:gi.COMPRESSED_RGBA_S3TC_DXT5_EXT},x2={70:gi.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:gi.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:gi.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:gi.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:gi.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:gi.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:gi.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:gi.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:gi.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:gi.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:gi.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:gi.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:gi.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function b2(s){const e=new Uint32Array(s);if(e[0]!==r2)throw new Error("Invalid DDS file magic word");const t=new Uint32Array(s,0,zl/Uint32Array.BYTES_PER_ELEMENT),i=t[ql.HEIGHT],n=t[ql.WIDTH],r=t[ql.MIPMAP_COUNT],o=new Uint32Array(s,ql.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,n2/Uint32Array.BYTES_PER_ELEMENT),a=o[a2];if(a&c2){const c=o[o2.FOURCC];if(c!==g2){const x=y2[c],y=Nd+zl,_=new Uint8Array(s,y);return[new Kr(_,{format:x,width:n,height:i,levels:r})]}const l=Nd+zl,h=new Uint32Array(e.buffer,l,J0/Uint32Array.BYTES_PER_ELEMENT),u=h[Kl.DXGI_FORMAT],d=h[Kl.RESOURCE_DIMENSION],f=h[Kl.MISC_FLAG],p=h[Kl.ARRAY_SIZE],m=x2[u];if(m===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===v2)throw new Error("DDSParser does not support cubemap textures");if(d===6)throw new Error("DDSParser does not supported 3D texture data");const g=new Array,v=Nd+zl+J0;if(p===1)g.push(new Uint8Array(s,v));else{const x=th[m];let y=0,_=n,C=i;for(let b=0;b>>1,C=C>>>1}let S=v;for(let b=0;bnew Kr(x,{format:m,width:n,height:i,levels:r}))}throw a&h2?new Error("DDSParser does not support uncompressed texture data."):a&u2?new Error("DDSParser does not supported YUV uncompressed texture data."):a&d2?new Error("DDSParser does not support single-channel (lumninance) texture data!"):a&l2?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const Q0=[171,75,84,88,32,49,49,187,13,10,26,10],w2=67305985,xs={ENDIANNESS:12,GL_TYPE:16,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},zf=64,ev={[De.UNSIGNED_BYTE]:1,[De.UNSIGNED_SHORT]:2,[De.INT]:4,[De.UNSIGNED_INT]:4,[De.FLOAT]:4,[De.HALF_FLOAT]:8},S2={[Se.RGBA]:4,[Se.RGB]:3,[Se.RG]:2,[Se.RED]:1,[Se.LUMINANCE]:1,[Se.LUMINANCE_ALPHA]:2,[Se.ALPHA]:1},_2={[De.UNSIGNED_SHORT_4_4_4_4]:2,[De.UNSIGNED_SHORT_5_5_5_1]:2,[De.UNSIGNED_SHORT_5_6_5]:2};function T2(s,e,t=!1){const i=new DataView(e);if(!M2(s,i))return null;const n=i.getUint32(xs.ENDIANNESS,!0)===w2,r=i.getUint32(xs.GL_TYPE,n),o=i.getUint32(xs.GL_FORMAT,n),a=i.getUint32(xs.GL_INTERNAL_FORMAT,n),c=i.getUint32(xs.PIXEL_WIDTH,n),l=i.getUint32(xs.PIXEL_HEIGHT,n)||1,h=i.getUint32(xs.PIXEL_DEPTH,n)||1,u=i.getUint32(xs.NUMBER_OF_ARRAY_ELEMENTS,n)||1,d=i.getUint32(xs.NUMBER_OF_FACES,n),f=i.getUint32(xs.NUMBER_OF_MIPMAP_LEVELS,n),p=i.getUint32(xs.BYTES_OF_KEY_VALUE_DATA,n);if(l===0||h!==1)throw new Error("Only 2D textures are supported");if(d!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");const m=4,g=4,v=c+3&-4,x=l+3&-4,y=new Array(u);let _=c*l;r===0&&(_=v*x);let C;if(r!==0?ev[r]?C=ev[r]*S2[o]:C=_2[r]:C=th[a],C===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const S=t?A2(i,p,n):null;let b=_*C,M=c,I=l,F=v,E=x,k=zf+p;for(let O=0;O1||r!==0?M:F,levelHeight:f>1||r!==0?I:E,levelBuffer:new Uint8Array(e,$,b)},$+=b}k+=D+4,k=k%4!==0?k+4-k%4:k,M=M>>1||1,I=I>>1||1,F=M+m-1&-4,E=I+g-1&-4,b=F*E*C}return r!==0?{uncompressed:y.map(O=>{let D=O[0].levelBuffer,$=!1;return r===De.FLOAT?D=new Float32Array(O[0].levelBuffer.buffer,O[0].levelBuffer.byteOffset,O[0].levelBuffer.byteLength/4):r===De.UNSIGNED_INT?($=!0,D=new Uint32Array(O[0].levelBuffer.buffer,O[0].levelBuffer.byteOffset,O[0].levelBuffer.byteLength/4)):r===De.INT&&($=!0,D=new Int32Array(O[0].levelBuffer.buffer,O[0].levelBuffer.byteOffset,O[0].levelBuffer.byteLength/4)),{resource:new Kh(D,{width:O[0].levelWidth,height:O[0].levelHeight}),type:r,format:$?C2(o):o}}),kvData:S}:{compressed:y.map(O=>new Kr(null,{format:a,width:c,height:l,levels:f,levelBuffers:O})),kvData:S}}function M2(s,e){for(let t=0;te-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let c=0;for(;c{const o=new Je(r,{mipmap:gs.OFF,alphaMode:mi.NO_PREMULTIPLIED_ALPHA,resolution:Dn(s),...e.data});return bl(o,t,s)});return n.length===1?n[0]:n},unload(s){Array.isArray(s)?s.forEach(e=>e.destroy(!0)):s.destroy(!0)}};Ne.add(E2);const I2={extension:{type:Pe.LoadParser,priority:ns.High},name:"loadKTX",test(s){return Ki(s,".ktx")},async load(s,e,t){const i=await(await ke.ADAPTER.fetch(s)).arrayBuffer(),{compressed:n,uncompressed:r,kvData:o}=T2(s,i),a=n??r,c={mipmap:gs.OFF,alphaMode:mi.NO_PREMULTIPLIED_ALPHA,resolution:Dn(s),...e.data},l=a.map(h=>{a===r&&Object.assign(c,{type:h.type,format:h.format});const u=h.resource??h,d=new Je(u,c);return d.ktxKeyValueData=o,bl(d,t,s)});return l.length===1?l[0]:l},unload(s){Array.isArray(s)?s.forEach(e=>e.destroy(!0)):s.destroy(!0)}};Ne.add(I2);const R2=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],P2={extension:Pe.ResolveParser,test:s=>{const e=Zt.extname(s).slice(1);return["basis","ktx","dds"].includes(e)},parse:s=>{var i,n;const e=s.split("."),t=e.pop();if(["ktx","dds"].includes(t)){const r=e.pop();if(R2.includes(r))return{resolution:parseFloat(((i=ke.RETINA_PREFIX.exec(s))==null?void 0:i[1])??"1"),format:r,src:s}}return{resolution:parseFloat(((n=ke.RETINA_PREFIX.exec(s))==null?void 0:n[1])??"1"),format:t,src:s}}};Ne.add(P2);const Zl=new nt,k2=4,kb=class Fa{constructor(e){this.renderer=e,this._rendererPremultipliedAlpha=!1}contextChange(){var t;const e=(t=this.renderer)==null?void 0:t.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}async image(e,t,i,n){const r=new Image;return r.src=await this.base64(e,t,i,n),r}async base64(e,t,i,n){const r=this.canvas(e,n);if(r.toBlob!==void 0)return new Promise((o,a)=>{r.toBlob(c=>{if(!c){a(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>o(l.result),l.onerror=a,l.readAsDataURL(c)},t,i)});if(r.toDataURL!==void 0)return r.toDataURL(t,i);if(r.convertToBlob!==void 0){const o=await r.convertToBlob({type:t,quality:i});return new Promise((a,c)=>{const l=new FileReader;l.onload=()=>a(l.result),l.onerror=c,l.readAsDataURL(o)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e,t){const{pixels:i,width:n,height:r,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,t);o&&Fa._flipY(i,n,r),a&&Fa._unpremultiplyAlpha(i);const c=new fC(n,r,1),l=new ImageData(new Uint8ClampedArray(i.buffer),n,r);return c.context.putImageData(l,0,0),c.canvas}pixels(e,t){const{pixels:i,width:n,height:r,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,t);return o&&Fa._flipY(i,n,r),a&&Fa._unpremultiplyAlpha(i),i}_rawPixels(e,t){const i=this.renderer;if(!i)throw new Error("The Extract has already been destroyed");let n,r=!1,o=!1,a,c=!1;e&&(e instanceof oo?a=e:(a=i.generateTexture(e,{region:t,resolution:i.resolution,multisample:i.multisample}),c=!0,t&&(Zl.width=t.width,Zl.height=t.height,t=Zl)));const l=i.gl;if(a){if(n=a.baseTexture.resolution,t=t??a.frame,r=!1,o=a.baseTexture.alphaMode>0&&a.baseTexture.format===Se.RGBA,!c){i.renderTexture.bind(a);const f=a.framebuffer.glFramebuffers[i.CONTEXT_UID];f.blitFramebuffer&&i.framebuffer.bind(f.blitFramebuffer)}}else n=i.resolution,t||(t=Zl,t.width=i.width/n,t.height=i.height/n),r=!0,o=this._rendererPremultipliedAlpha,i.renderTexture.bind();const h=Math.max(Math.round(t.width*n),1),u=Math.max(Math.round(t.height*n),1),d=new Uint8Array(k2*h*u);return l.readPixels(Math.round(t.x*n),Math.round(t.y*n),h,u,l.RGBA,l.UNSIGNED_BYTE,d),c&&(a==null||a.destroy(!0)),{pixels:d,width:h,height:u,flipY:r,premultipliedAlpha:o}}destroy(){this.renderer=null}static _flipY(e,t,i){const n=t<<2,r=i>>1,o=new Uint8Array(n);for(let a=0;a=0&&a>=0&&n>=0&&r>=0)){e.length=0;return}const c=Math.ceil(2.3*Math.sqrt(o+a)),l=c*8+(n?4:0)+(r?4:0);if(e.length=l,l===0)return;if(c===0){e.length=8,e[0]=e[6]=t+n,e[1]=e[3]=i+r,e[2]=e[4]=t-n,e[5]=e[7]=i-r;return}let h=0,u=c*4+(n?2:0)+2,d=u,f=l;{const p=n+o,m=r,g=t+p,v=t-p,x=i+m;if(e[h++]=g,e[h++]=x,e[--u]=x,e[--u]=v,r){const y=i-m;e[d++]=v,e[d++]=y,e[--f]=y,e[--f]=g}}for(let p=1;p0||e&&i<=0){const n=t/2;for(let r=n+n%2;r=6){tv(t,!1);const o=[];for(let l=0;l=0&&r>=0&&o.push(t,i,t+n,i,t+n,i+r,t,i+r)},triangulate(s,e){const t=s.points,i=e.points;if(t.length===0)return;const n=i.length/2;i.push(t[0],t[1],t[2],t[3],t[6],t[7],t[4],t[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},B2={build(s){ih.build(s)},triangulate(s,e){ih.triangulate(s,e)}};var cs=(s=>(s.MITER="miter",s.BEVEL="bevel",s.ROUND="round",s))(cs||{}),or=(s=>(s.BUTT="butt",s.ROUND="round",s.SQUARE="square",s))(or||{});const Jo={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(s,e=20){if(!this.adaptive||!s||isNaN(s))return e;let t=Math.ceil(s/this.maxLength);return tthis.maxSegments&&(t=this.maxSegments),t}};class iv{static curveTo(e,t,i,n,r,o){const a=o[o.length-2],c=o[o.length-1]-t,l=a-e,h=n-t,u=i-e,d=Math.abs(c*u-l*h);if(d<1e-8||r===0)return(o[o.length-2]!==e||o[o.length-1]!==t)&&o.push(e,t),null;const f=c*c+l*l,p=h*h+u*u,m=c*h+l*u,g=r*Math.sqrt(f)/d,v=r*Math.sqrt(p)/d,x=g*m/f,y=v*m/p,_=g*u+v*l,C=g*h+v*c,S=l*(v+x),b=c*(v+x),M=u*(g+y),I=h*(g+y),F=Math.atan2(b-C,S-_),E=Math.atan2(I-C,M-_);return{cx:_+e,cy:C+t,radius:r,startAngle:F,endAngle:E,anticlockwise:l*h>u*c}}static arc(e,t,i,n,r,o,a,c,l){const h=a-o,u=Jo._segmentsCount(Math.abs(h)*r,Math.ceil(Math.abs(h)/Wc)*40),d=h/(u*2),f=d*2,p=Math.cos(d),m=Math.sin(d),g=u-1,v=g%1/g;for(let x=0;x<=g;++x){const y=x+v*x,_=d+o+f*y,C=Math.cos(_),S=-Math.sin(_);l.push((p*C+m*S)*r+i,(p*-S+m*C)*r+n)}}}class L2{constructor(){this.reset()}begin(e,t,i){this.reset(),this.style=e,this.start=t,this.attribStart=i}end(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class ip{static curveLength(e,t,i,n,r,o,a,c){let l=0,h=0,u=0,d=0,f=0,p=0,m=0,g=0,v=0,x=0,y=0,_=e,C=t;for(let S=1;S<=10;++S)h=S/10,u=h*h,d=u*h,f=1-h,p=f*f,m=p*f,g=m*e+3*p*h*i+3*f*u*r+d*a,v=m*t+3*p*h*n+3*f*u*o+d*c,x=_-g,y=C-v,_=g,C=v,l+=Math.sqrt(x*x+y*y);return l}static curveTo(e,t,i,n,r,o,a){const c=a[a.length-2],l=a[a.length-1];a.length-=2;const h=Jo._segmentsCount(ip.curveLength(c,l,e,t,i,n,r,o));let u=0,d=0,f=0,p=0,m=0;a.push(c,l);for(let g=1,v=0;g<=h;++g)v=g/h,u=1-v,d=u*u,f=d*u,p=v*v,m=p*v,a.push(f*c+3*d*v*e+3*u*p*i+m*r,f*l+3*d*v*t+3*u*p*n+m*o)}}function sv(s,e,t,i,n,r,o,a){const c=s-t*n,l=e-i*n,h=s+t*r,u=e+i*r;let d,f;o?(d=i,f=-t):(d=-i,f=t);const p=c+d,m=l+f,g=h+d,v=u+f;return a.push(p,m,g,v),2}function Ir(s,e,t,i,n,r,o,a){const c=t-s,l=i-e;let h=Math.atan2(c,l),u=Math.atan2(n-s,r-e);a&&hu&&(u+=Math.PI*2);let d=h;const f=u-h,p=Math.abs(f),m=Math.sqrt(c*c+l*l),g=(15*p*Math.sqrt(m)/Math.PI>>0)+1,v=f/g;if(d+=v,a){o.push(s,e,t,i);for(let x=1,y=d;x=0&&(r.join===cs.ROUND?d+=Ir(y,_,y-b*O,_-M*O,y-I*O,_-F*O,h,!1)+4:d+=2,h.push(y-I*D,_-F*D,y+I*O,_+F*O));continue}const W=(-b+v)*(-M+_)-(-b+y)*(-M+x),ne=(-I+C)*(-F+_)-(-I+y)*(-F+S),re=(A*ne-L*W)/V,le=(B*W-P*ne)/V,ue=(re-y)*(re-y)+(le-_)*(le-_),ae=y+(re-y)*O,xe=_+(le-_)*O,Y=y-(re-y)*D,j=_-(le-_)*D,H=Math.min(A*A+P*P,L*L+B*B),G=q?O:D,z=H+G*G*m,ie=ue<=z;let fe=r.join;if(fe===cs.MITER&&ue/m>g&&(fe=cs.BEVEL),ie)switch(fe){case cs.MITER:{h.push(ae,xe,Y,j);break}case cs.BEVEL:{q?h.push(ae,xe,y+b*D,_+M*D,ae,xe,y+I*D,_+F*D):h.push(y-b*O,_-M*O,Y,j,y-I*O,_-F*O,Y,j),d+=2;break}case cs.ROUND:{q?(h.push(ae,xe,y+b*D,_+M*D),d+=Ir(y,_,y+b*D,_+M*D,y+I*D,_+F*D,h,!0)+4,h.push(ae,xe,y+I*D,_+F*D)):(h.push(y-b*O,_-M*O,Y,j),d+=Ir(y,_,y-b*O,_-M*O,y-I*O,_-F*O,h,!1)+4,h.push(y-I*O,_-F*O,Y,j));break}}else{switch(h.push(y-b*O,_-M*O,y+b*D,_+M*D),fe){case cs.MITER:{q?h.push(Y,j,Y,j):h.push(ae,xe,ae,xe),d+=2;break}case cs.ROUND:{q?d+=Ir(y,_,y+b*D,_+M*D,y+I*D,_+F*D,h,!0)+2:d+=Ir(y,_,y-b*O,_-M*O,y-I*O,_-F*O,h,!1)+2;break}}h.push(y-I*O,_-F*O,y+I*D,_+F*D),d+=2}}v=i[(u-2)*2],x=i[(u-2)*2+1],y=i[(u-1)*2],_=i[(u-1)*2+1],b=-(x-_),M=v-y,E=Math.sqrt(b*b+M*M),b/=E,M/=E,b*=p,M*=p,h.push(y-b*O,_-M*O,y+b*D,_+M*D),c||(r.cap===or.ROUND?d+=Ir(y-b*(O-D)*.5,_-M*(O-D)*.5,y-b*O,_-M*O,y+b*D,_+M*D,h,!1)+2:r.cap===or.SQUARE&&(d+=sv(y,_,b,M,O,D,!1,h)));const $=e.indices,N=Jo.epsilon*Jo.epsilon;for(let U=f;U0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,t=null,i=null,n=null){const r=new sh(e,t,i,n);return this.graphicsData.push(r),this.dirty++,this}drawHole(e,t=null){if(!this.graphicsData.length)return null;const i=new sh(e,null,null,t),n=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=n.lineStyle,n.holes.push(i),this.dirty++,this}destroy(){super.destroy();for(let e=0;e0&&(i=this.batches[this.batches.length-1],n=i.style);for(let c=this.shapeIndex;c65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(e,t){return!(!e||!t||e.texture.baseTexture!==t.texture.baseTexture||e.color+e.alpha!==t.color+t.alpha||!!e.native!=!!t.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let e=0,t=this.graphicsData.length;e65535*2)return!1;const e=this.batches;for(let t=0;t0&&(n=Jl.pop(),n||(n=new Af,n.texArray=new Pf),this.drawCalls.push(n)),n.start=h,n.size=0,n.texArray.count=0,n.type=l),m.touched=1,m._batchEnabled=e,m._batchLocation=r,m.wrapMode=Is.REPEAT,n.texArray.elements[n.texArray.count++]=m,r++)),n.size+=d.size,h+=d.size,a=m._batchLocation,this.addColors(t,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(i,a,d.attribSize,d.attribStart)}Je._globalBatch=e,this.packAttributes()}packAttributes(){const e=this.points,t=this.uvs,i=this.colors,n=this.textureIds,r=new ArrayBuffer(e.length*3*4),o=new Float32Array(r),a=new Uint32Array(r);let c=0;for(let l=0;l0&&e.alpha>0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:i},e)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new qr,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new qr,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this}lineTo(e,t){this.currentPath||this.moveTo(0,0);const i=this.currentPath.points,n=i[i.length-2],r=i[i.length-1];return(n!==e||r!==t)&&i.push(e,t),this}_initCurve(e=0,t=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,t]):this.moveTo(e,t)}quadraticCurveTo(e,t,i,n){this._initCurve();const r=this.currentPath.points;return r.length===0&&this.moveTo(0,0),sp.curveTo(e,t,i,n,r),this}bezierCurveTo(e,t,i,n,r,o){return this._initCurve(),ip.curveTo(e,t,i,n,r,o,this.currentPath.points),this}arcTo(e,t,i,n,r){this._initCurve(e,t);const o=this.currentPath.points,a=iv.curveTo(e,t,i,n,r,o);if(a){const{cx:c,cy:l,radius:h,startAngle:u,endAngle:d,anticlockwise:f}=a;this.arc(c,l,h,u,d,f)}return this}arc(e,t,i,n,r,o=!1){if(n===r)return this;if(!o&&r<=n?r+=Wc:o&&n<=r&&(n+=Wc),r-n===0)return this;const a=e+Math.cos(n)*i,c=t+Math.sin(n)*i,l=this._geometry.closePointEps;let h=this.currentPath?this.currentPath.points:null;if(h){const u=Math.abs(h[h.length-2]-a),d=Math.abs(h[h.length-1]-c);u0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:i},e)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(e,t,i,n){return this.drawShape(new nt(e,t,i,n))}drawRoundedRect(e,t,i,n,r){return this.drawShape(new Qh(e,t,i,n,r))}drawCircle(e,t,i){return this.drawShape(new Zh(e,t,i))}drawEllipse(e,t,i,n){return this.drawShape(new Jh(e,t,i,n))}drawPolygon(...e){let t,i=!0;const n=e[0];n.points?(i=n.closeStroke,t=n.points):Array.isArray(e[0])?t=e[0]:t=e;const r=new qr(t);return r.closeStroke=i,this.drawShape(r),this}drawShape(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===wi.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)}_render(e){this.finishPoly();const t=this._geometry;t.updateBatches(),t.batchable?(this.batchDirty!==t.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))}_populateBatches(){const e=this._geometry,t=this.blendMode,i=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(e.points);for(let n=0;ni&&!e.autoResize&&(o=i);let a=e._buffers;a||(a=e._buffers=this.generateBuffers(e));const c=t[0]._texture.baseTexture,l=c.alphaMode>0;this.state.blendMode=Lx(e.blendMode,l),r.state.set(this.state);const h=r.gl,u=e.worldTransform.copyTo(this.tempMatrix);u.prepend(r.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=St.shared.setValue(e.tintRgb).premultiply(e.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=c,this.renderer.shader.bind(this.shader);let d=!1;for(let f=0,p=0;fn&&(m=n),p>=a.length&&a.push(this._generateOneMoreBuffer(e));const g=a[p];g.uploadDynamic(t,f,m);const v=e._bufferUpdateIDs[p]||0;d=d||g._updateID0);n[o]=l,n[o+r]=l,n[o+r*2]=l,n[o+r*3]=l,o+=r*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}N1.extension={name:"particle",type:Pe.RendererPlugin};Ne.add(N1);var su=(s=>(s[s.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",s[s.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",s))(su||{});const Ql={willReadFrequently:!0},Us=class Ve{static get experimentalLetterSpacingSupported(){let e=Ve._experimentalLetterSpacingSupported;if(e!==void 0){const t=ke.ADAPTER.getCanvasRenderingContext2D().prototype;e=Ve._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,i,n,r,o,a,c,l){this.text=e,this.style=t,this.width=i,this.height=n,this.lines=r,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=c,this.fontProperties=l}static measureText(e,t,i,n=Ve._canvas){i=i??t.wordWrap;const r=t.toFontString(),o=Ve.measureFont(r);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);const a=n.getContext("2d",Ql);a.font=r;const c=(i?Ve.wordWrap(e,t,n):e).split(/(?:\r\n|\r|\n)/),l=new Array(c.length);let h=0;for(let p=0;p0&&(n?r-=t:r+=(Ve.graphemeSegmenter(e).length-1)*t),r}static wordWrap(e,t,i=Ve._canvas){const n=i.getContext("2d",Ql);let r=0,o="",a="";const c=Object.create(null),{letterSpacing:l,whiteSpace:h}=t,u=Ve.collapseSpaces(h),d=Ve.collapseNewlines(h);let f=!u;const p=t.wordWrapWidth+l,m=Ve.tokenize(e);for(let g=0;gp)if(o!==""&&(a+=Ve.addLine(o),o="",r=0),Ve.canBreakWords(v,t.breakWords)){const y=Ve.wordWrapSplit(v);for(let _=0;_p&&(a+=Ve.addLine(o),f=!1,o="",r=0),o+=C,r+=M}}else{o.length>0&&(a+=Ve.addLine(o),o="",r=0);const y=g===m.length-1;a+=Ve.addLine(v,!y),f=!1,o="",r=0}else x+r>p&&(f=!1,a+=Ve.addLine(o),o="",r=0),(o.length>0||!Ve.isBreakingSpace(v)||f)&&(o+=v,r+=x)}return a+=Ve.addLine(o,!1),a}static addLine(e,t=!0){return e=Ve.trimRight(e),e=t?`${e} -`:e,e}static getFromCache(e,t,i,n){let r=i[e];return typeof r!="number"&&(r=Ve._measureText(e,t,n)+t,i[e]=r),r}static collapseSpaces(e){return e==="normal"||e==="pre-line"}static collapseNewlines(e){return e==="normal"}static trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const i=e[t];if(!Ve.isBreakingSpace(i))break;e=e.slice(0,-1)}return e}static isNewline(e){return typeof e!="string"?!1:Ve._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:Ve._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const t=[];let i="";if(typeof e!="string")return t;for(let n=0;na;--d){for(let m=0;m{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const s=new Intl.Segmenter;return e=>[...s.segment(e)].map(t=>t.segment)}return s=>[...s]})(),Us.experimentalLetterSpacing=!1,Us._fonts={},Us._newlines=[10,13],Us._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let Zn=Us;const j2=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],U1=class Oa{constructor(e){this.styleID=0,this.reset(),Yd(this,e,e)}clone(){const e={};return Yd(e,this,Oa.defaultStyle),new Oa(e)}reset(){Yd(this,Oa.defaultStyle,Oa.defaultStyle)}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(e){const t=Vd(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)}get fill(){return this._fill}set fill(e){const t=Vd(e);this._fill!==t&&(this._fill=t,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(e){W2(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.styleID++)}get stroke(){return this._stroke}set stroke(e){const t=Vd(e);this._stroke!==t&&(this._stroke=t,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)}toFontString(){const e=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(let i=t.length-1;i>=0;i--){let n=t[i].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&!j2.includes(n)&&(n=`"${n}"`),t[i]=n}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${t.join(",")}`}};U1.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:su.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let mr=U1;function Vd(s){const e=St.shared,t=i=>{const n=e.setValue(i);return n.alpha===1?n.toHex():n.toRgbaString()};return Array.isArray(s)?s.map(t):t(s)}function W2(s,e){if(!Array.isArray(s)||!Array.isArray(e)||s.length!==e.length)return!1;for(let t=0;t0&&p>m&&(g=(m+p)/2);const v=m+d,x=i.lineHeight*(f+1);let y=v;f+10}}function K2(s,e){var i;let t=!1;if((i=s==null?void 0:s._textures)!=null&&i.length){for(let n=0;n{this.queue&&this.prepareItems()},this.registerFindHook(tI),this.registerFindHook(iI),this.registerFindHook(K2),this.registerFindHook(Z2),this.registerFindHook(J2),this.registerUploadHook(Q2),this.registerUploadHook(eI)}upload(e){return new Promise(t=>{e&&this.add(e),this.queue.length?(this.completes.push(t),this.ticking||(this.ticking=!0,$i.system.addOnce(this.tick,this,to.UTILITY))):t()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const e=this.queue[0];let t=!1;if(e&&!e._destroyed){for(let i=0,n=this.uploadHooks.length;i=0;t--)this.add(e.children[t]);return this}destroy(){this.ticking&&$i.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};X1.uploadsPerFrame=4;let Zf=X1;Object.defineProperties(ke,{UPLOADS_PER_FRAME:{get(){return Zf.uploadsPerFrame},set(s){ct("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),Zf.uploadsPerFrame=s}}});function Y1(s,e){return e instanceof Je?(e._glTextures[s.CONTEXT_UID]||s.texture.bind(e),!0):!1}function sI(s,e){if(!(e instanceof zi))return!1;const{geometry:t}=e;e.finishPoly(),t.updateBatches();const{batches:i}=t;for(let n=0;ni&&!e.autoResize&&(o=i);let a=e._buffers;a||(a=e._buffers=this.generateBuffers(e));const c=t[0]._texture.baseTexture,l=c.alphaMode>0;this.state.blendMode=Lx(e.blendMode,l),r.state.set(this.state);const h=r.gl,u=e.worldTransform.copyTo(this.tempMatrix);u.prepend(r.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=St.shared.setValue(e.tintRgb).premultiply(e.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=c,this.renderer.shader.bind(this.shader);let d=!1;for(let f=0,p=0;fn&&(m=n),p>=a.length&&a.push(this._generateOneMoreBuffer(e));const g=a[p];g.uploadDynamic(t,f,m);const v=e._bufferUpdateIDs[p]||0;d=d||g._updateID0);n[o]=l,n[o+r]=l,n[o+r*2]=l,n[o+r*3]=l,o+=r*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}Nb.extension={name:"particle",type:Pe.RendererPlugin};Ne.add(Nb);var su=(s=>(s[s.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",s[s.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",s))(su||{});const Ql={willReadFrequently:!0},Us=class Ve{static get experimentalLetterSpacingSupported(){let e=Ve._experimentalLetterSpacingSupported;if(e!==void 0){const t=ke.ADAPTER.getCanvasRenderingContext2D().prototype;e=Ve._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,i,n,r,o,a,c,l){this.text=e,this.style=t,this.width=i,this.height=n,this.lines=r,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=c,this.fontProperties=l}static measureText(e,t,i,n=Ve._canvas){i=i??t.wordWrap;const r=t.toFontString(),o=Ve.measureFont(r);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);const a=n.getContext("2d",Ql);a.font=r;const c=(i?Ve.wordWrap(e,t,n):e).split(/(?:\r\n|\r|\n)/),l=new Array(c.length);let h=0;for(let p=0;p0&&(n?r-=t:r+=(Ve.graphemeSegmenter(e).length-1)*t),r}static wordWrap(e,t,i=Ve._canvas){const n=i.getContext("2d",Ql);let r=0,o="",a="";const c=Object.create(null),{letterSpacing:l,whiteSpace:h}=t,u=Ve.collapseSpaces(h),d=Ve.collapseNewlines(h);let f=!u;const p=t.wordWrapWidth+l,m=Ve.tokenize(e);for(let g=0;gp)if(o!==""&&(a+=Ve.addLine(o),o="",r=0),Ve.canBreakWords(v,t.breakWords)){const y=Ve.wordWrapSplit(v);for(let _=0;_p&&(a+=Ve.addLine(o),f=!1,o="",r=0),o+=C,r+=M}}else{o.length>0&&(a+=Ve.addLine(o),o="",r=0);const y=g===m.length-1;a+=Ve.addLine(v,!y),f=!1,o="",r=0}else x+r>p&&(f=!1,a+=Ve.addLine(o),o="",r=0),(o.length>0||!Ve.isBreakingSpace(v)||f)&&(o+=v,r+=x)}return a+=Ve.addLine(o,!1),a}static addLine(e,t=!0){return e=Ve.trimRight(e),e=t?`${e} +`:e,e}static getFromCache(e,t,i,n){let r=i[e];return typeof r!="number"&&(r=Ve._measureText(e,t,n)+t,i[e]=r),r}static collapseSpaces(e){return e==="normal"||e==="pre-line"}static collapseNewlines(e){return e==="normal"}static trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const i=e[t];if(!Ve.isBreakingSpace(i))break;e=e.slice(0,-1)}return e}static isNewline(e){return typeof e!="string"?!1:Ve._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:Ve._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const t=[];let i="";if(typeof e!="string")return t;for(let n=0;na;--d){for(let m=0;m{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const s=new Intl.Segmenter;return e=>[...s.segment(e)].map(t=>t.segment)}return s=>[...s]})(),Us.experimentalLetterSpacing=!1,Us._fonts={},Us._newlines=[10,13],Us._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let Zn=Us;const j2=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ub=class Oa{constructor(e){this.styleID=0,this.reset(),Yd(this,e,e)}clone(){const e={};return Yd(e,this,Oa.defaultStyle),new Oa(e)}reset(){Yd(this,Oa.defaultStyle,Oa.defaultStyle)}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(e){const t=Vd(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)}get fill(){return this._fill}set fill(e){const t=Vd(e);this._fill!==t&&(this._fill=t,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(e){W2(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.styleID++)}get stroke(){return this._stroke}set stroke(e){const t=Vd(e);this._stroke!==t&&(this._stroke=t,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)}toFontString(){const e=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(let i=t.length-1;i>=0;i--){let n=t[i].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&!j2.includes(n)&&(n=`"${n}"`),t[i]=n}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${t.join(",")}`}};Ub.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:su.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let mr=Ub;function Vd(s){const e=St.shared,t=i=>{const n=e.setValue(i);return n.alpha===1?n.toHex():n.toRgbaString()};return Array.isArray(s)?s.map(t):t(s)}function W2(s,e){if(!Array.isArray(s)||!Array.isArray(e)||s.length!==e.length)return!1;for(let t=0;t0&&p>m&&(g=(m+p)/2);const v=m+d,x=i.lineHeight*(f+1);let y=v;f+10}}function K2(s,e){var i;let t=!1;if((i=s==null?void 0:s._textures)!=null&&i.length){for(let n=0;n{this.queue&&this.prepareItems()},this.registerFindHook(tI),this.registerFindHook(iI),this.registerFindHook(K2),this.registerFindHook(Z2),this.registerFindHook(J2),this.registerUploadHook(Q2),this.registerUploadHook(eI)}upload(e){return new Promise(t=>{e&&this.add(e),this.queue.length?(this.completes.push(t),this.ticking||(this.ticking=!0,$i.system.addOnce(this.tick,this,to.UTILITY))):t()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const e=this.queue[0];let t=!1;if(e&&!e._destroyed){for(let i=0,n=this.uploadHooks.length;i=0;t--)this.add(e.children[t]);return this}destroy(){this.ticking&&$i.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};Xb.uploadsPerFrame=4;let Zf=Xb;Object.defineProperties(ke,{UPLOADS_PER_FRAME:{get(){return Zf.uploadsPerFrame},set(s){ct("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),Zf.uploadsPerFrame=s}}});function Yb(s,e){return e instanceof Je?(e._glTextures[s.CONTEXT_UID]||s.texture.bind(e),!0):!1}function sI(s,e){if(!(e instanceof zi))return!1;const{geometry:t}=e;e.finishPoly(),t.updateBatches();const{batches:i}=t;for(let n=0;n1?ks.from(oI,rI,t):ks.from(lv,aI,t)}render(e){const t=this.renderer,i=this.quad;let n=i.vertices;n[0]=n[6]=e._width*-e.anchor.x,n[1]=n[3]=e._height*-e.anchor.y,n[2]=n[4]=e._width*(1-e.anchor.x),n[5]=n[7]=e._height*(1-e.anchor.y);const r=e.uvRespectAnchor?e.anchor.x:0,o=e.uvRespectAnchor?e.anchor.y:0;n=i.uvs,n[0]=n[6]=-r,n[1]=n[3]=-o,n[2]=n[4]=1-r,n[5]=n[7]=1-o,i.invalidate();const a=e._texture,c=a.baseTexture,l=c.alphaMode>0,h=e.tileTransform.localTransform,u=e.uvMatrix;let d=c.isPowerOfTwo&&a.frame.width===c.width&&a.frame.height===c.height;d&&(c._glTextures[t.CONTEXT_UID]?d=c.wrapMode!==Is.CLAMP:c.wrapMode===Is.CLAMP&&(c.wrapMode=Is.REPEAT));const f=d?this.simpleShader:this.shader,p=a.width,m=a.height,g=e._width,v=e._height;ec.set(h.a*p/g,h.b*p/v,h.c*m/g,h.d*m/v,h.tx/g,h.ty/v),ec.invert(),d?ec.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=ec.toArray(!0),f.uniforms.uColor=St.shared.setValue(e.tint).premultiply(e.worldAlpha,l).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),f.uniforms.uSampler=a,t.shader.bind(f),t.geometry.bind(i),this.state.blendMode=Lx(e.blendMode,l),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}H1.extension={name:"tilingSprite",type:Pe.RendererPlugin};Ne.add(H1);const j1=class Ba{constructor(e,t,i){this.linkedSheets=[],(e instanceof Je||e instanceof ze)&&(e={texture:e,data:t,resolutionFilename:i});const{texture:n,data:r,resolutionFilename:o=null,cachePrefix:a=""}=e;this.cachePrefix=a,this._texture=n instanceof ze?n:null,this.baseTexture=n instanceof Je?n:this._texture.baseTexture,this.textures={},this.animations={},this.data=r;const c=this.baseTexture.resource;this.resolution=this._updateResolution(o||(c?c.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(e=null){const{scale:t}=this.data.meta;let i=Dn(e,null);return i===null&&(i=typeof t=="number"?t:parseFloat(t??"1")),i!==1&&this.baseTexture.setResolution(i),i}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=Ba.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let t=e;const i=Ba.BATCH_SIZE;for(;t-e{this._batchIndex*Ba.BATCH_SIZE{i[n]=e}),Object.keys(e.textures).forEach(n=>{i[`${e.cachePrefix}${n}`]=e.textures[n]}),!t){const n=Zt.dirname(s[0]);e.linkedSheets.forEach((r,o)=>{Object.assign(i,W1([`${n}/${e.data.meta.related_multi_packs[o]}`],r,!0))})}return i}const hI={extension:Pe.Asset,cache:{test:s=>s instanceof cv,getCacheableAssets:(s,e)=>W1(s,e,!1)},resolver:{test:s=>{const e=s.split("?")[0].split("."),t=e.pop(),i=e.pop();return t==="json"&&cI.includes(i)},parse:s=>{var t;const e=s.split(".");return{resolution:parseFloat(((t=ke.RETINA_PREFIX.exec(s))==null?void 0:t[1])??"1"),format:e[e.length-2],src:s}}},loader:{name:"spritesheetLoader",extension:{type:Pe.LoadParser,priority:ns.Normal},async testParse(s,e){return Zt.extname(e.src).toLowerCase()===".json"&&!!s.frames},async parse(s,e,t){var h,u;const{texture:i,imageFilename:n,cachePrefix:r}=(e==null?void 0:e.data)??{};let o=Zt.dirname(e.src);o&&o.lastIndexOf("/")!==o.length-1&&(o+="/");let a;if(i&&i.baseTexture)a=i;else{const d=Qc(o+(n??s.meta.image),e.src);a=(await t.load([d]))[d]}const c=new cv({texture:a.baseTexture,data:s,resolutionFilename:e.src,cachePrefix:r});await c.parse();const l=(h=s==null?void 0:s.meta)==null?void 0:h.related_multi_packs;if(Array.isArray(l)){const d=[];for(const p of l){if(typeof p!="string")continue;let m=o+p;(u=e.data)!=null&&u.ignoreMultiPack||(m=Qc(m,e.src),d.push(t.load({src:m,data:{ignoreMultiPack:!0}})))}const f=await Promise.all(d);c.linkedSheets=f,f.forEach(p=>{p.linkedSheets=[c].concat(c.linkedSheets.filter(m=>m!==p))})}return c},unload(s){s.destroy(!0)}}};Ne.add(hI);class rh{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Tc{static test(e){return typeof e=="string"&&e.startsWith("info face=")}static parse(e){const t=e.match(/^[a-z]+\s+.+$/gm),i={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const r in t){const o=t[r].match(/^[a-z]+/gm)[0],a=t[r].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),c={};for(const l in a){const h=a[l].split("="),u=h[0],d=h[1].replace(/"/gm,""),f=parseFloat(d),p=isNaN(f)?d:f;c[u]=p}i[o].push(c)}const n=new rh;return i.info.forEach(r=>n.info.push({face:r.face,size:parseInt(r.size,10)})),i.common.forEach(r=>n.common.push({lineHeight:parseInt(r.lineHeight,10)})),i.page.forEach(r=>n.page.push({id:parseInt(r.id,10),file:r.file})),i.char.forEach(r=>n.char.push({id:parseInt(r.id,10),page:parseInt(r.page,10),x:parseInt(r.x,10),y:parseInt(r.y,10),width:parseInt(r.width,10),height:parseInt(r.height,10),xoffset:parseInt(r.xoffset,10),yoffset:parseInt(r.yoffset,10),xadvance:parseInt(r.xadvance,10)})),i.kerning.forEach(r=>n.kerning.push({first:parseInt(r.first,10),second:parseInt(r.second,10),amount:parseInt(r.amount,10)})),i.distanceField.forEach(r=>n.distanceField.push({distanceRange:parseInt(r.distanceRange,10),fieldType:r.fieldType})),n}}class Jf{static test(e){const t=e;return typeof e!="string"&&"getElementsByTagName"in e&&t.getElementsByTagName("page").length&&t.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(e){const t=new rh,i=e.getElementsByTagName("info"),n=e.getElementsByTagName("common"),r=e.getElementsByTagName("page"),o=e.getElementsByTagName("char"),a=e.getElementsByTagName("kerning"),c=e.getElementsByTagName("distanceField");for(let l=0;l")?Jf.test(ke.ADAPTER.parseXML(e)):!1}static parse(e){return Jf.parse(ke.ADAPTER.parseXML(e))}}const Gd=[Tc,Jf,Qf];function uI(s){for(let e=0;e=c-F*o){if(m===0)throw new Error(`[BitmapFont] textureHeight ${c}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${b}')`);--S,g=null,v=null,x=null,m=0,p=0,y=0;continue}if(y=Math.max(F+M.fontProperties.descent,y),E*o+p>=d){if(p===0)throw new Error(`[BitmapFont] textureWidth ${a}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${b}')`);--S,m+=y*o,m=Math.ceil(m),p=0,y=0;continue}fI(g,v,M,p,m,o,u);const k=Mc(M.text);f.char.push({id:k,page:_.length-1,x:p/o,y:m/o,width:E,height:F,xoffset:0,yoffset:0,xadvance:I-(u.dropShadow?u.dropShadowDistance:0)-(u.stroke?u.strokeThickness:0)}),p+=(E+2*r)*o,p=Math.ceil(p)}if(!(i!=null&&i.skipKerning))for(let S=0,b=h.length;S1?ks.from(oI,rI,t):ks.from(lv,aI,t)}render(e){const t=this.renderer,i=this.quad;let n=i.vertices;n[0]=n[6]=e._width*-e.anchor.x,n[1]=n[3]=e._height*-e.anchor.y,n[2]=n[4]=e._width*(1-e.anchor.x),n[5]=n[7]=e._height*(1-e.anchor.y);const r=e.uvRespectAnchor?e.anchor.x:0,o=e.uvRespectAnchor?e.anchor.y:0;n=i.uvs,n[0]=n[6]=-r,n[1]=n[3]=-o,n[2]=n[4]=1-r,n[5]=n[7]=1-o,i.invalidate();const a=e._texture,c=a.baseTexture,l=c.alphaMode>0,h=e.tileTransform.localTransform,u=e.uvMatrix;let d=c.isPowerOfTwo&&a.frame.width===c.width&&a.frame.height===c.height;d&&(c._glTextures[t.CONTEXT_UID]?d=c.wrapMode!==Is.CLAMP:c.wrapMode===Is.CLAMP&&(c.wrapMode=Is.REPEAT));const f=d?this.simpleShader:this.shader,p=a.width,m=a.height,g=e._width,v=e._height;ec.set(h.a*p/g,h.b*p/v,h.c*m/g,h.d*m/v,h.tx/g,h.ty/v),ec.invert(),d?ec.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=ec.toArray(!0),f.uniforms.uColor=St.shared.setValue(e.tint).premultiply(e.worldAlpha,l).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),f.uniforms.uSampler=a,t.shader.bind(f),t.geometry.bind(i),this.state.blendMode=Lx(e.blendMode,l),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}Hb.extension={name:"tilingSprite",type:Pe.RendererPlugin};Ne.add(Hb);const jb=class Ba{constructor(e,t,i){this.linkedSheets=[],(e instanceof Je||e instanceof ze)&&(e={texture:e,data:t,resolutionFilename:i});const{texture:n,data:r,resolutionFilename:o=null,cachePrefix:a=""}=e;this.cachePrefix=a,this._texture=n instanceof ze?n:null,this.baseTexture=n instanceof Je?n:this._texture.baseTexture,this.textures={},this.animations={},this.data=r;const c=this.baseTexture.resource;this.resolution=this._updateResolution(o||(c?c.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(e=null){const{scale:t}=this.data.meta;let i=Dn(e,null);return i===null&&(i=typeof t=="number"?t:parseFloat(t??"1")),i!==1&&this.baseTexture.setResolution(i),i}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=Ba.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let t=e;const i=Ba.BATCH_SIZE;for(;t-e{this._batchIndex*Ba.BATCH_SIZE{i[n]=e}),Object.keys(e.textures).forEach(n=>{i[`${e.cachePrefix}${n}`]=e.textures[n]}),!t){const n=Zt.dirname(s[0]);e.linkedSheets.forEach((r,o)=>{Object.assign(i,Wb([`${n}/${e.data.meta.related_multi_packs[o]}`],r,!0))})}return i}const hI={extension:Pe.Asset,cache:{test:s=>s instanceof cv,getCacheableAssets:(s,e)=>Wb(s,e,!1)},resolver:{test:s=>{const e=s.split("?")[0].split("."),t=e.pop(),i=e.pop();return t==="json"&&cI.includes(i)},parse:s=>{var t;const e=s.split(".");return{resolution:parseFloat(((t=ke.RETINA_PREFIX.exec(s))==null?void 0:t[1])??"1"),format:e[e.length-2],src:s}}},loader:{name:"spritesheetLoader",extension:{type:Pe.LoadParser,priority:ns.Normal},async testParse(s,e){return Zt.extname(e.src).toLowerCase()===".json"&&!!s.frames},async parse(s,e,t){var h,u;const{texture:i,imageFilename:n,cachePrefix:r}=(e==null?void 0:e.data)??{};let o=Zt.dirname(e.src);o&&o.lastIndexOf("/")!==o.length-1&&(o+="/");let a;if(i&&i.baseTexture)a=i;else{const d=Qc(o+(n??s.meta.image),e.src);a=(await t.load([d]))[d]}const c=new cv({texture:a.baseTexture,data:s,resolutionFilename:e.src,cachePrefix:r});await c.parse();const l=(h=s==null?void 0:s.meta)==null?void 0:h.related_multi_packs;if(Array.isArray(l)){const d=[];for(const p of l){if(typeof p!="string")continue;let m=o+p;(u=e.data)!=null&&u.ignoreMultiPack||(m=Qc(m,e.src),d.push(t.load({src:m,data:{ignoreMultiPack:!0}})))}const f=await Promise.all(d);c.linkedSheets=f,f.forEach(p=>{p.linkedSheets=[c].concat(c.linkedSheets.filter(m=>m!==p))})}return c},unload(s){s.destroy(!0)}}};Ne.add(hI);class rh{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Tc{static test(e){return typeof e=="string"&&e.startsWith("info face=")}static parse(e){const t=e.match(/^[a-z]+\s+.+$/gm),i={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const r in t){const o=t[r].match(/^[a-z]+/gm)[0],a=t[r].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),c={};for(const l in a){const h=a[l].split("="),u=h[0],d=h[1].replace(/"/gm,""),f=parseFloat(d),p=isNaN(f)?d:f;c[u]=p}i[o].push(c)}const n=new rh;return i.info.forEach(r=>n.info.push({face:r.face,size:parseInt(r.size,10)})),i.common.forEach(r=>n.common.push({lineHeight:parseInt(r.lineHeight,10)})),i.page.forEach(r=>n.page.push({id:parseInt(r.id,10),file:r.file})),i.char.forEach(r=>n.char.push({id:parseInt(r.id,10),page:parseInt(r.page,10),x:parseInt(r.x,10),y:parseInt(r.y,10),width:parseInt(r.width,10),height:parseInt(r.height,10),xoffset:parseInt(r.xoffset,10),yoffset:parseInt(r.yoffset,10),xadvance:parseInt(r.xadvance,10)})),i.kerning.forEach(r=>n.kerning.push({first:parseInt(r.first,10),second:parseInt(r.second,10),amount:parseInt(r.amount,10)})),i.distanceField.forEach(r=>n.distanceField.push({distanceRange:parseInt(r.distanceRange,10),fieldType:r.fieldType})),n}}class Jf{static test(e){const t=e;return typeof e!="string"&&"getElementsByTagName"in e&&t.getElementsByTagName("page").length&&t.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(e){const t=new rh,i=e.getElementsByTagName("info"),n=e.getElementsByTagName("common"),r=e.getElementsByTagName("page"),o=e.getElementsByTagName("char"),a=e.getElementsByTagName("kerning"),c=e.getElementsByTagName("distanceField");for(let l=0;l")?Jf.test(ke.ADAPTER.parseXML(e)):!1}static parse(e){return Jf.parse(ke.ADAPTER.parseXML(e))}}const Gd=[Tc,Jf,Qf];function uI(s){for(let e=0;e=c-F*o){if(m===0)throw new Error(`[BitmapFont] textureHeight ${c}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${b}')`);--S,g=null,v=null,x=null,m=0,p=0,y=0;continue}if(y=Math.max(F+M.fontProperties.descent,y),E*o+p>=d){if(p===0)throw new Error(`[BitmapFont] textureWidth ${a}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${b}')`);--S,m+=y*o,m=Math.ceil(m),p=0,y=0;continue}fI(g,v,M,p,m,o,u);const k=Mc(M.text);f.char.push({id:k,page:_.length-1,x:p/o,y:m/o,width:E,height:F,xoffset:0,yoffset:0,xadvance:I-(u.dropShadow?u.dropShadowDistance:0)-(u.stroke?u.strokeThickness:0)}),p+=(E+2*r)*o,p=Math.ceil(p)}if(!(i!=null&&i.skipKerning))for(let S=0,b=h.length;S{this.dirty=!0},this,0,0),this._roundPixels=ke.ROUND_PIXELS,this.dirty=!0,this._resolution=ke.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var E;const e=zn.available[this._fontName],t=this.fontSize,i=t/e.size,n=new pt,r=[],o=[],a=[],c=this._text.replace(/(?:\r\n|\r)/g,` -`)||" ",l=z1(c),h=this._maxWidth*e.size/t,u=e.distanceFieldType==="none"?hv:uv;let d=null,f=0,p=0,m=0,g=-1,v=0,x=0,y=0,_=0;for(let k=0;k{this.dirty=!0},this,0,0),this._roundPixels=ke.ROUND_PIXELS,this.dirty=!0,this._resolution=ke.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var E;const e=zn.available[this._fontName],t=this.fontSize,i=t/e.size,n=new pt,r=[],o=[],a=[],c=this._text.replace(/(?:\r\n|\r)/g,` +`)||" ",l=zb(c),h=this._maxWidth*e.size/t,u=e.distanceFieldType==="none"?hv:uv;let d=null,f=0,p=0,m=0,g=-1,v=0,x=0,y=0,_=0;for(let k=0;k0&&n.x>h&&(++x,Xo(r,1+g-x,1+k-g),k=g,g=-1,o.push(v),a.push(r.length>0?r[r.length-1].prevSpaces:0),p=Math.max(p,v),m++,n.x=0,n.y+=e.lineHeight,d=null,_=0)}const C=l[l.length-1];C!=="\r"&&C!==` `&&(/(?:\s)/.test(C)&&(f=v),o.push(f),p=Math.max(p,f),a.push(-1));const S=[];for(let k=0;k<=m;k++){let O=0;this._align==="right"?O=p-o[k]:this._align==="center"?O=(p-o[k])/2:this._align==="justify"&&(O=a[k]<0?0:(p-o[k])/a[k]),S.push(O)}const b=r.length,M={},I=[],F=this._activePagesMeshData;u.push(...F);for(let k=0;k6*D)||O.vertices.lengtht[n.mesh.texture.baseTexture.uid]).forEach(n=>{n.mesh.texture=ze.EMPTY});for(const n in t)t[n].destroy(),delete t[n];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(e)}};vI.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const yI=[".xml",".fnt"],xI={extension:{type:Pe.LoadParser,priority:ns.Normal},name:"loadBitmapFont",test(s){return yI.includes(Zt.extname(s).toLowerCase())},async testParse(s){return Tc.test(s)||Qf.test(s)},async parse(s,e,t){const i=Tc.test(s)?Tc.parse(s):Qf.parse(s),{src:n}=e,{page:r}=i,o=[];for(let l=0;la[l]);return zn.install(i,c,!0)},async load(s,e){return(await ke.ADAPTER.fetch(s)).text()},unload(s){s.destroy()}};Ne.add(xI);const em=class Io extends mr{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new Io(Object.keys(Io.defaultOptions).reduce((t,i)=>({...t,[i]:e[i]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(e=>{URL.revokeObjectURL(e.src),e.refs--,e.refs===0&&(e.fontFace&&document.fonts.delete(e.fontFace),delete Io.availableFonts[e.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,t={}){const{availableFonts:i}=Io;if(i[e]){const n=i[e];return this._fonts.push(n),n.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return ke.ADAPTER.fetch(e).then(n=>n.blob()).then(async n=>new Promise((r,o)=>{const a=URL.createObjectURL(n),c=new FileReader;c.onload=()=>r([a,c.result]),c.onerror=o,c.readAsDataURL(n)})).then(async([n,r])=>{const o=Object.assign({family:Zt.basename(e,Zt.extname(e)),weight:"normal",style:"normal",display:"auto",src:n,dataSrc:r,refs:1,originalUrl:e,fontFace:null},t);i[e]=o,this._fonts.push(o),this.styleID++;const a=new FontFace(o.family,`url(${o.src})`,{weight:o.weight,style:o.style,display:o.display});o.fontFace=a,await a.load(),document.fonts.add(a),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...e){const t=e.filter(i=>!this._overrides.includes(i));t.length>0&&(this._overrides.push(...t),this.styleID++)}removeOverride(...e){const t=e.filter(i=>this._overrides.includes(i));t.length>0&&(this._overrides=this._overrides.filter(i=>!t.includes(i)),this.styleID++)}toCSS(e){return[`transform: scale(${e})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((e,t)=>`${e} @font-face { @@ -1166,7 +1166,7 @@ void main(void)\r font-weight: ${t.weight}; font-style: ${t.style}; font-display: ${t.display}; - }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=cC(e)),typeof e=="number"?lC(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const t=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),n=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&t<1&&(e+=(t*255|0).toString(16).padStart(2,"0"));const r=`${i}px ${n}px`;return this.dropShadowBlur>0?`text-shadow: ${r} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${r} ${e}`}reset(){Object.assign(this,Io.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=ke.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};em.availableFonts={},em.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let Hd=em;const tc=class Ro extends yr{constructor(e="",t={}){super(ze.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,n=ze.from(i,{scaleMode:ke.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new nt,n.trim=new nt,this.texture=n;const r="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(r,"svg"),c=document.createElementNS(r,"foreignObject"),l=document.createElementNS(o,"div"),h=document.createElementNS(o,"style");c.setAttribute("width","10000"),c.setAttribute("height","10000"),c.style.overflow="hidden",a.appendChild(c),this.maxWidth=Ro.defaultMaxWidth,this.maxHeight=Ro.defaultMaxHeight,this._domElement=l,this._styleElement=h,this._svgRoot=a,this._foreignObject=c,this._foreignObject.appendChild(h),this._foreignObject.appendChild(l),this._image=i,this._loadImage=new Image,this._autoResolution=Ro.defaultAutoResolution,this._resolution=Ro.defaultResolution??ke.RESOLUTION,this.text=e,this.style=t}measureText(e){var h,u;const{text:t,style:i,resolution:n}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:i.toCSS(n)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const r=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:o,height:a}=r;(o>this.maxWidth||a>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const c=Math.min(this.maxWidth,Math.ceil(o)),l=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",c.toString()),this._svgRoot.setAttribute("height",l.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(h=this._style)==null?void 0:h.toCSS(n)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:c+i.padding*2,height:l+i.padding*2}}async updateText(e=!0){const{style:t,_image:i,_loadImage:n}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;const{width:r,height:o}=this.measureText();i.width=n.width=Math.ceil(Math.max(1,r)),i.height=n.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(c=>{n.onload=async()=>{if(a/gi,"

").replace(/
/gi,"
").replace(/ /gi," ")}};tc.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},tc.defaultMaxWidth=2024,tc.defaultMaxHeight=2024,tc.defaultAutoResolution=!0;function oh(s,e){const t=Math.max(0,Number(s)||0),i=Math.max(0,Number(e)||0);return{inner:Math.min(t,i),outer:Math.max(t,i)}}function K1(s){const e=Math.max(0,Number(s.outerRectW)||0),t=Math.max(0,Number(s.outerRectH)||0);return{innerW:Math.min(e,Math.max(0,Number(s.innerRectW)||0)),innerH:Math.min(t,Math.max(0,Number(s.innerRectH)||0)),outerW:e,outerH:t}}function bI(s,e,t,i,n){if(s==="random")return n();const r=Math.max(1,Math.round(t)),o=Math.max(0,Math.round(e))%r;return i?o/r:r<=1?.5:o/(r-1)}function fv(s,e,t,i){const n=Math.sqrt(s*s+i()*(e*e-s*s));return{x:Math.cos(t)*n,y:-Math.sin(t)*n,radialAngle:-t*180/Math.PI}}function wI(s,e){const{innerW:t,innerH:i,outerW:n,outerH:r}=K1(s),o=Math.max(0,(n-t)/2),a=Math.max(0,(r-i)/2),c=o*r,l=t*a,h=c*2+l*2;if(h<=0){const p=n*2+r*2;if(p<=0)return{x:0,y:0,radialAngle:0};let m=e()*p,g,v;return m{const F=M/o,E=I/a,k=Math.max(1e-4,Math.hypot(F,E)),O=F/k,D=E/k,$=n*O-r*D,N=r*O+n*D;return{x:s.x+n*S*o-r*b*a+$*.05,y:s.y+r*S*o+n*b*a+N*.05,nx:$,ny:N}};if(s.shape==="circle"){const S=Math.max(.001,s.radius),b=Math.hypot(h,u);if(b>=S)return null;const M=b>1e-4?h/b:1,I=b>1e-4?u/b:0;return d(M*S,I*S,M,I)}if(s.shape==="ellipse"){const S=Math.max(.001,s.radiusX),b=Math.max(.001,s.radiusY),M=Math.hypot(h/S,u/b);if(M>=1)return null;const I=M>1e-4?1/M:1,F=M>1e-4?h*I:S,E=M>1e-4?u*I:0,k=Math.max(1e-4,Math.hypot(F/(S*S),E/(b*b)));return d(F,E,F/(S*S)/k,E/(b*b)/k)}if(s.shape==="rect"){const S=Math.max(.001,s.width*.5),b=Math.max(.001,s.height*.5);if(Math.abs(h)>=S||Math.abs(u)>=b)return null;const M=S-Math.abs(h),I=b-Math.abs(u);if(M=0?1:-1;return d(E*S,u,E,0)}const F=u>=0?1:-1;return d(h,F*b,0,F)}const f=Math.max(3,Math.min(16,Math.round(s.sides||(s.shape==="custom"?5:6)))),p=Math.max(.001,s.width*.5),m=Math.max(.001,s.height*.5),g=Array.from({length:f},(S,b)=>{const M=Math.PI*.5+b/f*Math.PI*2;return{x:Math.cos(M)*p,y:Math.sin(M)*m}});let v=!1;for(let S=0,b=g.length-1;Su!=I.y>u&&h<(I.x-M.x)*(u-M.y)/(I.y-M.y)+M.x&&(v=!v)}if(!v)return null;let x=g[0].x,y=g[0].y,_=1/0;for(let S=0;S>>0^Math.imul(e+1,2654435761)^t)>>>0;return i^=i>>>16,i=Math.imul(i,2146121005),i^=i>>>15,i=Math.imul(i,2221713035),i^=i>>>16,(i>>>0)/4294967296}function bo(s,e,t,i,n){return s==="fixed"?e:s==="curve"?yi(e,t,Zs(i,n)):yi(e,t,n)}function jd(s,e,t,i,n,r){return s==="curve"?yi(e,t,Zs(i,n)):s==="random"?r:e}function pv(s,e,t,i,n){const r=1-n;return r*r*r*s+3*r*r*n*e+3*r*n*n*t+n*n*n*i}function Zs(s,e,t="线性"){if(!Array.isArray(s)||s.length===0)return 1;const i=[...s].sort((n,r)=>n.x-r.x);if(e<=i[0].x)return i[0].y;if(e>=i[i.length-1].x)return i[i.length-1].y;for(let n=0;n=i[n].x&&e<=i[n+1].x){const r=i[n],o=i[n+1],a=o.x-r.x||1;if(t!=="贝塞尔")return yi(r.y,o.y,(e-r.x)/a);const c=r.x+(r.outX??a/3),l=r.y+(r.outY??(o.y-r.y)/3),h=o.x+(o.inX??-a/3),u=o.y+(o.inY??-(o.y-r.y)/3);let d=0,f=1;for(let p=0;p<14;p++){const m=(d+f)/2;pv(r.x,c,h,o.x,m)>>0;return function(){e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}function jo(s){let e=s.replace("#","");return e.length===3&&(e=e.split("").map(t=>t+t).join("")),parseInt(e,16)}function II(s,e,t){const i=gv(s),n=gv(e),r=Math.round(i[0]+(n[0]-i[0])*t),o=Math.round(i[1]+(n[1]-i[1])*t),a=Math.round(i[2]+(n[2]-i[2])*t);return r<<16|o<<8|a}function tm(s,e){if(!Array.isArray(s)||s.length===0)return 16777215;const t=[...s].sort((i,n)=>i.position-n.position);if(e<=t[0].position)return jo(t[0].color);if(e>=t[t.length-1].position)return jo(t[t.length-1].color);for(let i=0;ir.position)continue;const o=(e-n.position)/Math.max(1e-4,r.position-n.position);return II(n.color,r.color,o)}return jo(t[t.length-1].color)}function gv(s){let e=s.replace("#","");e.length===3&&(e=e.split("").map(i=>i+i).join(""));const t=parseInt(e,16);return[t>>16&255,t>>8&255,t&255]}function RI(){return{sprite:null,boneName:"",mesh:null,meshSignature:"",history:[],bones:[],skinWeights:[],currentWidth:0,currentAlpha:0,currentColor:16777215,resourceId:1,enabled:!1,sampledLength:100,sampledWidth:100}}function Cc(s){s.history.length=0,s.bones.length=0,s.mesh&&(s.mesh.visible=!1)}class PI{constructor(e){w(this,"container");this.container=e}ensureMesh(e,t,i){const n=t.trailResources.find(g=>g.id===e.resourceId)||t.trailResources[0],r=(n==null?void 0:n.texture)||ze.EMPTY,o=Number(n==null?void 0:n.rotation)||0,a=Math.max(2,Math.min(16,Math.round(t.trailGridRows))),c=Math.max(2,Math.min(32,Math.round(t.trailGridCols))),l=Math.max(2,Math.min(16,Math.round((n==null?void 0:n.boneCount)??3))),h=`${a}:${c}:${l}:${(n==null?void 0:n.id)??0}:${o}`;if(e.mesh&&e.meshSignature===h)return e.mesh.texture!==r&&(e.mesh.texture=r),e.mesh;e.mesh&&(this.container.removeChild(e.mesh),e.mesh.destroy()),e.meshSignature&&e.meshSignature!==h&&(e.history.length=0,e.bones.length=0);const u=new Float32Array(a*c*2),d=new Float32Array(a*c*2),f=[],p=[];for(let g=0;g.05?e.history.unshift({x:t,y:i}):(r.x=t,r.y=i);const o=Math.max(1,n)*1.5;let a=0,c=e.history.length;for(let l=1;l=o||l>=239){c=l+1;break}e.history.length>c&&(e.history.length=c)}sampleBones(e,t,i){const n=Math.max(2,Math.min(16,Math.round(i))),r=e.history,o=[];if(!r.length)return o;let a=0;for(let l=1;l=h&&g>1e-4){const v=(h-u)/g;d={x:yi(p.x,m.x,v),y:yi(p.y,m.y,v)};break}u+=g}o.push({boneName:`${e.boneName}_trail_${l}`,x:d.x,y:d.y,rotation:0})}for(let l=0;l1){const l=o[0].rotation,u=(o[o.length-1].rotation-l+540)%360-180;for(let d=0;dh.id===i.resourceId)||t.trailResources[0];if(!(r!=null&&r.texture)||i.bones.length<2){n.visible=!1;return}e.resourceId=r.id,n.texture!==r.texture&&(n.texture=r.texture);const o=Math.max(2,Math.min(16,Math.round(t.trailGridRows))),a=Math.max(2,Math.min(32,Math.round(t.trailGridCols))),c=n.vertices,l=[];for(let h=0;h.5&&i.alpha>0}update(e,t,i,n,r,o,a){if(e.sprite=a,e.boneName=i,!t.trail||!e.enabled||e.sampledLength<=0||e.sampledWidth<=0){Cc(e);return}this.ensureMesh(e,t,a);const c=t.trailResources.find(f=>f.id===e.resourceId)||t.trailResources[0];this.appendPoint(e,n,r,e.sampledLength);const l=c!=null&&c.lifeLengthEnabled?Math.max(0,Zs(c.lifeLengthCurve,o)):1,h=Math.max(0,e.sampledLength)*l;e.bones=this.sampleBones(e,h,(c==null?void 0:c.boneCount)??3),e.bones[0]&&(e.bones[0].x=n,e.bones[0].y=r);const u=(c==null?void 0:c.widthMode)==="particle"?(Math.abs(a.scale.x)+Math.abs(a.scale.y))*.5:1;e.currentWidth=Math.max(0,e.sampledWidth)*u,e.currentAlpha=(c==null?void 0:c.alphaMode)==="particle"?a.alpha:(c==null?void 0:c.alphaMode)==="curve"?Zs(c.alphaCurve,o):(c==null?void 0:c.alpha)??1,e.currentColor=(c==null?void 0:c.colorMode)==="particle"?a.tint:(c==null?void 0:c.colorMode)==="curve"?tm(c.colorGradient,o):jo((c==null?void 0:c.color)||"#ffffff");const d={bones:e.bones.map(f=>({...f})),activeBoneCount:e.bones.length,width:e.currentWidth,alpha:Math.min(1,Math.max(0,e.currentAlpha)),colorHex:e.currentColor,resourceId:e.resourceId};return this.skinMesh(e,t,d),d}applyState(e,t,i,n){var r;e.sprite=i,e.resourceId=n.resourceId??((r=t.trailResources[0])==null?void 0:r.id)??1,e.bones=n.bones.map(o=>({...o})),e.currentWidth=n.width,e.currentAlpha=n.alpha,this.skinMesh(e,t,n)}drawDebug(e,t,i,n){if(e.clear(),!t||!i.trail)return;const r=Math.max(2,Math.min(16,Math.round(i.trailGridRows))),o=Math.max(2,Math.min(32,Math.round(i.trailGridCols)));e.lineStyle(1,3790847,.72);for(const a of n){const c=a.mesh;if(!(c!=null&&c.visible))continue;const l=c.vertices,h=(u,d)=>{const f=(u*r+d)*2;return{x:l[f],y:l[f+1]}};for(let u=0;ur.texture||r.sequenceFrames.some(o=>o.texture));if(!t.length)return kI(s.texture);const i=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(i<=0)return t[Math.floor(e()*t.length)];let n=e()*i;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}function BI(s,e){const t=s.trailResources.filter(r=>r.texture);if(!t.length)return s.trailResources[0]||FI();const i=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(i<=0)return t[Math.min(t.length-1,Math.floor(e*t.length))];let n=e*i;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}function vv(s,e){if(s.imageMode!=="sequence"||s.sequenceFrames.length<=1)return{index:0,visible:!0};const t=Math.min(120,Math.max(1,Number(s.sequenceFps)||30)),i=Math.max(0,Math.floor(Math.max(0,e)*t)),n=s.sequenceFrames.length-1;return s.sequencePlayback==="once-hide"?{index:Math.min(n,i),visible:i<=n}:s.sequencePlayback==="once-hold"?{index:Math.min(n,i),visible:!0}:s.sequencePlayback==="loop-reverse"?{index:n-i%s.sequenceFrames.length,visible:!0}:{index:i%s.sequenceFrames.length,visible:!0}}function zd(s,e,t){var i;return s.imageMode==="sequence"&&s.sequenceFrames.length?((i=s.sequenceFrames[Math.max(0,Math.min(s.sequenceFrames.length-1,t))])==null?void 0:i.texture)||s.texture||e:s.texture||e}function cl(){return{texture:null,imageResources:[{id:1,texture:null,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],blend:"normal",independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}]}],imageWeightVersion:1,name:"ParticleSystem1",mode:"stream",rate:20,streamBehavior:"normal",loopDurationFrames:30,generateLoopStartAnimation:!1,loopStartUseCustomDuration:!1,loopStartDurationFrames:30,generateLoopEndAnimation:!1,loopEndUseCustomDuration:!1,loopEndDurationFrames:30,burstCount:50,burstLoop:!1,delay:0,duration:1,shape:"point",shapeRangeVersion:1,innerRadius:0,outerRadius:30,innerRectW:0,innerRectH:0,outerRectW:60,outerRectH:40,spawnPathId:0,spawnPathDistribution:"fixed",radius:30,rectW:60,rectH:40,centerX:0,centerY:0,rootRotation:0,rootScaleX:1,rootScaleY:1,emissionAngleMode:"random",direction:0,spread:360,coneDirection:90,coneAngle:60,lifeMin:.6,lifeMax:1.8,lifeMode:"random",lifeCurve:[{x:0,y:0},{x:1,y:1}],speedMin:30,speedMax:140,speedMode:"random",speedCurve:[{x:0,y:0},{x:1,y:1}],scaleMin:.3,scaleMax:.8,scaleMode:"random",scaleAxisMode:"uniform",scaleYMin:.3,scaleYMax:.8,scaleCurve:[{x:0,y:0},{x:1,y:1}],scaleYCurve:[{x:0,y:0},{x:1,y:1}],scaleEndRatio:.3,initialRotationMode:"random",initialRotationMin:0,initialRotationMax:360,initialRotationCurve:[{x:0,y:0},{x:1,y:1}],alpha:.9,alphaEnd:0,rotationSpeedMin:-180,rotationSpeedMax:180,speedOverLifeEnabled:!1,speedOverLifeMode:"fixed",speedOverLifeMin:1,speedOverLifeMax:1,speedOverLifeCurve:[{x:0,y:1},{x:1,y:1}],scaleOverLifeEnabled:!1,scaleOverLifeMode:"curve",scaleOverLifeAxisMode:"uniform",scaleOverLifeMin:0,scaleOverLifeMax:1,scaleYOverLifeMin:0,scaleYOverLifeMax:1,scaleOverLifeCurve:[{x:0,y:1},{x:1,y:1}],scaleYOverLifeCurve:[{x:0,y:1},{x:1,y:1}],rotationOverLifeEnabled:!1,rotationOverLifeMode:"random",rotationOverLifeCurve:[{x:0,y:0},{x:1,y:1}],gravity:980,gravityMode:"fixed",gravityMin:980,gravityMax:980,gravityDirection:-90,gravityCurve:[{x:0,y:1},{x:1,y:1}],damping:0,seed:0,colorStart:"#ffffff",colorEnd:"#ff4d4d",colorOverLife:!1,blend:"add",alphaMode:"curve",curveMode:"线性",alphaCurve:[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],textureName:"star",textureFolder:"",alphaScale:1,anchorX:.5,anchorY:.5,independentAlpha:"off",offsetX:0,offsetY:0,noise:!1,noiseAmt:30,noiseRange:100,noiseSpeed:1,useGravity:!1,wind:!1,windX:0,windY:0,windMode:"fixed",windMin:100,windMax:100,windDirection:0,windCurve:[{x:0,y:1},{x:1,y:1}],forceField:!1,forceStrength:10,forceRadius:100,forceCenterX:0,forceCenterY:0,forceFalloff:"linear",attraction:!1,attractionCenterX:200,attractionCenterY:0,attractionRadius:20,attractionDuration:.5,attractionDelay:.1,attractionDelayMode:"particle",attractionPath:"curve",trail:!1,trailConfigVersion:3,trailResources:[{id:1,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:[{x:0,y:1},{x:1,y:1}],boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:[{x:0,y:1},{x:1,y:1}],shapeEnabled:!1,shapeCurve:[{x:0,y:1},{x:1,y:1}]}],trailResourceVersion:6,trailTexture:null,trailTextureName:"trail",trailPreviewUrl:"/images/trail.png",trailColorMode:"particle",trailColor:"#ffffff",trailColorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],trailAlphaMode:"particle",trailAlpha:1,trailAlphaCurve:[{x:0,y:1},{x:1,y:1}],trailBoneCount:3,trailLength:100,trailWidth:100,trailWidthMode:"particle",trailLifeLengthEnabled:!1,trailLifeLengthCurve:[{x:0,y:1},{x:1,y:1}],trailShapeEnabled:!1,trailShapeCurve:[{x:0,y:1},{x:1,y:1}],trailGridRows:4,trailGridCols:4,collision:!1,collisionColliderIds:[],pathFollow:!1,emitterFollow:!1,emitterFollowMode:"none",emitterFollowPathId:0,emitterFollowSpineId:0,emitterFollowBoneName:"",emitterFollowBoneOffsetX:0,emitterFollowBoneOffsetY:0,emitterFollowBoneRotation:0,emitterFollowBoneScaleX:1,emitterFollowBoneScaleY:1,emitterAngleMode:"fixed",emitterFollowCurve:[{x:0,y:0},{x:1,y:1}],emitterFollowDuration:2,emitterFollowSpace:"world",emitterFollowDirection:"forward",emitterFollowOffset:0}}function pr(s){var F;const e=cl(),t=s,i=t.shapeRangeVersion!==1,n=Number(t.radius),r=Number(t.rectW),o=Number(t.rectH),a=Number(t.direction),c=Number(t.spread),l=t.shape,h=t.imageWeightVersion!==1,u=t.loopDurationFrames==null,d=t.gravityMode==null,f=Number(t.gravity),p=t.windMode==null,m=Number(t.windX),g=Number(t.windY),v=t.forceFalloff==null,x=Number(t.forceStrength),y=t.trailConfigVersion!==3,_=!Array.isArray(t.trailResources),C=t.trailResourceVersion!==6,S=t.trailTexture,b=String(t.trailTextureName||"trail"),M=String(t.trailPreviewUrl||"/images/trail.png").replace("/trails/trail.png","/images/trail.png");for(const[E,k]of Object.entries(e))t[E]!==void 0&&t[E]!==null||(t[E]=Array.isArray(k)?k.map(O=>typeof O=="object"&&O!==null?{...O}:O):k);i&&(s.innerRadius=0,s.outerRadius=Math.max(0,Number.isFinite(n)?n:e.outerRadius),s.innerRectW=0,s.innerRectH=0,s.outerRectW=Math.max(0,Number.isFinite(r)?r:e.outerRectW),s.outerRectH=Math.max(0,Number.isFinite(o)?o:e.outerRectH),s.coneDirection=Number.isFinite(a)?a:90,s.emissionAngleMode=Number.isFinite(c)&&c>0?"random":"fixed",l==="cone"&&(s.spread=Math.max(0,Number(s.coneAngle)||0)),s.shapeRangeVersion=1),s.shape==="orbit"&&(s.shape="path"),["fixed","random","radial","path-normal","path-tangent"].includes(s.emissionAngleMode)||(s.emissionAngleMode="fixed"),!["circle","rect","cone"].includes(s.shape)&&s.emissionAngleMode==="radial"&&(s.emissionAngleMode="fixed"),s.shape!=="path"&&(s.emissionAngleMode==="path-normal"||s.emissionAngleMode==="path-tangent")&&(s.emissionAngleMode="fixed"),s.spawnPathId=Math.max(0,Math.round(Number(s.spawnPathId)||0)),s.spawnPathDistribution!=="fixed"&&s.spawnPathDistribution!=="random"&&(s.spawnPathDistribution="fixed"),s.innerRadius=Math.max(0,Number(s.innerRadius)||0),s.outerRadius=Math.max(s.innerRadius,Number(s.outerRadius)||0),s.innerRectW=Math.max(0,Number(s.innerRectW)||0),s.innerRectH=Math.max(0,Number(s.innerRectH)||0),s.outerRectW=Math.max(s.innerRectW,Number(s.outerRectW)||0),s.outerRectH=Math.max(s.innerRectH,Number(s.outerRectH)||0);const I=Array.from(new Set((Array.isArray(s.collisionColliderIds)?s.collisionColliderIds:[]).map(E=>Math.round(Number(E))).filter(E=>Number.isFinite(E)&&E>0)));(I.length!==s.collisionColliderIds.length||I.some((E,k)=>E!==s.collisionColliderIds[k]))&&(s.collisionColliderIds=I),s.streamBehavior!=="normal"&&s.streamBehavior!=="loop"&&(s.streamBehavior="normal"),(u||!Number.isFinite(s.loopDurationFrames))&&(s.loopDurationFrames=Math.ceil(Math.max(1/30,Number(s.duration)||1)*30)),s.loopDurationFrames=Math.min(1800,Math.max(1,Math.ceil(s.loopDurationFrames))),typeof s.generateLoopStartAnimation!="boolean"&&(s.generateLoopStartAnimation=!1),typeof s.generateLoopEndAnimation!="boolean"&&(s.generateLoopEndAnimation=!1),typeof s.loopStartUseCustomDuration!="boolean"&&(s.loopStartUseCustomDuration=!1),typeof s.loopEndUseCustomDuration!="boolean"&&(s.loopEndUseCustomDuration=!1),s.loopStartDurationFrames=Math.min(1800,Math.max(1,Math.ceil(Number(s.loopStartDurationFrames)||30))),s.loopEndDurationFrames=Math.min(1800,Math.max(1,Math.ceil(Number(s.loopEndDurationFrames)||30))),(!Array.isArray(s.imageResources)||s.imageResources.length===0)&&(s.imageResources=cl().imageResources);for(const E of s.imageResources){!E.texture&&s.texture&&(E.texture=s.texture),E.textureName||(E.textureName="star"),E.previewUrl==="/particles/star.png"&&(E.previewUrl="/images/star.png"),E.previewUrl||(E.previewUrl=E.textureName==="star"?"/images/star.png":""),E.imageMode!=="fixed"&&E.imageMode!=="sequence"&&(E.imageMode="fixed"),E.sequencePlayback==="once"?E.sequencePlayback="once-hold":E.sequencePlayback==="loop"?E.sequencePlayback="loop-forward":["once-hide","once-hold","loop-forward","loop-reverse"].includes(E.sequencePlayback)||(E.sequencePlayback="loop-forward"),Number.isFinite(E.sequenceFps)||(E.sequenceFps=30),E.sequenceFps=Math.min(120,Math.max(1,Number(E.sequenceFps)||30)),Array.isArray(E.sequenceFrames)||(E.sequenceFrames=[]);for(const k of E.sequenceFrames)typeof k.name!="string"&&(k.name=""),typeof k.previewUrl!="string"&&(k.previewUrl=""),k.texture===void 0&&(k.texture=null);Number.isFinite(E.weight)||(E.weight=100),typeof E.locked!="boolean"&&(E.locked=!1),Number.isFinite(E.scale)||(E.scale=1),Number.isFinite(E.anchorX)||(E.anchorX=.5),Number.isFinite(E.anchorY)||(E.anchorY=.5),E.colorMode!=="fixed"&&E.colorMode!=="random"&&E.colorMode!=="lifetime"&&(E.colorMode=s.colorOverLife?"lifetime":"fixed"),E.colorStart||(E.colorStart=s.colorStart||"#ffffff"),E.colorEnd||(E.colorEnd=s.colorEnd||E.colorStart),(!Array.isArray(E.colorGradient)||E.colorGradient.length<2)&&(E.colorGradient=[{position:0,color:E.colorStart},{position:1,color:E.colorEnd}]),Object.prototype.hasOwnProperty.call(ar,E.blend)||(E.blend=s.blend||"normal"),["off","fixed","curve"].includes(E.independentAlpha)||(E.independentAlpha=s.independentAlpha||"off"),Number.isFinite(E.alpha)||(E.alpha=Number.isFinite(s.alphaScale)?s.alphaScale:1),["跟随导出","线性","贝塞尔"].includes(E.alphaCurveMode)||(E.alphaCurveMode=s.curveMode||"跟随导出"),(!Array.isArray(E.alphaCurve)||E.alphaCurve.length<2)&&(E.alphaCurve=(s.alphaCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k})))}if(s.imageResources.length===1)s.imageResources[0].weight=100,s.imageResources[0].locked=!1;else if(h){const E=100/s.imageResources.length;s.imageResources.forEach((k,O)=>{k.weight=O===s.imageResources.length-1?100-E*(s.imageResources.length-1):E,k.locked=!1})}if(s.imageWeightVersion=1,d){const E=Number.isFinite(f)&&f!==0?f:980;s.gravity=E,s.gravityMin=E,s.gravityMax=E}if(p){const E=Number.isFinite(m)&&Number.isFinite(g)&&(m!==0||g!==0);s.windMin=E?Math.hypot(m,g):100,s.windMax=s.windMin,s.windDirection=E?Math.atan2(-g,m)*180/Math.PI:0}v&&(s.forceStrength=Number.isFinite(x)&&x!==0?x:10),y&&(s.trailConfigVersion=3,s.trailAlphaCurve=[{x:0,y:1},{x:1,y:1}],s.trailLifeLengthCurve=[{x:0,y:1},{x:1,y:1}],s.trailShapeCurve=[{x:0,y:1},{x:1,y:1}],s.trailGridRows=4,s.trailGridCols=4),(_||!s.trailResources.length)&&(s.trailResources=[{id:1,texture:S||null,textureName:b,previewUrl:M,weight:100,locked:!1,rotation:0,colorMode:s.trailColorMode,color:s.trailColor,colorGradient:s.trailColorGradient.map(E=>({...E})),blend:"normal",alphaMode:s.trailAlphaMode,alpha:s.trailAlpha,alphaCurve:s.trailAlphaCurve.map(E=>({...E})),boneCount:s.trailBoneCount,trailRatio:100,lengthMode:"fixed",length:s.trailLength,lengthMin:s.trailLength,lengthMax:s.trailLength,widthSizeMode:"fixed",width:s.trailWidth,widthMin:s.trailWidth,widthMax:s.trailWidth,widthMode:s.trailWidthMode,lifeLengthEnabled:s.trailLifeLengthEnabled,lifeLengthCurve:s.trailLifeLengthCurve.map(E=>({...E})),shapeEnabled:s.trailShapeEnabled,shapeCurve:s.trailShapeCurve.map(E=>({...E}))}]);for(const E of s.trailResources)E.textureName||(E.textureName="trail"),E.previewUrl==="/trails/trail.png"&&(E.previewUrl="/images/trail.png"),E.previewUrl||(E.previewUrl="/images/trail.png"),Number.isFinite(E.weight)||(E.weight=100),typeof E.locked!="boolean"&&(E.locked=!1),Number.isFinite(E.rotation)||(E.rotation=0),["particle","fixed","curve"].includes(E.colorMode)||(E.colorMode=s.trailColorMode||"particle"),E.color||(E.color=s.trailColor||"#ffffff"),(!Array.isArray(E.colorGradient)||E.colorGradient.length<2)&&(E.colorGradient=(s.trailColorGradient||[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}]).map(k=>({...k}))),Object.prototype.hasOwnProperty.call(ar,E.blend)||(E.blend="normal"),["particle","fixed","curve"].includes(E.alphaMode)||(E.alphaMode=s.trailAlphaMode||"particle"),Number.isFinite(E.alpha)||(E.alpha=Number.isFinite(s.trailAlpha)?s.trailAlpha:1),(!Array.isArray(E.alphaCurve)||E.alphaCurve.length<2)&&(E.alphaCurve=(s.trailAlphaCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k}))),Number.isFinite(E.boneCount)||(E.boneCount=Number.isFinite(s.trailBoneCount)?s.trailBoneCount:3),Number.isFinite(E.trailRatio)||(E.trailRatio=100),E.trailRatio=Math.min(100,Math.max(0,E.trailRatio)),["fixed","random"].includes(E.lengthMode)||(E.lengthMode="fixed"),Number.isFinite(E.length)||(E.length=Number.isFinite(s.trailLength)?s.trailLength:100),Number.isFinite(E.lengthMin)||(E.lengthMin=E.length),Number.isFinite(E.lengthMax)||(E.lengthMax=E.length),["fixed","random"].includes(E.widthSizeMode)||(E.widthSizeMode="fixed"),Number.isFinite(E.width)||(E.width=Number.isFinite(s.trailWidth)?s.trailWidth:100),Number.isFinite(E.widthMin)||(E.widthMin=E.width),Number.isFinite(E.widthMax)||(E.widthMax=E.width),["particle","fixed"].includes(E.widthMode)||(E.widthMode=s.trailWidthMode||"particle"),typeof E.lifeLengthEnabled!="boolean"&&(E.lifeLengthEnabled=!!s.trailLifeLengthEnabled),(!Array.isArray(E.lifeLengthCurve)||E.lifeLengthCurve.length<2)&&(E.lifeLengthCurve=(s.trailLifeLengthCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k}))),typeof E.shapeEnabled!="boolean"&&(E.shapeEnabled=!!s.trailShapeEnabled),(!Array.isArray(E.shapeCurve)||E.shapeCurve.length<2)&&(E.shapeCurve=(s.trailShapeCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k})));if(s.trailResources.length===1&&(s.trailResources[0].weight=100,s.trailResources[0].locked=!1),C)for(const E of s.trailResources)E.alphaCurve=((F=E.alphaCurve)==null?void 0:F.length)>=2?E.alphaCurve:[{x:0,y:1},{x:1,y:1}];return s.trailResourceVersion=6,s}class LI extends Si{constructor(t,i=TI){super();w(this,"pool",[]);w(this,"cfg");w(this,"accumulator",0);w(this,"burstTimer",0);w(this,"_spawnSerial",0);w(this,"_elapsed",0);w(this,"_attractionEnabledAt",0);w(this,"_attractionWasEnabled",!1);w(this,"states",[]);w(this,"rng",Math.random);w(this,"_lastSeed",-1);w(this,"trailDebugGfx",new zi);w(this,"trail");w(this,"colliders",[]);w(this,"followSpawnX",0);w(this,"followSpawnY",0);w(this,"followSpawnAngle",0);w(this,"spawnPathSampler",null);w(this,"spawnPathClosed",!1);w(this,"followExportCurveMode","线性");w(this,"simulationTransform",null);this.cfg=pr(t),this.trail=new PI(this),this._ensurePool(i),this.addChild(this.trailDebugGfx)}setFollowExportCurveMode(t){this.followExportCurveMode=t}resolveCurveMode(t){return t==="跟随导出"?this.followExportCurveMode:t}reseed(){const t=this.cfg.seed;t!==this._lastSeed&&(this._lastSeed=t,this.rng=Wd(t>>>0))}_ensurePool(t){for(;this.pool.length=n.delay),o=i==="force"||i==="normal"&&(n.mode==="burst"||this._elapsed=1;)this.accumulator-=1,this.spawnOne();else this.burstTimer+=t,n.burstLoop?this.burstTimer>=1&&(this.burstTimer=0,this.emitBurst()):t>0&&this.burstTimer<=t&&this.emitBurst();const a=[];for(let p=0;p0){const A=Math.max(1e-4,Math.abs(n.rootScaleX)),P=Math.max(1e-4,Math.abs(n.rootScaleY)),L=-(((c=this.simulationTransform)==null?void 0:c.rotation)??n.rootRotation)*Math.PI/180,B=Math.cos(L),X=Math.sin(L),V=((l=this.simulationTransform)==null?void 0:l.centerX)??n.centerX,q=((h=this.simulationTransform)==null?void 0:h.centerY)??n.centerY,W=V+B*A*m.x-X*P*m.y,ne=-q+X*A*m.x+B*P*m.y,re=W,le=-ne,ue=n.forceCenterX-re,ae=n.forceCenterY-le,xe=Math.hypot(ue,ae);if(xe>1e-4&&xe<=n.forceRadius){let Y=1;n.forceFalloff==="linear"?Y=1-xe/n.forceRadius:n.forceFalloff==="inverse"&&(Y=Math.min(10,n.forceRadius/Math.max(xe,n.forceRadius*.1)));const j=n.forceStrength*Y*10,H=ue/xe*j,G=ae/xe*j,z=H,ie=-G;m.vx+=(B*z+X*ie)/A*t,m.vy+=(-X*z+B*ie)/P*t}}if(!m.collisionPaused&&n.damping>0){const A=Math.max(0,1-n.damping*t);m.vx*=A,m.vy*=A}if(m.collisionPaused)m.vx=0,m.vy=0;else if(m.x+=m.vx*t,m.y+=m.vy*t,this.applyColliders(m,p))continue;if(n.attraction&&!m.collisionPaused){const A=m.maxLife-m.life;if(n.attractionDelayMode==="particle"?A>=Math.max(0,n.attractionDelay):this._elapsed-this._attractionEnabledAt>=Math.max(0,n.attractionDelay)){const L=xo(n,m.x,m.y,this.simulationTransform),B=n.attractionCenterX,X=n.attractionCenterY,V=Math.max(0,n.attractionRadius);if(!m.attractionActive){if(Math.hypot(B-L.x,X-L.y)<=V){this.kill(p);continue}m.attractionActive=!0,m.attractionElapsed=0,m.attractionStartWorldX=L.x,m.attractionStartWorldY=L.y}m.attractionElapsed+=t;const q=Math.max(1e-4,n.attractionDuration),W=Math.min(1,m.attractionElapsed/q);let ne=yi(m.attractionStartWorldX,B,W),re=yi(m.attractionStartWorldY,X,W);if(n.attractionPath==="curve"){const ae=B-m.attractionStartWorldX,xe=X-m.attractionStartWorldY,Y=Math.hypot(ae,xe);if(Y>1e-4){const j=Y*.25*m.attractionCurveSide,H=(m.attractionStartWorldX+B)*.5-xe/Y*j,G=(m.attractionStartWorldY+X)*.5+ae/Y*j,z=1-W;ne=z*z*m.attractionStartWorldX+2*z*W*H+W*W*B,re=z*z*m.attractionStartWorldY+2*z*W*G+W*W*X}}const le=Math.hypot(B-ne,X-re);if(W>=1||le<=V){this.kill(p);continue}const ue=mv(n,ne,re,this.simulationTransform);m.x=ue.x,m.y=ue.y,m.vx=0,m.vy=0}}const v=g,x=m.sprite,y=n.imageResources.find(A=>A.id===m.resourceId);if(y){const A=vv(y,m.maxLife-m.life);m.imageFrameIndex=A.index,x.texture=zd(y,n.texture,m.imageFrameIndex),x.visible=A.visible}if(n.speedOverLifeEnabled){const A=ic(jd(n.speedOverLifeMode,n.speedOverLifeMin,n.speedOverLifeMax,n.speedOverLifeCurve,v,m.speedScaleTarget),1),P=m.speedScale===0?A:A/m.speedScale;m.vx*=P,m.vy*=P,m.speedScale=A}let _=m.rotationSpeed;n.rotationOverLifeEnabled&&n.rotationOverLifeMode==="curve"&&(_=yi(n.rotationSpeedMin,n.rotationSpeedMax,Zs(n.rotationOverLifeCurve,v))),m.rotation+=_*t;let C=m.x,S=m.y;if(n.noise&&n.noiseAmt>0&&n.noiseRange>0&&n.noiseSpeed>0){const A=m.maxLife-m.life,P=Math.max(0,n.noiseRange)*Math.min(1,Math.max(0,n.noiseAmt)/100)*.5,L=A*Math.max(0,n.noiseSpeed)*Math.PI*2;C+=(Math.sin(m.noisePhaseX+L)-Math.sin(m.noisePhaseX))*P,S+=(Math.sin(m.noisePhaseY+L*.83)-Math.sin(m.noisePhaseY))*P}x.x=C,x.y=S,x.rotation=-m.rotation*Math.PI/180;let b=1,M=1;n.scaleOverLifeEnabled&&(b=jd(n.scaleOverLifeMode,n.scaleOverLifeMin,n.scaleOverLifeMax,n.scaleOverLifeCurve,v,m.scaleOverLifeX),M=n.scaleOverLifeAxisMode==="separate"?jd(n.scaleOverLifeMode,n.scaleYOverLifeMin,n.scaleYOverLifeMax,n.scaleYOverLifeCurve,v,m.scaleOverLifeY):b),x.scale.set(ic(m.scaleStartX*b,1),ic(m.scaleStartY*M,1));const I=n.alphaMode==="curve"?Zs(n.alphaCurve,v,this.resolveCurveMode(n.curveMode))*n.alphaScale:n.alpha*n.alphaScale;x.alpha=ic((y==null?void 0:y.independentAlpha)==="fixed"?y.alpha:(y==null?void 0:y.independentAlpha)==="curve"?Zs(y.alphaCurve,v,this.resolveCurveMode(y.alphaCurveMode)):I,1);const F=(y==null?void 0:y.colorStart)||"#ffffff",E=(y==null?void 0:y.colorMode)==="lifetime"?tm(y.colorGradient,v):(y==null?void 0:y.colorMode)==="random"?m.colorSample:jo(F);x.tint=E,x.blendMode=ar[(y==null?void 0:y.blend)||"normal"];const k=this.trail.update(m.trail,n,m.boneName,C,S,v,x),O=xo(n,C,S,this.simulationTransform),D=((u=this.simulationTransform)==null?void 0:u.rotation)??n.rootRotation,$=Math.abs(((d=this.simulationTransform)==null?void 0:d.scaleX)??n.rootScaleX),N=Math.abs(((f=this.simulationTransform)==null?void 0:f.scaleY)??n.rootScaleY),U=k?{...k,bones:k.bones.map(A=>{const P=xo(n,A.x,A.y,this.simulationTransform);return{...A,worldX:P.x,worldY:P.y,worldRotation:D-A.rotation}})}:void 0;a.push({boneName:m.boneName,spawnId:m.spawnId,x:C,y:S,rotation:m.rotation,scaleX:x.scale.x,scaleY:x.scale.y,worldX:O.x,worldY:O.y,worldRotation:D+m.rotation,worldScaleX:x.scale.x*$,worldScaleY:x.scale.y*N,alpha:x.alpha,colorHex:E,resourceId:m.resourceId,imageFrameIndex:m.imageFrameIndex,imageVisible:x.visible,trailState:U,active:!0})}return this.states=a,a}drawTrailMeshDebug(t){this.trail.drawDebug(this.trailDebugGfx,t,this.cfg,this.pool.map(i=>i.trail))}emitBurst(){for(let t=0;t0&&this.spawnPathSampler){const a=this.estimatedEmissionCount(),c=bI(t.spawnPathDistribution,this._spawnSerial,a,this.spawnPathClosed,this.rng),l=this.spawnPathSampler(c);if(l)return{...this.applyFollowToOrigin(l.x+i,l.y+n),radialAngle:0,pathAngle:l.angle}}const r=SI(t,this.rng);return{...this.applyFollowToOrigin(i+r.x,n+r.y),radialAngle:r.radialAngle}}estimatedEmissionCount(){const t=this.cfg;return t.mode==="burst"?Math.max(1,Math.round(t.burstCount)):Math.max(1,Math.floor(t.rate*(t.streamBehavior==="loop"?Math.max(1,t.loopDurationFrames)/30:Math.max(0,t.duration))))}applyFollowToOrigin(t,i){const n=this.followSpawnAngle*Math.PI/180,r=Math.cos(n),o=Math.sin(n);return{x:this.followSpawnX+r*t-o*i,y:this.followSpawnY+o*t+r*i}}spawnOne(){const t=this.cfg;let i=this.pool.findIndex(_=>!_.active);if(i===-1)return;const n=this.spawnOrigin(),{x:r,y:o}=n,a=bo(t.lifeMode,t.lifeMin,t.lifeMax,t.lifeCurve,this.rng()),c=bo(t.speedMode,t.speedMin,t.speedMax,t.speedCurve,this.rng()),l=_I(t,n,this.followSpawnAngle,this.rng),h=this.pool[i],u=OI(t,this.rng),d=this._spawnSerial++;h.spawnId=d;const f=BI(t,Rr(t.seed,d,1540483477));h.noisePhaseX=Rr(t.seed,d,1757159915)*Math.PI*2,h.noisePhaseY=Rr(t.seed,d,48610963)*Math.PI*2,h.gravityStrength=t.useGravity&&t.gravityMode==="random"?yi(t.gravityMin,t.gravityMax,this.rng()):t.gravityMin,h.windStrength=t.wind&&t.windMode==="random"?yi(t.windMin,t.windMax,this.rng()):t.windMin,h.attractionActive=!1,h.attractionElapsed=0,h.collisionPaused=!1,h.attractionCurveSide=Rr(t.seed,d,2738958700)<.5?-1:1,h.trail.history.length=0,h.trail.bones.length=0,h.trail.currentWidth=0,h.trail.currentAlpha=0,h.trail.currentColor=16777215,h.trail.resourceId=f.id;const p=Math.min(100,Math.max(0,Number(f.trailRatio)||0)),m=t.mode==="burst"?Math.max(0,Math.round(t.burstCount)):Math.max(0,Math.floor(t.rate*(t.streamBehavior==="loop"?Math.max(1,t.loopDurationFrames)/30:Math.max(0,t.duration)))),g=p>0&&m===1&&d===0,v=Rr(t.seed,d,668265261)*100,x=(_,C,S,b,M)=>{if(_!=="random")return Math.max(0,Number(C)||0);const I=Math.max(0,Math.min(Number(S)||0,Number(b)||0)),F=Math.max(0,Math.max(Number(S)||0,Number(b)||0));return yi(I,F,Rr(t.seed,d,M))};h.trail.sampledLength=x(f.lengthMode,f.length,f.lengthMin,f.lengthMax,374761393),h.trail.sampledWidth=x(f.widthSizeMode,f.width,f.widthMin,f.widthMax,3550635116),h.trail.enabled=t.trail&&(g||v0&&h.trail.sampledWidth>0,h.trail.mesh&&(h.trail.mesh.visible=!1),h.active=!0,h.life=a,h.maxLife=a,h.x=r,h.y=o,h.trail.enabled&&h.trail.history.push({x:r,y:o}),h.vx=Math.cos(l)*c,h.vy=Math.sin(l)*c,h.scaleStartX=bo(t.scaleMode,t.scaleMin,t.scaleMax,t.scaleCurve,this.rng())*u.scale,h.scaleStartY=t.scaleAxisMode==="separate"?bo(t.scaleMode,t.scaleYMin,t.scaleYMax,t.scaleYCurve,this.rng())*u.scale:h.scaleStartX,h.alphaStart=t.alpha,h.alphaEnd=t.alphaEnd,h.rotation=t.initialRotationMode==="direction"?-Math.atan2(h.vy,h.vx)*180/Math.PI+t.initialRotationMin:bo(t.initialRotationMode,t.initialRotationMin,t.initialRotationMax,t.initialRotationCurve,this.rng()),h.rotationSpeed=t.rotationOverLifeEnabled?bo(t.rotationOverLifeMode,t.rotationSpeedMin,t.rotationSpeedMax,t.rotationOverLifeCurve,this.rng()):0,h.speedScale=1,h.speedScaleTarget=t.speedOverLifeMode==="random"?yi(t.speedOverLifeMin,t.speedOverLifeMax,this.rng()):t.speedOverLifeMin,h.scaleOverLifeX=t.scaleOverLifeMode==="random"?yi(t.scaleOverLifeMin,t.scaleOverLifeMax,this.rng()):t.scaleOverLifeMin,h.scaleOverLifeY=t.scaleOverLifeMode==="random"?yi(t.scaleYOverLifeMin,t.scaleYOverLifeMax,this.rng()):t.scaleYOverLifeMin,h.resourceId=u.id,h.colorSample=u.colorMode==="random"?tm(u.colorGradient,Rr(t.seed,d,2654435769)):jo(u.colorStart);const y=vv(u,0);h.imageFrameIndex=y.index,h.sprite.texture=zd(u,t.texture,y.index),h.sprite.anchor.set(u.anchorX,u.anchorY),h.sprite.blendMode=ar[u.blend],h.sprite.tint=h.colorSample,h.sprite.visible=!0}kill(t){const i=this.pool[t];i.active=!1,i.sprite.visible=!1,Cc(i.trail)}clear(){for(const t of this.pool)t.active=!1,t.sprite.visible=!1,Cc(t.trail)}get activeCount(){let t=0;for(const i of this.pool)i.active&&t++;return t}capture(){const t=[];for(const i of this.pool)i.active&&t.push({boneName:i.boneName,spawnId:i.spawnId,x:i.sprite.x,y:i.sprite.y,rotation:i.rotation,scaleX:i.sprite.scale.x,scaleY:i.sprite.scale.y,...this.captureWorldTransform(i),alpha:i.sprite.alpha,colorHex:i.sprite.tint,resourceId:i.resourceId,imageFrameIndex:i.imageFrameIndex,imageVisible:i.sprite.visible,active:!0,trailState:this.cfg.trail&&i.trail.bones.length?{bones:i.trail.bones.map(n=>{var o;const r=xo(this.cfg,n.x,n.y,this.simulationTransform);return{...n,worldX:r.x,worldY:r.y,worldRotation:(((o=this.simulationTransform)==null?void 0:o.rotation)??this.cfg.rootRotation)-n.rotation}}),activeBoneCount:i.trail.bones.length,width:i.trail.currentWidth,alpha:i.trail.currentAlpha,colorHex:i.trail.currentColor,resourceId:i.trail.resourceId}:void 0});return t}captureWorldTransform(t){var r,o,a;const i=xo(this.cfg,t.sprite.x,t.sprite.y,this.simulationTransform),n=((r=this.simulationTransform)==null?void 0:r.rotation)??this.cfg.rootRotation;return{worldX:i.x,worldY:i.y,worldRotation:n+t.rotation,worldScaleX:t.sprite.scale.x*Math.abs(((o=this.simulationTransform)==null?void 0:o.scaleX)??this.cfg.rootScaleX),worldScaleY:t.sprite.scale.y*Math.abs(((a=this.simulationTransform)==null?void 0:a.scaleY)??this.cfg.rootScaleY)}}apply(t){const i=new Map;for(const n of t)i.set(n.boneName,n);for(const n of this.pool){const r=i.get(n.boneName);if(!r){n.active=!1,n.sprite.visible=!1,n.trail.mesh&&(n.trail.mesh.visible=!1);continue}n.active=r.active;const o=n.sprite;if(o.visible=r.active&&r.imageVisible!==!1,o.x=r.x,o.y=r.y,o.rotation=-r.rotation*Math.PI/180,o.scale.set(r.scaleX,r.scaleY),o.alpha=r.alpha,o.tint=r.colorHex,r.resourceId!=null){const a=this.cfg.imageResources.find(c=>c.id===r.resourceId);a&&(n.imageFrameIndex=r.imageFrameIndex??0,o.texture=zd(a,this.cfg.texture,n.imageFrameIndex),o.anchor.set(a.anchorX,a.anchorY),o.blendMode=ar[a.blend])}this.cfg.trail&&r.trailState?this.trail.applyState(n.trail,this.cfg,n.sprite,r.trailState):n.trail.mesh&&(n.trail.mesh.visible=!1)}}reset(){for(const t of this.pool)t.active=!1,t.sprite.visible=!1,Cc(t.trail);this.accumulator=0,this.burstTimer=0,this._spawnSerial=0,this._elapsed=0,this._attractionEnabledAt=0,this._attractionWasEnabled=!1,this._lastSeed=this.cfg.seed,this.rng=Wd(this.cfg.seed>>>0)}restartEmissionCycle(){this.accumulator=0,this.burstTimer=0,this._spawnSerial=0,this._elapsed=0,this._attractionEnabledAt=0,this._attractionWasEnabled=this.cfg.attraction,this._lastSeed=this.cfg.seed,this.rng=Wd(this.cfg.seed>>>0)}}const io=new Map,Zr=new Map;function DI(s){return[...io.values()].some(e=>e===s)}function Z1(s){if(!(DI(s)||(Zr.get(s)||0)>0)){Zr.delete(s);for(const e of s.textures)e.destroy(!0)}}function NI(s){const e=Zr.get(s)||0;e>1?Zr.set(s,e-1):Zr.delete(s),Z1(s)}function UI(s){return io.get(s)||null}function nu(s,e){wl(s),io.set(s,e)}function $I(s){const e=io.get(s);return e?(Zr.set(e,(Zr.get(e)||0)+1),e):null}function XI(s,e){const t=io.get(s);return t?(nu(e,t),!0):!1}function wl(s){const e=io.get(s);e&&(io.delete(s),Z1(e))}function Nt(s){if(Array.isArray(s))return s.map(e=>Nt(e));if(s&&typeof s=="object"){const e=Object.getPrototypeOf(s);if(e===Object.prototype||e===null){const t={};for(const[i,n]of Object.entries(s))t[i]=Nt(n);return t}}return s}const J1=["3.8","4.0","4.1","4.2","4.3"];function ah(s){const e=String(s||"").trim();return J1.find(t=>e===t||e.startsWith(`${t}.`))||null}function im(){return J1.join(" / ")}function VI(s){return s==="4.3"?"4.3":"4.2"}function ap(){return{imagesPath:"./images/",spineVersion:"4.2",keyframeCurve:"linear",fps:30,omitFps:!1,integerFrameAlignment:!0,bonePool:!0,excludeEmptyAnimations:!1,fileName:"SpineParticle.json"}}function Q1(s){const e=Object.assign(ap(),s||{});return e.imagesPath=String(e.imagesPath||"./images/"),e.spineVersion=ah(e.spineVersion)||"4.2",e.keyframeCurve=e.keyframeCurve==="bezier"?"bezier":"linear",e.fps=Math.min(240,Math.max(1,Math.round(Number(e.fps)||30))),e.omitFps=e.omitFps===!0,e.integerFrameAlignment=e.integerFrameAlignment!==!1,e.bonePool=e.bonePool!==!1,e.excludeEmptyAnimations=e.excludeEmptyAnimations===!0,e.fileName=String(e.fileName||"SpineParticle.json"),e}const sm=30;function Ac(s,e=1){return Math.min(1800,Math.max(1,Math.ceil(Number(s)||e)))}function eb(s,e=30){const t=Math.max(0,Number(s.lifeMin)||0),i=Math.max(0,Number(s.lifeMax)||0),n=s.lifeMode==="fixed"?t:Math.max(t,i);return Ac(Math.ceil(n*Math.max(1,e)),sm)}function lr(s,e=30){const t=Ac(s.loopDurationFrames),i=eb(s,e),n=s.generateLoopStartAnimation?s.loopStartUseCustomDuration?Ac(s.loopStartDurationFrames,sm):i:0,r=s.generateLoopEndAnimation?s.loopEndUseCustomDuration?Ac(s.loopEndDurationFrames,sm):i:0;return{start:n,loop:t,end:r,total:n+t+r}}function tb(s,e){const t=lr(s,e),n=Math.max(0,Math.ceil(Math.max(0,Number(s.delay)||0)*Math.max(1,e)))+t.start;return{start:n,end:n+t.loop}}function Ec(s,e,t){const i=Math.max(1,Math.floor(t)-1),n=Math.min(i-1,Math.max(0,Math.floor(Number(s)||0))),r=Math.min(i,Math.max(n+1,Math.floor(Number(e)||i)));return{start:n,end:r}}function YI(s,e,t){const i=Math.max(1,e-1),n=Math.max(1,t-1),r=s.end>=i?n:s.end;return Ec(s.start,r,t)}let sc=1,nc=1,rc=1,oc=1;function ac(s,e){const t=new Set(e),i=`${s} Copy`;if(!t.has(i))return i;let n=2;for(;t.has(`${i} ${n}`);)n++;return`${i} ${n}`}const ao=nM("particle",{state:()=>({editor:{viewScale:1,viewX:0,viewY:0},systems:[],colliders:[],paths:[],spines:[],activeId:0,activeObjectType:"particle",activeObjectId:0,timeline:{playing:!0,loop:!0,frame:0,totalFrames:60,playbackStart:0,playbackEnd:59,fps:30,recorded:!1,animation:"animation",animations:["animation"]},settings:{parameterPanelOnRight:!0,tickEnabled:!1,axisFontSize:12,tickWidth:1,showAxisLabels:!0,axisColor:"#7a86ad",undoLimit:20,backgroundX:0,backgroundY:0,backgroundOpacity:1,backgroundImageName:"",backgroundImageData:"",showEmitter:!0,showBones:!1,bonePointDrawSize:1,boneAxisDrawSize:2,showSkinMesh:!1,showGrid:!0,exportSettings:ap()}}),getters:{activeSystemCount:s=>s.systems.length},actions:{syncSceneSequences(){sc=Math.max(sc,...this.systems.map(s=>s.id+1),1),nc=Math.max(nc,...this.colliders.map(s=>s.id+1),1),rc=Math.max(rc,...this.paths.map(s=>s.id+1),1),oc=Math.max(oc,...this.spines.map(s=>s.id+1),1)},addSystem(s){const e=cl();s!=null&&s.config&&Object.assign(e,s.config);const t=new Set(this.systems.map(r=>r.config.name));if(t.has(e.name)){let r=0;for(const a of this.systems){const c=/^ParticleSystem(\d+)$/.exec(a.config.name);c&&(r=Math.max(r,parseInt(c[1],10)))}e.name=`ParticleSystem${r+1}`;let o=2;for(;t.has(e.name);)e.name=`ParticleSystem${r+o}`,o++}const i=this.timeline.animations.includes(this.timeline.animation)?this.timeline.animation:this.timeline.animations[0]||"animation",n={id:sc++,visible:!0,animation:i,config:e};return this.systems.push(n),this.activeId=n.id,this.activeObjectType="particle",this.activeObjectId=n.id,n},removeSystem(s){var i;const e=this.systems.findIndex(n=>n.id===s);e>=0&&this.systems.splice(e,1),this.activeId===s&&(this.activeId=((i=this.systems[0])==null?void 0:i.id)??0);const t=this.systems.find(n=>n.id===this.activeId);if(t&&(this.timeline.animation=t.animation),this.activeObjectType==="particle"&&this.activeObjectId===s){const n=this.systems[0];this.activeObjectId=(n==null?void 0:n.id)??0}},selectSystem(s){this.activeId=s,this.activeObjectType="particle",this.activeObjectId=s;const e=this.systems.find(t=>t.id===s);e&&(this.timeline.animation=e.animation)},setSystemAnimation(s,e){if(!this.timeline.animations.includes(e))return;const t=this.systems.find(i=>i.id===s);t&&(t.animation=e,this.timeline.animation=e)},addAnimation(){const s=new Set(this.timeline.animations);let e=2,t=`animation${e}`;for(;s.has(t);)t=`animation${++e}`;this.timeline.animations.push(t),this.timeline.animation=t;const i=this.systems.find(n=>n.id===this.activeId);return i&&(i.animation=t),t},renameAnimation(s,e){const t=e.trim(),i=this.timeline.animations.indexOf(s);if(i<0||!t||t!==s&&this.timeline.animations.includes(t))return!1;this.timeline.animations[i]=t;for(const n of this.systems)n.animation===s&&(n.animation=t);return this.timeline.animation===s&&(this.timeline.animation=t),!0},removeAnimation(s){if(this.timeline.animations.length<=1)return!1;const e=this.timeline.animations.indexOf(s);if(e<0)return!1;this.timeline.animations.splice(e,1);const t=this.timeline.animations[Math.min(e,this.timeline.animations.length-1)];for(const i of this.systems)i.animation===s&&(i.animation=t);return this.timeline.animation===s&&(this.timeline.animation=t),!0},addCollider(){const s=nc++,e={id:s,name:`Collider${s}`,visible:!0,shape:"circle",enabled:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,radius:50,radiusX:70,radiusY:45,width:120,height:80,sides:6,response:"physics",elasticity:.8,friction:.3,followPath:!1,followPathId:0,followDuration:2,followPathRotation:!1,followCurveMode:"跟随导出",followCurve:[{x:0,y:0},{x:1,y:1}]};return this.colliders.push(e),this.activeObjectType="collision",this.activeObjectId=e.id,e},addPath(){const s=rc++,e={id:s,name:`Path${s}`,visible:!0,enabled:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,closed:!1,color:"#ff933e",preset:"",points:[]};return this.paths.push(e),this.activeObjectType="path",this.activeObjectId=e.id,e},addSpine(){const s=oc++,e={id:s,name:`SpineSkeleton${s}`,enabled:!0,visible:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,timeOffset:0,skeletonFileName:"",atlasFileName:"",textureFileNames:[],dataVersion:"",sourceBundle:null,selectedAnimation:"",selectedBone:"",animations:[],bones:[],assetVersion:0,status:"empty",error:""};return this.spines.push(e),this.activeObjectType="spine",this.activeObjectId=e.id,e},duplicateSelectedObject(){const s=this.activeObjectId;if(!s)return null;if(this.activeObjectType==="particle"){const i=this.systems.find(r=>r.id===s);if(!i)return null;const n=Nt(i);return n.id=sc++,n.config.name=ac(i.config.name,this.systems.map(r=>r.config.name)),n.frames=void 0,this.systems.push(n),this.activeId=n.id,this.activeObjectId=n.id,this.timeline.animation=n.animation,n}if(this.activeObjectType==="collision"){const i=this.colliders.find(r=>r.id===s);if(!i)return null;const n=Nt(i);return n.id=nc++,n.name=ac(i.name,this.colliders.map(r=>r.name)),this.colliders.push(n),this.activeObjectId=n.id,n}if(this.activeObjectType==="path"){const i=this.paths.find(r=>r.id===s);if(!i)return null;const n=Nt(i);return n.id=rc++,n.name=ac(i.name,this.paths.map(r=>r.name)),this.paths.push(n),this.activeObjectId=n.id,n}const e=this.spines.find(i=>i.id===s);if(!e)return null;const t=Nt(e);return t.id=oc++,t.name=ac(e.name,this.spines.map(i=>i.name)),t.selectedBone="",XI(e.id,t.id),this.spines.push(t),this.activeObjectId=t.id,t},selectSceneObject(s,e){if(this.activeObjectType=s,this.activeObjectId=e,s==="particle"){this.activeId=e;const t=this.systems.find(i=>i.id===e);t&&(this.timeline.animation=t.animation)}},removeCollider(s){var t;const e=this.colliders.findIndex(i=>i.id===s);e>=0&&this.colliders.splice(e,1);for(const i of this.systems){const n=pr(i.config);n.collisionColliderIds=n.collisionColliderIds.filter(r=>r!==s)}if(this.activeObjectType==="collision"&&this.activeObjectId===s){const i=this.systems[0];this.activeObjectType=i?"particle":"collision",this.activeObjectId=(i==null?void 0:i.id)??((t=this.colliders[0])==null?void 0:t.id)??0}},removePath(s){var t;const e=this.paths.findIndex(i=>i.id===s);if(e>=0&&this.paths.splice(e,1),this.activeObjectType==="path"&&this.activeObjectId===s){const i=this.systems[0];this.activeObjectType=i?"particle":"path",this.activeObjectId=(i==null?void 0:i.id)??((t=this.paths[0])==null?void 0:t.id)??0}},removeSpine(s){wl(s);const e=this.spines.findIndex(t=>t.id===s);if(e>=0&&this.spines.splice(e,1),this.activeObjectType==="spine"&&this.activeObjectId===s){const t=this.systems[0],i=this.colliders[0],n=this.paths[0],r=this.spines[0];t?(this.activeObjectType="particle",this.activeObjectId=t.id,this.activeId=t.id):i?(this.activeObjectType="collision",this.activeObjectId=i.id):n?(this.activeObjectType="path",this.activeObjectId=n.id):(this.activeObjectType="spine",this.activeObjectId=(r==null?void 0:r.id)??0)}this.recalcTotalFrames()},play(){const s=Ec(this.timeline.playbackStart,this.timeline.playbackEnd,this.timeline.totalFrames);(this.timeline.frame=s.end)&&(this.timeline.frame=s.start),this.timeline.playing=!0},pause(){this.timeline.playing=!1},togglePlay(){this.timeline.playing?this.pause():this.play()},toStart(){this.timeline.frame=this.timeline.playbackStart},previousFrame(){this.timeline.playing=!1,this.timeline.frame=Math.max(this.timeline.playbackStart,this.timeline.frame-1)},nextFrame(){this.timeline.playing=!1,this.timeline.frame=Math.min(this.timeline.playbackEnd,this.timeline.frame+1)},toEnd(){this.timeline.playing=!1,this.timeline.frame=this.timeline.playbackEnd},toggleLoop(){this.timeline.loop=!this.timeline.loop},setFrame(s){this.timeline.frame=Math.max(0,Math.min(s,this.timeline.totalFrames-1))},setPlaybackStart(s){const e=Ec(s,this.timeline.playbackEnd,this.timeline.totalFrames);this.timeline.playbackStart=e.start,this.timeline.playbackEnd=e.end,this.timeline.framee.end&&(this.timeline.frame=e.end)},recalcTotalFrames(){const s=this.timeline.fps||30;let e=0;for(const r of this.systems){const o=r.config,a=Math.max(0,Number(o.lifeMin)||0),c=Math.max(0,Number(o.lifeMax)||0),l=o.lifeMode==="fixed"?a:Math.max(a,c),h=o.mode==="stream"?o.streamBehavior==="loop"?Math.max(1/s,Math.ceil(Math.max(1,Number(o.loopDurationFrames)||1))/s):Math.max(1/s,Number(o.duration)||0):0;let u=Math.max(0,Number(o.delay)||0)+h+l;o.mode==="stream"&&o.streamBehavior==="loop"&&(u=Math.max(0,Number(o.delay)||0)+lr(o,s).total/s),u>e&&(e=u)}for(const r of this.spines){const o=r.animations.find(c=>c.name===r.selectedAnimation);if(!o)continue;const a=Math.max(0,Number(r.timeOffset)||0)+Math.max(0,o.duration||0);a>e&&(e=a)}for(const r of this.colliders){if(!r.followPath||!r.followPathId)continue;const o=Math.max(0,Number(r.followDuration)||0);o>e&&(e=o)}const t=this.timeline.totalFrames,i=Math.max(2,Math.ceil(e*s)+1);this.timeline.totalFrames=i;const n=YI({start:this.timeline.playbackStart,end:this.timeline.playbackEnd},t,i);return this.timeline.playbackStart=n.start,this.timeline.playbackEnd=n.end,this.timeline.frame>=i&&(this.timeline.frame=i-1),i}}}),ib="SpineParticle.SystemSettings",sb=1,qd="SpineParticle.SystemSettings.v1";function _a(s,e,t,i){const n=Number(s);return Math.min(t,Math.max(e,Number.isFinite(n)?n:i))}function GI(s){return{parameterPanelOnRight:s.parameterPanelOnRight,undoLimit:s.undoLimit,showEmitter:s.showEmitter,showBones:s.showBones,bonePointDrawSize:s.bonePointDrawSize,boneAxisDrawSize:s.boneAxisDrawSize,showSkinMesh:s.showSkinMesh,tickEnabled:s.tickEnabled,axisFontSize:s.axisFontSize,tickWidth:s.tickWidth,showAxisLabels:s.showAxisLabels,axisColor:s.axisColor}}function HI(s,e){const t=n=>s[n]==null?!!e[n]:s[n]===!0,i=typeof s.axisColor=="string"&&/^#[0-9a-f]{6}$/i.test(s.axisColor)?s.axisColor:e.axisColor;return{parameterPanelOnRight:t("parameterPanelOnRight"),undoLimit:Math.round(_a(s.undoLimit,1,200,e.undoLimit)),showEmitter:t("showEmitter"),showBones:t("showBones"),bonePointDrawSize:_a(s.bonePointDrawSize,.1,10,e.bonePointDrawSize),boneAxisDrawSize:_a(s.boneAxisDrawSize,.1,10,e.boneAxisDrawSize),showSkinMesh:t("showSkinMesh"),tickEnabled:t("tickEnabled"),axisFontSize:Math.round(_a(s.axisFontSize,8,40,e.axisFontSize)),tickWidth:_a(s.tickWidth,1,5,e.tickWidth),showAxisLabels:t("showAxisLabels"),axisColor:i}}function jI(s){let e;try{e=JSON.parse(s)}catch{throw new Error("系统设置缓存不是有效的 JSON")}const t=e;if(t.format!==ib)throw new Error("不是 Spine粒子编辑器系统设置缓存");if(t.version!==sb)throw new Error(`暂不支持系统配置版本:${t.version??"未知"}`);if(!t.settings||typeof t.settings!="object")throw new Error("系统设置缓存缺少 settings");return t}function WI(s,e){Object.assign(s.settings,HI(e,s.settings))}let lc=null;function zI(s){lc==null||lc();try{const e=localStorage.getItem(qd);e&&WI(s,jI(e).settings)}catch{try{localStorage.removeItem(qd)}catch{}}lc=Xi(()=>GI(s.settings),e=>{const t={format:ib,version:sb,savedAt:new Date().toISOString(),settings:e};try{localStorage.setItem(qd,JSON.stringify(t))}catch{}},{deep:!0})}function qI(s,e=0){if(s<=0)return 1;const t=Math.pow(10,Math.floor(Math.log10(s))),i=[1,2,5,10,20,50,100];let n=1;for(const r of i)if(r*t>=s){n=r*t;break}return Math.max(n,e)}function KI(s,e,t,i,n){if(!t)return;const r=t;r.clear();const o=s.settings;if(!o.tickEnabled){for(const b of n)b.visible=!1;return}const a=0,c=0,l=e.screen.width/s.editor.viewScale,h=e.screen.height/s.editor.viewScale,u=+("0x"+o.axisColor.replace("#",""));r.lineStyle(1.5,u,.35),r.moveTo(-l,c),r.lineTo(l,c),r.moveTo(a,-h),r.lineTo(a,h);const d=s.editor.viewScale,f=qI(50/d),p=l,m=h,g=Math.max(1,o.tickWidth);if(o.tickEnabled){for(let b=0;b<=l;b+=f){const M=Math.round(b/f)*f;M!==0&&(r.lineStyle(g,u,.25),r.moveTo(M,c-4),r.lineTo(M,c+4),r.moveTo(-M,c-4),r.lineTo(-M,c+4))}for(let b=0;b<=h;b+=f)Math.round(b/f)*f!==0&&(r.lineStyle(g,u,.25),r.moveTo(a-4,b),r.lineTo(a+4,b),r.moveTo(a-4,-b),r.lineTo(a+4,-b))}const v=e.screen.width/2+s.editor.viewX,x=e.screen.height*.5+s.editor.viewY,y=o.axisFontSize,_=+("0x"+o.axisColor.replace("#",""));for(;n.length<64;){const b=new op("",{fontFamily:"monospace",fontSize:y,fill:_});b.anchor.set(.5,.5),i.addChild(b),n.push(b)}let C=0;const S=o.showAxisLabels&&o.tickEnabled;for(let b=0;b<=l;b+=f){const M=Math.round(b/f)*f;if(M===0||!S||M>p)continue;const I=n[C++];if(!I)break;I.style.fontSize=y,I.text=String(M),I.position.set(v+M*d,x+9),I.visible=!0;const F=n[C++];if(!F)break;F.style.fontSize=y,F.text=String(-M),F.position.set(v-M*d,x+9),F.visible=!0}for(let b=0;b<=h;b+=f){const M=Math.round(b/f)*f;if(M===0||!S||M>m)continue;const I=n[C++];if(!I)break;I.style.fontSize=y,I.text=String(M),I.position.set(v+8,x-b*d),I.visible=!0;const F=n[C++];if(!F)break;F.style.fontSize=y,F.text=String(-M),F.position.set(v+8,x+b*d),F.visible=!0}for(;Cx.id===s.activeId);if(!n||n.visible===!1)return;const r=n.config,o=e.get(n.id),a=(o==null?void 0:o.x)??r.centerX??0,c=-((o==null?void 0:o.y)??r.centerY??0),l=r.shape;if(l==="point"||l==="path")return;const h=r.rootScaleX??1,u=r.rootScaleY??1,d=-((o==null?void 0:o.rotation)??r.rootRotation??0)*Math.PI/180,f=Math.cos(d),p=Math.sin(d),m=r.offsetX??0,g=r.offsetY??0,v=(x,y)=>{const _=x+m,C=-y-g,S=_*h,b=C*u;return[a+S*f-b*p,c+(S*p+b*f)]};if(l==="circle"){const x=oh(r.innerRadius,r.outerRadius);i.lineStyle(2,3991658,.7);const y=48;for(const _ of[x.outer,x.inner])if(!(_<=0))for(let C=0;C<=y;C++){const S=C/y*Math.PI*2,[b,M]=v(Math.cos(S)*_,Math.sin(S)*_);C===0?i.moveTo(b,M):i.lineTo(b,M)}}else if(l==="rect"){const x=K1(r);i.lineStyle(2,4885759,.7);for(const[y,_]of[[x.outerW,x.outerH],[x.innerW,x.innerH]]){if(y<=0||_<=0)continue;const C=y/2,S=_/2,b=v(-C,-S),M=v(C,-S),I=v(C,S),F=v(-C,S);i.moveTo(b[0],b[1]),i.lineTo(M[0],M[1]),i.lineTo(I[0],I[1]),i.lineTo(F[0],F[1]),i.lineTo(b[0],b[1])}}else if(l==="cone"){const x=oh(r.innerRadius,r.outerRadius),y=r.coneAngle/2*Math.PI/180,_=r.coneDirection*Math.PI/180,C=v(Math.cos(_-y)*x.inner,Math.sin(_-y)*x.inner),S=v(Math.cos(_+y)*x.inner,Math.sin(_+y)*x.inner),b=v(Math.cos(_-y)*x.outer,Math.sin(_-y)*x.outer),M=v(Math.cos(_+y)*x.outer,Math.sin(_+y)*x.outer);i.lineStyle(2,3991658,.7),i.moveTo(C[0],C[1]),i.lineTo(b[0],b[1]),i.moveTo(S[0],S[1]),i.lineTo(M[0],M[1]),i.lineStyle(1,3991658,.5);const I=24;for(const F of[x.outer,x.inner])if(!(F<=0))for(let E=0;E<=I;E++){const k=_-y+2*y*E/I,[O,D]=v(Math.cos(k)*F,Math.sin(k)*F);E===0?i.moveTo(O,D):i.lineTo(O,D)}}}function QI(s,e){if(!e)return;const t=e;t.clear();const i=s.systems.find(c=>c.id===s.activeId);if((i==null?void 0:i.visible)===!1)return;const n=i==null?void 0:i.config;if(!(n!=null&&n.forceField)||n.forceRadius<=0)return;const r=n.forceCenterX,o=-n.forceCenterY,a=n.forceStrength>=0?5818367:16739194;t.lineStyle(2,a,.85),t.beginFill(a,.08),t.drawCircle(r,o,n.forceRadius),t.endFill(),t.lineStyle(1,a,.7),t.moveTo(r-9,o),t.lineTo(r+9,o),t.moveTo(r,o-9),t.lineTo(r,o+9),t.beginFill(a,.95),t.drawCircle(r,o,4),t.endFill()}function eR(s,e){if(!e)return;const t=e;t.clear();const i=s.systems.find(l=>l.id===s.activeId);if((i==null?void 0:i.visible)===!1)return;const n=i==null?void 0:i.config;if(!(n!=null&&n.attraction))return;const r=n.attractionCenterX,o=-n.attractionCenterY,a=Math.max(0,n.attractionRadius),c=16731487;a>0&&(t.lineStyle(2,c,.95),t.beginFill(c,.09),t.drawCircle(r,o,a),t.endFill()),t.lineStyle(1,c,.85),t.moveTo(r-10,o),t.lineTo(r+10,o),t.moveTo(r,o-10),t.lineTo(r,o+10),t.beginFill(c,1),t.drawCircle(r,o,a>0?4:6),t.endFill()}function tR(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(s.scaleX??1)),a=Math.max(1e-4,Math.abs(s.scaleY??1));return{x:s.x+n*e*o-r*t*a,y:s.y+r*e*o+n*t*a}}function wo(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(s.scaleX??1)),a=Math.max(1e-4,Math.abs(s.scaleY??1)),c=e-s.x,l=t-s.y;return{x:(n*c+r*l)/o,y:(-r*c+n*l)/a}}function nb(s,e,t="linear"){if(!s.length)return e;const i=[...s].sort((n,r)=>n.x-r.x);if(e<=i[0].x)return i[0].y;for(let n=1;nl.id===a.emitterFollowSpineId);!c||c.visible===!1||n.set(`${a.emitterFollowSpineId}:${a.emitterFollowBoneName}`,{spineId:a.emitterFollowSpineId,boneName:a.emitterFollowBoneName})}for(const o of n.values()){const a=e==null?void 0:e.getBoneWorldTransform(o.spineId,o.boneName);if(!a)continue;const c=a.x,l=-a.y;i.lineStyle(2,12881151,.95),i.beginFill(12881151,.2),i.drawCircle(c,l,8),i.endFill(),i.beginFill(15919103,1),i.drawCircle(c,l,3.5),i.endFill()}}function sR(s,e,t){if(!t)return;const i=t;if(i.clear(),!s.value)return;const n=e();if(!n)return;const r=n.x,o=-n.y,a=n.scaleX,c=n.scaleY,l=-n.rotation*Math.PI/180,h=Math.cos(l),u=Math.sin(l),d=(m,g)=>{const v=m*a,x=-g*c;return[r+v*h-x*u,o+(v*u+x*h)]},f=(m,g,v,x)=>{const y=d(m,g),_=d(v,x);i.moveTo(y[0],y[1]),i.lineTo(_[0],_[1])},p=26;if(i.lineStyle(2,3526911,.9),i.beginFill(3526911,.25),i.drawCircle(r,o,6),i.endFill(),s.value==="translate")i.lineStyle(2,3526911,.9),f(-p,0,p,0),f(0,-p,0,p),f(p-6,-4,p,0),f(p,0,p-6,4),f(-20,-4,-p,0),f(-p,0,-20,4),f(-4,p-6,0,p),f(0,p,4,p-6),f(-4,-20,0,-p),f(0,-p,4,-20);else if(s.value==="rotate"){i.lineStyle(2,3526911,.8);const m=48;for(let x=0;x<=m;x++){const y=x/m*Math.PI*2,[_,C]=d(Math.cos(y)*p,Math.sin(y)*p);x===0?i.moveTo(_,C):i.lineTo(_,C)}const[g,v]=d(0,p);i.beginFill(3526911,.95),i.drawCircle(g,v,4),i.endFill()}else if(s.value==="scale"){i.lineStyle(2,3526911,.9);const g=[[-p,-p],[p,-p],[p,p],[-p,p]].map(([v,x])=>d(v,x));i.moveTo(g[0][0],g[0][1]),i.lineTo(g[1][0],g[1][1]),i.lineTo(g[2][0],g[2][1]),i.lineTo(g[3][0],g[3][1]),i.lineTo(g[0][0],g[0][1]),i.beginFill(3526911,.9);for(const v of g)i.drawRect(v[0]-3,v[1]-3,6,6);i.endFill()}}function nR(s,e=16777215){const t=Number.parseInt(s.replace("#",""),16);return Number.isFinite(t)?t:e}function rR(s,e,t){if(!t)return;const i=t;i.clear();for(const n of e){if(n.visible===!1)continue;const r=s.activeObjectType==="collision"&&s.activeObjectId===n.id,o=n.enabled?r?16735858:13911899:5792116,a=n.rotation*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=Math.max(1e-4,Math.abs(n.scaleX??1)),u=Math.max(1e-4,Math.abs(n.scaleY??1)),d=(m,g)=>({x:n.x+c*m*h-l*g*u,y:-(n.y+l*m*h+c*g*u)});let f=[];if(n.shape==="circle"||n.shape==="ellipse"){const m=n.shape==="circle"?n.radius:n.radiusX,g=n.shape==="circle"?n.radius:n.radiusY;f=Array.from({length:49},(v,x)=>{const y=x/48*Math.PI*2;return d(Math.cos(y)*m,Math.sin(y)*g)})}else if(n.shape==="rect"){const m=n.width*.5,g=n.height*.5;f=[d(-m,-g),d(m,-g),d(m,g),d(-m,g),d(-m,-g)]}else{const m=Math.max(3,Math.min(16,Math.round(n.sides)));f=Array.from({length:m+1},(g,v)=>{const x=Math.PI*.5+v%m/m*Math.PI*2;return d(Math.cos(x)*n.width*.5,Math.sin(x)*n.height*.5)})}if(!f.length)continue;i.lineStyle(r?2.5:1.5,o,n.enabled?.95:.45),i.beginFill(o,r?.12:.055),i.moveTo(f[0].x,f[0].y);for(let m=1;m{const f=tR(n,u,d);return{x:f.x,y:-f.y}},c=n.points[0],l=a(c.x,c.y);i.lineStyle(r?2.5:1.8,o,r?1:.75),i.moveTo(l.x,l.y);const h=n.closed?n.points.length:n.points.length-1;for(let u=0;u{const f=a(u.x,u.y),p=a(u.x+u.inX,u.y+u.inY),m=a(u.x+u.outX,u.y+u.outY),g=Math.hypot(u.inX,u.inY)>.01,v=Math.hypot(u.outX,u.outY)>.01;i.lineStyle(1,11121867,.65),g&&(i.moveTo(f.x,f.y),i.lineTo(p.x,p.y)),v&&(i.moveTo(f.x,f.y),i.lineTo(m.x,m.y)),g&&(i.beginFill(14015724,.95),i.drawCircle(p.x,p.y,3),i.endFill()),v&&(i.beginFill(14015724,.95),i.drawCircle(m.x,m.y,3),i.endFill()),i.beginFill(e.has(d)?16777215:o,1),i.lineStyle(1.5,e.has(d)?6126847:16777215,.95),i.drawCircle(f.x,f.y,e.has(d)?5:4),i.endFill()})}}function aR(s,e,t,i){var o;const n=Number.isFinite(e.worldX)&&Number.isFinite(e.worldY),r=Number.isFinite(e.worldRotation);s.push({boneName:e.boneName,x:n?e.worldX:e.x,y:n?-e.worldY:e.y,rotation:r?-e.worldRotation:-e.rotation,parentX:t,parentY:i}),(o=e.trailState)!=null&&o.bones.length&&e.trailState.bones.forEach(a=>{const c=Number.isFinite(a.worldX)&&Number.isFinite(a.worldY),l=Number.isFinite(a.worldRotation);s.push({boneName:a.boneName,x:c?a.worldX:a.x,y:c?-a.worldY:a.y,rotation:l?-a.worldRotation:a.rotation,parentX:t,parentY:i,trail:!0})})}function xv(s,e,t,i,n,r,o,a){const c=r*.62,l=e+i*r,h=t+n*r,u=Math.max(2.5,r*.32),d=Math.max(1.7,r*.22),f=l-i*u,p=h-n*u,m=-n,g=i;s.lineStyle(o,a,.95),s.moveTo(e-i*c,t-n*c),s.lineTo(f,p),s.lineStyle(0),s.beginFill(a,.95),s.drawPolygon([l,h,f+m*d,p+g*d,f-m*d,p-g*d]),s.endFill()}function lR(s,e,t){if(!t)return;const i=t;if(i.clear(),!e.settings.showBones)return;const n=0,r=0,o=Math.max(.25,Math.abs(e.editor.viewScale)||1),a=Math.min(10,Math.max(.1,Number(e.settings.bonePointDrawSize)||1)),c=Math.min(10,Math.max(.1,Number(e.settings.boneAxisDrawSize)||2)),l=2.5*a/o,h=4.5*c/o,u=Math.max(.65,c*.625)/o;for(const d of s){const f=d.trail?16731533:16747610;i.lineStyle(1,f,d.trail?.65:.35),i.moveTo(d.parentX??n,d.parentY??r),i.lineTo(d.x,d.y);const p=d.rotation*Math.PI/180,m=Math.cos(p),g=Math.sin(p);xv(i,d.x,d.y,m,g,h,u,15684432),xv(i,d.x,d.y,g,-m,h,u,5622123),i.beginFill(f,.9),i.drawCircle(d.x,d.y,l),i.endFill()}}function Ai(s){return s.map(e=>({...e,trailState:e.trailState?{...e.trailState,bones:e.trailState.bones.map(t=>({...t}))}:void 0}))}function cR(s){const e=new Map;for(const i of s)for(const n of i)e.has(n.boneName)||e.set(n.boneName,Ai([n])[0]);const t=[...e.keys()].sort((i,n)=>{const r=Number(i.replace(/^p_/,"")),o=Number(n.replace(/^p_/,""));return Number.isFinite(r)&&Number.isFinite(o)?r-o:i.localeCompare(n)});for(let i=0;i[r.boneName,r]));s[i]=t.map(r=>{const o=n.get(r);return o||{...Ai([e.get(r)])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}})}}function hR(s){s.length<2||(s[s.length-1]=Ai(s[0]))}function uR(s,e){const t=Math.max(0,s.length-1),i=[];for(let n=0;n<=e;n++){const r=Math.min(t,Math.round(n/e*t));i.push(Ai(s[r]||[]))}return i}function Kd(s){return`${s.boneName}:${s.spawnId??"legacy"}`}function bv(s){return{...Ai([s])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}}function dR(s,e,t,i){const n=Math.min(s.length,i+1),r=s.slice(Math.max(0,s.length-n)),o=new Map;for(const l of e){if(l.imageVisible===!1||l.alpha<=0)continue;const h=Kd(l),u=new Map;let d=!1;for(let f=r.length-1;f>=0;f--){const p=r[f].find(m=>Kd(m)===h);if(p)d=!0,u.set(f,p);else if(d)break}o.set(h,u)}const a=Math.max(0,r.length-1),c=[];for(let l=0;l<=t;l++){const h=Math.min(a,Math.round(l/t*a));c.push(e.map(u=>{var f;if(u.imageVisible===!1||u.alpha<=0)return Ai([u])[0];const d=(f=o.get(Kd(u)))==null?void 0:f.get(h);return d?Ai([d])[0]:bv(u)}))}return c[0]=c[0].map(bv),c[c.length-1]=Ai(e),c}function wv(s,e){const t=s.length?1:0;for(let i=t;i{const y=x?[[]]:[];e.reset();for(let _=0;_0&&e.restartEmissionCycle();for(let C=0;C0;_++)e.update(r,"off"),x.push(e.capture());(v=x[x.length-1])!=null&&v.length&&x.push([]),wv(u,uR(x,a.end))}const g=Ai(u[u.length-1]||[]);for(u.length>i&&(u.length=i);u.lengtha.id===r)||(this.container.removeChild(o.root),o.root.destroy({children:!0}),this.entries.delete(r));for(const r of e){const o=UI(r.id);let a=this.entries.get(r.id);if(a&&a.assetVersion!==r.assetVersion&&!o&&(this.container.removeChild(a.root),a.root.destroy({children:!0}),this.entries.delete(r.id),a=void 0),(!a||a.assetVersion!==r.assetVersion)&&o){a&&(this.container.removeChild(a.root),a.root.destroy({children:!0}));const d=new Si,f=new o.SpineClass({skeletonData:o.skeletonData,autoUpdate:!1,darkTint:!1});o.skeletonData.defaultSkin&&f.skeleton.setSkin(o.skeletonData.defaultSkin),o.runtimeVersion==="4.3"?f.skeleton.setupPoseSlots():f.skeleton.setSlotsToSetupPose(),d.addChild(f),this.container.addChild(d),a={root:d,spine:f,runtimeVersion:o.runtimeVersion,assetVersion:r.assetVersion,animation:""},this.entries.set(r.id,a)}if(!a)continue;const c=a.root,l=a.spine,h=r.visible!==!1&&r.enabled;c.visible=h,c.renderable=h,c.position.set(r.x,-r.y),c.rotation=-r.rotation*Math.PI/180,c.scale.set(r.scaleX,r.scaleY),a.animation!==r.selectedAnimation&&(a.animation=r.selectedAnimation,a.runtimeVersion==="4.3"?l.skeleton.setupPose():l.skeleton.setToSetupPose(),l.state.clearTracks(),a.animation&&l.state.setAnimation(0,a.animation,!1));const u=a.runtimeVersion==="4.3"?l.state.getTrack(0):l.state.getCurrent(0);if(u){const d=((n=r.animations.find(p=>p.name===r.selectedAnimation))==null?void 0:n.duration)||0,f=Math.max(0,t/Math.max(1,i)-r.timeOffset);u.trackTime=d>0?Math.min(f,d):f}l.update(0)}}getBoneWorldTransform(e,t){const i=this.entries.get(e),n=i==null?void 0:i.spine.skeleton.findBone(t);if(!i||!n||!n.active)return null;const r=i.runtimeVersion==="4.3"?n.appliedPose:n,o=i.root,a=Math.cos(o.rotation),c=Math.sin(o.rotation),l=a*o.scale.x,h=-c*o.scale.y,u=c*o.scale.x,d=a*o.scale.y,f=l*r.a+h*r.c,p=l*r.b+h*r.d,m=u*r.a+d*r.c,g=u*r.b+d*r.d,v=o.position.x+l*r.worldX+h*r.worldY,x=o.position.y+u*r.worldX+d*r.worldY;return{x:v,y:-x,rotation:-Math.atan2(m,f)*180/Math.PI,scaleX:Math.max(1e-4,Math.hypot(f,m)),scaleY:Math.max(1e-4,Math.hypot(p,g))}}destroy(){for(const e of this.entries.values())e.root.removeFromParent(),e.root.destroy({children:!0});this.entries.clear(),this.container.removeFromParent(),this.container.destroy({children:!0})}}let rb=class{constructor(){w(this,"entries",{});w(this,"size",0)}add(e){let t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){let t=this.size;for(var i=0,n=e.length;i1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}toRgb888(){const e=t=>("0"+(t*255).toString(16)).slice(-2);return+("0x"+e(this.r)+e(this.g)+e(this.b))}static fromString(e,t=new Ci){return t.setFromString(e)}},w(Ci,"WHITE",new Ci(1,1,1,1)),w(Ci,"RED",new Ci(1,0,0,1)),w(Ci,"GREEN",new Ci(0,1,0,1)),w(Ci,"BLUE",new Ci(0,0,1,1)),w(Ci,"MAGENTA",new Ci(1,0,1,1)),Ci);var Kt;let Ie=(Kt=class{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*Kt.degRad)}static sinDeg(e){return Math.sin(e*Kt.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*Kt.degRad}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){let t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return Kt.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,i){let n=Math.random(),r=t-e;return n<=(i-e)/r?e+Math.sqrt(n*r*(i-e)):t-Math.sqrt((1-n)*r*(t-i))}static isPowerOfTwo(e){return e&&(e&e-1)===0}},w(Kt,"PI",3.1415927),w(Kt,"PI2",Kt.PI*2),w(Kt,"invPI2",1/Kt.PI2),w(Kt,"radiansToDegrees",180/Kt.PI),w(Kt,"radDeg",Kt.radiansToDegrees),w(Kt,"degreesToRadians",Kt.PI/180),w(Kt,"degRad",Kt.degreesToRadians),Kt);var Ms;let Re=(Ms=class{static arrayCopy(e,t,i,n,r){for(let o=t,a=n;o=t?e:Ms.setArraySize(e,t,i)}static newArray(e,t){let i=new Array(e);for(let n=0;n0?this.items.pop():this.instantiator()}free(e){e.reset&&e.reset(),this.items.push(e)}freeAll(e){for(let t=0;t>1)*a;let c=t.bone.skeleton,l=t.deform,h=this.vertices,u=this.bones;if(!u){l.length>0&&(h=l);let m=t.bone,g=m.worldX,v=m.worldY,x=m.a,y=m.b,_=m.c,C=m.d;for(let S=i,b=o;b=this.regions.length&&(i=this.regions.length-1);let n=this.regions[i];t.region!=n&&(t.region=n,t.updateRegion())}getPath(e,t){let i=e,n=(this.start+t).toString();for(let r=this.digits-n.length;r>0;r--)i+="0";return i+=n,i}static nextID(){return In._nextID++}},w(In,"_nextID",0),In);var xi;(function(s){s[s.hold=0]="hold",s[s.once=1]="once",s[s.loop=2]="loop",s[s.pingpong=3]="pingpong",s[s.onceReverse=4]="onceReverse",s[s.loopReverse=5]="loopReverse",s[s.pingpongReverse=6]="pingpongReverse"})(xi||(xi={}));const lb=[xi.hold,xi.once,xi.loop,xi.pingpong,xi.onceReverse,xi.loopReverse,xi.pingpongReverse];let lp=class{constructor(e,t,i){w(this,"name");w(this,"timelines",[]);w(this,"timelineIds",new rb);w(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=i}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds.clear();for(var t=0;t0&&(t%=this.duration));let l=this.timelines;for(let h=0,u=l.length;ht)return n-1;return i-1}static search(e,t,i){let n=e.length;for(let r=i;rt)return r-i;return n-i}},cn=class extends Ut{constructor(t,i,n){super(t,n);w(this,"curves");this.curves=Re.newFloatArray(t+i*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let i=this.getFrameCount()+t*18;if(this.curves.length>i){let n=Re.newFloatArray(i);Re.arrayCopy(this.curves,0,n,0,i),this.curves=n}}setBezier(t,i,n,r,o,a,c,l,h,u,d){let f=this.curves,p=this.getFrameCount()+t*18;n==0&&(f[i]=2+p);let m=(r-a*2+l)*.03,g=(o-c*2+h)*.03,v=((a-l)*3-r+u)*.006,x=((c-h)*3-o+d)*.006,y=m*2+v,_=g*2+x,C=(a-r)*.3+m+v*.16666667,S=(c-o)*.3+g+x*.16666667,b=r+C,M=o+S;for(let I=p+18;pt){let h=this.frames[i],u=this.frames[i+n];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}let a=r+18;for(r+=2;r=t){let h=o[r-2],u=o[r-1];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}i+=this.getFrameEntries();let c=o[a-2],l=o[a-1];return l+(t-c)/(this.frames[i]-c)*(this.frames[i+n]-l)}},Os=class extends cn{constructor(e,t,i){super(e,t,[i])}getFrameEntries(){return 2}setFrame(e,t,i){e<<=1,this.frames[e]=t,this.frames[e+1]=i}getCurveValue(e){let t=this.frames,i=t.length-2;for(let r=2;r<=i;r+=2)if(t[r]>e){i=r-2;break}let n=this.curves[i>>1];switch(n){case 0:let r=t[i],o=t[i+1];return o+(e-r)/(t[i+2]-r)*(t[i+2+1]-o);case 1:return t[i+1]}return this.getBezierValue(e,i,1,n-2)}getRelativeValue(e,t,i,n,r){if(e>2];switch(g){case 0:let v=h[m];d=h[m+1],f=h[m+2],p=h[m+3];let x=(n-v)/(h[m+4]-v);d+=(h[m+4+1]-d)*x,f+=(h[m+4+2]-f)*x,p+=(h[m+4+3]-p)*x;break;case 1:d=h[m+1],f=h[m+2],p=h[m+3];break;default:d=this.getBezierValue(n,m,1,g-2),f=this.getBezierValue(n,m,2,g+18-2),p=this.getBezierValue(n,m,3,g+36-2)}if(o==1)u.r=d,u.g=f,u.b=p;else{if(a==ge.setup){let v=l.data.color;u.r=v.r,u.g=v.g,u.b=v.b}u.r+=(d-u.r)*o,u.g+=(f-u.g)*o,u.b+=(p-u.b)*o}}},wb=class extends Os{constructor(t,i,n){super(t,i,rt.alpha+"|"+n);w(this,"slotIndex",0);this.slotIndex=n}apply(t,i,n,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.color;if(n>3];switch(C){case 0:let S=h[_];f=h[_+1],p=h[_+2],m=h[_+3],g=h[_+4],v=h[_+5],x=h[_+6],y=h[_+7];let b=(n-S)/(h[_+8]-S);f+=(h[_+8+1]-f)*b,p+=(h[_+8+2]-p)*b,m+=(h[_+8+3]-m)*b,g+=(h[_+8+4]-g)*b,v+=(h[_+8+5]-v)*b,x+=(h[_+8+6]-x)*b,y+=(h[_+8+7]-y)*b;break;case 1:f=h[_+1],p=h[_+2],m=h[_+3],g=h[_+4],v=h[_+5],x=h[_+6],y=h[_+7];break;default:f=this.getBezierValue(n,_,1,C-2),p=this.getBezierValue(n,_,2,C+18-2),m=this.getBezierValue(n,_,3,C+36-2),g=this.getBezierValue(n,_,4,C+54-2),v=this.getBezierValue(n,_,5,C+72-2),x=this.getBezierValue(n,_,6,C+90-2),y=this.getBezierValue(n,_,7,C+108-2)}if(o==1)u.set(f,p,m,g),d.r=v,d.g=x,d.b=y;else{if(a==ge.setup){u.setFromColor(l.data.color);let S=l.data.darkColor;d.r=S.r,d.g=S.g,d.b=S.b}u.add((f-u.r)*o,(p-u.g)*o,(m-u.b)*o,(g-u.a)*o),d.r+=(v-d.r)*o,d.g+=(x-d.g)*o,d.b+=(y-d.b)*o}}},_b=class extends cn{constructor(t,i,n){super(t,i,[rt.rgb+"|"+n,rt.rgb2+"|"+n]);w(this,"slotIndex",0);this.slotIndex=n}getFrameEntries(){return 7}setFrame(t,i,n,r,o,a,c,l){t*=7,this.frames[t]=i,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=o,this.frames[t+4]=a,this.frames[t+5]=c,this.frames[t+6]=l}apply(t,i,n,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=this.frames,u=l.color,d=l.darkColor;if(nt){let l=this.frames[i];return n[r+1]*(t-l)/(n[r]-l)}let o=r+18;for(r+=2;r=t){let l=n[r-2],h=n[r-1];return h+(t-l)/(n[r]-l)*(n[r+1]-h)}let a=n[o-2],c=n[o-1];return c+(1-c)*(t-a)/(this.frames[i+this.getFrameEntries()]-a)}apply(t,i,n,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.getAttachment();if(!h||!(h instanceof Un)||h.timelineAttachment!=this.attachment)return;let u=l.deform;u.length==0&&(a=ge.setup);let d=this.vertices,f=d[0].length,p=this.frames;if(n=p[p.length-1]){let _=d[p.length-1];if(o==1)if(a==ge.add){let C=h;if(C.bones)for(let S=0;Sn)this.apply(t,i,Number.MAX_VALUE,r,o,a,c),i=-1;else if(i>=l[h-1])return;if(n0&&l[u-1]==d;)u--}for(;u=l[u];u++)r.push(this.events[u])}},w(Yr,"propertyIds",[""+rt.event]),Yr);var Gr;let Va=(Gr=class extends Ut{constructor(t){super(t,Gr.propertyIds);w(this,"drawOrders");this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,i,n){this.frames[t]=i,this.drawOrders[t]=n}apply(t,i,n,r,o,a,c){if(c==Ri.mixOut){a==ge.setup&&Re.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(n>2];switch(m){case 0:let g=h[p];u=h[p+1],d=h[p+2],f=h[p+3];let v=(n-g)/(h[p+4]-g);u+=(h[p+4+1]-u)*v,d+=(h[p+4+2]-d)*v,f+=(h[p+4+3]-f)*v;break;case 1:u=h[p+1],d=h[p+2],f=h[p+3];break;default:u=this.getBezierValue(n,p,1,m-2),d=this.getBezierValue(n,p,2,m+18-2),f=this.getBezierValue(n,p,3,m+36-2)}if(a==ge.setup){let g=l.data;l.mixRotate=g.mixRotate+(u-g.mixRotate)*o,l.mixX=g.mixX+(d-g.mixX)*o,l.mixY=g.mixY+(f-g.mixY)*o}else l.mixRotate+=(u-l.mixRotate)*o,l.mixX+=(d-l.mixX)*o,l.mixY+=(f-l.mixY)*o}},lo=class extends Os{constructor(t,i,n,r){super(t,i,r+"|"+n);w(this,"constraintIndex",0);this.constraintIndex=n}apply(t,i,n,r,o,a,c){let l;if(this.constraintIndex==-1){const h=n>=this.frames[0]?this.getCurveValue(n):0;for(const u of t.physicsConstraints)u.active&&this.global(u.data)&&this.set(u,this.getAbsoluteValue2(n,o,a,this.get(u),this.setup(u),h))}else l=t.physicsConstraints[this.constraintIndex],l.active&&this.set(l,this.getAbsoluteValue(n,o,a,this.get(l),this.setup(l)))}},Rb=class extends lo{constructor(e,t,i){super(e,t,i,rt.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},Pb=class extends lo{constructor(e,t,i){super(e,t,i,rt.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},kb=class extends lo{constructor(e,t,i){super(e,t,i,rt.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},Fb=class extends lo{constructor(e,t,i){super(e,t,i,rt.physicsConstraintMass)}setup(e){return 1/e.data.massInverse}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}},Ob=class extends lo{constructor(e,t,i){super(e,t,i,rt.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},Bb=class extends lo{constructor(e,t,i){super(e,t,i,rt.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},Lb=class extends lo{constructor(e,t,i){super(e,t,i,rt.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}};var Hr;let Db=(Hr=class extends Ut{constructor(t,i){super(t,Hr.propertyIds);w(this,"constraintIndex");this.constraintIndex=i}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i}apply(t,i,n,r,o,a,c){let l;if(this.constraintIndex!=-1&&(l=t.physicsConstraints[this.constraintIndex],!l.active))return;const h=this.frames;if(i>n)this.apply(t,i,Number.MAX_VALUE,[],o,a,c),i=-1;else if(i>=h[h.length-1])return;if(!(n=h[Ut.search1(h,i)+1]))if(l!=null)l.reset();else for(const u of t.physicsConstraints)u.active&&u.reset()}},w(Hr,"propertyIds",[rt.physicsConstraintReset.toString()]),Hr);var Bi;let Nb=(Bi=class extends Ut{constructor(t,i,n){super(t,[rt.sequence+"|"+i+"|"+n.sequence.id]);w(this,"slotIndex");w(this,"attachment");this.slotIndex=i,this.attachment=n}getFrameEntries(){return Bi.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,i,n,r,o){let a=this.frames;t*=Bi.ENTRIES,a[t]=i,a[t+Bi.MODE]=n|r<<4,a[t+Bi.DELAY]=o}apply(t,i,n,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.attachment,u=this.attachment;if(h!=u&&(!(h instanceof Un)||h.timelineAttachment!=u))return;if(c==Ri.mixOut){a==ge.setup&&(l.sequenceIndex=-1);return}let d=this.frames;if(n>4,x=this.attachment.sequence.regions.length,y=lb[m&15];if(y!=xi.hold)switch(v+=(n-p)/g+1e-5|0,y){case xi.once:v=Math.min(x-1,v);break;case xi.loop:v%=x;break;case xi.pingpong:{let _=(x<<1)-2;v=_==0?0:v%_,v>=x&&(v=_-v);break}case xi.onceReverse:v=Math.max(x-1-v,0);break;case xi.loopReverse:v=x-1-v%x;break;case xi.pingpongReverse:{let _=(x<<1)-2;v=_==0?0:(v+x-1)%_,v>=x&&(v=_-v)}}l.sequenceIndex=v}},w(Bi,"ENTRIES",3),w(Bi,"MODE",1),w(Bi,"DELAY",2),Bi);var Rn;let pR=(Rn=class{constructor(e){w(this,"data");w(this,"tracks",new Array);w(this,"timeScale",1);w(this,"unkeyedState",0);w(this,"events",new Array);w(this,"listeners",new Array);w(this,"queue",new vR(this));w(this,"propertyIDs",new rb);w(this,"animationsChanged",!1);w(this,"trackEntryPool",new lh(()=>new gR));this.data=e}static emptyAnimation(){return Rn._emptyAnimation}update(e){e*=this.timeScale;let t=this.tracks;for(let i=0,n=t.length;i0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){let c=r.trackLast-a.delay;if(c>=0){for(a.delay=0,a.trackTime+=r.timeScale==0?0:(c/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setCurrent(i,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[i]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let c=r.mixingFrom;for(r.mixingFrom=null,c&&(c.mixingTo=null);c;)this.queue.end(c),c=c.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){let i=e.mixingFrom;if(!i)return!0;let n=this.updateMixingFrom(i,t);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,e.nextTrackLast!=-1&&e.mixTime>=e.mixDuration?((i.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=i.mixingFrom,i.mixingFrom!=null&&(i.mixingFrom.mixingTo=e),e.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=t*i.timeScale,e.mixTime+=t,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let t=this.events,i=this.tracks,n=!1;for(let d=0,f=i.length;d0)continue;n=!0;let m=d==0?ge.first:p.mixBlend,g=p.alpha;p.mixingFrom?g*=this.applyMixingFrom(p,e,m):p.trackTime>=p.trackEnd&&!p.next&&(g=0);let v=g>=p.alphaAttachmentThreshold,x=p.animationLast,y=p.getAnimationTime(),_=y,C=t;p.reverse&&(_=p.animation.duration-_,C=null);let S=p.animation.timelines,b=S.length;if(d==0&&g==1||m==ge.add){d==0&&(v=!0);for(let M=0;M1&&(r=1),i!=ge.first&&(i=n.mixBlend));let o=r=n.alphaAttachmentThreshold):(a&&C instanceof Va&&b==ge.setup&&(S=Ri.mixIn),C.apply(t,d,p,m,M,b,S))}}return e.mixDuration>0&&this.queueEvents(n,f),this.events.length=0,n.nextAnimationLast=f,n.nextTrackLast=n.trackTime,r}applyAttachmentTimeline(e,t,i,n,r){var o=t.slots[e.slotIndex];o.bone.active&&(i=0,y=m>=0;Math.abs(g)<=90&&Ie.signum(g)!=Ie.signum(p)&&(Math.abs(m-v)>180?(f+=360*Ie.signum(m),y=x):v!=0?f-=360*Ie.signum(m):y=x),y!=x&&(f+=360*Ie.signum(m)),o[a]=f}o[a+1]=p,l.rotation=u+f*n}queueEvents(e,t){let i=e.animationStart,n=e.animationEnd,r=n-i,o=e.trackLast%r,a=this.events,c=0,l=a.length;for(;cn||this.queue.event(e,u)}let h=!1;if(e.loop)if(r==0)h=!0;else{const u=Math.floor(e.trackTime/r);h=u>0&&u>Math.floor(e.trackLast/r)}else h=t>=n&&e.animationLast=this.tracks.length)return;let t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let i=t;for(;;){let n=i.mixingFrom;if(!n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(e,t,i){let n=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,n&&(i&&this.queue.interrupt(n),t.mixingFrom=n,n.mixingTo=t,t.mixTime=0,n.mixingFrom&&n.mixDuration>0&&(t.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,i=!1){let n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error("Animation not found: "+t);return this.setAnimationWith(e,n,i)}setAnimationWith(e,t,i=!1){if(!t)throw new Error("animation cannot be null.");let n=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast==-1?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,n=!1):this.clearNext(r));let o=this.trackEntry(e,t,i,r);return this.setCurrent(e,o,n),this.queue.drain(),o}addAnimation(e,t,i=!1,n=0){let r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);return this.addAnimationWith(e,r,i,n)}addAnimationWith(e,t,i=!1,n=0){if(!t)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;let o=this.trackEntry(e,t,i,r);return r?(r.next=o,o.previous=r,n<=0&&(n=Math.max(n+r.getTrackComplete()-o.mixDuration,0))):(this.setCurrent(e,o,!0),this.queue.drain(),n<0&&(n=0)),o.delay=n,o}setEmptyAnimation(e,t=0){let i=this.setAnimationWith(e,Rn.emptyAnimation(),!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){let n=this.addAnimationWith(e,Rn.emptyAnimation(),!1,i);return i<=0&&(n.delay=Math.max(n.delay+n.mixDuration-t,0)),n.mixDuration=t,n.trackEnd=t,n}setEmptyAnimations(e=0){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let i=0,n=this.tracks.length;i0){r[c]=yR,o[c]=u;continue e}break}r[c]=Jd}}}getCurrent(e){return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){let t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},w(Rn,"_emptyAnimation",new lp("",[],0)),Rn),gR=class{constructor(){w(this,"animation",null);w(this,"previous",null);w(this,"next",null);w(this,"mixingFrom",null);w(this,"mixingTo",null);w(this,"listener",null);w(this,"trackIndex",0);w(this,"loop",!1);w(this,"holdPrevious",!1);w(this,"reverse",!1);w(this,"shortestRotation",!1);w(this,"eventThreshold",0);w(this,"mixAttachmentThreshold",0);w(this,"alphaAttachmentThreshold",0);w(this,"mixDrawOrderThreshold",0);w(this,"animationStart",0);w(this,"animationEnd",0);w(this,"animationLast",0);w(this,"nextAnimationLast",0);w(this,"delay",0);w(this,"trackTime",0);w(this,"trackLast",0);w(this,"nextTrackLast",0);w(this,"trackEnd",0);w(this,"timeScale",0);w(this,"alpha",0);w(this,"mixTime",0);w(this,"_mixDuration",0);w(this,"interruptAlpha",0);w(this,"totalAlpha",0);w(this,"mixBlend",ge.replace);w(this,"timelineMode",new Array);w(this,"timelineHoldMix",new Array);w(this,"timelinesRotation",new Array)}get mixDuration(){return this._mixDuration}set mixDuration(e){this._mixDuration=e}setMixDurationWithDelay(e,t){this._mixDuration=e,t<=0&&(this.previous!=null?t=Math.max(t+this.previous.getTrackComplete()-e,0):t=0),this.delay=t}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let e=this.animationEnd-this.animationStart;return e==0?this.animationStart:this.trackTime%e+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let e=this.animationEnd-this.animationStart;if(e!=0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime=0}},vR=class{constructor(e){w(this,"objects",[]);w(this,"drainDisabled",!1);w(this,"animState");this.animState=e}start(e){this.objects.push(Hi.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(Hi.interrupt),this.objects.push(e)}end(e){this.objects.push(Hi.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(Hi.dispose),this.objects.push(e)}complete(e){this.objects.push(Hi.complete),this.objects.push(e)}event(e,t){this.objects.push(Hi.event),this.objects.push(e),this.objects.push(t)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects;for(let t=0;t{h.width=parseInt(i[1]),h.height=parseInt(i[2])},n.format=()=>{},n.filter=h=>{h.minFilter=Re.enumValue(ui,i[1]),h.magFilter=Re.enumValue(ui,i[2])},n.repeat=h=>{i[1].indexOf("x")!=-1&&(h.uWrap=Fn.Repeat),i[1].indexOf("y")!=-1&&(h.vWrap=Fn.Repeat)},n.pma=h=>{h.pma=i[1]=="true"};var r={};r.xy=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2])},r.size=h=>{h.width=parseInt(i[1]),h.height=parseInt(i[2])},r.bounds=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2]),h.width=parseInt(i[3]),h.height=parseInt(i[4])},r.offset=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2])},r.orig=h=>{h.originalWidth=parseInt(i[1]),h.originalHeight=parseInt(i[2])},r.offsets=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2]),h.originalWidth=parseInt(i[3]),h.originalHeight=parseInt(i[4])},r.rotate=h=>{let u=i[1];u=="true"?h.degrees=90:u!="false"&&(h.degrees=parseInt(u))},r.index=h=>{h.index=parseInt(i[1])};let o=t.readLine();for(;o&&o.trim().length==0;)o=t.readLine();for(;!(!o||o.trim().length==0||t.readEntry(i,o)==0);)o=t.readLine();let a=null,c=null,l=null;for(;o!==null;)if(o.trim().length==0)a=null,o=t.readLine();else if(a){let h=new Yb(a,o);for(;;){let u=t.readEntry(i,o=t.readLine());if(u==0)break;let d=r[i[0]];if(d)d(h);else{c||(c=[]),l||(l=[]),c.push(i[0]);let f=[];for(let p=0;p0&&l&&l.length>0&&(h.names=c,h.values=l,c=null,l=null),h.u=h.x/a.width,h.v=h.y/a.height,h.degrees==90?(h.u2=(h.x+h.height)/a.width,h.v2=(h.y+h.width)/a.height):(h.u2=(h.x+h.width)/a.width,h.v2=(h.y+h.height)/a.height),this.regions.push(h)}else{for(a=new TR(o.trim());t.readEntry(i,o=t.readLine())!=0;){let h=n[i[0]];h&&h(a)}this.pages.push(a)}}findRegion(e){for(let t=0;t=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length==0))return 0;let i=t.indexOf(":");if(i==-1)return 0;e[0]=t.substr(0,i).trim();for(let n=1,r=i+1;;n++){let o=t.indexOf(",",r);if(o==-1)return e[n]=t.substr(r).trim(),n;if(e[n]=t.substr(r,o-r).trim(),r=o+1,n==4)return 4}}},TR=class{constructor(e){w(this,"name");w(this,"minFilter",ui.Nearest);w(this,"magFilter",ui.Nearest);w(this,"uWrap",Fn.ClampToEdge);w(this,"vWrap",Fn.ClampToEdge);w(this,"texture",null);w(this,"width",0);w(this,"height",0);w(this,"pma",!1);w(this,"regions",new Array);this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(let t of this.regions)t.texture=e}},Yb=class extends SR{constructor(t,i){super();w(this,"page");w(this,"name");w(this,"x",0);w(this,"y",0);w(this,"offsetX",0);w(this,"offsetY",0);w(this,"originalWidth",0);w(this,"originalHeight",0);w(this,"index",0);w(this,"degrees",0);w(this,"names",null);w(this,"values",null);this.page=t,this.name=i,t.regions.push(this)}},Sl=class nm extends Un{constructor(t,i){super(t);w(this,"region",null);w(this,"path");w(this,"regionUVs",[]);w(this,"uvs",[]);w(this,"triangles",[]);w(this,"color",new st(1,1,1,1));w(this,"width",0);w(this,"height",0);w(this,"hullLength",0);w(this,"edges",[]);w(this,"parentMesh",null);w(this,"sequence",null);w(this,"tempColor",new st(0,0,0,0));this.path=i}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=Re.newFloatArray(t.length));let i=this.uvs,n=this.uvs.length,r=this.region.u,o=this.region.v,a=0,c=0;if(this.region instanceof Yb){let l=this.region,h=l.page,u=h.width,d=h.height;switch(l.degrees){case 90:r-=(l.originalHeight-l.offsetY-l.height)/u,o-=(l.originalWidth-l.offsetX-l.width)/d,a=l.originalHeight/u,c=l.originalWidth/d;for(let f=0;f= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=i}};var Gt;(function(s){s[s.Normal=0]="Normal",s[s.OnlyTranslation=1]="OnlyTranslation",s[s.NoRotationOrReflection=2]="NoRotationOrReflection",s[s.NoScale=3]="NoScale",s[s.NoScaleOrReflection=4]="NoScaleOrReflection"})(Gt||(Gt={}));let Mv=class{constructor(e,t,i){w(this,"data");w(this,"skeleton");w(this,"parent",null);w(this,"children",new Array);w(this,"x",0);w(this,"y",0);w(this,"rotation",0);w(this,"scaleX",0);w(this,"scaleY",0);w(this,"shearX",0);w(this,"shearY",0);w(this,"ax",0);w(this,"ay",0);w(this,"arotation",0);w(this,"ascaleX",0);w(this,"ascaleY",0);w(this,"ashearX",0);w(this,"ashearY",0);w(this,"a",0);w(this,"b",0);w(this,"c",0);w(this,"d",0);w(this,"worldY",0);w(this,"worldX",0);w(this,"inherit",Gt.Normal);w(this,"sorted",!1);w(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=t,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(e){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,t,i,n,r,o,a){this.ax=e,this.ay=t,this.arotation=i,this.ascaleX=n,this.ascaleY=r,this.ashearX=o,this.ashearY=a;let c=this.parent;if(!c){let f=this.skeleton;const p=f.scaleX,m=f.scaleY,g=(i+o)*Ie.degRad,v=(i+90+a)*Ie.degRad;this.a=Math.cos(g)*n*p,this.b=Math.cos(v)*r*p,this.c=Math.sin(g)*n*m,this.d=Math.sin(v)*r*m,this.worldX=e*p+f.x,this.worldY=t*m+f.y;return}let l=c.a,h=c.b,u=c.c,d=c.d;switch(this.worldX=l*e+h*t+c.worldX,this.worldY=u*e+d*t+c.worldY,this.inherit){case Gt.Normal:{const f=(i+o)*Ie.degRad,p=(i+90+a)*Ie.degRad,m=Math.cos(f)*n,g=Math.cos(p)*r,v=Math.sin(f)*n,x=Math.sin(p)*r;this.a=l*m+h*v,this.b=l*g+h*x,this.c=u*m+d*v,this.d=u*g+d*x;return}case Gt.OnlyTranslation:{const f=(i+o)*Ie.degRad,p=(i+90+a)*Ie.degRad;this.a=Math.cos(f)*n,this.b=Math.cos(p)*r,this.c=Math.sin(f)*n,this.d=Math.sin(p)*r;break}case Gt.NoRotationOrReflection:{let f=1/this.skeleton.scaleX,p=1/this.skeleton.scaleY;l*=f,u*=p;let m=l*l+u*u,g=0;m>1e-4?(m=Math.abs(l*d*p-h*f*u)/m,h=u*m,d=l*m,g=Math.atan2(u,l)*Ie.radDeg):(l=0,u=0,g=90-Math.atan2(d,h)*Ie.radDeg);const v=(i+o-g)*Ie.degRad,x=(i+a-g+90)*Ie.degRad,y=Math.cos(v)*n,_=Math.cos(x)*r,C=Math.sin(v)*n,S=Math.sin(x)*r;this.a=l*y-h*C,this.b=l*_-h*S,this.c=u*y+d*C,this.d=u*_+d*S;break}case Gt.NoScale:case Gt.NoScaleOrReflection:{i*=Ie.degRad;const f=Math.cos(i),p=Math.sin(i);let m=(l*f+h*p)/this.skeleton.scaleX,g=(u*f+d*p)/this.skeleton.scaleY,v=Math.sqrt(m*m+g*g);v>1e-5&&(v=1/v),m*=v,g*=v,v=Math.sqrt(m*m+g*g),this.inherit==Gt.NoScale&&l*d-h*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(v=-v),i=Math.PI/2+Math.atan2(g,m);const x=Math.cos(i)*v,y=Math.sin(i)*v;o*=Ie.degRad,a=(90+a)*Ie.degRad;const _=Math.cos(o)*n,C=Math.cos(a)*r,S=Math.sin(o)*n,b=Math.sin(a)*r;this.a=m*_+x*S,this.b=m*C+x*b,this.c=g*_+y*S,this.d=g*C+y*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let e=this.data;this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}updateAppliedTransform(){let e=this.parent;if(!e){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*Ie.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*Ie.radDeg;return}let t=e.a,i=e.b,n=e.c,r=e.d,o=1/(t*r-i*n),a=r*o,c=i*o,l=n*o,h=t*o,u=this.worldX-e.worldX,d=this.worldY-e.worldY;this.ax=u*a-d*c,this.ay=d*h-u*l;let f,p,m,g;if(this.inherit==Gt.OnlyTranslation)f=this.a,p=this.b,m=this.c,g=this.d;else{switch(this.inherit){case Gt.NoRotationOrReflection:{let C=Math.abs(t*r-i*n)/(t*t+n*n);i=-n*this.skeleton.scaleX*C/this.skeleton.scaleY,r=t*this.skeleton.scaleY*C/this.skeleton.scaleX,o=1/(t*r-i*n),a=r*o,c=i*o;break}case Gt.NoScale:case Gt.NoScaleOrReflection:let v=Ie.cosDeg(this.rotation),x=Ie.sinDeg(this.rotation);t=(t*v+i*x)/this.skeleton.scaleX,n=(n*v+r*x)/this.skeleton.scaleY;let y=Math.sqrt(t*t+n*n);y>1e-5&&(y=1/y),t*=y,n*=y,y=Math.sqrt(t*t+n*n),this.inherit==Gt.NoScale&&o<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(y=-y);let _=Ie.PI/2+Math.atan2(n,t);i=Math.cos(_)*y,r=Math.sin(_)*y,o=1/(t*r-i*n),a=r*o,c=i*o,l=n*o,h=t*o}f=a*this.a-c*this.c,p=a*this.b-c*this.d,m=h*this.c-l*this.a,g=h*this.d-l*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let v=f*g-p*m;this.ascaleY=v/this.ascaleX,this.ashearY=-Math.atan2(f*p+m*g,v)*Ie.radDeg,this.arotation=Math.atan2(m,f)*Ie.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*Ie.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*Ie.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*Ie.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(e){let t=1/(this.a*this.d-this.b*this.c),i=e.x-this.worldX,n=e.y-this.worldY;return e.x=i*this.d*t-n*this.b*t,e.y=n*this.a*t-i*this.c*t,e}localToWorld(e){let t=e.x,i=e.y;return e.x=t*this.a+i*this.b+this.worldX,e.y=t*this.c+i*this.d+this.worldY,e}worldToParent(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.worldToLocal(e)}parentToWorld(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.localToWorld(e)}worldToLocalRotation(e){let t=Ie.sinDeg(e),i=Ie.cosDeg(e);return Math.atan2(this.a*t-this.c*i,this.d*i-this.b*t)*Ie.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=Ie.sinDeg(e),i=Ie.cosDeg(e);return Math.atan2(i*this.c+t*this.d,i*this.a+t*this.b)*Ie.radDeg}rotateWorld(e){e*=Ie.degRad;const t=Math.sin(e),i=Math.cos(e),n=this.a,r=this.b;this.a=i*n-t*this.c,this.b=i*r-t*this.d,this.c=t*n+i*this.c,this.d=t*r+i*this.d}},ou=class{constructor(e,t,i){w(this,"name");w(this,"order");w(this,"skinRequired");this.name=e,this.order=t,this.skinRequired=i}},zb=class{constructor(e,t){w(this,"data");w(this,"intValue",0);w(this,"floatValue",0);w(this,"stringValue",null);w(this,"time",0);w(this,"volume",0);w(this,"balance",0);if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},qb=class{constructor(e){w(this,"name");w(this,"intValue",0);w(this,"floatValue",0);w(this,"stringValue",null);w(this,"audioPath",null);w(this,"volume",0);w(this,"balance",0);this.name=e}},MR=class{constructor(e,t){w(this,"data");w(this,"bones");w(this,"target");w(this,"bendDirection",0);w(this,"compress",!1);w(this,"stretch",!1);w(this,"mix",1);w(this,"softness",0);w(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0;n180?f-=360:f<-180&&(f+=360);let g=e.ascaleX,v=e.ascaleY;if(n||r){switch(e.inherit){case Gt.NoScale:case Gt.NoScaleOrReflection:p=t-e.worldX,m=i-e.worldY}const x=e.data.length*g;if(x>1e-4){const y=p*p+m*m;if(n&&yx*x){const _=(Math.sqrt(y)/x-1)*a+1;g*=_,o&&(v*=_)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*a,g,v,e.ashearX,e.ashearY)}apply2(e,t,i,n,r,o,a,c,l){if(e.inherit!=Gt.Normal||t.inherit!=Gt.Normal)return;let h=e.ax,u=e.ay,d=e.ascaleX,f=e.ascaleY,p=d,m=f,g=t.ascaleX,v=0,x=0,y=0;d<0?(d=-d,v=180,y=-1):(v=0,y=1),f<0&&(f=-f,y=-y),g<0?(g=-g,x=180):x=0;let _=t.ax,C=0,S=0,b=0,M=e.a,I=e.b,F=e.c,E=e.d,k=Math.abs(d-f)<=1e-4;!k||o?(C=0,S=M*_+e.worldX,b=F*_+e.worldY):(C=t.ay,S=M*_+I*C+e.worldX,b=F*_+E*C+e.worldY);let O=e.parent;if(!O)throw new Error("IK parent must itself have a parent.");M=O.a,I=O.b,F=O.c,E=O.d;let D=M*E-I*F,$=S-O.worldX,N=b-O.worldY;D=Math.abs(D)<=1e-4?0:1/D;let U=($*E-N*I)*D-h,A=(N*M-$*F)*D-u,P=Math.sqrt(U*U+A*A),L=t.data.length*g,B,X;if(P<1e-4){this.apply1(e,i,n,!1,o,!1,l),t.updateWorldTransformWith(_,C,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}$=i-O.worldX,N=n-O.worldY;let V=($*E-N*I)*D-h,q=(N*M-$*F)*D-u,W=V*V+q*q;if(c!=0){c*=d*(g+1)*.5;let le=Math.sqrt(W),ue=le-P-L*d+c;if(ue>0){let ae=Math.min(1,ue/(c*2))-1;ae=(ue-c*(1-ae*ae))/le,V-=ae*V,q-=ae*q,W=V*V+q*q}}e:if(k){L*=d;let le=(W-P*P-L*L)/(2*P*L);le<-1?(le=-1,X=Math.PI*r):le>1?(le=1,X=0,o&&(M=(Math.sqrt(W)/(P+L)-1)*l+1,p*=M,a&&(m*=M))):X=Math.acos(le)*r,M=P+L*le,I=L*Math.sin(X),B=Math.atan2(q*M-V*I,V*M+q*I)}else{M=d*L,I=f*L;let le=M*M,ue=I*I,ae=Math.atan2(q,V);F=ue*P*P+le*W-le*ue;let xe=-2*ue*P,Y=ue-le;if(E=xe*xe-4*Y*F,E>=0){let ce=Math.sqrt(E);xe<0&&(ce=-ce),ce=-(xe+ce)*.5;let Ce=ce/Y,ye=F/ce,we=Math.abs(Ce)=0){N=Math.sqrt(Ce)*r,B=ae-Math.atan2(N,we),X=Math.atan2(N/f,(we-P)/d);break e}}let j=Ie.PI,H=P-M,G=H*H,z=0,ie=0,fe=P+M,te=fe*fe,oe=0;F=-M*P/(le-ue),F>=-1&&F<=1&&(F=Math.acos(F),$=M*Math.cos(F)+P,N=I*Math.sin(F),E=$*$+N*N,Ete&&(ie=F,te=E,fe=$,oe=N)),W<=(G+te)*.5?(B=ae-Math.atan2(z*r,H),X=j*r):(B=ae-Math.atan2(oe*r,fe),X=ie*r)}let ne=Math.atan2(C,_)*y,re=e.arotation;B=(B-ne)*Ie.radDeg+v-re,B>180?B-=360:B<-180&&(B+=360),e.updateWorldTransformWith(h,u,re+B*l,p,m,0,0),re=t.arotation,X=((X+ne)*Ie.radDeg-t.ashearX)*y+x-re,X>180?X-=360:X<-180&&(X+=360),t.updateWorldTransformWith(_,C,re+X*l,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},Kb=class extends ou{constructor(t){super(t,0,!1);w(this,"bones",new Array);w(this,"_target",null);w(this,"bendDirection",0);w(this,"compress",!1);w(this,"stretch",!1);w(this,"uniform",!1);w(this,"mix",0);w(this,"softness",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Zb=class extends ou{constructor(t){super(t,0,!1);w(this,"bones",new Array);w(this,"_target",null);w(this,"positionMode",rn.Fixed);w(this,"spacingMode",li.Fixed);w(this,"rotateMode",Jr.Chain);w(this,"offsetRotation",0);w(this,"position",0);w(this,"spacing",0);w(this,"mixRotate",0);w(this,"mixX",0);w(this,"mixY",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}};var rn;(function(s){s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent"})(rn||(rn={}));var li;(function(s){s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s[s.Proportional=3]="Proportional"})(li||(li={}));var Jr;(function(s){s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale"})(Jr||(Jr={}));var Ei;let CR=(Ei=class{constructor(e,t){w(this,"data");w(this,"bones");w(this,"target");w(this,"position",0);w(this,"spacing",0);w(this,"mixRotate",0);w(this,"mixX",0);w(this,"mixY",0);w(this,"spaces",new Array);w(this,"positions",new Array);w(this,"world",new Array);w(this,"curves",new Array);w(this,"lengths",new Array);w(this,"segments",new Array);w(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0,r=e.bones.length;n0){_=u/_*p;for(let S=1;S0?Ie.degRad:-.01745329277777778}for(let _=0,C=3;_0){let E=S.a,k=S.b,O=S.c,D=S.d,$=0,N=0,U=0;if(a?$=m[C-1]:d[_+1]==0?$=m[C+2]:$=Math.atan2(F,I),$-=Math.atan2(O,E),y){N=Math.cos($),U=Math.sin($);let A=S.data.length;g+=(A*(N*E-U*O)-I)*i,v+=(A*(U*E+N*O)-F)*i}else $+=x;$>Ie.PI?$-=Ie.PI2:$<-3.1415927&&($+=Ie.PI2),$*=i,N=Math.cos($),U=Math.sin($),S.a=N*E-U*O,S.b=N*k-U*D,S.c=U*E+N*O,S.d=U*k+N*D}S.updateAppliedTransform()}}computeWorldPositions(e,t,i){let n=this.target,r=this.position,o=this.spaces,a=Re.setArraySize(this.positions,t*3+2),c=this.world,l=e.closed,h=e.worldVerticesLength,u=h/6,d=Ei.NONE;if(!e.constantSpeed){let A=e.lengths;u-=l?1:2;let P=A[u];this.data.positionMode==rn.Percent&&(r*=P);let L;switch(this.data.spacingMode){case li.Percent:L=P;break;case li.Proportional:L=P/t;break;default:L=1}c=Re.setArraySize(this.world,8);for(let B=0,X=0,V=0;BP){d!=Ei.AFTER&&(d=Ei.AFTER,e.computeWorldVertices(n,h-6,4,c,0,2)),this.addAfterPosition(W-P,c,0,a,X);continue}for(;;V++){let ne=A[V];if(!(W>ne)){if(V==0)W/=ne;else{let re=A[V-1];W=(W-re)/(ne-re)}break}}V!=d&&(d=V,l&&V==u?(e.computeWorldVertices(n,h-4,4,c,0,2),e.computeWorldVertices(n,0,4,c,4,2)):e.computeWorldVertices(n,V*6+2,8,c,0,2)),this.addCurvePosition(W,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],a,X,i||B>0&&q==0)}return a}l?(h+=2,c=Re.setArraySize(this.world,h),e.computeWorldVertices(n,2,h-4,c,0,2),e.computeWorldVertices(n,0,2,c,h-4,2),c[h-2]=c[0],c[h-1]=c[1]):(u--,h-=4,c=Re.setArraySize(this.world,h),e.computeWorldVertices(n,2,h,c,0,2));let f=Re.setArraySize(this.curves,u),p=0,m=c[0],g=c[1],v=0,x=0,y=0,_=0,C=0,S=0,b=0,M=0,I=0,F=0,E=0,k=0,O=0,D=0;for(let A=0,P=2;Ap){this.addAfterPosition(V-p,c,h-4,a,P);continue}for(;;L++){let q=f[L];if(!(V>q)){if(L==0)V/=q;else{let W=f[L-1];V=(V-W)/(q-W)}break}}if(L!=d){d=L;let q=L*6;for(m=c[q],g=c[q+1],v=c[q+2],x=c[q+3],y=c[q+4],_=c[q+5],C=c[q+6],S=c[q+7],b=(m-v*2+y)*.03,M=(g-x*2+_)*.03,I=((v-y)*3-m+C)*.006,F=((x-_)*3-g+S)*.006,E=b*2+I,k=M*2+F,O=(v-m)*.3+b+I*.16666667,D=(x-g)*.3+M+F*.16666667,U=Math.sqrt(O*O+D*D),N[0]=U,q=1;q<8;q++)O+=E,D+=k,E+=I,k+=F,U+=Math.sqrt(O*O+D*D),N[q]=U;O+=E,D+=k,U+=Math.sqrt(O*O+D*D),N[8]=U,O+=E+I,D+=k+F,U+=Math.sqrt(O*O+D*D),N[9]=U,B=0}for(V*=U;;B++){let q=N[B];if(!(V>q)){if(B==0)V/=q;else{let W=N[B-1];V=B+(V-W)/(q-W)}break}}this.addCurvePosition(V*.1,m,g,v,x,y,_,C,S,a,P,i||A>0&&X==0)}return a}addBeforePosition(e,t,i,n,r){let o=t[i],a=t[i+1],c=t[i+2]-o,l=t[i+3]-a,h=Math.atan2(l,c);n[r]=o+e*Math.cos(h),n[r+1]=a+e*Math.sin(h),n[r+2]=h}addAfterPosition(e,t,i,n,r){let o=t[i+2],a=t[i+3],c=o-t[i],l=a-t[i+1],h=Math.atan2(l,c);n[r]=o+e*Math.cos(h),n[r+1]=a+e*Math.sin(h),n[r+2]=h}addCurvePosition(e,t,i,n,r,o,a,c,l,h,u,d){if(e==0||isNaN(e)){h[u]=t,h[u+1]=i,h[u+2]=Math.atan2(r-i,n-t);return}let f=e*e,p=f*e,m=1-e,g=m*m,v=g*m,x=m*e,y=x*3,_=m*y,C=y*e,S=t*v+n*_+o*C+c*p,b=i*v+r*_+a*C+l*p;h[u]=S,h[u+1]=b,d&&(e<.001?h[u+2]=Math.atan2(r-i,n-t):h[u+2]=Math.atan2(b-(i*g+r*x*2+a*f),S-(t*g+n*x*2+o*f)))}},w(Ei,"NONE",-1),w(Ei,"BEFORE",-2),w(Ei,"AFTER",-3),w(Ei,"epsilon",1e-5),Ei),AR=class{constructor(e,t){w(this,"data");w(this,"_bone",null);w(this,"inertia",0);w(this,"strength",0);w(this,"damping",0);w(this,"massInverse",0);w(this,"wind",0);w(this,"gravity",0);w(this,"mix",0);w(this,"_reset",!0);w(this,"ux",0);w(this,"uy",0);w(this,"cx",0);w(this,"cy",0);w(this,"tx",0);w(this,"ty",0);w(this,"xOffset",0);w(this,"xVelocity",0);w(this,"yOffset",0);w(this,"yVelocity",0);w(this,"rotateOffset",0);w(this,"rotateVelocity",0);w(this,"scaleOffset",0);w(this,"scaleVelocity",0);w(this,"active",!1);w(this,"skeleton");w(this,"remaining",0);w(this,"lastTime",0);this.data=e,this.skeleton=t,this.bone=t.bones[e.bone.index],this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}reset(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}setToSetupPose(){const e=this.data;this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}isActive(){return this.active}update(e){const t=this.mix;if(t==0)return;const i=this.data.x>0,n=this.data.y>0,r=this.data.rotate>0||this.data.shearX>0,o=this.data.scaleX>0,a=this.bone,c=a.data.length;switch(e){case ir.none:return;case ir.reset:this.reset();case ir.update:const l=this.skeleton,h=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=h,this.lastTime=l.time;const u=a.worldX,d=a.worldY;if(this._reset)this._reset=!1,this.ux=u,this.uy=d;else{let f=this.remaining,p=this.inertia,m=this.data.step,g=this.skeleton.data.referenceScale,v=-1,x=this.data.limit*h,y=x*Math.abs(l.scaleY);if(x*=Math.abs(l.scaleX),i||n){if(i){const _=(this.ux-u)*p;this.xOffset+=_>x?x:_<-x?-x:_,this.ux=u}if(n){const _=(this.uy-d)*p;this.yOffset+=_>y?y:_<-y?-y:_,this.uy=d}if(f>=m){v=Math.pow(this.damping,60*m);const _=this.massInverse*m,C=this.strength,S=this.wind*g*l.scaleX,b=this.gravity*g*l.scaleY;do i&&(this.xVelocity+=(S-this.xOffset*C)*_,this.xOffset+=this.xVelocity*m,this.xVelocity*=v),n&&(this.yVelocity-=(b+this.yOffset*C)*_,this.yOffset+=this.yVelocity*m,this.yVelocity*=v),f-=m;while(f>=m)}i&&(a.worldX+=this.xOffset*t*this.data.x),n&&(a.worldY+=this.yOffset*t*this.data.y)}if(r||o){let _=Math.atan2(a.c,a.a),C=0,S=0,b=0,M=this.cx-a.worldX,I=this.cy-a.worldY;if(M>x?M=x:M<-x&&(M=-x),I>y?I=y:I<-y&&(I=-y),r){b=(this.data.rotate+this.data.shearX)*t;let F=Math.atan2(I+this.ty,M+this.tx)-_-this.rotateOffset*b;this.rotateOffset+=(F-Math.ceil(F*Ie.invPI2-.5)*Ie.PI2)*p,F=this.rotateOffset*b+_,C=Math.cos(F),S=Math.sin(F),o&&(F=c*a.getWorldScaleX(),F>0&&(this.scaleOffset+=(M*C+I*S)*p/F))}else{C=Math.cos(_),S=Math.sin(_);const F=c*a.getWorldScaleX();F>0&&(this.scaleOffset+=(M*C+I*S)*p/F)}if(f=this.remaining,f>=m){v==-1&&(v=Math.pow(this.damping,60*m));const F=this.massInverse*m,E=this.strength,k=this.wind,O=up.yDown?-this.gravity:this.gravity,D=c/g;for(;;)if(f-=m,o&&(this.scaleVelocity+=(k*C-O*S-this.scaleOffset*E)*F,this.scaleOffset+=this.scaleVelocity*m,this.scaleVelocity*=v),r){if(this.rotateVelocity-=((k*S+O*C)*D+this.rotateOffset*E)*F,this.rotateOffset+=this.rotateVelocity*m,this.rotateVelocity*=v,f0){let f=0;this.data.rotate>0&&(f=l*this.data.rotate,h=Math.sin(f),u=Math.cos(f),d=a.b,a.b=u*d-h*a.d,a.d=h*d+u*a.d),f+=l*this.data.shearX,h=Math.sin(f),u=Math.cos(f),d=a.a,a.a=u*d-h*a.c,a.c=h*d+u*a.c}else l*=this.data.rotate,h=Math.sin(l),u=Math.cos(l),d=a.a,a.a=u*d-h*a.c,a.c=h*d+u*a.c,d=a.b,a.b=u*d-h*a.d,a.d=h*d+u*a.d}if(o){const l=1+this.scaleOffset*t*this.data.scaleX;a.a*=l,a.c*=l}e!=ir.pose&&(this.tx=c*a.a,this.ty=c*a.c),a.updateAppliedTransform()}translate(e,t){this.ux-=e,this.uy-=t,this.cx-=e,this.cy-=t}rotate(e,t,i){const n=i*Ie.degRad,r=Math.cos(n),o=Math.sin(n),a=this.cx-e,c=this.cy-t;this.translate(a*r-c*o-a,a*o+c*r-c)}},ER=class{constructor(e,t){w(this,"data");w(this,"bone");w(this,"color");w(this,"darkColor",null);w(this,"attachment",null);w(this,"attachmentState",0);w(this,"sequenceIndex",-1);w(this,"deform",new Array);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("bone cannot be null.");this.data=e,this.bone=t,this.color=new st,this.darkColor=e.darkColor?new st:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof Un)||!(this.attachment instanceof Un)||e.timelineAttachment!=this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=e,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},IR=class{constructor(e,t){w(this,"data");w(this,"bones");w(this,"target");w(this,"mixRotate",0);w(this,"mixX",0);w(this,"mixY",0);w(this,"mixScaleX",0);w(this,"mixScaleY",0);w(this,"mixShearY",0);w(this,"temp",new ch);w(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0;n0?Ie.degRad:-.01745329277777778,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let v=0,x=g.length;vIe.PI?M-=Ie.PI2:M<-3.1415927&&(M+=Ie.PI2),M*=e;let I=Math.cos(M),F=Math.sin(M);y.a=I*_-F*S,y.b=I*C-F*b,y.c=F*_+I*S,y.d=F*C+I*b}if(a){let _=this.temp;c.localToWorld(_.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(_.x-y.worldX)*t,y.worldY+=(_.y-y.worldY)*i}if(n!=0){let _=Math.sqrt(y.a*y.a+y.c*y.c);_!=0&&(_=(_+(Math.sqrt(l*l+u*u)-_+this.data.offsetScaleX)*n)/_),y.a*=_,y.c*=_}if(r!=0){let _=Math.sqrt(y.b*y.b+y.d*y.d);_!=0&&(_=(_+(Math.sqrt(h*h+d*d)-_+this.data.offsetScaleY)*r)/_),y.b*=_,y.d*=_}if(o>0){let _=y.b,C=y.d,S=Math.atan2(C,_),b=Math.atan2(d,h)-Math.atan2(u,l)-(S-Math.atan2(y.c,y.a));b>Ie.PI?b-=Ie.PI2:b<-3.1415927&&(b+=Ie.PI2),b=S+(b+m)*o;let M=Math.sqrt(_*_+C*C);y.b=Math.cos(b)*M,y.d=Math.sin(b)*M}y.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,i=this.mixY,n=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=t!=0||i!=0,c=this.target,l=c.a,h=c.b,u=c.c,d=c.d,f=l*d-h*u>0?Ie.degRad:-.01745329277777778,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let v=0,x=g.length;vIe.PI?M-=Ie.PI2:M<-3.1415927&&(M+=Ie.PI2),M*=e;let I=Math.cos(M),F=Math.sin(M);y.a=I*_-F*S,y.b=I*C-F*b,y.c=F*_+I*S,y.d=F*C+I*b}if(a){let _=this.temp;c.localToWorld(_.set(this.data.offsetX,this.data.offsetY)),y.worldX+=_.x*t,y.worldY+=_.y*i}if(n!=0){let _=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleX)*n+1;y.a*=_,y.c*=_}if(r!=0){let _=(Math.sqrt(h*h+d*d)-1+this.data.offsetScaleY)*r+1;y.b*=_,y.d*=_}if(o>0){let _=Math.atan2(d,h)-Math.atan2(u,l);_>Ie.PI?_-=Ie.PI2:_<-3.1415927&&(_+=Ie.PI2);let C=y.b,S=y.d;_=Math.atan2(S,C)+(_-Ie.PI/2+m)*o;let b=Math.sqrt(C*C+S*S);y.b=Math.cos(_)*b,y.d=Math.sin(_)*b}y.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,i=this.mixY,n=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=this.target,c=this.bones;for(let l=0,h=c.length;lt.data.name==e)??null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(t=>t.data.name==e)??null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(t=>t.data.name==e)??null}findPhysicsConstraint(e){if(e==null)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(t=>t.data.name==e)??null}getBoundsRect(e){let t=new ch,i=new ch;return this.getBounds(t,i,void 0,e),{x:t.x,y:t.y,width:i.x,height:i.y}}getBounds(e,t,i=new Array(2),n=null){if(!e)throw new Error("offset cannot be null.");if(!t)throw new Error("size cannot be null.");let r=this.drawOrder,o=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let h=0,u=r.length;h=n.length&&(n.length=e+1),n[e]||(n[e]={}),n[e][t]=i}addSkin(e){for(let n=0;n= 0.");if(!t)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=i}};var cr;(function(s){s[s.Normal=0]="Normal",s[s.Additive=1]="Additive",s[s.Multiply=2]="Multiply",s[s.Screen=3]="Screen"})(cr||(cr={}));let ew=class extends ou{constructor(t){super(t,0,!1);w(this,"bones",new Array);w(this,"_target",null);w(this,"mixRotate",0);w(this,"mixX",0);w(this,"mixY",0);w(this,"mixScaleX",0);w(this,"mixScaleY",0);w(this,"mixShearY",0);w(this,"offsetRotation",0);w(this,"offsetX",0);w(this,"offsetY",0);w(this,"offsetScaleX",0);w(this,"offsetScaleY",0);w(this,"offsetShearY",0);w(this,"relative",!1);w(this,"local",!1)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},am=class{constructor(e){w(this,"scale",1);w(this,"attachmentLoader");w(this,"linkedMeshes",new Array);this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,i=new uh;i.name="";let n=new RR(e),r=n.readInt32(),o=n.readInt32();i.hash=o==0&&r==0?null:o.toString(16)+r.toString(16),i.version=n.readString(),i.x=n.readFloat(),i.y=n.readFloat(),i.width=n.readFloat(),i.height=n.readFloat(),i.referenceScale=n.readFloat()*t;let a=n.readBoolean();a&&(i.fps=n.readFloat(),i.imagesPath=n.readString(),i.audioPath=n.readString());let c=0;c=n.readInt(!0);for(let h=0;h>1&3,f.rotateMode=p>>3&3,(p&128)!=0&&(f.offsetRotation=n.readFloat()),f.position=n.readFloat(),f.positionMode==rn.Fixed&&(f.position*=t),f.spacing=n.readFloat(),(f.spacingMode==li.Length||f.spacingMode==li.Fixed)&&(f.spacing*=t),f.mixRotate=n.readFloat(),f.mixX=n.readFloat(),f.mixY=n.readFloat(),i.pathConstraints.push(f)}c=n.readInt(!0);for(let h=0,u;h>4,e.readFloat())}n.push(S);break}}}}}let o=e.readInt(!0);if(o>0){let l=new Va(o),h=i.slots.length;for(let u=0;u=0;x--)p[x]=-1;let m=Re.newArray(h-f,0),g=0,v=0;for(let x=0;x=0;x--)p[x]==-1&&(p[x]=m[--v]);l.setFrame(u,d,p)}n.push(l)}let a=e.readInt(!0);if(a>0){let l=new hp(a);for(let h=0;h>>1^-(i&1)}readStringRef(){let e=this.readInt(!0);return e==0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="";for(let i=0;i>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),i+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),i+=3;break;default:t+=String.fromCharCode(n),i++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},PR=class{constructor(e,t,i,n,r){w(this,"parent");w(this,"skinIndex");w(this,"slotIndex");w(this,"mesh");w(this,"inheritTimeline");this.mesh=e,this.skinIndex=t,this.slotIndex=i,this.parent=n,this.inheritTimeline=r}},kR=class{constructor(e=null,t=null,i=0){w(this,"bones");w(this,"vertices");w(this,"length");this.bones=e,this.vertices=t,this.length=i}};var gn;(function(s){s[s.Region=0]="Region",s[s.BoundingBox=1]="BoundingBox",s[s.Mesh=2]="Mesh",s[s.LinkedMesh=3]="LinkedMesh",s[s.Path=4]="Path",s[s.Point=5]="Point",s[s.Clipping=6]="Clipping"})(gn||(gn={}));function Mi(s,e,t){let i=s.readFloat(),n=s.readFloat()*t;for(let r=0,o=0,a=e.getFrameCount()-1;e.setFrame(r,i,n),r!=a;r++){let c=s.readFloat(),l=s.readFloat()*t;switch(s.readByte()){case Vs:e.setStepped(r);break;case Ys:ht(s,e,o++,r,0,i,c,n,l,t)}i=c,n=l}return e}function Qd(s,e,t){let i=s.readFloat(),n=s.readFloat()*t,r=s.readFloat()*t;for(let o=0,a=0,c=e.getFrameCount()-1;e.setFrame(o,i,n,r),o!=c;o++){let l=s.readFloat(),h=s.readFloat()*t,u=s.readFloat()*t;switch(s.readByte()){case Vs:e.setStepped(o);break;case Ys:ht(s,e,a++,o,0,i,l,n,h,t),ht(s,e,a++,o,1,i,l,r,u,t)}i=l,n=h,r=u}return e}function ht(s,e,t,i,n,r,o,a,c,l){e.setBezier(t,i,n,r,a,s.readFloat(),s.readFloat()*l,s.readFloat(),s.readFloat()*l,o,c)}const FR=0,OR=1,BR=2,LR=3,DR=4,NR=5,UR=6,$R=7,XR=8,VR=9,YR=10,GR=0,HR=1,jR=2,WR=3,zR=4,qR=5,KR=0,ZR=1,JR=0,QR=1,eP=2,tP=0,iP=1,sP=2,nP=4,rP=5,oP=6,aP=7,lP=8,Vs=1,Ys=2;class ji{constructor(){w(this,"convexPolygons",new Array);w(this,"convexPolygonsIndices",new Array);w(this,"indicesArray",new Array);w(this,"isConcaveArray",new Array);w(this,"triangles",new Array);w(this,"polygonPool",new lh(()=>new Array));w(this,"polygonIndicesPool",new lh(()=>new Array))}triangulate(e){let t=e,i=e.length>>1,n=this.indicesArray;n.length=0;for(let a=0;a3;){let a=i-1,c=0,l=1;for(;;){e:if(!r[c]){let d=n[a]<<1,f=n[c]<<1,p=n[l]<<1,m=t[d],g=t[d+1],v=t[f],x=t[f+1],y=t[p],_=t[p+1];for(let C=(l+1)%i;C!=a;C=(C+1)%i){if(!r[C])continue;let S=n[C]<<1,b=t[S],M=t[S+1];if(ji.positiveArea(y,_,m,g,b,M)&&ji.positiveArea(m,g,v,x,b,M)&&ji.positiveArea(v,x,y,_,b,M))break e}break}if(l==0){do{if(!r[c])break;c--}while(c>0);break}a=c,c=l,l=(l+1)%i}o.push(n[(i+c-1)%i]),o.push(n[c]),o.push(n[(c+1)%i]),n.splice(c,1),r.splice(c,1),i--;let h=(i+c-1)%i,u=c==i?0:c;r[h]=ji.isConcave(h,i,t,n),r[u]=ji.isConcave(u,i,t,n)}return i==3&&(o.push(n[2]),o.push(n[0]),o.push(n[1])),o}decompose(e,t){let i=e,n=this.convexPolygons;this.polygonPool.freeAll(n),n.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let o=this.polygonIndicesPool.obtain();o.length=0;let a=this.polygonPool.obtain();a.length=0;let c=-1,l=0;for(let h=0,u=t.length;h0?(n.push(a),r.push(o)):(this.polygonPool.free(a),this.polygonIndicesPool.free(o)),a=this.polygonPool.obtain(),a.length=0,a.push(m),a.push(g),a.push(v),a.push(x),a.push(y),a.push(_),o=this.polygonIndicesPool.obtain(),o.length=0,o.push(d),o.push(f),o.push(p),l=ji.winding(m,g,v,x,y,_),c=d)}a.length>0&&(n.push(a),r.push(o));for(let h=0,u=n.length;h=0;h--)a=n[h],a.length==0&&(n.splice(h,1),this.polygonPool.free(a),o=r[h],r.splice(h,1),this.polygonIndicesPool.free(o));return n}static isConcave(e,t,i,n){let r=n[(t+e-1)%t]<<1,o=n[e]<<1,a=n[(e+1)%t]<<1;return!this.positiveArea(i[r],i[r+1],i[o],i[o+1],i[a],i[a+1])}static positiveArea(e,t,i,n,r,o){return e*(o-n)+i*(t-o)+r*(n-t)>=0}static winding(e,t,i,n,r,o){let a=i-e,c=n-t;return r*c-o*a+a*t-e*c>=0?1:-1}}class dh{constructor(){w(this,"triangulator",new ji);w(this,"clippingPolygon",new Array);w(this,"clipOutput",new Array);w(this,"clippedVertices",new Array);w(this,"clippedUVs",new Array);w(this,"clippedTriangles",new Array);w(this,"scratch",new Array);w(this,"clipAttachment",null);w(this,"clippingPolygons",null)}clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let i=t.worldVerticesLength,n=Re.setArraySize(this.clippingPolygon,i);t.computeWorldVertices(e,0,i,n,0,2);let r=this.clippingPolygon;dh.makeClockwise(r);let o=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let a=0,c=o.length;a>1,S=this.clipOutput,b=Re.setArraySize(r,y+C*2);for(let I=0;I<_;I+=2,y+=2){let F=S[I],E=S[I+1];b[y]=F,b[y+1]=E}y=o.length;let M=Re.setArraySize(o,y+3*(C-2));C--;for(let I=1;I>1,X=this.clipOutput,V=Re.setArraySize(l,D+B*f);for(let W=0;W<$;W+=2,D+=f){let ne=X[W],re=X[W+1];V[D]=ne,V[D+1]=re,V[D+2]=r.r,V[D+3]=r.g,V[D+4]=r.b,V[D+5]=r.a;let le=ne-I,ue=re-F,ae=(N*le+U*ue)*L,xe=(P*le+A*ue)*L,Y=1-ae-xe;V[D+6]=y*ae+b*xe+E*Y,V[D+7]=_*ae+M*xe+k*Y,a&&(V[D+8]=o.r,V[D+9]=o.g,V[D+10]=o.b,V[D+11]=o.a)}D=h.length;let q=Re.setArraySize(h,D+3*(B-2));B--;for(let W=1;W>1,P=this.clipOutput,L=Re.setArraySize(o,E+A*2),B=Re.setArraySize(a,E+A*2);for(let V=0;V=2?(u=c,c=this.scratch):u=this.scratch,u.length=0,u.push(e),u.push(t),u.push(i),u.push(n),u.push(r),u.push(o),u.push(e),u.push(t),c.length=0;let d=a.length-4,f=a;for(let p=0;;p+=2){let m=f[p],g=f[p+1],v=m-f[p+2],x=g-f[p+3],y=c.length,_=u;for(let S=0,b=u.length-2;Sv*(g-E),O=x*(m-M)-v*(g-I);if(O>0){if(k){c.push(F),c.push(E);continue}let D=F-M,$=E-I,N=O/(D*x-$*v);if(N>=0&&N<=1)c.push(M+D*N),c.push(I+$*N);else{c.push(F),c.push(E);continue}}else if(k){let D=F-M,$=E-I,N=O/(D*x-$*v);if(N>=0&&N<=1)c.push(M+D*N),c.push(I+$*N),c.push(F),c.push(E);else{c.push(F),c.push(E);continue}}h=!0}if(y==c.length)return l.length=0,!0;if(c.push(c[0]),c.push(c[1]),p==d)break;let C=c;c=u,c.length=0,u=C}if(l!=c){l.length=0;for(let p=0,m=c.length-2;p>1;l0){let h=i.findPhysicsConstraint(a);if(!h)throw new Error("Physics constraint not found: "+a);l=i.physicsConstraints.indexOf(h)}for(let h in c){let u=c[h],d=u[0];if(!d)continue;let f=u.length;if(h=="reset"){const m=new Db(f,l);for(let g=0;d!=null;d=u[g+1],g++)m.setFrame(g,J(d,"time",0));r.push(m);continue}let p;if(h=="inertia")p=new Rb(f,f,l);else if(h=="strength")p=new Pb(f,f,l);else if(h=="damping")p=new kb(f,f,l);else if(h=="mass")p=new Fb(f,f,l);else if(h=="wind")p=new Ob(f,f,l);else if(h=="gravity")p=new Bb(f,f,l);else if(h=="mix")p=new Lb(f,f,l);else continue;r.push(bs(u,p,0,1))}}if(e.attachments)for(let a in e.attachments){let c=e.attachments[a],l=i.findSkin(a);if(!l)throw new Error("Skin not found: "+a);for(let h in c){let u=c[h],d=i.findSlot(h);if(!d)throw new Error("Slot not found: "+h);let f=d.index;for(let p in u){let m=u[p],g=l.getAttachment(f,p);for(let v in m){let x=m[v],y=x[0];if(y){if(v=="deform"){let _=g.bones,C=g.vertices,S=_?C.length/3*2:C.length,b=new Tb(x.length,x.length,f,g),M=J(y,"time",0);for(let I=0,F=0;;I++){let E,k=J(y,"vertices",null);if(!k)E=_?Re.newFloatArray(S):C;else{E=Re.newFloatArray(S);let N=J(y,"offset",0);if(Re.arrayCopy(k,0,E,N,k.length),n!=1)for(let U=N,A=U+k.length;U=0;v--)d[v]==-1&&(d[v]=p[--g])}a.setFrame(l,J(u,"time",0),d)}r.push(a)}if(e.events){let a=new hp(e.events.length),c=0;for(let l=0;l"u"&&(Math.fround=(function(s){return function(e){return s[0]=e,s[0]}})(new Float32Array(1)));if(typeof window<"u"&&window.PIXI){let s=window.require;window.require=e=>{if(s)return s(e);if(e.startsWith("@pixi/"))return window.PIXI}}const yn=class yn extends wR{constructor(t){super(t.resource.source);w(this,"texture");this.texture=ze.from(t)}static from(t){return yn.textureMap.has(t)?yn.textureMap.get(t):new yn(t)}setFilters(t,i){this.texture.baseTexture.scaleMode=yn.toPixiTextureFilter(t),this.texture.baseTexture.mipmap=yn.toPixiMipMap(t)}setWraps(t,i){this.texture.baseTexture.wrapMode=yn.toPixiTextureWrap(t)}dispose(){this.texture.destroy()}static toPixiTextureFilter(t){switch(t){case ui.Nearest:case ui.MipMapNearestLinear:case ui.MipMapNearestNearest:return Cs.NEAREST;case ui.Linear:case ui.MipMapLinearLinear:case ui.MipMapLinearNearest:return Cs.LINEAR;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiMipMap(t){switch(t){case ui.Nearest:case ui.Linear:return gs.OFF;case ui.MipMapNearestLinear:case ui.MipMapNearestNearest:case ui.MipMapLinearLinear:case ui.MipMapLinearNearest:return gs.ON;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case Fn.ClampToEdge:return Is.CLAMP;case Fn.MirroredRepeat:return Is.MIRRORED_REPEAT;case Fn.Repeat:return Is.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case cr.Normal:return je.NORMAL;case cr.Additive:return je.ADD;case cr.Multiply:return je.MULTIPLY;case cr.Screen:return je.SCREEN;default:throw new Error(`Unknown blendMode: ${String(t)}`)}}};w(yn,"textureMap",new Map);let so=yn;const xn=class xn extends ll{constructor(){const t=new rp;t.getBuffer("aVertexPosition").static=!1,t.getBuffer("aTextureCoord").static=!1;const i=new nh(ze.EMPTY);super(t,i);w(this,"name","");w(this,"warnedTwoTint",!1)}updateFromSpineData(t,i,n,r,o,a,c,l){var v,x;this.texture=t.texture;const h=o/(l?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((v=u.data)==null?void 0:v.length)!==h&&(u.data=new Float32Array(h));const d=this.geometry.getBuffer("aVertexPosition");((x=d.data)==null?void 0:x.length)!==h&&(d.data=new Float32Array(h));let f=0,p=u.data,m=d.data;for(let y=0;y0?`text-shadow: ${r} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${r} ${e}`}reset(){Object.assign(this,Io.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=ke.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};em.availableFonts={},em.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let Hd=em;const tc=class Ro extends yr{constructor(e="",t={}){super(ze.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,n=ze.from(i,{scaleMode:ke.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new nt,n.trim=new nt,this.texture=n;const r="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(r,"svg"),c=document.createElementNS(r,"foreignObject"),l=document.createElementNS(o,"div"),h=document.createElementNS(o,"style");c.setAttribute("width","10000"),c.setAttribute("height","10000"),c.style.overflow="hidden",a.appendChild(c),this.maxWidth=Ro.defaultMaxWidth,this.maxHeight=Ro.defaultMaxHeight,this._domElement=l,this._styleElement=h,this._svgRoot=a,this._foreignObject=c,this._foreignObject.appendChild(h),this._foreignObject.appendChild(l),this._image=i,this._loadImage=new Image,this._autoResolution=Ro.defaultAutoResolution,this._resolution=Ro.defaultResolution??ke.RESOLUTION,this.text=e,this.style=t}measureText(e){var h,u;const{text:t,style:i,resolution:n}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:i.toCSS(n)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const r=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:o,height:a}=r;(o>this.maxWidth||a>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const c=Math.min(this.maxWidth,Math.ceil(o)),l=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",c.toString()),this._svgRoot.setAttribute("height",l.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(h=this._style)==null?void 0:h.toCSS(n)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:c+i.padding*2,height:l+i.padding*2}}async updateText(e=!0){const{style:t,_image:i,_loadImage:n}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;const{width:r,height:o}=this.measureText();i.width=n.width=Math.ceil(Math.max(1,r)),i.height=n.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(c=>{n.onload=async()=>{if(a/gi,"
").replace(/
/gi,"
").replace(/ /gi," ")}};tc.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},tc.defaultMaxWidth=2024,tc.defaultMaxHeight=2024,tc.defaultAutoResolution=!0;function oh(s,e){const t=Math.max(0,Number(s)||0),i=Math.max(0,Number(e)||0);return{inner:Math.min(t,i),outer:Math.max(t,i)}}function Kb(s){const e=Math.max(0,Number(s.outerRectW)||0),t=Math.max(0,Number(s.outerRectH)||0);return{innerW:Math.min(e,Math.max(0,Number(s.innerRectW)||0)),innerH:Math.min(t,Math.max(0,Number(s.innerRectH)||0)),outerW:e,outerH:t}}function bI(s,e,t,i,n){if(s==="random")return n();const r=Math.max(1,Math.round(t)),o=Math.max(0,Math.round(e))%r;return i?o/r:r<=1?.5:o/(r-1)}function fv(s,e,t,i){const n=Math.sqrt(s*s+i()*(e*e-s*s));return{x:Math.cos(t)*n,y:-Math.sin(t)*n,radialAngle:-t*180/Math.PI}}function wI(s,e){const{innerW:t,innerH:i,outerW:n,outerH:r}=Kb(s),o=Math.max(0,(n-t)/2),a=Math.max(0,(r-i)/2),c=o*r,l=t*a,h=c*2+l*2;if(h<=0){const p=n*2+r*2;if(p<=0)return{x:0,y:0,radialAngle:0};let m=e()*p,g,v;return m{const F=M/o,E=I/a,k=Math.max(1e-4,Math.hypot(F,E)),O=F/k,D=E/k,$=n*O-r*D,N=r*O+n*D;return{x:s.x+n*S*o-r*b*a+$*.05,y:s.y+r*S*o+n*b*a+N*.05,nx:$,ny:N}};if(s.shape==="circle"){const S=Math.max(.001,s.radius),b=Math.hypot(h,u);if(b>=S)return null;const M=b>1e-4?h/b:1,I=b>1e-4?u/b:0;return d(M*S,I*S,M,I)}if(s.shape==="ellipse"){const S=Math.max(.001,s.radiusX),b=Math.max(.001,s.radiusY),M=Math.hypot(h/S,u/b);if(M>=1)return null;const I=M>1e-4?1/M:1,F=M>1e-4?h*I:S,E=M>1e-4?u*I:0,k=Math.max(1e-4,Math.hypot(F/(S*S),E/(b*b)));return d(F,E,F/(S*S)/k,E/(b*b)/k)}if(s.shape==="rect"){const S=Math.max(.001,s.width*.5),b=Math.max(.001,s.height*.5);if(Math.abs(h)>=S||Math.abs(u)>=b)return null;const M=S-Math.abs(h),I=b-Math.abs(u);if(M=0?1:-1;return d(E*S,u,E,0)}const F=u>=0?1:-1;return d(h,F*b,0,F)}const f=Math.max(3,Math.min(16,Math.round(s.sides||(s.shape==="custom"?5:6)))),p=Math.max(.001,s.width*.5),m=Math.max(.001,s.height*.5),g=Array.from({length:f},(S,b)=>{const M=Math.PI*.5+b/f*Math.PI*2;return{x:Math.cos(M)*p,y:Math.sin(M)*m}});let v=!1;for(let S=0,b=g.length-1;Su!=I.y>u&&h<(I.x-M.x)*(u-M.y)/(I.y-M.y)+M.x&&(v=!v)}if(!v)return null;let x=g[0].x,y=g[0].y,_=1/0;for(let S=0;S>>0^Math.imul(e+1,2654435761)^t)>>>0;return i^=i>>>16,i=Math.imul(i,2146121005),i^=i>>>15,i=Math.imul(i,2221713035),i^=i>>>16,(i>>>0)/4294967296}function bo(s,e,t,i,n){return s==="fixed"?e:s==="curve"?yi(e,t,Zs(i,n)):yi(e,t,n)}function jd(s,e,t,i,n,r){return s==="curve"?yi(e,t,Zs(i,n)):s==="random"?r:e}function pv(s,e,t,i,n){const r=1-n;return r*r*r*s+3*r*r*n*e+3*r*n*n*t+n*n*n*i}function Zs(s,e,t="线性"){if(!Array.isArray(s)||s.length===0)return 1;const i=[...s].sort((n,r)=>n.x-r.x);if(e<=i[0].x)return i[0].y;if(e>=i[i.length-1].x)return i[i.length-1].y;for(let n=0;n=i[n].x&&e<=i[n+1].x){const r=i[n],o=i[n+1],a=o.x-r.x||1;if(t!=="贝塞尔")return yi(r.y,o.y,(e-r.x)/a);const c=r.x+(r.outX??a/3),l=r.y+(r.outY??(o.y-r.y)/3),h=o.x+(o.inX??-a/3),u=o.y+(o.inY??-(o.y-r.y)/3);let d=0,f=1;for(let p=0;p<14;p++){const m=(d+f)/2;pv(r.x,c,h,o.x,m)>>0;return function(){e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}function jo(s){let e=s.replace("#","");return e.length===3&&(e=e.split("").map(t=>t+t).join("")),parseInt(e,16)}function II(s,e,t){const i=gv(s),n=gv(e),r=Math.round(i[0]+(n[0]-i[0])*t),o=Math.round(i[1]+(n[1]-i[1])*t),a=Math.round(i[2]+(n[2]-i[2])*t);return r<<16|o<<8|a}function tm(s,e){if(!Array.isArray(s)||s.length===0)return 16777215;const t=[...s].sort((i,n)=>i.position-n.position);if(e<=t[0].position)return jo(t[0].color);if(e>=t[t.length-1].position)return jo(t[t.length-1].color);for(let i=0;ir.position)continue;const o=(e-n.position)/Math.max(1e-4,r.position-n.position);return II(n.color,r.color,o)}return jo(t[t.length-1].color)}function gv(s){let e=s.replace("#","");e.length===3&&(e=e.split("").map(i=>i+i).join(""));const t=parseInt(e,16);return[t>>16&255,t>>8&255,t&255]}function RI(){return{sprite:null,boneName:"",mesh:null,meshSignature:"",history:[],bones:[],skinWeights:[],currentWidth:0,currentAlpha:0,currentColor:16777215,resourceId:1,enabled:!1,sampledLength:100,sampledWidth:100}}function Cc(s){s.history.length=0,s.bones.length=0,s.mesh&&(s.mesh.visible=!1)}class PI{constructor(e){w(this,"container");this.container=e}ensureMesh(e,t,i){const n=t.trailResources.find(g=>g.id===e.resourceId)||t.trailResources[0],r=(n==null?void 0:n.texture)||ze.EMPTY,o=Number(n==null?void 0:n.rotation)||0,a=Math.max(2,Math.min(16,Math.round(t.trailGridRows))),c=Math.max(2,Math.min(32,Math.round(t.trailGridCols))),l=Math.max(2,Math.min(16,Math.round((n==null?void 0:n.boneCount)??3))),h=`${a}:${c}:${l}:${(n==null?void 0:n.id)??0}:${o}`;if(e.mesh&&e.meshSignature===h)return e.mesh.texture!==r&&(e.mesh.texture=r),e.mesh;e.mesh&&(this.container.removeChild(e.mesh),e.mesh.destroy()),e.meshSignature&&e.meshSignature!==h&&(e.history.length=0,e.bones.length=0);const u=new Float32Array(a*c*2),d=new Float32Array(a*c*2),f=[],p=[];for(let g=0;g.05?e.history.unshift({x:t,y:i}):(r.x=t,r.y=i);const o=Math.max(1,n)*1.5;let a=0,c=e.history.length;for(let l=1;l=o||l>=239){c=l+1;break}e.history.length>c&&(e.history.length=c)}sampleBones(e,t,i){const n=Math.max(2,Math.min(16,Math.round(i))),r=e.history,o=[];if(!r.length)return o;let a=0;for(let l=1;l=h&&g>1e-4){const v=(h-u)/g;d={x:yi(p.x,m.x,v),y:yi(p.y,m.y,v)};break}u+=g}o.push({boneName:`${e.boneName}_trail_${l}`,x:d.x,y:d.y,rotation:0})}for(let l=0;l1){const l=o[0].rotation,u=(o[o.length-1].rotation-l+540)%360-180;for(let d=0;dh.id===i.resourceId)||t.trailResources[0];if(!(r!=null&&r.texture)||i.bones.length<2){n.visible=!1;return}e.resourceId=r.id,n.texture!==r.texture&&(n.texture=r.texture);const o=Math.max(2,Math.min(16,Math.round(t.trailGridRows))),a=Math.max(2,Math.min(32,Math.round(t.trailGridCols))),c=n.vertices,l=[];for(let h=0;h.5&&i.alpha>0}update(e,t,i,n,r,o,a){if(e.sprite=a,e.boneName=i,!t.trail||!e.enabled||e.sampledLength<=0||e.sampledWidth<=0){Cc(e);return}this.ensureMesh(e,t,a);const c=t.trailResources.find(f=>f.id===e.resourceId)||t.trailResources[0];this.appendPoint(e,n,r,e.sampledLength);const l=c!=null&&c.lifeLengthEnabled?Math.max(0,Zs(c.lifeLengthCurve,o)):1,h=Math.max(0,e.sampledLength)*l;e.bones=this.sampleBones(e,h,(c==null?void 0:c.boneCount)??3),e.bones[0]&&(e.bones[0].x=n,e.bones[0].y=r);const u=(c==null?void 0:c.widthMode)==="particle"?(Math.abs(a.scale.x)+Math.abs(a.scale.y))*.5:1;e.currentWidth=Math.max(0,e.sampledWidth)*u,e.currentAlpha=(c==null?void 0:c.alphaMode)==="particle"?a.alpha:(c==null?void 0:c.alphaMode)==="curve"?Zs(c.alphaCurve,o):(c==null?void 0:c.alpha)??1,e.currentColor=(c==null?void 0:c.colorMode)==="particle"?a.tint:(c==null?void 0:c.colorMode)==="curve"?tm(c.colorGradient,o):jo((c==null?void 0:c.color)||"#ffffff");const d={bones:e.bones.map(f=>({...f})),activeBoneCount:e.bones.length,width:e.currentWidth,alpha:Math.min(1,Math.max(0,e.currentAlpha)),colorHex:e.currentColor,resourceId:e.resourceId};return this.skinMesh(e,t,d),d}applyState(e,t,i,n){var r;e.sprite=i,e.resourceId=n.resourceId??((r=t.trailResources[0])==null?void 0:r.id)??1,e.bones=n.bones.map(o=>({...o})),e.currentWidth=n.width,e.currentAlpha=n.alpha,this.skinMesh(e,t,n)}drawDebug(e,t,i,n){if(e.clear(),!t||!i.trail)return;const r=Math.max(2,Math.min(16,Math.round(i.trailGridRows))),o=Math.max(2,Math.min(32,Math.round(i.trailGridCols)));e.lineStyle(1,3790847,.72);for(const a of n){const c=a.mesh;if(!(c!=null&&c.visible))continue;const l=c.vertices,h=(u,d)=>{const f=(u*r+d)*2;return{x:l[f],y:l[f+1]}};for(let u=0;ur.texture||r.sequenceFrames.some(o=>o.texture));if(!t.length)return kI(s.texture);const i=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(i<=0)return t[Math.floor(e()*t.length)];let n=e()*i;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}function BI(s,e){const t=s.trailResources.filter(r=>r.texture);if(!t.length)return s.trailResources[0]||FI();const i=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(i<=0)return t[Math.min(t.length-1,Math.floor(e*t.length))];let n=e*i;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}function vv(s,e){if(s.imageMode!=="sequence"||s.sequenceFrames.length<=1)return{index:0,visible:!0};const t=Math.min(120,Math.max(1,Number(s.sequenceFps)||30)),i=Math.max(0,Math.floor(Math.max(0,e)*t)),n=s.sequenceFrames.length-1;return s.sequencePlayback==="once-hide"?{index:Math.min(n,i),visible:i<=n}:s.sequencePlayback==="once-hold"?{index:Math.min(n,i),visible:!0}:s.sequencePlayback==="loop-reverse"?{index:n-i%s.sequenceFrames.length,visible:!0}:{index:i%s.sequenceFrames.length,visible:!0}}function zd(s,e,t){var i;return s.imageMode==="sequence"&&s.sequenceFrames.length?((i=s.sequenceFrames[Math.max(0,Math.min(s.sequenceFrames.length-1,t))])==null?void 0:i.texture)||s.texture||e:s.texture||e}function cl(){return{texture:null,imageResources:[{id:1,texture:null,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],blend:"normal",independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}]}],imageWeightVersion:1,name:"ParticleSystem1",mode:"stream",rate:20,streamBehavior:"normal",loopDurationFrames:30,generateLoopStartAnimation:!1,loopStartUseCustomDuration:!1,loopStartDurationFrames:30,generateLoopEndAnimation:!1,loopEndUseCustomDuration:!1,loopEndDurationFrames:30,burstCount:50,burstLoop:!1,delay:0,duration:1,shape:"point",shapeRangeVersion:1,innerRadius:0,outerRadius:30,innerRectW:0,innerRectH:0,outerRectW:60,outerRectH:40,spawnPathId:0,spawnPathDistribution:"fixed",radius:30,rectW:60,rectH:40,centerX:0,centerY:0,rootRotation:0,rootScaleX:1,rootScaleY:1,emissionAngleMode:"random",direction:0,spread:360,coneDirection:90,coneAngle:60,lifeMin:.6,lifeMax:1.8,lifeMode:"random",lifeCurve:[{x:0,y:0},{x:1,y:1}],speedMin:30,speedMax:140,speedMode:"random",speedCurve:[{x:0,y:0},{x:1,y:1}],scaleMin:.3,scaleMax:.8,scaleMode:"random",scaleAxisMode:"uniform",scaleYMin:.3,scaleYMax:.8,scaleCurve:[{x:0,y:0},{x:1,y:1}],scaleYCurve:[{x:0,y:0},{x:1,y:1}],scaleEndRatio:.3,initialRotationMode:"random",initialRotationMin:0,initialRotationMax:360,initialRotationCurve:[{x:0,y:0},{x:1,y:1}],alpha:.9,alphaEnd:0,rotationSpeedMin:-180,rotationSpeedMax:180,speedOverLifeEnabled:!1,speedOverLifeMode:"fixed",speedOverLifeMin:1,speedOverLifeMax:1,speedOverLifeCurve:[{x:0,y:1},{x:1,y:1}],scaleOverLifeEnabled:!1,scaleOverLifeMode:"curve",scaleOverLifeAxisMode:"uniform",scaleOverLifeMin:0,scaleOverLifeMax:1,scaleYOverLifeMin:0,scaleYOverLifeMax:1,scaleOverLifeCurve:[{x:0,y:1},{x:1,y:1}],scaleYOverLifeCurve:[{x:0,y:1},{x:1,y:1}],rotationOverLifeEnabled:!1,rotationOverLifeMode:"random",rotationOverLifeCurve:[{x:0,y:0},{x:1,y:1}],gravity:980,gravityMode:"fixed",gravityMin:980,gravityMax:980,gravityDirection:-90,gravityCurve:[{x:0,y:1},{x:1,y:1}],damping:0,seed:0,colorStart:"#ffffff",colorEnd:"#ff4d4d",colorOverLife:!1,blend:"add",alphaMode:"curve",curveMode:"线性",alphaCurve:[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],textureName:"star",textureFolder:"",alphaScale:1,anchorX:.5,anchorY:.5,independentAlpha:"off",offsetX:0,offsetY:0,noise:!1,noiseAmt:30,noiseRange:100,noiseSpeed:1,useGravity:!1,wind:!1,windX:0,windY:0,windMode:"fixed",windMin:100,windMax:100,windDirection:0,windCurve:[{x:0,y:1},{x:1,y:1}],forceField:!1,forceStrength:10,forceRadius:100,forceCenterX:0,forceCenterY:0,forceFalloff:"linear",attraction:!1,attractionCenterX:200,attractionCenterY:0,attractionRadius:20,attractionDuration:.5,attractionDelay:.1,attractionDelayMode:"particle",attractionPath:"curve",trail:!1,trailConfigVersion:3,trailResources:[{id:1,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:[{x:0,y:1},{x:1,y:1}],boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:[{x:0,y:1},{x:1,y:1}],shapeEnabled:!1,shapeCurve:[{x:0,y:1},{x:1,y:1}]}],trailResourceVersion:6,trailTexture:null,trailTextureName:"trail",trailPreviewUrl:"/images/trail.png",trailColorMode:"particle",trailColor:"#ffffff",trailColorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],trailAlphaMode:"particle",trailAlpha:1,trailAlphaCurve:[{x:0,y:1},{x:1,y:1}],trailBoneCount:3,trailLength:100,trailWidth:100,trailWidthMode:"particle",trailLifeLengthEnabled:!1,trailLifeLengthCurve:[{x:0,y:1},{x:1,y:1}],trailShapeEnabled:!1,trailShapeCurve:[{x:0,y:1},{x:1,y:1}],trailGridRows:4,trailGridCols:4,collision:!1,collisionColliderIds:[],pathFollow:!1,emitterFollow:!1,emitterFollowMode:"none",emitterFollowPathId:0,emitterFollowSpineId:0,emitterFollowBoneName:"",emitterFollowBoneOffsetX:0,emitterFollowBoneOffsetY:0,emitterFollowBoneRotation:0,emitterFollowBoneScaleX:1,emitterFollowBoneScaleY:1,emitterAngleMode:"fixed",emitterFollowCurve:[{x:0,y:0},{x:1,y:1}],emitterFollowDuration:2,emitterFollowSpace:"world",emitterFollowDirection:"forward",emitterFollowOffset:0}}function pr(s){var F;const e=cl(),t=s,i=t.shapeRangeVersion!==1,n=Number(t.radius),r=Number(t.rectW),o=Number(t.rectH),a=Number(t.direction),c=Number(t.spread),l=t.shape,h=t.imageWeightVersion!==1,u=t.loopDurationFrames==null,d=t.gravityMode==null,f=Number(t.gravity),p=t.windMode==null,m=Number(t.windX),g=Number(t.windY),v=t.forceFalloff==null,x=Number(t.forceStrength),y=t.trailConfigVersion!==3,_=!Array.isArray(t.trailResources),C=t.trailResourceVersion!==6,S=t.trailTexture,b=String(t.trailTextureName||"trail"),M=String(t.trailPreviewUrl||"/images/trail.png").replace("/trails/trail.png","/images/trail.png");for(const[E,k]of Object.entries(e))t[E]!==void 0&&t[E]!==null||(t[E]=Array.isArray(k)?k.map(O=>typeof O=="object"&&O!==null?{...O}:O):k);i&&(s.innerRadius=0,s.outerRadius=Math.max(0,Number.isFinite(n)?n:e.outerRadius),s.innerRectW=0,s.innerRectH=0,s.outerRectW=Math.max(0,Number.isFinite(r)?r:e.outerRectW),s.outerRectH=Math.max(0,Number.isFinite(o)?o:e.outerRectH),s.coneDirection=Number.isFinite(a)?a:90,s.emissionAngleMode=Number.isFinite(c)&&c>0?"random":"fixed",l==="cone"&&(s.spread=Math.max(0,Number(s.coneAngle)||0)),s.shapeRangeVersion=1),s.shape==="orbit"&&(s.shape="path"),["fixed","random","radial","path-normal","path-tangent"].includes(s.emissionAngleMode)||(s.emissionAngleMode="fixed"),!["circle","rect","cone"].includes(s.shape)&&s.emissionAngleMode==="radial"&&(s.emissionAngleMode="fixed"),s.shape!=="path"&&(s.emissionAngleMode==="path-normal"||s.emissionAngleMode==="path-tangent")&&(s.emissionAngleMode="fixed"),s.spawnPathId=Math.max(0,Math.round(Number(s.spawnPathId)||0)),s.spawnPathDistribution!=="fixed"&&s.spawnPathDistribution!=="random"&&(s.spawnPathDistribution="fixed"),s.innerRadius=Math.max(0,Number(s.innerRadius)||0),s.outerRadius=Math.max(s.innerRadius,Number(s.outerRadius)||0),s.innerRectW=Math.max(0,Number(s.innerRectW)||0),s.innerRectH=Math.max(0,Number(s.innerRectH)||0),s.outerRectW=Math.max(s.innerRectW,Number(s.outerRectW)||0),s.outerRectH=Math.max(s.innerRectH,Number(s.outerRectH)||0);const I=Array.from(new Set((Array.isArray(s.collisionColliderIds)?s.collisionColliderIds:[]).map(E=>Math.round(Number(E))).filter(E=>Number.isFinite(E)&&E>0)));(I.length!==s.collisionColliderIds.length||I.some((E,k)=>E!==s.collisionColliderIds[k]))&&(s.collisionColliderIds=I),s.streamBehavior!=="normal"&&s.streamBehavior!=="loop"&&(s.streamBehavior="normal"),(u||!Number.isFinite(s.loopDurationFrames))&&(s.loopDurationFrames=Math.ceil(Math.max(1/30,Number(s.duration)||1)*30)),s.loopDurationFrames=Math.min(1800,Math.max(1,Math.ceil(s.loopDurationFrames))),typeof s.generateLoopStartAnimation!="boolean"&&(s.generateLoopStartAnimation=!1),typeof s.generateLoopEndAnimation!="boolean"&&(s.generateLoopEndAnimation=!1),typeof s.loopStartUseCustomDuration!="boolean"&&(s.loopStartUseCustomDuration=!1),typeof s.loopEndUseCustomDuration!="boolean"&&(s.loopEndUseCustomDuration=!1),s.loopStartDurationFrames=Math.min(1800,Math.max(1,Math.ceil(Number(s.loopStartDurationFrames)||30))),s.loopEndDurationFrames=Math.min(1800,Math.max(1,Math.ceil(Number(s.loopEndDurationFrames)||30))),(!Array.isArray(s.imageResources)||s.imageResources.length===0)&&(s.imageResources=cl().imageResources);for(const E of s.imageResources){!E.texture&&s.texture&&(E.texture=s.texture),E.textureName||(E.textureName="star"),E.previewUrl==="/particles/star.png"&&(E.previewUrl="/images/star.png"),E.previewUrl||(E.previewUrl=E.textureName==="star"?"/images/star.png":""),E.imageMode!=="fixed"&&E.imageMode!=="sequence"&&(E.imageMode="fixed"),E.sequencePlayback==="once"?E.sequencePlayback="once-hold":E.sequencePlayback==="loop"?E.sequencePlayback="loop-forward":["once-hide","once-hold","loop-forward","loop-reverse"].includes(E.sequencePlayback)||(E.sequencePlayback="loop-forward"),Number.isFinite(E.sequenceFps)||(E.sequenceFps=30),E.sequenceFps=Math.min(120,Math.max(1,Number(E.sequenceFps)||30)),Array.isArray(E.sequenceFrames)||(E.sequenceFrames=[]);for(const k of E.sequenceFrames)typeof k.name!="string"&&(k.name=""),typeof k.previewUrl!="string"&&(k.previewUrl=""),k.texture===void 0&&(k.texture=null);Number.isFinite(E.weight)||(E.weight=100),typeof E.locked!="boolean"&&(E.locked=!1),Number.isFinite(E.scale)||(E.scale=1),Number.isFinite(E.anchorX)||(E.anchorX=.5),Number.isFinite(E.anchorY)||(E.anchorY=.5),E.colorMode!=="fixed"&&E.colorMode!=="random"&&E.colorMode!=="lifetime"&&(E.colorMode=s.colorOverLife?"lifetime":"fixed"),E.colorStart||(E.colorStart=s.colorStart||"#ffffff"),E.colorEnd||(E.colorEnd=s.colorEnd||E.colorStart),(!Array.isArray(E.colorGradient)||E.colorGradient.length<2)&&(E.colorGradient=[{position:0,color:E.colorStart},{position:1,color:E.colorEnd}]),Object.prototype.hasOwnProperty.call(ar,E.blend)||(E.blend=s.blend||"normal"),["off","fixed","curve"].includes(E.independentAlpha)||(E.independentAlpha=s.independentAlpha||"off"),Number.isFinite(E.alpha)||(E.alpha=Number.isFinite(s.alphaScale)?s.alphaScale:1),["跟随导出","线性","贝塞尔"].includes(E.alphaCurveMode)||(E.alphaCurveMode=s.curveMode||"跟随导出"),(!Array.isArray(E.alphaCurve)||E.alphaCurve.length<2)&&(E.alphaCurve=(s.alphaCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k})))}if(s.imageResources.length===1)s.imageResources[0].weight=100,s.imageResources[0].locked=!1;else if(h){const E=100/s.imageResources.length;s.imageResources.forEach((k,O)=>{k.weight=O===s.imageResources.length-1?100-E*(s.imageResources.length-1):E,k.locked=!1})}if(s.imageWeightVersion=1,d){const E=Number.isFinite(f)&&f!==0?f:980;s.gravity=E,s.gravityMin=E,s.gravityMax=E}if(p){const E=Number.isFinite(m)&&Number.isFinite(g)&&(m!==0||g!==0);s.windMin=E?Math.hypot(m,g):100,s.windMax=s.windMin,s.windDirection=E?Math.atan2(-g,m)*180/Math.PI:0}v&&(s.forceStrength=Number.isFinite(x)&&x!==0?x:10),y&&(s.trailConfigVersion=3,s.trailAlphaCurve=[{x:0,y:1},{x:1,y:1}],s.trailLifeLengthCurve=[{x:0,y:1},{x:1,y:1}],s.trailShapeCurve=[{x:0,y:1},{x:1,y:1}],s.trailGridRows=4,s.trailGridCols=4),(_||!s.trailResources.length)&&(s.trailResources=[{id:1,texture:S||null,textureName:b,previewUrl:M,weight:100,locked:!1,rotation:0,colorMode:s.trailColorMode,color:s.trailColor,colorGradient:s.trailColorGradient.map(E=>({...E})),blend:"normal",alphaMode:s.trailAlphaMode,alpha:s.trailAlpha,alphaCurve:s.trailAlphaCurve.map(E=>({...E})),boneCount:s.trailBoneCount,trailRatio:100,lengthMode:"fixed",length:s.trailLength,lengthMin:s.trailLength,lengthMax:s.trailLength,widthSizeMode:"fixed",width:s.trailWidth,widthMin:s.trailWidth,widthMax:s.trailWidth,widthMode:s.trailWidthMode,lifeLengthEnabled:s.trailLifeLengthEnabled,lifeLengthCurve:s.trailLifeLengthCurve.map(E=>({...E})),shapeEnabled:s.trailShapeEnabled,shapeCurve:s.trailShapeCurve.map(E=>({...E}))}]);for(const E of s.trailResources)E.textureName||(E.textureName="trail"),E.previewUrl==="/trails/trail.png"&&(E.previewUrl="/images/trail.png"),E.previewUrl||(E.previewUrl="/images/trail.png"),Number.isFinite(E.weight)||(E.weight=100),typeof E.locked!="boolean"&&(E.locked=!1),Number.isFinite(E.rotation)||(E.rotation=0),["particle","fixed","curve"].includes(E.colorMode)||(E.colorMode=s.trailColorMode||"particle"),E.color||(E.color=s.trailColor||"#ffffff"),(!Array.isArray(E.colorGradient)||E.colorGradient.length<2)&&(E.colorGradient=(s.trailColorGradient||[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}]).map(k=>({...k}))),Object.prototype.hasOwnProperty.call(ar,E.blend)||(E.blend="normal"),["particle","fixed","curve"].includes(E.alphaMode)||(E.alphaMode=s.trailAlphaMode||"particle"),Number.isFinite(E.alpha)||(E.alpha=Number.isFinite(s.trailAlpha)?s.trailAlpha:1),(!Array.isArray(E.alphaCurve)||E.alphaCurve.length<2)&&(E.alphaCurve=(s.trailAlphaCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k}))),Number.isFinite(E.boneCount)||(E.boneCount=Number.isFinite(s.trailBoneCount)?s.trailBoneCount:3),Number.isFinite(E.trailRatio)||(E.trailRatio=100),E.trailRatio=Math.min(100,Math.max(0,E.trailRatio)),["fixed","random"].includes(E.lengthMode)||(E.lengthMode="fixed"),Number.isFinite(E.length)||(E.length=Number.isFinite(s.trailLength)?s.trailLength:100),Number.isFinite(E.lengthMin)||(E.lengthMin=E.length),Number.isFinite(E.lengthMax)||(E.lengthMax=E.length),["fixed","random"].includes(E.widthSizeMode)||(E.widthSizeMode="fixed"),Number.isFinite(E.width)||(E.width=Number.isFinite(s.trailWidth)?s.trailWidth:100),Number.isFinite(E.widthMin)||(E.widthMin=E.width),Number.isFinite(E.widthMax)||(E.widthMax=E.width),["particle","fixed"].includes(E.widthMode)||(E.widthMode=s.trailWidthMode||"particle"),typeof E.lifeLengthEnabled!="boolean"&&(E.lifeLengthEnabled=!!s.trailLifeLengthEnabled),(!Array.isArray(E.lifeLengthCurve)||E.lifeLengthCurve.length<2)&&(E.lifeLengthCurve=(s.trailLifeLengthCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k}))),typeof E.shapeEnabled!="boolean"&&(E.shapeEnabled=!!s.trailShapeEnabled),(!Array.isArray(E.shapeCurve)||E.shapeCurve.length<2)&&(E.shapeCurve=(s.trailShapeCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k})));if(s.trailResources.length===1&&(s.trailResources[0].weight=100,s.trailResources[0].locked=!1),C)for(const E of s.trailResources)E.alphaCurve=((F=E.alphaCurve)==null?void 0:F.length)>=2?E.alphaCurve:[{x:0,y:1},{x:1,y:1}];return s.trailResourceVersion=6,s}class LI extends Si{constructor(t,i=TI){super();w(this,"pool",[]);w(this,"cfg");w(this,"accumulator",0);w(this,"burstTimer",0);w(this,"_spawnSerial",0);w(this,"_elapsed",0);w(this,"_attractionEnabledAt",0);w(this,"_attractionWasEnabled",!1);w(this,"states",[]);w(this,"rng",Math.random);w(this,"_lastSeed",-1);w(this,"trailDebugGfx",new zi);w(this,"trail");w(this,"colliders",[]);w(this,"followSpawnX",0);w(this,"followSpawnY",0);w(this,"followSpawnAngle",0);w(this,"spawnPathSampler",null);w(this,"spawnPathClosed",!1);w(this,"followExportCurveMode","线性");w(this,"simulationTransform",null);this.cfg=pr(t),this.trail=new PI(this),this._ensurePool(i),this.addChild(this.trailDebugGfx)}setFollowExportCurveMode(t){this.followExportCurveMode=t}resolveCurveMode(t){return t==="跟随导出"?this.followExportCurveMode:t}reseed(){const t=this.cfg.seed;t!==this._lastSeed&&(this._lastSeed=t,this.rng=Wd(t>>>0))}_ensurePool(t){for(;this.pool.length=n.delay),o=i==="force"||i==="normal"&&(n.mode==="burst"||this._elapsed=1;)this.accumulator-=1,this.spawnOne();else this.burstTimer+=t,n.burstLoop?this.burstTimer>=1&&(this.burstTimer=0,this.emitBurst()):t>0&&this.burstTimer<=t&&this.emitBurst();const a=[];for(let p=0;p0){const A=Math.max(1e-4,Math.abs(n.rootScaleX)),P=Math.max(1e-4,Math.abs(n.rootScaleY)),L=-(((c=this.simulationTransform)==null?void 0:c.rotation)??n.rootRotation)*Math.PI/180,B=Math.cos(L),X=Math.sin(L),V=((l=this.simulationTransform)==null?void 0:l.centerX)??n.centerX,q=((h=this.simulationTransform)==null?void 0:h.centerY)??n.centerY,W=V+B*A*m.x-X*P*m.y,ne=-q+X*A*m.x+B*P*m.y,re=W,le=-ne,ue=n.forceCenterX-re,ae=n.forceCenterY-le,xe=Math.hypot(ue,ae);if(xe>1e-4&&xe<=n.forceRadius){let Y=1;n.forceFalloff==="linear"?Y=1-xe/n.forceRadius:n.forceFalloff==="inverse"&&(Y=Math.min(10,n.forceRadius/Math.max(xe,n.forceRadius*.1)));const j=n.forceStrength*Y*10,H=ue/xe*j,G=ae/xe*j,z=H,ie=-G;m.vx+=(B*z+X*ie)/A*t,m.vy+=(-X*z+B*ie)/P*t}}if(!m.collisionPaused&&n.damping>0){const A=Math.max(0,1-n.damping*t);m.vx*=A,m.vy*=A}if(m.collisionPaused)m.vx=0,m.vy=0;else if(m.x+=m.vx*t,m.y+=m.vy*t,this.applyColliders(m,p))continue;if(n.attraction&&!m.collisionPaused){const A=m.maxLife-m.life;if(n.attractionDelayMode==="particle"?A>=Math.max(0,n.attractionDelay):this._elapsed-this._attractionEnabledAt>=Math.max(0,n.attractionDelay)){const L=xo(n,m.x,m.y,this.simulationTransform),B=n.attractionCenterX,X=n.attractionCenterY,V=Math.max(0,n.attractionRadius);if(!m.attractionActive){if(Math.hypot(B-L.x,X-L.y)<=V){this.kill(p);continue}m.attractionActive=!0,m.attractionElapsed=0,m.attractionStartWorldX=L.x,m.attractionStartWorldY=L.y}m.attractionElapsed+=t;const q=Math.max(1e-4,n.attractionDuration),W=Math.min(1,m.attractionElapsed/q);let ne=yi(m.attractionStartWorldX,B,W),re=yi(m.attractionStartWorldY,X,W);if(n.attractionPath==="curve"){const ae=B-m.attractionStartWorldX,xe=X-m.attractionStartWorldY,Y=Math.hypot(ae,xe);if(Y>1e-4){const j=Y*.25*m.attractionCurveSide,H=(m.attractionStartWorldX+B)*.5-xe/Y*j,G=(m.attractionStartWorldY+X)*.5+ae/Y*j,z=1-W;ne=z*z*m.attractionStartWorldX+2*z*W*H+W*W*B,re=z*z*m.attractionStartWorldY+2*z*W*G+W*W*X}}const le=Math.hypot(B-ne,X-re);if(W>=1||le<=V){this.kill(p);continue}const ue=mv(n,ne,re,this.simulationTransform);m.x=ue.x,m.y=ue.y,m.vx=0,m.vy=0}}const v=g,x=m.sprite,y=n.imageResources.find(A=>A.id===m.resourceId);if(y){const A=vv(y,m.maxLife-m.life);m.imageFrameIndex=A.index,x.texture=zd(y,n.texture,m.imageFrameIndex),x.visible=A.visible}if(n.speedOverLifeEnabled){const A=ic(jd(n.speedOverLifeMode,n.speedOverLifeMin,n.speedOverLifeMax,n.speedOverLifeCurve,v,m.speedScaleTarget),1),P=m.speedScale===0?A:A/m.speedScale;m.vx*=P,m.vy*=P,m.speedScale=A}let _=m.rotationSpeed;n.rotationOverLifeEnabled&&n.rotationOverLifeMode==="curve"&&(_=yi(n.rotationSpeedMin,n.rotationSpeedMax,Zs(n.rotationOverLifeCurve,v))),m.rotation+=_*t;let C=m.x,S=m.y;if(n.noise&&n.noiseAmt>0&&n.noiseRange>0&&n.noiseSpeed>0){const A=m.maxLife-m.life,P=Math.max(0,n.noiseRange)*Math.min(1,Math.max(0,n.noiseAmt)/100)*.5,L=A*Math.max(0,n.noiseSpeed)*Math.PI*2;C+=(Math.sin(m.noisePhaseX+L)-Math.sin(m.noisePhaseX))*P,S+=(Math.sin(m.noisePhaseY+L*.83)-Math.sin(m.noisePhaseY))*P}x.x=C,x.y=S,x.rotation=-m.rotation*Math.PI/180;let b=1,M=1;n.scaleOverLifeEnabled&&(b=jd(n.scaleOverLifeMode,n.scaleOverLifeMin,n.scaleOverLifeMax,n.scaleOverLifeCurve,v,m.scaleOverLifeX),M=n.scaleOverLifeAxisMode==="separate"?jd(n.scaleOverLifeMode,n.scaleYOverLifeMin,n.scaleYOverLifeMax,n.scaleYOverLifeCurve,v,m.scaleOverLifeY):b),x.scale.set(ic(m.scaleStartX*b,1),ic(m.scaleStartY*M,1));const I=n.alphaMode==="curve"?Zs(n.alphaCurve,v,this.resolveCurveMode(n.curveMode))*n.alphaScale:n.alpha*n.alphaScale;x.alpha=ic((y==null?void 0:y.independentAlpha)==="fixed"?y.alpha:(y==null?void 0:y.independentAlpha)==="curve"?Zs(y.alphaCurve,v,this.resolveCurveMode(y.alphaCurveMode)):I,1);const F=(y==null?void 0:y.colorStart)||"#ffffff",E=(y==null?void 0:y.colorMode)==="lifetime"?tm(y.colorGradient,v):(y==null?void 0:y.colorMode)==="random"?m.colorSample:jo(F);x.tint=E,x.blendMode=ar[(y==null?void 0:y.blend)||"normal"];const k=this.trail.update(m.trail,n,m.boneName,C,S,v,x),O=xo(n,C,S,this.simulationTransform),D=((u=this.simulationTransform)==null?void 0:u.rotation)??n.rootRotation,$=Math.abs(((d=this.simulationTransform)==null?void 0:d.scaleX)??n.rootScaleX),N=Math.abs(((f=this.simulationTransform)==null?void 0:f.scaleY)??n.rootScaleY),U=k?{...k,bones:k.bones.map(A=>{const P=xo(n,A.x,A.y,this.simulationTransform);return{...A,worldX:P.x,worldY:P.y,worldRotation:D-A.rotation}})}:void 0;a.push({boneName:m.boneName,spawnId:m.spawnId,x:C,y:S,rotation:m.rotation,scaleX:x.scale.x,scaleY:x.scale.y,worldX:O.x,worldY:O.y,worldRotation:D+m.rotation,worldScaleX:x.scale.x*$,worldScaleY:x.scale.y*N,alpha:x.alpha,colorHex:E,resourceId:m.resourceId,imageFrameIndex:m.imageFrameIndex,imageVisible:x.visible,trailState:U,active:!0})}return this.states=a,a}drawTrailMeshDebug(t){this.trail.drawDebug(this.trailDebugGfx,t,this.cfg,this.pool.map(i=>i.trail))}emitBurst(){for(let t=0;t0&&this.spawnPathSampler){const a=this.estimatedEmissionCount(),c=bI(t.spawnPathDistribution,this._spawnSerial,a,this.spawnPathClosed,this.rng),l=this.spawnPathSampler(c);if(l)return{...this.applyFollowToOrigin(l.x+i,l.y+n),radialAngle:0,pathAngle:l.angle}}const r=SI(t,this.rng);return{...this.applyFollowToOrigin(i+r.x,n+r.y),radialAngle:r.radialAngle}}estimatedEmissionCount(){const t=this.cfg;return t.mode==="burst"?Math.max(1,Math.round(t.burstCount)):Math.max(1,Math.floor(t.rate*(t.streamBehavior==="loop"?Math.max(1,t.loopDurationFrames)/30:Math.max(0,t.duration))))}applyFollowToOrigin(t,i){const n=this.followSpawnAngle*Math.PI/180,r=Math.cos(n),o=Math.sin(n);return{x:this.followSpawnX+r*t-o*i,y:this.followSpawnY+o*t+r*i}}spawnOne(){const t=this.cfg;let i=this.pool.findIndex(_=>!_.active);if(i===-1)return;const n=this.spawnOrigin(),{x:r,y:o}=n,a=bo(t.lifeMode,t.lifeMin,t.lifeMax,t.lifeCurve,this.rng()),c=bo(t.speedMode,t.speedMin,t.speedMax,t.speedCurve,this.rng()),l=_I(t,n,this.followSpawnAngle,this.rng),h=this.pool[i],u=OI(t,this.rng),d=this._spawnSerial++;h.spawnId=d;const f=BI(t,Rr(t.seed,d,1540483477));h.noisePhaseX=Rr(t.seed,d,1757159915)*Math.PI*2,h.noisePhaseY=Rr(t.seed,d,48610963)*Math.PI*2,h.gravityStrength=t.useGravity&&t.gravityMode==="random"?yi(t.gravityMin,t.gravityMax,this.rng()):t.gravityMin,h.windStrength=t.wind&&t.windMode==="random"?yi(t.windMin,t.windMax,this.rng()):t.windMin,h.attractionActive=!1,h.attractionElapsed=0,h.collisionPaused=!1,h.attractionCurveSide=Rr(t.seed,d,2738958700)<.5?-1:1,h.trail.history.length=0,h.trail.bones.length=0,h.trail.currentWidth=0,h.trail.currentAlpha=0,h.trail.currentColor=16777215,h.trail.resourceId=f.id;const p=Math.min(100,Math.max(0,Number(f.trailRatio)||0)),m=t.mode==="burst"?Math.max(0,Math.round(t.burstCount)):Math.max(0,Math.floor(t.rate*(t.streamBehavior==="loop"?Math.max(1,t.loopDurationFrames)/30:Math.max(0,t.duration)))),g=p>0&&m===1&&d===0,v=Rr(t.seed,d,668265261)*100,x=(_,C,S,b,M)=>{if(_!=="random")return Math.max(0,Number(C)||0);const I=Math.max(0,Math.min(Number(S)||0,Number(b)||0)),F=Math.max(0,Math.max(Number(S)||0,Number(b)||0));return yi(I,F,Rr(t.seed,d,M))};h.trail.sampledLength=x(f.lengthMode,f.length,f.lengthMin,f.lengthMax,374761393),h.trail.sampledWidth=x(f.widthSizeMode,f.width,f.widthMin,f.widthMax,3550635116),h.trail.enabled=t.trail&&(g||v0&&h.trail.sampledWidth>0,h.trail.mesh&&(h.trail.mesh.visible=!1),h.active=!0,h.life=a,h.maxLife=a,h.x=r,h.y=o,h.trail.enabled&&h.trail.history.push({x:r,y:o}),h.vx=Math.cos(l)*c,h.vy=Math.sin(l)*c,h.scaleStartX=bo(t.scaleMode,t.scaleMin,t.scaleMax,t.scaleCurve,this.rng())*u.scale,h.scaleStartY=t.scaleAxisMode==="separate"?bo(t.scaleMode,t.scaleYMin,t.scaleYMax,t.scaleYCurve,this.rng())*u.scale:h.scaleStartX,h.alphaStart=t.alpha,h.alphaEnd=t.alphaEnd,h.rotation=t.initialRotationMode==="direction"?-Math.atan2(h.vy,h.vx)*180/Math.PI+t.initialRotationMin:bo(t.initialRotationMode,t.initialRotationMin,t.initialRotationMax,t.initialRotationCurve,this.rng()),h.rotationSpeed=t.rotationOverLifeEnabled?bo(t.rotationOverLifeMode,t.rotationSpeedMin,t.rotationSpeedMax,t.rotationOverLifeCurve,this.rng()):0,h.speedScale=1,h.speedScaleTarget=t.speedOverLifeMode==="random"?yi(t.speedOverLifeMin,t.speedOverLifeMax,this.rng()):t.speedOverLifeMin,h.scaleOverLifeX=t.scaleOverLifeMode==="random"?yi(t.scaleOverLifeMin,t.scaleOverLifeMax,this.rng()):t.scaleOverLifeMin,h.scaleOverLifeY=t.scaleOverLifeMode==="random"?yi(t.scaleYOverLifeMin,t.scaleYOverLifeMax,this.rng()):t.scaleYOverLifeMin,h.resourceId=u.id,h.colorSample=u.colorMode==="random"?tm(u.colorGradient,Rr(t.seed,d,2654435769)):jo(u.colorStart);const y=vv(u,0);h.imageFrameIndex=y.index,h.sprite.texture=zd(u,t.texture,y.index),h.sprite.anchor.set(u.anchorX,u.anchorY),h.sprite.blendMode=ar[u.blend],h.sprite.tint=h.colorSample,h.sprite.visible=!0}kill(t){const i=this.pool[t];i.active=!1,i.sprite.visible=!1,Cc(i.trail)}clear(){for(const t of this.pool)t.active=!1,t.sprite.visible=!1,Cc(t.trail)}get activeCount(){let t=0;for(const i of this.pool)i.active&&t++;return t}capture(){const t=[];for(const i of this.pool)i.active&&t.push({boneName:i.boneName,spawnId:i.spawnId,x:i.sprite.x,y:i.sprite.y,rotation:i.rotation,scaleX:i.sprite.scale.x,scaleY:i.sprite.scale.y,...this.captureWorldTransform(i),alpha:i.sprite.alpha,colorHex:i.sprite.tint,resourceId:i.resourceId,imageFrameIndex:i.imageFrameIndex,imageVisible:i.sprite.visible,active:!0,trailState:this.cfg.trail&&i.trail.bones.length?{bones:i.trail.bones.map(n=>{var o;const r=xo(this.cfg,n.x,n.y,this.simulationTransform);return{...n,worldX:r.x,worldY:r.y,worldRotation:(((o=this.simulationTransform)==null?void 0:o.rotation)??this.cfg.rootRotation)-n.rotation}}),activeBoneCount:i.trail.bones.length,width:i.trail.currentWidth,alpha:i.trail.currentAlpha,colorHex:i.trail.currentColor,resourceId:i.trail.resourceId}:void 0});return t}captureWorldTransform(t){var r,o,a;const i=xo(this.cfg,t.sprite.x,t.sprite.y,this.simulationTransform),n=((r=this.simulationTransform)==null?void 0:r.rotation)??this.cfg.rootRotation;return{worldX:i.x,worldY:i.y,worldRotation:n+t.rotation,worldScaleX:t.sprite.scale.x*Math.abs(((o=this.simulationTransform)==null?void 0:o.scaleX)??this.cfg.rootScaleX),worldScaleY:t.sprite.scale.y*Math.abs(((a=this.simulationTransform)==null?void 0:a.scaleY)??this.cfg.rootScaleY)}}apply(t){const i=new Map;for(const n of t)i.set(n.boneName,n);for(const n of this.pool){const r=i.get(n.boneName);if(!r){n.active=!1,n.sprite.visible=!1,n.trail.mesh&&(n.trail.mesh.visible=!1);continue}n.active=r.active;const o=n.sprite;if(o.visible=r.active&&r.imageVisible!==!1,o.x=r.x,o.y=r.y,o.rotation=-r.rotation*Math.PI/180,o.scale.set(r.scaleX,r.scaleY),o.alpha=r.alpha,o.tint=r.colorHex,r.resourceId!=null){const a=this.cfg.imageResources.find(c=>c.id===r.resourceId);a&&(n.imageFrameIndex=r.imageFrameIndex??0,o.texture=zd(a,this.cfg.texture,n.imageFrameIndex),o.anchor.set(a.anchorX,a.anchorY),o.blendMode=ar[a.blend])}this.cfg.trail&&r.trailState?this.trail.applyState(n.trail,this.cfg,n.sprite,r.trailState):n.trail.mesh&&(n.trail.mesh.visible=!1)}}reset(){for(const t of this.pool)t.active=!1,t.sprite.visible=!1,Cc(t.trail);this.accumulator=0,this.burstTimer=0,this._spawnSerial=0,this._elapsed=0,this._attractionEnabledAt=0,this._attractionWasEnabled=!1,this._lastSeed=this.cfg.seed,this.rng=Wd(this.cfg.seed>>>0)}restartEmissionCycle(){this.accumulator=0,this.burstTimer=0,this._spawnSerial=0,this._elapsed=0,this._attractionEnabledAt=0,this._attractionWasEnabled=this.cfg.attraction,this._lastSeed=this.cfg.seed,this.rng=Wd(this.cfg.seed>>>0)}}const io=new Map,Zr=new Map;function DI(s){return[...io.values()].some(e=>e===s)}function Zb(s){if(!(DI(s)||(Zr.get(s)||0)>0)){Zr.delete(s);for(const e of s.textures)e.destroy(!0)}}function NI(s){const e=Zr.get(s)||0;e>1?Zr.set(s,e-1):Zr.delete(s),Zb(s)}function UI(s){return io.get(s)||null}function nu(s,e){wl(s),io.set(s,e)}function $I(s){const e=io.get(s);return e?(Zr.set(e,(Zr.get(e)||0)+1),e):null}function XI(s,e){const t=io.get(s);return t?(nu(e,t),!0):!1}function wl(s){const e=io.get(s);e&&(io.delete(s),Zb(e))}function Nt(s){if(Array.isArray(s))return s.map(e=>Nt(e));if(s&&typeof s=="object"){const e=Object.getPrototypeOf(s);if(e===Object.prototype||e===null){const t={};for(const[i,n]of Object.entries(s))t[i]=Nt(n);return t}}return s}const Jb=["3.8","4.0","4.1","4.2","4.3"];function ah(s){const e=String(s||"").trim();return Jb.find(t=>e===t||e.startsWith(`${t}.`))||null}function im(){return Jb.join(" / ")}function VI(s){return s==="4.3"?"4.3":"4.2"}function ap(){return{imagesPath:"./images/",spineVersion:"4.2",keyframeCurve:"linear",fps:30,omitFps:!1,integerFrameAlignment:!0,bonePool:!0,excludeEmptyAnimations:!1,fileName:"SpineParticle.json"}}function Qb(s){const e=Object.assign(ap(),s||{});return e.imagesPath=String(e.imagesPath||"./images/"),e.spineVersion=ah(e.spineVersion)||"4.2",e.keyframeCurve=e.keyframeCurve==="bezier"?"bezier":"linear",e.fps=Math.min(240,Math.max(1,Math.round(Number(e.fps)||30))),e.omitFps=e.omitFps===!0,e.integerFrameAlignment=e.integerFrameAlignment!==!1,e.bonePool=e.bonePool!==!1,e.excludeEmptyAnimations=e.excludeEmptyAnimations===!0,e.fileName=String(e.fileName||"SpineParticle.json"),e}const sm=30;function Ac(s,e=1){return Math.min(1800,Math.max(1,Math.ceil(Number(s)||e)))}function e1(s,e=30){const t=Math.max(0,Number(s.lifeMin)||0),i=Math.max(0,Number(s.lifeMax)||0),n=s.lifeMode==="fixed"?t:Math.max(t,i);return Ac(Math.ceil(n*Math.max(1,e)),sm)}function lr(s,e=30){const t=Ac(s.loopDurationFrames),i=e1(s,e),n=s.generateLoopStartAnimation?s.loopStartUseCustomDuration?Ac(s.loopStartDurationFrames,sm):i:0,r=s.generateLoopEndAnimation?s.loopEndUseCustomDuration?Ac(s.loopEndDurationFrames,sm):i:0;return{start:n,loop:t,end:r,total:n+t+r}}function t1(s,e){const t=lr(s,e),n=Math.max(0,Math.ceil(Math.max(0,Number(s.delay)||0)*Math.max(1,e)))+t.start;return{start:n,end:n+t.loop}}function Ec(s,e,t){const i=Math.max(1,Math.floor(t)-1),n=Math.min(i-1,Math.max(0,Math.floor(Number(s)||0))),r=Math.min(i,Math.max(n+1,Math.floor(Number(e)||i)));return{start:n,end:r}}function YI(s,e,t){const i=Math.max(1,e-1),n=Math.max(1,t-1),r=s.end>=i?n:s.end;return Ec(s.start,r,t)}let sc=1,nc=1,rc=1,oc=1;function ac(s,e){const t=new Set(e),i=`${s} Copy`;if(!t.has(i))return i;let n=2;for(;t.has(`${i} ${n}`);)n++;return`${i} ${n}`}const ao=nM("particle",{state:()=>({editor:{viewScale:1,viewX:0,viewY:0},systems:[],colliders:[],paths:[],spines:[],activeId:0,activeObjectType:"particle",activeObjectId:0,timeline:{playing:!0,loop:!0,frame:0,totalFrames:60,playbackStart:0,playbackEnd:59,fps:30,recorded:!1,animation:"animation",animations:["animation"]},settings:{parameterPanelOnRight:!0,tickEnabled:!1,axisFontSize:12,tickWidth:1,showAxisLabels:!0,axisColor:"#7a86ad",undoLimit:20,backgroundX:0,backgroundY:0,backgroundOpacity:1,backgroundImageName:"",backgroundImageData:"",showEmitter:!0,showBones:!1,bonePointDrawSize:1,boneAxisDrawSize:2,showSkinMesh:!1,showGrid:!0,exportSettings:ap()}}),getters:{activeSystemCount:s=>s.systems.length},actions:{syncSceneSequences(){sc=Math.max(sc,...this.systems.map(s=>s.id+1),1),nc=Math.max(nc,...this.colliders.map(s=>s.id+1),1),rc=Math.max(rc,...this.paths.map(s=>s.id+1),1),oc=Math.max(oc,...this.spines.map(s=>s.id+1),1)},addSystem(s){const e=cl();s!=null&&s.config&&Object.assign(e,s.config);const t=new Set(this.systems.map(r=>r.config.name));if(t.has(e.name)){let r=0;for(const a of this.systems){const c=/^ParticleSystem(\d+)$/.exec(a.config.name);c&&(r=Math.max(r,parseInt(c[1],10)))}e.name=`ParticleSystem${r+1}`;let o=2;for(;t.has(e.name);)e.name=`ParticleSystem${r+o}`,o++}const i=this.timeline.animations.includes(this.timeline.animation)?this.timeline.animation:this.timeline.animations[0]||"animation",n={id:sc++,visible:!0,animation:i,config:e};return this.systems.push(n),this.activeId=n.id,this.activeObjectType="particle",this.activeObjectId=n.id,n},removeSystem(s){var i;const e=this.systems.findIndex(n=>n.id===s);e>=0&&this.systems.splice(e,1),this.activeId===s&&(this.activeId=((i=this.systems[0])==null?void 0:i.id)??0);const t=this.systems.find(n=>n.id===this.activeId);if(t&&(this.timeline.animation=t.animation),this.activeObjectType==="particle"&&this.activeObjectId===s){const n=this.systems[0];this.activeObjectId=(n==null?void 0:n.id)??0}},selectSystem(s){this.activeId=s,this.activeObjectType="particle",this.activeObjectId=s;const e=this.systems.find(t=>t.id===s);e&&(this.timeline.animation=e.animation)},setSystemAnimation(s,e){if(!this.timeline.animations.includes(e))return;const t=this.systems.find(i=>i.id===s);t&&(t.animation=e,this.timeline.animation=e)},addAnimation(){const s=new Set(this.timeline.animations);let e=2,t=`animation${e}`;for(;s.has(t);)t=`animation${++e}`;this.timeline.animations.push(t),this.timeline.animation=t;const i=this.systems.find(n=>n.id===this.activeId);return i&&(i.animation=t),t},renameAnimation(s,e){const t=e.trim(),i=this.timeline.animations.indexOf(s);if(i<0||!t||t!==s&&this.timeline.animations.includes(t))return!1;this.timeline.animations[i]=t;for(const n of this.systems)n.animation===s&&(n.animation=t);return this.timeline.animation===s&&(this.timeline.animation=t),!0},removeAnimation(s){if(this.timeline.animations.length<=1)return!1;const e=this.timeline.animations.indexOf(s);if(e<0)return!1;this.timeline.animations.splice(e,1);const t=this.timeline.animations[Math.min(e,this.timeline.animations.length-1)];for(const i of this.systems)i.animation===s&&(i.animation=t);return this.timeline.animation===s&&(this.timeline.animation=t),!0},addCollider(){const s=nc++,e={id:s,name:`Collider${s}`,visible:!0,shape:"circle",enabled:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,radius:50,radiusX:70,radiusY:45,width:120,height:80,sides:6,response:"physics",elasticity:.8,friction:.3,followPath:!1,followPathId:0,followDuration:2,followPathRotation:!1,followCurveMode:"跟随导出",followCurve:[{x:0,y:0},{x:1,y:1}]};return this.colliders.push(e),this.activeObjectType="collision",this.activeObjectId=e.id,e},addPath(){const s=rc++,e={id:s,name:`Path${s}`,visible:!0,enabled:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,closed:!1,color:"#ff933e",preset:"",points:[]};return this.paths.push(e),this.activeObjectType="path",this.activeObjectId=e.id,e},addSpine(){const s=oc++,e={id:s,name:`SpineSkeleton${s}`,enabled:!0,visible:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,timeOffset:0,skeletonFileName:"",atlasFileName:"",textureFileNames:[],dataVersion:"",sourceBundle:null,selectedAnimation:"",selectedBone:"",animations:[],bones:[],assetVersion:0,status:"empty",error:""};return this.spines.push(e),this.activeObjectType="spine",this.activeObjectId=e.id,e},duplicateSelectedObject(){const s=this.activeObjectId;if(!s)return null;if(this.activeObjectType==="particle"){const i=this.systems.find(r=>r.id===s);if(!i)return null;const n=Nt(i);return n.id=sc++,n.config.name=ac(i.config.name,this.systems.map(r=>r.config.name)),n.frames=void 0,this.systems.push(n),this.activeId=n.id,this.activeObjectId=n.id,this.timeline.animation=n.animation,n}if(this.activeObjectType==="collision"){const i=this.colliders.find(r=>r.id===s);if(!i)return null;const n=Nt(i);return n.id=nc++,n.name=ac(i.name,this.colliders.map(r=>r.name)),this.colliders.push(n),this.activeObjectId=n.id,n}if(this.activeObjectType==="path"){const i=this.paths.find(r=>r.id===s);if(!i)return null;const n=Nt(i);return n.id=rc++,n.name=ac(i.name,this.paths.map(r=>r.name)),this.paths.push(n),this.activeObjectId=n.id,n}const e=this.spines.find(i=>i.id===s);if(!e)return null;const t=Nt(e);return t.id=oc++,t.name=ac(e.name,this.spines.map(i=>i.name)),t.selectedBone="",XI(e.id,t.id),this.spines.push(t),this.activeObjectId=t.id,t},selectSceneObject(s,e){if(this.activeObjectType=s,this.activeObjectId=e,s==="particle"){this.activeId=e;const t=this.systems.find(i=>i.id===e);t&&(this.timeline.animation=t.animation)}},removeCollider(s){var t;const e=this.colliders.findIndex(i=>i.id===s);e>=0&&this.colliders.splice(e,1);for(const i of this.systems){const n=pr(i.config);n.collisionColliderIds=n.collisionColliderIds.filter(r=>r!==s)}if(this.activeObjectType==="collision"&&this.activeObjectId===s){const i=this.systems[0];this.activeObjectType=i?"particle":"collision",this.activeObjectId=(i==null?void 0:i.id)??((t=this.colliders[0])==null?void 0:t.id)??0}},removePath(s){var t;const e=this.paths.findIndex(i=>i.id===s);if(e>=0&&this.paths.splice(e,1),this.activeObjectType==="path"&&this.activeObjectId===s){const i=this.systems[0];this.activeObjectType=i?"particle":"path",this.activeObjectId=(i==null?void 0:i.id)??((t=this.paths[0])==null?void 0:t.id)??0}},removeSpine(s){wl(s);const e=this.spines.findIndex(t=>t.id===s);if(e>=0&&this.spines.splice(e,1),this.activeObjectType==="spine"&&this.activeObjectId===s){const t=this.systems[0],i=this.colliders[0],n=this.paths[0],r=this.spines[0];t?(this.activeObjectType="particle",this.activeObjectId=t.id,this.activeId=t.id):i?(this.activeObjectType="collision",this.activeObjectId=i.id):n?(this.activeObjectType="path",this.activeObjectId=n.id):(this.activeObjectType="spine",this.activeObjectId=(r==null?void 0:r.id)??0)}this.recalcTotalFrames()},play(){const s=Ec(this.timeline.playbackStart,this.timeline.playbackEnd,this.timeline.totalFrames);(this.timeline.frame=s.end)&&(this.timeline.frame=s.start),this.timeline.playing=!0},pause(){this.timeline.playing=!1},togglePlay(){this.timeline.playing?this.pause():this.play()},toStart(){this.timeline.frame=this.timeline.playbackStart},previousFrame(){this.timeline.playing=!1,this.timeline.frame=Math.max(this.timeline.playbackStart,this.timeline.frame-1)},nextFrame(){this.timeline.playing=!1,this.timeline.frame=Math.min(this.timeline.playbackEnd,this.timeline.frame+1)},toEnd(){this.timeline.playing=!1,this.timeline.frame=this.timeline.playbackEnd},toggleLoop(){this.timeline.loop=!this.timeline.loop},setFrame(s){this.timeline.frame=Math.max(0,Math.min(s,this.timeline.totalFrames-1))},setPlaybackStart(s){const e=Ec(s,this.timeline.playbackEnd,this.timeline.totalFrames);this.timeline.playbackStart=e.start,this.timeline.playbackEnd=e.end,this.timeline.framee.end&&(this.timeline.frame=e.end)},recalcTotalFrames(){const s=this.timeline.fps||30;let e=0;for(const r of this.systems){const o=r.config,a=Math.max(0,Number(o.lifeMin)||0),c=Math.max(0,Number(o.lifeMax)||0),l=o.lifeMode==="fixed"?a:Math.max(a,c),h=o.mode==="stream"?o.streamBehavior==="loop"?Math.max(1/s,Math.ceil(Math.max(1,Number(o.loopDurationFrames)||1))/s):Math.max(1/s,Number(o.duration)||0):0;let u=Math.max(0,Number(o.delay)||0)+h+l;o.mode==="stream"&&o.streamBehavior==="loop"&&(u=Math.max(0,Number(o.delay)||0)+lr(o,s).total/s),u>e&&(e=u)}for(const r of this.spines){const o=r.animations.find(c=>c.name===r.selectedAnimation);if(!o)continue;const a=Math.max(0,Number(r.timeOffset)||0)+Math.max(0,o.duration||0);a>e&&(e=a)}for(const r of this.colliders){if(!r.followPath||!r.followPathId)continue;const o=Math.max(0,Number(r.followDuration)||0);o>e&&(e=o)}const t=this.timeline.totalFrames,i=Math.max(2,Math.ceil(e*s)+1);this.timeline.totalFrames=i;const n=YI({start:this.timeline.playbackStart,end:this.timeline.playbackEnd},t,i);return this.timeline.playbackStart=n.start,this.timeline.playbackEnd=n.end,this.timeline.frame>=i&&(this.timeline.frame=i-1),i}}}),i1="SpineParticle.SystemSettings",s1=1,qd="SpineParticle.SystemSettings.v1";function _a(s,e,t,i){const n=Number(s);return Math.min(t,Math.max(e,Number.isFinite(n)?n:i))}function GI(s){return{parameterPanelOnRight:s.parameterPanelOnRight,undoLimit:s.undoLimit,showEmitter:s.showEmitter,showBones:s.showBones,bonePointDrawSize:s.bonePointDrawSize,boneAxisDrawSize:s.boneAxisDrawSize,showSkinMesh:s.showSkinMesh,tickEnabled:s.tickEnabled,axisFontSize:s.axisFontSize,tickWidth:s.tickWidth,showAxisLabels:s.showAxisLabels,axisColor:s.axisColor}}function HI(s,e){const t=n=>s[n]==null?!!e[n]:s[n]===!0,i=typeof s.axisColor=="string"&&/^#[0-9a-f]{6}$/i.test(s.axisColor)?s.axisColor:e.axisColor;return{parameterPanelOnRight:t("parameterPanelOnRight"),undoLimit:Math.round(_a(s.undoLimit,1,200,e.undoLimit)),showEmitter:t("showEmitter"),showBones:t("showBones"),bonePointDrawSize:_a(s.bonePointDrawSize,.1,10,e.bonePointDrawSize),boneAxisDrawSize:_a(s.boneAxisDrawSize,.1,10,e.boneAxisDrawSize),showSkinMesh:t("showSkinMesh"),tickEnabled:t("tickEnabled"),axisFontSize:Math.round(_a(s.axisFontSize,8,40,e.axisFontSize)),tickWidth:_a(s.tickWidth,1,5,e.tickWidth),showAxisLabels:t("showAxisLabels"),axisColor:i}}function jI(s){let e;try{e=JSON.parse(s)}catch{throw new Error("系统设置缓存不是有效的 JSON")}const t=e;if(t.format!==i1)throw new Error("不是 Spine粒子编辑器系统设置缓存");if(t.version!==s1)throw new Error(`暂不支持系统配置版本:${t.version??"未知"}`);if(!t.settings||typeof t.settings!="object")throw new Error("系统设置缓存缺少 settings");return t}function WI(s,e){Object.assign(s.settings,HI(e,s.settings))}let lc=null;function zI(s){lc==null||lc();try{const e=localStorage.getItem(qd);e&&WI(s,jI(e).settings)}catch{try{localStorage.removeItem(qd)}catch{}}lc=Xi(()=>GI(s.settings),e=>{const t={format:i1,version:s1,savedAt:new Date().toISOString(),settings:e};try{localStorage.setItem(qd,JSON.stringify(t))}catch{}},{deep:!0})}function qI(s,e=0){if(s<=0)return 1;const t=Math.pow(10,Math.floor(Math.log10(s))),i=[1,2,5,10,20,50,100];let n=1;for(const r of i)if(r*t>=s){n=r*t;break}return Math.max(n,e)}function KI(s,e,t,i,n){if(!t)return;const r=t;r.clear();const o=s.settings;if(!o.tickEnabled){for(const b of n)b.visible=!1;return}const a=0,c=0,l=e.screen.width/s.editor.viewScale,h=e.screen.height/s.editor.viewScale,u=+("0x"+o.axisColor.replace("#",""));r.lineStyle(1.5,u,.35),r.moveTo(-l,c),r.lineTo(l,c),r.moveTo(a,-h),r.lineTo(a,h);const d=s.editor.viewScale,f=qI(50/d),p=l,m=h,g=Math.max(1,o.tickWidth);if(o.tickEnabled){for(let b=0;b<=l;b+=f){const M=Math.round(b/f)*f;M!==0&&(r.lineStyle(g,u,.25),r.moveTo(M,c-4),r.lineTo(M,c+4),r.moveTo(-M,c-4),r.lineTo(-M,c+4))}for(let b=0;b<=h;b+=f)Math.round(b/f)*f!==0&&(r.lineStyle(g,u,.25),r.moveTo(a-4,b),r.lineTo(a+4,b),r.moveTo(a-4,-b),r.lineTo(a+4,-b))}const v=e.screen.width/2+s.editor.viewX,x=e.screen.height*.5+s.editor.viewY,y=o.axisFontSize,_=+("0x"+o.axisColor.replace("#",""));for(;n.length<64;){const b=new op("",{fontFamily:"monospace",fontSize:y,fill:_});b.anchor.set(.5,.5),i.addChild(b),n.push(b)}let C=0;const S=o.showAxisLabels&&o.tickEnabled;for(let b=0;b<=l;b+=f){const M=Math.round(b/f)*f;if(M===0||!S||M>p)continue;const I=n[C++];if(!I)break;I.style.fontSize=y,I.text=String(M),I.position.set(v+M*d,x+9),I.visible=!0;const F=n[C++];if(!F)break;F.style.fontSize=y,F.text=String(-M),F.position.set(v-M*d,x+9),F.visible=!0}for(let b=0;b<=h;b+=f){const M=Math.round(b/f)*f;if(M===0||!S||M>m)continue;const I=n[C++];if(!I)break;I.style.fontSize=y,I.text=String(M),I.position.set(v+8,x-b*d),I.visible=!0;const F=n[C++];if(!F)break;F.style.fontSize=y,F.text=String(-M),F.position.set(v+8,x+b*d),F.visible=!0}for(;Cx.id===s.activeId);if(!n||n.visible===!1)return;const r=n.config,o=e.get(n.id),a=(o==null?void 0:o.x)??r.centerX??0,c=-((o==null?void 0:o.y)??r.centerY??0),l=r.shape;if(l==="point"||l==="path")return;const h=r.rootScaleX??1,u=r.rootScaleY??1,d=-((o==null?void 0:o.rotation)??r.rootRotation??0)*Math.PI/180,f=Math.cos(d),p=Math.sin(d),m=r.offsetX??0,g=r.offsetY??0,v=(x,y)=>{const _=x+m,C=-y-g,S=_*h,b=C*u;return[a+S*f-b*p,c+(S*p+b*f)]};if(l==="circle"){const x=oh(r.innerRadius,r.outerRadius);i.lineStyle(2,3991658,.7);const y=48;for(const _ of[x.outer,x.inner])if(!(_<=0))for(let C=0;C<=y;C++){const S=C/y*Math.PI*2,[b,M]=v(Math.cos(S)*_,Math.sin(S)*_);C===0?i.moveTo(b,M):i.lineTo(b,M)}}else if(l==="rect"){const x=Kb(r);i.lineStyle(2,4885759,.7);for(const[y,_]of[[x.outerW,x.outerH],[x.innerW,x.innerH]]){if(y<=0||_<=0)continue;const C=y/2,S=_/2,b=v(-C,-S),M=v(C,-S),I=v(C,S),F=v(-C,S);i.moveTo(b[0],b[1]),i.lineTo(M[0],M[1]),i.lineTo(I[0],I[1]),i.lineTo(F[0],F[1]),i.lineTo(b[0],b[1])}}else if(l==="cone"){const x=oh(r.innerRadius,r.outerRadius),y=r.coneAngle/2*Math.PI/180,_=r.coneDirection*Math.PI/180,C=v(Math.cos(_-y)*x.inner,Math.sin(_-y)*x.inner),S=v(Math.cos(_+y)*x.inner,Math.sin(_+y)*x.inner),b=v(Math.cos(_-y)*x.outer,Math.sin(_-y)*x.outer),M=v(Math.cos(_+y)*x.outer,Math.sin(_+y)*x.outer);i.lineStyle(2,3991658,.7),i.moveTo(C[0],C[1]),i.lineTo(b[0],b[1]),i.moveTo(S[0],S[1]),i.lineTo(M[0],M[1]),i.lineStyle(1,3991658,.5);const I=24;for(const F of[x.outer,x.inner])if(!(F<=0))for(let E=0;E<=I;E++){const k=_-y+2*y*E/I,[O,D]=v(Math.cos(k)*F,Math.sin(k)*F);E===0?i.moveTo(O,D):i.lineTo(O,D)}}}function QI(s,e){if(!e)return;const t=e;t.clear();const i=s.systems.find(c=>c.id===s.activeId);if((i==null?void 0:i.visible)===!1)return;const n=i==null?void 0:i.config;if(!(n!=null&&n.forceField)||n.forceRadius<=0)return;const r=n.forceCenterX,o=-n.forceCenterY,a=n.forceStrength>=0?5818367:16739194;t.lineStyle(2,a,.85),t.beginFill(a,.08),t.drawCircle(r,o,n.forceRadius),t.endFill(),t.lineStyle(1,a,.7),t.moveTo(r-9,o),t.lineTo(r+9,o),t.moveTo(r,o-9),t.lineTo(r,o+9),t.beginFill(a,.95),t.drawCircle(r,o,4),t.endFill()}function eR(s,e){if(!e)return;const t=e;t.clear();const i=s.systems.find(l=>l.id===s.activeId);if((i==null?void 0:i.visible)===!1)return;const n=i==null?void 0:i.config;if(!(n!=null&&n.attraction))return;const r=n.attractionCenterX,o=-n.attractionCenterY,a=Math.max(0,n.attractionRadius),c=16731487;a>0&&(t.lineStyle(2,c,.95),t.beginFill(c,.09),t.drawCircle(r,o,a),t.endFill()),t.lineStyle(1,c,.85),t.moveTo(r-10,o),t.lineTo(r+10,o),t.moveTo(r,o-10),t.lineTo(r,o+10),t.beginFill(c,1),t.drawCircle(r,o,a>0?4:6),t.endFill()}function tR(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(s.scaleX??1)),a=Math.max(1e-4,Math.abs(s.scaleY??1));return{x:s.x+n*e*o-r*t*a,y:s.y+r*e*o+n*t*a}}function wo(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(s.scaleX??1)),a=Math.max(1e-4,Math.abs(s.scaleY??1)),c=e-s.x,l=t-s.y;return{x:(n*c+r*l)/o,y:(-r*c+n*l)/a}}function n1(s,e,t="linear"){if(!s.length)return e;const i=[...s].sort((n,r)=>n.x-r.x);if(e<=i[0].x)return i[0].y;for(let n=1;nl.id===a.emitterFollowSpineId);!c||c.visible===!1||n.set(`${a.emitterFollowSpineId}:${a.emitterFollowBoneName}`,{spineId:a.emitterFollowSpineId,boneName:a.emitterFollowBoneName})}for(const o of n.values()){const a=e==null?void 0:e.getBoneWorldTransform(o.spineId,o.boneName);if(!a)continue;const c=a.x,l=-a.y;i.lineStyle(2,12881151,.95),i.beginFill(12881151,.2),i.drawCircle(c,l,8),i.endFill(),i.beginFill(15919103,1),i.drawCircle(c,l,3.5),i.endFill()}}function sR(s,e,t){if(!t)return;const i=t;if(i.clear(),!s.value)return;const n=e();if(!n)return;const r=n.x,o=-n.y,a=n.scaleX,c=n.scaleY,l=-n.rotation*Math.PI/180,h=Math.cos(l),u=Math.sin(l),d=(m,g)=>{const v=m*a,x=-g*c;return[r+v*h-x*u,o+(v*u+x*h)]},f=(m,g,v,x)=>{const y=d(m,g),_=d(v,x);i.moveTo(y[0],y[1]),i.lineTo(_[0],_[1])},p=26;if(i.lineStyle(2,3526911,.9),i.beginFill(3526911,.25),i.drawCircle(r,o,6),i.endFill(),s.value==="translate")i.lineStyle(2,3526911,.9),f(-p,0,p,0),f(0,-p,0,p),f(p-6,-4,p,0),f(p,0,p-6,4),f(-20,-4,-p,0),f(-p,0,-20,4),f(-4,p-6,0,p),f(0,p,4,p-6),f(-4,-20,0,-p),f(0,-p,4,-20);else if(s.value==="rotate"){i.lineStyle(2,3526911,.8);const m=48;for(let x=0;x<=m;x++){const y=x/m*Math.PI*2,[_,C]=d(Math.cos(y)*p,Math.sin(y)*p);x===0?i.moveTo(_,C):i.lineTo(_,C)}const[g,v]=d(0,p);i.beginFill(3526911,.95),i.drawCircle(g,v,4),i.endFill()}else if(s.value==="scale"){i.lineStyle(2,3526911,.9);const g=[[-p,-p],[p,-p],[p,p],[-p,p]].map(([v,x])=>d(v,x));i.moveTo(g[0][0],g[0][1]),i.lineTo(g[1][0],g[1][1]),i.lineTo(g[2][0],g[2][1]),i.lineTo(g[3][0],g[3][1]),i.lineTo(g[0][0],g[0][1]),i.beginFill(3526911,.9);for(const v of g)i.drawRect(v[0]-3,v[1]-3,6,6);i.endFill()}}function nR(s,e=16777215){const t=Number.parseInt(s.replace("#",""),16);return Number.isFinite(t)?t:e}function rR(s,e,t){if(!t)return;const i=t;i.clear();for(const n of e){if(n.visible===!1)continue;const r=s.activeObjectType==="collision"&&s.activeObjectId===n.id,o=n.enabled?r?16735858:13911899:5792116,a=n.rotation*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=Math.max(1e-4,Math.abs(n.scaleX??1)),u=Math.max(1e-4,Math.abs(n.scaleY??1)),d=(m,g)=>({x:n.x+c*m*h-l*g*u,y:-(n.y+l*m*h+c*g*u)});let f=[];if(n.shape==="circle"||n.shape==="ellipse"){const m=n.shape==="circle"?n.radius:n.radiusX,g=n.shape==="circle"?n.radius:n.radiusY;f=Array.from({length:49},(v,x)=>{const y=x/48*Math.PI*2;return d(Math.cos(y)*m,Math.sin(y)*g)})}else if(n.shape==="rect"){const m=n.width*.5,g=n.height*.5;f=[d(-m,-g),d(m,-g),d(m,g),d(-m,g),d(-m,-g)]}else{const m=Math.max(3,Math.min(16,Math.round(n.sides)));f=Array.from({length:m+1},(g,v)=>{const x=Math.PI*.5+v%m/m*Math.PI*2;return d(Math.cos(x)*n.width*.5,Math.sin(x)*n.height*.5)})}if(!f.length)continue;i.lineStyle(r?2.5:1.5,o,n.enabled?.95:.45),i.beginFill(o,r?.12:.055),i.moveTo(f[0].x,f[0].y);for(let m=1;m{const f=tR(n,u,d);return{x:f.x,y:-f.y}},c=n.points[0],l=a(c.x,c.y);i.lineStyle(r?2.5:1.8,o,r?1:.75),i.moveTo(l.x,l.y);const h=n.closed?n.points.length:n.points.length-1;for(let u=0;u{const f=a(u.x,u.y),p=a(u.x+u.inX,u.y+u.inY),m=a(u.x+u.outX,u.y+u.outY),g=Math.hypot(u.inX,u.inY)>.01,v=Math.hypot(u.outX,u.outY)>.01;i.lineStyle(1,11121867,.65),g&&(i.moveTo(f.x,f.y),i.lineTo(p.x,p.y)),v&&(i.moveTo(f.x,f.y),i.lineTo(m.x,m.y)),g&&(i.beginFill(14015724,.95),i.drawCircle(p.x,p.y,3),i.endFill()),v&&(i.beginFill(14015724,.95),i.drawCircle(m.x,m.y,3),i.endFill()),i.beginFill(e.has(d)?16777215:o,1),i.lineStyle(1.5,e.has(d)?6126847:16777215,.95),i.drawCircle(f.x,f.y,e.has(d)?5:4),i.endFill()})}}function aR(s,e,t,i){var o;const n=Number.isFinite(e.worldX)&&Number.isFinite(e.worldY),r=Number.isFinite(e.worldRotation);s.push({boneName:e.boneName,x:n?e.worldX:e.x,y:n?-e.worldY:e.y,rotation:r?-e.worldRotation:-e.rotation,parentX:t,parentY:i}),(o=e.trailState)!=null&&o.bones.length&&e.trailState.bones.forEach(a=>{const c=Number.isFinite(a.worldX)&&Number.isFinite(a.worldY),l=Number.isFinite(a.worldRotation);s.push({boneName:a.boneName,x:c?a.worldX:a.x,y:c?-a.worldY:a.y,rotation:l?-a.worldRotation:a.rotation,parentX:t,parentY:i,trail:!0})})}function xv(s,e,t,i,n,r,o,a){const c=r*.62,l=e+i*r,h=t+n*r,u=Math.max(2.5,r*.32),d=Math.max(1.7,r*.22),f=l-i*u,p=h-n*u,m=-n,g=i;s.lineStyle(o,a,.95),s.moveTo(e-i*c,t-n*c),s.lineTo(f,p),s.lineStyle(0),s.beginFill(a,.95),s.drawPolygon([l,h,f+m*d,p+g*d,f-m*d,p-g*d]),s.endFill()}function lR(s,e,t){if(!t)return;const i=t;if(i.clear(),!e.settings.showBones)return;const n=0,r=0,o=Math.max(.25,Math.abs(e.editor.viewScale)||1),a=Math.min(10,Math.max(.1,Number(e.settings.bonePointDrawSize)||1)),c=Math.min(10,Math.max(.1,Number(e.settings.boneAxisDrawSize)||2)),l=2.5*a/o,h=4.5*c/o,u=Math.max(.65,c*.625)/o;for(const d of s){const f=d.trail?16731533:16747610;i.lineStyle(1,f,d.trail?.65:.35),i.moveTo(d.parentX??n,d.parentY??r),i.lineTo(d.x,d.y);const p=d.rotation*Math.PI/180,m=Math.cos(p),g=Math.sin(p);xv(i,d.x,d.y,m,g,h,u,15684432),xv(i,d.x,d.y,g,-m,h,u,5622123),i.beginFill(f,.9),i.drawCircle(d.x,d.y,l),i.endFill()}}function Ai(s){return s.map(e=>({...e,trailState:e.trailState?{...e.trailState,bones:e.trailState.bones.map(t=>({...t}))}:void 0}))}function cR(s){const e=new Map;for(const i of s)for(const n of i)e.has(n.boneName)||e.set(n.boneName,Ai([n])[0]);const t=[...e.keys()].sort((i,n)=>{const r=Number(i.replace(/^p_/,"")),o=Number(n.replace(/^p_/,""));return Number.isFinite(r)&&Number.isFinite(o)?r-o:i.localeCompare(n)});for(let i=0;i[r.boneName,r]));s[i]=t.map(r=>{const o=n.get(r);return o||{...Ai([e.get(r)])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}})}}function hR(s){s.length<2||(s[s.length-1]=Ai(s[0]))}function uR(s,e){const t=Math.max(0,s.length-1),i=[];for(let n=0;n<=e;n++){const r=Math.min(t,Math.round(n/e*t));i.push(Ai(s[r]||[]))}return i}function Kd(s){return`${s.boneName}:${s.spawnId??"legacy"}`}function bv(s){return{...Ai([s])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}}function dR(s,e,t,i){const n=Math.min(s.length,i+1),r=s.slice(Math.max(0,s.length-n)),o=new Map;for(const l of e){if(l.imageVisible===!1||l.alpha<=0)continue;const h=Kd(l),u=new Map;let d=!1;for(let f=r.length-1;f>=0;f--){const p=r[f].find(m=>Kd(m)===h);if(p)d=!0,u.set(f,p);else if(d)break}o.set(h,u)}const a=Math.max(0,r.length-1),c=[];for(let l=0;l<=t;l++){const h=Math.min(a,Math.round(l/t*a));c.push(e.map(u=>{var f;if(u.imageVisible===!1||u.alpha<=0)return Ai([u])[0];const d=(f=o.get(Kd(u)))==null?void 0:f.get(h);return d?Ai([d])[0]:bv(u)}))}return c[0]=c[0].map(bv),c[c.length-1]=Ai(e),c}function wv(s,e){const t=s.length?1:0;for(let i=t;i{const y=x?[[]]:[];e.reset();for(let _=0;_0&&e.restartEmissionCycle();for(let C=0;C0;_++)e.update(r,"off"),x.push(e.capture());(v=x[x.length-1])!=null&&v.length&&x.push([]),wv(u,uR(x,a.end))}const g=Ai(u[u.length-1]||[]);for(u.length>i&&(u.length=i);u.lengtha.id===r)||(this.container.removeChild(o.root),o.root.destroy({children:!0}),this.entries.delete(r));for(const r of e){const o=UI(r.id);let a=this.entries.get(r.id);if(a&&a.assetVersion!==r.assetVersion&&!o&&(this.container.removeChild(a.root),a.root.destroy({children:!0}),this.entries.delete(r.id),a=void 0),(!a||a.assetVersion!==r.assetVersion)&&o){a&&(this.container.removeChild(a.root),a.root.destroy({children:!0}));const d=new Si,f=new o.SpineClass({skeletonData:o.skeletonData,autoUpdate:!1,darkTint:!1});o.skeletonData.defaultSkin&&f.skeleton.setSkin(o.skeletonData.defaultSkin),o.runtimeVersion==="4.3"?f.skeleton.setupPoseSlots():f.skeleton.setSlotsToSetupPose(),d.addChild(f),this.container.addChild(d),a={root:d,spine:f,runtimeVersion:o.runtimeVersion,assetVersion:r.assetVersion,animation:""},this.entries.set(r.id,a)}if(!a)continue;const c=a.root,l=a.spine,h=r.visible!==!1&&r.enabled;c.visible=h,c.renderable=h,c.position.set(r.x,-r.y),c.rotation=-r.rotation*Math.PI/180,c.scale.set(r.scaleX,r.scaleY),a.animation!==r.selectedAnimation&&(a.animation=r.selectedAnimation,a.runtimeVersion==="4.3"?l.skeleton.setupPose():l.skeleton.setToSetupPose(),l.state.clearTracks(),a.animation&&l.state.setAnimation(0,a.animation,!1));const u=a.runtimeVersion==="4.3"?l.state.getTrack(0):l.state.getCurrent(0);if(u){const d=((n=r.animations.find(p=>p.name===r.selectedAnimation))==null?void 0:n.duration)||0,f=Math.max(0,t/Math.max(1,i)-r.timeOffset);u.trackTime=d>0?Math.min(f,d):f}l.update(0)}}getBoneWorldTransform(e,t){const i=this.entries.get(e),n=i==null?void 0:i.spine.skeleton.findBone(t);if(!i||!n||!n.active)return null;const r=i.runtimeVersion==="4.3"?n.appliedPose:n,o=i.root,a=Math.cos(o.rotation),c=Math.sin(o.rotation),l=a*o.scale.x,h=-c*o.scale.y,u=c*o.scale.x,d=a*o.scale.y,f=l*r.a+h*r.c,p=l*r.b+h*r.d,m=u*r.a+d*r.c,g=u*r.b+d*r.d,v=o.position.x+l*r.worldX+h*r.worldY,x=o.position.y+u*r.worldX+d*r.worldY;return{x:v,y:-x,rotation:-Math.atan2(m,f)*180/Math.PI,scaleX:Math.max(1e-4,Math.hypot(f,m)),scaleY:Math.max(1e-4,Math.hypot(p,g))}}destroy(){for(const e of this.entries.values())e.root.removeFromParent(),e.root.destroy({children:!0});this.entries.clear(),this.container.removeFromParent(),this.container.destroy({children:!0})}}let r1=class{constructor(){w(this,"entries",{});w(this,"size",0)}add(e){let t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){let t=this.size;for(var i=0,n=e.length;i1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}toRgb888(){const e=t=>("0"+(t*255).toString(16)).slice(-2);return+("0x"+e(this.r)+e(this.g)+e(this.b))}static fromString(e,t=new Ci){return t.setFromString(e)}},w(Ci,"WHITE",new Ci(1,1,1,1)),w(Ci,"RED",new Ci(1,0,0,1)),w(Ci,"GREEN",new Ci(0,1,0,1)),w(Ci,"BLUE",new Ci(0,0,1,1)),w(Ci,"MAGENTA",new Ci(1,0,1,1)),Ci);var Kt;let Ie=(Kt=class{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*Kt.degRad)}static sinDeg(e){return Math.sin(e*Kt.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*Kt.degRad}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){let t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return Kt.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,i){let n=Math.random(),r=t-e;return n<=(i-e)/r?e+Math.sqrt(n*r*(i-e)):t-Math.sqrt((1-n)*r*(t-i))}static isPowerOfTwo(e){return e&&(e&e-1)===0}},w(Kt,"PI",3.1415927),w(Kt,"PI2",Kt.PI*2),w(Kt,"invPI2",1/Kt.PI2),w(Kt,"radiansToDegrees",180/Kt.PI),w(Kt,"radDeg",Kt.radiansToDegrees),w(Kt,"degreesToRadians",Kt.PI/180),w(Kt,"degRad",Kt.degreesToRadians),Kt);var Ms;let Re=(Ms=class{static arrayCopy(e,t,i,n,r){for(let o=t,a=n;o=t?e:Ms.setArraySize(e,t,i)}static newArray(e,t){let i=new Array(e);for(let n=0;n0?this.items.pop():this.instantiator()}free(e){e.reset&&e.reset(),this.items.push(e)}freeAll(e){for(let t=0;t>1)*a;let c=t.bone.skeleton,l=t.deform,h=this.vertices,u=this.bones;if(!u){l.length>0&&(h=l);let m=t.bone,g=m.worldX,v=m.worldY,x=m.a,y=m.b,_=m.c,C=m.d;for(let S=i,b=o;b=this.regions.length&&(i=this.regions.length-1);let n=this.regions[i];t.region!=n&&(t.region=n,t.updateRegion())}getPath(e,t){let i=e,n=(this.start+t).toString();for(let r=this.digits-n.length;r>0;r--)i+="0";return i+=n,i}static nextID(){return In._nextID++}},w(In,"_nextID",0),In);var xi;(function(s){s[s.hold=0]="hold",s[s.once=1]="once",s[s.loop=2]="loop",s[s.pingpong=3]="pingpong",s[s.onceReverse=4]="onceReverse",s[s.loopReverse=5]="loopReverse",s[s.pingpongReverse=6]="pingpongReverse"})(xi||(xi={}));const l1=[xi.hold,xi.once,xi.loop,xi.pingpong,xi.onceReverse,xi.loopReverse,xi.pingpongReverse];let lp=class{constructor(e,t,i){w(this,"name");w(this,"timelines",[]);w(this,"timelineIds",new r1);w(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=i}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds.clear();for(var t=0;t0&&(t%=this.duration));let l=this.timelines;for(let h=0,u=l.length;ht)return n-1;return i-1}static search(e,t,i){let n=e.length;for(let r=i;rt)return r-i;return n-i}},cn=class extends Ut{constructor(t,i,n){super(t,n);w(this,"curves");this.curves=Re.newFloatArray(t+i*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let i=this.getFrameCount()+t*18;if(this.curves.length>i){let n=Re.newFloatArray(i);Re.arrayCopy(this.curves,0,n,0,i),this.curves=n}}setBezier(t,i,n,r,o,a,c,l,h,u,d){let f=this.curves,p=this.getFrameCount()+t*18;n==0&&(f[i]=2+p);let m=(r-a*2+l)*.03,g=(o-c*2+h)*.03,v=((a-l)*3-r+u)*.006,x=((c-h)*3-o+d)*.006,y=m*2+v,_=g*2+x,C=(a-r)*.3+m+v*.16666667,S=(c-o)*.3+g+x*.16666667,b=r+C,M=o+S;for(let I=p+18;pt){let h=this.frames[i],u=this.frames[i+n];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}let a=r+18;for(r+=2;r=t){let h=o[r-2],u=o[r-1];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}i+=this.getFrameEntries();let c=o[a-2],l=o[a-1];return l+(t-c)/(this.frames[i]-c)*(this.frames[i+n]-l)}},Os=class extends cn{constructor(e,t,i){super(e,t,[i])}getFrameEntries(){return 2}setFrame(e,t,i){e<<=1,this.frames[e]=t,this.frames[e+1]=i}getCurveValue(e){let t=this.frames,i=t.length-2;for(let r=2;r<=i;r+=2)if(t[r]>e){i=r-2;break}let n=this.curves[i>>1];switch(n){case 0:let r=t[i],o=t[i+1];return o+(e-r)/(t[i+2]-r)*(t[i+2+1]-o);case 1:return t[i+1]}return this.getBezierValue(e,i,1,n-2)}getRelativeValue(e,t,i,n,r){if(e>2];switch(g){case 0:let v=h[m];d=h[m+1],f=h[m+2],p=h[m+3];let x=(n-v)/(h[m+4]-v);d+=(h[m+4+1]-d)*x,f+=(h[m+4+2]-f)*x,p+=(h[m+4+3]-p)*x;break;case 1:d=h[m+1],f=h[m+2],p=h[m+3];break;default:d=this.getBezierValue(n,m,1,g-2),f=this.getBezierValue(n,m,2,g+18-2),p=this.getBezierValue(n,m,3,g+36-2)}if(o==1)u.r=d,u.g=f,u.b=p;else{if(a==ge.setup){let v=l.data.color;u.r=v.r,u.g=v.g,u.b=v.b}u.r+=(d-u.r)*o,u.g+=(f-u.g)*o,u.b+=(p-u.b)*o}}},w1=class extends Os{constructor(t,i,n){super(t,i,rt.alpha+"|"+n);w(this,"slotIndex",0);this.slotIndex=n}apply(t,i,n,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.color;if(n>3];switch(C){case 0:let S=h[_];f=h[_+1],p=h[_+2],m=h[_+3],g=h[_+4],v=h[_+5],x=h[_+6],y=h[_+7];let b=(n-S)/(h[_+8]-S);f+=(h[_+8+1]-f)*b,p+=(h[_+8+2]-p)*b,m+=(h[_+8+3]-m)*b,g+=(h[_+8+4]-g)*b,v+=(h[_+8+5]-v)*b,x+=(h[_+8+6]-x)*b,y+=(h[_+8+7]-y)*b;break;case 1:f=h[_+1],p=h[_+2],m=h[_+3],g=h[_+4],v=h[_+5],x=h[_+6],y=h[_+7];break;default:f=this.getBezierValue(n,_,1,C-2),p=this.getBezierValue(n,_,2,C+18-2),m=this.getBezierValue(n,_,3,C+36-2),g=this.getBezierValue(n,_,4,C+54-2),v=this.getBezierValue(n,_,5,C+72-2),x=this.getBezierValue(n,_,6,C+90-2),y=this.getBezierValue(n,_,7,C+108-2)}if(o==1)u.set(f,p,m,g),d.r=v,d.g=x,d.b=y;else{if(a==ge.setup){u.setFromColor(l.data.color);let S=l.data.darkColor;d.r=S.r,d.g=S.g,d.b=S.b}u.add((f-u.r)*o,(p-u.g)*o,(m-u.b)*o,(g-u.a)*o),d.r+=(v-d.r)*o,d.g+=(x-d.g)*o,d.b+=(y-d.b)*o}}},_1=class extends cn{constructor(t,i,n){super(t,i,[rt.rgb+"|"+n,rt.rgb2+"|"+n]);w(this,"slotIndex",0);this.slotIndex=n}getFrameEntries(){return 7}setFrame(t,i,n,r,o,a,c,l){t*=7,this.frames[t]=i,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=o,this.frames[t+4]=a,this.frames[t+5]=c,this.frames[t+6]=l}apply(t,i,n,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=this.frames,u=l.color,d=l.darkColor;if(nt){let l=this.frames[i];return n[r+1]*(t-l)/(n[r]-l)}let o=r+18;for(r+=2;r=t){let l=n[r-2],h=n[r-1];return h+(t-l)/(n[r]-l)*(n[r+1]-h)}let a=n[o-2],c=n[o-1];return c+(1-c)*(t-a)/(this.frames[i+this.getFrameEntries()]-a)}apply(t,i,n,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.getAttachment();if(!h||!(h instanceof Un)||h.timelineAttachment!=this.attachment)return;let u=l.deform;u.length==0&&(a=ge.setup);let d=this.vertices,f=d[0].length,p=this.frames;if(n=p[p.length-1]){let _=d[p.length-1];if(o==1)if(a==ge.add){let C=h;if(C.bones)for(let S=0;Sn)this.apply(t,i,Number.MAX_VALUE,r,o,a,c),i=-1;else if(i>=l[h-1])return;if(n0&&l[u-1]==d;)u--}for(;u=l[u];u++)r.push(this.events[u])}},w(Yr,"propertyIds",[""+rt.event]),Yr);var Gr;let Va=(Gr=class extends Ut{constructor(t){super(t,Gr.propertyIds);w(this,"drawOrders");this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,i,n){this.frames[t]=i,this.drawOrders[t]=n}apply(t,i,n,r,o,a,c){if(c==Ri.mixOut){a==ge.setup&&Re.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(n>2];switch(m){case 0:let g=h[p];u=h[p+1],d=h[p+2],f=h[p+3];let v=(n-g)/(h[p+4]-g);u+=(h[p+4+1]-u)*v,d+=(h[p+4+2]-d)*v,f+=(h[p+4+3]-f)*v;break;case 1:u=h[p+1],d=h[p+2],f=h[p+3];break;default:u=this.getBezierValue(n,p,1,m-2),d=this.getBezierValue(n,p,2,m+18-2),f=this.getBezierValue(n,p,3,m+36-2)}if(a==ge.setup){let g=l.data;l.mixRotate=g.mixRotate+(u-g.mixRotate)*o,l.mixX=g.mixX+(d-g.mixX)*o,l.mixY=g.mixY+(f-g.mixY)*o}else l.mixRotate+=(u-l.mixRotate)*o,l.mixX+=(d-l.mixX)*o,l.mixY+=(f-l.mixY)*o}},lo=class extends Os{constructor(t,i,n,r){super(t,i,r+"|"+n);w(this,"constraintIndex",0);this.constraintIndex=n}apply(t,i,n,r,o,a,c){let l;if(this.constraintIndex==-1){const h=n>=this.frames[0]?this.getCurveValue(n):0;for(const u of t.physicsConstraints)u.active&&this.global(u.data)&&this.set(u,this.getAbsoluteValue2(n,o,a,this.get(u),this.setup(u),h))}else l=t.physicsConstraints[this.constraintIndex],l.active&&this.set(l,this.getAbsoluteValue(n,o,a,this.get(l),this.setup(l)))}},R1=class extends lo{constructor(e,t,i){super(e,t,i,rt.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},P1=class extends lo{constructor(e,t,i){super(e,t,i,rt.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},k1=class extends lo{constructor(e,t,i){super(e,t,i,rt.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},F1=class extends lo{constructor(e,t,i){super(e,t,i,rt.physicsConstraintMass)}setup(e){return 1/e.data.massInverse}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}},O1=class extends lo{constructor(e,t,i){super(e,t,i,rt.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},B1=class extends lo{constructor(e,t,i){super(e,t,i,rt.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},L1=class extends lo{constructor(e,t,i){super(e,t,i,rt.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}};var Hr;let D1=(Hr=class extends Ut{constructor(t,i){super(t,Hr.propertyIds);w(this,"constraintIndex");this.constraintIndex=i}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i}apply(t,i,n,r,o,a,c){let l;if(this.constraintIndex!=-1&&(l=t.physicsConstraints[this.constraintIndex],!l.active))return;const h=this.frames;if(i>n)this.apply(t,i,Number.MAX_VALUE,[],o,a,c),i=-1;else if(i>=h[h.length-1])return;if(!(n=h[Ut.search1(h,i)+1]))if(l!=null)l.reset();else for(const u of t.physicsConstraints)u.active&&u.reset()}},w(Hr,"propertyIds",[rt.physicsConstraintReset.toString()]),Hr);var Bi;let N1=(Bi=class extends Ut{constructor(t,i,n){super(t,[rt.sequence+"|"+i+"|"+n.sequence.id]);w(this,"slotIndex");w(this,"attachment");this.slotIndex=i,this.attachment=n}getFrameEntries(){return Bi.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,i,n,r,o){let a=this.frames;t*=Bi.ENTRIES,a[t]=i,a[t+Bi.MODE]=n|r<<4,a[t+Bi.DELAY]=o}apply(t,i,n,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.attachment,u=this.attachment;if(h!=u&&(!(h instanceof Un)||h.timelineAttachment!=u))return;if(c==Ri.mixOut){a==ge.setup&&(l.sequenceIndex=-1);return}let d=this.frames;if(n>4,x=this.attachment.sequence.regions.length,y=l1[m&15];if(y!=xi.hold)switch(v+=(n-p)/g+1e-5|0,y){case xi.once:v=Math.min(x-1,v);break;case xi.loop:v%=x;break;case xi.pingpong:{let _=(x<<1)-2;v=_==0?0:v%_,v>=x&&(v=_-v);break}case xi.onceReverse:v=Math.max(x-1-v,0);break;case xi.loopReverse:v=x-1-v%x;break;case xi.pingpongReverse:{let _=(x<<1)-2;v=_==0?0:(v+x-1)%_,v>=x&&(v=_-v)}}l.sequenceIndex=v}},w(Bi,"ENTRIES",3),w(Bi,"MODE",1),w(Bi,"DELAY",2),Bi);var Rn;let pR=(Rn=class{constructor(e){w(this,"data");w(this,"tracks",new Array);w(this,"timeScale",1);w(this,"unkeyedState",0);w(this,"events",new Array);w(this,"listeners",new Array);w(this,"queue",new vR(this));w(this,"propertyIDs",new r1);w(this,"animationsChanged",!1);w(this,"trackEntryPool",new lh(()=>new gR));this.data=e}static emptyAnimation(){return Rn._emptyAnimation}update(e){e*=this.timeScale;let t=this.tracks;for(let i=0,n=t.length;i0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){let c=r.trackLast-a.delay;if(c>=0){for(a.delay=0,a.trackTime+=r.timeScale==0?0:(c/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setCurrent(i,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[i]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let c=r.mixingFrom;for(r.mixingFrom=null,c&&(c.mixingTo=null);c;)this.queue.end(c),c=c.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){let i=e.mixingFrom;if(!i)return!0;let n=this.updateMixingFrom(i,t);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,e.nextTrackLast!=-1&&e.mixTime>=e.mixDuration?((i.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=i.mixingFrom,i.mixingFrom!=null&&(i.mixingFrom.mixingTo=e),e.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=t*i.timeScale,e.mixTime+=t,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let t=this.events,i=this.tracks,n=!1;for(let d=0,f=i.length;d0)continue;n=!0;let m=d==0?ge.first:p.mixBlend,g=p.alpha;p.mixingFrom?g*=this.applyMixingFrom(p,e,m):p.trackTime>=p.trackEnd&&!p.next&&(g=0);let v=g>=p.alphaAttachmentThreshold,x=p.animationLast,y=p.getAnimationTime(),_=y,C=t;p.reverse&&(_=p.animation.duration-_,C=null);let S=p.animation.timelines,b=S.length;if(d==0&&g==1||m==ge.add){d==0&&(v=!0);for(let M=0;M1&&(r=1),i!=ge.first&&(i=n.mixBlend));let o=r=n.alphaAttachmentThreshold):(a&&C instanceof Va&&b==ge.setup&&(S=Ri.mixIn),C.apply(t,d,p,m,M,b,S))}}return e.mixDuration>0&&this.queueEvents(n,f),this.events.length=0,n.nextAnimationLast=f,n.nextTrackLast=n.trackTime,r}applyAttachmentTimeline(e,t,i,n,r){var o=t.slots[e.slotIndex];o.bone.active&&(i=0,y=m>=0;Math.abs(g)<=90&&Ie.signum(g)!=Ie.signum(p)&&(Math.abs(m-v)>180?(f+=360*Ie.signum(m),y=x):v!=0?f-=360*Ie.signum(m):y=x),y!=x&&(f+=360*Ie.signum(m)),o[a]=f}o[a+1]=p,l.rotation=u+f*n}queueEvents(e,t){let i=e.animationStart,n=e.animationEnd,r=n-i,o=e.trackLast%r,a=this.events,c=0,l=a.length;for(;cn||this.queue.event(e,u)}let h=!1;if(e.loop)if(r==0)h=!0;else{const u=Math.floor(e.trackTime/r);h=u>0&&u>Math.floor(e.trackLast/r)}else h=t>=n&&e.animationLast=this.tracks.length)return;let t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let i=t;for(;;){let n=i.mixingFrom;if(!n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(e,t,i){let n=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,n&&(i&&this.queue.interrupt(n),t.mixingFrom=n,n.mixingTo=t,t.mixTime=0,n.mixingFrom&&n.mixDuration>0&&(t.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,i=!1){let n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error("Animation not found: "+t);return this.setAnimationWith(e,n,i)}setAnimationWith(e,t,i=!1){if(!t)throw new Error("animation cannot be null.");let n=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast==-1?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,n=!1):this.clearNext(r));let o=this.trackEntry(e,t,i,r);return this.setCurrent(e,o,n),this.queue.drain(),o}addAnimation(e,t,i=!1,n=0){let r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);return this.addAnimationWith(e,r,i,n)}addAnimationWith(e,t,i=!1,n=0){if(!t)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;let o=this.trackEntry(e,t,i,r);return r?(r.next=o,o.previous=r,n<=0&&(n=Math.max(n+r.getTrackComplete()-o.mixDuration,0))):(this.setCurrent(e,o,!0),this.queue.drain(),n<0&&(n=0)),o.delay=n,o}setEmptyAnimation(e,t=0){let i=this.setAnimationWith(e,Rn.emptyAnimation(),!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){let n=this.addAnimationWith(e,Rn.emptyAnimation(),!1,i);return i<=0&&(n.delay=Math.max(n.delay+n.mixDuration-t,0)),n.mixDuration=t,n.trackEnd=t,n}setEmptyAnimations(e=0){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let i=0,n=this.tracks.length;i0){r[c]=yR,o[c]=u;continue e}break}r[c]=Jd}}}getCurrent(e){return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){let t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},w(Rn,"_emptyAnimation",new lp("",[],0)),Rn),gR=class{constructor(){w(this,"animation",null);w(this,"previous",null);w(this,"next",null);w(this,"mixingFrom",null);w(this,"mixingTo",null);w(this,"listener",null);w(this,"trackIndex",0);w(this,"loop",!1);w(this,"holdPrevious",!1);w(this,"reverse",!1);w(this,"shortestRotation",!1);w(this,"eventThreshold",0);w(this,"mixAttachmentThreshold",0);w(this,"alphaAttachmentThreshold",0);w(this,"mixDrawOrderThreshold",0);w(this,"animationStart",0);w(this,"animationEnd",0);w(this,"animationLast",0);w(this,"nextAnimationLast",0);w(this,"delay",0);w(this,"trackTime",0);w(this,"trackLast",0);w(this,"nextTrackLast",0);w(this,"trackEnd",0);w(this,"timeScale",0);w(this,"alpha",0);w(this,"mixTime",0);w(this,"_mixDuration",0);w(this,"interruptAlpha",0);w(this,"totalAlpha",0);w(this,"mixBlend",ge.replace);w(this,"timelineMode",new Array);w(this,"timelineHoldMix",new Array);w(this,"timelinesRotation",new Array)}get mixDuration(){return this._mixDuration}set mixDuration(e){this._mixDuration=e}setMixDurationWithDelay(e,t){this._mixDuration=e,t<=0&&(this.previous!=null?t=Math.max(t+this.previous.getTrackComplete()-e,0):t=0),this.delay=t}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let e=this.animationEnd-this.animationStart;return e==0?this.animationStart:this.trackTime%e+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let e=this.animationEnd-this.animationStart;if(e!=0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime=0}},vR=class{constructor(e){w(this,"objects",[]);w(this,"drainDisabled",!1);w(this,"animState");this.animState=e}start(e){this.objects.push(Hi.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(Hi.interrupt),this.objects.push(e)}end(e){this.objects.push(Hi.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(Hi.dispose),this.objects.push(e)}complete(e){this.objects.push(Hi.complete),this.objects.push(e)}event(e,t){this.objects.push(Hi.event),this.objects.push(e),this.objects.push(t)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects;for(let t=0;t{h.width=parseInt(i[1]),h.height=parseInt(i[2])},n.format=()=>{},n.filter=h=>{h.minFilter=Re.enumValue(ui,i[1]),h.magFilter=Re.enumValue(ui,i[2])},n.repeat=h=>{i[1].indexOf("x")!=-1&&(h.uWrap=Fn.Repeat),i[1].indexOf("y")!=-1&&(h.vWrap=Fn.Repeat)},n.pma=h=>{h.pma=i[1]=="true"};var r={};r.xy=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2])},r.size=h=>{h.width=parseInt(i[1]),h.height=parseInt(i[2])},r.bounds=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2]),h.width=parseInt(i[3]),h.height=parseInt(i[4])},r.offset=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2])},r.orig=h=>{h.originalWidth=parseInt(i[1]),h.originalHeight=parseInt(i[2])},r.offsets=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2]),h.originalWidth=parseInt(i[3]),h.originalHeight=parseInt(i[4])},r.rotate=h=>{let u=i[1];u=="true"?h.degrees=90:u!="false"&&(h.degrees=parseInt(u))},r.index=h=>{h.index=parseInt(i[1])};let o=t.readLine();for(;o&&o.trim().length==0;)o=t.readLine();for(;!(!o||o.trim().length==0||t.readEntry(i,o)==0);)o=t.readLine();let a=null,c=null,l=null;for(;o!==null;)if(o.trim().length==0)a=null,o=t.readLine();else if(a){let h=new Y1(a,o);for(;;){let u=t.readEntry(i,o=t.readLine());if(u==0)break;let d=r[i[0]];if(d)d(h);else{c||(c=[]),l||(l=[]),c.push(i[0]);let f=[];for(let p=0;p0&&l&&l.length>0&&(h.names=c,h.values=l,c=null,l=null),h.u=h.x/a.width,h.v=h.y/a.height,h.degrees==90?(h.u2=(h.x+h.height)/a.width,h.v2=(h.y+h.width)/a.height):(h.u2=(h.x+h.width)/a.width,h.v2=(h.y+h.height)/a.height),this.regions.push(h)}else{for(a=new TR(o.trim());t.readEntry(i,o=t.readLine())!=0;){let h=n[i[0]];h&&h(a)}this.pages.push(a)}}findRegion(e){for(let t=0;t=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length==0))return 0;let i=t.indexOf(":");if(i==-1)return 0;e[0]=t.substr(0,i).trim();for(let n=1,r=i+1;;n++){let o=t.indexOf(",",r);if(o==-1)return e[n]=t.substr(r).trim(),n;if(e[n]=t.substr(r,o-r).trim(),r=o+1,n==4)return 4}}},TR=class{constructor(e){w(this,"name");w(this,"minFilter",ui.Nearest);w(this,"magFilter",ui.Nearest);w(this,"uWrap",Fn.ClampToEdge);w(this,"vWrap",Fn.ClampToEdge);w(this,"texture",null);w(this,"width",0);w(this,"height",0);w(this,"pma",!1);w(this,"regions",new Array);this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(let t of this.regions)t.texture=e}},Y1=class extends SR{constructor(t,i){super();w(this,"page");w(this,"name");w(this,"x",0);w(this,"y",0);w(this,"offsetX",0);w(this,"offsetY",0);w(this,"originalWidth",0);w(this,"originalHeight",0);w(this,"index",0);w(this,"degrees",0);w(this,"names",null);w(this,"values",null);this.page=t,this.name=i,t.regions.push(this)}},Sl=class nm extends Un{constructor(t,i){super(t);w(this,"region",null);w(this,"path");w(this,"regionUVs",[]);w(this,"uvs",[]);w(this,"triangles",[]);w(this,"color",new st(1,1,1,1));w(this,"width",0);w(this,"height",0);w(this,"hullLength",0);w(this,"edges",[]);w(this,"parentMesh",null);w(this,"sequence",null);w(this,"tempColor",new st(0,0,0,0));this.path=i}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=Re.newFloatArray(t.length));let i=this.uvs,n=this.uvs.length,r=this.region.u,o=this.region.v,a=0,c=0;if(this.region instanceof Y1){let l=this.region,h=l.page,u=h.width,d=h.height;switch(l.degrees){case 90:r-=(l.originalHeight-l.offsetY-l.height)/u,o-=(l.originalWidth-l.offsetX-l.width)/d,a=l.originalHeight/u,c=l.originalWidth/d;for(let f=0;f= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=i}};var Gt;(function(s){s[s.Normal=0]="Normal",s[s.OnlyTranslation=1]="OnlyTranslation",s[s.NoRotationOrReflection=2]="NoRotationOrReflection",s[s.NoScale=3]="NoScale",s[s.NoScaleOrReflection=4]="NoScaleOrReflection"})(Gt||(Gt={}));let Mv=class{constructor(e,t,i){w(this,"data");w(this,"skeleton");w(this,"parent",null);w(this,"children",new Array);w(this,"x",0);w(this,"y",0);w(this,"rotation",0);w(this,"scaleX",0);w(this,"scaleY",0);w(this,"shearX",0);w(this,"shearY",0);w(this,"ax",0);w(this,"ay",0);w(this,"arotation",0);w(this,"ascaleX",0);w(this,"ascaleY",0);w(this,"ashearX",0);w(this,"ashearY",0);w(this,"a",0);w(this,"b",0);w(this,"c",0);w(this,"d",0);w(this,"worldY",0);w(this,"worldX",0);w(this,"inherit",Gt.Normal);w(this,"sorted",!1);w(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=t,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(e){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,t,i,n,r,o,a){this.ax=e,this.ay=t,this.arotation=i,this.ascaleX=n,this.ascaleY=r,this.ashearX=o,this.ashearY=a;let c=this.parent;if(!c){let f=this.skeleton;const p=f.scaleX,m=f.scaleY,g=(i+o)*Ie.degRad,v=(i+90+a)*Ie.degRad;this.a=Math.cos(g)*n*p,this.b=Math.cos(v)*r*p,this.c=Math.sin(g)*n*m,this.d=Math.sin(v)*r*m,this.worldX=e*p+f.x,this.worldY=t*m+f.y;return}let l=c.a,h=c.b,u=c.c,d=c.d;switch(this.worldX=l*e+h*t+c.worldX,this.worldY=u*e+d*t+c.worldY,this.inherit){case Gt.Normal:{const f=(i+o)*Ie.degRad,p=(i+90+a)*Ie.degRad,m=Math.cos(f)*n,g=Math.cos(p)*r,v=Math.sin(f)*n,x=Math.sin(p)*r;this.a=l*m+h*v,this.b=l*g+h*x,this.c=u*m+d*v,this.d=u*g+d*x;return}case Gt.OnlyTranslation:{const f=(i+o)*Ie.degRad,p=(i+90+a)*Ie.degRad;this.a=Math.cos(f)*n,this.b=Math.cos(p)*r,this.c=Math.sin(f)*n,this.d=Math.sin(p)*r;break}case Gt.NoRotationOrReflection:{let f=1/this.skeleton.scaleX,p=1/this.skeleton.scaleY;l*=f,u*=p;let m=l*l+u*u,g=0;m>1e-4?(m=Math.abs(l*d*p-h*f*u)/m,h=u*m,d=l*m,g=Math.atan2(u,l)*Ie.radDeg):(l=0,u=0,g=90-Math.atan2(d,h)*Ie.radDeg);const v=(i+o-g)*Ie.degRad,x=(i+a-g+90)*Ie.degRad,y=Math.cos(v)*n,_=Math.cos(x)*r,C=Math.sin(v)*n,S=Math.sin(x)*r;this.a=l*y-h*C,this.b=l*_-h*S,this.c=u*y+d*C,this.d=u*_+d*S;break}case Gt.NoScale:case Gt.NoScaleOrReflection:{i*=Ie.degRad;const f=Math.cos(i),p=Math.sin(i);let m=(l*f+h*p)/this.skeleton.scaleX,g=(u*f+d*p)/this.skeleton.scaleY,v=Math.sqrt(m*m+g*g);v>1e-5&&(v=1/v),m*=v,g*=v,v=Math.sqrt(m*m+g*g),this.inherit==Gt.NoScale&&l*d-h*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(v=-v),i=Math.PI/2+Math.atan2(g,m);const x=Math.cos(i)*v,y=Math.sin(i)*v;o*=Ie.degRad,a=(90+a)*Ie.degRad;const _=Math.cos(o)*n,C=Math.cos(a)*r,S=Math.sin(o)*n,b=Math.sin(a)*r;this.a=m*_+x*S,this.b=m*C+x*b,this.c=g*_+y*S,this.d=g*C+y*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let e=this.data;this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}updateAppliedTransform(){let e=this.parent;if(!e){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*Ie.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*Ie.radDeg;return}let t=e.a,i=e.b,n=e.c,r=e.d,o=1/(t*r-i*n),a=r*o,c=i*o,l=n*o,h=t*o,u=this.worldX-e.worldX,d=this.worldY-e.worldY;this.ax=u*a-d*c,this.ay=d*h-u*l;let f,p,m,g;if(this.inherit==Gt.OnlyTranslation)f=this.a,p=this.b,m=this.c,g=this.d;else{switch(this.inherit){case Gt.NoRotationOrReflection:{let C=Math.abs(t*r-i*n)/(t*t+n*n);i=-n*this.skeleton.scaleX*C/this.skeleton.scaleY,r=t*this.skeleton.scaleY*C/this.skeleton.scaleX,o=1/(t*r-i*n),a=r*o,c=i*o;break}case Gt.NoScale:case Gt.NoScaleOrReflection:let v=Ie.cosDeg(this.rotation),x=Ie.sinDeg(this.rotation);t=(t*v+i*x)/this.skeleton.scaleX,n=(n*v+r*x)/this.skeleton.scaleY;let y=Math.sqrt(t*t+n*n);y>1e-5&&(y=1/y),t*=y,n*=y,y=Math.sqrt(t*t+n*n),this.inherit==Gt.NoScale&&o<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(y=-y);let _=Ie.PI/2+Math.atan2(n,t);i=Math.cos(_)*y,r=Math.sin(_)*y,o=1/(t*r-i*n),a=r*o,c=i*o,l=n*o,h=t*o}f=a*this.a-c*this.c,p=a*this.b-c*this.d,m=h*this.c-l*this.a,g=h*this.d-l*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let v=f*g-p*m;this.ascaleY=v/this.ascaleX,this.ashearY=-Math.atan2(f*p+m*g,v)*Ie.radDeg,this.arotation=Math.atan2(m,f)*Ie.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*Ie.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*Ie.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*Ie.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(e){let t=1/(this.a*this.d-this.b*this.c),i=e.x-this.worldX,n=e.y-this.worldY;return e.x=i*this.d*t-n*this.b*t,e.y=n*this.a*t-i*this.c*t,e}localToWorld(e){let t=e.x,i=e.y;return e.x=t*this.a+i*this.b+this.worldX,e.y=t*this.c+i*this.d+this.worldY,e}worldToParent(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.worldToLocal(e)}parentToWorld(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.localToWorld(e)}worldToLocalRotation(e){let t=Ie.sinDeg(e),i=Ie.cosDeg(e);return Math.atan2(this.a*t-this.c*i,this.d*i-this.b*t)*Ie.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=Ie.sinDeg(e),i=Ie.cosDeg(e);return Math.atan2(i*this.c+t*this.d,i*this.a+t*this.b)*Ie.radDeg}rotateWorld(e){e*=Ie.degRad;const t=Math.sin(e),i=Math.cos(e),n=this.a,r=this.b;this.a=i*n-t*this.c,this.b=i*r-t*this.d,this.c=t*n+i*this.c,this.d=t*r+i*this.d}},ou=class{constructor(e,t,i){w(this,"name");w(this,"order");w(this,"skinRequired");this.name=e,this.order=t,this.skinRequired=i}},z1=class{constructor(e,t){w(this,"data");w(this,"intValue",0);w(this,"floatValue",0);w(this,"stringValue",null);w(this,"time",0);w(this,"volume",0);w(this,"balance",0);if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},q1=class{constructor(e){w(this,"name");w(this,"intValue",0);w(this,"floatValue",0);w(this,"stringValue",null);w(this,"audioPath",null);w(this,"volume",0);w(this,"balance",0);this.name=e}},MR=class{constructor(e,t){w(this,"data");w(this,"bones");w(this,"target");w(this,"bendDirection",0);w(this,"compress",!1);w(this,"stretch",!1);w(this,"mix",1);w(this,"softness",0);w(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0;n180?f-=360:f<-180&&(f+=360);let g=e.ascaleX,v=e.ascaleY;if(n||r){switch(e.inherit){case Gt.NoScale:case Gt.NoScaleOrReflection:p=t-e.worldX,m=i-e.worldY}const x=e.data.length*g;if(x>1e-4){const y=p*p+m*m;if(n&&yx*x){const _=(Math.sqrt(y)/x-1)*a+1;g*=_,o&&(v*=_)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*a,g,v,e.ashearX,e.ashearY)}apply2(e,t,i,n,r,o,a,c,l){if(e.inherit!=Gt.Normal||t.inherit!=Gt.Normal)return;let h=e.ax,u=e.ay,d=e.ascaleX,f=e.ascaleY,p=d,m=f,g=t.ascaleX,v=0,x=0,y=0;d<0?(d=-d,v=180,y=-1):(v=0,y=1),f<0&&(f=-f,y=-y),g<0?(g=-g,x=180):x=0;let _=t.ax,C=0,S=0,b=0,M=e.a,I=e.b,F=e.c,E=e.d,k=Math.abs(d-f)<=1e-4;!k||o?(C=0,S=M*_+e.worldX,b=F*_+e.worldY):(C=t.ay,S=M*_+I*C+e.worldX,b=F*_+E*C+e.worldY);let O=e.parent;if(!O)throw new Error("IK parent must itself have a parent.");M=O.a,I=O.b,F=O.c,E=O.d;let D=M*E-I*F,$=S-O.worldX,N=b-O.worldY;D=Math.abs(D)<=1e-4?0:1/D;let U=($*E-N*I)*D-h,A=(N*M-$*F)*D-u,P=Math.sqrt(U*U+A*A),L=t.data.length*g,B,X;if(P<1e-4){this.apply1(e,i,n,!1,o,!1,l),t.updateWorldTransformWith(_,C,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}$=i-O.worldX,N=n-O.worldY;let V=($*E-N*I)*D-h,q=(N*M-$*F)*D-u,W=V*V+q*q;if(c!=0){c*=d*(g+1)*.5;let le=Math.sqrt(W),ue=le-P-L*d+c;if(ue>0){let ae=Math.min(1,ue/(c*2))-1;ae=(ue-c*(1-ae*ae))/le,V-=ae*V,q-=ae*q,W=V*V+q*q}}e:if(k){L*=d;let le=(W-P*P-L*L)/(2*P*L);le<-1?(le=-1,X=Math.PI*r):le>1?(le=1,X=0,o&&(M=(Math.sqrt(W)/(P+L)-1)*l+1,p*=M,a&&(m*=M))):X=Math.acos(le)*r,M=P+L*le,I=L*Math.sin(X),B=Math.atan2(q*M-V*I,V*M+q*I)}else{M=d*L,I=f*L;let le=M*M,ue=I*I,ae=Math.atan2(q,V);F=ue*P*P+le*W-le*ue;let xe=-2*ue*P,Y=ue-le;if(E=xe*xe-4*Y*F,E>=0){let ce=Math.sqrt(E);xe<0&&(ce=-ce),ce=-(xe+ce)*.5;let Ce=ce/Y,ye=F/ce,we=Math.abs(Ce)=0){N=Math.sqrt(Ce)*r,B=ae-Math.atan2(N,we),X=Math.atan2(N/f,(we-P)/d);break e}}let j=Ie.PI,H=P-M,G=H*H,z=0,ie=0,fe=P+M,te=fe*fe,oe=0;F=-M*P/(le-ue),F>=-1&&F<=1&&(F=Math.acos(F),$=M*Math.cos(F)+P,N=I*Math.sin(F),E=$*$+N*N,Ete&&(ie=F,te=E,fe=$,oe=N)),W<=(G+te)*.5?(B=ae-Math.atan2(z*r,H),X=j*r):(B=ae-Math.atan2(oe*r,fe),X=ie*r)}let ne=Math.atan2(C,_)*y,re=e.arotation;B=(B-ne)*Ie.radDeg+v-re,B>180?B-=360:B<-180&&(B+=360),e.updateWorldTransformWith(h,u,re+B*l,p,m,0,0),re=t.arotation,X=((X+ne)*Ie.radDeg-t.ashearX)*y+x-re,X>180?X-=360:X<-180&&(X+=360),t.updateWorldTransformWith(_,C,re+X*l,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},K1=class extends ou{constructor(t){super(t,0,!1);w(this,"bones",new Array);w(this,"_target",null);w(this,"bendDirection",0);w(this,"compress",!1);w(this,"stretch",!1);w(this,"uniform",!1);w(this,"mix",0);w(this,"softness",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Z1=class extends ou{constructor(t){super(t,0,!1);w(this,"bones",new Array);w(this,"_target",null);w(this,"positionMode",rn.Fixed);w(this,"spacingMode",li.Fixed);w(this,"rotateMode",Jr.Chain);w(this,"offsetRotation",0);w(this,"position",0);w(this,"spacing",0);w(this,"mixRotate",0);w(this,"mixX",0);w(this,"mixY",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}};var rn;(function(s){s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent"})(rn||(rn={}));var li;(function(s){s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s[s.Proportional=3]="Proportional"})(li||(li={}));var Jr;(function(s){s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale"})(Jr||(Jr={}));var Ei;let CR=(Ei=class{constructor(e,t){w(this,"data");w(this,"bones");w(this,"target");w(this,"position",0);w(this,"spacing",0);w(this,"mixRotate",0);w(this,"mixX",0);w(this,"mixY",0);w(this,"spaces",new Array);w(this,"positions",new Array);w(this,"world",new Array);w(this,"curves",new Array);w(this,"lengths",new Array);w(this,"segments",new Array);w(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0,r=e.bones.length;n0){_=u/_*p;for(let S=1;S0?Ie.degRad:-.01745329277777778}for(let _=0,C=3;_0){let E=S.a,k=S.b,O=S.c,D=S.d,$=0,N=0,U=0;if(a?$=m[C-1]:d[_+1]==0?$=m[C+2]:$=Math.atan2(F,I),$-=Math.atan2(O,E),y){N=Math.cos($),U=Math.sin($);let A=S.data.length;g+=(A*(N*E-U*O)-I)*i,v+=(A*(U*E+N*O)-F)*i}else $+=x;$>Ie.PI?$-=Ie.PI2:$<-3.1415927&&($+=Ie.PI2),$*=i,N=Math.cos($),U=Math.sin($),S.a=N*E-U*O,S.b=N*k-U*D,S.c=U*E+N*O,S.d=U*k+N*D}S.updateAppliedTransform()}}computeWorldPositions(e,t,i){let n=this.target,r=this.position,o=this.spaces,a=Re.setArraySize(this.positions,t*3+2),c=this.world,l=e.closed,h=e.worldVerticesLength,u=h/6,d=Ei.NONE;if(!e.constantSpeed){let A=e.lengths;u-=l?1:2;let P=A[u];this.data.positionMode==rn.Percent&&(r*=P);let L;switch(this.data.spacingMode){case li.Percent:L=P;break;case li.Proportional:L=P/t;break;default:L=1}c=Re.setArraySize(this.world,8);for(let B=0,X=0,V=0;BP){d!=Ei.AFTER&&(d=Ei.AFTER,e.computeWorldVertices(n,h-6,4,c,0,2)),this.addAfterPosition(W-P,c,0,a,X);continue}for(;;V++){let ne=A[V];if(!(W>ne)){if(V==0)W/=ne;else{let re=A[V-1];W=(W-re)/(ne-re)}break}}V!=d&&(d=V,l&&V==u?(e.computeWorldVertices(n,h-4,4,c,0,2),e.computeWorldVertices(n,0,4,c,4,2)):e.computeWorldVertices(n,V*6+2,8,c,0,2)),this.addCurvePosition(W,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],a,X,i||B>0&&q==0)}return a}l?(h+=2,c=Re.setArraySize(this.world,h),e.computeWorldVertices(n,2,h-4,c,0,2),e.computeWorldVertices(n,0,2,c,h-4,2),c[h-2]=c[0],c[h-1]=c[1]):(u--,h-=4,c=Re.setArraySize(this.world,h),e.computeWorldVertices(n,2,h,c,0,2));let f=Re.setArraySize(this.curves,u),p=0,m=c[0],g=c[1],v=0,x=0,y=0,_=0,C=0,S=0,b=0,M=0,I=0,F=0,E=0,k=0,O=0,D=0;for(let A=0,P=2;Ap){this.addAfterPosition(V-p,c,h-4,a,P);continue}for(;;L++){let q=f[L];if(!(V>q)){if(L==0)V/=q;else{let W=f[L-1];V=(V-W)/(q-W)}break}}if(L!=d){d=L;let q=L*6;for(m=c[q],g=c[q+1],v=c[q+2],x=c[q+3],y=c[q+4],_=c[q+5],C=c[q+6],S=c[q+7],b=(m-v*2+y)*.03,M=(g-x*2+_)*.03,I=((v-y)*3-m+C)*.006,F=((x-_)*3-g+S)*.006,E=b*2+I,k=M*2+F,O=(v-m)*.3+b+I*.16666667,D=(x-g)*.3+M+F*.16666667,U=Math.sqrt(O*O+D*D),N[0]=U,q=1;q<8;q++)O+=E,D+=k,E+=I,k+=F,U+=Math.sqrt(O*O+D*D),N[q]=U;O+=E,D+=k,U+=Math.sqrt(O*O+D*D),N[8]=U,O+=E+I,D+=k+F,U+=Math.sqrt(O*O+D*D),N[9]=U,B=0}for(V*=U;;B++){let q=N[B];if(!(V>q)){if(B==0)V/=q;else{let W=N[B-1];V=B+(V-W)/(q-W)}break}}this.addCurvePosition(V*.1,m,g,v,x,y,_,C,S,a,P,i||A>0&&X==0)}return a}addBeforePosition(e,t,i,n,r){let o=t[i],a=t[i+1],c=t[i+2]-o,l=t[i+3]-a,h=Math.atan2(l,c);n[r]=o+e*Math.cos(h),n[r+1]=a+e*Math.sin(h),n[r+2]=h}addAfterPosition(e,t,i,n,r){let o=t[i+2],a=t[i+3],c=o-t[i],l=a-t[i+1],h=Math.atan2(l,c);n[r]=o+e*Math.cos(h),n[r+1]=a+e*Math.sin(h),n[r+2]=h}addCurvePosition(e,t,i,n,r,o,a,c,l,h,u,d){if(e==0||isNaN(e)){h[u]=t,h[u+1]=i,h[u+2]=Math.atan2(r-i,n-t);return}let f=e*e,p=f*e,m=1-e,g=m*m,v=g*m,x=m*e,y=x*3,_=m*y,C=y*e,S=t*v+n*_+o*C+c*p,b=i*v+r*_+a*C+l*p;h[u]=S,h[u+1]=b,d&&(e<.001?h[u+2]=Math.atan2(r-i,n-t):h[u+2]=Math.atan2(b-(i*g+r*x*2+a*f),S-(t*g+n*x*2+o*f)))}},w(Ei,"NONE",-1),w(Ei,"BEFORE",-2),w(Ei,"AFTER",-3),w(Ei,"epsilon",1e-5),Ei),AR=class{constructor(e,t){w(this,"data");w(this,"_bone",null);w(this,"inertia",0);w(this,"strength",0);w(this,"damping",0);w(this,"massInverse",0);w(this,"wind",0);w(this,"gravity",0);w(this,"mix",0);w(this,"_reset",!0);w(this,"ux",0);w(this,"uy",0);w(this,"cx",0);w(this,"cy",0);w(this,"tx",0);w(this,"ty",0);w(this,"xOffset",0);w(this,"xVelocity",0);w(this,"yOffset",0);w(this,"yVelocity",0);w(this,"rotateOffset",0);w(this,"rotateVelocity",0);w(this,"scaleOffset",0);w(this,"scaleVelocity",0);w(this,"active",!1);w(this,"skeleton");w(this,"remaining",0);w(this,"lastTime",0);this.data=e,this.skeleton=t,this.bone=t.bones[e.bone.index],this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}reset(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}setToSetupPose(){const e=this.data;this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}isActive(){return this.active}update(e){const t=this.mix;if(t==0)return;const i=this.data.x>0,n=this.data.y>0,r=this.data.rotate>0||this.data.shearX>0,o=this.data.scaleX>0,a=this.bone,c=a.data.length;switch(e){case ir.none:return;case ir.reset:this.reset();case ir.update:const l=this.skeleton,h=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=h,this.lastTime=l.time;const u=a.worldX,d=a.worldY;if(this._reset)this._reset=!1,this.ux=u,this.uy=d;else{let f=this.remaining,p=this.inertia,m=this.data.step,g=this.skeleton.data.referenceScale,v=-1,x=this.data.limit*h,y=x*Math.abs(l.scaleY);if(x*=Math.abs(l.scaleX),i||n){if(i){const _=(this.ux-u)*p;this.xOffset+=_>x?x:_<-x?-x:_,this.ux=u}if(n){const _=(this.uy-d)*p;this.yOffset+=_>y?y:_<-y?-y:_,this.uy=d}if(f>=m){v=Math.pow(this.damping,60*m);const _=this.massInverse*m,C=this.strength,S=this.wind*g*l.scaleX,b=this.gravity*g*l.scaleY;do i&&(this.xVelocity+=(S-this.xOffset*C)*_,this.xOffset+=this.xVelocity*m,this.xVelocity*=v),n&&(this.yVelocity-=(b+this.yOffset*C)*_,this.yOffset+=this.yVelocity*m,this.yVelocity*=v),f-=m;while(f>=m)}i&&(a.worldX+=this.xOffset*t*this.data.x),n&&(a.worldY+=this.yOffset*t*this.data.y)}if(r||o){let _=Math.atan2(a.c,a.a),C=0,S=0,b=0,M=this.cx-a.worldX,I=this.cy-a.worldY;if(M>x?M=x:M<-x&&(M=-x),I>y?I=y:I<-y&&(I=-y),r){b=(this.data.rotate+this.data.shearX)*t;let F=Math.atan2(I+this.ty,M+this.tx)-_-this.rotateOffset*b;this.rotateOffset+=(F-Math.ceil(F*Ie.invPI2-.5)*Ie.PI2)*p,F=this.rotateOffset*b+_,C=Math.cos(F),S=Math.sin(F),o&&(F=c*a.getWorldScaleX(),F>0&&(this.scaleOffset+=(M*C+I*S)*p/F))}else{C=Math.cos(_),S=Math.sin(_);const F=c*a.getWorldScaleX();F>0&&(this.scaleOffset+=(M*C+I*S)*p/F)}if(f=this.remaining,f>=m){v==-1&&(v=Math.pow(this.damping,60*m));const F=this.massInverse*m,E=this.strength,k=this.wind,O=up.yDown?-this.gravity:this.gravity,D=c/g;for(;;)if(f-=m,o&&(this.scaleVelocity+=(k*C-O*S-this.scaleOffset*E)*F,this.scaleOffset+=this.scaleVelocity*m,this.scaleVelocity*=v),r){if(this.rotateVelocity-=((k*S+O*C)*D+this.rotateOffset*E)*F,this.rotateOffset+=this.rotateVelocity*m,this.rotateVelocity*=v,f0){let f=0;this.data.rotate>0&&(f=l*this.data.rotate,h=Math.sin(f),u=Math.cos(f),d=a.b,a.b=u*d-h*a.d,a.d=h*d+u*a.d),f+=l*this.data.shearX,h=Math.sin(f),u=Math.cos(f),d=a.a,a.a=u*d-h*a.c,a.c=h*d+u*a.c}else l*=this.data.rotate,h=Math.sin(l),u=Math.cos(l),d=a.a,a.a=u*d-h*a.c,a.c=h*d+u*a.c,d=a.b,a.b=u*d-h*a.d,a.d=h*d+u*a.d}if(o){const l=1+this.scaleOffset*t*this.data.scaleX;a.a*=l,a.c*=l}e!=ir.pose&&(this.tx=c*a.a,this.ty=c*a.c),a.updateAppliedTransform()}translate(e,t){this.ux-=e,this.uy-=t,this.cx-=e,this.cy-=t}rotate(e,t,i){const n=i*Ie.degRad,r=Math.cos(n),o=Math.sin(n),a=this.cx-e,c=this.cy-t;this.translate(a*r-c*o-a,a*o+c*r-c)}},ER=class{constructor(e,t){w(this,"data");w(this,"bone");w(this,"color");w(this,"darkColor",null);w(this,"attachment",null);w(this,"attachmentState",0);w(this,"sequenceIndex",-1);w(this,"deform",new Array);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("bone cannot be null.");this.data=e,this.bone=t,this.color=new st,this.darkColor=e.darkColor?new st:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof Un)||!(this.attachment instanceof Un)||e.timelineAttachment!=this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=e,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},IR=class{constructor(e,t){w(this,"data");w(this,"bones");w(this,"target");w(this,"mixRotate",0);w(this,"mixX",0);w(this,"mixY",0);w(this,"mixScaleX",0);w(this,"mixScaleY",0);w(this,"mixShearY",0);w(this,"temp",new ch);w(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0;n0?Ie.degRad:-.01745329277777778,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let v=0,x=g.length;vIe.PI?M-=Ie.PI2:M<-3.1415927&&(M+=Ie.PI2),M*=e;let I=Math.cos(M),F=Math.sin(M);y.a=I*_-F*S,y.b=I*C-F*b,y.c=F*_+I*S,y.d=F*C+I*b}if(a){let _=this.temp;c.localToWorld(_.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(_.x-y.worldX)*t,y.worldY+=(_.y-y.worldY)*i}if(n!=0){let _=Math.sqrt(y.a*y.a+y.c*y.c);_!=0&&(_=(_+(Math.sqrt(l*l+u*u)-_+this.data.offsetScaleX)*n)/_),y.a*=_,y.c*=_}if(r!=0){let _=Math.sqrt(y.b*y.b+y.d*y.d);_!=0&&(_=(_+(Math.sqrt(h*h+d*d)-_+this.data.offsetScaleY)*r)/_),y.b*=_,y.d*=_}if(o>0){let _=y.b,C=y.d,S=Math.atan2(C,_),b=Math.atan2(d,h)-Math.atan2(u,l)-(S-Math.atan2(y.c,y.a));b>Ie.PI?b-=Ie.PI2:b<-3.1415927&&(b+=Ie.PI2),b=S+(b+m)*o;let M=Math.sqrt(_*_+C*C);y.b=Math.cos(b)*M,y.d=Math.sin(b)*M}y.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,i=this.mixY,n=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=t!=0||i!=0,c=this.target,l=c.a,h=c.b,u=c.c,d=c.d,f=l*d-h*u>0?Ie.degRad:-.01745329277777778,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let v=0,x=g.length;vIe.PI?M-=Ie.PI2:M<-3.1415927&&(M+=Ie.PI2),M*=e;let I=Math.cos(M),F=Math.sin(M);y.a=I*_-F*S,y.b=I*C-F*b,y.c=F*_+I*S,y.d=F*C+I*b}if(a){let _=this.temp;c.localToWorld(_.set(this.data.offsetX,this.data.offsetY)),y.worldX+=_.x*t,y.worldY+=_.y*i}if(n!=0){let _=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleX)*n+1;y.a*=_,y.c*=_}if(r!=0){let _=(Math.sqrt(h*h+d*d)-1+this.data.offsetScaleY)*r+1;y.b*=_,y.d*=_}if(o>0){let _=Math.atan2(d,h)-Math.atan2(u,l);_>Ie.PI?_-=Ie.PI2:_<-3.1415927&&(_+=Ie.PI2);let C=y.b,S=y.d;_=Math.atan2(S,C)+(_-Ie.PI/2+m)*o;let b=Math.sqrt(C*C+S*S);y.b=Math.cos(_)*b,y.d=Math.sin(_)*b}y.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,i=this.mixY,n=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=this.target,c=this.bones;for(let l=0,h=c.length;lt.data.name==e)??null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(t=>t.data.name==e)??null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(t=>t.data.name==e)??null}findPhysicsConstraint(e){if(e==null)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(t=>t.data.name==e)??null}getBoundsRect(e){let t=new ch,i=new ch;return this.getBounds(t,i,void 0,e),{x:t.x,y:t.y,width:i.x,height:i.y}}getBounds(e,t,i=new Array(2),n=null){if(!e)throw new Error("offset cannot be null.");if(!t)throw new Error("size cannot be null.");let r=this.drawOrder,o=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let h=0,u=r.length;h=n.length&&(n.length=e+1),n[e]||(n[e]={}),n[e][t]=i}addSkin(e){for(let n=0;n= 0.");if(!t)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=i}};var cr;(function(s){s[s.Normal=0]="Normal",s[s.Additive=1]="Additive",s[s.Multiply=2]="Multiply",s[s.Screen=3]="Screen"})(cr||(cr={}));let ew=class extends ou{constructor(t){super(t,0,!1);w(this,"bones",new Array);w(this,"_target",null);w(this,"mixRotate",0);w(this,"mixX",0);w(this,"mixY",0);w(this,"mixScaleX",0);w(this,"mixScaleY",0);w(this,"mixShearY",0);w(this,"offsetRotation",0);w(this,"offsetX",0);w(this,"offsetY",0);w(this,"offsetScaleX",0);w(this,"offsetScaleY",0);w(this,"offsetShearY",0);w(this,"relative",!1);w(this,"local",!1)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},am=class{constructor(e){w(this,"scale",1);w(this,"attachmentLoader");w(this,"linkedMeshes",new Array);this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,i=new uh;i.name="";let n=new RR(e),r=n.readInt32(),o=n.readInt32();i.hash=o==0&&r==0?null:o.toString(16)+r.toString(16),i.version=n.readString(),i.x=n.readFloat(),i.y=n.readFloat(),i.width=n.readFloat(),i.height=n.readFloat(),i.referenceScale=n.readFloat()*t;let a=n.readBoolean();a&&(i.fps=n.readFloat(),i.imagesPath=n.readString(),i.audioPath=n.readString());let c=0;c=n.readInt(!0);for(let h=0;h>1&3,f.rotateMode=p>>3&3,(p&128)!=0&&(f.offsetRotation=n.readFloat()),f.position=n.readFloat(),f.positionMode==rn.Fixed&&(f.position*=t),f.spacing=n.readFloat(),(f.spacingMode==li.Length||f.spacingMode==li.Fixed)&&(f.spacing*=t),f.mixRotate=n.readFloat(),f.mixX=n.readFloat(),f.mixY=n.readFloat(),i.pathConstraints.push(f)}c=n.readInt(!0);for(let h=0,u;h>4,e.readFloat())}n.push(S);break}}}}}let o=e.readInt(!0);if(o>0){let l=new Va(o),h=i.slots.length;for(let u=0;u=0;x--)p[x]=-1;let m=Re.newArray(h-f,0),g=0,v=0;for(let x=0;x=0;x--)p[x]==-1&&(p[x]=m[--v]);l.setFrame(u,d,p)}n.push(l)}let a=e.readInt(!0);if(a>0){let l=new hp(a);for(let h=0;h>>1^-(i&1)}readStringRef(){let e=this.readInt(!0);return e==0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="";for(let i=0;i>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),i+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),i+=3;break;default:t+=String.fromCharCode(n),i++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},PR=class{constructor(e,t,i,n,r){w(this,"parent");w(this,"skinIndex");w(this,"slotIndex");w(this,"mesh");w(this,"inheritTimeline");this.mesh=e,this.skinIndex=t,this.slotIndex=i,this.parent=n,this.inheritTimeline=r}},kR=class{constructor(e=null,t=null,i=0){w(this,"bones");w(this,"vertices");w(this,"length");this.bones=e,this.vertices=t,this.length=i}};var gn;(function(s){s[s.Region=0]="Region",s[s.BoundingBox=1]="BoundingBox",s[s.Mesh=2]="Mesh",s[s.LinkedMesh=3]="LinkedMesh",s[s.Path=4]="Path",s[s.Point=5]="Point",s[s.Clipping=6]="Clipping"})(gn||(gn={}));function Mi(s,e,t){let i=s.readFloat(),n=s.readFloat()*t;for(let r=0,o=0,a=e.getFrameCount()-1;e.setFrame(r,i,n),r!=a;r++){let c=s.readFloat(),l=s.readFloat()*t;switch(s.readByte()){case Vs:e.setStepped(r);break;case Ys:ht(s,e,o++,r,0,i,c,n,l,t)}i=c,n=l}return e}function Qd(s,e,t){let i=s.readFloat(),n=s.readFloat()*t,r=s.readFloat()*t;for(let o=0,a=0,c=e.getFrameCount()-1;e.setFrame(o,i,n,r),o!=c;o++){let l=s.readFloat(),h=s.readFloat()*t,u=s.readFloat()*t;switch(s.readByte()){case Vs:e.setStepped(o);break;case Ys:ht(s,e,a++,o,0,i,l,n,h,t),ht(s,e,a++,o,1,i,l,r,u,t)}i=l,n=h,r=u}return e}function ht(s,e,t,i,n,r,o,a,c,l){e.setBezier(t,i,n,r,a,s.readFloat(),s.readFloat()*l,s.readFloat(),s.readFloat()*l,o,c)}const FR=0,OR=1,BR=2,LR=3,DR=4,NR=5,UR=6,$R=7,XR=8,VR=9,YR=10,GR=0,HR=1,jR=2,WR=3,zR=4,qR=5,KR=0,ZR=1,JR=0,QR=1,eP=2,tP=0,iP=1,sP=2,nP=4,rP=5,oP=6,aP=7,lP=8,Vs=1,Ys=2;class ji{constructor(){w(this,"convexPolygons",new Array);w(this,"convexPolygonsIndices",new Array);w(this,"indicesArray",new Array);w(this,"isConcaveArray",new Array);w(this,"triangles",new Array);w(this,"polygonPool",new lh(()=>new Array));w(this,"polygonIndicesPool",new lh(()=>new Array))}triangulate(e){let t=e,i=e.length>>1,n=this.indicesArray;n.length=0;for(let a=0;a3;){let a=i-1,c=0,l=1;for(;;){e:if(!r[c]){let d=n[a]<<1,f=n[c]<<1,p=n[l]<<1,m=t[d],g=t[d+1],v=t[f],x=t[f+1],y=t[p],_=t[p+1];for(let C=(l+1)%i;C!=a;C=(C+1)%i){if(!r[C])continue;let S=n[C]<<1,b=t[S],M=t[S+1];if(ji.positiveArea(y,_,m,g,b,M)&&ji.positiveArea(m,g,v,x,b,M)&&ji.positiveArea(v,x,y,_,b,M))break e}break}if(l==0){do{if(!r[c])break;c--}while(c>0);break}a=c,c=l,l=(l+1)%i}o.push(n[(i+c-1)%i]),o.push(n[c]),o.push(n[(c+1)%i]),n.splice(c,1),r.splice(c,1),i--;let h=(i+c-1)%i,u=c==i?0:c;r[h]=ji.isConcave(h,i,t,n),r[u]=ji.isConcave(u,i,t,n)}return i==3&&(o.push(n[2]),o.push(n[0]),o.push(n[1])),o}decompose(e,t){let i=e,n=this.convexPolygons;this.polygonPool.freeAll(n),n.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let o=this.polygonIndicesPool.obtain();o.length=0;let a=this.polygonPool.obtain();a.length=0;let c=-1,l=0;for(let h=0,u=t.length;h0?(n.push(a),r.push(o)):(this.polygonPool.free(a),this.polygonIndicesPool.free(o)),a=this.polygonPool.obtain(),a.length=0,a.push(m),a.push(g),a.push(v),a.push(x),a.push(y),a.push(_),o=this.polygonIndicesPool.obtain(),o.length=0,o.push(d),o.push(f),o.push(p),l=ji.winding(m,g,v,x,y,_),c=d)}a.length>0&&(n.push(a),r.push(o));for(let h=0,u=n.length;h=0;h--)a=n[h],a.length==0&&(n.splice(h,1),this.polygonPool.free(a),o=r[h],r.splice(h,1),this.polygonIndicesPool.free(o));return n}static isConcave(e,t,i,n){let r=n[(t+e-1)%t]<<1,o=n[e]<<1,a=n[(e+1)%t]<<1;return!this.positiveArea(i[r],i[r+1],i[o],i[o+1],i[a],i[a+1])}static positiveArea(e,t,i,n,r,o){return e*(o-n)+i*(t-o)+r*(n-t)>=0}static winding(e,t,i,n,r,o){let a=i-e,c=n-t;return r*c-o*a+a*t-e*c>=0?1:-1}}class dh{constructor(){w(this,"triangulator",new ji);w(this,"clippingPolygon",new Array);w(this,"clipOutput",new Array);w(this,"clippedVertices",new Array);w(this,"clippedUVs",new Array);w(this,"clippedTriangles",new Array);w(this,"scratch",new Array);w(this,"clipAttachment",null);w(this,"clippingPolygons",null)}clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let i=t.worldVerticesLength,n=Re.setArraySize(this.clippingPolygon,i);t.computeWorldVertices(e,0,i,n,0,2);let r=this.clippingPolygon;dh.makeClockwise(r);let o=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let a=0,c=o.length;a>1,S=this.clipOutput,b=Re.setArraySize(r,y+C*2);for(let I=0;I<_;I+=2,y+=2){let F=S[I],E=S[I+1];b[y]=F,b[y+1]=E}y=o.length;let M=Re.setArraySize(o,y+3*(C-2));C--;for(let I=1;I>1,X=this.clipOutput,V=Re.setArraySize(l,D+B*f);for(let W=0;W<$;W+=2,D+=f){let ne=X[W],re=X[W+1];V[D]=ne,V[D+1]=re,V[D+2]=r.r,V[D+3]=r.g,V[D+4]=r.b,V[D+5]=r.a;let le=ne-I,ue=re-F,ae=(N*le+U*ue)*L,xe=(P*le+A*ue)*L,Y=1-ae-xe;V[D+6]=y*ae+b*xe+E*Y,V[D+7]=_*ae+M*xe+k*Y,a&&(V[D+8]=o.r,V[D+9]=o.g,V[D+10]=o.b,V[D+11]=o.a)}D=h.length;let q=Re.setArraySize(h,D+3*(B-2));B--;for(let W=1;W>1,P=this.clipOutput,L=Re.setArraySize(o,E+A*2),B=Re.setArraySize(a,E+A*2);for(let V=0;V=2?(u=c,c=this.scratch):u=this.scratch,u.length=0,u.push(e),u.push(t),u.push(i),u.push(n),u.push(r),u.push(o),u.push(e),u.push(t),c.length=0;let d=a.length-4,f=a;for(let p=0;;p+=2){let m=f[p],g=f[p+1],v=m-f[p+2],x=g-f[p+3],y=c.length,_=u;for(let S=0,b=u.length-2;Sv*(g-E),O=x*(m-M)-v*(g-I);if(O>0){if(k){c.push(F),c.push(E);continue}let D=F-M,$=E-I,N=O/(D*x-$*v);if(N>=0&&N<=1)c.push(M+D*N),c.push(I+$*N);else{c.push(F),c.push(E);continue}}else if(k){let D=F-M,$=E-I,N=O/(D*x-$*v);if(N>=0&&N<=1)c.push(M+D*N),c.push(I+$*N),c.push(F),c.push(E);else{c.push(F),c.push(E);continue}}h=!0}if(y==c.length)return l.length=0,!0;if(c.push(c[0]),c.push(c[1]),p==d)break;let C=c;c=u,c.length=0,u=C}if(l!=c){l.length=0;for(let p=0,m=c.length-2;p>1;l0){let h=i.findPhysicsConstraint(a);if(!h)throw new Error("Physics constraint not found: "+a);l=i.physicsConstraints.indexOf(h)}for(let h in c){let u=c[h],d=u[0];if(!d)continue;let f=u.length;if(h=="reset"){const m=new D1(f,l);for(let g=0;d!=null;d=u[g+1],g++)m.setFrame(g,J(d,"time",0));r.push(m);continue}let p;if(h=="inertia")p=new R1(f,f,l);else if(h=="strength")p=new P1(f,f,l);else if(h=="damping")p=new k1(f,f,l);else if(h=="mass")p=new F1(f,f,l);else if(h=="wind")p=new O1(f,f,l);else if(h=="gravity")p=new B1(f,f,l);else if(h=="mix")p=new L1(f,f,l);else continue;r.push(bs(u,p,0,1))}}if(e.attachments)for(let a in e.attachments){let c=e.attachments[a],l=i.findSkin(a);if(!l)throw new Error("Skin not found: "+a);for(let h in c){let u=c[h],d=i.findSlot(h);if(!d)throw new Error("Slot not found: "+h);let f=d.index;for(let p in u){let m=u[p],g=l.getAttachment(f,p);for(let v in m){let x=m[v],y=x[0];if(y){if(v=="deform"){let _=g.bones,C=g.vertices,S=_?C.length/3*2:C.length,b=new T1(x.length,x.length,f,g),M=J(y,"time",0);for(let I=0,F=0;;I++){let E,k=J(y,"vertices",null);if(!k)E=_?Re.newFloatArray(S):C;else{E=Re.newFloatArray(S);let N=J(y,"offset",0);if(Re.arrayCopy(k,0,E,N,k.length),n!=1)for(let U=N,A=U+k.length;U=0;v--)d[v]==-1&&(d[v]=p[--g])}a.setFrame(l,J(u,"time",0),d)}r.push(a)}if(e.events){let a=new hp(e.events.length),c=0;for(let l=0;l"u"&&(Math.fround=(function(s){return function(e){return s[0]=e,s[0]}})(new Float32Array(1)));if(typeof window<"u"&&window.PIXI){let s=window.require;window.require=e=>{if(s)return s(e);if(e.startsWith("@pixi/"))return window.PIXI}}const yn=class yn extends wR{constructor(t){super(t.resource.source);w(this,"texture");this.texture=ze.from(t)}static from(t){return yn.textureMap.has(t)?yn.textureMap.get(t):new yn(t)}setFilters(t,i){this.texture.baseTexture.scaleMode=yn.toPixiTextureFilter(t),this.texture.baseTexture.mipmap=yn.toPixiMipMap(t)}setWraps(t,i){this.texture.baseTexture.wrapMode=yn.toPixiTextureWrap(t)}dispose(){this.texture.destroy()}static toPixiTextureFilter(t){switch(t){case ui.Nearest:case ui.MipMapNearestLinear:case ui.MipMapNearestNearest:return Cs.NEAREST;case ui.Linear:case ui.MipMapLinearLinear:case ui.MipMapLinearNearest:return Cs.LINEAR;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiMipMap(t){switch(t){case ui.Nearest:case ui.Linear:return gs.OFF;case ui.MipMapNearestLinear:case ui.MipMapNearestNearest:case ui.MipMapLinearLinear:case ui.MipMapLinearNearest:return gs.ON;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case Fn.ClampToEdge:return Is.CLAMP;case Fn.MirroredRepeat:return Is.MIRRORED_REPEAT;case Fn.Repeat:return Is.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case cr.Normal:return je.NORMAL;case cr.Additive:return je.ADD;case cr.Multiply:return je.MULTIPLY;case cr.Screen:return je.SCREEN;default:throw new Error(`Unknown blendMode: ${String(t)}`)}}};w(yn,"textureMap",new Map);let so=yn;const xn=class xn extends ll{constructor(){const t=new rp;t.getBuffer("aVertexPosition").static=!1,t.getBuffer("aTextureCoord").static=!1;const i=new nh(ze.EMPTY);super(t,i);w(this,"name","");w(this,"warnedTwoTint",!1)}updateFromSpineData(t,i,n,r,o,a,c,l){var v,x;this.texture=t.texture;const h=o/(l?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((v=u.data)==null?void 0:v.length)!==h&&(u.data=new Float32Array(h));const d=this.geometry.getBuffer("aVertexPosition");((x=d.data)==null?void 0:x.length)!==h&&(d.data=new Float32Array(h));let f=0,p=u.data,m=d.data;for(let y=0;ynew lm);w(this,"beforeUpdateWorldTransforms",()=>{});w(this,"afterUpdateWorldTransforms",()=>{});w(this,"_autoUpdate",!1);w(this,"_ticker",$i.shared);w(this,"meshesCache",new Map);w(this,"lightColor",new st);w(this,"darkColor",new st);w(this,"_boundsProvider");w(this,"_boundsPoint",new pt);w(this,"_boundsSpineID",-1);w(this,"_boundsSpineDirty",!0);w(this,"slotsObject",new Map);w(this,"verticesCache",Re.newFloatArray(1024));w(this,"clippingSlotToPixiMasks",{});w(this,"currentClippingSlot");const n=t instanceof uh?t:t.skeletonData;this.skeleton=new up(n);const r=new bR(n);this.state=new pR(r),(t==null?void 0:t.darkTint)!==void 0||(i==null?void 0:i.slotMeshFactory)===void 0?(this.darkTint=(t==null?void 0:t.darkTint)===void 0?this.skeleton.slots.some(o=>!!o.data.darkColor):t==null?void 0:t.darkTint,this.darkTint&&(this.slotMeshFactory=()=>new Ya)):this.initializeMeshFactory(i==null?void 0:i.slotMeshFactory),t!=null&&t.ticker&&(this._ticker=t.ticker),this.autoUpdate=(t==null?void 0:t.autoUpdate)??!0,this.boundsProvider=t.boundsProvider}get debug(){return this._debug}set debug(t){this._debug&&this._debug.unregisterSpine(this),t&&t.registerSpine(this),this._debug=t}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t&&!this._autoUpdate?this._ticker.add(this.internalUpdate,this):!t&&this._autoUpdate&&this._ticker.remove(this.internalUpdate,this),this._autoUpdate=t}get ticker(){return this._ticker}set ticker(t){t=t??$i.shared,this._ticker!==t&&(this._autoUpdate&&(this._ticker.remove(this.internalUpdate,this),t.add(this.internalUpdate,this)),this._ticker=t)}get boundsProvider(){return this._boundsProvider}set boundsProvider(t){this._boundsProvider=t,t?(this._boundsSpineID=-1,this._boundsSpineDirty=!0,this.interactiveChildren=!1):(this.interactiveChildren=!0,this.hitArea=null),this.hasNeverUpdated||this.calculateBounds()}initializeMeshFactory(t){if(t){this.slotMeshFactory=t;const i=this.slotMeshFactory();i instanceof Ya&&(this.darkTint=!0),i.destroy()}else for(let i=0;inew Ya,this.darkTint=!0;break}}update(t){this.internalUpdate(0,t)}internalUpdate(t,i){this.hasNeverUpdated=!1;const n=i??this._ticker.deltaMS/1e3;this.state.update(n),this.state.apply(this.skeleton),this.beforeUpdateWorldTransforms(this),this.skeleton.update(n),this.skeleton.updateWorldTransform(ir.update),this.afterUpdateWorldTransforms(this)}updateTransform(){var t;this.renderMeshes(),this.sortChildren(),(t=this.debug)==null||t.renderDebug(this),super.updateTransform()}destroy(t){var i;this.autoUpdate&&(this.autoUpdate=!1),this._ticker=null;for(const[,n]of this.meshesCache)n==null||n.destroy();this.state.clearListeners(),this.debug=void 0,this.meshesCache.clear(),this.slotsObject.clear();for(let n in this.clippingSlotToPixiMasks)(i=this.clippingSlotToPixiMasks[n].mask)==null||i.destroy(),delete this.clippingSlotToPixiMasks[n];super.destroy(t)}resetMeshes(){for(const[,t]of this.meshesCache)t.zIndex=-1,t.visible=!1}_calculateBounds(){this.hasNeverUpdated&&(this.internalUpdate(0,0),this.renderMeshes())}hasMeshForSlot(t){return this.meshesCache.has(t)}getMeshForSlot(t){if(this.hasMeshForSlot(t)){let i=this.meshesCache.get(t);return i.visible=!0,i}else{let i=this.slotMeshFactory();return this.addChild(i),this.meshesCache.set(t,i),i}}getSlotFromRef(t){let i;if(typeof t=="number"?i=this.skeleton.slots[t]:typeof t=="string"?i=this.skeleton.findSlot(t):i=t,!i)throw new Error(`No slot found with the given slot reference: ${t}`);return i}addSlotObject(t,i,n){var a;let r=this.getSlotFromRef(t);const o=(a=this.slotsObject.get(r))==null?void 0:a.container;if(!(o&&o===i)){for(const[c,{container:l}]of this.slotsObject)if(c!==r&&l===i){this.removeSlotObject(c,i);break}o&&this.removeChild(o),this.slotsObject.set(r,{container:i,followAttachmentTimeline:(n==null?void 0:n.followAttachmentTimeline)||!1,followSlotColor:(n==null?void 0:n.followSlotColor)||!1}),this.addChild(i)}}getSlotObject(t){const i=this.slotsObject.get(this.getSlotFromRef(t));return i?i.container:void 0}removeSlotObject(t,i){var o;let n=this.getSlotFromRef(t),r=(o=this.slotsObject.get(n))==null?void 0:o.container;r&&(i&&i!==r||(this.removeChild(r),this.slotsObject.delete(n)))}removeSlotObjects(){for(const[,t]of this.slotsObject)t.container.removeFromParent();this.slotsObject.clear()}updateSlotObject(t,i,n){const{container:r,followAttachmentTimeline:o}=t,a=o?!!i.attachment:!0;if(r.visible=this.skeleton.drawOrder.includes(i)&&a,r.visible){let c=i.bone;const l=r.localTransform;l.a=c.a,l.b=c.c,l.c=-c.b,l.d=-c.d,l.tx=c.worldX,l.ty=c.worldY,r.transform.setFromMatrix(l),r.zIndex=n,r.alpha=this.skeleton.color.a*i.color.a,t.followSlotColor&&this.setSlotObjectTint(r,255*this.skeleton.color.r*i.color.r<<16|255*this.skeleton.color.g*i.color.g<<8|255*this.skeleton.color.b*i.color.b)}}setSlotObjectTint(t,i){const n=t;"tint"in n&&(n.tint=i);for(const r of n.children??[])this.setSlotObjectTint(r,i)}updateAndSetPixiMask(t,i){var a,c;const n=t.attachment;if(n&&n instanceof Wo){const l=(a=this.clippingSlotToPixiMasks)[c=t.data.name]||(a[c]={slot:t,vertices:new Array});l.maskComputed=!1,this.currentClippingSlot=l;return}let r=this.currentClippingSlot;const o=this.slotsObject.get(t);if(r&&o){let l=r.mask;if(l||(l=Av.obtain(),r.mask=l,this.addChild(l)),!r.maskComputed){let h=r.slot,u=h.attachment;r.maskComputed=!0;const d=u.worldVerticesLength,f=r.vertices;u.computeWorldVertices(h,0,d,f,0,2),l.clear().lineStyle(0).beginFill(0).drawPolygon(f).endFill()}o.container.mask=l}else o!=null&&o.container.mask&&(o.container.mask=null);if(r&&r.slot.attachment.endSlot==t.data&&(this.currentClippingSlot=void 0),i){for(const l in this.clippingSlotToPixiMasks){const h=this.clippingSlotToPixiMasks[l];(!(h.slot.attachment instanceof Wo)||!h.maskComputed)&&h.mask&&(this.removeChild(h.mask),Av.free(h.mask),h.mask=void 0)}this.currentClippingSlot=void 0}}renderMeshes(){var r,o;this.resetMeshes();let t=null,i=null;const n=this.skeleton.drawOrder;for(let a=0,c=n.length,l=0;a>1)*p,x>this.verticesCache.length&&(this.verticesCache=Re.newFloatArray(x)),y.computeWorldVertices(h,0,y.worldVerticesLength,this.verticesCache,0,p),t=y.triangles,i=y.uvs,v=(o=y.region)==null?void 0:o.texture}else if(m instanceof Wo){vt.clipper.clipStart(h,m);continue}else{this.hasMeshForSlot(h)&&(this.getMeshForSlot(h).visible=!1),vt.clipper.clipEndWithSlot(h);continue}if(v!=null){const _=h.bone.skeleton.color,C=h.color,S=_.a*C.a*g.a;this.lightColor.set(_.r*C.r*g.r,_.g*C.g*g.g,_.b*C.b*g.b,S),h.darkColor!=null?this.darkColor.set(h.darkColor.r,h.darkColor.g,h.darkColor.b,1):this.darkColor.set(0,0,0,1);let b,M,I,F;if(vt.clipper.isClipping())vt.clipper.clipTriangles(this.verticesCache,t,t.length,i,this.lightColor,this.darkColor,f),b=vt.clipper.clippedVertices,M=b.length,I=vt.clipper.clippedTriangles,F=I.length;else{const k=this.verticesCache;for(let O=2,D=0,$=x;O<$;O+=p,D+=2){let N=O;k[N++]=this.lightColor.r,k[N++]=this.lightColor.g,k[N++]=this.lightColor.b,k[N++]=this.lightColor.a,k[N++]=i[D],k[N++]=i[D+1],f&&(k[N++]=this.darkColor.r,k[N++]=this.darkColor.g,k[N++]=this.darkColor.b,k[N++]=this.darkColor.a)}b=this.verticesCache,M=x,I=t,F=t.length}if(M==0||F==0){vt.clipper.clipEndWithSlot(h);continue}const E=this.getMeshForSlot(h);E.renderable=!0,E.zIndex=d,E.updateFromSpineData(v,h.data.blendMode,h.data.name,b,M,I,F,f)}vt.clipper.clipEndWithSlot(h)}vt.clipper.clipEnd()}calculateBounds(){if(!this._boundsProvider){super.calculateBounds();return}const t=this.transform;if(this._boundsSpineID===t._worldID)return;this.updateBounds();const i=this._localBounds,n=this._boundsPoint;n.set(i.minX,i.minY),t.worldTransform.apply(n,n),this._bounds.minX=n.x,this._bounds.minY=n.y,n.set(i.maxX,i.maxY),t.worldTransform.apply(n,n),this._bounds.maxX=n.x,this._bounds.maxY=n.y}updateBounds(){if(!this._boundsProvider||!this._boundsSpineDirty)return;this._boundsSpineDirty=!1,this._localBounds||(this._localBounds=new al);const t=this._boundsProvider.calculateBounds(this),i=this._localBounds;i.clear(),i.minX=t.x,i.minY=t.y,i.maxX=t.x+t.width,i.maxY=t.y+t.height,this.hitArea=this._localBounds.getRectangle()}setBonePosition(t,i){const n=t;if(typeof t=="string"&&(t=this.skeleton.findBone(t)),!t)throw Error(`Cannot set bone position, bone ${String(n)} not found`);if(vt.vectorAux.set(i.x,i.y),t.parent){const r=t.parent.worldToLocal(vt.vectorAux);t.x=r.x,t.y=r.y}else t.x=vt.vectorAux.x,t.y=vt.vectorAux.y}getBonePosition(t,i){const n=t;return typeof t=="string"&&(t=this.skeleton.findBone(t)),t?(i||(i={x:0,y:0}),i.x=t.worldX,i.y=t.worldY,i):(console.error(`Cannot get bone position! Bone ${String(n)} not found`),i)}skeletonToPixiWorldCoordinates(t){this.worldTransform.apply(t,t)}pixiWorldCoordinatesToSkeleton(t){this.worldTransform.applyInverse(t,t)}pixiWorldCoordinatesToBone(t,i){this.pixiWorldCoordinatesToSkeleton(t),i.parent?i.parent.worldToLocal(t):i.worldToLocal(t)}static from(t,i,n){if(typeof t=="string")return vt.oldFrom(t,i,n);const{skeleton:r,atlas:o,scale:a=1,darkTint:c,autoUpdate:l,boundsProvider:h,ticker:u}=t,d=`${r}-${o}-${a}`;let f=vt.skeletonCache[d];if(!f){const p=tn.get(r),m=tn.get(o),g=new rm(m);let v=p instanceof Uint8Array?new am(g):new fh(g);v.scale=a,f=v.readSkeletonData(p),vt.skeletonCache[d]=f}return new vt({skeletonData:f,darkTint:c,autoUpdate:l,boundsProvider:h,ticker:u})}static oldFrom(t,i,n){const r=`${t}-${i}-${(n==null?void 0:n.scale)??1}`;let o=vt.skeletonCache[r];if(o)return new vt(o,n);const a=tn.get(t),c=tn.get(i),l=new rm(c);let h=a instanceof Uint8Array?new am(l):new fh(l);return h.scale=(n==null?void 0:n.scale)??1,o=h.readSkeletonData(a),vt.skeletonCache[r]=o,new this(o,n)}get tint(){return this.skeleton.color.toRgb888()}set tint(t){st.rgb888ToColor(this.skeleton.color,t)}};w(vt,"vectorAux",new ch),w(vt,"clipper",new dh),w(vt,"QUAD_TRIANGLES",[0,1,2,2,3,0]),w(vt,"VERTEX_SIZE",8),w(vt,"DARK_VERTEX_SIZE",12),w(vt,"skeletonCache",Object.create(null));let mh=vt;const Av=new lh(()=>new zi);up.yDown=!0;const cc="spineTextureAtlasLoader",pP={extension:Pe.Asset,resolver:{test:s=>Ki(s,".atlas"),parse:s=>{var t,i;const e=s.split(".");return{resolution:parseFloat(((i=(t=ke.RETINA_PREFIX)==null?void 0:t.exec(s))==null?void 0:i[1])??"1"),format:e[e.length-2],src:s}}},loader:{name:cc,extension:{type:Pe.LoadParser,priority:ns.Normal,name:cc},test(s){return Ki(s,".atlas")},async load(s){const e=await ke.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[${cc}] Failed to fetch ${s}: ${e.status} ${e.statusText}`);return await e.text()},testParse(s,e){const t=Ki(e.src,".atlas"),i=typeof s=="string",n=e.loadParser===cc;return Promise.resolve((t||n)&&i)},unload(s){s.dispose()},async parse(s,e,t){var c;const i=e.data||{};let n=Zt.dirname(e.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");const r=new Vb(s);if(i.images instanceof Je||typeof i.images=="string"){const l=i.images;i.images={},i.images[r.pages[0].name]=l}const o=[];let a=!0;for(const l of t.parsers)if(l.name=="loadTextures"){a=(c=l.config)==null?void 0:c.preferCreateImageBitmap;break}tn.setPreferences({preferCreateImageBitmap:!1});for(const l of r.pages){const h=l.name,u=i!=null&&i.images?i.images[h]:void 0;if(u instanceof Je)l.setTexture(so.from(u));else{const d=u??Zt.normalize([...n.split(Zt.sep),h].join(Zt.sep)),f={src:Qc(d,e.src),data:{...i.imageMetadata,alphaMode:l.pma?mi.PMA:mi.UNPACK}},p=t.load(f).then(m=>{l.setTexture(so.from(m.baseTexture))});o.push(p)}}return await Promise.all(o),tn.setPreferences({preferCreateImageBitmap:a}),r}}};Ne.add(pP);const hc="spineSkeletonLoader";function gP(s){return s.hasOwnProperty("bones")}function vP(s){return s instanceof Uint8Array}const yP={extension:Pe.Asset,loader:{name:hc,extension:{type:Pe.LoadParser,priority:ns.Normal,name:hc},test(s){return Ki(s,".skel")},async load(s){const e=await ke.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[${hc}] Failed to fetch ${s}: ${e.status} ${e.statusText}`);return new Uint8Array(await e.arrayBuffer())},testParse(s,e){const t=Ki(e.src,".json")&&gP(s),i=Ki(e.src,".skel")&&vP(s),n=e.loadParser===hc;return Promise.resolve(t||i||n)}}};Ne.add(yP);class xP extends an{constructor(t=!1){super();w(this,"_buffer");w(this,"_indexBuffer");this._buffer=new Ot(void 0,t,!1),this._indexBuffer=new Ot(void 0,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,De.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,De.FLOAT).addAttribute("aColor",this._buffer,4,!0,De.UNSIGNED_BYTE).addAttribute("aDarkColor",this._buffer,4,!0,De.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,De.FLOAT).addIndex(this._indexBuffer)}}const bP=` +`;class fP extends ks{constructor(t){const i={uSampler:t??ze.EMPTY,alpha:1,uTextureMatrix:Bt.IDENTITY,uColor:new Float32Array([1,1,1,1]),uDarkColor:new Float32Array([0,0,0,0])},n={tint:16777215,darkTint:0,alpha:1,pluginName:"darkTintBatch"};super(en.from(uP,dP),i);w(this,"uvMatrix");w(this,"batchable");w(this,"pluginName");w(this,"_tintRGB");w(this,"_darkTintRGB");w(this,"_colorDirty");w(this,"_alpha");w(this,"_tintColor");w(this,"_darkTintColor");this._colorDirty=!1,this.uvMatrix=new Qm(i.uSampler),this.batchable=!0,this.pluginName=n.pluginName,this._tintColor=new St(n.tint),this._darkTintColor=new St(n.darkTint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._darkTintRGB=this._darkTintColor.toLittleEndianNumber(),this._alpha=n.alpha,this._colorDirty=!0}get texture(){return this.uniforms.uSampler}set texture(t){this.uniforms.uSampler!==t&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!t.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=t,this.uvMatrix.texture=t)}set alpha(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(t){t!==this.tint&&(this._tintColor.setValue(t),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}set darkTint(t){t!==this.darkTint&&(this._darkTintColor.setValue(t),this._darkTintRGB=this._darkTintColor.toLittleEndianNumber(),this._colorDirty=!0)}get darkTint(){return this._darkTintColor.value}get tintValue(){return this._tintColor.toNumber()}get darkTintValue(){return this._darkTintColor.toNumber()}update(){this._colorDirty&&(this._colorDirty=!1,St.shared.setValue(this._tintColor).premultiply(this._alpha,!0).toArray(this.uniforms.uColor),St.shared.setValue(this._darkTintColor).premultiply(this._alpha,!0).premultiply(1,!1).toArray(this.uniforms.uDarkColor)),this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}}class mP extends ll{constructor(t){super(new hP,new fP(t),void 0,void 0);w(this,"_darkTintRGB",0)}get darkTint(){return"darkTint"in this.shader?this.shader.darkTint:null}set darkTint(t){this.shader.darkTint=t}get darkTintValue(){return this.shader.darkTintValue}_renderToBatch(t){const i=this.geometry,n=this.shader;n.uvMatrix&&(n.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=i.indexBuffer.data,this._tintRGB=n._tintRGB,this._darkTintRGB=n._darkTintRGB,this._texture=n.texture;const r=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[r]),t.plugins[r].render(this)}}const ri=class ri extends mP{constructor(){super();w(this,"name","")}updateFromSpineData(t,i,n,r,o,a,c,l){var v,x;this.texture=t.texture;const h=o/(l?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((v=u.data)==null?void 0:v.length)!==h&&(u.data=new Float32Array(h));const d=this.geometry.getBuffer("aVertexPosition");((x=d.data)==null?void 0:x.length)!==h&&(d.data=new Float32Array(h));let f=0,p=u.data,m=d.data;for(let y=0;ynew lm);w(this,"beforeUpdateWorldTransforms",()=>{});w(this,"afterUpdateWorldTransforms",()=>{});w(this,"_autoUpdate",!1);w(this,"_ticker",$i.shared);w(this,"meshesCache",new Map);w(this,"lightColor",new st);w(this,"darkColor",new st);w(this,"_boundsProvider");w(this,"_boundsPoint",new pt);w(this,"_boundsSpineID",-1);w(this,"_boundsSpineDirty",!0);w(this,"slotsObject",new Map);w(this,"verticesCache",Re.newFloatArray(1024));w(this,"clippingSlotToPixiMasks",{});w(this,"currentClippingSlot");const n=t instanceof uh?t:t.skeletonData;this.skeleton=new up(n);const r=new bR(n);this.state=new pR(r),(t==null?void 0:t.darkTint)!==void 0||(i==null?void 0:i.slotMeshFactory)===void 0?(this.darkTint=(t==null?void 0:t.darkTint)===void 0?this.skeleton.slots.some(o=>!!o.data.darkColor):t==null?void 0:t.darkTint,this.darkTint&&(this.slotMeshFactory=()=>new Ya)):this.initializeMeshFactory(i==null?void 0:i.slotMeshFactory),t!=null&&t.ticker&&(this._ticker=t.ticker),this.autoUpdate=(t==null?void 0:t.autoUpdate)??!0,this.boundsProvider=t.boundsProvider}get debug(){return this._debug}set debug(t){this._debug&&this._debug.unregisterSpine(this),t&&t.registerSpine(this),this._debug=t}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t&&!this._autoUpdate?this._ticker.add(this.internalUpdate,this):!t&&this._autoUpdate&&this._ticker.remove(this.internalUpdate,this),this._autoUpdate=t}get ticker(){return this._ticker}set ticker(t){t=t??$i.shared,this._ticker!==t&&(this._autoUpdate&&(this._ticker.remove(this.internalUpdate,this),t.add(this.internalUpdate,this)),this._ticker=t)}get boundsProvider(){return this._boundsProvider}set boundsProvider(t){this._boundsProvider=t,t?(this._boundsSpineID=-1,this._boundsSpineDirty=!0,this.interactiveChildren=!1):(this.interactiveChildren=!0,this.hitArea=null),this.hasNeverUpdated||this.calculateBounds()}initializeMeshFactory(t){if(t){this.slotMeshFactory=t;const i=this.slotMeshFactory();i instanceof Ya&&(this.darkTint=!0),i.destroy()}else for(let i=0;inew Ya,this.darkTint=!0;break}}update(t){this.internalUpdate(0,t)}internalUpdate(t,i){this.hasNeverUpdated=!1;const n=i??this._ticker.deltaMS/1e3;this.state.update(n),this.state.apply(this.skeleton),this.beforeUpdateWorldTransforms(this),this.skeleton.update(n),this.skeleton.updateWorldTransform(ir.update),this.afterUpdateWorldTransforms(this)}updateTransform(){var t;this.renderMeshes(),this.sortChildren(),(t=this.debug)==null||t.renderDebug(this),super.updateTransform()}destroy(t){var i;this.autoUpdate&&(this.autoUpdate=!1),this._ticker=null;for(const[,n]of this.meshesCache)n==null||n.destroy();this.state.clearListeners(),this.debug=void 0,this.meshesCache.clear(),this.slotsObject.clear();for(let n in this.clippingSlotToPixiMasks)(i=this.clippingSlotToPixiMasks[n].mask)==null||i.destroy(),delete this.clippingSlotToPixiMasks[n];super.destroy(t)}resetMeshes(){for(const[,t]of this.meshesCache)t.zIndex=-1,t.visible=!1}_calculateBounds(){this.hasNeverUpdated&&(this.internalUpdate(0,0),this.renderMeshes())}hasMeshForSlot(t){return this.meshesCache.has(t)}getMeshForSlot(t){if(this.hasMeshForSlot(t)){let i=this.meshesCache.get(t);return i.visible=!0,i}else{let i=this.slotMeshFactory();return this.addChild(i),this.meshesCache.set(t,i),i}}getSlotFromRef(t){let i;if(typeof t=="number"?i=this.skeleton.slots[t]:typeof t=="string"?i=this.skeleton.findSlot(t):i=t,!i)throw new Error(`No slot found with the given slot reference: ${t}`);return i}addSlotObject(t,i,n){var a;let r=this.getSlotFromRef(t);const o=(a=this.slotsObject.get(r))==null?void 0:a.container;if(!(o&&o===i)){for(const[c,{container:l}]of this.slotsObject)if(c!==r&&l===i){this.removeSlotObject(c,i);break}o&&this.removeChild(o),this.slotsObject.set(r,{container:i,followAttachmentTimeline:(n==null?void 0:n.followAttachmentTimeline)||!1,followSlotColor:(n==null?void 0:n.followSlotColor)||!1}),this.addChild(i)}}getSlotObject(t){const i=this.slotsObject.get(this.getSlotFromRef(t));return i?i.container:void 0}removeSlotObject(t,i){var o;let n=this.getSlotFromRef(t),r=(o=this.slotsObject.get(n))==null?void 0:o.container;r&&(i&&i!==r||(this.removeChild(r),this.slotsObject.delete(n)))}removeSlotObjects(){for(const[,t]of this.slotsObject)t.container.removeFromParent();this.slotsObject.clear()}updateSlotObject(t,i,n){const{container:r,followAttachmentTimeline:o}=t,a=o?!!i.attachment:!0;if(r.visible=this.skeleton.drawOrder.includes(i)&&a,r.visible){let c=i.bone;const l=r.localTransform;l.a=c.a,l.b=c.c,l.c=-c.b,l.d=-c.d,l.tx=c.worldX,l.ty=c.worldY,r.transform.setFromMatrix(l),r.zIndex=n,r.alpha=this.skeleton.color.a*i.color.a,t.followSlotColor&&this.setSlotObjectTint(r,255*this.skeleton.color.r*i.color.r<<16|255*this.skeleton.color.g*i.color.g<<8|255*this.skeleton.color.b*i.color.b)}}setSlotObjectTint(t,i){const n=t;"tint"in n&&(n.tint=i);for(const r of n.children??[])this.setSlotObjectTint(r,i)}updateAndSetPixiMask(t,i){var a,c;const n=t.attachment;if(n&&n instanceof Wo){const l=(a=this.clippingSlotToPixiMasks)[c=t.data.name]||(a[c]={slot:t,vertices:new Array});l.maskComputed=!1,this.currentClippingSlot=l;return}let r=this.currentClippingSlot;const o=this.slotsObject.get(t);if(r&&o){let l=r.mask;if(l||(l=Av.obtain(),r.mask=l,this.addChild(l)),!r.maskComputed){let h=r.slot,u=h.attachment;r.maskComputed=!0;const d=u.worldVerticesLength,f=r.vertices;u.computeWorldVertices(h,0,d,f,0,2),l.clear().lineStyle(0).beginFill(0).drawPolygon(f).endFill()}o.container.mask=l}else o!=null&&o.container.mask&&(o.container.mask=null);if(r&&r.slot.attachment.endSlot==t.data&&(this.currentClippingSlot=void 0),i){for(const l in this.clippingSlotToPixiMasks){const h=this.clippingSlotToPixiMasks[l];(!(h.slot.attachment instanceof Wo)||!h.maskComputed)&&h.mask&&(this.removeChild(h.mask),Av.free(h.mask),h.mask=void 0)}this.currentClippingSlot=void 0}}renderMeshes(){var r,o;this.resetMeshes();let t=null,i=null;const n=this.skeleton.drawOrder;for(let a=0,c=n.length,l=0;a>1)*p,x>this.verticesCache.length&&(this.verticesCache=Re.newFloatArray(x)),y.computeWorldVertices(h,0,y.worldVerticesLength,this.verticesCache,0,p),t=y.triangles,i=y.uvs,v=(o=y.region)==null?void 0:o.texture}else if(m instanceof Wo){vt.clipper.clipStart(h,m);continue}else{this.hasMeshForSlot(h)&&(this.getMeshForSlot(h).visible=!1),vt.clipper.clipEndWithSlot(h);continue}if(v!=null){const _=h.bone.skeleton.color,C=h.color,S=_.a*C.a*g.a;this.lightColor.set(_.r*C.r*g.r,_.g*C.g*g.g,_.b*C.b*g.b,S),h.darkColor!=null?this.darkColor.set(h.darkColor.r,h.darkColor.g,h.darkColor.b,1):this.darkColor.set(0,0,0,1);let b,M,I,F;if(vt.clipper.isClipping())vt.clipper.clipTriangles(this.verticesCache,t,t.length,i,this.lightColor,this.darkColor,f),b=vt.clipper.clippedVertices,M=b.length,I=vt.clipper.clippedTriangles,F=I.length;else{const k=this.verticesCache;for(let O=2,D=0,$=x;O<$;O+=p,D+=2){let N=O;k[N++]=this.lightColor.r,k[N++]=this.lightColor.g,k[N++]=this.lightColor.b,k[N++]=this.lightColor.a,k[N++]=i[D],k[N++]=i[D+1],f&&(k[N++]=this.darkColor.r,k[N++]=this.darkColor.g,k[N++]=this.darkColor.b,k[N++]=this.darkColor.a)}b=this.verticesCache,M=x,I=t,F=t.length}if(M==0||F==0){vt.clipper.clipEndWithSlot(h);continue}const E=this.getMeshForSlot(h);E.renderable=!0,E.zIndex=d,E.updateFromSpineData(v,h.data.blendMode,h.data.name,b,M,I,F,f)}vt.clipper.clipEndWithSlot(h)}vt.clipper.clipEnd()}calculateBounds(){if(!this._boundsProvider){super.calculateBounds();return}const t=this.transform;if(this._boundsSpineID===t._worldID)return;this.updateBounds();const i=this._localBounds,n=this._boundsPoint;n.set(i.minX,i.minY),t.worldTransform.apply(n,n),this._bounds.minX=n.x,this._bounds.minY=n.y,n.set(i.maxX,i.maxY),t.worldTransform.apply(n,n),this._bounds.maxX=n.x,this._bounds.maxY=n.y}updateBounds(){if(!this._boundsProvider||!this._boundsSpineDirty)return;this._boundsSpineDirty=!1,this._localBounds||(this._localBounds=new al);const t=this._boundsProvider.calculateBounds(this),i=this._localBounds;i.clear(),i.minX=t.x,i.minY=t.y,i.maxX=t.x+t.width,i.maxY=t.y+t.height,this.hitArea=this._localBounds.getRectangle()}setBonePosition(t,i){const n=t;if(typeof t=="string"&&(t=this.skeleton.findBone(t)),!t)throw Error(`Cannot set bone position, bone ${String(n)} not found`);if(vt.vectorAux.set(i.x,i.y),t.parent){const r=t.parent.worldToLocal(vt.vectorAux);t.x=r.x,t.y=r.y}else t.x=vt.vectorAux.x,t.y=vt.vectorAux.y}getBonePosition(t,i){const n=t;return typeof t=="string"&&(t=this.skeleton.findBone(t)),t?(i||(i={x:0,y:0}),i.x=t.worldX,i.y=t.worldY,i):(console.error(`Cannot get bone position! Bone ${String(n)} not found`),i)}skeletonToPixiWorldCoordinates(t){this.worldTransform.apply(t,t)}pixiWorldCoordinatesToSkeleton(t){this.worldTransform.applyInverse(t,t)}pixiWorldCoordinatesToBone(t,i){this.pixiWorldCoordinatesToSkeleton(t),i.parent?i.parent.worldToLocal(t):i.worldToLocal(t)}static from(t,i,n){if(typeof t=="string")return vt.oldFrom(t,i,n);const{skeleton:r,atlas:o,scale:a=1,darkTint:c,autoUpdate:l,boundsProvider:h,ticker:u}=t,d=`${r}-${o}-${a}`;let f=vt.skeletonCache[d];if(!f){const p=tn.get(r),m=tn.get(o),g=new rm(m);let v=p instanceof Uint8Array?new am(g):new fh(g);v.scale=a,f=v.readSkeletonData(p),vt.skeletonCache[d]=f}return new vt({skeletonData:f,darkTint:c,autoUpdate:l,boundsProvider:h,ticker:u})}static oldFrom(t,i,n){const r=`${t}-${i}-${(n==null?void 0:n.scale)??1}`;let o=vt.skeletonCache[r];if(o)return new vt(o,n);const a=tn.get(t),c=tn.get(i),l=new rm(c);let h=a instanceof Uint8Array?new am(l):new fh(l);return h.scale=(n==null?void 0:n.scale)??1,o=h.readSkeletonData(a),vt.skeletonCache[r]=o,new this(o,n)}get tint(){return this.skeleton.color.toRgb888()}set tint(t){st.rgb888ToColor(this.skeleton.color,t)}};w(vt,"vectorAux",new ch),w(vt,"clipper",new dh),w(vt,"QUAD_TRIANGLES",[0,1,2,2,3,0]),w(vt,"VERTEX_SIZE",8),w(vt,"DARK_VERTEX_SIZE",12),w(vt,"skeletonCache",Object.create(null));let mh=vt;const Av=new lh(()=>new zi);up.yDown=!0;const cc="spineTextureAtlasLoader",pP={extension:Pe.Asset,resolver:{test:s=>Ki(s,".atlas"),parse:s=>{var t,i;const e=s.split(".");return{resolution:parseFloat(((i=(t=ke.RETINA_PREFIX)==null?void 0:t.exec(s))==null?void 0:i[1])??"1"),format:e[e.length-2],src:s}}},loader:{name:cc,extension:{type:Pe.LoadParser,priority:ns.Normal,name:cc},test(s){return Ki(s,".atlas")},async load(s){const e=await ke.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[${cc}] Failed to fetch ${s}: ${e.status} ${e.statusText}`);return await e.text()},testParse(s,e){const t=Ki(e.src,".atlas"),i=typeof s=="string",n=e.loadParser===cc;return Promise.resolve((t||n)&&i)},unload(s){s.dispose()},async parse(s,e,t){var c;const i=e.data||{};let n=Zt.dirname(e.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");const r=new V1(s);if(i.images instanceof Je||typeof i.images=="string"){const l=i.images;i.images={},i.images[r.pages[0].name]=l}const o=[];let a=!0;for(const l of t.parsers)if(l.name=="loadTextures"){a=(c=l.config)==null?void 0:c.preferCreateImageBitmap;break}tn.setPreferences({preferCreateImageBitmap:!1});for(const l of r.pages){const h=l.name,u=i!=null&&i.images?i.images[h]:void 0;if(u instanceof Je)l.setTexture(so.from(u));else{const d=u??Zt.normalize([...n.split(Zt.sep),h].join(Zt.sep)),f={src:Qc(d,e.src),data:{...i.imageMetadata,alphaMode:l.pma?mi.PMA:mi.UNPACK}},p=t.load(f).then(m=>{l.setTexture(so.from(m.baseTexture))});o.push(p)}}return await Promise.all(o),tn.setPreferences({preferCreateImageBitmap:a}),r}}};Ne.add(pP);const hc="spineSkeletonLoader";function gP(s){return s.hasOwnProperty("bones")}function vP(s){return s instanceof Uint8Array}const yP={extension:Pe.Asset,loader:{name:hc,extension:{type:Pe.LoadParser,priority:ns.Normal,name:hc},test(s){return Ki(s,".skel")},async load(s){const e=await ke.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[${hc}] Failed to fetch ${s}: ${e.status} ${e.statusText}`);return new Uint8Array(await e.arrayBuffer())},testParse(s,e){const t=Ki(e.src,".json")&&gP(s),i=Ki(e.src,".skel")&&vP(s),n=e.loadParser===hc;return Promise.resolve(t||i||n)}}};Ne.add(yP);class xP extends an{constructor(t=!1){super();w(this,"_buffer");w(this,"_indexBuffer");this._buffer=new Ot(void 0,t,!1),this._indexBuffer=new Ot(void 0,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,De.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,De.FLOAT).addAttribute("aColor",this._buffer,4,!0,De.UNSIGNED_BYTE).addAttribute("aDarkColor",this._buffer,4,!0,De.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,De.FLOAT).addIndex(this._indexBuffer)}}const bP=` precision highp float; attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; @@ -1236,4 +1236,4 @@ void main(void){ gl_FragColor.a = color.a * vColor.a; gl_FragColor.rgb = ((color.a - 1.0) * vDarkColor.a + 1.0 - color.rgb) * vDarkColor.rgb + color.rgb * vColor.rgb; } -`;class tw extends Kn{constructor(e){super(e),this.shaderGenerator=new Hx(bP,wP),this.geometryClass=xP,this.vertexSize=7}packInterleavedGeometry(e,t,i,n,r){const{uint32View:o,float32View:a}=t,c=n/this.vertexSize,l=e.uvs,h=e.indices,u=e.vertexData,d=e._texture.baseTexture._batchLocation,f=Math.min(e.worldAlpha,1),p=St.shared.setValue(e._tintRGB).toPremultiplied(f,!0),m=St.shared.setValue(e._darkTintRGB).premultiply(f,!0).toPremultiplied(1,!1);for(let g=0;g0){let o=function(l){return Promise.all(l.map(h=>Promise.resolve(h).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));n=o(t.map(l=>{if(l=CP(l),l in Ev)return;Ev[l]=!0;const h=l.endsWith(".css"),u=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=h?"stylesheet":MP,h||(d.as="script"),d.crossOrigin="",d.href=l,c&&d.setAttribute("nonce",c),document.head.appendChild(d),h)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return n.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};async function sw(){const[s,e]=await Promise.all([Iv(()=>import("./index-Btg_SCRJ.js"),[]),Iv(()=>import("./index-De2_H8wT.js"),__vite__mapDeps([0,1]))]);return{core:s,pixi:e}}async function AP(s,e,t){const{core:i,pixi:n}=await sw(),r=new i.TextureAtlas(e);return dp(r,t,n.SpineTexture),{skeletonData:new i.SkeletonJson(new i.AtlasAttachmentLoader(r)).readSkeletonData(s),SpineClass:n.Spine}}async function EP(s,e,t){const{core:i,pixi:n}=await sw(),r=new i.TextureAtlas(e);return dp(r,t,n.SpineTexture),{skeletonData:new i.SkeletonBinary(new i.AtlasAttachmentLoader(r)).readSkeletonData(s),SpineClass:n.Spine}}function sr(s,e,t){const i=Number(s[e]);return Number.isFinite(i)?i:t}function qi(s,e,t,i){s[e]==null&&(s[e]=sr(s,t,i))}function fp(s,e,t){if(typeof s.curve!="number")return;const i=sr(s,"time",0),r=sr(e,"time",0)-i,o=s.curve,a=sr(s,"c2",0),c=sr(s,"c3",1),l=sr(s,"c4",1);s.curve=t.flatMap(([h,u])=>[i+r*o,h+(u-h)*a,i+r*c,h+(u-h)*l]),delete s.c2,delete s.c3,delete s.c4}function hr(s,e){if(Array.isArray(s))for(let t=0;t[sr(i,r,o),sr(n,r,o)]))}}function IP(s){if(Array.isArray(s))for(let e=0;eNumber.parseInt(i.slice(r,r+2),16)/255);return e?n:n.slice(0,3)}function Rv(s,e){if(Array.isArray(s))for(let t=0;t[a,o[c]]))}}function RP(s){for(const e of s.bones||[])e.inherit==null&&e.transform!=null&&(e.inherit=e.transform);for(const e of s.transform||[])qi(e,"mixRotate","rotateMix",1),qi(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX),qi(e,"mixScaleX","scaleMix",1),e.mixScaleY==null&&(e.mixScaleY=e.mixScaleX),qi(e,"mixShearY","shearMix",1);for(const e of s.path||[])qi(e,"mixRotate","rotateMix",1),qi(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX)}function PP(s){for(const e of s.skins||[])for(const t of Object.values(e.attachments||{}))for(const i of Object.values(t||{}))i.parent!=null&&i.timelines==null&&i.deform!=null&&(i.timelines=i.deform)}function kP(s){for(const e of Object.values(s.slots||{}))e.color&&!e.rgba&&(e.rgba=e.color,delete e.color),e.twoColor&&!e.rgba2&&(e.rgba2=e.twoColor,delete e.twoColor),Rv(e.rgba,!1),Rv(e.rgba2,!0)}function FP(s){for(const e of Object.values(s.bones||{})){for(const t of e.rotate||[])qi(t,"value","angle",0);hr(e.rotate,[{key:"value",fallback:0}]),hr(e.translate,[{key:"x",fallback:0},{key:"y",fallback:0}]),hr(e.scale,[{key:"x",fallback:1},{key:"y",fallback:1}]),hr(e.shear,[{key:"x",fallback:0},{key:"y",fallback:0}])}}function OP(s){for(const e of Object.values(s.ik||{}))hr(e,[{key:"mix",fallback:1},{key:"softness",fallback:0}])}function BP(s){for(const e of Object.values(s.transform||{})){for(const t of e)qi(t,"mixRotate","rotateMix",1),qi(t,"mixX","translateMix",1),t.mixY==null&&(t.mixY=t.mixX),qi(t,"mixScaleX","scaleMix",1),t.mixScaleY==null&&(t.mixScaleY=t.mixScaleX),qi(t,"mixShearY","shearMix",1);hr(e,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1},{key:"mixScaleX",fallback:1},{key:"mixScaleY",fallback:1},{key:"mixShearY",fallback:1}])}}function LP(s){for(const e of Object.values(s.path||{})){for(const i of["position","spacing"]){const n=e[i];for(const r of n||[])qi(r,"value",i,0);hr(n,[{key:"value",fallback:0}])}const t=e.mix;for(const i of t||[])qi(i,"mixRotate","rotateMix",1),qi(i,"mixX","translateMix",1),i.mixY==null&&(i.mixY=i.mixX);hr(t,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1}])}}function DP(s){if(!s.deform)return;const e=s.attachments||(s.attachments={});for(const[t,i]of Object.entries(s.deform)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(i)){const a=n[r]||(n[r]={});for(const[c,l]of Object.entries(o)){const h=a[c]||(a[c]={});h.deform=l,IP(l)}}}delete s.deform}function nw(s){RP(s),PP(s);for(const e of Object.values(s.animations||{}))kP(e),FP(e),OP(e),BP(e),LP(e),DP(e),!e.drawOrder&&e.draworder&&(e.drawOrder=e.draworder);return s}function NP(s){return s.replace(/\\/g,"/").split("/").pop()||s}async function UP(s){const e=await Promise.all(s.map(async t=>{const i=URL.createObjectURL(t);try{return[NP(t.name).toLowerCase(),await ze.fromURL(i)]}finally{URL.revokeObjectURL(i)}}));return new Map(e)}function $P(s){const e=new Map;return s.bones.map(t=>{var r;const i=((r=t.parent)==null?void 0:r.name)||null,n=i?(e.get(i)||0)+1:0;return e.set(t.name,n),{name:t.name,parent:i,depth:n}})}async function rw(s,e,t){var o;if(!/\.(json|skel)$/i.test(s.name))throw new Error("Spine 数据仅支持 .json 或 .skel");if(!/\.atlas$/i.test(e.name))throw new Error("图集文件仅支持 .atlas");if(!t.length)throw new Error("请至少选择一张纹理图片");const i=await e.text(),n=await UP(t),r=[...n.values()];try{let a,c,l=null,h;if(/\.skel$/i.test(s.name)){const u=await s.arrayBuffer();try{({skeletonData:a,SpineClass:c}=await EP(u,i,n)),h="4.3"}catch(d){try{({skeletonData:a,SpineClass:c}=TP(u,i,n)),h="4.2"}catch(f){const p=d instanceof Error?d.message:String(d),m=f instanceof Error?f.message:String(f);throw new Error(`Spine 二进制解析失败(4.3:${p};旧版:${m})`)}}l=ah(a.version)}else{let u;try{u=JSON.parse(await s.text())}catch{throw new Error("Spine JSON 文件格式无效")}if(l=ah((o=u==null?void 0:u.skeleton)==null?void 0:o.spine),!l)throw new Error(`Spine JSON 版本不受支持,仅支持 ${im()}`);h=VI(l),l==="3.8"&&nw(u);const d=h==="4.3"?await AP(u,i,n):_P(u,i,n);a=d.skeletonData,c=d.SpineClass}if(!l)throw new Error(`Spine 数据版本不受支持,仅支持 ${im()}`);return{skeletonData:a,textures:r,runtimeVersion:h,SpineClass:c,dataVersion:l,animations:a.animations.map(u=>({name:u.name,duration:u.duration})),bones:$P(a)}}catch(a){for(const c of r)c.destroy(!0);throw a}}function Ic(s){return new Promise((e,t)=>{const i=new FileReader;i.onload=()=>e(String(i.result||"")),i.onerror=()=>t(i.error),i.readAsDataURL(s)})}async function XP(s,e,t){return{skeleton:{name:s.name,dataUrl:await Ic(s)},atlas:{name:e.name,dataUrl:await Ic(e)},textures:await Promise.all(t.map(async i=>({name:i.name,dataUrl:await Ic(i)})))}}async function tf(s){const e=await fetch(s.dataUrl);if(!e.ok)throw new Error(`无法读取内嵌 Spine 文件:${s.name}`);return new File([await e.blob()],s.name)}async function VP(s){return{skeleton:await tf(s.skeleton),atlas:await tf(s.atlas),textures:await Promise.all(s.textures.map(tf))}}const ow="SpineParticle.EditorConfig",aw=1;function lw(s){return{backgroundX:s.backgroundX,backgroundY:s.backgroundY,backgroundOpacity:s.backgroundOpacity,backgroundImageName:s.backgroundImageName,backgroundImageData:s.backgroundImageData,showGrid:s.showGrid,exportSettings:Nt(s.exportSettings)}}function YP(s){return JSON.parse(JSON.stringify(s,(e,t)=>{if(!(e==="texture"||e==="trailTexture"||e==="frames"))return t}))}function cw(s){const e=Nt(s);return delete e.tags,delete e.selectedTag,e}function GP(s){const e=lw(s.settings);return YP({format:ow,version:aw,savedAt:new Date().toISOString(),editor:Nt(s.editor),settings:e,timeline:{fps:s.timeline.fps,loop:s.timeline.loop,playbackStart:s.timeline.playbackStart,playbackEnd:s.timeline.playbackEnd,animations:[...s.timeline.animations]},selection:{type:s.activeObjectType,id:s.activeObjectId},scene:{systems:s.systems.map(t=>({...Nt(t),frames:void 0})),colliders:s.colliders.map(cw),paths:Nt(s.paths),spines:Nt(s.spines)}})}function HP(){return`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.json`}function hw(s){const e=GP(s),t=new Blob([JSON.stringify(e,null,2)],{type:"application/json;charset=utf-8"}),i=URL.createObjectURL(t),n=document.createElement("a");return n.href=i,n.download=HP(),document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),0),e}function uw(s){let e;try{e=JSON.parse(s)}catch{throw new Error("配置文件不是有效的 JSON")}const t=e;if(t.format!==ow)throw new Error("不是 SpineParticle 编辑器配置文件");if(t.version!==aw)throw new Error(`暂不支持配置版本:${t.version??"未知"}`);if(!t.scene||!Array.isArray(t.scene.systems)||!Array.isArray(t.scene.colliders)||!Array.isArray(t.scene.paths)||!Array.isArray(t.scene.spines))throw new Error("配置文件缺少完整场景数据");return t}async function jP(s){const e=new Map,t=n=>{const r=n==="/particles/star.png"?"/images/star.png":n==="/trails/trail.png"?"/images/trail.png":n||"/images/star.png";let o=e.get(r);return o||(o=ze.fromURL(r).then(a=>nr(a)),e.set(r,o)),o},i=await t("/images/star.png");await Promise.all(s.map(async n=>{var o;const r=pr(n.config);r.texture=i,await Promise.all(r.imageResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/star.png"),await Promise.all(a.sequenceFrames.map(async c=>{c.texture=await t(c.previewUrl||a.previewUrl||"/images/star.png")}))})),await Promise.all(r.trailResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/trail.png")})),r.trailTexture=((o=r.trailResources[0])==null?void 0:o.texture)||null,n.frames=[]}))}async function WP(s){const e=new Map;try{for(const t of s){if(!t.sourceBundle)continue;const i=await VP(t.sourceBundle);e.set(t.id,await rw(i.skeleton,i.atlas,i.textures))}return e}catch(t){for(const i of e.values())for(const n of i.textures)n.destroy(!0);throw t}}function zP(s,e){const t=(e==null?void 0:e.type)||"particle",i=Number(e==null?void 0:e.id)||0;(t==="particle"?s.systems.some(r=>r.id===i):t==="collision"?s.colliders.some(r=>r.id===i):t==="path"?s.paths.some(r=>r.id===i):s.spines.some(r=>r.id===i))?s.selectSceneObject(t,i):s.systems[0]?s.selectSceneObject("particle",s.systems[0].id):s.colliders[0]?s.selectSceneObject("collision",s.colliders[0].id):s.paths[0]?s.selectSceneObject("path",s.paths[0].id):s.spines[0]?s.selectSceneObject("spine",s.spines[0].id):(s.activeObjectType="particle",s.activeObjectId=0,s.activeId=0)}async function qP(s,e){var h,u,d,f,p,m,g;const t=uw(JSON.stringify(e)),i=Nt(t.scene.systems),n=t.scene.colliders.map(cw),r=Nt(t.scene.paths),o=Nt(t.scene.spines);for(const v of o)v.sourceBundle==null&&(v.sourceBundle=null),v.dataVersion==null&&(v.dataVersion="");await jP(i);const a=await WP(o),c=new Map(s.spines.map(v=>[v.id,v.assetVersion]));for(const v of s.spines)wl(v.id);s.systems=i,s.colliders=n,s.paths=r,s.spines=o,Object.assign(s.editor,Nt(t.editor||{}));const l=t.settings;if(l)for(const v of["backgroundX","backgroundY","backgroundOpacity","backgroundImageName","backgroundImageData","showGrid"])Object.prototype.hasOwnProperty.call(l,v)&&(s.settings[v]=l[v]);s.settings.exportSettings=Q1((h=t.settings)==null?void 0:h.exportSettings),s.settings.undoLimit=Math.min(200,Math.max(1,Math.round(Number(s.settings.undoLimit)||20))),s.timeline.fps=Math.max(1,Math.round(Number((u=t.timeline)==null?void 0:u.fps)||30)),s.timeline.loop=((d=t.timeline)==null?void 0:d.loop)!==!1,s.timeline.animations=Array.isArray((f=t.timeline)==null?void 0:f.animations)&&t.timeline.animations.length?[...new Set(t.timeline.animations.filter(v=>typeof v=="string"&&v.trim()).map(v=>v.trim()))]:["animation"];for(const v of s.spines){const x=a.get(v.id);if(v.assetVersion=Math.max(Number(v.assetVersion)||0,c.get(v.id)||0)+1,!x){v.status="empty",v.error=v.skeletonFileName?"配置未包含可复用的 Spine 原始资源":"",v.animations=[],v.bones=[],v.selectedAnimation="";continue}nu(v.id,x),v.dataVersion=x.dataVersion,v.animations=x.animations,v.bones=x.bones,x.animations.some(y=>y.name===v.selectedAnimation)||(v.selectedAnimation=((p=x.animations[0])==null?void 0:p.name)||""),v.status="ready",v.error=""}s.syncSceneSequences(),zP(s,t.selection),s.timeline.playbackStart=Math.max(0,Math.floor(Number((m=t.timeline)==null?void 0:m.playbackStart)||0)),s.timeline.playbackEnd=Math.max(1,Math.floor(Number((g=t.timeline)==null?void 0:g.playbackEnd)||Number.MAX_SAFE_INTEGER)),s.timeline.frame=0,s.timeline.recorded=!1,s.timeline.playing=!0;for(const v of s.systems)s.timeline.animations.includes(v.animation)||(v.animation=s.timeline.animations[0]);return s.recalcTotalFrames(),s.timeline.frame=s.timeline.playbackStart,t}async function dw(s,e){return qP(s,uw(e))}async function KP(s,e){if(!/\.json$/i.test(e.name))throw new Error("请选择 .json 配置文件");return dw(s,await e.text())}const au=no({undoCount:0});let ph=null,Cn=null,ur=[],Ta=null,An=null,gh=!1;function mp(s){return{systems:s.systems.map(t=>{const i=Nt(t);return i.frames=void 0,i}),colliders:Nt(s.colliders),paths:Nt(s.paths),spines:Nt(s.spines),animations:[...s.timeline.animations],settings:lw(s.settings)}}function pp(s){return JSON.stringify(s,(e,t)=>e==="texture"||e==="trailTexture"?null:typeof t=="string"&&t.startsWith("data:")&&t.length>256?`${t.length}:${t.slice(0,96)}:${t.slice(-48)}`:t)}function fw(s,e=mp(s),t=pp(e)){const i=new Map;for(const n of e.spines){const r=$I(n.id);r&&i.set(n.id,r)}return{data:e,signature:t,spineAssets:i}}function vh(s){if(s){for(const e of s.spineAssets.values())NI(e);s.spineAssets.clear()}}function mw(s){for(;ur.length>s;)vh(ur.shift()||null);au.undoCount=ur.length}function pw(){const s=ph;if(!s||!Cn||gh)return;const e=mp(s),t=pp(e);t!==Cn.signature&&(ur.push(Cn),Cn=fw(s,e,t),mw(s.settings.undoLimit))}function ZP(){gh||(An&&clearTimeout(An),An=setTimeout(()=>{An=null,pw()},250))}function JP(s){const e=s.activeObjectId;return s.activeObjectType==="particle"?s.systems.some(t=>t.id===e):s.activeObjectType==="collision"?s.colliders.some(t=>t.id===e):s.activeObjectType==="path"?s.paths.some(t=>t.id===e):s.spines.some(t=>t.id===e)}function QP(s){var t,i;if(!JP(s)){const n=s.systems[0],r=s.colliders[0],o=s.paths[0],a=s.spines[0];n?(s.activeObjectType="particle",s.activeObjectId=n.id):r?(s.activeObjectType="collision",s.activeObjectId=r.id):o?(s.activeObjectType="path",s.activeObjectId=o.id):(s.activeObjectType="spine",s.activeObjectId=(a==null?void 0:a.id)||0)}const e=s.activeObjectType==="particle"?s.systems.find(n=>n.id===s.activeObjectId):s.systems.find(n=>n.id===s.activeId);s.activeId=(e==null?void 0:e.id)||((t=s.systems[0])==null?void 0:t.id)||0,s.timeline.animation=(e==null?void 0:e.animation)||((i=s.systems[0])==null?void 0:i.animation)||s.timeline.animations[0]||"animation"}function ek(s,e){const t=Cn;gh=!0;try{for(const i of s.spines)wl(i.id);s.systems=Nt(e.data.systems),s.colliders=Nt(e.data.colliders),s.paths=Nt(e.data.paths),s.spines=Nt(e.data.spines),s.timeline.animations=[...e.data.animations],Object.assign(s.settings,Nt(e.data.settings));for(const[i,n]of e.spineAssets)nu(i,n);for(const i of s.systems)i.frames=[];s.timeline.recorded=!1,s.timeline.playing=!1,QP(s),s.recalcTotalFrames(),Cn=e}finally{gh=!1,vh(t)}}function tk(s){if(!(ph===s&&Ta)){Ta==null||Ta(),An&&clearTimeout(An),vh(Cn);for(const e of ur)vh(e);ur=[],ph=s,Cn=fw(s),au.undoCount=0,Ta=Xi(()=>pp(mp(s)),ZP,{flush:"post"})}}function ik(s,e){const t=Math.min(200,Math.max(1,Math.round(Number(e)||20)));s.settings.undoLimit=t,mw(t)}function gw(){const s=ph;if(!s||!Cn)return!1;An&&(clearTimeout(An),An=null),pw();const e=ur.pop();return e?(ek(s,e),au.undoCount=ur.length,!0):!1}function sk(s){const e=s instanceof HTMLElement?s:null;return!!(e!=null&&e.closest('input, textarea, select, [contenteditable="true"]'))}function nk(s){function e(i){var r;const n=i.target instanceof Node?i.target:null;s.canvasFocused.value=!!n&&!!((r=s.canvasElement.value)!=null&&r.contains(n))}function t(i){const n=i.key.toLowerCase();if((i.ctrlKey||i.metaKey)&&!i.altKey&&n==="s"){i.preventDefault(),i.stopPropagation(),s.save();return}if((i.ctrlKey||i.metaKey)&&!i.altKey&&n==="z"){i.preventDefault(),i.stopPropagation(),s.undo();return}if(i.ctrlKey||i.metaKey||i.altKey||sk(i.target))return;if(n==="d"){i.preventDefault(),s.togglePlay();return}if(n==="s"){i.preventDefault(),s.toStart();return}if(!s.canvasFocused.value)return;const r={q:"",w:"translate",e:"rotate",r:"scale"};n in r&&(i.preventDefault(),s.setTool(r[n]))}Vn(()=>{document.addEventListener("pointerdown",e,!0),window.addEventListener("keydown",t,!0)}),gl(()=>{document.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",t,!0)})}const rk={class:"help-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"help-title"},ok={class:"help-body"},ak=["aria-expanded"],lk={class:"caret"},ck={class:"help-module-body"},hk=["aria-expanded"],uk={class:"caret"},dk={class:"help-module-body"},fk=["aria-expanded"],mk={class:"caret"},pk={class:"help-module-body"},gk=["aria-expanded"],vk={class:"caret"},yk={class:"help-module-body"},xk=["aria-expanded"],bk={class:"caret"},wk={class:"help-module-body"},Sk=["aria-expanded"],_k={class:"caret"},Tk={class:"help-module-body"},Mk=["aria-expanded"],Ck={class:"caret"},Ak={class:"help-module-body"},Ek=["aria-expanded"],Ik={class:"caret"},Rk={class:"help-module-body"},Pk=["aria-expanded"],kk={class:"caret"},Fk={class:"help-module-body"},Ok=Jt({__name:"HelpDialog",props:{show:{type:Boolean}},emits:["close"],setup(s,{emit:e}){const t=e,i=Ge(Array.from({length:9},()=>!1));function n(){t("close")}function r(o){o.key==="Escape"&&n()}return Vn(()=>window.addEventListener("keydown",r)),pl(()=>window.removeEventListener("keydown",r)),(o,a)=>s.show?(K(),Q("div",{key:0,class:"help-overlay",role:"presentation",onClick:et(n,["self"])},[T("section",rk,[T("header",{class:"help-head"},[a[9]||(a[9]=T("div",null,[T("h2",{id:"help-title"},"使用说明"),T("p",null,"从创建粒子到保存、导出的快速入门")],-1)),T("button",{class:"help-close","aria-label":"关闭使用说明",title:"关闭 (Esc)",onClick:n},"✕")]),T("div",ok,[a[37]||(a[37]=es('

快速开始

  1. 创建对象:在左侧“场景对象”中用 +粒子 / +碰撞 / +路径 / +Spine 添加场景对象。
  2. 编辑粒子:选中某个粒子系统,依次调整“发射模式 → 发射器形状 → 粒子属性 → 外观与资源 → 修改器”。
  3. 查看效果:底部时间轴可播放、暂停、逐帧或拖动;修改任意参数后会自动重新计算。
  4. 保存与导出:用“保存配置”保留工程;“导出 Spine Json / images 包 / .spine 包”输出成品。

每个模块组标题右侧的“重置”可把该组参数恢复默认;系统设置会自动保存在当前浏览器。

常用操作

小眼睛
单独显示/隐藏对象;隐藏的粒子系统不会被导出。
+Copy
完整复制当前选中对象,方便对比不同参数。
背景图
上传参考图并调整位置和透明度,只用于画布预览。
系统设置
管理界面布局、辅助显示、刻度等,自动存入浏览器。
撤销/重做
Ctrl+Z 撤回一步;可达成的步数在系统设置中调整。
Spine 骨骼
在层级树搜索并选择骨骼,可用于粒子发射器跟随。

快捷键

Ctrl/⌘+Z撤回上一步
Ctrl/⌘+S保存配置
Q拖动画布
W位移工具
E旋转工具
R缩放工具
D播放 / 暂停
S回到第一帧

Q / W / E / R 需先点击画布;光标位于输入框时,单键快捷键不会触发。

功能模块详解
',3)),T("section",{class:Le(["help-section help-module",{open:i.value[0]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[0]?"true":"false",onClick:a[0]||(a[0]=c=>i.value[0]=!i.value[0])},[a[10]||(a[10]=T("span",{class:"mnum"},"1",-1)),a[11]||(a[11]=T("span",{class:"mtitle"},"配置管理",-1)),T("span",lk,_e(i.value[0]?"▾":"▸"),1)],8,ak),de(T("div",ck,[...a[12]||(a[12]=[es('
保存配置
把当前全部场景对象和参数保存为工程 JSON 文件(也支持 Ctrl+S)。
加载配置
选择本地配置文件,恢复完整工程。
预设
从下拉中选择已保存的预设快速套用;点击下拉即可刷新列表。
范围
配置只含对象与参数,不含“系统设置”;系统设置单独存于浏览器。
',1)])],512),[[vi,i.value[0]]])],2),T("section",{class:Le(["help-section help-module",{open:i.value[1]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[1]?"true":"false",onClick:a[1]||(a[1]=c=>i.value[1]=!i.value[1])},[a[13]||(a[13]=T("span",{class:"mnum"},"2",-1)),a[14]||(a[14]=T("span",{class:"mtitle"},"场景对象",-1)),T("span",uk,_e(i.value[1]?"▾":"▸"),1)],8,hk),de(T("div",dk,[...a[15]||(a[15]=[es('
粒子
核心对象。可设名称、位置 X/Y、偏移、旋转、缩放 X/Y,以及“随机种子”——相同种子可精确复现同一次效果。
碰撞
圆形/椭圆/矩形/多边形/自定义;启用开关、碰撞响应(物理弹跳/暂停/销毁)、弹性与摩擦,还可沿某条路径移动并带进度曲线。
路径
贝塞尔路径,可双击新建/删除锚点、拖手柄调曲线;内置圆/方/多边形/星形预设,支持闭合与颜色。
Spine
加载 .json+.atlas+.png 预览骨骼动画,可查看/搜索骨骼层级树,用于粒子“发射器跟随”。
通用
每个对象都有小眼睛显隐;“+Copy”可以复制当前对象;隐藏的粒子系统不会进入导出。
',1)])],512),[[vi,i.value[1]]])],2),T("section",{class:Le(["help-section help-module",{open:i.value[2]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[2]?"true":"false",onClick:a[2]||(a[2]=c=>i.value[2]=!i.value[2])},[a[16]||(a[16]=T("span",{class:"mnum"},"3",-1)),a[17]||(a[17]=T("span",{class:"mtitle"},"发射模式",-1)),T("span",mk,_e(i.value[2]?"▾":"▸"),1)],8,fk),de(T("div",pk,[...a[18]||(a[18]=[es('
持续
按“每秒发射数量”持续喷射;再分“常规持续”(发射时长)与“循环持续”(三段式:开始循环 / 纯循环 / 结束循环,可自动或自定义帧长,做到无缝衔接)。
爆发
一次性发射“单次数量”颗粒子。
延迟时间
粒子条左端位置,表示发射开始前的等待时间。
注意
循环持续模式不支持骨骼跟随和路径跟随;开关时会把跟随设置恢复默认。
',1)])],512),[[vi,i.value[2]]])],2),T("section",{class:Le(["help-section help-module",{open:i.value[3]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[3]?"true":"false",onClick:a[3]||(a[3]=c=>i.value[3]=!i.value[3])},[a[19]||(a[19]=T("span",{class:"mnum"},"4",-1)),a[20]||(a[20]=T("span",{class:"mtitle"},"发射器形状",-1)),T("span",vk,_e(i.value[3]?"▾":"▸"),1)],8,gk),de(T("div",yk,[...a[21]||(a[21]=[es('
形状
点 / 圆形 / 矩形 / 锥形 / 路径。
圆·锥
内半径与外半径,形成环形或锥形发射区;锥形额外有“锥形朝向”和“开口角度”。
矩形
“外框 − 内框”形成环带,可分别设置内外宽高。
路径
选一条场景路径作为出生线;出生分布可选等距固定或随机。
发射角度
固定 / 随机(基准角度 + 随机范围)/ 径向(圆、矩、锥中心向外)/ 垂直于路径 / 沿路径方向。
',1)])],512),[[vi,i.value[3]]])],2),T("section",{class:Le(["help-section help-module",{open:i.value[4]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[4]?"true":"false",onClick:a[4]||(a[4]=c=>i.value[4]=!i.value[4])},[a[22]||(a[22]=T("span",{class:"mnum"},"5",-1)),a[23]||(a[23]=T("span",{class:"mtitle"},"粒子属性",-1)),T("span",bk,_e(i.value[4]?"▾":"▸"),1)],8,xk),de(T("div",wk,[...a[24]||(a[24]=[T("dl",{class:"help-list"},[T("div",null,[T("dt",null,"初始参数"),T("dd",null,"生命周期、速度、缩放(统一或 X/Y 分离)、初始旋转(可跟随发射方向)。每个属性支持固定 / 随机 / 曲线三种取值。")]),T("div",null,[T("dt",null,"生命周期变化"),T("dd",null,"速度倍率、缩放倍率(统一/分离)、旋转速度,均可用“生命周期 → 倍率”曲线控制。")]),T("div",null,[T("dt",null,"曲线含义"),T("dd",null,"横轴为粒子生命周期 0→1,纵轴为倍率或对应数值。")])],-1)])],512),[[vi,i.value[4]]])],2),T("section",{class:Le(["help-section help-module",{open:i.value[5]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[5]?"true":"false",onClick:a[5]||(a[5]=c=>i.value[5]=!i.value[5])},[a[25]||(a[25]=T("span",{class:"mnum"},"6",-1)),a[26]||(a[26]=T("span",{class:"mtitle"},"外观与资源",-1)),T("span",_k,_e(i.value[5]?"▾":"▸"),1)],8,Sk),de(T("div",Tk,[...a[27]||(a[27]=[T("dl",{class:"help-list"},[T("div",null,[T("dt",null,"透明度"),T("dd",null,"曲线或固定;曲线模式可选“跟随导出 / 线性 / 贝塞尔”。")]),T("div",null,[T("dt",null,"图片资源"),T("dd",null,"“+”新增,可上传单图或序列帧;多张图片按权重随机。每张可调缩放、轴心、颜色(固定/随机/生命周期渐变)、混合模式(正常/相加/相乘/滤色)、独立透明度(关/固定/曲线)。")]),T("div",null,[T("dt",null,"序列帧"),T("dd",null,"播放方式:单次隐藏 / 单次定格 / 正向循环 / 反向循环,可设每秒帧数。")])],-1)])],512),[[vi,i.value[5]]])],2),T("section",{class:Le(["help-section help-module",{open:i.value[6]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[6]?"true":"false",onClick:a[6]||(a[6]=c=>i.value[6]=!i.value[6])},[a[28]||(a[28]=T("span",{class:"mnum"},"7",-1)),a[29]||(a[29]=T("span",{class:"mtitle"},"修改器",-1)),T("span",Ck,_e(i.value[6]?"▾":"▸"),1)],8,Mk),de(T("div",Ak,[...a[30]||(a[30]=[es('
移动噪声
强度、波动范围、时间流速,让粒子轨迹产生抖动。
重力 / 风力
固定或随机强度、方向,以及生命周期内强度曲线。
力场
中心 X/Y、强度(正吸负斥)、半径、衰减(恒定/线性/反比)。
吸附
延迟后把粒子吸到指定点,到达范围即死亡;可直线或曲线。
拖尾
独立拖尾图片(多资源按权重)、旋转、拖尾骨骼数、拖尾比例;长度/宽度可固定或随机并支持放大;可加生命周期长度曲线与形状曲线;颜色/透明度可跟随粒子、固定或曲线。
发射器跟随
跟随某条路径(局部/世界、正/反向、进度曲线),或跟随 Spine 骨骼(选中的骨骼 + 偏移)。
碰撞 + 阻尼
选择场景中已启用的碰撞对象参与,并设置速度阻尼。
',1)])],512),[[vi,i.value[6]]])],2),T("section",{class:Le(["help-section help-module",{open:i.value[7]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[7]?"true":"false",onClick:a[7]||(a[7]=c=>i.value[7]=!i.value[7])},[a[31]||(a[31]=T("span",{class:"mnum"},"8",-1)),a[32]||(a[32]=T("span",{class:"mtitle"},"导出设置",-1)),T("span",Ik,_e(i.value[7]?"▾":"▸"),1)],8,Ek),de(T("div",Rk,[...a[33]||(a[33]=[es('
图片路径
写入 Spine 的 images 路径,例如 ./images/。
Spine 版本
3.8 / 4.0 / 4.1 / 4.2 / 4.3。
关键帧曲线
线性或平滑贝塞尔;出生、死亡、突变仍使用阶跃关键帧。
导出 FPS
修改 FPS 会保持动画实际秒数不变;“不写 fps”只省略元数据。
其它
整数帧对齐、骨骼对象池、排除无内容动画。
导出按钮
“导出 Spine Json”生成骨骼动画文件;“导出 images 包”单独下载图片 ZIP;“导出 .spine 包”需要连接器。
',1)])],512),[[vi,i.value[7]]])],2),T("section",{class:Le(["help-section help-module help-connector",{open:i.value[8]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[8]?"true":"false",onClick:a[8]||(a[8]=c=>i.value[8]=!i.value[8])},[a[34]||(a[34]=T("span",{class:"mnum"},"9",-1)),a[35]||(a[35]=T("span",{class:"mtitle"},"连接器(Spine 连接器)使用说明",-1)),T("span",kk,_e(i.value[8]?"▾":"▸"),1)],8,Pk),de(T("div",Fk,[...a[36]||(a[36]=[es('

连接器用于把网页生成的 JSON 和图片,调用你电脑上已安装并激活的 Spine,转换成可编辑的 .spine 工程。

前置
电脑已安装并激活 Spine;并已启动桌面版连接器APP。
网页端
导出区状态显示“连接器可用 · Spine 已就绪”后,点击“导出 .spine 包”。
首次授权
生产网站首次连接会显示“授权当前网站”;点击后在本机确认页核对完整来源(协议 + 域名 + 端口),再点“允许此网站”。授权一次后本机会保存白名单。本地 127.0.0.1:5173 默认允许。
路径设置
连接器自动检测 Spine 安装位置;检测不到时可在桌面窗口手动指定:Windows 选 Spine.com,macOS 选 Spine.app/Contents/MacOS/Spine。
下载结果
得到 ZIP 包,内含 .spine 工程和图片目录(如 images/star.png)。
版本
连接器按请求与 JSON 内的版本自动匹配 3.8~4.3,使用最新可用补丁。
安全
仅监听本机 127.0.0.1:27843;授权与白名单保存在连接器里;文件在临时目录转换后清理,并有大小限制。
',2)])],512),[[vi,i.value[8]]])],2),a[38]||(a[38]=T("section",{class:"help-section help-export"},[T("h3",null,"配置与导出有什么区别?"),T("p",null,[T("b",null,"保存配置"),At("会保存编辑器中的全部对象和参数,之后可以继续修改;"),T("b",null,"导出 Spine Json"),At("只导出显示中的粒子系统,并把跟随、碰撞和拖尾结果烘焙为独立动画数据。")])],-1))])])])):Te("",!0)}}),Qt=(s,e)=>{const t=s.__vccOpts||s;for(const[i,n]of e)t[i]=n;return t},Bk=Qt(Ok,[["__scopeId","data-v-12773018"]]);function zo(s){const e=()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",e),window.removeEventListener("pointercancel",e)};window.addEventListener("pointermove",s),window.addEventListener("pointerup",e),window.addEventListener("pointercancel",e)}function us(s,e,t){const i=s.holder.value,n=s.app(),r=i.getBoundingClientRect(),o=Math.max(1e-4,s.store.editor.viewScale),a=e-r.left,c=t-r.top;return{x:(a-n.screen.width/2-s.store.editor.viewX)/o,y:-(c-n.screen.height*.5-s.store.editor.viewY)/o}}function Lk(s,e){const t=s.holder.value,i=s.app(),n=s.store,r=t.getBoundingClientRect(),o=e.clientX-r.left,a=e.clientY-r.top,c=e.deltaY<0?1.12:1/1.12,l=n.editor.viewScale,h=Math.max(.01,l*c),u=i.screen.width/2,d=i.screen.height*.5,f=n.editor.viewX,p=n.editor.viewY,m=(o-u-f)/l,g=(a-d-p)/l;n.editor.viewX=o-u-m*h,n.editor.viewY=a-d-g*h,n.editor.viewScale=h}function Dk(s,e,t){const i=s.store,n=i.editor.viewX,r=i.editor.viewY;zo(o=>{i.editor.viewX=n+(o.clientX-e),i.editor.viewY=r+(o.clientY-t)})}function vw(s,e){const t=Math.max(.01,s.store.editor.viewScale*e);s.store.editor.viewScale=t}function Nk(s){vw(s,1.2)}function Uk(s){vw(s,1/1.2)}function $k(s){s.store.editor.viewScale=1,s.store.editor.viewX=0,s.store.editor.viewY=0}function Xk(s){s.store.editor.viewScale=1,s.store.editor.viewX=0,s.store.editor.viewY=0}function Vk(s){s.store.settings.showGrid=!s.store.settings.showGrid}const Yk={class:"topbar"},Gk=["disabled"],Hk={class:"tool-group"},jk={class:"tool-group"},Wk={key:0,class:"background-panel"},zk=["disabled"],qk=["title"],Kk={class:"background-position-row"},Zk={class:"background-opacity-row"},Jk={class:"zoom-pct"},Qk=Jt({__name:"StageToolbar",props:{ctx:{},activeTool:{},showSettings:{type:Boolean},showHelp:{type:Boolean}},emits:["update:activeTool","update:showSettings","update:showHelp","clear-background","background-file"],setup(s,{emit:e}){const t=s,i=e,n=ao(),r=Ge(!1),o=Ge(null),a=qe(()=>n.settings.backgroundImageName);function c(m){i("update:activeTool",t.activeTool===m?"":m)}function l(){r.value=!r.value,r.value&&i("update:showSettings",!1)}function h(){const m=!t.showSettings;i("update:showSettings",m),m&&(r.value=!1)}function u(){i("update:showHelp",!0),r.value=!1,i("update:showSettings",!1)}function d(m){i("background-file",m)}function f(m=!0){o.value&&(o.value.value=""),i("clear-background",m)}function p(){gw()}return(m,g)=>(K(),Q("div",Yk,[T("button",{class:"settings-btn",onClick:h,title:"系统设置"},"系统设置"),T("button",{class:"undo-btn",disabled:R(au).undoCount===0,onClick:p,title:"撤回上一步 (Ctrl+Z)"},"↶",8,Gk),T("div",Hk,[T("button",{class:Le(["tool-btn",{on:s.activeTool===""}]),onClick:g[0]||(g[0]=v=>c("")),title:"拖动画布 (Q)"},"✋",2),T("button",{class:Le(["tool-btn",{on:s.activeTool==="translate"}]),onClick:g[1]||(g[1]=v=>c("translate")),title:"位移 (W)"},"✥",2),T("button",{class:Le(["tool-btn",{on:s.activeTool==="rotate"}]),onClick:g[2]||(g[2]=v=>c("rotate")),title:"旋转 (E)"},"⟳",2),T("button",{class:Le(["tool-btn",{on:s.activeTool==="scale"}]),onClick:g[3]||(g[3]=v=>c("scale")),title:"缩放 (R)"},"⤢",2)]),T("div",jk,[T("button",{class:"tool-btn",onClick:g[4]||(g[4]=v=>R(Nk)(s.ctx)),title:"放大"},"+"),T("button",{class:"tool-btn",onClick:g[5]||(g[5]=v=>R(Uk)(s.ctx)),title:"缩小"},"-"),T("button",{class:"tool-btn",onClick:g[6]||(g[6]=v=>R($k)(s.ctx)),title:"适配画布"},"⤢"),T("button",{class:Le(["tool-btn",{on:R(n).settings.showGrid}]),onClick:g[7]||(g[7]=v=>R(Vk)(s.ctx)),title:"切换网格"},"▦",2),T("button",{class:"tool-btn",onClick:g[8]||(g[8]=v=>R(Xk)(s.ctx)),title:"重置视图"},"⟳")]),T("div",{class:"background-menu",onClick:g[14]||(g[14]=et(()=>{},["stop"]))},[T("button",{class:Le(["background-btn",{on:r.value}]),title:"背景图显示设置",onClick:l},"背景图",2),r.value?(K(),Q("div",Wk,[T("button",{class:"background-upload",onClick:g[9]||(g[9]=v=>{var x;return(x=o.value)==null?void 0:x.click()})},_e(a.value?"更换图像":"上传图像"),1),T("button",{class:"background-clear",disabled:!a.value,onClick:g[10]||(g[10]=v=>f())},"清除背景",8,zk),T("input",{ref_key:"backgroundFileInput",ref:o,class:"background-file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:d},null,544),T("div",{class:"background-file-name",title:a.value},_e(a.value||"未上传图像"),9,qk),T("div",Kk,[T("label",null,[g[15]||(g[15]=T("span",null,"X",-1)),de(T("input",{"onUpdate:modelValue":g[11]||(g[11]=v=>R(n).settings.backgroundX=v),type:"number",step:"1","aria-label":"背景图 X 偏移"},null,512),[[He,R(n).settings.backgroundX,void 0,{number:!0}]])]),T("label",null,[g[16]||(g[16]=T("span",null,"Y",-1)),de(T("input",{"onUpdate:modelValue":g[12]||(g[12]=v=>R(n).settings.backgroundY=v),type:"number",step:"1","aria-label":"背景图 Y 偏移"},null,512),[[He,R(n).settings.backgroundY,void 0,{number:!0}]])])]),T("label",Zk,[g[17]||(g[17]=T("span",null,"透明度",-1)),de(T("input",{"onUpdate:modelValue":g[13]||(g[13]=v=>R(n).settings.backgroundOpacity=v),type:"range",min:"0",max:"1",step:"0.01","aria-label":"背景图透明度"},null,512),[[He,R(n).settings.backgroundOpacity,void 0,{number:!0}]]),T("b",null,_e(Math.round(R(n).settings.backgroundOpacity*100))+"%",1)])])):Te("",!0)]),T("button",{class:Le(["help-btn",{on:s.showHelp}]),title:"查看使用说明",onClick:u},"使用说明",2),T("span",Jk,_e(Math.round(R(n).editor.viewScale*100))+"%",1)]))}}),eF=Qt(Qk,[["__scopeId","data-v-4749834a"]]),tF={key:0,class:"settings-panel"},iF={class:"sp-head"},sF={class:"sp-switch-row"},nF={class:"sp-switch-control"},rF={class:"sp-row"},oF={class:"sp-chk"},aF={class:"sp-chk"},lF={class:"sp-row"},cF={class:"sp-row"},hF={class:"sp-chk"},uF={class:"sp-chk"},dF={class:"sp-row"},fF={class:"sp-row"},mF={class:"sp-row"},pF={class:"sp-hex"},gF={class:"sp-chk"},vF=Jt({__name:"StageSettingsPanel",props:{show:{type:Boolean}},emits:["close"],setup(s,{emit:e}){const t=e,i=ao();function n(o){ik(i,Number(o.target.value))}function r(){i.settings.bonePointDrawSize=Math.min(10,Math.max(.1,Number(i.settings.bonePointDrawSize)||1)),i.settings.boneAxisDrawSize=Math.min(10,Math.max(.1,Number(i.settings.boneAxisDrawSize)||2))}return(o,a)=>s.show?(K(),Q("div",tF,[T("div",iF,[a[15]||(a[15]=At("系统设置 ",-1)),T("button",{class:"sp-close",onClick:a[0]||(a[0]=c=>t("close"))},"✕")]),a[29]||(a[29]=T("div",{class:"sp-section-title"},"界面布局",-1)),T("label",sF,[a[17]||(a[17]=T("span",null,"参数面板位置",-1)),T("span",nF,[de(T("input",{type:"checkbox","onUpdate:modelValue":a[1]||(a[1]=c=>R(i).settings.parameterPanelOnRight=c),"aria-label":"参数面板显示在右侧"},null,512),[[Et,R(i).settings.parameterPanelOnRight]]),a[16]||(a[16]=T("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),T("b",null,_e(R(i).settings.parameterPanelOnRight?"右侧":"左侧"),1)])]),a[30]||(a[30]=T("div",{class:"sp-divider"},null,-1)),a[31]||(a[31]=T("div",{class:"sp-section-title"},"操作历史",-1)),T("label",rF,[a[18]||(a[18]=T("span",null,"最大撤回步数",-1)),de(T("input",{class:"sp-num sp-undo-limit",type:"number",min:"1",max:"200","onUpdate:modelValue":a[2]||(a[2]=c=>R(i).settings.undoLimit=c),"aria-label":"最大撤回步数",onChange:n},null,544),[[He,R(i).settings.undoLimit,void 0,{number:!0}]])]),a[32]||(a[32]=T("div",{class:"sp-divider"},null,-1)),a[33]||(a[33]=T("div",{class:"sp-section-title"},"画布辅助显示",-1)),T("label",oF,[de(T("input",{type:"checkbox","onUpdate:modelValue":a[3]||(a[3]=c=>R(i).settings.showEmitter=c)},null,512),[[Et,R(i).settings.showEmitter]]),a[19]||(a[19]=At("发射点",-1))]),T("label",aF,[de(T("input",{type:"checkbox","onUpdate:modelValue":a[4]||(a[4]=c=>R(i).settings.showBones=c)},null,512),[[Et,R(i).settings.showBones]]),a[20]||(a[20]=At("骨骼连线",-1))]),R(i).settings.showBones?(K(),Q(Fe,{key:0},[T("label",lF,[a[21]||(a[21]=T("span",null,"骨骼点绘制大小",-1)),de(T("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":a[5]||(a[5]=c=>R(i).settings.bonePointDrawSize=c),"aria-label":"骨骼点绘制大小",onChange:r},null,544),[[He,R(i).settings.bonePointDrawSize,void 0,{number:!0}]])]),T("label",cF,[a[22]||(a[22]=T("span",null,"坐标轴绘制大小",-1)),de(T("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":a[6]||(a[6]=c=>R(i).settings.boneAxisDrawSize=c),"aria-label":"坐标轴绘制大小",onChange:r},null,544),[[He,R(i).settings.boneAxisDrawSize,void 0,{number:!0}]])])],64)):Te("",!0),T("label",hF,[de(T("input",{type:"checkbox","onUpdate:modelValue":a[7]||(a[7]=c=>R(i).settings.showSkinMesh=c)},null,512),[[Et,R(i).settings.showSkinMesh]]),a[23]||(a[23]=At("蒙皮网格",-1))]),a[34]||(a[34]=T("div",{class:"sp-divider"},null,-1)),T("label",uF,[de(T("input",{type:"checkbox","onUpdate:modelValue":a[8]||(a[8]=c=>R(i).settings.tickEnabled=c)},null,512),[[Et,R(i).settings.tickEnabled]]),a[24]||(a[24]=At("启用刻度",-1))]),R(i).settings.tickEnabled?(K(),Q(Fe,{key:1},[T("label",dF,[a[25]||(a[25]=T("span",null,"刻度文字大小",-1)),de(T("input",{type:"range",min:"8",max:"40",step:"1","onUpdate:modelValue":a[9]||(a[9]=c=>R(i).settings.axisFontSize=c)},null,512),[[He,R(i).settings.axisFontSize,void 0,{number:!0}]]),de(T("input",{type:"number",min:"8",max:"40","onUpdate:modelValue":a[10]||(a[10]=c=>R(i).settings.axisFontSize=c),class:"sp-num"},null,512),[[He,R(i).settings.axisFontSize,void 0,{number:!0}]])]),T("label",fF,[a[26]||(a[26]=T("span",null,"刻度线粗细",-1)),de(T("input",{type:"range",min:"1",max:"5",step:"0.5","onUpdate:modelValue":a[11]||(a[11]=c=>R(i).settings.tickWidth=c)},null,512),[[He,R(i).settings.tickWidth,void 0,{number:!0}]]),de(T("input",{type:"number",min:"1",max:"5","onUpdate:modelValue":a[12]||(a[12]=c=>R(i).settings.tickWidth=c),class:"sp-num"},null,512),[[He,R(i).settings.tickWidth,void 0,{number:!0}]])]),T("label",mF,[a[27]||(a[27]=T("span",null,"坐标轴颜色",-1)),de(T("input",{type:"color","onUpdate:modelValue":a[13]||(a[13]=c=>R(i).settings.axisColor=c),class:"sp-colr"},null,512),[[He,R(i).settings.axisColor]]),T("span",pF,_e(R(i).settings.axisColor),1)]),T("label",gF,[de(T("input",{type:"checkbox","onUpdate:modelValue":a[14]||(a[14]=c=>R(i).settings.showAxisLabels=c)},null,512),[[Et,R(i).settings.showAxisLabels]]),a[28]||(a[28]=At("显示刻度数值",-1))])],64)):Te("",!0),a[35]||(a[35]=T("div",{class:"sp-cache-note"},"整个系统设置会自动保存到当前浏览器",-1))])):Te("",!0)}}),yF=Qt(vF,[["__scopeId","data-v-1bba85d9"]]);class sf{constructor(){w(this,"sprite",null);w(this,"texture",null);w(this,"loadVersion",0)}createSprite(e){const t=new yr(ze.EMPTY);return t.anchor.set(.5),t.visible=!1,e.addChild(t),this.sprite=t,t}applyTransform(e,t,i){this.sprite&&(this.sprite.position.set(Number(e)||0,-(Number(t)||0)),this.sprite.alpha=Math.min(1,Math.max(0,Number(i)||0)))}async syncTexture(e){const t=++this.loadVersion;if(!e){this.sprite&&(this.sprite.texture=ze.EMPTY,this.sprite.visible=!1),this.texture&&this.texture.destroy(!0),this.texture=null;return}try{const i=await ze.fromURL(e);if(t!==this.loadVersion||!this.sprite){i.destroy(!0);return}const n=this.texture;this.texture=i,this.sprite.texture=i,this.sprite.visible=!0,n&&n.destroy(!0)}catch(i){console.error("背景图恢复失败",i)}}static clearStoreBackground(e,t){e.settings.backgroundImageData="",e.settings.backgroundImageName="",t&&(e.settings.backgroundX=0,e.settings.backgroundY=0,e.settings.backgroundOpacity=1)}static async handleFileChange(e,t){var r;const i=t.target,n=(r=i.files)==null?void 0:r[0];if(n)try{e.settings.backgroundImageData=await Ic(n),e.settings.backgroundImageName=n.name}catch(o){console.error("背景图加载失败",o)}finally{i.value=""}}destroy(){this.loadVersion++,this.texture&&this.texture.destroy(!0),this.texture=null,this.sprite=null}}class xF{constructor(e){w(this,"selectedNodes",new Set);w(this,"suppressNextDoubleClick",!1);this.ctx=e}resetSelection(){this.selectedNodes.clear()}activePath(){const e=this.ctx.store;if(e.activeObjectType!=="path")return null;const t=e.paths.find(i=>i.id===e.activeObjectId)||null;return(t==null?void 0:t.visible)===!1?null:t}pathInsertIndex(e,t,i){if(e.points.length<2)return e.points.length;const n=e.closed?e.points.length:e.points.length-1;let r=e.points.length,o=1/0;for(let a=0;aMath.hypot(c.x-n.x,c.y-n.y)<=r);if(o>=0){t.points.splice(o,1),this.selectedNodes.clear();return}const a=this.pathInsertIndex(t,n.x,n.y);t.points.splice(a,0,{x:n.x,y:n.y,inX:0,inY:0,outX:0,outY:0}),this.selectedNodes.clear(),this.selectedNodes.add(a)}onPointerDown(e){const t=this.activePath();if(!t||!t.enabled)return!1;const i=us(this.ctx,e.clientX,e.clientY),n=wo(t,i.x,i.y),r=9/Math.max(.01,this.ctx.store.editor.viewScale);if(e.detail>=2){if(t.points.findIndex(u=>Math.hypot(u.x-n.x,u.y-n.y)<=r)>=0)return!0;const l={x:n.x,y:n.y,inX:0,inY:0,outX:0,outY:0},h=this.pathInsertIndex(t,n.x,n.y);return t.points.splice(h,0,l),this.selectedNodes.clear(),this.selectedNodes.add(h),this.suppressNextDoubleClick=!0,zo(u=>{const d=us(this.ctx,u.clientX,u.clientY),f=wo(t,d.x,d.y);l.outX=f.x-l.x,l.outY=f.y-l.y,l.inX=-l.outX,l.inY=-l.outY}),!0}let o=null;for(const c of this.selectedNodes){const l=t.points[c];l&&(Math.hypot(l.x+l.inX-n.x,l.y+l.inY-n.y)<=r&&(o={index:c,side:"in"}),Math.hypot(l.x+l.outX-n.x,l.y+l.outY-n.y)<=r&&(o={index:c,side:"out"}))}if(o){const c=t.points[o.index],l=o.side==="in"?Math.hypot(c.outX,c.outY):Math.hypot(c.inX,c.inY);return zo(u=>{const d=us(this.ctx,u.clientX,u.clientY),f=wo(t,d.x,d.y),p=f.x-c.x,m=f.y-c.y;if(o.side==="in"?(c.inX=p,c.inY=m):(c.outX=p,c.outY=m),!u.altKey){const g=Math.max(1e-4,Math.hypot(p,m)),v=u.shiftKey?g:l;o.side==="in"?(c.outX=-p/g*v,c.outY=-m/g*v):(c.inX=-p/g*v,c.inY=-m/g*v)}}),!0}const a=t.points.findIndex(c=>Math.hypot(c.x-n.x,c.y-n.y)<=r);if(a>=0){if(e.altKey)return this.selectedNodes.delete(a),!0;e.ctrlKey||e.metaKey?this.selectedNodes.add(a):this.selectedNodes.has(a)||(this.selectedNodes.clear(),this.selectedNodes.add(a));const c=n,l=[...this.selectedNodes].map(u=>({index:u,x:t.points[u].x,y:t.points[u].y}));return zo(u=>{const d=us(this.ctx,u.clientX,u.clientY),f=wo(t,d.x,d.y);for(const p of l)t.points[p.index].x=p.x+f.x-c.x,t.points[p.index].y=p.y+f.y-c.y}),!0}if(e.altKey&&!e.ctrlKey&&!e.metaKey)return this.selectedNodes.clear(),!0;if(e.ctrlKey||e.metaKey||e.altKey){const c=n,l=e.altKey,h=u=>{const d=us(this.ctx,u.clientX,u.clientY),f=wo(t,d.x,d.y),p=Math.min(c.x,f.x),m=Math.max(c.x,f.x),g=Math.min(c.y,f.y),v=Math.max(c.y,f.y);t.points.forEach((x,y)=>{x.x>=p&&x.x<=m&&x.y>=g&&x.y<=v&&(l?this.selectedNodes.delete(y):this.selectedNodes.add(y))}),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h)};return window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h),!0}return!1}}class bF{constructor(e,t){this.ctx=e,this.getTool=t}onColliderPointerDown(e){const t=this.ctx.store;if(t.activeObjectType!=="collision")return!1;const i=t.colliders.find(x=>x.id===t.activeObjectId);if(!(i!=null&&i.enabled)||i.visible===!1)return!1;const n=us(this.ctx,e.clientX,e.clientY),r=i.rotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),c=Math.max(1e-4,Math.abs(i.scaleX??1)),l=Math.max(1e-4,Math.abs(i.scaleY??1)),h=n.x-i.x,u=n.y-i.y,d=(o*h+a*u)/c,f=(-a*h+o*u)/l;if(!(i.shape==="circle"?Math.hypot(d,f)<=i.radius:i.shape==="ellipse"?Math.hypot(d/Math.max(1,i.radiusX),f/Math.max(1,i.radiusY))<=1:Math.abs(d)<=i.width*.5&&Math.abs(f)<=i.height*.5))return!1;const m=i.x,g=i.y,v=n;return zo(x=>{const y=us(this.ctx,x.clientX,x.clientY);i.x=m+y.x-v.x,i.y=g+y.y-v.y}),!0}onForceFieldDown(e){const t=this.ctx.store.systems.find(h=>h.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const i=t==null?void 0:t.config;if(!(i!=null&&i.forceField)||i.forceRadius<=0)return!1;const n=us(this.ctx,e.clientX,e.clientY);if(Math.hypot(n.x-i.forceCenterX,n.y-i.forceCenterY)>i.forceRadius)return!1;const o=i.forceCenterX,a=i.forceCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const c=h=>{const u=us(this.ctx,h.clientX,h.clientY);i.forceCenterX=o+u.x-n.x,i.forceCenterY=a+u.y-n.y},l=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)};return window.addEventListener("pointermove",c),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),e.preventDefault(),!0}onAttractionDown(e){const t=this.ctx.store.systems.find(u=>u.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const i=t==null?void 0:t.config;if(!(i!=null&&i.attraction))return!1;const n=us(this.ctx,e.clientX,e.clientY),r=Math.max(i.attractionRadius,12/Math.max(1e-4,this.ctx.store.editor.viewScale));if(Math.hypot(n.x-i.attractionCenterX,n.y-i.attractionCenterY)>r)return!1;const a=i.attractionCenterX,c=i.attractionCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const l=u=>{const d=us(this.ctx,u.clientX,u.clientY);i.attractionCenterX=a+d.x-n.x,i.attractionCenterY=c+d.y-n.y},h=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h)};return window.addEventListener("pointermove",l),window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h),e.preventDefault(),!0}selectedTransformTarget(){const e=this.ctx.store,t=e.activeObjectId;if(e.activeObjectType==="particle"){const r=e.systems.find(a=>a.id===t);if(!r||r.visible===!1)return null;const o=r.config;return{x:o.centerX,y:o.centerY,rotation:o.rootRotation,scaleX:o.rootScaleX??1,scaleY:o.rootScaleY??1,setPosition:(a,c)=>{o.centerX=a,o.centerY=c},setRotation:a=>{o.rootRotation=a},setScale:(a,c)=>{o.rootScaleX=a,o.rootScaleY=c}}}const n=(e.activeObjectType==="collision"?e.colliders:e.activeObjectType==="path"?e.paths:e.spines).find(r=>r.id===t);return!n||n.visible===!1?null:{x:Number(n.x)||0,y:Number(n.y)||0,rotation:Number(n.rotation)||0,scaleX:Math.max(.05,Number(n.scaleX)||1),scaleY:Math.max(.05,Number(n.scaleY)||1),setPosition:(r,o)=>{n.x=r,n.y=o},setRotation:r=>{n.rotation=r},setScale:(r,o)=>{n.scaleX=r,n.scaleY=o}}}onGizmoDown(e){const t=this.selectedTransformTarget();if(!t)return;const i=this.ctx.app(),n=this.ctx.store,r=n.editor.viewScale,o=this.ctx.holder.value.getBoundingClientRect(),a=o.left+i.screen.width/2+n.editor.viewX+t.x*r,c=o.top+i.screen.height*.5+n.editor.viewY+-t.y*r,l=e.clientX,h=e.clientY,u=this.getTool(),d=t.x,f=t.y,p=t.rotation,m=t.scaleX,g=t.scaleY,v=Math.hypot(l-a,h-c)||1,x=Math.atan2(h-c,l-a);zo(_=>{const C=(_.clientX-l)/r,S=(_.clientY-h)/r;if(u==="translate")t.setPosition(d+C,f-S);else if(u==="rotate"){const b=Math.atan2(_.clientY-c,_.clientX-a);t.setRotation(p-(b-x)*180/Math.PI)}else if(u==="scale"){const M=Math.hypot(_.clientX-a,_.clientY-c)/v;t.setScale(Math.max(.05,m*M),Math.max(.05,g*M))}})}}function Pv(s,e,t,i,n){const r=1-n;return r*r*r*s+3*r*r*n*e+3*r*n*n*t+n*n*n*i}function kv(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(s.scaleX??1)),a=Math.max(1e-4,Math.abs(s.scaleY??1));return{x:s.x+n*e*o-r*t*a,y:s.y+r*e*o+n*t*a}}function gp(s,e){if(!s.points.length)return null;if(s.points.length===1)return{...kv(s,s.points[0].x,s.points[0].y),angle:s.rotation};const t=s.closed?s.points.length:s.points.length-1,i=[];let n=0;for(let p=0;p0&&v===0)continue;const x=v/20,y=Pv(m.x,m.x+m.outX,g.x+g.inX,g.x,x),_=Pv(m.y,m.y+m.outY,g.y+g.inY,g.y,x),C=kv(s,y,_),S=i[i.length-1];S&&(n+=Math.hypot(C.x-S.x,C.y-S.y)),i.push({...C,distance:n})}}const r=Math.min(1,Math.max(0,e))*n;let o=i.findIndex(p=>p.distance>=r);o<0&&(o=i.length-1);const a=i[o],c=i[Math.max(0,o-1)],l=i[Math.min(i.length-1,o+1)],h=c.distance,u=o>0?(r-h)/Math.max(1e-4,a.distance-h):0,d=c.x+(a.x-c.x)*Math.min(1,Math.max(0,u)),f=c.y+(a.y-c.y)*Math.min(1,Math.max(0,u));return{x:d,y:f,angle:Math.atan2(l.y-c.y,l.x-c.x)*180/Math.PI}}function yh(s,e,t,i=Math.max(1e-4,Math.abs(s.rootScaleX)),n=Math.max(1e-4,Math.abs(s.rootScaleY))){const r=-s.rootRotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),c=e-s.centerX,l=-t+s.centerY;return{x:(o*c+a*l)/i,y:(-a*c+o*l)/n}}function wF(s,e,t){const i=gp(e,t);if(!i)return null;const n=yh(s,i.x,i.y),r=i.angle*Math.PI/180,o=yh(s,i.x+Math.cos(r),i.y+Math.sin(r)),a=Math.atan2(o.y-n.y,o.x-n.x)*180/Math.PI;return{...n,angle:a}}function SF(s,e){return s.colliders.map(t=>{if(!t.followPath||!t.followPathId)return t;const i=s.paths.find(h=>h.id===t.followPathId&&h.enabled);if(!(i!=null&&i.points.length))return t;const n=Math.max(.05,Number(t.followDuration)||2),r=Math.min(1,Math.max(0,e/n)),o=Array.isArray(t.followCurve)?t.followCurve:[{x:0,y:0},{x:1,y:1}],a=t.followCurveMode==="跟随导出"?s.settings.exportSettings.keyframeCurve==="bezier"?"bezier":"linear":t.followCurveMode==="贝塞尔"?"bezier":"linear",c=Math.min(1,Math.max(0,nb(o,r,a))),l=gp(i,c);return l?{...t,x:l.x,y:l.y,rotation:t.rotation+(t.followPathRotation?l.angle:0)}:t})}class _F{constructor(){w(this,"emitters",new Map);w(this,"configs",new Map)}sync(e,t,i,n){for(const[r,o]of this.emitters){const a=e.systems.find(c=>c.id===r);(!a||this.configs.get(r)!==a.config)&&(t.removeChild(o),o.destroy({children:!0}),this.emitters.delete(r),this.configs.delete(r))}for(const r of e.systems){i&&!r.config.texture&&(r.config.texture=i);const o=pr(r.config);if(n)for(const c of o.trailResources)!c.texture&&(c.previewUrl==="/images/trail.png"||c.previewUrl==="/trails/trail.png")&&(c.texture=n);if(i)for(const c of o.imageResources)!c.texture&&c.textureName==="star"&&(c.texture=i);if(this.emitters.has(r.id))continue;const a=new LI(r.config);t.addChild(a),this.emitters.set(r.id,a),this.configs.set(r.id,r.config)}}destroy(e){for(const[t,i]of this.emitters)e.removeChild(i),i.destroy({children:!0}),this.emitters.delete(t),this.configs.delete(t)}}async function TF(){const[s,e]=await Promise.all([ze.fromURL("/images/star.png"),ze.fromURL("/images/trail.png")]);return{dotTex:s,trailTex:e}}function MF(s,e,t){for(const i of s.systems){i.config.texture=e;const n=pr(i.config);if(t)for(const r of n.trailResources)!r.texture&&(r.previewUrl==="/images/trail.png"||r.previewUrl==="/trails/trail.png")&&(r.texture=t);for(const r of n.imageResources)!r.texture&&r.textureName==="star"&&(r.texture=e)}}const CF={class:"stage-wrap"},AF={key:0,class:"hud"},EF={class:"hud-number hud-system-count"},IF={class:"hud-number hud-particle-count"},RF=Jt({__name:"Stage",setup(s){const e=ao(),t=Ge(null),i=Ge(null),n=Ge(!1),r=Ge(!1),o=Ge(""),a=Ge(!1);e.settings.undoLimit>0||(e.settings.undoLimit=20),e.settings.parameterPanelOnRight==null&&(e.settings.parameterPanelOnRight=!0),Number.isFinite(e.settings.backgroundX)||(e.settings.backgroundX=0),Number.isFinite(e.settings.backgroundY)||(e.settings.backgroundY=0),Number.isFinite(e.settings.backgroundOpacity)||(e.settings.backgroundOpacity=1),e.settings.backgroundImageName==null&&(e.settings.backgroundImageName=""),e.settings.backgroundImageData==null&&(e.settings.backgroundImageData=""),e.settings.showEmitter==null&&(e.settings.showEmitter=!0),e.settings.showBones==null&&(e.settings.showBones=!1),e.settings.bonePointDrawSize>0||(e.settings.bonePointDrawSize=1),e.settings.boneAxisDrawSize>0||(e.settings.boneAxisDrawSize=2),e.settings.showSkinMesh==null&&(e.settings.showSkinMesh=!1),e.settings.showGrid==null&&(e.settings.showGrid=!0);let c=null,l=null,h=null,u=null,d=null,f=null,p=null,m=null,g=null,v=null,x=null,y=null,_=null,C=null,S=[],b=0,M=0,I=0,F=0,E=null,k=null;const O=new sf,D=new _F,$={store:e,holder:t,app:()=>c},N=new xF($),U=new bF($,()=>o.value);let A=[];const P=new Map;function L(){l=new Si,c.stage.addChild(l),_=new Si,c.stage.addChild(_),O.createSprite(l),y=new zi,l.addChild(y),C=new mR,l.addChild(C.container),u=new zi,l.addChild(u),h=new zi,l.addChild(h),f=new zi,l.addChild(f),p=new zi,l.addChild(p),m=new zi,l.addChild(m),g=new zi,l.addChild(g),v=new zi,l.addChild(v),x=new zi,l.addChild(x),d=new zi,l.addChild(d)}function B(le){if(le.button===0){if(o.value&&U.selectedTransformTarget()){U.onGizmoDown(le);return}N.onPointerDown(le)||U.onColliderPointerDown(le)||U.onAttractionDown(le)||U.onForceFieldDown(le)||Dk($,le.clientX,le.clientY)}}function X(le){N.onStageDoubleClick(le)}function V(le){Lk($,le)}function q(le=!0){sf.clearStoreBackground(e,le)}async function W(le){await sf.handleFileChange(e,le)}nk({canvasElement:t,canvasFocused:a,undo:gw,save:()=>hw(e),togglePlay:()=>e.togglePlay(),toStart:()=>e.toStart(),setTool:le=>{o.value=le}});function ne(){l&&D.sync(e,l,E,k)}function re(){var ae,xe,Y;F=requestAnimationFrame(re);const le=performance.now()/1e3;let ue=le-b;if(b=le,ue>.1&&(ue=.1),c&&l){l.scale.set(e.editor.viewScale),l.position.set(c.screen.width/2+e.editor.viewX,c.screen.height*.5+e.editor.viewY),O.applyTransform(e.settings.backgroundX,e.settings.backgroundY,e.settings.backgroundOpacity),KI(e,c,y,_,S),ne();const j=Math.max(1,e.timeline.fps),H=e.timeline.frame,G=H/j;C==null||C.sync(e.spines,H,j),A=SF(e,G);for(const Me of e.systems){const ve=D.emitters.get(Me.id);if(!ve)continue;ve.setFollowExportCurveMode(e.settings.exportSettings.keyframeCurve==="bezier"?"贝塞尔":"线性");const Xe=Me.visible!==!1;ve.visible=Xe,ve.renderable=Xe;const pe=Me.config;ve.scale.set(pe.rootScaleX,pe.rootScaleY);const Ke=new Set(pe.collisionColliderIds);ve.setColliders(pe.collision?A.filter($e=>Ke.has($e.id)):[]),ve.setEmitterFollowSpawn(0,0,0);let Ze={x:pe.centerX,y:pe.centerY,rotation:pe.rootRotation};const Ct=pe.emitterFollow&&pe.emitterFollowMode==="bone"?e.spines.find($e=>$e.id===pe.emitterFollowSpineId&&$e.enabled&&$e.status==="ready"):null,Lt=Ct&&(C==null?void 0:C.getBoneWorldTransform(Ct.id,pe.emitterFollowBoneName))||null,ii=pe.emitterFollow&&pe.emitterFollowMode==="path"?e.paths.find($e=>$e.id===pe.emitterFollowPathId&&$e.enabled):null,rs=Math.max(.05,pe.emitterFollowDuration),zt=Math.min(1,Math.max(0,G/rs)),se=Math.min(1,Math.max(0,nb(pe.emitterFollowCurve,zt))),he=Math.min(1,Math.max(0,pe.emitterFollowOffset)),ot=pe.emitterFollowDirection==="reverse"?(1-he)*(1-se):he+(1-he)*se,at=ii?gp(ii,ot):null;if(Lt){const $e=pe.emitterFollowBoneOffsetX,_i=pe.emitterFollowBoneOffsetY,pi=Lt.x+$e,$t=Lt.y+_i,Fi=pe.rootRotation+pe.emitterFollowBoneRotation,vs=Math.max(1e-4,Math.abs(pe.rootScaleX*pe.emitterFollowBoneScaleX)),Vi=Math.max(1e-4,Math.abs(pe.rootScaleY*pe.emitterFollowBoneScaleY));if(Ze={x:pi,y:$t,rotation:Fi},pe.emitterFollowSpace==="local")ve.position.set(pi,-$t),ve.rotation=-Fi*Math.PI/180,ve.scale.set(vs,Vi),ve.setSimulationTransform(pi,$t,Fi,vs,Vi);else{ve.position.set(pe.centerX,-pe.centerY),ve.rotation=-pe.rootRotation*Math.PI/180,ve.scale.set(vs,Vi),ve.setSimulationTransform(pe.centerX,pe.centerY,pe.rootRotation,vs,Vi);const Ti=yh(pe,pi,$t,vs,Vi),uo=-(Fi-pe.rootRotation);ve.setEmitterFollowSpawn(Ti.x,Ti.y,uo)}}else if(at){const $e=at.angle+(pe.emitterFollowDirection==="reverse"?180:0),_i=pe.emitterAngleMode==="direction"?$e:pe.rootRotation;if(Ze={x:at.x,y:at.y,rotation:_i},pe.emitterFollowSpace==="local")ve.position.set(at.x,-at.y),ve.rotation=-_i*Math.PI/180,ve.setSimulationTransform(at.x,at.y,_i);else{ve.position.set(pe.centerX,-pe.centerY),ve.rotation=-pe.rootRotation*Math.PI/180,ve.setSimulationTransform(pe.centerX,pe.centerY,pe.rootRotation);const pi=yh(pe,at.x,at.y),$t=pe.emitterAngleMode==="direction"?-($e-pe.rootRotation):0;ve.setEmitterFollowSpawn(pi.x,pi.y,$t)}}else ve.position.set(pe.centerX,-pe.centerY),ve.rotation=-pe.rootRotation*Math.PI/180,ve.setSimulationTransform(pe.centerX,pe.centerY,pe.rootRotation);const gt=pe.shape==="path"&&pe.spawnPathId>0&&e.paths.find($e=>$e.id===pe.spawnPathId&&$e.enabled&&$e.points.length>0)||null;ve.setSpawnPathSampler(gt?$e=>wF(pe,gt,$e):null,(gt==null?void 0:gt.closed)===!0),P.set(Me.id,Ze)}let z=0;const ie=[],fe=e.settings.showBones&&e.activeObjectType==="particle"?e.activeObjectId:0,te=(Me,ve,Xe)=>{!Me||Me.id!==fe||Me.visible===!1||aR(ie,Xe,ve.position.x,ve.position.y)},oe=e.timeline,ce=oe.fps,Ce=1/Math.max(1,ce);let ye=I,we=0;if(oe.playing?(M+=ue,we=Math.floor(M/Ce),we>0&&(M-=we*Ce)):M=0,oe.playing&&we>0)for(let Me=0;MeZe.id===e.activeId),Xe=(ve==null?void 0:ve.config.mode)==="stream"&&ve.config.streamBehavior==="loop"?tb(ve.config,ce):null,Ke=oe.loop&&(Xe==null?void 0:Xe.start)===oe.playbackStart&&Xe.end===oe.playbackEnd?oe.playbackEnd-1:oe.playbackEnd;if(oe.frame>Ke)if(oe.loop)oe.frame=oe.playbackStart;else{oe.frame=oe.playbackEnd,oe.playing=!1;break}}else{if(oe.frame===0)for(const ve of e.systems){const Xe=D.emitters.get(ve.id);Xe&&(ve.config.mode==="stream"&&ve.config.streamBehavior==="loop"?fR(ve,Xe,ce,oe.totalFrames):Xe.reset())}for(const[ve,Xe]of D.emitters){const pe=e.systems.find(ii=>ii.id===ve),Ke=(pe==null?void 0:pe.config.mode)==="stream"&&pe.config.streamBehavior==="loop",Ze=Ke?(ae=pe.frames)==null?void 0:ae[oe.frame]:void 0,Ct=oe.frame===0&&!Ke,Lt=Ct?[]:Ze||Xe.update(Ce);if(Ct?Xe.apply([]):Ze&&Xe.apply(Ze),(pe==null?void 0:pe.visible)!==!1)for(const ii of Lt)ii.active&&te(pe,Xe,ii);z+=Lt.length}for(const ve of e.systems){if(!ve.config.texture)continue;ve.frames=ve.frames||[];const Xe=D.emitters.get(ve.id);Xe&&!(ve.config.mode==="stream"&&ve.config.streamBehavior==="loop")&&(ve.frames[oe.frame]=Xe.capture())}oe.frame++,oe.frame>=oe.totalFrames&&(oe.frame=oe.playbackStart,oe.recorded=!0)}else{oe.playing||(ye=oe.frame);for(const Me of e.systems){const ve=D.emitters.get(Me.id),Xe=oe.playing?I:oe.frame,pe=(Y=Me.frames)==null?void 0:Y[Xe],Ke=Me.config.mode==="stream"&&Me.config.streamBehavior==="loop"&&!!pe;if((oe.recorded||Ke)&&ve&&pe){ve.apply(pe);for(const Ze of pe)Ze.active&&(te(Me,ve,Ze),z++)}else if(ve){const Ze=oe.frame===0?[]:ve.update(0);if(oe.frame===0&&ve.apply([]),Me.visible!==!1)for(const Ct of Ze)Ct.active&&te(Me,ve,Ct);z+=ve.activeCount}}}I=ye,C==null||C.sync(e.spines,ye,ce);for(const[,Me]of D.emitters)Me.drawTrailMeshDebug(e.settings.showSkinMesh);rR(e,A,g),oR(e,N.selectedNodes,v),iR(e,C,u),ZI(e,P,h),JI(e,P,f),QI(e,p),eR(e,m),sR(o,U.selectedTransformTarget.bind(U),x),lR(ie,e,d),i.value&&(i.value.systems=e.systems.length,i.value.particles=z)}}return Vn(async()=>{const le=t.value;c=new A1({width:le.clientWidth||800,height:le.clientHeight||600,backgroundAlpha:0,antialias:!0}),le.appendChild(c.view),L(),Xi(()=>e.settings.backgroundImageData,ae=>O.syncTexture(ae),{immediate:!0});const ue=await TF();E=ue.dotTex,k=ue.trailTex,MF(e,E,k),i.value={systems:e.systems.length,particles:0},e.timeline.recorded=!1,e.timeline.frame=0,M=0,I=0,e.timeline.playing=!0,e.timeline.loop=!0;for(const ae of e.systems)ae.frames=[];e.recalcTotalFrames(),b=performance.now()/1e3,re(),Xi(()=>e.systems.map(ae=>JSON.stringify(ae.config,(xe,Y)=>xe==="texture"||xe==="trailTexture"||xe==="previewUrl"?void 0:Y)).join("|")+`|colliders:${JSON.stringify(e.colliders)}|paths:${JSON.stringify(e.paths)}`,()=>{e.recalcTotalFrames(),e.timeline.recorded=!1,e.timeline.frame=0;for(const ae of e.systems)ae.frames=[];e.timeline.playing=!0,e.timeline.loop=!0}),tk(e)}),gl(()=>{cancelAnimationFrame(F),C==null||C.destroy(),C=null,O.destroy(),l&&c&&D.destroy(l),c&&(c.destroy(!0,{children:!0}),c=null)}),Xi(()=>[e.activeObjectType,e.activeObjectId],()=>N.resetSelection()),(le,ue)=>(K(),Q("div",CF,[T("div",{ref_key:"holder",ref:t,class:Le(["stage-holder",{grid:R(e).settings.showGrid}]),tabindex:"0",onWheel:et(V,["prevent"]),onPointerdown:B,onDblclick:et(X,["prevent"])},null,34),be(eF,{ctx:$,"active-tool":o.value,"show-settings":n.value,"show-help":r.value,"onUpdate:activeTool":ue[0]||(ue[0]=ae=>o.value=ae),"onUpdate:showSettings":ue[1]||(ue[1]=ae=>n.value=ae),"onUpdate:showHelp":ue[2]||(ue[2]=ae=>r.value=ae),onClearBackground:q,onBackgroundFile:W},null,8,["active-tool","show-settings","show-help"]),be(yF,{show:n.value,onClose:ue[3]||(ue[3]=ae=>n.value=!1)},null,8,["show"]),be(Bk,{show:r.value,onClose:ue[4]||(ue[4]=ae=>r.value=!1)},null,8,["show"]),i.value?(K(),Q("div",AF,[ue[5]||(ue[5]=At(" 系统: ",-1)),T("b",EF,_e(i.value.systems),1),ue[6]||(ue[6]=At(" · 粒子(骨骼): ",-1)),T("b",IF,_e(i.value.particles),1),ue[7]||(ue[7]=At(" · 根骨骼: ",-1)),ue[8]||(ue[8]=T("b",null,"root",-1)),ue[9]||(ue[9]=T("span",{class:"hud-tip"},"滚轮缩放 · 左键拖动画布",-1))])):Te("",!0)]))}}),PF=Qt(RF,[["__scopeId","data-v-384a3641"]]),kF=[{x:0,y:0},{x:1,y:1}],cm=[{x:0,y:1},{x:1,y:1}],FF=[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],hm=[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}],um=[{x:0,y:1},{x:1,y:1}],dm=[{x:0,y:1},{x:1,y:1}],qt=no({visible:!1,title:"",detail:"",progress:0,indeterminate:!1,failed:!1});let uc=0;function OF(s){return new Promise(e=>window.setTimeout(e,s))}function yw(s,e){const t=++uc,i=performance.now();Object.assign(qt,{visible:!0,title:s,detail:e,progress:0,indeterminate:!1,failed:!1});const n=(o,a)=>{t===uc&&(qt.indeterminate=o==null,o!=null&&(qt.progress=Math.min(100,Math.max(0,o))),a&&(qt.detail=a))},r=async(o,a)=>{if(t!==uc)return;qt.failed=o,qt.indeterminate=!1,qt.progress=o?qt.progress:100,qt.detail=a,await OF(Math.max(180,(o?850:450)-(performance.now()-i))),t===uc&&(qt.visible=!1)};return{update:n,paint:()=>new Promise(o=>requestAnimationFrame(()=>o())),finish:(o="已完成")=>r(!1,o),fail:(o="操作失败")=>r(!0,o)}}async function BF(s,e){if(!s.body)return e(null),s.text();const t=Number(s.headers.get("content-length")),i=Number.isFinite(t)&&t>0,n=s.body.getReader(),r=new TextDecoder;let o=0,a="";for(e(i?0:null);;){const{done:c,value:l}=await n.read();if(c)break;o+=l.byteLength,a+=r.decode(l,{stream:!0}),e(i?Math.min(1,o/t):null)}return a+=r.decode(),i&&e(1),a}const LF="3.8";function ds(s,e,t){s[e]==null&&s[t]!=null&&(s[e]=s[t]),delete s[t]}function fm(s){if(!s||typeof s!="object")return;if(Array.isArray(s)){for(const t of s)fm(t);return}const e=s;Array.isArray(e.curve)&&delete e.curve;for(const t of Object.values(e))fm(t)}function DF(s){for(const e of s.bones)ds(e,"transform","inherit");for(const e of s.transform||[])ds(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),e.scaleMix==null&&(e.scaleMix=e.mixScaleX??e.mixScaleY),ds(e,"shearMix","mixShearY"),delete e.mixX,delete e.mixY,delete e.mixScaleX,delete e.mixScaleY;for(const e of s.path||[])ds(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),delete e.mixX,delete e.mixY;for(const e of s.skins)for(const t of Object.values(e.attachments||{}))for(const i of Object.values(t||{}))i.parent!=null&&ds(i,"deform","timelines")}function NF(s){for(const e of Object.values(s.slots||{}))ds(e,"color","rgba"),ds(e,"twoColor","rgba2")}function UF(s){for(const e of Object.values(s.bones||{}))for(const t of e.rotate||[])ds(t,"angle","value")}function $F(s){for(const e of Object.values(s.transform||{}))for(const t of e)ds(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),t.scaleMix==null&&(t.scaleMix=t.mixScaleX??t.mixScaleY),ds(t,"shearMix","mixShearY"),delete t.mixX,delete t.mixY,delete t.mixScaleX,delete t.mixScaleY}function XF(s){for(const e of Object.values(s.path||{})){for(const t of["position","spacing"])for(const i of e[t]||[])ds(i,t,"value");for(const t of e.mix||[])ds(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),delete t.mixX,delete t.mixY}}function VF(s){if(!s.attachments)return;const e=s.deform||(s.deform={});for(const[t,i]of Object.entries(s.attachments)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(i)){const a=n[r]||(n[r]={});for(const[c,l]of Object.entries(o))l.deform&&(a[c]=l.deform)}}delete s.attachments}function YF(s){s.skeleton.spine=LF,DF(s);for(const e of Object.values(s.animations))NF(e),UF(e),$F(e),XF(e),VF(e);return fm(s.animations),s}function GF(s,e,t,i){const n=t.frame-e.frame,r=n<=0?0:(s.frame-e.frame)/n;let o=0;for(let a=0;a[...i].sort((o,a)=>o-a);let r=!0;for(;r;){r=!1;const o=n();for(let a=0;au&&(u=f,h=d)}h>=0&&(i.add(h),r=!0)}}return n().map(o=>s[o])}function Fv(s,e,t,i,n){const r=t-e+1;if(r<2)return 0;const o=n?e:t,a=n?e+1:t-1,c=n?e+2:t-2,l=Math.abs(s[a].frame-s[o].frame);if(r>=3&&l>0&&Math.abs(Math.abs(s[c].frame-s[a].frame)-l)<1e-6){const u=s[o].values[i],d=s[a].values[i],f=s[c].values[i];return n?(-3*u+4*d-f)/(2*l):(3*u-4*d+f)/(2*l)}const h=s[a].frame-s[o].frame;return h?(s[a].values[i]-s[o].values[i])/h:0}function Ov(s,e,t){const i=s[t].frame-s[e].frame,n=[];for(let r=0;rd.values[r])),l=Math.max(...s.slice(e,t+1).map(d=>d.values[r])),h=o+Fv(s,e,t,r,!0)*i/3,u=a-Fv(s,e,t,r,!1)*i/3;n.push([Math.max(c,Math.min(l,h)),Math.max(c,Math.min(l,u))])}return{values:n}}function HF(s,e,t,i,n){const r=1-n;return r*r*r*s+3*r*r*n*e+3*r*n*n*t+n*n*n*i}function jF(s,e,t,i,n){const r=t.frame-e.frame,o=r<=0?0:(s.frame-e.frame)/r;let a=0;for(let c=0;c[...i].sort((a,c)=>a-c);let r=!0;for(;r;){r=!1;const a=n();for(let c=0;cf&&(f=m,d=p)}d>=0&&(i.add(d),r=!0)}}const o=n();return{samples:o.map(a=>s[a]),controls:o.slice(0,-1).map((a,c)=>Ov(s,a,o[c+1]))}}function WF(s){if(!s.length)return[];const e=[s[0]];for(let t=1;t180;)i-=360;for(;i-e[t-1]<-180;)i+=360;e.push(i)}return e}function ti(s){if(!Number.isFinite(s))return 0;const e=Math.round(s*1e5)/1e5;return Object.is(e,-0)?0:e}function zF(s,e,t,i){const n=Math.max(2,Math.min(16,Math.round(Number(s.trailGridRows)||2))),r=Math.max(2,Math.min(32,Math.round(Number(s.trailGridCols)||2))),o=Math.max(2,t.length),a=e.lengthMode==="random"?Math.max(1,Number(e.lengthMin)||0,Number(e.lengthMax)||0):Math.max(.001,Number(e.length)||100),c=e.widthSizeMode==="random"?Math.max(1,Number(e.widthMin)||0,Number(e.widthMax)||0):Math.max(.001,Number(e.width)||100),l=(Number(e.rotation)||0)*Math.PI/180,h=Math.cos(l),u=Math.sin(l),d=[],f=[],p=[],m=[],g=[];for(let y=0;y=0;y--)g.push({col:y,row:n-1});for(let y=n-2;y>=1;y--)g.push({col:0,row:y});const v=g.length;for(let y=1;y|\s]+/g,"_").replace(/^_+|_+$/g,"")||e}function ww(s,e){let t=s,i=2;for(;e.has(t);)t=`${s}_${i++}`;return e.add(t),t}function KF(s){return s.replace(/\.[^./\\]+$/,"")}function Sw(s,e){return KF([s,e].filter(Boolean).join("/").replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/^\.\//,""))}function ZF(s){var i,n;const e=Number(((i=s==null?void 0:s.orig)==null?void 0:i.width)??(s==null?void 0:s.width))||0,t=Number(((n=s==null?void 0:s.orig)==null?void 0:n.height)??(s==null?void 0:s.height))||0;return{width:e,height:t}}function fc(s){return Math.round(Math.max(0,Math.min(1,s))*255).toString(16).padStart(2,"0")}function Uv(s,e){return[(s>>16&255)/255,(s>>8&255)/255,(s&255)/255,Math.max(0,Math.min(1,e))]}function Ga(s,e){return ti(s/e)}function JF(s,e){const t=s.config,i=t.lifeMode==="fixed"?Math.max(0,Number(t.lifeMin)||0):Math.max(0,Number(t.lifeMin)||0,Number(t.lifeMax)||0),n=Math.max(0,Number(t.delay)||0);let r;return t.mode!=="stream"?r=n+i:t.streamBehavior!=="loop"?r=n+Math.max(1/e,Number(t.duration)||0)+i:r=n+lr(t,e).total/e,Math.max(1,Math.ceil(r*e)+1)}function xh(s,e){return e?s.boneName:`${s.spawnId??"legacy"}_${s.boneName}`}function QF(s,e,t){const i=new Set;for(const n of s)for(const r of n)i.add(xh(r,e));return[...i].sort().map((n,r)=>({key:n,name:ww(`_particle_${String(r).padStart(3,"0")}`,t),states:s.map(o=>o.find(a=>xh(a,e)===n)||null)}))}function $v(s,e){const t=new Set(e.states.map(i=>i==null?void 0:i.resourceId).filter(i=>typeof i=="number"));return s.config.imageResources.filter(i=>t.has(i.id))}function e3(s,e,t,i){const n=e*t/i,r=Math.min(s.states.length-1,Math.max(0,Math.floor(n))),o=Math.min(s.states.length-1,r+1),a=s.states[r],c=s.states[o];if(!a||!c||xh(a,!0)!==xh(c,!0)||a.spawnId!==c.spawnId)return a;const l=n-r;if(l<=1e-6)return a;const h=(d,f)=>(d??0)+((f??d??0)-(d??0))*l,u=a.trailState&&c.trailState&&a.trailState.resourceId===c.trailState.resourceId?{...a.trailState,width:h(a.trailState.width,c.trailState.width),alpha:h(a.trailState.alpha,c.trailState.alpha),bones:a.trailState.bones.map((d,f)=>{const p=c.trailState.bones[f]||d;return{...d,worldX:h(d.worldX??d.x,p.worldX??p.x),worldY:h(d.worldY??d.y,p.worldY??p.y),worldRotation:h(d.worldRotation??-d.rotation,p.worldRotation??-p.rotation)}})}:a.trailState;return{...a,worldX:h(a.worldX,c.worldX),worldY:h(a.worldY,c.worldY),worldRotation:h(a.worldRotation,c.worldRotation),worldScaleX:h(a.worldScaleX,c.worldScaleX),worldScaleY:h(a.worldScaleY,c.worldScaleY),alpha:h(a.alpha,c.alpha),trailState:u}}function Xv(s,e){return!s||s==="跟随导出"?e.keyframeCurve:s==="贝塞尔"?"bezier":"linear"}function _o(s,e,t,i,n,r=new Set,o=n.keyframeCurve){if(!s.length)return[];const a=o==="bezier"&&n.spineVersion!=="3.8"?bw(s,i,r):{samples:xw(s,i,r),controls:[]},c=a.samples.map(l=>{const h={time:Ga(l.frame,e)};return t.forEach((u,d)=>{h[u]=ti(l.values[d])}),h});for(let l=0;l0&&n&&e.add(t-1),i&&e.add(t))}return e}function i3(s){const e=new Set;for(let t=0;t0&&n&&e.add(t-1),i&&e.add(t))}return e}function s3(s,e){var i;if(!s.shapeEnabled||!((i=s.shapeCurve)!=null&&i.length))return 1;const t=[...s.shapeCurve].sort((n,r)=>n.x-r.x);if(e<=t[0].x)return Math.max(0,t[0].y);for(let n=1;n{r!==n&&(i.push(t(r,o)),n=r)}),i}function r3(s,e,t){const i=s.imageMode==="sequence"?s.sequenceFrames[e]:void 0,n=(i==null?void 0:i.name)||s.textureName||`image_${s.id}`,r=(i==null?void 0:i.texture)||s.texture,o=ZF(r);(!o.width||!o.height)&&t.push({code:"missing-image",message:`图片“${n}”缺失或尺寸不可读,已保留路径。`});const a=o.width||1,c=o.height||1;return{path:Sw(s.textureFolder,n),x:ti((.5-s.anchorX)*a),y:ti((s.anchorY-.5)*c),width:ti(a),height:ti(c)}}function o3(s,e,t,i,n=i.keyframeCurve){if(!s.length)return[];const r=new Set;for(let h=1;h({frame:u,values:h})),a=1/255,c=n==="bezier"&&i.spineVersion!=="3.8"?bw(o,[a,a,a,.01],r):{samples:xw(o,[a,a,a,.01],r),controls:[]},l=c.samples.map(h=>({time:Ga(h.frame,t),color:`${fc(h.values[0])}${fc(h.values[1])}${fc(h.values[2])}${fc(h.values[3])}`}));if(c.controls.length)for(let h=0;h({time:Ga(d,n),name:u??null}));c.length&&(a.attachment=c);const l=o3(i,t,n,r,o);l.length&&(a.rgba=l)}function Yv(s){var p;const e=s.settings,t=Math.max(1,Number(s.timeline.fps)||30),i=Math.max(1,Math.round(e.fps||30)),n=e.integerFrameAlignment?i:t,r=[],o=s.systems.filter(m=>m.visible!==!1),a={skeleton:{hash:"",spine:e.spineVersion,x:0,y:0,width:0,height:0,images:e.imagesPath||"./images/"},bones:[{name:"root"}],slots:[],skins:[{name:"default",attachments:{}}],animations:{}};e.omitFps||(a.skeleton.fps=i);const c=a.skins[0].attachments,l=new Set(["root"]),h=[...new Set([...s.timeline.animations.length?s.timeline.animations:["animation"],...o.map(m=>m.animation||"animation")])],u=new Map;for(const m of o){const g=Math.min(((p=m.frames)==null?void 0:p.length)||0,JF(m,t)),v=(m.frames||[]).slice(0,g);v.length||r.push({code:"empty-cache",message:`“${m.config.name}”没有可用帧缓存。`});const x=ww(qF(m.config.name,`system_${m.id}`),l);a.bones.push({name:x,parent:"root"});const y=QF(v,e.bonePool,l),_=Math.max(0,(g-1)/t),C=Math.max(1,Math.ceil(_*n)+1),S=u.get(m.animation)||[];S.push({system:m,tracks:y,targetFrames:C}),u.set(m.animation,S);for(const b of y){a.bones.push({name:b.name,parent:x});const M=$v(m,b),I=new Set(M.map(O=>O.blend));for(const O of I){const D=`${b.name}_image_${O}`;a.slots.push({name:D,bone:b.name,color:"ffffff00",blend:Bv[O]});const $=c[D]||(c[D]={});for(const N of M.filter(U=>U.blend===O)){const U=N.imageMode==="sequence"?Math.max(1,N.sequenceFrames.length):1;for(let A=0;A{var L;return((L=P==null?void 0:P.trailState)==null?void 0:L.resourceId)===O.id}))continue;const D=Math.max(2,Math.min(16,Math.round(O.boneCount||3))),$=[];for(let P=0;Pa.bones.findIndex(L=>L.name===P)),A=Sw("",O.textureName||`trail_${O.id}`);(c[N]||(c[N]={}))[`trail_${O.id}`]=zF(m.config,O,U,A),O.texture||r.push({code:"missing-image",message:`拖尾图片“${O.textureName||O.id}”缺失,已保留路径。`})}const F=`${b.name}_image_`,E=`${b.name}_trail_`,k=a.slots.filter(O=>String(O.name).startsWith(F)||String(O.name).startsWith(E));k.length&&(a.slots=a.slots.filter(O=>!k.includes(O)),a.slots.push(...k.filter(O=>String(O.name).startsWith(E)),...k.filter(O=>String(O.name).startsWith(F))))}}for(const m of h){const g=u.get(m)||[],v={bones:{},slots:{}};let x=!1;for(const{system:y,tracks:_,targetFrames:C}of g)for(const S of _){const b=Array.from({length:C},(B,X)=>e3(S,X,t,n)),M=b.map(B=>!!(B!=null&&B.active)),I=[],F=[],E=[];b.forEach((B,X)=>{B!=null&&B.active&&(I.push({frame:X,values:[B.worldX??B.x,B.worldY??B.y]}),F.push(B.worldRotation??B.rotation),E.push({frame:X,values:[B.worldScaleX??B.scaleX,B.worldScaleY??B.scaleY]}))});const k=WF(F),O=I.map((B,X)=>({frame:B.frame,values:[k[X]??0]})),D=t3(b),$={},N=_o(I,n,["x","y"],[Lv,Lv],e,D),U=_o(O,n,["value"],[Nv],e,D),A=_o(E,n,["x","y"],[dc,dc],e,D);N.length&&($.translate=N),U.length&&($.rotate=U),A.length&&($.scale=A),Object.keys($).length&&(v.bones[S.name]=$,x=!0);const P=$v(y,S),L=new Set(P.map(B=>B.blend));for(const B of L){const X=[],V=[];let q=16777215;for(let le=0;leY.id===ue.resourceId):void 0,xe=!!ue&&M[le]&&ue.imageVisible!==!1&&(ae==null?void 0:ae.blend)===B;ue&&(ae==null?void 0:ae.blend)===B&&(q=ue.colorHex),X.push(xe?`image_${ae.id}_${ue.imageFrameIndex??0}`:null),V.push(Uv(q,xe?ue.alpha:0))}const ne=P.filter(le=>le.blend===B).filter(le=>le.independentAlpha==="curve").map(le=>Xv(le.alphaCurveMode,e)),re=ne.length?ne.includes("bezier")?"bezier":"linear":Xv(y.config.alphaMode==="curve"?y.config.curveMode:void 0,e);Vv(v,`${S.name}_image_${B}`,X,V,n,e,re),X.some(Boolean)&&(x=!0)}if(y.config.trail)for(const B of y.config.trailResources){const X=Math.max(2,Math.min(16,Math.round(B.boneCount||3))),V=b.map(Y=>{var j;return((j=Y==null?void 0:Y.trailState)==null?void 0:j.resourceId)===B.id?Y.trailState:void 0}),q=V.find(Y=>!!Y);if(!q)continue;const W=i3(V),ne=B.widthSizeMode==="random"?Math.max(1,Number(B.widthMin)||0,Number(B.widthMax)||0):Math.max(.001,Number(B.width)||100);let re=q;const le=V.map(Y=>(Y&&(re=Y),re));for(let Y=0;Y{const Me=ye==null?void 0:ye.bones[Math.min(ye.bones.length-1,Y)];if(!Me)return;const ve={x:Me.worldX??Me.x,y:Me.worldY??Me.y,rotation:Me.worldRotation??-Me.rotation};j.push({frame:we,values:[ve.x,ve.y]}),H.push({frame:we,values:[ve.rotation]}),G.push({frame:we,values:[1,Math.max(0,ye.width/ne)*ie]})});const fe=`${S.name}_trail_${B.id}_${Y}`,te={},oe=_o(j,n,["x","y"],[Dv,Dv],e,z),ce=_o(H,n,["value"],[Nv],e,z),Ce=_o(G,n,["x","y"],[dc,dc],e,z);oe.length&&(te.translate=oe),ce.length&&(te.rotate=ce),Ce.length&&(te.scale=Ce),Object.keys(te).length&&(v.bones[fe]=te)}const ue=V.map(()=>`trail_${B.id}`);let ae=q.colorHex;const xe=V.map(Y=>(Y&&(ae=Y.colorHex),Uv(ae,Y?Y.alpha:0)));Vv(v,`${S.name}_trail_${B.id}`,ue,xe,n,e),x=!0}}(x||!e.excludeEmptyAnimations)&&(a.animations[m]=v)}!Object.keys(a.animations).length&&!e.excludeEmptyAnimations&&(a.animations.animation={bones:{},slots:{}});const d=e.spineVersion==="3.8"?YF(a):a,f=JSON.stringify(d,null,2);return{json:d,text:f,warnings:r,particleSystemCount:o.length,animationCount:Object.keys(d.animations).length,boneCount:d.bones.length}}function a3(s,e){const t=new Blob([s.text],{type:"application/json;charset=utf-8"}),i=URL.createObjectURL(t),n=document.createElement("a");n.href=i,n.download=/\.json$/i.test(e)?e:`${e||"SpineParticle"}.json`,n.style.display="none",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3)}class z${constructor(){w(this,"array",[])}add(e){const t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!==void 0}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}}class l3{constructor(){w(this,"entries",{});w(this,"size",0)}add(e){const t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){const t=this.size;for(let i=0,n=e.length;i1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}toRgb888(){const e=t=>`0${(t*255).toString(16)}`.slice(-2);return+`0x${e(this.r)}${e(this.g)}${e(this.b)}`}static fromString(e,t=new Qi){return t.setFromString(e)}};w(Qi,"WHITE",new Qi(1,1,1,1)),w(Qi,"RED",new Qi(1,0,0,1)),w(Qi,"GREEN",new Qi(0,1,0,1)),w(Qi,"BLUE",new Qi(0,0,1,1)),w(Qi,"MAGENTA",new Qi(1,0,1,1));let tt=Qi;const Xt=class Xt{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*Xt.degRad)}static sinDeg(e){return Math.sin(e*Xt.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*Xt.radDeg}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){const t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return Xt.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,i){const n=Math.random(),r=t-e;return n<=(i-e)/r?e+Math.sqrt(n*r*(i-e)):t-Math.sqrt((1-n)*r*(t-i))}static isPowerOfTwo(e){return e&&(e&e-1)===0}};w(Xt,"epsilon",1e-5),w(Xt,"epsilon2",Xt.epsilon*Xt.epsilon),w(Xt,"PI",3.1415927),w(Xt,"PI2",Xt.PI*2),w(Xt,"invPI2",1/Xt.PI2),w(Xt,"radiansToDegrees",180/Xt.PI),w(Xt,"radDeg",Xt.radiansToDegrees),w(Xt,"degreesToRadians",Xt.PI/180),w(Xt,"degRad",Xt.degreesToRadians);let Ee=Xt;const as=class as{apply(e,t,i){return t===void 0||i===void 0?this.applyInternal(e):e+(t-e)*this.applyInternal(i)}};w(as,"linear",new class extends as{applyInternal(e){return e}}),w(as,"smooth",new class extends as{applyInternal(e){return e*e*(3-2*e)}}),w(as,"slowFast",new class extends as{applyInternal(e){return e*e}}),w(as,"fastSlow",new class extends as{applyInternal(e){return(e-1)*(e-1)*-1+1}}),w(as,"circle",new class extends as{applyInternal(e){return e<=.5?(e*=2,(1-Math.sqrt(1-e*e))/2):(e--,e*=2,(Math.sqrt(1-e*e)+1)/2)}});let qo=as;class c3 extends qo{constructor(t){super();w(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 q$ extends c3{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2===0?-1:1)+1}}const Qn=class Qn{static arrayCopy(e,t,i,n,r){for(let o=t,a=n;o=t?e:Qn.setArraySize(e,t,i)}static newArray(e,t){const i=[];for(let n=0;n0?this.items.pop():this.instantiator()}free(e){var t;(t=e.reset)==null||t.call(e),this.items.push(e)}freeAll(e){for(let t=0;tthis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}class J${constructor(e=32){w(this,"values");w(this,"addedValues",0);w(this,"lastValue",0);w(this,"mean",0);w(this,"dirty",!0);this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t{h.width=parseInt(i[1]),h.height=parseInt(i[2])},n.format=()=>{},n.filter=h=>{h.minFilter=Ye.enumValue(Qo,i[1]),h.magFilter=Ye.enumValue(Qo,i[2])},n.repeat=h=>{i[1].indexOf("x")!==-1&&(h.uWrap=ea.Repeat),i[1].indexOf("y")!==-1&&(h.vWrap=ea.Repeat)},n.pma=h=>{h.pma=i[1]==="true"};var r={};r.xy=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2])},r.size=h=>{h.width=parseInt(i[1]),h.height=parseInt(i[2])},r.bounds=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2]),h.width=parseInt(i[3]),h.height=parseInt(i[4])},r.offset=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2])},r.orig=h=>{h.originalWidth=parseInt(i[1]),h.originalHeight=parseInt(i[2])},r.offsets=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2]),h.originalWidth=parseInt(i[3]),h.originalHeight=parseInt(i[4])},r.rotate=h=>{const u=i[1];u==="true"?h.degrees=90:u!=="false"&&(h.degrees=parseInt(u))},r.index=h=>{h.index=parseInt(i[1])};let o=t.readLine();for(;o&&o.trim().length===0;)o=t.readLine();for(;!(!o||o.trim().length===0||t.readEntry(i,o)===0);)o=t.readLine();let a=null,c=null,l=null;for(;o!==null;)if(o.trim().length===0)a=null,o=t.readLine();else if(a){const h=new Tw(a,o);for(;;){const u=t.readEntry(i,o=t.readLine());if(u===0)break;const d=r[i[0]];if(d)d(h);else{c||(c=[]),l||(l=[]),c.push(i[0]);const f=[];for(let p=0;p0&&l&&l.length>0&&(h.names=c,h.values=l,c=null,l=null),h.u=h.x/a.width,h.v=h.y/a.height,h.degrees===90?(h.u2=(h.x+h.height)/a.width,h.v2=(h.y+h.width)/a.height):(h.u2=(h.x+h.width)/a.width,h.v2=(h.y+h.height)/a.height),this.regions.push(h)}else{for(a=new f3(o.trim());t.readEntry(i,o=t.readLine())!==0;){const h=n[i[0]];h&&h(a)}this.pages.push(a)}}findRegion(e){for(let t=0;t=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length===0))return 0;const i=t.indexOf(":");if(i===-1)return 0;e[0]=t.substr(0,i).trim();for(let n=1,r=i+1;;n++){const o=t.indexOf(",",r);if(o===-1)return e[n]=t.substr(r).trim(),n;if(e[n]=t.substr(r,o-r).trim(),r=o+1,n===4)return 4}}}class f3{constructor(e){w(this,"name");w(this,"minFilter",Qo.Nearest);w(this,"magFilter",Qo.Nearest);w(this,"uWrap",ea.ClampToEdge);w(this,"vWrap",ea.ClampToEdge);w(this,"texture",null);w(this,"width",0);w(this,"height",0);w(this,"pma",!1);w(this,"regions",[]);this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(const t of this.regions)t.texture=e}}class Tw extends _w{constructor(t,i){super();w(this,"page");w(this,"name");w(this,"x",0);w(this,"y",0);w(this,"offsetX",0);w(this,"offsetY",0);w(this,"originalWidth",0);w(this,"originalHeight",0);w(this,"index",0);w(this,"degrees",0);w(this,"names",null);w(this,"values",null);this.page=t,this.name=i,t.regions.push(this)}}const Ch=class Ch{constructor(e){w(this,"name");w(this,"timelineAttachment");w(this,"timelineSlots",Ch.empty);if(!e)throw new Error("name cannot be null.");this.name=e,this.timelineAttachment=this}isTimelineActive(e,t,i){let n=e[t];if(n.bone.isActive()){const r=(i?n.getAppliedPose():n.getPose()).getAttachment();if(r!=null&&r.timelineAttachment===this)return!0}for(let r=0,o=this.timelineSlots.length;r>1)*c;const l=i.appliedPose.deform;let h=this.vertices;const u=this.bones;if(!u){l.length>0&&(h=l);const m=i.bone.appliedPose,g=m.worldX,v=m.worldY,x=m.a,y=m.b,_=m.c,C=m.d;for(let S=n,b=a;b=this.regions.length&&(t=this.regions.length-1),t}getUVs(e){return this.uvs[e]}hasPathSuffix(){return this.pathSuffix}getPath(e,t){if(!this.pathSuffix)return e;let i=e;const n=(this.start+t).toString();for(let r=this.digits-n.length;r>0;r--)i+="0";return i+=n,i}static nextID(){return Fo._nextID++}};w(Fo,"_nextID",0);let ia=Fo;var bi;(function(s){s[s.hold=0]="hold",s[s.once=1]="once",s[s.loop=2]="loop",s[s.pingpong=3]="pingpong",s[s.onceReverse=4]="onceReverse",s[s.loopReverse=5]="loopReverse",s[s.pingpongReverse=6]="pingpongReverse"})(bi||(bi={}));const Mw=[bi.hold,bi.once,bi.loop,bi.pingpong,bi.onceReverse,bi.loopReverse,bi.pingpongReverse];class vp{constructor(e,t,i){w(this,"name");w(this,"timelines",[]);w(this,"timelineIds");w(this,"bones");w(this,"color",new tt(1,1,1,1));w(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.duration=i,this.timelineIds=new l3,this.bones=[],this.setTimelines(t)}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e;const t=e.length;this.timelineIds.clear(),this.bones.length=0;const i=new Set,n=e;for(let r=0;r0&&(t%=this.duration));const u=this.timelines;for(let d=0,f=u.length;dt)return r-i;return n-i}};function m3(s){return typeof s=="object"&&s!==null&&typeof s.slotIndex=="number"}class co extends Rt{constructor(t,i,...n){super(t,...n);w(this,"curves");this.curves=Ye.newFloatArray(t+i*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){const i=this.getFrameCount()+t*18;if(this.curves.length>i){const n=Ye.newFloatArray(i);Ye.arrayCopy(this.curves,0,n,0,i),this.curves=n}}setBezier(t,i,n,r,o,a,c,l,h,u,d){const f=this.curves;let p=this.getFrameCount()+t*18;n===0&&(f[i]=2+p);const m=(r-a*2+l)*.03,g=(o-c*2+h)*.03,v=((a-l)*3-r+u)*.006,x=((c-h)*3-o+d)*.006;let y=m*2+v,_=g*2+x,C=(a-r)*.3+m+v*.16666667,S=(c-o)*.3+g+x*.16666667,b=r+C,M=o+S;for(let I=p+18;pt){const h=this.frames[i],u=this.frames[i+n];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}const a=r+18;for(r+=2;r=t){const h=o[r-2],u=o[r-1];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}i+=this.getFrameEntries();const c=o[a-2],l=o[a-1];return l+(t-c)/(this.frames[i]-c)*(this.frames[i+n]-l)}}class En extends co{constructor(e,t,i){super(e,t,i)}getFrameEntries(){return 2}setFrame(e,t,i){e<<=1,this.frames[e]=t,this.frames[e+1]=i}getCurveValue(e){const t=this.frames;let i=t.length-2;for(let r=2;r<=i;r+=2)if(t[r]>e){i=r-2;break}const n=this.curves[i>>1];switch(n){case 0:{const r=t[i],o=t[i+1];return o+(e-r)/(t[i+2]-r)*(t[i+2+1]-o)}case 1:return t[i+1]}return this.getBezierValue(e,i,1,n-2)}getRelativeValue(e,t,i,n,r,o){if(e>2];switch(f){case 0:{const p=u[d];c=u[d+1],l=u[d+2],h=u[d+3];const m=(i-p)/(u[d+4]-p);c+=(u[d+4+1]-c)*m,l+=(u[d+4+2]-l)*m,h+=(u[d+4+3]-h)*m;break}case 1:c=u[d+1],l=u[d+2],h=u[d+3];break;default:c=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),h=this.getBezierValue(i,d,3,f+36-2)}if(n!==1)if(r===Ue.setup){const p=e.data.setupPose.color;c=p.r+(c-p.r)*n,l=p.g+(l-p.g)*n,h=p.b+(h-p.b)*n}else c=a.r+(c-a.r)*n,l=a.g+(l-a.g)*n,h=a.b+(h-a.b)*n;a.r=c<0?0:c>1?1:c,a.g=l<0?0:l>1?1:l,a.b=h<0?0:h>1?1:h}}class Nw extends En{constructor(t,i,n){super(t,i,`${Qe.alpha}|${n}`);w(this,"slotIndex",0);this.slotIndex=n}apply(t,i,n,r,o,a,c,l,h){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=(h?u.appliedPose:u.pose).color;let f=0;const p=this.frames;if(n1?1:f}}class Uw extends lu{constructor(e,t,i){super(e,t,i,`${Qe.rgb}|${i}`,`${Qe.alpha}|${i}`,`${Qe.rgb2}|${i}`)}getFrameEntries(){return 8}setFrame(e,t,i,n,r,o,a,c,l){e<<=3,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=n,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=c,this.frames[e+7]=l}apply1(e,t,i,n,r,o){const a=t.color,c=t.darkColor;let l=0,h=0,u=0;const d=this.frames;if(i>3];switch(x){case 0:{const y=d[v];f=d[v+1],p=d[v+2],m=d[v+3],g=d[v+4],l=d[v+5],h=d[v+6],u=d[v+7];const _=(i-y)/(d[v+8]-y);f+=(d[v+8+1]-f)*_,p+=(d[v+8+2]-p)*_,m+=(d[v+8+3]-m)*_,g+=(d[v+8+4]-g)*_,l+=(d[v+8+5]-l)*_,h+=(d[v+8+6]-h)*_,u+=(d[v+8+7]-u)*_;break}case 1:f=d[v+1],p=d[v+2],m=d[v+3],g=d[v+4],l=d[v+5],h=d[v+6],u=d[v+7];break;default:f=this.getBezierValue(i,v,1,x-2),p=this.getBezierValue(i,v,2,x+18-2),m=this.getBezierValue(i,v,3,x+36-2),g=this.getBezierValue(i,v,4,x+54-2),l=this.getBezierValue(i,v,5,x+72-2),h=this.getBezierValue(i,v,6,x+90-2),u=this.getBezierValue(i,v,7,x+108-2)}if(n===1)a.set(f,p,m,g);else if(r===Ue.setup){const y=e.data.setupPose;let _=y.color;a.set(_.r+(f-_.r)*n,_.g+(p-_.g)*n,_.b+(m-_.b)*n,_.a+(g-_.a)*n),_=y.darkColor,l=_.r+(l-_.r)*n,h=_.g+(h-_.g)*n,u=_.b+(u-_.b)*n}else a.add((f-a.r)*n,(p-a.g)*n,(m-a.b)*n,(g-a.a)*n),l=c.r+(l-c.r)*n,h=c.g+(h-c.g)*n,u=c.b+(u-c.b)*n;c.r=l<0?0:l>1?1:l,c.g=h<0?0:h>1?1:h,c.b=u<0?0:u>1?1:u}}class $w extends lu{constructor(e,t,i){super(e,t,i,`${Qe.rgb}|${i}`,`${Qe.rgb2}|${i}`)}getFrameEntries(){return 7}setFrame(e,t,i,n,r,o,a,c){e*=7,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=n,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=c}apply1(e,t,i,n,r,o){const a=t.color,c=t.darkColor;let l=0,h=0,u=0,d=0,f=0,p=0;const m=this.frames;if(i1?1:l,a.g=h<0?0:h>1?1:h,a.b=u<0?0:u>1?1:u,c.r=d<0?0:d>1?1:d,c.g=f<0?0:f>1?1:f,c.b=p<0?0:p>1?1:p}}class Ha extends Rt{constructor(t,i){super(t,`${Qe.attachment}|${i}`);w(this,"slotIndex",0);w(this,"attachmentNames");this.slotIndex=i,this.attachmentNames=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i,n){this.frames[t]=i,this.attachmentNames[t]=n}apply(t,i,n,r,o,a,c,l,h){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=h?u.appliedPose:u.pose;l||nt){const l=this.frames[i];return n[r+1]*(t-l)/(n[r]-l)}const o=r+18;for(r+=2;r=t){const l=n[r-2],h=n[r-1];return h+(t-l)/(n[r]-l)*(n[r+1]-h)}const a=n[o-2],c=n[o-1];return c+(1-c)*(t-a)/(this.frames[i+this.getFrameEntries()]-a)}apply(t,i,n,r,o,a,c,l,h){const u=t.slots;if(!this.attachment.isTimelineActive(u,this.slotIndex,h))return;const d=this.attachment.timelineSlots,f=this.frames;if(n=f[f.length-1])g=0,p=this.vertices[f.length-1],m=null;else{const x=Rt.search(f,n);g=this.getCurvePercent(n,x),p=this.vertices[x],m=this.vertices[x+1]}const v=this.vertices[0].length;this.applyToSlot(u[this.slotIndex],h,p,m,g,v,o,a,c);for(const x of d)this.applyToSlot(u[x],h,p,m,g,v,o,a,c)}applyBeforeFirst(t,i,n,r){if(!t.bone.active)return;const o=i?t.appliedPose:t.pose;if(o.attachment==null||o.attachment.timelineAttachment!==this.attachment)return;const a=o.deform;switch(a.length===0&&(r=Ue.setup),r){case Ue.setup:a.length=0;break;case Ue.first:{if(n===1){a.length=0;return}const c=this.vertices[0].length;a.length=c;const l=a,h=o.attachment;if(h.bones===null){const u=h.vertices;for(let d=0;d>4,h=c.attachment.sequence.regions.length;const u=Mw[o&15];if(u!==bi.hold)switch(l+=(n-r)/a+1e-5|0,u){case bi.once:l=Math.min(h-1,l);break;case bi.loop:l%=h;break;case bi.pingpong:{const d=(h<<1)-2;l=d===0?0:l%d,l>=h&&(l=d-l);break}case bi.onceReverse:l=Math.max(h-1-l,0);break;case bi.loopReverse:l=h-1-l%h;break;case bi.pingpongReverse:{const d=(h<<1)-2;l=d===0?0:(l+h-1)%d,l>=h&&(l=d-l)}}c.sequenceIndex=l}};w(ls,"ENTRIES",3),w(ls,"MODE",1),w(ls,"DELAY",2);let Sh=ls;const Eh=class Eh extends Rt{constructor(t){super(t,...Eh.propertyIds);w(this,"events");this.events=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i.time,this.events[t]=i}apply(t,i,n,r,o,a,c,l,h){if(!r)return;const u=this.frames,d=this.frames.length;if(i>n)this.apply(null,i,Number.MAX_VALUE,r,0,a,!1,!1,!1),i=-1;else if(i>=u[d-1])return;if(n0&&u[f-1]===p;)f--}for(;f=u[f];f++)r.push(this.events[f])}};w(Eh,"propertyIds",[`${Qe.event}`]);let ul=Eh;const Oo=class Oo extends Rt{constructor(t){super(t,...Oo.propertyIds);w(this,"drawOrders");this.drawOrders=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i,n){this.frames[t]=i,this.drawOrders[t]=n}apply(t,i,n,r,o,a,c,l,h){const u=h?t.drawOrder.appliedPose:t.drawOrder.pose,d=t.slots;if(l||n>2];switch(x){case 0:{const _=f[v];p=f[v+1],m=f[v+2],g=f[v+3];const C=(n-_)/(f[v+4]-_);p+=(f[v+4+1]-p)*C,m+=(f[v+4+2]-m)*C,g+=(f[v+4+3]-g)*C;break}case 1:p=f[v+1],m=f[v+2],g=f[v+3];break;default:p=this.getBezierValue(n,v,1,x-2),m=this.getBezierValue(n,v,2,x+18-2),g=this.getBezierValue(n,v,3,x+36-2)}const y=a===Ue.setup?u.data.setupPose:d;c?(d.mixRotate=y.mixRotate+p*o,d.mixX=y.mixX+m*o,d.mixY=y.mixY+g*o):(d.mixRotate=y.mixRotate+(p-y.mixRotate)*o,d.mixX=y.mixX+(m-y.mixX)*o,d.mixY=y.mixY+(g-y.mixY)*o)}}class xr extends _l{constructor(e,t,i,n){super(e,t,i,n)}apply(e,t,i,n,r,o,a,c,l){if(a&&!this.additive&&(a=!1),this.constraintIndex===-1){const h=i>=this.frames[0]?this.getCurveValue(i):0,u=e.physics;for(const d of u)if(d.active&&this.global(d.data)){const f=l?d.appliedPose:d.pose;this.set(f,this.getAbsoluteValue(i,r,o,a,this.get(f),this.get(d.data.setupPose),h))}}else{const h=e.constraints[this.constraintIndex];if(h.active){const u=l?h.appliedPose:h.pose;this.set(u,this.getAbsoluteValue(i,r,o,a,this.get(u),this.get(h.data.setupPose)))}}}}class Ww extends xr{constructor(e,t,i){super(e,t,i,Qe.physicsConstraintInertia)}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}}class zw extends xr{constructor(e,t,i){super(e,t,i,Qe.physicsConstraintStrength)}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}}class qw extends xr{constructor(e,t,i){super(e,t,i,Qe.physicsConstraintDamping)}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}}class Kw extends xr{constructor(e,t,i){super(e,t,i,Qe.physicsConstraintMass)}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}}class Zw extends xr{constructor(e,t,i){super(e,t,i,Qe.physicsConstraintWind),this.additive=!0}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}}class Jw extends xr{constructor(e,t,i){super(e,t,i,Qe.physicsConstraintGravity),this.additive=!0}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}}class Qw extends xr{constructor(e,t,i){super(e,t,i,Qe.physicsConstraintMix)}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}}const Ih=class Ih extends Rt{constructor(t,i){super(t,...Ih.propertyIds);w(this,"constraintIndex");this.constraintIndex=i,this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i}apply(t,i,n,r,o,a,c,l,h){let u;if(this.constraintIndex!==-1&&(u=t.constraints[this.constraintIndex],!u.active))return;const d=this.frames;if(i>n)this.apply(t,i,Number.MAX_VALUE,[],o,a,!1,!1,!1),i=-1;else if(i>=d[d.length-1])return;if(!(n=d[Rt.search(d,i)+1]))if(u!=null)u.reset(t);else for(const f of t.physics)f.active&&f.reset(t)}};w(Ih,"propertyIds",[Qe.physicsConstraintReset.toString()]);let _h=Ih;class eS extends _l{constructor(e,t,i){super(e,t,i,Qe.sliderTime)}apply(e,t,i,n,r,o,a,c,l){const h=e.constraints[this.constraintIndex];if(h.active){const u=l?h.appliedPose:h.pose;u.time=this.getAbsoluteValue(i,r,o,a,u.time,h.data.setupPose.time)}}}class tS extends _l{constructor(e,t,i){super(e,t,i,Qe.sliderMix),this.additive=!0}apply(e,t,i,n,r,o,a,c,l){const h=e.constraints[this.constraintIndex];if(h.active){const u=l?h.appliedPose:h.pose;u.mix=this.getAbsoluteValue(i,r,o,a,u.mix,h.data.setupPose.mix)}}}const za=class za{constructor(e){w(this,"data");w(this,"tracks",[]);w(this,"timeScale",1);w(this,"unkeyedState",0);w(this,"events",[]);w(this,"listeners",[]);w(this,"queue",new y3(this));w(this,"propertyIds",new Map);w(this,"animationsChanged",!1);w(this,"trackEntryPool",new h3(()=>new v3));this.data=e}update(e){e*=this.timeScale;const t=this.tracks;for(let i=0,n=t.length;i0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){const c=r.trackLast-a.delay;if(c>=0){for(a.delay=0,a.trackTime+=r.timeScale===0?0:(c/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setTrack(i,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[i]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let c=r.mixingFrom;for(r.mixingFrom=null,c&&(c.mixingTo=null);c;)this.queue.end(c),c=c.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){const i=e.mixingFrom;if(!i)return!0;const n=this.updateMixingFrom(i,t);if(i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,e.nextTrackLast!==-1&&e.mixTime>=e.mixDuration){if(i.totalAlpha===0||e.mixDuration===0){if(e.mixingFrom=i.mixingFrom,i.mixingFrom!=null&&(i.mixingFrom.mixingTo=e),i.totalAlpha===0)for(let r=e;r.mixingTo!=null;r=r.mixingTo)r.keepHold=!0;this.queue.end(i)}return n}return i.trackTime+=t*i.timeScale,e.mixTime+=t,!1}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const t=this.events,i=this.tracks;let n=!1;for(let a=0,c=i.length;a0)continue;n=!0;let h=l.alpha;l.mixingFrom?h*=this.applyMixingFrom(l,e):l.trackTime>=l.trackEnd&&!l.next&&(h=0);let u=l.animationLast,d=l.getAnimationTime(),f=d,p=t;l.reverse&&(f=l.animation.duration-f,p=null);const m=l.animation.timelines,g=m.length;if(a===0&&h===1)for(let v=0;v=l.alphaAttachmentThreshold,y=l.additive,_=y||l.shortestRotation,C=!_&&l.timelinesRotation.length!==g<<1;C&&(l.timelinesRotation.length=g<<1);for(let S=0;S0?c/a:o,h=i.animation.timelines,u=h.length,d=i.timelineMode,f=i.timelineHoldMix,p=r=i.alphaAttachmentThreshold);else{const O=!m||!(I instanceof dr)||E===Ue.current;I.apply(t,_,S,b,k,E,g,O,!1)}}return i.reverse&&r0&&this.queueEvents(i,C),this.events.length=0,i.nextAnimationLast=C,i.nextTrackLast=i.trackTime,r}applyAttachmentTimeline(e,t,i,n,r){const o=t.slots[e.slotIndex];if(!o.bone.active||!r&&o.attachmentState===this.unkeyedState+Kv)return;let a=i=0,C=v>=0;Math.abs(x)<=90&&Ee.signum(x)!==Ee.signum(g)&&(Math.abs(v-y)>180?(m+=360*Ee.signum(v),C=_):y!==0?m-=360*Ee.signum(v):C=_),C!==_&&(m+=360*Ee.signum(v)),o[a]=m}o[a+1]=g,h.rotation=f+m*n}queueEvents(e,t){const i=e.animationStart,n=e.animationEnd,r=n-i,o=e.reverse;let a=e.trackLast%r;o&&(a=r-a);const c=this.events;let l=0,h=c.length;for(;l=i&&d.time<=n&&this.queue.event(e,d)}let u=!1;if(e.loop)if(r===0)u=!0;else{const d=Math.floor(e.trackTime/r);u=d>0&&d>Math.floor(e.trackLast/r)}else u=t>=n&&e.animationLast=i&&d.time<=n&&this.queue.event(e,d)}}eventsReverse(e,t,i){const n=e.animation.duration,r=n-t,o=n-i,a=e.animation.timelines;for(let c=0,l=e.animation.timelines.length;c=o){for(let p=0;p=r)break;this.events.push(u[p])}}else{for(let m=0;m=r);m++)this.events.push(u[m]);let p=0;for(;p=o);p++);for(;p= 0.");if(e>=this.tracks.length)return;const t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let i=t;for(;;){const n=i.mixingFrom;if(!n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[t.trackIndex]=null,this.queue.drain()}setTrack(e,t,i){const n=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,n&&(n.next=null,i&&this.queue.interrupt(n),t.mixingFrom=n,n.mixingTo=t,t.mixTime=0,n.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,i=!1){return typeof t=="string"?this.setAnimation1(e,t,i):this.setAnimation2(e,t,i)}setAnimation1(e,t,i=!1){const n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error(`Animation not found: ${t}`);return this.setAnimation2(e,n,i)}setAnimation2(e,t,i=!1){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let n=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast===-1&&r.animation===t?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,n=!1):this.clearNext(r));const o=this.trackEntry(e,t,i,r);return this.setTrack(e,o,n),this.queue.drain(),o}addAnimation(e,t,i=!1,n=0){return typeof t=="string"?this.addAnimation1(e,t,i,n):this.addAnimation2(e,t,i,n)}addAnimation1(e,t,i=!1,n=0){const r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error(`Animation not found: ${t}`);return this.addAnimation2(e,r,i,n)}addAnimation2(e,t,i=!1,n=0){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;const o=this.trackEntry(e,t,i,r);return r?(r.next=o,o.previous=r,n<=0&&(n=Math.max(n+r.getTrackComplete()-o.mixDuration,0))):(this.setTrack(e,o,!0),this.queue.drain(),n<0&&(n=0)),o.delay=n,o}setEmptyAnimation(e,t=0){const i=this.setAnimation(e,za.emptyAnimation,!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){const n=this.addAnimation(e,za.emptyAnimation,!1,i);return i<=0&&(n.delay=Math.max(n.delay+n.mixDuration-t,0)),n.mixDuration=t,n.trackEnd=t,n}setEmptyAnimations(e=0){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let i=0,n=this.tracks.length;i0&&(o[d]=v);break}}c&&(g=g&~mc|r[d]&mc),r[d]=g}}from(e,t,i){const n=this.propertyIds;let r=x3;for(let o=0,a=i.length;o= 0.");return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){const t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}};w(za,"emptyAnimation",new vp("",[],0));let Hv=za;class v3{constructor(){w(this,"animation",null);w(this,"previous",null);w(this,"next",null);w(this,"mixingFrom",null);w(this,"mixingTo",null);w(this,"listener",null);w(this,"trackIndex",0);w(this,"loop",!1);w(this,"additive",!1);w(this,"reverse",!1);w(this,"shortestRotation",!1);w(this,"keepHold",!1);w(this,"eventThreshold",0);w(this,"mixAttachmentThreshold",0);w(this,"alphaAttachmentThreshold",0);w(this,"mixDrawOrderThreshold",0);w(this,"animationStart",0);w(this,"animationEnd",0);w(this,"animationLast",0);w(this,"nextAnimationLast",0);w(this,"delay",0);w(this,"trackTime",0);w(this,"trackLast",0);w(this,"nextTrackLast",0);w(this,"trackEnd",0);w(this,"timeScale",0);w(this,"alpha",0);w(this,"mixTime",0);w(this,"mixDuration",0);w(this,"totalAlpha",0);w(this,"mixInterpolation",qo.linear);w(this,"timelineMode",[]);w(this,"timelineHoldMix",[]);w(this,"timelinesRotation",[])}setMixDuration(e,t){this.mixDuration=e,t!==void 0&&(t<=0&&(t=this.previous==null?0:Math.max(t+this.previous.getTrackComplete()-e,0)),this.delay=t)}setMixInterpolation(e){if(!e)throw new Error("mixInterpolation cannot be null.");this.mixInterpolation=e}mix(){if(this.mixDuration===0)return 1;let e=this.mixTime/this.mixDuration;return e>=1?1:this.mixInterpolation===qo.linear?e:(e=this.mixInterpolation.apply(e),e<0?0:e>1?1:e)}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.mixInterpolation=qo.linear,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(!this.loop)return Math.min(this.trackTime+this.animationStart,this.animationEnd);const e=this.animationEnd-this.animationStart;return e===0?this.animationStart:this.trackTime%e+this.animationStart}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){const e=this.animationEnd-this.animationStart;if(e!==0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime=0}}class y3{constructor(e){w(this,"objects",[]);w(this,"drainDisabled",!1);w(this,"animState");this.animState=e}start(e){this.objects.push(Wi.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(Wi.interrupt),this.objects.push(e)}end(e){this.objects.push(Wi.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(Wi.dispose),this.objects.push(e)}complete(e){this.objects.push(Wi.complete),this.objects.push(e)}event(e,t){this.objects.push(Wi.event),this.objects.push(e),this.objects.push(t)}drain(){var e,t,i,n,r,o;if(!this.drainDisabled){this.drainDisabled=!0;for(let a=0;a= 0.");if(!i)throw new Error("name cannot be null.");this.index=t,this.parent=n}copy(t){const i=new hu(this.index,this.name,t);return i.length=this.length,i.setupPose.set(this.setupPose),i}}var Yt;(function(s){s[s.Normal=0]="Normal",s[s.OnlyTranslation=1]="OnlyTranslation",s[s.NoRotationOrReflection=2]="NoRotationOrReflection",s[s.NoScale=3]="NoScale",s[s.NoScaleOrReflection=4]="NoScaleOrReflection"})(Yt||(Yt={}));class mm{constructor(){w(this,"bone");w(this,"x",0);w(this,"y",0);w(this,"rotation",0);w(this,"scaleX",0);w(this,"scaleY",0);w(this,"shearX",0);w(this,"shearY",0);w(this,"inherit",Yt.Normal);w(this,"a",0);w(this,"b",0);w(this,"c",0);w(this,"d",0);w(this,"worldY",0);w(this,"worldX",0);w(this,"world",0);w(this,"local",0)}set(e){if(e==null)throw new Error("pose cannot be null.");this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}setPosition(e,t){this.x=e,this.y=t}setScale(e,t){this.scaleX=e,this.scaleY=t===void 0?e:t}getInherit(){return this.inherit}setInherit(e){if(e==null)throw new Error("inherit cannot be null.");this.inherit=e}update(e,t){this.world!==e._update&&this.updateWorldTransform(e)}updateWorldTransform(e){this.local===e._update?this.updateLocalTransform(e):this.world=e._update;const t=this.rotation,i=this.scaleX,n=this.scaleY,r=this.shearX,o=this.shearY;if(!this.bone.parent){const d=e.scaleX,f=e.scaleY,p=(t+r)*Ee.degRad,m=(t+90+o)*Ee.degRad;this.a=Math.cos(p)*i*d,this.b=Math.cos(m)*n*d,this.c=Math.sin(p)*i*f,this.d=Math.sin(m)*n*f,this.worldX=this.x*d+e.x,this.worldY=this.y*f+e.y;return}const a=this.bone.parent.appliedPose;let c=a.a,l=a.b,h=a.c,u=a.d;switch(this.worldX=c*this.x+l*this.y+a.worldX,this.worldY=h*this.x+u*this.y+a.worldY,this.inherit){case Yt.Normal:{const d=(t+r)*Ee.degRad,f=(t+90+o)*Ee.degRad,p=Math.cos(d)*i,m=Math.cos(f)*n,g=Math.sin(d)*i,v=Math.sin(f)*n;this.a=c*p+l*g,this.b=c*m+l*v,this.c=h*p+u*g,this.d=h*m+u*v;return}case Yt.OnlyTranslation:{const d=e.scaleX,f=e.scaleY,p=(t+r)*Ee.degRad,m=(t+90+o)*Ee.degRad;this.a=Math.cos(p)*i*d,this.b=Math.cos(m)*n*d,this.c=Math.sin(p)*i*f,this.d=Math.sin(m)*n*f;break}case Yt.NoRotationOrReflection:{const d=e.scaleX,f=e.scaleY,p=1/d,m=1/f;c*=p,h*=m;let g=c*c+h*h,v=0;g>Ee.epsilon2?(g=Math.abs(c*u*m-l*p*h)/g,l=h*g,u=c*g,v=t-Ee.atan2Deg(h,c)):(c=0,h=0,v=t-90+Ee.atan2Deg(u,l));const x=(v+r)*Ee.degRad,y=(v+o+90)*Ee.degRad,_=Math.cos(x)*i,C=Math.cos(y)*n,S=Math.sin(x)*i,b=Math.sin(y)*n;this.a=(c*_-l*S)*d,this.b=(c*C-l*b)*d,this.c=(h*_+u*S)*f,this.d=(h*C+u*b)*f;break}case Yt.NoScale:case Yt.NoScaleOrReflection:{const d=e.scaleX,f=e.scaleY,p=1/d,m=1/f,g=t*Ee.degRad,v=Math.cos(g),x=Math.sin(g);let y=(c*v+l*x)*p,_=(h*v+u*x)*m;const C=1/Math.sqrt(y*y+_*_);y*=C,_*=C;let S=-_,b=y;this.inherit===Yt.NoScale&&c*u-l*h<0!=(d<0!=f<0)&&(S=-S,b=-b);const M=r*Ee.degRad,I=(90+o)*Ee.degRad,F=Math.cos(M)*i,E=Math.cos(I)*n,k=Math.sin(M)*i,O=Math.sin(I)*n;this.a=(y*F+S*k)*d,this.b=(y*E+S*O)*d,this.c=(_*F+b*k)*f,this.d=(_*E+b*O)*f;break}}}updateLocalTransform(e){this.local=0,this.world=e._update;const t=e.scaleX,i=e.scaleY;if(!this.bone.parent){const v=1/t,x=1/i;this.x=(this.worldX-e.x)*v,this.y=(this.worldY-e.y)*x,this.set5(this.a*v,this.b*v,this.c*x,this.d*x,0);return}const n=this.bone.parent.appliedPose;let r=n.a,o=n.b,a=n.c,c=n.d;const l=r*c-o*a,h=1/(r*c-o*a),u=c*h,d=o*h,f=a*h,p=r*h,m=this.worldX-n.worldX,g=this.worldY-n.worldY;switch(this.x=m*u-g*d,this.y=g*p-m*f,this.inherit){case Yt.Normal:this.set5(u*this.a-d*this.c,u*this.b-d*this.d,p*this.c-f*this.a,p*this.d-f*this.b,0);break;case Yt.OnlyTranslation:{const v=1/t,x=1/i;this.set5(this.a*v,this.b*v,this.c*x,this.d*x,0);break}case Yt.NoRotationOrReflection:{const v=1/t,x=1/i;r*=v,a*=x;const y=this.a*v,_=this.b*v,C=this.c*x,S=this.d*x,b=1/(r*r+a*a),M=1/Math.abs(l*v*x);this.set5((r*y+a*C)*b,(r*_+a*S)*b,(r*C-a*y)*M,(r*S-a*_)*M,Ee.atan2Deg(a,r));break}case Yt.NoScale:case Yt.NoScaleOrReflection:{const v=1/t,x=1/i,y=this.a*v,_=this.b*v,C=this.c*x,S=this.d*x;let b=c*this.a-o*this.c,M=r*this.c-a*this.a;l<0&&(b=-b,M=-M);let I=Ee.atan2Deg(M,b);this.rotation=I,I*=Ee.degRad;const F=Math.cos(I),E=Math.sin(I);let k=(r*F+o*E)*v,O=(a*F+c*E)*x;const D=1/Math.sqrt(k*k+O*O);k*=D,O*=D;const $=this.inherit===Yt.NoScale&&l<0!=(t<0!=i<0)?-1:1;this.set4(k*y+O*C,k*_+O*S,(k*C-O*y)*$,(k*S-O*_)*$)}}}set4(e,t,i,n){const r=e*e+i*i,o=t*t+n*n;r>Ee.epsilon2?(this.shearX=Ee.atan2Deg(i,e),this.scaleX=Math.sqrt(r)):(this.shearX=0,this.scaleX=0),this.scaleY=Math.sqrt(o),o>Ee.epsilon2?(this.shearY=Ee.atan2Deg(n,t),e*n-t*i<0?(this.scaleY=-this.scaleY,this.shearY+=90):this.shearY-=90,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}set5(e,t,i,n,r){this.shearX=0;const o=e*e+i*i,a=t*t+n*n;if(o>Ee.epsilon2){const c=Ee.atan2Deg(i,e);this.rotation=c+r,this.scaleX=Math.sqrt(o),this.scaleY=Math.sqrt(a),a>Ee.epsilon2?(this.shearY=Ee.atan2Deg(n,t),e*n-t*i<0?(this.scaleY=-this.scaleY,this.shearY+=90-c):this.shearY-=90+c,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}else this.scaleX=0,this.scaleY=Math.sqrt(a),this.shearY=0,this.rotation=a>Ee.epsilon2?Ee.atan2Deg(n,t)-90+r:r}validateLocalTransform(e){this.local===e._update&&this.updateLocalTransform(e)}modifyLocal(e){this.local===e._update&&this.updateLocalTransform(e),this.world=0,this.resetWorld(e,e._update)}modifyWorld(e){const t=e._update;this.local=t,this.world=t,this.resetWorld(e,t)}resetWorld(e,t){const i=this.bone.children;for(let n=0,r=i.length;n1&&t.constrained(this.bones[1].bone)}isSourceActive(){return this.target.active}static apply(t,i,n,r,o,a,c,l,h,u){typeof n=="number"?Jn.apply1(t,i,n,r,o,a,c,l):Jn.apply2(t,i,n,r,o,a,c,l,h,u)}static apply1(t,i,n,r,o,a,c,l){i.modifyLocal(t);const h=i.bone.parent.appliedPose;let u=h.a,d=h.b,f=h.c,p=h.d,m=-i.shearX-i.rotation,g=0,v=0;switch(i.inherit){case Yt.OnlyTranslation:g=(n-i.worldX)*Ee.signum(t.scaleX),v=(r-i.worldY)*Ee.signum(t.scaleY);break;case Yt.NoRotationOrReflection:{const x=Math.abs(u*p-d*f)/Math.max(Ee.epsilon,u*u+f*f),y=u/t.scaleX,_=f/t.scaleY;d=-_*x*t.scaleX,p=y*x*t.scaleY,m+=Ee.atan2Deg(_,y)}default:{const x=n-h.worldX,y=r-h.worldY,_=u*p-d*f;Math.abs(_)<=Ee.epsilon?(g=0,v=0):(g=(x*p-y*d)/_-i.x,v=(y*u-x*f)/_-i.y)}}if(m+=Ee.atan2Deg(v,g),i.scaleX<0&&(m+=180),m>180?m-=360:m<=-180&&(m+=360),i.rotation+=m*l,o||a){switch(i.inherit){case Yt.NoScale:case Yt.NoScaleOrReflection:g=n-i.worldX,v=r-i.worldY}const x=i.bone.data.length*i.scaleX;if(x>Ee.epsilon){const y=g*g+v*v;if(o&&yx*x){const _=(Math.sqrt(y)/x-1)*l+1;switch(i.scaleX*=_,c){case Ni.Uniform:i.scaleY*=_;break;case Ni.Volume:i.scaleY/=_<.7?.25+.642857*_:_}}}}}static apply2(t,i,n,r,o,a,c,l,h,u){if(i.inherit!==Yt.Normal||n.inherit!==Yt.Normal)return;i.modifyLocal(t),n.modifyLocal(t);let d=i.x,f=i.y,p=i.scaleX,m=i.scaleY,g=n.scaleX,v=0,x=0,y=0;p<0?(p=-p,v=180,y=-1):(v=0,y=1),m<0&&(m=-m,y=-y),g<0?(g=-g,x=180):x=0;let _=0,C=0,S=i.a,b=i.b,M=i.c,I=i.d;const F=Math.abs(p-m)<=Ee.epsilon;!F||c?(n.y=0,_=S*n.x+i.worldX,C=M*n.x+i.worldY):(_=S*n.x+b*n.y+i.worldX,C=M*n.x+I*n.y+i.worldY);const E=i.bone.parent.appliedPose;S=E.a,b=E.b,M=E.c,I=E.d;let k=S*I-b*M,O=_-E.worldX,D=C-E.worldY;k=Math.abs(k)<=Ee.epsilon?0:1/k;const $=(O*I-D*b)*k-d,N=(D*S-O*M)*k-f;let U=Math.sqrt($*$+N*N),A=n.bone.data.length*g,P,L;if(U0){let re=Math.min(1,ne/(h*2))-1;re=(ne-h*(1-re*re))/W,B-=re*B,X-=re*X,V=B*B+X*X}}e:if(F){A*=p;let W=(V-U*U-A*A)/(2*U*A);if(W<-1)W=-1,L=Math.PI*a;else if(W>1){if(W=1,L=0,c)switch(S=(Math.sqrt(V)/(U+A)-1)*u+1,i.scaleX*=S,l){case Ni.Uniform:i.scaleY*=S;break;case Ni.Volume:i.scaleY/=S<.7?.25+.642857*S:S}}else L=Math.acos(W)*a;S=U+A*W,b=A*Math.sin(L),P=Math.atan2(X*S-B*b,B*S+X*b)}else{S=p*A,b=m*A;const W=S*S,ne=b*b,re=Math.atan2(X,B);M=ne*U*U+W*V-W*ne;const le=-2*ne*U,ue=ne-W;if(I=le*le-4*ue*M,I>=0){let fe=Math.sqrt(I);le<0&&(fe=-fe),fe=-(le+fe)*.5;let te=fe/ue,oe=M/fe;const ce=Math.abs(te)=0){D=Math.sqrt(te)*a,P=re-Math.atan2(D,ce),L=Math.atan2(D/m,(ce-U)/p);break e}}let ae=Ee.PI,xe=U-S,Y=xe*xe,j=0,H=0,G=U+S,z=G*G,ie=0;M=-S*U/(W-ne),M>=-1&&M<=1&&(M=Math.acos(M),O=S*Math.cos(M)+U,D=b*Math.sin(M),I=O*O+D*D,Iz&&(H=M,z=I,G=O,ie=D)),V<=(Y+z)*.5?(P=re-Math.atan2(j*a,xe),L=ae*a):(P=re-Math.atan2(ie*a,G),L=H*a)}const q=Math.atan2(n.y,n.x)*y;P=(P-q)*Ee.radDeg+v-i.rotation,P>180?P-=360:P<=-180&&(P+=360),i.rotation+=P*u,L=((L+q)*Ee.radDeg-n.shearX)*y+x-n.rotation,L>180?L-=360:L<=-180&&(L+=360),n.rotation+=L*u}}class Rc extends Ml{constructor(t){super(t,new pm);w(this,"bones",[]);w(this,"_target",null);w(this,"_scaleYMode",Ni.None)}set target(t){this._target=t}get target(){if(!this._target)throw new Error("target cannot be null.");return this._target}set scaleYMode(t){this._scaleYMode=t}get scaleYMode(){if(this._scaleYMode==null)throw new Error("scaleYMode cannot be null.");return this._scaleYMode}create(t){return new Jn(this,t)}}class gm{constructor(){w(this,"position",0);w(this,"spacing",0);w(this,"mixRotate",0);w(this,"mixX",0);w(this,"mixY",0)}set(e){this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}}class Pc extends Ml{constructor(t){super(t,new gm);w(this,"bones",[]);w(this,"_slot",null);w(this,"positionMode",on.Fixed);w(this,"spacingMode",ci.Fixed);w(this,"rotateMode",Qr.Chain);w(this,"offsetRotation",0)}set slot(t){this._slot=t}get slot(){if(this._slot)return this._slot;throw new Error("SlotData not set.")}create(t){return new vm(this,t)}}var on;(function(s){s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent"})(on||(on={}));var ci;(function(s){s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s[s.Proportional=3]="Proportional"})(ci||(ci={}));var Qr;(function(s){s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale"})(Qr||(Qr={}));const _s=class _s extends Tl{constructor(t,i){super(t,new gm,new gm);w(this,"data");w(this,"bones");w(this,"slot");w(this,"spaces",[]);w(this,"positions",[]);w(this,"world",[]);w(this,"curves",[]);w(this,"lengths",[]);w(this,"segments",[]);if(!i)throw new Error("skeleton cannot be null.");this.data=t,this.bones=[];for(const n of this.data.bones)this.bones.push(i.bones[n.index].constrainedPose);this.slot=i.slots[t.slot.index]}copy(t){var i=new _s(this.data,t);return i.pose.set(this.pose),i}update(t,i){const n=this.slot.appliedPose.attachment;if(!(n instanceof dl))return;const r=this.appliedPose,o=r.mixRotate,a=r.mixX,c=r.mixY;if(o===0&&a===0&&c===0)return;const l=this.data,h=l.rotateMode===Qr.Tangent,u=l.rotateMode===Qr.ChainScale,d=this.bones,f=d.length,p=h?f:f+1,m=Ye.setArraySize(this.spaces,p),g=u?this.lengths=Ye.setArraySize(this.lengths,f):[],v=r.spacing;switch(l.spacingMode){case ci.Percent:if(u)for(let b=0,M=p-1;b0){b=p/b*v;for(let M=1;M0?Ee.degRad:-Ee.degRad}for(let b=0,M=3;b0){let D=I.a,$=I.b,N=I.c,U=I.d,A=0,P=0,L=0;if(h?A=x[M-1]:m[b+1]===0?A=x[M+2]:A=Math.atan2(O,k),A-=Math.atan2(N,D),S){P=Math.cos(A),L=Math.sin(A);const B=I.bone.data.length;y+=(B*(P*D-L*N)-k)*o,_+=(B*(L*D+P*N)-O)*o}else A+=C;A>Ee.PI?A-=Ee.PI2:A<-Ee.PI&&(A+=Ee.PI2),A*=o,P=Math.cos(A),L=Math.sin(A),I.a=P*D-L*N,I.b=P*$-L*U,I.c=L*D+P*N,I.d=L*$+P*U}}}computeWorldPositions(t,i,n,r){const o=this.slot;let a=this.appliedPose.position,c=this.spaces,l=Ye.setArraySize(this.positions,n*3+2),h=this.world;const u=i.closed;let d=i.worldVerticesLength,f=d/6,p=_s.NONE;if(!i.constantSpeed){const L=i.lengths;f-=u?1:2;const B=L[f];this.data.positionMode===on.Percent&&(a*=B);let X;switch(this.data.spacingMode){case ci.Percent:X=B;break;case ci.Proportional:X=B/n;break;default:X=1}h=Ye.setArraySize(this.world,8);for(let V=0,q=0,W=0;VB){p!==_s.AFTER&&(p=_s.AFTER,i.computeWorldVertices(t,o,d-6,4,h,0,2)),this.addAfterPosition(re-B,h,0,l,q);continue}for(;;W++){const le=L[W];if(!(re>le)){if(W===0)re/=le;else{const ue=L[W-1];re=(re-ue)/(le-ue)}break}}W!==p&&(p=W,u&&W===f?(i.computeWorldVertices(t,o,d-4,4,h,0,2),i.computeWorldVertices(t,o,0,4,h,4,2)):i.computeWorldVertices(t,o,W*6+2,8,h,0,2)),this.addCurvePosition(re,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],l,q,r||V>0&&ne===0)}return l}u?(d+=2,h=Ye.setArraySize(this.world,d),i.computeWorldVertices(t,o,2,d-4,h,0,2),i.computeWorldVertices(t,o,0,2,h,d-4,2),h[d-2]=h[0],h[d-1]=h[1]):(f--,d-=4,h=Ye.setArraySize(this.world,d),i.computeWorldVertices(t,o,2,d,h,0,2));const m=Ye.setArraySize(this.curves,f);let g=0,v=h[0],x=h[1],y=0,_=0,C=0,S=0,b=0,M=0,I=0,F=0,E=0,k=0,O=0,D=0,$=0,N=0;for(let L=0,B=2;Lg){this.addAfterPosition(W-g,h,d-4,l,B);continue}for(;;X++){const ne=m[X];if(!(W>ne)){if(X===0)W/=ne;else{const re=m[X-1];W=(W-re)/(ne-re)}break}}if(X!==p){p=X;let ne=X*6;for(v=h[ne],x=h[ne+1],y=h[ne+2],_=h[ne+3],C=h[ne+4],S=h[ne+5],b=h[ne+6],M=h[ne+7],I=(v-y*2+C)*.03,F=(x-_*2+S)*.03,E=((y-C)*3-v+b)*.006,k=((_-S)*3-x+M)*.006,O=I*2+E,D=F*2+k,$=(y-v)*.3+I+E*.16666667,N=(_-x)*.3+F+k*.16666667,P=Math.sqrt($*$+N*N),A[0]=P,ne=1;ne<8;ne++)$+=O,N+=D,O+=E,D+=k,P+=Math.sqrt($*$+N*N),A[ne]=P;$+=O,N+=D,P+=Math.sqrt($*$+N*N),A[8]=P,$+=O+E,N+=D+k,P+=Math.sqrt($*$+N*N),A[9]=P,V=0}for(W*=P;;V++){const ne=A[V];if(!(W>ne)){if(V===0)W/=ne;else{const re=A[V-1];W=V+(W-re)/(ne-re)}break}}this.addCurvePosition(W*.1,v,x,y,_,C,S,b,M,l,B,r||L>0&&q===0)}return l}addBeforePosition(t,i,n,r,o){const a=i[n],c=i[n+1],l=i[n+2]-a,h=i[n+3]-c,u=Math.atan2(h,l);r[o]=a+t*Math.cos(u),r[o+1]=c+t*Math.sin(u),r[o+2]=u}addAfterPosition(t,i,n,r,o){const a=i[n+2],c=i[n+3],l=a-i[n],h=c-i[n+1],u=Math.atan2(h,l);r[o]=a+t*Math.cos(u),r[o+1]=c+t*Math.sin(u),r[o+2]=u}addCurvePosition(t,i,n,r,o,a,c,l,h,u,d,f){if(t===0||Number.isNaN(t)){u[d]=i,u[d+1]=n,u[d+2]=Math.atan2(o-n,r-i);return}const p=t*t,m=p*t,g=1-t,v=g*g,x=v*g,y=g*t,_=y*3,C=g*_,S=_*t,b=i*x+r*C+a*S+l*m,M=n*x+o*C+c*S+h*m;u[d]=b,u[d+1]=M,f&&(t<.001?u[d+2]=Math.atan2(o-n,r-i):u[d+2]=Math.atan2(M-(n*v+o*y*2+c*p),b-(i*v+r*y*2+a*p)))}sort(t){const i=this.slot.data.index,n=this.slot.bone;t.skin!=null&&this.sortPathSlot(t,t.skin,i,n),t.data.defaultSkin!=null&&t.data.defaultSkin!==t.skin&&this.sortPathSlot(t,t.data.defaultSkin,i,n),this.sortPath(t,this.slot.pose.attachment,n);const r=this.bones,o=this.bones.length;for(let a=0;a0,a=this.data.y>0,c=this.data.rotate>0||this.data.shearX>0,l=this.data.scaleX>0,h=this.bone;let u=h.bone.data.length,d=this.data.step,f=0;if(i!==Ur.none){switch(h.modifyWorld(t),i){case Ur.reset:this.reset(t);case Ur.update:{const p=Math.max(t.time-this.lastTime,0),m=this.remaining;this.remaining+=p,this.lastTime=t.time;const g=h.worldX,v=h.worldY;if(this._reset)this._reset=!1,this.ux=g,this.uy=v;else{let x=this.remaining,y=n.inertia,_=t.data.referenceScale,C=-1,S=0,b=0,M=this.data.limit*p,I=M*Math.abs(t.scaleY);if(M*=Math.abs(t.scaleX),o||a){if(o){const F=(this.ux-g)*y;this.xOffset+=F>M?M:F<-M?-M:F,this.ux=g}if(a){const F=(this.uy-v)*y;this.yOffset+=F>I?I:F<-I?-I:F,this.uy=v}if(x>=d){const F=this.xOffset,E=this.yOffset;C=n.damping**(60*d),S=d*n.massInverse,b=n.strength;const k=_*n.wind,O=_*n.gravity,D=(k*t.windX+O*t.gravityX)*t.scaleX,$=(k*t.windY+O*t.gravityY)*t.scaleY;do o&&(this.xVelocity+=(D-this.xOffset*b)*S,this.xOffset+=this.xVelocity*d,this.xVelocity*=C),a&&(this.yVelocity-=($+this.yOffset*b)*S,this.yOffset+=this.yVelocity*d,this.yVelocity*=C),x-=d;while(x>=d);this.xLag=this.xOffset-F,this.yLag=this.yOffset-E}f=Math.max(0,1-x/d),o&&(h.worldX+=(this.xOffset-this.xLag*f)*r*this.data.x),a&&(h.worldY+=(this.yOffset-this.yLag*f)*r*this.data.y)}if(c||l){let F=Math.atan2(h.c,h.a),E=0,k=0,O=0,D=this.cx-h.worldX,$=this.cy-h.worldY;if(D>M?D=M:D<-M&&(D=-M),$>I?$=I:$<-I&&($=-I),x=this.remaining,c){O=(this.data.rotate+this.data.shearX)*r,f=this.rotateLag*Math.max(0,1-m/d);let N=Math.atan2($+this.ty,D+this.tx)-F-(this.rotateOffset-f)*O;this.rotateOffset+=(N-Math.ceil(N*Ee.invPI2-.5)*Ee.PI2)*y,N=(this.rotateOffset-f)*O+F,E=Math.cos(N),k=Math.sin(N),l&&(N=u*h.getWorldScaleX(),N>0&&(this.scaleOffset+=(D*E+$*k)*y/N))}else{E=Math.cos(F),k=Math.sin(F);const N=u*h.getWorldScaleX()-this.scaleLag*Math.max(0,1-m/d);N>0&&(this.scaleOffset+=(D*E+$*k)*y/N)}if(x>=d){C===-1&&(C=n.damping**(60*d),S=d*n.massInverse,b=n.strength);const N=n.wind*t.windX+n.gravity*t.gravityX,U=(n.wind*t.windY+n.gravity*t.gravityY)*bm.yDir,A=this.rotateOffset,P=this.scaleOffset,L=u/_;for(;;)if(x-=d,l&&(this.scaleVelocity+=(N*E-U*k-this.scaleOffset*b)*S,this.scaleOffset+=this.scaleVelocity*d,this.scaleVelocity*=C),c){if(this.rotateVelocity-=((N*k+U*E)*L+this.rotateOffset*b)*S,this.rotateOffset+=this.rotateVelocity*d,this.rotateVelocity*=C,x0){let x=0;this.data.rotate>0&&(x=p*this.data.rotate,m=Math.sin(x),g=Math.cos(x),v=h.b,h.b=g*v-m*h.d,h.d=m*v+g*h.d),x+=p*this.data.shearX,m=Math.sin(x),g=Math.cos(x),v=h.a,h.a=g*v-m*h.c,h.c=m*v+g*h.c}else p*=this.data.rotate,m=Math.sin(p),g=Math.cos(p),v=h.a,h.a=g*v-m*h.c,h.c=m*v+g*h.c,v=h.b,h.b=g*v-m*h.d,h.d=m*v+g*h.d}if(l){let p=1+(this.scaleOffset-this.scaleLag*f)*r*this.data.scaleX;switch(h.a*=p,h.c*=p,this.data.scaleYMode){case Ni.Uniform:h.b*=p,h.d*=p;break;case Ni.Volume:p=Math.abs(p),p=p>=.7?1/p:4-3.67347*p,h.b*=p,h.d*=p}}i!==Ur.pose&&(this.tx=u*h.a,this.ty=u*h.c)}}sort(t){const i=this.bone.bone;t.sortBone(i),t._updateCache.push(this),t.sortReset(i.children),t.constrained(i)}isSourceActive(){return this.bone.bone.active}}class kc extends Ml{constructor(t){super(t,new ym);w(this,"_bone",null);w(this,"x",0);w(this,"y",0);w(this,"rotate",0);w(this,"scaleX",0);w(this,"shearX",0);w(this,"limit",0);w(this,"step",0);w(this,"inertiaGlobal",!1);w(this,"strengthGlobal",!1);w(this,"dampingGlobal",!1);w(this,"massGlobal",!1);w(this,"windGlobal",!1);w(this,"gravityGlobal",!1);w(this,"mixGlobal",!1);w(this,"_scaleYMode",Ni.None)}set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}get scaleYMode(){return this._scaleYMode}set scaleYMode(t){if(t==null)throw new Error("scaleYMode cannot be null.");this._scaleYMode=t}create(t){return new uu(this,t)}}typeof Math.fround>"u"&&(Math.fround=(s=>e=>(s[0]=e,s[0]))(new Float32Array(1)));class wm{constructor(){w(this,"time",0);w(this,"mix",0)}set(e){this.time=e.time,this.mix=e.mix}}const qa=class qa extends Tl{constructor(t,i){super(t,new wm,new wm);w(this,"bone",null);if(!i)throw new Error("skeleton cannot be null.");t.bone!=null&&(this.bone=i.bones[t.bone.index])}copy(t){var i=new qa(this.data,t);return i.pose.set(this.pose),i}update(t,i){const n=this.appliedPose;if(n.mix===0)return;const r=this.data,o=r.animation,a=this.bone;if(a!==null){if(!a.active)return;r.local&&a.appliedPose.validateLocalTransform(t),n.time=r.offset+(r.property.value(t,a.appliedPose,r.local,qa.offsets)-r.property.offset)*r.scale,r.loop?n.time=o.duration+n.time%o.duration:n.time=Math.max(0,n.time)}const c=t.bones,l=o.bones;for(let h=0,u=o.bones.length;h=n.length&&(n.length=e+1),n[e]||(n[e]={}),n[e][t]=i}addSkin(e){for(let i=0;i= 0.");if(!n)throw new Error("boneData cannot be null.");this.index=t,this.boneData=n}}var Th;(function(s){s[s.Normal=0]="Normal",s[s.Additive=1]="Additive",s[s.Multiply=2]="Multiply",s[s.Screen=3]="Screen"})(Th||(Th={}));class Tm{constructor(){w(this,"mixRotate",0);w(this,"mixX",0);w(this,"mixY",0);w(this,"mixScaleX",0);w(this,"mixScaleY",0);w(this,"mixShearY",0)}set(e){this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}}class Tp extends Tl{constructor(t,i){super(t,new Tm,new Tm);w(this,"bones");w(this,"source");if(!i)throw new Error("skeleton cannot be null.");this.bones=[];for(const r of t.bones)this.bones.push(i.bones[r.index].constrainedPose);const n=i.bones[t.source.index];if(n==null)throw new Error("source cannot be null.");this.source=n}copy(t){var i=new Tp(this.data,t);return i.pose.set(this.pose),i}update(t,i){const n=this.appliedPose;if(n.mixRotate===0&&n.mixX===0&&n.mixY===0&&n.mixScaleX===0&&n.mixScaleY===0&&n.mixShearY===0)return;const r=this.data,o=r.localSource,a=r.localTarget,c=r.additive,l=r.clamp,h=r.offsets,u=this.source.appliedPose;o&&u.validateLocalTransform(t);const d=r.properties,f=r.properties.length,p=this.bones;for(let m=0,g=this.bones.length;m0?n[xt.ROTATION]:-n[xt.ROTATION]);return a<0&&(a+=360),a}}class aS extends ca{mix(e){return e.mixRotate}apply(e,t,i,n,r,o){if(r)i.rotation+=(o?n:n-i.rotation)*t.mixRotate;else{const a=e.scaleX,c=e.scaleY,l=1/a,h=1/c,u=i.a*l,d=i.b*l,f=i.c*h,p=i.d*h;n*=Ee.degRad,o||(n-=Math.atan2(f,u)),n>Ee.PI?n-=Ee.PI2:n<-Ee.PI&&(n+=Ee.PI2),n*=t.mixRotate;const m=Math.cos(n),g=Math.sin(n);i.a=(m*u-g*f)*a,i.b=(m*d-g*p)*a,i.c=(g*u+m*f)*c,i.d=(g*d+m*p)*c}}}class Cm extends la{value(e,t,i,n){return i?t.x+n[xt.X]:(n[xt.X]*t.a+n[xt.Y]*t.b+t.worldX)/e.scaleX}}class lS extends ca{mix(e){return e.mixX}apply(e,t,i,n,r,o){r?i.x+=(o?n:n-i.x)*t.mixX:(o||(n-=i.worldX/e.scaleX),i.worldX+=n*t.mixX*e.scaleX)}}class Am extends la{value(e,t,i,n){return i?t.y+n[xt.Y]:(n[xt.X]*t.c+n[xt.Y]*t.d+t.worldY)/e.scaleY}}class cS extends ca{mix(e){return e.mixY}apply(e,t,i,n,r,o){r?i.y+=(o?n:n-i.y)*t.mixY:(o||(n-=i.worldY/e.scaleY),i.worldY+=n*t.mixY*e.scaleY)}}class Em extends la{value(e,t,i,n){if(i)return t.scaleX+n[xt.SCALEX];const r=t.a/e.scaleX,o=t.c/e.scaleY;return Math.sqrt(r*r+o*o)+n[xt.SCALEX]}}class hS extends ca{mix(e){return e.mixScaleX}apply(e,t,i,n,r,o){if(r)o?i.scaleX*=1+(n-1)*t.mixScaleX:i.scaleX!==0&&(i.scaleX+=(n-i.scaleX)*t.mixScaleX);else if(o){const a=1+(n-1)*t.mixScaleX;i.a*=a,i.c*=a}else{let a=i.a/e.scaleX,c=i.c/e.scaleY,l=Math.sqrt(a*a+c*c);l!==0&&(l=1+(n-l)*t.mixScaleX/l,i.a*=l,i.c*=l)}}}class Im extends la{value(e,t,i,n){if(i)return t.scaleY+n[xt.SCALEY];const r=t.b/e.scaleX,o=t.d/e.scaleY;return Math.sqrt(r*r+o*o)+n[xt.SCALEY]}}class uS extends ca{mix(e){return e.mixScaleY}apply(e,t,i,n,r,o){if(r)o?i.scaleY*=1+(n-1)*t.mixScaleY:i.scaleY!==0&&(i.scaleY+=(n-i.scaleY)*t.mixScaleY);else if(o){const a=1+(n-1)*t.mixScaleY;i.b*=a,i.d*=a}else{let a=i.b/e.scaleX,c=i.d/e.scaleY,l=Math.sqrt(a*a+c*c);l!==0&&(l=1+(n-l)*t.mixScaleY/l,i.b*=l,i.d*=l)}}}class Rm extends la{value(e,t,i,n){if(i)return t.shearY+n[xt.SHEARY];const r=1/e.scaleX,o=1/e.scaleY;return(Math.atan2(t.d*o,t.b*r)-Math.atan2(t.c*o,t.a*r))*Ee.radDeg-90+n[xt.SHEARY]}}class dS extends ca{mix(e){return e.mixShearY}apply(e,t,i,n,r,o){if(r)o||(n-=i.shearY),i.shearY+=n*t.mixShearY;else{const a=e.scaleX,c=e.scaleY,l=i.b/a,h=i.d/c,u=Math.atan2(h,l);n=(n+90)*Ee.degRad,o?n-=Ee.PI/2:(n-=u-Math.atan2(i.c/c,i.a/a),n>Ee.PI?n-=Ee.PI2:n<-Ee.PI&&(n+=Ee.PI2)),n=u+n*t.mixShearY;const d=Math.sqrt(l*l+h*h);i.b=Math.cos(n)*d*a,i.d=Math.sin(n)*d*c}}}class nX{constructor(e){w(this,"scale",1);w(this,"attachmentLoader");w(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new rS;i.name="";const n=new w3(e),r=n.readInt32(),o=n.readInt32();i.hash=o===0&&r===0?null:o.toString(16)+r.toString(16),i.version=n.readString(),i.x=n.readFloat(),i.y=n.readFloat(),i.width=n.readFloat(),i.height=n.readFloat(),i.referenceScale=n.readFloat()*t;const a=n.readBoolean();a&&(i.fps=n.readFloat(),i.imagesPath=n.readString(),i.audioPath=n.readString());let c=0;c=n.readInt(!0);for(let p=0;p>5;for(let _=0,C;_>1&1,v.spacingMode=x>>2&3,v.rotateMode=x>>4&3,(x&128)!==0&&(v.offsetRotation=n.readFloat());const y=v.setupPose;y.position=n.readFloat(),v.positionMode===on.Fixed&&(y.position*=t),y.spacing=n.readFloat(),(v.spacingMode===ci.Length||v.spacingMode===ci.Fixed)&&(y.spacing*=t),y.mixRotate=n.readFloat(),y.mixX=n.readFloat(),y.mixY=n.readFloat(),h.push(v);break}case H3:{const v=new kc(m);v.bone=l[n.readInt(!0)];let x=n.readByte();if(v.skinRequired=(x&1)!==0,(x&2)!==0&&(v.x=n.readFloat()),(x&4)!==0&&(v.y=n.readFloat()),(x&8)!==0&&(v.rotate=n.readFloat()),(x&16)!==0){let _=n.readFloat();_<-2?(v.scaleYMode=Ni.Volume,_=-2-_):_<0&&(v.scaleYMode=Ni.Uniform,_=-1-_),v.scaleX=_}(x&32)!==0&&(v.shearX=n.readFloat()),v.limit=((x&64)!==0?n.readFloat():5e3)*t,v.step=1/n.readUnsignedByte();const y=v.setupPose;y.inertia=n.readFloat(),y.strength=n.readFloat(),y.damping=n.readFloat(),y.massInverse=(x&128)!==0?n.readFloat():1,y.wind=n.readFloat(),y.gravity=n.readFloat(),x=n.readByte(),(x&1)!==0&&(v.inertiaGlobal=!0),(x&2)!==0&&(v.strengthGlobal=!0),(x&4)!==0&&(v.dampingGlobal=!0),(x&8)!==0&&(v.massGlobal=!0),(x&16)!==0&&(v.windGlobal=!0),(x&32)!==0&&(v.gravityGlobal=!0),(x&64)!==0&&(v.mixGlobal=!0),y.mix=(x&128)!==0?n.readFloat():1,h.push(v);break}case j3:{const v=new Xr(m),x=n.readByte();if(v.skinRequired=(x&1)!==0,v.loop=(x&2)!==0,v.additive=(x&4)!==0,(x&8)!==0){const y=n.readFloat();a&&(x&64)!==0?v.max=y:v.setupPose.time=y}if((x&16)!==0&&(v.setupPose.mix=(x&32)!==0?n.readFloat():1),(x&64)!==0){v.local=(x&128)!==0,v.bone=l[n.readInt(!0)];const y=n.readFloat();let _=1;switch(n.readByte()){case 0:v.property=new Mm;break;case 1:{_=t,v.property=new Cm;break}case 2:{_=t,v.property=new Am;break}case 3:v.property=new Em;break;case 4:v.property=new Im;break;case 5:v.property=new Rm;break;default:continue}v.property.offset=y*_,v.offset=n.readFloat(),v.scale=n.readFloat()/_}h.push(v);break}}}const d=this.readSkin(n,i,!0,a);d&&(i.defaultSkin=d,i.skins.push(d));{let p=i.skins.length;for(Ye.setArraySize(i.skins,c=p+n.readInt(!0));p0){x=[];for(let b=0;b>4,e.readFloat())}r.push(F);break}}}}}const a=i.slots.length,c=e.readInt(!0);if(c>0){const f=new dr(c);for(let p=0;p0){const f=new ul(h);for(let p=0;p>>1^-(i&1)}readStringRef(){const e=this.readInt(!0);return e===0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="";for(let i=0;i>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),i+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),i+=3;break;default:t+=String.fromCharCode(n),i++}}return t}readFloat(){const e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!==0}}let S3=class{constructor(e,t,i,n,r,o){w(this,"source");w(this,"skinIndex");w(this,"slotIndex");w(this,"sourceIndex");w(this,"mesh");w(this,"inheritTimelines");this.mesh=e,this.skinIndex=t,this.slotIndex=i,this.sourceIndex=n,this.source=r,this.inheritTimelines=o}};class Jv{constructor(e=null,t,i=0){w(this,"bones");w(this,"vertices");w(this,"length");this.bones=e,this.vertices=t,this.length=i}}var vn;(function(s){s[s.Region=0]="Region",s[s.BoundingBox=1]="BoundingBox",s[s.Mesh=2]="Mesh",s[s.LinkedMesh=3]="LinkedMesh",s[s.Path=4]="Path",s[s.Point=5]="Point",s[s.Clipping=6]="Clipping"})(vn||(vn={}));function ei(s,e,t,i){t instanceof En?_3(s,e,t,i):T3(s,e,t,i)}function _3(s,e,t,i){let n=s.readFloat(),r=s.readFloat()*i;for(let o=0,a=0,c=t.getFrameCount()-1;t.setFrame(o,n,r),o!==c;o++){const l=s.readFloat(),h=s.readFloat()*i;switch(s.readByte()){case Gs:t.setStepped(o);break;case Hs:ut(s,t,a++,o,0,n,l,r,h,i)}n=l,r=h}e.push(t)}function T3(s,e,t,i){let n=s.readFloat(),r=s.readFloat()*i,o=s.readFloat()*i;for(let a=0,c=0,l=t.getFrameCount()-1;t.setFrame(a,n,r,o),a!==l;a++){const h=s.readFloat(),u=s.readFloat()*i,d=s.readFloat()*i;switch(s.readByte()){case Gs:t.setStepped(a);break;case Hs:ut(s,t,c++,a,0,n,h,r,u,i),ut(s,t,c++,a,1,n,h,o,d,i)}n=h,r=u,o=d}e.push(t)}function Qv(s,e){const t=s.readInt(!0);if(t===0)return null;const i=new Array(e).fill(-1),n=new Array(e-t);let r=0,o=0;for(let a=0;a=0;a--)i[a]===-1&&(i[a]=n[--o]);return i}function ut(s,e,t,i,n,r,o,a,c,l){e.setBezier(t,i,n,r,a,s.readFloat(),s.readFloat()*l,s.readFloat(),s.readFloat()*l,o,c)}const M3=0,C3=1,A3=2,E3=3,I3=4,R3=5,P3=6,k3=7,F3=8,O3=9,B3=10,L3=0,D3=1,N3=2,U3=3,$3=4,X3=5,V3=0,Y3=1,G3=2,H3=3,j3=4,W3=0,z3=1,q3=0,K3=1,Z3=2,J3=0,Q3=1,eO=2,tO=4,iO=5,sO=6,nO=7,rO=8,oO=0,aO=1,Gs=1,Hs=2;class lO{constructor(e){w(this,"attachmentLoader");w(this,"scale",1);w(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new rS,n=typeof e=="string"?JSON.parse(e):e,r=n.skeleton;if(r&&(i.hash=r.hash,i.version=r.spine,i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height,i.referenceScale=Z(r,"referenceScale",100)*t,i.fps=r.fps,i.imagesPath=r.images??null,i.audioPath=r.audio??null),n.bones)for(let o=0;o0&&l.properties.push(S)}l.offsets[xt.ROTATION]=Z(o,"rotation",0),l.offsets[xt.X]=Z(o,"x",0)*t,l.offsets[xt.Y]=Z(o,"y",0)*t,l.offsets[xt.SCALEX]=Z(o,"scaleX",0),l.offsets[xt.SCALEY]=Z(o,"scaleY",0),l.offsets[xt.SHEARY]=Z(o,"shearY",0);const y=l.setupPose;d&&(y.mixRotate=Z(o,"mixRotate",1)),f&&(y.mixX=Z(o,"mixX",1)),p&&(y.mixY=Z(o,"mixY",y.mixX)),m&&(y.mixScaleX=Z(o,"mixScaleX",1)),g&&(y.mixScaleY=Z(o,"mixScaleY",y.mixScaleX)),v&&(y.mixShearY=Z(o,"mixShearY",1)),i.constraints.push(l);break}case"path":{const l=new Pc(a);l.skinRequired=c;for(let f=0;f0){const d=i.findConstraint(l,kc);if(!d)throw new Error(`Physics constraint not found: ${l}`);u=i.constraints.indexOf(d)}for(const d in h){const f=h[d];let p=f[0];if(!p)continue;const m=f.length;let g,v=0;if(d==="reset"){const x=new _h(m,u);for(let y=0;p!=null;p=f[y+1],y++)x.setFrame(y,Z(p,"time",0));r.push(x);continue}switch(d){case"inertia":g=new Ww(m,m,u);break;case"strength":g=new zw(m,m,u);break;case"damping":g=new qw(m,m,u);break;case"mass":g=new Kw(m,m,u);break;case"wind":g=new Zw(m,m,u);break;case"gravity":g=new Jw(m,m,u);break;case"mix":{v=1,g=new Qw(m,m,u);break}default:continue}Zi(r,f,g,v,1)}}if(e.slider)for(const l in e.slider){const h=e.slider[l],u=i.findConstraint(l,Xr);if(!u)throw new Error(`Slider not found: ${l}`);const d=i.constraints.indexOf(u);for(const f in h){const p=h[f];if(!p[0])continue;const g=p.length;switch(f){case"time":Zi(r,p,new eS(g,g,d),1,1);break;case"mix":Zi(r,p,new tS(g,g,d),1,1);break}}}if(e.attachments)for(const l in e.attachments){const h=e.attachments[l],u=i.findSkin(l);if(!u)throw new Error(`Skin not found: ${l}`);for(const d in h){const f=h[d],p=i.findSlot(d);if(!p)throw new Error(`Attachment slot not found: ${d}`);const m=p.index;for(const g in f){const v=f[g],x=u.getAttachment(m,g);if(!x)throw new Error(`Timeline attachment not found: ${g}`);for(const y in v){const _=v[y];let C=_[0];if(C){if(y==="deform"){const S=x.bones,b=x.vertices,M=S?b.length/3*2:b.length,I=new Xw(_.length,_.length,m,x);let F=Z(C,"time",0);for(let E=0,k=0;;E++){let O;const D=Z(C,"vertices",null);if(!D)O=S?Ye.newFloatArray(M):b;else{O=Ye.newFloatArray(M);const A=Z(C,"offset",0);if(Ye.arrayCopy(D,0,O,A,D.length),n!==1)for(let P=A,L=P+D.length;P=0;l--)r[l]===-1&&(r[l]=o[--c]);return r}function mt(s,e,t,i,n,r,o,a,c,l){if(s==="stepped")return e.setStepped(i),t;const h=n<<2,u=s[h],d=s[h+1]*l,f=s[h+2],p=s[h+3]*l;return e.setBezier(t,i,n,r,a,u,d,f,p,o,c),t+1}function Z(s,e,t){return s[e]!==void 0?s[e]:t}class hO{newRegionAttachment(e,t,i,n){return new ru(t,i)}newMeshAttachment(e,t,i,n){return new Sl(t,i)}newBoundingBoxAttachment(e,t){return new Ub(t)}newPathAttachment(e,t){return new hl(t)}newPointAttachment(e,t){return new Hb(t)}newClippingAttachment(e,t){return new Wo(t)}}class uO{sequence(e){for(let t=0;t!Number.isInteger(h)||h<0||h>=o))throw new Error(`拖尾网格“${e}”的三角形索引越界`);const a=Number(s.hull)||0;if(!Number.isInteger(a)||a<0||a>o)throw new Error(`拖尾网格“${e}”的外轮廓数量无效`);if(Array.isArray(s.edges)&&s.edges.some(h=>!Number.isInteger(h)||h<0||h>=o*2||h%2))throw new Error(`拖尾网格“${e}”的外轮廓边索引越界`);if(n.length===i.length)return;let c=0,l=0;for(;c=t)throw new Error(`拖尾网格“${e}”引用了不存在的骨骼`);if(![p,m,g].every(Number.isFinite)||g<0)throw new Error(`拖尾网格“${e}”包含无效权重数据`);u+=g}if(Math.abs(u-1)>.001)throw new Error(`拖尾网格“${e}”的顶点权重之和不为 1`);l++}if(c!==n.length||l!==o)throw new Error(`拖尾网格“${e}”的顶点数量与 UV 不一致`)}function mO(s,e){var r,o,a,c;const t=Array.isArray(s.bones)?s.bones:[],i=new Map(t.map(l=>[String(l.name||""),l])),n=new Set;for(const l of t){if(l.inherit!=null&&!dO.has(l.inherit))throw new Error(`骨骼“${l.name||""}”的 inherit 值“${l.inherit}”不符合 Spine ${e} JSON 格式`);if(/_particle_\d+_trail_/.test(String(l.name||""))){const h=i.get(String(l.parent||""));if(!h||/_particle_\d+_trail_/.test(String(h.name||"")))throw new Error(`拖尾骨骼“${l.name||""}”必须直接挂在粒子系统骨骼下,不能组成骨骼链`)}}for(const l of Array.isArray(s.skins)?s.skins:[]){const h=(l==null?void 0:l.attachments)||{};for(const u of Object.keys(h))for(const d of Object.keys(h[u]||{})){const f=h[u][d];(f==null?void 0:f.type)==="mesh"&&(fO(f,d,t.length),((r=f.vertices)==null?void 0:r.length)!==((o=f.uvs)==null?void 0:o.length)&&n.add(u))}}for(const l of Object.values(s.animations||{}))for(const h of n){const u=(c=(a=l==null?void 0:l.slots)==null?void 0:a[h])==null?void 0:c.attachment;if(Array.isArray(u)&&u.some(d=>!(d!=null&&d.name)))throw new Error(`加权拖尾插槽“${h}”不能使用空附件,未出现或死亡阶段应将对应骨骼缩放设为 0`)}}function pO(s){var e;if(String(((e=s==null?void 0:s.skeleton)==null?void 0:e.spine)||"")!=="3.8")throw new Error("Spine 3.8 导出的版本标识必须为 3.8");for(const t of s.bones||[])if(t.inherit!=null)throw new Error(`Spine 3.8 骨骼“${t.name||""}”应使用 transform,不能使用 inherit`);for(const t of Object.values(s.animations||{})){for(const n of Object.values(t.slots||{})){if(n.rgba||n.rgba2)throw new Error("Spine 3.8 插槽颜色时间轴必须使用 color / twoColor");for(const r of n.attachment||[])if(!Object.prototype.hasOwnProperty.call(r,"name"))throw new Error("Spine 3.8 附件时间轴的隐藏帧必须显式写入 name: null")}for(const n of Object.values(t.bones||{}))for(const r of n.rotate||[])if(r.value!=null||r.angle==null)throw new Error("Spine 3.8 旋转时间轴必须使用 angle");const i=[t];for(;i.length;){const n=i.pop();if(!(!n||typeof n!="object")){if(!Array.isArray(n)&&Array.isArray(n.curve))throw new Error("Spine 3.8 不支持 4.x 数组曲线格式");i.push(...Object.values(n))}}}}function ty(s,e){var o;const t=JSON.parse(s),i=ah((o=t==null?void 0:t.skeleton)==null?void 0:o.spine);if(!i)throw new Error(`导出版本不受支持,仅支持 Spine ${im()}`);if(e&&i!==e)throw new Error(`导出版本不一致:设置为 Spine ${e},JSON 标记为 Spine ${i}`);mO(t,i),i==="3.8"&&pO(t);const n=i==="3.8"?nw(JSON.parse(JSON.stringify(t))):t,r=i==="4.3"?new lO(new uO).readSkeletonData(n):new fh(new hO).readSkeletonData(n);if(!r.bones.length)throw new Error("导出结果缺少骨骼");return{version:i,bones:r.bones.length,slots:r.slots.length,animations:r.animations.length}}const fS="http://127.0.0.1:27843";class Mh extends Error{constructor(t,i="CONNECTOR_ERROR",n){super(t);w(this,"code");w(this,"pairUrl");this.name="SpineConnectorError",this.code=i,this.pairUrl=n}}function Pm(s,e){return String(s||"").trim().replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||e}function gO(s,e){const t=/\.([a-z0-9]{2,5})$/i.exec(s);return t?`.${t[1].toLowerCase()}`:e.includes("jpeg")?".jpg":e.includes("webp")?".webp":e.includes("gif")?".gif":".png"}function vO(s,e,t){const i=String(s||"").replace(/\\/g,"/").split("/").filter(Boolean).map(r=>Pm(r,"images")),n=Pm(e.replace(/\.[^./\\]+$/,""),"image");return[...i,`${n}${gO(e,t)}`].join("/")}async function rf(s,e,t){if(!s)return null;const i=await fetch(s);if(!i.ok)throw new Error(`无法读取导出图片:${t}`);const n=await i.blob(),r=new Uint8Array(await n.arrayBuffer());let o="";const a=32768;for(let c=0;co.finally(()=>{i++,e==null||e(i,t.length)});for(const o of s.filter(a=>a.visible!==!1)){for(const a of o.config.imageResources)if(a.imageMode==="sequence"&&a.sequenceFrames.length)for(const c of a.sequenceFrames)t.push(n(rf(c.previewUrl,a.textureFolder,c.name||a.textureName)));else t.push(n(rf(a.previewUrl,a.textureFolder,a.textureName)));if(o.config.trail)for(const a of o.config.trailResources)t.push(n(rf(a.previewUrl,"",a.textureName)))}const r=new Map;for(const o of await Promise.all(t))o&&!r.has(o.path)&&r.set(o.path,o);return[...r.values()]}async function yO(){try{const s=await fetch(`${fS}/v1/health`,{cache:"no-store"});if(!s.ok)throw new Error(`HTTP ${s.status}`);return{available:!0,...await s.json()}}catch(s){return{available:!1,authorized:!1,error:s instanceof Error?s.message:String(s)}}}async function xO(s,e){const t=await mS(s.systems,(n,r)=>{e==null||e({phase:"images",progress:r?n/r:1})}),i=JSON.stringify({schemaVersion:1,projectName:s.projectName,spineVersion:s.spineVersion,skeletonJson:s.skeletonJson,images:t});return new Promise((n,r)=>{const o=new XMLHttpRequest;o.open("POST",`${fS}/v1/convert`),o.responseType="blob",o.setRequestHeader("Content-Type","application/json"),o.upload.onprogress=a=>{e==null||e({phase:"upload",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.upload.onloadend=()=>e==null?void 0:e({phase:"processing",progress:null}),o.onprogress=a=>{e==null||e({phase:"download",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.onerror=()=>r(new Mh("未检测到本地 Spine 连接器,请先启动连接器","CONNECTOR_OFFLINE")),o.onload=async()=>{const a=o.response;if(o.status<200||o.status>=300){let h={};try{h=JSON.parse(await a.text())}catch{}r(new Mh(h.message||`Spine 连接器返回错误:HTTP ${o.status}`,h.code,h.pairUrl));return}const c=o.getResponseHeader("X-Spine-File-Name");let l=`${Pm(s.projectName,"SpineParticle")}.zip`;if(c)try{l=decodeURIComponent(c)}catch{}n({blob:a,fileName:l,spineEditorVersion:o.getResponseHeader("X-Spine-Editor-Version")||s.spineVersion,imageCount:t.length})},o.send(i)})}function bO(s,e){const t=URL.createObjectURL(s),i=document.createElement("a");i.href=t,i.download=/\.zip$/i.test(e)?e:`${e}.zip`,i.style.display="none",document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}const wO=Array.from({length:256},(s,e)=>{let t=e;for(let i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;return t>>>0});function SO(s){let e=4294967295;for(const t of s)e=wO[(e^t)&255]^e>>>8;return(e^4294967295)>>>0}function _O(s){const e=String(s||"").replace(/\\/g,"/").split("/").filter(t=>t&&t!==".");if(!e.length||e.some(t=>t===".."))throw new Error("ZIP 文件路径无效");return e.join("/")}function TO(s=new Date){const e=Math.max(1980,s.getFullYear());return{time:s.getHours()<<11|s.getMinutes()<<5|Math.floor(s.getSeconds()/2),date:e-1980<<9|s.getMonth()+1<<5|s.getDate()}}function of(s){const e=new Uint8Array(s);return{bytes:e,view:new DataView(e.buffer)}}function iy(s){const e=new Uint8Array(s.reduce((i,n)=>i+n.length,0));let t=0;for(const i of s)e.set(i,t),t+=i.length;return e}function MO(s){const e=new TextEncoder,t=[],i=[],n=TO();let r=0;for(const c of s){const l=e.encode(_O(c.name)),h=SO(c.data),u=of(30);u.view.setUint32(0,67324752,!0),u.view.setUint16(4,20,!0),u.view.setUint16(6,2048,!0),u.view.setUint16(10,n.time,!0),u.view.setUint16(12,n.date,!0),u.view.setUint32(14,h,!0),u.view.setUint32(18,c.data.length,!0),u.view.setUint32(22,c.data.length,!0),u.view.setUint16(26,l.length,!0),t.push(u.bytes,l,c.data);const d=of(46);d.view.setUint32(0,33639248,!0),d.view.setUint16(4,20,!0),d.view.setUint16(6,20,!0),d.view.setUint16(8,2048,!0),d.view.setUint16(12,n.time,!0),d.view.setUint16(14,n.date,!0),d.view.setUint32(16,h,!0),d.view.setUint32(20,c.data.length,!0),d.view.setUint32(24,c.data.length,!0),d.view.setUint16(28,l.length,!0),d.view.setUint32(42,r,!0),i.push(d.bytes,l),r+=u.bytes.length+l.length+c.data.length}const o=iy(i),a=of(22);return a.view.setUint32(0,101010256,!0),a.view.setUint16(8,s.length,!0),a.view.setUint16(10,s.length,!0),a.view.setUint32(12,o.length,!0),a.view.setUint32(16,r,!0),new Blob([iy([...t,o,a.bytes])],{type:"application/zip"})}function CO(s){const e=atob(s),t=new Uint8Array(e.length);for(let i=0;ii===".."||/^[a-z]+:/i.test(i))?"images":t.join("/")}function EO(s){return String(s||"SpineParticle").replace(/\.json$/i,"").replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||"SpineParticle"}async function IO(s){const e=await mS(s.systems);if(!e.length)throw new Error("当前可见粒子系统没有可导出的图片");const t=AO(s.imagesPath);return{blob:MO(e.map(n=>({name:`${t}/${n.path}`,data:CO(n.dataBase64)}))),imageCount:e.length,folder:t}}function RO(s,e){const t=`${EO(e)}-images.zip`,i=URL.createObjectURL(s),n=document.createElement("a");return n.href=i,n.download=t,n.style.display="none",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3),t}function PO(s){s.settings.exportSettings=Q1(s.settings.exportSettings);const e=qe(()=>s.settings.exportSettings),t=Ge(!1),i=Ge(null),n=Ge(""),r=Ge(!1),o=Ge(null),a=Ge(""),c=Ge(""),l=qe(()=>{const b=o.value;return b?b.available?b.spineFound?b.authorized?"连接器可用 · Spine 已就绪":"连接器已启动,当前网站尚未授权":"连接器已启动,但未找到 Spine":"本地 Spine 连接器未启动":"正在检测本地 Spine 连接器…"}),h=qe(()=>{var b,M,I,F,E,k;return{ready:!!((b=o.value)!=null&&b.available)&&!!((M=o.value)!=null&&M.spineFound)&&!!((I=o.value)!=null&&I.authorized),warning:!!((F=o.value)!=null&&F.available)&&(!((E=o.value)!=null&&E.spineFound)||!((k=o.value)!=null&&k.authorized))}}),u=qe(()=>{var b,M,I;return!!((b=o.value)!=null&&b.available)&&!!((M=o.value)!=null&&M.spineFound)&&!!((I=o.value)!=null&&I.authorized)}),d=qe(()=>{const b=o.value;return!(b!=null&&b.available)||!b.spineFound||b.authorized||typeof window>"u"?"":`http://127.0.0.1:27843/pair?origin=${encodeURIComponent(window.location.origin)}`}),f=qe(()=>{const b=o.value;return b?b.available?b.spineFound?b.authorized?"":"未授权":"未找到 Spine":"未启动":"检测中"}),p=qe(()=>t.value?"正在重新计算并生成 Spine 工程":f.value?`暂不可用:${f.value}`:`调用本机 Spine 自动生成 ${e.value.spineVersion} 工程`);Vn(()=>{v(),m=window.setInterval(v,3e3)});let m,g=0;pl(()=>{m!==void 0&&window.clearInterval(m)});async function v(){const b=++g,M=await yO();if(b!==g)return;o.value=M;const I=c.value;(I==="CONNECTOR_OFFLINE"?M.available:I==="SPINE_NOT_FOUND"?M.available&&M.spineFound:I==="ORIGIN_NOT_ALLOWED"?M.available&&M.spineFound&&M.authorized:!!I&&M.available&&M.spineFound&&M.authorized)&&(c.value="",a.value="",r.value&&(r.value=!1,n.value=""))}function x(){return new Promise(b=>requestAnimationFrame(()=>b()))}async function y(b){s.timeline.playing=!1,s.timeline.frame=0,s.timeline.recorded=!1;for(const F of s.systems)F.frames=void 0;s.recalcTotalFrames(),await x(),s.timeline.playing=!0;const M=s.timeline.totalFrames/Math.max(1,s.timeline.fps)*1e3,I=performance.now()+Math.max(8e3,M*2.5+3e3);for(;!s.timeline.recorded;){if(performance.now()>I)throw new Error("重新计算动画超时,请确认页面仍在运行后重试");b==null||b(Math.min(.98,s.timeline.frame/Math.max(1,s.timeline.totalFrames-1))),await new Promise(F=>setTimeout(F,50))}b==null||b(1)}async function _(){if(!t.value){t.value=!0,i.value="json",r.value=!1,c.value="",a.value="",n.value="正在重新计算粒子动画…";try{await y();const b=Yv({systems:s.systems,timeline:s.timeline,settings:e.value});ty(b.text,e.value.spineVersion),a3(b,e.value.fileName);const M=b.warnings.length?`;${b.warnings.length} 条资源提示(缺图仍已导出)`:"";n.value=`已导出 Spine ${e.value.spineVersion}:${b.particleSystemCount} 个粒子系统、${b.animationCount} 个动画、${b.boneCount} 根骨骼${M}`}catch(b){r.value=!0,n.value=b instanceof Error?b.message:String(b)}finally{t.value=!1,i.value=null}}}async function C(){if(t.value)return;t.value=!0,i.value="spine",r.value=!1,c.value="",a.value="",n.value="正在重新计算粒子动画…";const b=yw("导出 Spine 包","正在重新计算粒子动画…");try{await b.paint(),await y(E=>b.update(E*18,"正在重新计算粒子动画…")),b.update(20,"正在生成 Spine JSON…");const M=Yv({systems:s.systems,timeline:s.timeline,settings:e.value});ty(M.text,e.value.spineVersion),n.value="正在整理图片并调用本机 Spine…";const I=e.value.fileName.replace(/\.json$/i,"")||"SpineParticle",F=await xO({projectName:I,spineVersion:e.value.spineVersion,skeletonJson:M.text,systems:s.systems},({phase:E,progress:k})=>{E==="images"?b.update(k==null?null:22+k*18,"正在整理工程图片…"):E==="upload"?b.update(k==null?null:40+k*30,"正在上传数据到 Spine 连接器…"):E==="processing"?b.update(null,"Spine 正在转换工程,请稍候…"):b.update(k==null?null:82+k*16,"正在下载生成的 Spine 工程包…")});b.update(99,"正在交给浏览器下载…"),bO(F.blob,F.fileName),n.value=`已生成 ${F.fileName}:包含 .spine 工程和 ${F.imageCount} 张图片,Spine ${F.spineEditorVersion}`,await v(),await b.finish("Spine 工程包已开始下载")}catch(M){const I=M instanceof Error?M.message:String(M);r.value=!0,c.value=M instanceof Mh?M.code:"",M instanceof Mh&&M.pairUrl&&(a.value=M.pairUrl),n.value=I,await v(),await b.fail(I)}finally{t.value=!1,i.value=null}}async function S(){if(!t.value){t.value=!0,i.value="images",r.value=!1,c.value="",a.value="",n.value="正在整理当前粒子系统使用的图片…";try{const b=await IO({systems:s.systems,imagesPath:e.value.imagesPath}),M=RO(b.blob,e.value.fileName);n.value=`已生成 ${M}:${b.folder}/ 内包含 ${b.imageCount} 张图片`}catch(b){r.value=!0,n.value=b instanceof Error?b.message:String(b)}finally{t.value=!1,i.value=null}}}return{exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorHealth:o,connectorPairUrl:a,connectorExportErrorCode:c,connectorStatusText:l,connectorStatusClass:h,connectorReady:u,connectorAuthorizationUrl:d,connectorDisabledReason:f,connectorButtonTitle:p,connectorHealthTimer:m,connectorHealthRequestId:g,refreshConnectorHealth:v,nextPaint:x,prepareExportFrames:y,exportSpineJson:_,exportSpineProject:C,exportSpineImages:S}}function kO(s){const e=Ge(null),t=Ge(""),i=Ge([]),n=Ge(!1),r=Ge(""),o=Ge(!1);function a(){hw(s),o.value=!1,r.value="配置已保存到本地"}async function c(u){var p;const d=u.target,f=(p=d.files)==null?void 0:p[0];if(f){r.value="正在加载配置…",o.value=!1;try{await KP(s,f),r.value=`已加载:${f.name}`}catch(m){o.value=!0,r.value=m instanceof Error?m.message:String(m)}finally{d.value=""}}}async function l(){try{const u=await fetch(`/Preset/index.json?t=${Date.now()}`,{cache:"no-store"});if(!u.ok)throw new Error("无法读取预设列表");const d=await u.json();i.value=Array.isArray(d)?d.filter(f=>!!f&&typeof f.name=="string"&&typeof f.file=="string"):[]}catch{i.value=[]}}async function h(){const u=t.value;if(!u)return;n.value=!0,o.value=!1,r.value="正在加载预设…";const d=yw("加载预设",`正在下载 ${u}…`);try{await d.paint();const f=await fetch(`/Preset/${encodeURIComponent(u)}`,{cache:"no-store"});if(!f.ok)throw new Error(`无法读取预设:${u}`);const p=await BF(f,m=>{d.update(m==null?null:m*55,`正在下载 ${u}…`)});d.update(58,"正在解析预设配置…"),d.update(70,"正在解析并恢复预设资源…"),await dw(s,p),r.value=`已加载预设:${u.replace(/\.json$/i,"")}`,await d.finish("预设加载完成")}catch(f){o.value=!0;const p=f instanceof Error?f.message:String(f);r.value=`${p},请检查预设文件命名`,await d.fail(p)}finally{n.value=!1,t.value=""}}return Vn(l),{configFileInput:e,selectedPreset:t,presetOptions:i,presetLoading:n,configMessage:r,configError:o,saveConfig:a,onConfigFileChange:c,refreshPresets:l,loadSelectedPreset:h}}function FO(s){const e=Ge(null),t=Ge(null),i=Ge(null),n=Ge(null),r=Ge(null);function o(){var B;const P=(B=s.value)==null?void 0:B.config;if(!P)return;const L=Math.max(0,...P.trailResources.map(X=>X.id))+1;P.trailResources.push({id:L,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:um.map(X=>({...X})),boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:cm.map(X=>({...X})),shapeEnabled:!1,shapeCurve:dm.map(X=>({...X}))}),p()}function a(P){var L;r.value=P,(L=n.value)==null||L.click()}function c(P,L){var V;const B=(V=s.value)==null?void 0:V.config;if(!B)return;const X=P==="trailGridCols"?32:16;B[P]=Math.min(X,Math.max(2,Math.round(Number(L)||2)))}function l(P,L){var X;const B=(X=s.value)==null?void 0:X.config.trailResources.find(V=>V.id===P);B&&(B.boneCount=Math.min(16,Math.max(2,Math.round(Number(L)||2))))}function h(P,L){var X;const B=(X=s.value)==null?void 0:X.config.trailResources.find(V=>V.id===P);B&&(B.rotation=Math.max(-360,Math.min(360,Number(L)||0)))}async function u(P){var W,ne;const L=P.target,B=(W=L.files)==null?void 0:W[0],X=(ne=s.value)==null?void 0:ne.config,V=X==null?void 0:X.trailResources.find(re=>re.id===r.value);if(!B||!V){L.value="";return}const q=await M(B);V.texture=nr(await ze.fromURL(q)),V.previewUrl=q,V.textureName=B.name.replace(/\.[^.]+$/,"")||"trail",L.value="",r.value=null}async function d(P){var X;const L=(X=s.value)==null?void 0:X.config,B=L==null?void 0:L.trailResources.find(V=>V.id===P);B&&(B.texture=nr(await ze.fromURL("/images/trail.png")),B.previewUrl="/images/trail.png",B.textureName="trail",B.weight=100,B.locked=!1,B.rotation=0,B.boneCount=3,B.trailRatio=100,B.lengthMode="fixed",B.length=100,B.lengthMin=100,B.lengthMax=100,B.widthSizeMode="fixed",B.width=100,B.widthMin=100,B.widthMax=100,B.widthMode="particle",B.lifeLengthEnabled=!1,B.lifeLengthCurve=cm.map(V=>({...V})),B.shapeEnabled=!1,B.shapeCurve=dm.map(V=>({...V})),B.colorMode="particle",B.color="#ffffff",B.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],B.blend="normal",B.alphaMode="particle",B.alpha=1,B.alphaCurve=um.map(V=>({...V})),p())}function f(P){var X;const L=(X=s.value)==null?void 0:X.config.trailResources;if(!L||L.length<=1)return;const B=L.findIndex(V=>V.id===P);B>=0&&L.splice(B,1),p()}function p(){var V;const P=(V=s.value)==null?void 0:V.config.trailResources;if(!(P!=null&&P.length))return;if(P.length===1){P[0].weight=100,P[0].locked=!1;return}const L=P.filter(q=>q.locked),B=P.filter(q=>!q.locked);let X=L.reduce((q,W)=>q+Math.max(0,Number(W.weight)||0),0);X>100&&($(L,100,!0),X=100),$(B,100-X)}function m(P,L){var ne;const B=(ne=s.value)==null?void 0:ne.config.trailResources;if(!(B!=null&&B.length))return;if(B.length===1){B[0].weight=100,B[0].locked=!1;return}const X=B.find(re=>re.id===P);if(!X||X.locked)return;const V=B.filter(re=>re.id!==P&&re.locked).reduce((re,le)=>re+Math.max(0,Number(le.weight)||0),0),q=Math.max(0,100-V),W=B.filter(re=>re.id!==P&&!re.locked);X.weight=D(Math.min(q,Math.max(0,Number(L)||0))),W.length?$(W,q-X.weight,!0):X.weight=D(q)}function g(P){var X;const L=(X=s.value)==null?void 0:X.config.trailResources;if(!L||L.length===1)return;const B=L.find(V=>V.id===P);B&&(B.locked=!B.locked)}function v(P,L){const B=L.target;P.color=F(B.value,P.color),B.value=P.color}function x(P,L){v(P,L),L.target.blur()}function y(){var B;const P=(B=s.value)==null?void 0:B.config;if(!P)return;const L=Math.max(0,...P.imageResources.map(X=>X.id))+1;P.imageResources.push({id:L,texture:P.texture,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],blend:"normal",independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:hm.map(X=>({...X}))}),N()}function _(P){var L;i.value=P,(L=e.value)==null||L.click()}function C(P){var L;i.value=P,(L=t.value)==null||L.click()}async function S(P){var ne,re;const L=P.target,B=(ne=L.files)==null?void 0:ne[0],X=(re=s.value)==null?void 0:re.config,V=X==null?void 0:X.imageResources.find(le=>le.id===i.value);if(!B||!V){L.value="";return}const q=await M(B),W=nr(await ze.fromURL(q));V.texture=W,V.previewUrl=q,V.textureFolder="",V.textureName=B.name.replace(/\.[^.]+$/,"")||"particle",L.value="",i.value=null}async function b(P){var q;const L=P.target,B=Array.from(L.files||[]).sort((W,ne)=>W.name.localeCompare(ne.name,void 0,{numeric:!0,sensitivity:"base"})),X=(q=s.value)==null?void 0:q.config,V=X==null?void 0:X.imageResources.find(W=>W.id===i.value);if(!B.length||!V){L.value="";return}V.sequenceFrames=await Promise.all(B.map(async W=>{const ne=await M(W);return{name:W.name,previewUrl:ne,texture:nr(await ze.fromURL(ne))}})),V.imageMode="sequence",L.value="",i.value=null}function M(P){return new Promise((L,B)=>{const X=new FileReader;X.onload=()=>L(String(X.result||"")),X.onerror=()=>B(X.error),X.readAsDataURL(P)})}function I(P){var X;const L=(X=s.value)==null?void 0:X.config,B=L==null?void 0:L.imageResources.find(V=>V.id===P);!L||!B||(B.texture=L.texture,B.textureName="star",B.textureFolder="",B.previewUrl="/images/star.png",B.imageMode="fixed",B.sequencePlayback="loop-forward",B.sequenceFps=30,B.sequenceFrames=[],B.scale=1,B.anchorX=.5,B.anchorY=.5,B.colorMode="fixed",B.colorStart="#ffffff",B.colorEnd="#ff4d4d",B.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],B.blend="normal",B.independentAlpha="off",B.alpha=1,B.alphaCurveMode="跟随导出",B.alphaCurve=hm.map(V=>({...V})),B.locked=!1,N())}function F(P,L){let B=P.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(B)&&(B=B.split("").map(X=>X+X).join("")),/^[0-9a-f]{6}$/i.test(B)?`#${B.toLowerCase()}`:L}function E(P,L){const B=L.target;P.colorStart=F(B.value,P.colorStart),B.value=P.colorStart}function k(P,L){E(P,L),L.target.blur()}function O(P){var X;const L=(X=s.value)==null?void 0:X.config.imageResources;if(!L||L.length<=1)return;const B=L.findIndex(V=>V.id===P);B>=0&&L.splice(B,1),N()}function D(P){return Math.round(P)}function $(P,L,B=!1){if(!P.length)return;const X=Math.max(0,D(L)),V=B?P.reduce((W,ne)=>W+Math.max(0,Number(ne.weight)||0),0):0;let q=0;P.forEach((W,ne)=>{const re=ne===P.length-1,le=D(re?X-q:V>0?X*Math.max(0,Number(W.weight)||0)/V:X/P.length);W.weight=le,q+=le})}function N(){var V;const P=(V=s.value)==null?void 0:V.config.imageResources;if(!(P!=null&&P.length))return;if(P.length===1){P[0].weight=100,P[0].locked=!1;return}const L=P.filter(q=>q.locked),B=P.filter(q=>!q.locked);let X=L.reduce((q,W)=>q+Math.max(0,Number(W.weight)||0),0);X>100&&($(L,100,!0),X=100),$(B,100-X)}function U(P,L){var ne;const B=(ne=s.value)==null?void 0:ne.config.imageResources;if(!(B!=null&&B.length))return;if(B.length===1){B[0].weight=100,B[0].locked=!1;return}const X=B.find(re=>re.id===P);if(!X||X.locked)return;const V=B.filter(re=>re.id!==P&&re.locked).reduce((re,le)=>re+Math.max(0,Number(le.weight)||0),0),q=Math.max(0,100-V),W=B.filter(re=>re.id!==P&&!re.locked);if(X.weight=D(Math.min(q,Math.max(0,Number(L)||0))),!W.length){X.weight=D(q);return}$(W,q-X.weight,!0)}function A(P){var X;const L=(X=s.value)==null?void 0:X.config.imageResources;if(!L||L.length===1)return;const B=L.find(V=>V.id===P);B&&(B.locked=!B.locked)}return{textureFileInput:e,sequenceFileInput:t,pendingResourceId:i,trailTextureFileInput:n,pendingTrailResourceId:r,addTrailResource:o,openTrailTexturePicker:a,onTrailRigChange:c,onTrailResourceBoneCountChange:l,onTrailResourceRotationChange:h,onTrailTextureFile:u,resetTrailTexture:d,removeTrailResource:f,rebalanceTrailWeights:p,setTrailResourceWeight:m,toggleTrailResourceLock:g,setTrailColor:v,commitTrailColor:x,addImageResource:y,openTexturePicker:_,openSequencePicker:C,onTextureFile:S,onSequenceFiles:b,readFileAsDataUrl:M,resetTexture:I,normalizeHex:F,setResourceFixedColor:E,commitResourceFixedColor:k,removeImageResource:O,roundWeight:D,distributeImageWeights:$,rebalanceImageWeights:N,setResourceWeight:U,toggleResourceLock:A}}function OO(){const s=ao(),{exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:c,connectorReady:l,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:p,exportSpineProject:m,exportSpineImages:g}=PO(s),{configFileInput:v,selectedPreset:x,presetOptions:y,presetLoading:_,configMessage:C,configError:S,saveConfig:b,onConfigFileChange:M,refreshPresets:I,loadSelectedPreset:F}=kO(s);function E(ee){return ee==="跟随导出"?e.value.keyframeCurve==="bezier"?"bezier":"linear":ee==="贝塞尔"?"bezier":"linear"}s.systems.length||s.addSystem();const k=qe(()=>{const ee=s.systems.findIndex(me=>me.id===s.activeId);return ee>=0?ee:0}),O=qe(()=>s.systems[k.value]||null),{textureFileInput:D,sequenceFileInput:$,trailTextureFileInput:N,addTrailResource:U,openTrailTexturePicker:A,onTrailRigChange:P,onTrailResourceBoneCountChange:L,onTrailResourceRotationChange:B,onTrailTextureFile:X,resetTrailTexture:V,removeTrailResource:q,setTrailResourceWeight:W,toggleTrailResourceLock:ne,setTrailColor:re,commitTrailColor:le,addImageResource:ue,openTexturePicker:ae,openSequencePicker:xe,onTextureFile:Y,onSequenceFiles:j,resetTexture:H,setResourceFixedColor:G,commitResourceFixedColor:z,removeImageResource:ie,setResourceWeight:fe,toggleResourceLock:te}=FO(O),oe=qe(()=>O.value?eb(O.value.config,s.timeline.fps):30),ce=qe(()=>{var me;const ee=(me=O.value)==null?void 0:me.config;return ee?Math.max(1,Math.ceil(Number(ee.loopDurationFrames)||1)):1}),Ce=qe(()=>s.activeObjectType),ye=qe(()=>s.activeObjectType==="collision"&&s.colliders.find(ee=>ee.id===s.activeObjectId)||null),we=qe(()=>s.activeObjectType==="path"&&s.paths.find(ee=>ee.id===s.activeObjectId)||null),Me=qe(()=>s.activeObjectType==="spine"&&s.spines.find(ee=>ee.id===s.activeObjectId)||null),ve=qe(()=>s.activeObjectType==="particle"?s.systems.some(ee=>ee.id===s.activeObjectId):s.activeObjectType==="collision"?s.colliders.some(ee=>ee.id===s.activeObjectId):s.activeObjectType==="path"?s.paths.some(ee=>ee.id===s.activeObjectId):s.spines.some(ee=>ee.id===s.activeObjectId)),Xe=qe(()=>{const ee=s.spines.find(me=>me.selectedBone&&me.bones.some(Ae=>Ae.name===me.selectedBone));return ee?{spine:ee,boneName:ee.selectedBone}:null}),pe=qe(()=>{var Ae;const ee=(Ae=O.value)==null?void 0:Ae.config;if(!ee||ee.emitterFollowMode!=="bone")return null;const me=s.spines.find(bt=>bt.id===ee.emitterFollowSpineId);return!me||!me.bones.some(bt=>bt.name===ee.emitterFollowBoneName)?null:{spine:me,boneName:ee.emitterFollowBoneName}}),Ke=Ge(!1),Ze=qe(()=>{var me;const ee=new Set(((me=O.value)==null?void 0:me.config.collisionColliderIds)||[]);return s.colliders.filter(Ae=>ee.has(Ae.id))}),Ct=qe(()=>{var me;const ee=new Set(((me=O.value)==null?void 0:me.config.collisionColliderIds)||[]);return s.colliders.filter(Ae=>!ee.has(Ae.id))});Xi(()=>{var ee,me;return[(ee=O.value)==null?void 0:ee.id,(me=O.value)==null?void 0:me.config.collision]},()=>{Ke.value=!1});function Lt(ee){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;!me||me.collisionColliderIds.includes(ee)||(me.collisionColliderIds.push(ee),Ke.value=!1)}function ii(ee){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;me&&(me.collisionColliderIds=me.collisionColliderIds.filter(bt=>bt!==ee))}Ma(()=>{for(const ee of s.systems)ee.visible==null&&(ee.visible=!0);for(const ee of s.colliders)ee.visible==null&&(ee.visible=!0);for(const ee of s.paths)ee.visible==null&&(ee.visible=!0);for(const ee of s.spines)ee.visible==null&&(ee.visible=!0)}),Ma(()=>{if(!O.value)return;const ee=pr(O.value.config);ee.lifeMode==="curve"&&(ee.lifeMode="random"),ee.speedMode==="curve"&&(ee.speedMode="random"),ee.scaleMode==="curve"&&(ee.scaleMode="random"),ee.initialRotationMode==="curve"&&(ee.initialRotationMode="random"),ee.mode==="stream"&&!(ee.duration>0)&&(ee.duration=1),ee.streamBehavior==="loop"&&(ee.emitterFollow||ee.emitterFollowMode!=="none")&&ot(ee)}),Ma(()=>{const ee=new Set(s.colliders.map(me=>me.id));for(const me of s.systems){const Ae=pr(me.config),bt=Ae.collisionColliderIds.filter(Sr=>ee.has(Sr));if(bt.length!==Ae.collisionColliderIds.length&&(Ae.collisionColliderIds=bt),Ae.spawnPathId>0&&!s.paths.some(Sr=>Sr.id===Ae.spawnPathId)&&(Ae.spawnPathId=0,(Ae.emissionAngleMode==="path-normal"||Ae.emissionAngleMode==="path-tangent")&&(Ae.emissionAngleMode="fixed")),Ae.emitterFollowMode!=="bone")continue;const Pt=s.spines.find(Sr=>Sr.id===Ae.emitterFollowSpineId);!!(Pt!=null&&Pt.bones.some(Sr=>Sr.name===Ae.emitterFollowBoneName))||(Ae.emitterFollowMode="none",Ae.emitterFollowSpineId=0,Ae.emitterFollowBoneName="")}}),Ma(()=>{for(const ee of s.colliders)ee.followPathId==null&&(ee.followPathId=0),ee.followDuration>0||(ee.followDuration=2),ee.followPathRotation==null&&(ee.followPathRotation=!1),["跟随导出","线性","贝塞尔"].includes(ee.followCurveMode)||(ee.followCurveMode="跟随导出"),(!Array.isArray(ee.followCurve)||ee.followCurve.length<2)&&(ee.followCurve=[{x:0,y:0},{x:1,y:1}])});const rs=no({config:!0,scene:!1,emitMode:!0,shape:!0,attr:!0,look:!0,mods:!0,export:!1});function zt(ee){rs[ee]=!rs[ee]}function se(ee){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;me&&(me.mode=ee,ee==="stream"&&!(me.duration>0)&&(me.duration=1))}function he(ee){var bt;const me=(bt=O.value)==null?void 0:bt.config;if(!me)return;const Ae=Math.min(1800,Math.max(1,Math.ceil(Number(ee)||1)));me.loopDurationFrames=Ae}function ot(ee){const me=cl();ee.emitterFollow=!1,ee.emitterFollowMode="none",ee.emitterFollowPathId=me.emitterFollowPathId,ee.emitterFollowSpineId=me.emitterFollowSpineId,ee.emitterFollowBoneName=me.emitterFollowBoneName,ee.emitterFollowBoneOffsetX=me.emitterFollowBoneOffsetX,ee.emitterFollowBoneOffsetY=me.emitterFollowBoneOffsetY,ee.emitterFollowBoneRotation=me.emitterFollowBoneRotation,ee.emitterFollowBoneScaleX=me.emitterFollowBoneScaleX,ee.emitterFollowBoneScaleY=me.emitterFollowBoneScaleY,ee.emitterAngleMode=me.emitterAngleMode,ee.emitterFollowCurve=me.emitterFollowCurve.map(Ae=>({...Ae})),ee.emitterFollowDuration=me.emitterFollowDuration,ee.emitterFollowSpace=me.emitterFollowSpace,ee.emitterFollowDirection=me.emitterFollowDirection,ee.emitterFollowOffset=me.emitterFollowOffset}function at(ee){var Pt;const me=(Pt=O.value)==null?void 0:Pt.config;if(!me||me.streamBehavior===ee)return;const Ae=ee==="loop",bt=Ae?"进入循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?":"退出循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?";window.confirm(bt)&&(ot(me),me.streamBehavior=ee,Ae||(me.generateLoopStartAnimation=!1,me.generateLoopEndAnimation=!1))}function gt(ee,me){var Pt;const Ae=(Pt=O.value)==null?void 0:Pt.config;if(!Ae)return;const bt=me.target.checked;ee==="start"?Ae.generateLoopStartAnimation=bt:Ae.generateLoopEndAnimation=bt}function $e(ee,me){var Pt;const Ae=(Pt=O.value)==null?void 0:Pt.config;if(!Ae)return;const bt=Math.min(1800,Math.max(1,Math.ceil(Number(me.target.value)||30)));ee==="start"?Ae.loopStartDurationFrames=bt:Ae.loopEndDurationFrames=bt}function _i(ee,me){var Pt;const Ae=(Pt=O.value)==null?void 0:Pt.config;if(!Ae)return;const bt=me.target.checked;ee==="start"?Ae.loopStartUseCustomDuration=bt:Ae.loopEndUseCustomDuration=bt}function pi(ee,me){const Ae=ee.target.value;if(me.emitterFollowMode=Ae,Ae!=="bone"){me.emitterFollowSpineId=0,me.emitterFollowBoneName="";return}$t(me)}function $t(ee){const me=Xe.value;if(!me){ee.emitterFollowMode="none",ee.emitterFollowSpineId=0,ee.emitterFollowBoneName="";return}ee.emitterFollowMode="bone",ee.emitterFollowSpineId=me.spine.id,ee.emitterFollowBoneName=me.boneName}const Fi={emitMode:["mode","rate","streamBehavior","loopDurationFrames","generateLoopStartAnimation","loopStartUseCustomDuration","loopStartDurationFrames","generateLoopEndAnimation","loopEndUseCustomDuration","loopEndDurationFrames","burstCount","burstLoop","delay","duration"],shape:["shape","shapeRangeVersion","innerRadius","outerRadius","innerRectW","innerRectH","outerRectW","outerRectH","spawnPathId","spawnPathDistribution","radius","rectW","rectH","emissionAngleMode","direction","spread","coneDirection","coneAngle"],attr:["lifeMin","lifeMax","lifeMode","lifeCurve","speedMin","speedMax","speedMode","speedCurve","scaleMin","scaleMax","scaleMode","scaleAxisMode","scaleYMin","scaleYMax","scaleCurve","scaleYCurve","scaleEndRatio","initialRotationMode","initialRotationMin","initialRotationMax","initialRotationCurve","rotationSpeedMin","rotationSpeedMax","speedOverLifeEnabled","speedOverLifeMode","speedOverLifeMin","speedOverLifeMax","speedOverLifeCurve","scaleOverLifeEnabled","scaleOverLifeMode","scaleOverLifeAxisMode","scaleOverLifeMin","scaleOverLifeMax","scaleYOverLifeMin","scaleYOverLifeMax","scaleOverLifeCurve","scaleYOverLifeCurve","rotationOverLifeEnabled","rotationOverLifeMode","rotationOverLifeCurve"],look:["texture","imageResources","imageWeightVersion","alpha","alphaEnd","colorStart","colorEnd","colorOverLife","blend","alphaMode","curveMode","alphaCurve","textureName","textureFolder","alphaScale","anchorX","anchorY","independentAlpha"],mods:["noise","noiseAmt","noiseRange","noiseSpeed","useGravity","gravity","gravityMode","gravityMin","gravityMax","gravityDirection","gravityCurve","wind","windX","windY","windMode","windMin","windMax","windDirection","windCurve","forceField","forceStrength","forceRadius","forceCenterX","forceCenterY","forceFalloff","attraction","attractionCenterX","attractionCenterY","attractionRadius","attractionDuration","attractionDelay","attractionDelayMode","attractionPath","trail","trailConfigVersion","trailResources","trailResourceVersion","trailTexture","trailTextureName","trailPreviewUrl","trailColorMode","trailColor","trailColorGradient","trailAlphaMode","trailAlpha","trailAlphaCurve","trailBoneCount","trailLength","trailWidth","trailWidthMode","trailLifeLengthEnabled","trailLifeLengthCurve","trailShapeEnabled","trailShapeCurve","trailGridRows","trailGridCols","collision","collisionColliderIds","pathFollow","emitterFollow","emitterFollowMode","emitterFollowPathId","emitterFollowSpineId","emitterFollowBoneName","emitterFollowBoneOffsetX","emitterFollowBoneOffsetY","emitterFollowBoneRotation","emitterFollowBoneScaleX","emitterFollowBoneScaleY","emitterAngleMode","emitterFollowCurve","emitterFollowDuration","emitterFollowSpace","emitterFollowDirection","emitterFollowOffset","damping"]};function vs(ee){var bt;const me=(bt=O.value)==null?void 0:bt.config;if(ee==="export"){s.settings.exportSettings=ap();return}if(!me)return;const Ae=cl();for(const Pt of Fi[ee])me[Pt]=Ae[Pt]}function Vi(){e.value.fps=Math.min(240,Math.max(1,Math.round(Number(e.value.fps)||30)))}function Ti(ee){var me;s.selectSystem(((me=s.systems[ee])==null?void 0:me.id)??0)}function uo(){s.addSystem()}function Cl(){s.addCollider()}function Al(){s.addPath()}function wr(){s.addSpine()}function ha(){s.duplicateSelectedObject()}function Yi(ee,me,Ae=0,bt=0,Pt=0,ma=0){return{x:ee,y:me,inX:Ae,inY:bt,outX:Pt,outY:ma}}function ua(){const ee=we.value;if(!(!ee||!ee.preset))if(ee.preset==="circle"){const Ae=60.751328;ee.points=[Yi(110,0,0,-Ae,0,Ae),Yi(0,110,Ae,0,-Ae,0),Yi(-110,0,0,Ae,0,-Ae),Yi(0,-110,-Ae,0,Ae,0)],ee.closed=!0}else if(ee.preset==="square")ee.points=[Yi(-100,-100),Yi(100,-100),Yi(100,100),Yi(-100,100)],ee.closed=!0;else{const me=ee.preset==="star"?10:6;ee.points=Array.from({length:me},(Ae,bt)=>{const Pt=ee.preset==="star"&&bt%2?50:110,ma=-Math.PI*.5+bt/me*Math.PI*2;return Yi(Math.cos(ma)*Pt,Math.sin(ma)*Pt)}),ee.closed=!0}}function da(){we.value&&(we.value.points=[])}function El(){O.value&&(O.value.config.seed=Math.floor(Math.random()*999999)+1)}function Il(ee){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;!me||ee==="direction"||(me.speedOverLifeMode=ee,ee==="curve"&&me.speedOverLifeMin===me.speedOverLifeMax&&(me.speedOverLifeMin=0,me.speedOverLifeMax=1))}function fo(){var me;const ee=(me=O.value)==null?void 0:me.config;!ee||ee.scaleOverLifeMode!=="curve"||(ee.scaleOverLifeMin===ee.scaleOverLifeMax&&(ee.scaleOverLifeMin=0,ee.scaleOverLifeMax=1),ee.scaleYOverLifeMin===ee.scaleYOverLifeMax&&(ee.scaleYOverLifeMin=0,ee.scaleYOverLifeMax=1))}function Rl(ee){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;!me||ee==="direction"||(me.scaleOverLifeMode=ee,fo())}const fa={point:{emissionAngleMode:"random",direction:0,spread:360},circle:{innerRadius:0,outerRadius:100,emissionAngleMode:"fixed",direction:-90,spread:0},rect:{innerRectW:0,innerRectH:0,outerRectW:200,outerRectH:100,emissionAngleMode:"fixed",direction:-90,spread:0},cone:{innerRadius:0,outerRadius:100,coneAngle:90,coneDirection:90,emissionAngleMode:"random",direction:90,spread:90},path:{spawnPathId:0,spawnPathDistribution:"fixed",emissionAngleMode:"fixed",direction:0,spread:0}};function Pl(){var Ae;const ee=(Ae=O.value)==null?void 0:Ae.config;if(!ee)return;const me=fa[ee.shape];me&&Object.assign(ee,me)}function du(){var me;const ee=(me=O.value)==null?void 0:me.config;!ee||ee.spawnPathId>0||(ee.emissionAngleMode==="path-normal"||ee.emissionAngleMode==="path-tangent")&&(ee.emissionAngleMode="fixed")}return{store:s,exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:c,connectorReady:l,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:p,exportSpineProject:m,exportSpineImages:g,configFileInput:v,selectedPreset:x,presetOptions:y,presetLoading:_,configMessage:C,configError:S,saveConfig:b,onConfigFileChange:M,refreshPresets:I,loadSelectedPreset:F,resolvedCurveEditorMode:E,sys:O,textureFileInput:D,sequenceFileInput:$,trailTextureFileInput:N,addTrailResource:U,openTrailTexturePicker:A,onTrailRigChange:P,onTrailResourceBoneCountChange:L,onTrailResourceRotationChange:B,onTrailTextureFile:X,resetTrailTexture:V,removeTrailResource:q,setTrailResourceWeight:W,toggleTrailResourceLock:ne,setTrailColor:re,commitTrailColor:le,addImageResource:ue,openTexturePicker:ae,openSequencePicker:xe,onTextureFile:Y,onSequenceFiles:j,resetTexture:H,setResourceFixedColor:G,commitResourceFixedColor:z,removeImageResource:ie,setResourceWeight:fe,toggleResourceLock:te,automaticLoopDuration:oe,loopDurationFrames:ce,activeObjectType:Ce,activeCollider:ye,activePath:we,activeSpine:Me,canCopyObject:ve,selectedSpineBone:Xe,boundSpineBone:pe,collisionPickerOpen:Ke,selectedCollisionBodies:Ze,availableCollisionBodies:Ct,addCollisionBody:Lt,removeCollisionBody:ii,collapsed:rs,toggle:zt,setEmitMode:se,setLoopDurationFrames:he,setStreamBehavior:at,setLoopSection:gt,setLoopSectionDuration:$e,setLoopCustomDuration:_i,onEmitterFollowModeChange:pi,bindSelectedBone:$t,resetModule:vs,normalizeExportFps:Vi,select:Ti,addSys:uo,addCollider:Cl,addPath:Al,addSpine:wr,copySelectedObject:ha,applyPathPreset:ua,clearPathAnchors:da,randomizeSeed:El,setSpeedOverLifeMode:Il,prepareScaleOverLifeCurve:fo,setScaleOverLifeMode:Rl,onShapeChange:Pl,onSpawnPathChange:du,LINEAR_CURVE:kF,FLAT_CURVE:cm,ALPHA_CURVE:FF,RESOURCE_ALPHA_CURVE:hm,TRAIL_ALPHA_CURVE:um,TRAIL_SHAPE_CURVE:dm}}const pS=Symbol("particle-panel");function BO(){const s=OO();return By(pS,s),s}function br(){const s=No(pS);if(!s)throw new Error("Particle panel sections require a ParticlePanel parent");return s}const LO={class:"group config-management"},DO={class:"caret"},NO={class:"group-body config-management-body"},UO={class:"config-toolbar"},$O=["disabled"],XO={value:""},VO=["value"],YO=Jt({__name:"ProjectConfigSection",setup(s){const{configFileInput:e,selectedPreset:t,presetOptions:i,presetLoading:n,configMessage:r,configError:o,saveConfig:a,onConfigFileChange:c,refreshPresets:l,loadSelectedPreset:h,collapsed:u,toggle:d,select:f}=br();return(p,m)=>(K(),Q("div",LO,[T("div",{class:"group-head",onClick:m[0]||(m[0]=g=>R(d)("config"))},[T("span",DO,_e(R(u).config?"▸":"▾"),1),m[8]||(m[8]=T("span",null,"配置管理",-1))]),de(T("div",NO,[T("div",UO,[T("button",{title:"保存全部编辑器配置 (Ctrl+S)",onClick:m[1]||(m[1]=(...g)=>R(a)&&R(a)(...g))},"保存配置"),T("button",{title:"加载本地编辑器配置",onClick:m[2]||(m[2]=g=>{var v;return(v=R(e))==null?void 0:v.click()})},"加载配置"),de(T("select",{"onUpdate:modelValue":m[3]||(m[3]=g=>jt(t)?t.value=g:null),"aria-label":"预设列表",disabled:!R(i).length||R(n),onPointerdown:m[4]||(m[4]=(...g)=>R(l)&&R(l)(...g)),onFocus:m[5]||(m[5]=(...g)=>R(l)&&R(l)(...g)),onChange:m[6]||(m[6]=(...g)=>R(h)&&R(h)(...g))},[T("option",XO,_e(R(i).length?"选择预设":"无预设文件"),1),(K(!0),Q(Fe,null,Dt(R(i),g=>(K(),Q("option",{key:g.file,value:g.file},_e(g.name),9,VO))),128))],40,$O),[[wt,R(t)]]),T("input",{ref_key:"configFileInput",ref:e,hidden:"",type:"file",accept:".json,application/json",onChange:m[7]||(m[7]=(...g)=>R(c)&&R(c)(...g))},null,544)]),R(r)?(K(),Q("div",{key:0,class:Le(["config-message",{error:R(o)}])},_e(R(r)),3)):Te("",!0)],512),[[vi,!R(u).config]])]))}}),GO=Qt(YO,[["__scopeId","data-v-cb52d3e0"]]),HO={class:"ns-label"},jO=["min","max","step","value","disabled"],WO=["min","max","step","value","disabled"],zO=Jt({__name:"NumSlider",props:{label:{},modelValue:{},min:{},max:{},step:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=Ge(String(t.modelValue));Xi(()=>t.modelValue,c=>{n.value=String(c)});function r(c){const l=parseFloat(c.target.value);Number.isNaN(l)||i("update:modelValue",l)}function o(c){n.value=c.target.value;const l=parseFloat(n.value);Number.isNaN(l)||i("update:modelValue",l)}function a(){const c=parseFloat(n.value);Number.isNaN(c)&&(n.value=String(t.modelValue))}return(c,l)=>(K(),Q("div",{class:Le(["ns",{disabled:s.disabled}])},[T("span",HO,_e(s.label),1),T("input",{type:"range",class:"ns-range",min:s.min,max:s.max,step:s.step,value:s.modelValue,disabled:s.disabled,onInput:r},null,40,jO),T("input",{type:"number",class:"ns-num",min:s.min,max:s.max,step:s.step,value:n.value,disabled:s.disabled,onInput:o,onBlur:a},null,40,WO)],2))}}),Be=Qt(zO,[["__scopeId","data-v-7c2fbed0"]]),qO={class:"ce"},KO={class:"ce-editor"},ZO={class:"ce-grid"},JO=["x1","x2","y2"],QO=["y1","x2","y2"],eB=["x","y","width","height"],tB=["d"],iB={key:0,class:"ce-handles"},sB=["x1","y1","x2","y2"],nB=["cx","cy","onPointerdown"],rB=["x1","y1","x2","y2"],oB=["cx","cy","onPointerdown"],aB=["cx","cy"],lB=["cx","cy","onPointerdown","onDblclick"],cB={class:"ce-nav"},hB={class:"ce-tip"},Hn=8,uB=Jt({__name:"CurveEditor",props:{modelValue:{},defaultValue:{default:()=>[{x:0,y:0},{x:1,y:1}]},mode:{default:"linear"}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=Ge(null),r=Ge(300),o=Ge(110);let a=null;function c(){if(!n.value)return;const E=n.value.getBoundingClientRect();r.value=E.width,o.value=E.height}function l(E){return Hn+E*(r.value-Hn*2)}function h(E){return Hn+(1-E)*(o.value-Hn*2)}function u(){return[...t.modelValue].sort((E,k)=>E.x-k.x)}function d(E){i("update:modelValue",[...E].sort((k,O)=>k.x-O.x))}function f(){d(t.defaultValue.map(E=>({...E})))}const p=qe(()=>u());function m(E){const k=p.value[E],O=p.value[Math.max(0,E-1)];return{x:k.x-(k.x-O.x)/3,y:k.y-(k.y-O.y)/3}}function g(E){const k=p.value[E],O=p.value[Math.min(p.value.length-1,E+1)];return{x:k.x+(O.x-k.x)/3,y:k.y+(O.y-k.y)/3}}function v(E){const k=p.value[E],O=m(E);return{x:k.x+(k.inX??O.x-k.x),y:k.y+(k.inY??O.y-k.y)}}function x(E){const k=p.value[E],O=g(E);return{x:k.x+(k.outX??O.x-k.x),y:k.y+(k.outY??O.y-k.y)}}const y=qe(()=>{if(!p.value.length)return"";let E=`M ${l(p.value[0].x)} ${h(p.value[0].y)}`;for(let k=1;kMath.abs($.x-k)>.02);D.push({x:k,y:O}),d(D)}let b={t:0,i:-1,x:0,y:0};function M(E,k){E.stopPropagation();const O=u().findIndex(U=>Math.abs(U.x-p.value[k].x)<1e-6&&Math.abs(U.y-p.value[k].y)<1e-6);if(O<0)return;const D=Date.now();if(D-b.t<300&&b.i===k&&Math.abs(E.clientX-b.x)<8&&Math.abs(E.clientY-b.y)<8){b={t:0,i:-1,x:0,y:0},F(k);return}b={t:D,i:k,x:E.clientX,y:E.clientY};const $=U=>{(Math.abs(U.clientX-E.clientX)>8||Math.abs(U.clientY-E.clientY)>8)&&(b={t:0,i:-1,x:0,y:0});const{x:A,y:P}=_(U.clientX,U.clientY),L=u();L[O]={x:A,y:P},d(L)},N=()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",N)};window.addEventListener("pointermove",$),window.addEventListener("pointerup",N)}function I(E,k,O){E.stopPropagation();const D=N=>{const U=_(N.clientX,N.clientY),A=u(),P=A[k],L=O==="in"?A[Math.max(0,k-1)].x:P.x,B=O==="in"?P.x:A[Math.min(A.length-1,k+1)].x,X=Math.min(B,Math.max(L,U.x)),V=Math.round((X-P.x)*100)/100,q=Math.round((U.y-P.y)*100)/100;A[k]=O==="in"?{...P,inX:V,inY:q}:{...P,outX:V,outY:q},d(A)},$=()=>{window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",$)};window.addEventListener("pointermove",D),window.addEventListener("pointerup",$)}function F(E,k){k==null||k.stopPropagation();const O=u();O.length<=2||(C=Date.now(),d(O.filter((D,$)=>$!==E)))}return Vn(()=>{c(),a=new ResizeObserver(c),n.value&&a.observe(n.value)}),gl(()=>{a==null||a.disconnect()}),(E,k)=>(K(),Q("div",qO,[T("div",KO,[(K(),Q("svg",{ref_key:"svg",ref:n,class:"ce-svg",onDblclick:S},[T("g",ZO,[(K(),Q(Fe,null,Dt([.25,.5,.75],O=>T("line",{key:"v"+O,x1:l(O),y1:"0",x2:l(O),y2:h(0)},null,8,JO)),64)),(K(),Q(Fe,null,Dt([.25,.5,.75],O=>T("line",{key:"h"+O,x1:"0",y1:h(O),x2:l(1),y2:h(O)},null,8,QO)),64))]),T("rect",{x:l(0),y:h(1),width:l(1)-l(0),height:h(0)-h(1),class:"ce-frame",fill:"none"},null,8,eB),T("path",{d:y.value,class:"ce-line",fill:"none"},null,8,tB),s.mode==="bezier"?(K(),Q("g",iB,[(K(!0),Q(Fe,null,Dt(p.value,(O,D)=>(K(),Q(Fe,{key:"handles-"+D},[D>0?(K(),Q("line",{key:0,x1:l(O.x),y1:h(O.y),x2:l(v(D).x),y2:h(v(D).y)},null,8,sB)):Te("",!0),D>0?(K(),Q("circle",{key:1,cx:l(v(D).x),cy:h(v(D).y),r:"4",onPointerdown:$=>I($,D,"in")},null,40,nB)):Te("",!0),DI($,D,"out")},null,40,oB)):Te("",!0)],64))),128))])):Te("",!0),(K(!0),Q(Fe,null,Dt(p.value,(O,D)=>(K(),Q("g",{key:D},[T("circle",{cx:l(O.x),cy:h(O.y),r:"5",class:"ce-node"},null,8,aB),T("circle",{cx:l(O.x),cy:h(O.y),r:"9",class:"ce-hit",onPointerdown:$=>M($,D),onDblclick:$=>F(D,$)},null,40,lB)]))),128))],544)),T("div",cB,[T("span",hB,_e(s.mode==="bezier"?"拖动方形手柄调整弧度·双击空白新建·双击节点删除":"双击空白新建·双击节点删除·拖动节点调整"),1)])]),T("button",{class:"ce-reset",type:"button",title:"恢复默认曲线",onClick:f},"重置")]))}}),qs=Qt(uB,[["__scopeId","data-v-9bfb7b31"]]),dB={class:"spine-editor"},fB={class:"field wide"},mB={class:"grid three"},pB={class:"field"},gB={class:"field"},vB={class:"field"},yB={class:"grid three"},xB={class:"field"},bB={class:"field"},wB={class:"field"},SB=["disabled"],_B={class:"asset-row"},TB=["title"],MB={class:"asset-row"},CB=["title"],AB={class:"asset-row"},EB=["title"],IB={class:"asset-actions"},RB=["disabled"],PB={class:"runtime-note"},kB={key:0},FB={key:0,class:"error"},OB={class:"section-box"},BB={key:0,class:"empty"},LB={key:1,class:"field wide"},DB=["value"],NB={class:"section-box"},UB={class:"tree-title-row"},$B=["disabled","title"],XB={key:0,class:"empty"},VB={key:1,class:"bone-search"},YB={key:2,class:"empty"},GB={key:3,class:"bone-tree"},HB=["onClick","onKeydown"],jB=["title","onClick"],WB={key:1,class:"bone-leaf"},zB={class:"bone-name"},qB=Jt({__name:"SpineObjectPanel",props:{spineObject:{}},setup(s){const e=s,t=ao(),i=Ge(null),n=Ge(null),r=Ge(null),o=Ge(null),a=Ge(new Set),c=Ge(""),l=Ge(null),h=Ge(null),u=Ge([]);e.spineObject.selectedBone==null&&(e.spineObject.selectedBone=""),e.spineObject.sourceBundle==null&&(e.spineObject.sourceBundle=null),e.spineObject.dataVersion==null&&(e.spineObject.dataVersion="");const d=qe(()=>{var U;return((U=l.value)==null?void 0:U.name)||e.spineObject.skeletonFileName}),f=qe(()=>{var U;return((U=h.value)==null?void 0:U.name)||e.spineObject.atlasFileName}),p=qe(()=>u.value.length?u.value.map(U=>U.name):e.spineObject.textureFileNames),m=qe(()=>p.value.length?`${p.value.length} 张:${p.value.join(", ")}`:"PNG / JPEG / WebP..."),g=qe(()=>new Set(e.spineObject.bones.map(U=>U.parent).filter(U=>!!U))),v=qe(()=>new Map(e.spineObject.bones.map(U=>[U.name,U]))),x=qe(()=>e.spineObject.bones.filter(U=>{var L;const A=c.value.trim().toLocaleLowerCase();if(A)return U.name.toLocaleLowerCase().includes(A);let P=U.parent;for(;P;){if(a.value.has(P))return!1;P=((L=v.value.get(P))==null?void 0:L.parent)||null}return!0})),y=qe(()=>g.value.size>0&&[...g.value].every(U=>a.value.has(U)));function _(U){const A=e.spineObject.selectedBone===U;for(const P of t.spines)P.selectedBone="";A||(e.spineObject.selectedBone=U)}function C(U){a.value.has(U)?a.value.delete(U):a.value.add(U)}function S(){a.value=y.value?new Set:new Set(g.value)}function b(U){var A;return((A=U.target.files)==null?void 0:A[0])||null}function M(U){l.value=b(U)}function I(U){h.value=b(U)}function F(U){u.value=Array.from(U.target.files||[])}function E(U){return U.name.replace(/\.[^.]+$/,"").toLocaleLowerCase()}async function k(U){const A=Array.from(U.target.files||[]);if(!A.length)return;const P=A.filter(W=>/\.(json|skel)$/i.test(W.name)),L=A.filter(W=>/\.atlas$/i.test(W.name)),B=A.filter(W=>/\.(png|jpe?g|webp|wepb)$/i.test(W.name)),X=L.map(W=>({atlas:W,skeleton:P.find(ne=>E(ne)===E(W))})).find(W=>W.skeleton),V=(X==null?void 0:X.skeleton)||P[0]||null,q=(X==null?void 0:X.atlas)||L[0]||null;if(l.value=V,h.value=q,u.value=B,!V||!q||!B.length){const W=[!V&&"JSON / SKEL",!q&&"Atlas",!B.length&&"纹理图片"].filter(Boolean).join("、");e.spineObject.status="error",e.spineObject.error=`所选文件夹缺少:${W}`;return}await $()}function O(){t.recalcTotalFrames()}function D(){O(),t.timeline.frame=0}async function $(){var P;const U=l.value,A=h.value;if(!U||!A||!u.value.length){e.spineObject.status="error",e.spineObject.error="请依次选择 Spine 数据、Atlas 和全部纹理图片";return}e.spineObject.status="loading",e.spineObject.error="";try{const L=await rw(U,A,u.value);nu(e.spineObject.id,L),e.spineObject.skeletonFileName=U.name,e.spineObject.atlasFileName=A.name,e.spineObject.textureFileNames=u.value.map(B=>B.name),e.spineObject.dataVersion=L.dataVersion,e.spineObject.animations=L.animations,e.spineObject.bones=L.bones,e.spineObject.selectedBone="",c.value="",a.value=new Set,e.spineObject.selectedAnimation=((P=L.animations[0])==null?void 0:P.name)||"",e.spineObject.assetVersion++,e.spineObject.status="ready",O(),t.timeline.frame=0;try{e.spineObject.sourceBundle=await XP(U,A,u.value)}catch(B){e.spineObject.sourceBundle=null,console.warn("Spine 配置资源嵌入失败",B)}}catch(L){e.spineObject.status="error",e.spineObject.error=L instanceof Error?L.message:String(L)}}function N(){wl(e.spineObject.id),l.value=null,h.value=null,u.value=[],i.value&&(i.value.value=""),n.value&&(n.value.value=""),r.value&&(r.value.value=""),o.value&&(o.value.value=""),e.spineObject.skeletonFileName="",e.spineObject.atlasFileName="",e.spineObject.textureFileNames=[],e.spineObject.dataVersion="",e.spineObject.sourceBundle=null,e.spineObject.animations=[],e.spineObject.bones=[],e.spineObject.selectedBone="",c.value="",a.value=new Set,e.spineObject.selectedAnimation="",e.spineObject.assetVersion++,e.spineObject.status="empty",e.spineObject.error="",O()}return(U,A)=>(K(),Q("div",dB,[A[30]||(A[30]=T("div",{class:"editor-title"},"Spine 属性",-1)),T("label",fB,[A[15]||(A[15]=T("span",null,"Spine 名称",-1)),de(T("input",{"onUpdate:modelValue":A[0]||(A[0]=P=>s.spineObject.name=P)},null,512),[[He,s.spineObject.name]])]),T("div",mB,[T("label",pB,[A[16]||(A[16]=T("span",null,"X 位置",-1)),de(T("input",{"onUpdate:modelValue":A[1]||(A[1]=P=>s.spineObject.x=P),type:"number"},null,512),[[He,s.spineObject.x,void 0,{number:!0}]])]),T("label",gB,[A[17]||(A[17]=T("span",null,"Y 位置",-1)),de(T("input",{"onUpdate:modelValue":A[2]||(A[2]=P=>s.spineObject.y=P),type:"number"},null,512),[[He,s.spineObject.y,void 0,{number:!0}]])]),T("label",vB,[A[18]||(A[18]=T("span",null,"旋转",-1)),de(T("input",{"onUpdate:modelValue":A[3]||(A[3]=P=>s.spineObject.rotation=P),type:"number"},null,512),[[He,s.spineObject.rotation,void 0,{number:!0}]])])]),T("div",yB,[T("label",xB,[A[19]||(A[19]=T("span",null,"Scale X",-1)),de(T("input",{"onUpdate:modelValue":A[4]||(A[4]=P=>s.spineObject.scaleX=P),type:"number",step:"0.05"},null,512),[[He,s.spineObject.scaleX,void 0,{number:!0}]])]),T("label",bB,[A[20]||(A[20]=T("span",null,"Scale Y",-1)),de(T("input",{"onUpdate:modelValue":A[5]||(A[5]=P=>s.spineObject.scaleY=P),type:"number",step:"0.05"},null,512),[[He,s.spineObject.scaleY,void 0,{number:!0}]])]),T("label",wB,[A[21]||(A[21]=T("span",null,"开始时间",-1)),de(T("input",{"onUpdate:modelValue":A[6]||(A[6]=P=>s.spineObject.timeOffset=P),type:"number",min:"0",step:"0.033333",onChange:O},null,544),[[He,s.spineObject.timeOffset,void 0,{number:!0}]])])]),A[31]||(A[31]=T("div",{class:"divider"},null,-1)),A[32]||(A[32]=T("div",{class:"section-title"},"Spine 资源",-1)),T("input",{ref_key:"skeletonInput",ref:i,hidden:"",type:"file",accept:".json,.skel,application/json,application/octet-stream",onChange:M},null,544),T("input",{ref_key:"atlasInput",ref:n,hidden:"",type:"file",accept:".atlas,text/plain",onChange:I},null,544),T("input",{ref_key:"textureInput",ref:r,hidden:"",type:"file",multiple:"",accept:".png,.jpg,.jpeg,.webp,.wepb,image/png,image/jpeg,image/webp",onChange:F},null,544),T("input",{ref_key:"folderInput",ref:o,hidden:"",type:"file",multiple:"",webkitdirectory:"",directory:"",onChange:k},null,544),T("button",{class:"folder-select",disabled:s.spineObject.status==="loading",onClick:A[7]||(A[7]=P=>{var L;return(L=o.value)==null?void 0:L.click()})},"选择文件夹并加载",8,SB),A[33]||(A[33]=T("div",{class:"folder-hint"},"一次读取文件夹中的 JSON / SKEL、Atlas 和全部纹理;仍可在下方单独替换资源。",-1)),T("div",_B,[T("div",{class:"asset-name",title:d.value},_e(d.value||"JSON / SKEL..."),9,TB),T("button",{onClick:A[8]||(A[8]=P=>{var L;return(L=i.value)==null?void 0:L.click()})},"选择")]),T("div",MB,[T("div",{class:"asset-name",title:f.value},_e(f.value||"Atlas..."),9,CB),T("button",{onClick:A[9]||(A[9]=P=>{var L;return(L=n.value)==null?void 0:L.click()})},"选择")]),T("div",AB,[T("div",{class:"asset-name",title:p.value.join(", ")},_e(m.value),9,EB),T("button",{onClick:A[10]||(A[10]=P=>{var L;return(L=r.value)==null?void 0:L.click()})},"选择(多选)")]),T("div",IB,[T("button",{class:"load",disabled:s.spineObject.status==="loading",onClick:$},_e(s.spineObject.status==="loading"?"加载中…":"↧ 加载"),9,RB),T("button",{class:"clear",onClick:N},"清除")]),T("div",PB,[A[22]||(A[22]=At(" 支持 Spine 3.8 / 4.0 / 4.1 / 4.2 / 4.3 JSON · 对应版本运行时按需加载 · 本地离线 ",-1)),s.spineObject.dataVersion?(K(),Q("span",kB," · 当前资源 "+_e(s.spineObject.dataVersion),1)):Te("",!0)]),s.spineObject.error?(K(),Q("div",FB,_e(s.spineObject.error),1)):Te("",!0),T("div",OB,[A[25]||(A[25]=T("div",{class:"section-title"},"Spine 动画",-1)),s.spineObject.animations.length?(K(),Q("label",LB,[A[24]||(A[24]=T("span",null,"时间轴播放动画",-1)),de(T("select",{"onUpdate:modelValue":A[11]||(A[11]=P=>s.spineObject.selectedAnimation=P),onChange:D},[A[23]||(A[23]=T("option",{value:""},"无",-1)),(K(!0),Q(Fe,null,Dt(s.spineObject.animations,P=>(K(),Q("option",{key:P.name,value:P.name},_e(P.name)+"("+_e(P.duration.toFixed(2))+"s) ",9,DB))),128))],544),[[wt,s.spineObject.selectedAnimation]])])):(K(),Q("div",BB,"无可用动画"))]),T("div",NB,[T("div",UB,[A[29]||(A[29]=T("div",{class:"section-title"},"层级树",-1)),T("button",{class:Le(["selected-bone",{active:s.spineObject.selectedBone}]),disabled:!s.spineObject.selectedBone,title:s.spineObject.selectedBone?"点击清除骨骼选择":"当前未选择骨骼",onClick:A[12]||(A[12]=P=>s.spineObject.selectedBone="")},[s.spineObject.selectedBone?(K(),Q(Fe,{key:0},[A[26]||(A[26]=At("清除选中骨骼:",-1)),T("strong",null,_e(s.spineObject.selectedBone),1)],64)):(K(),Q(Fe,{key:1},[A[27]||(A[27]=At("当前骨骼:",-1)),A[28]||(A[28]=T("strong",null,"未选择",-1))],64))],10,$B),s.spineObject.bones.length?(K(),Q("button",{key:0,class:"tree-action",onClick:S},_e(y.value?"全部展开":"全部折叠"),1)):Te("",!0)]),s.spineObject.bones.length?(K(),Q("div",VB,[de(T("input",{"onUpdate:modelValue":A[13]||(A[13]=P=>c.value=P),type:"search","aria-label":"搜索骨骼",placeholder:"搜索骨骼名称…"},null,512),[[He,c.value,void 0,{trim:!0}]]),c.value?(K(),Q("button",{key:0,title:"清空搜索","aria-label":"清空骨骼搜索",onClick:A[14]||(A[14]=P=>c.value="")},"✕")):Te("",!0)])):(K(),Q("div",XB,"未加载 Spine")),s.spineObject.bones.length&&!x.value.length?(K(),Q("div",YB,"未找到匹配的骨骼")):s.spineObject.bones.length?(K(),Q("div",GB,[(K(!0),Q(Fe,null,Dt(x.value,P=>(K(),Q("div",{key:P.name,class:Le(["bone",{selected:s.spineObject.selectedBone===P.name}]),style:di({paddingLeft:`${6+P.depth*16}px`}),role:"button",tabindex:"0",onClick:L=>_(P.name),onKeydown:zr(et(L=>_(P.name),["prevent"]),["enter"])},[g.value.has(P.name)?(K(),Q("button",{key:0,class:"bone-toggle",title:a.value.has(P.name)?"展开子骨骼":"折叠子骨骼",onClick:et(L=>C(P.name),["stop"])},_e(a.value.has(P.name)?"▸":"▾"),9,jB)):(K(),Q("span",WB,"•")),T("span",zB,_e(P.name),1)],46,HB))),128))])):Te("",!0)])]))}}),KB=Qt(qB,[["__scopeId","data-v-9257fb45"]]),ZB={class:"group"},JB={class:"caret"},QB={class:"scene-actions"},eL=["disabled"],tL={class:"group-body"},iL={class:"tree scene-tree"},sL=["onClick"],nL={class:"tlabel"},rL=["title","aria-label","onClick"],oL={viewBox:"0 0 24 24","aria-hidden":"true"},aL={key:0,class:"eye-slash",d:"M4 4l16 16"},lL=["onClick"],cL=["onClick"],hL={class:"tlabel"},uL=["title","aria-label","onClick"],dL={viewBox:"0 0 24 24","aria-hidden":"true"},fL={key:0,class:"eye-slash",d:"M4 4l16 16"},mL=["onClick"],pL=["onClick"],gL={class:"tlabel"},vL=["title","aria-label","onClick"],yL={viewBox:"0 0 24 24","aria-hidden":"true"},xL={key:0,class:"eye-slash",d:"M4 4l16 16"},bL=["onClick"],wL=["onClick"],SL={class:"tlabel"},_L=["title","aria-label","onClick"],TL={viewBox:"0 0 24 24","aria-hidden":"true"},ML={key:0,class:"eye-slash",d:"M4 4l16 16"},CL=["onClick"],AL={key:0,class:"empty"},EL={class:"row"},IL={class:"seed-row scene-seed"},RL={class:"field-block"},PL={class:"field-grid"},kL={class:"field-block"},FL={class:"field-block check-field"},OL={class:"field-grid"},BL={class:"compact-field"},LL={class:"compact-field"},DL={class:"field-grid"},NL={class:"compact-field"},UL={class:"compact-field"},$L={key:1,class:"field-grid"},XL={class:"compact-field"},VL={class:"compact-field"},YL={key:2,class:"field-grid"},GL={class:"compact-field"},HL={class:"compact-field"},jL={class:"field-block"},WL={key:4,class:"field-grid"},zL={class:"compact-field"},qL={class:"compact-field"},KL={class:"collider-follow-section"},ZL={class:"follow-path"},JL={class:"field-block"},QL=["value"],eD={class:"field-grid"},tD={class:"compact-field"},iD={class:"compact-field"},sD={class:"follow-path"},nD={class:"field-block"},rD={class:"field-grid"},oD={class:"compact-field"},aD={class:"compact-field"},lD={class:"field-grid"},cD={class:"compact-field"},hD={class:"compact-field"},uD={class:"setting-line"},dD={class:"setting-line"},fD={class:"field-block"},mD={key:4,class:"panel-hint"},pD=Jt({__name:"SceneObjectsSection",setup(s){const{store:e,resolvedCurveEditorMode:t,sys:i,activeObjectType:n,activeCollider:r,activePath:o,activeSpine:a,canCopyObject:c,collapsed:l,toggle:h,select:u,addSys:d,addCollider:f,addPath:p,addSpine:m,copySelectedObject:g,applyPathPreset:v,clearPathAnchors:x,randomizeSeed:y,LINEAR_CURVE:_}=br();return(C,S)=>(K(),Q("div",ZB,[T("div",{class:"group-head scene-head",onClick:S[5]||(S[5]=b=>R(h)("scene"))},[T("span",JB,_e(R(l).scene?"▸":"▾"),1),S[50]||(S[50]=T("span",null,"场景对象",-1)),T("div",QB,[T("button",{class:"scene-add",title:"添加粒子系统",onClick:S[0]||(S[0]=et((...b)=>R(d)&&R(d)(...b),["stop"]))},"+粒子"),T("button",{class:"scene-add",title:"添加碰撞体",onClick:S[1]||(S[1]=et((...b)=>R(f)&&R(f)(...b),["stop"]))},"+碰撞"),T("button",{class:"scene-add",title:"添加路径",onClick:S[2]||(S[2]=et((...b)=>R(p)&&R(p)(...b),["stop"]))},"+路径"),T("button",{class:"scene-add",title:"添加 Spine",onClick:S[3]||(S[3]=et((...b)=>R(m)&&R(m)(...b),["stop"]))},"+Spine"),T("button",{class:"scene-add",disabled:!R(c),title:"复制当前选中的场景对象",onClick:S[4]||(S[4]=et((...b)=>R(g)&&R(g)(...b),["stop"]))},"+Copy",8,eL)])]),de(T("div",tL,[T("div",iL,[(K(!0),Q(Fe,null,Dt(R(e).systems,(b,M)=>(K(),Q("div",{key:`particle-${b.id}`,class:Le(["tree-item scene-object-item",{on:R(n)==="particle"&&b.id===R(e).activeObjectId}]),onClick:I=>R(u)(M)},[S[53]||(S[53]=T("span",{class:"tdot"},"●",-1)),T("span",nL,_e(b.config.name||"ParticleSystem"+(M+1)),1),T("button",{class:Le(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示粒子系统":"隐藏粒子系统","aria-label":b.visible===!1?"显示粒子系统":"隐藏粒子系统",onClick:et(I=>b.visible=b.visible===!1,["stop"])},[(K(),Q("svg",oL,[S[51]||(S[51]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[52]||(S[52]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),Q("path",aL)):Te("",!0)]))],10,rL),S[54]||(S[54]=T("span",{class:"scene-object-kind"},"粒子",-1)),T("button",{class:"scene-object-delete",title:"删除粒子系统",onClick:et(I=>R(e).removeSystem(b.id),["stop"])},"✕",8,lL)],10,sL))),128)),(K(!0),Q(Fe,null,Dt(R(e).colliders,b=>(K(),Q("div",{key:`collision-${b.id}`,class:Le(["tree-item scene-object-item",{on:R(n)==="collision"&&b.id===R(e).activeObjectId}]),onClick:M=>R(e).selectSceneObject("collision",b.id)},[S[57]||(S[57]=T("span",{class:"tdot collision-dot"},"■",-1)),T("span",hL,_e(b.name),1),T("button",{class:Le(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示碰撞体":"隐藏碰撞体","aria-label":b.visible===!1?"显示碰撞体":"隐藏碰撞体",onClick:et(M=>b.visible=b.visible===!1,["stop"])},[(K(),Q("svg",dL,[S[55]||(S[55]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[56]||(S[56]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),Q("path",fL)):Te("",!0)]))],10,uL),S[58]||(S[58]=T("span",{class:"scene-object-kind"},"碰撞",-1)),T("button",{class:"scene-object-delete",title:"删除碰撞体",onClick:et(M=>R(e).removeCollider(b.id),["stop"])},"✕",8,mL)],10,cL))),128)),(K(!0),Q(Fe,null,Dt(R(e).paths,b=>(K(),Q("div",{key:`path-${b.id}`,class:Le(["tree-item scene-object-item",{on:R(n)==="path"&&b.id===R(e).activeObjectId}]),onClick:M=>R(e).selectSceneObject("path",b.id)},[S[61]||(S[61]=T("span",{class:"tdot path-dot"},"◇",-1)),T("span",gL,_e(b.name),1),T("button",{class:Le(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示路径":"隐藏路径","aria-label":b.visible===!1?"显示路径":"隐藏路径",onClick:et(M=>b.visible=b.visible===!1,["stop"])},[(K(),Q("svg",yL,[S[59]||(S[59]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[60]||(S[60]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),Q("path",xL)):Te("",!0)]))],10,vL),S[62]||(S[62]=T("span",{class:"scene-object-kind"},"路径",-1)),T("button",{class:"scene-object-delete",title:"删除路径",onClick:et(M=>R(e).removePath(b.id),["stop"])},"✕",8,bL)],10,pL))),128)),(K(!0),Q(Fe,null,Dt(R(e).spines,b=>(K(),Q("div",{key:`spine-${b.id}`,class:Le(["tree-item scene-object-item",{on:R(n)==="spine"&&b.id===R(e).activeObjectId}]),onClick:M=>R(e).selectSceneObject("spine",b.id)},[S[65]||(S[65]=T("span",{class:"tdot spine-dot"},"◆",-1)),T("span",SL,_e(b.name),1),T("button",{class:Le(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示 Spine":"隐藏 Spine","aria-label":b.visible===!1?"显示 Spine":"隐藏 Spine",onClick:et(M=>b.visible=b.visible===!1,["stop"])},[(K(),Q("svg",TL,[S[63]||(S[63]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[64]||(S[64]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),Q("path",ML)):Te("",!0)]))],10,_L),S[66]||(S[66]=T("span",{class:"scene-object-kind"},"Spine",-1)),T("button",{class:"scene-object-delete",title:"删除 Spine",onClick:et(M=>R(e).removeSpine(b.id),["stop"])},"✕",8,CL)],10,wL))),128)),!R(e).systems.length&&!R(e).colliders.length&&!R(e).paths.length&&!R(e).spines.length?(K(),Q("div",AL,"场景中暂无对象")):Te("",!0)]),R(n)==="particle"&&R(i)?(K(),Q(Fe,{key:0},[T("label",EL,[S[67]||(S[67]=T("span",null,"名称",-1)),de(T("input",{"onUpdate:modelValue":S[6]||(S[6]=b=>R(i).config.name=b),class:"inp"},null,512),[[He,R(i).config.name]])]),be(Be,{label:"位置X",min:-2e3,max:2e3,step:1,modelValue:R(i).config.centerX,"onUpdate:modelValue":S[7]||(S[7]=b=>R(i).config.centerX=b)},null,8,["modelValue"]),be(Be,{label:"位置Y",min:-2e3,max:2e3,step:1,modelValue:R(i).config.centerY,"onUpdate:modelValue":S[8]||(S[8]=b=>R(i).config.centerY=b)},null,8,["modelValue"]),be(Be,{label:"偏移X",min:-2e3,max:2e3,step:1,modelValue:R(i).config.offsetX,"onUpdate:modelValue":S[9]||(S[9]=b=>R(i).config.offsetX=b)},null,8,["modelValue"]),be(Be,{label:"偏移Y",min:-2e3,max:2e3,step:1,modelValue:R(i).config.offsetY,"onUpdate:modelValue":S[10]||(S[10]=b=>R(i).config.offsetY=b)},null,8,["modelValue"]),be(Be,{label:"旋转",min:-360,max:360,step:1,modelValue:R(i).config.rootRotation,"onUpdate:modelValue":S[11]||(S[11]=b=>R(i).config.rootRotation=b)},null,8,["modelValue"]),be(Be,{label:"缩放X",min:.05,max:10,step:.05,modelValue:R(i).config.rootScaleX,"onUpdate:modelValue":S[12]||(S[12]=b=>R(i).config.rootScaleX=b)},null,8,["modelValue"]),be(Be,{label:"缩放Y",min:.05,max:10,step:.05,modelValue:R(i).config.rootScaleY,"onUpdate:modelValue":S[13]||(S[13]=b=>R(i).config.rootScaleY=b)},null,8,["modelValue"]),T("div",IL,[S[68]||(S[68]=T("label",{for:"system-seed"},"随机种子",-1)),de(T("input",{id:"system-seed",class:"seed-input",type:"number",min:"0",step:"1","onUpdate:modelValue":S[14]||(S[14]=b=>R(i).config.seed=b),title:"控制粒子系统内全部随机属性、资源选择与修改器随机采样"},null,512),[[He,R(i).config.seed,void 0,{number:!0}]]),T("button",{class:"seed-random",title:"生成新的全局随机种子",onClick:S[15]||(S[15]=(...b)=>R(y)&&R(y)(...b))},"⚄")]),S[69]||(S[69]=T("div",{class:"seed-hint"},"控制初始随机参数、资源选择和修改器随机采样;相同种子可复现相同效果",-1))],64)):R(r)?(K(),Q(Fe,{key:1},[S[94]||(S[94]=T("div",{class:"object-editor-title"},"碰撞体属性",-1)),T("label",RL,[S[70]||(S[70]=T("span",null,"碰撞体名称",-1)),de(T("input",{"onUpdate:modelValue":S[16]||(S[16]=b=>R(r).name=b),class:"inp"},null,512),[[He,R(r).name]])]),T("div",PL,[T("label",kL,[S[72]||(S[72]=T("span",null,"类型",-1)),de(T("select",{"onUpdate:modelValue":S[17]||(S[17]=b=>R(r).shape=b),class:"inp"},[...S[71]||(S[71]=[es('',5)])],512),[[wt,R(r).shape]])]),T("label",FL,[S[73]||(S[73]=T("span",null,"启用",-1)),de(T("input",{"onUpdate:modelValue":S[18]||(S[18]=b=>R(r).enabled=b),type:"checkbox"},null,512),[[Et,R(r).enabled]])])]),T("div",OL,[T("label",BL,[S[74]||(S[74]=T("span",null,"X 位置",-1)),de(T("input",{"onUpdate:modelValue":S[19]||(S[19]=b=>R(r).x=b),type:"number",class:"inp"},null,512),[[He,R(r).x,void 0,{number:!0}]])]),T("label",LL,[S[75]||(S[75]=T("span",null,"Y 位置",-1)),de(T("input",{"onUpdate:modelValue":S[20]||(S[20]=b=>R(r).y=b),type:"number",class:"inp"},null,512),[[He,R(r).y,void 0,{number:!0}]])])]),be(Be,{label:"旋转",min:-360,max:360,step:1,modelValue:R(r).rotation,"onUpdate:modelValue":S[21]||(S[21]=b=>R(r).rotation=b)},null,8,["modelValue"]),T("div",DL,[T("label",NL,[S[76]||(S[76]=T("span",null,"缩放 X",-1)),de(T("input",{"onUpdate:modelValue":S[22]||(S[22]=b=>R(r).scaleX=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,R(r).scaleX,void 0,{number:!0}]])]),T("label",UL,[S[77]||(S[77]=T("span",null,"缩放 Y",-1)),de(T("input",{"onUpdate:modelValue":S[23]||(S[23]=b=>R(r).scaleY=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,R(r).scaleY,void 0,{number:!0}]])])]),R(r).shape==="circle"?(K(),Mt(Be,{key:0,label:"半径",min:1,max:1e3,step:1,modelValue:R(r).radius,"onUpdate:modelValue":S[24]||(S[24]=b=>R(r).radius=b)},null,8,["modelValue"])):R(r).shape==="ellipse"?(K(),Q("div",$L,[T("label",XL,[S[78]||(S[78]=T("span",null,"X 半径",-1)),de(T("input",{"onUpdate:modelValue":S[25]||(S[25]=b=>R(r).radiusX=b),type:"number",min:"1",class:"inp"},null,512),[[He,R(r).radiusX,void 0,{number:!0}]])]),T("label",VL,[S[79]||(S[79]=T("span",null,"Y 半径",-1)),de(T("input",{"onUpdate:modelValue":S[26]||(S[26]=b=>R(r).radiusY=b),type:"number",min:"1",class:"inp"},null,512),[[He,R(r).radiusY,void 0,{number:!0}]])])])):(K(),Q("div",YL,[T("label",GL,[S[80]||(S[80]=T("span",null,"宽度",-1)),de(T("input",{"onUpdate:modelValue":S[27]||(S[27]=b=>R(r).width=b),type:"number",min:"1",class:"inp"},null,512),[[He,R(r).width,void 0,{number:!0}]])]),T("label",HL,[S[81]||(S[81]=T("span",null,"高度",-1)),de(T("input",{"onUpdate:modelValue":S[28]||(S[28]=b=>R(r).height=b),type:"number",min:"1",class:"inp"},null,512),[[He,R(r).height,void 0,{number:!0}]])])])),R(r).shape==="polygon"||R(r).shape==="custom"?(K(),Mt(Be,{key:3,label:"边数",min:3,max:16,step:1,modelValue:R(r).sides,"onUpdate:modelValue":S[29]||(S[29]=b=>R(r).sides=b)},null,8,["modelValue"])):Te("",!0),T("label",jL,[S[83]||(S[83]=T("span",null,"碰撞响应",-1)),de(T("select",{"onUpdate:modelValue":S[30]||(S[30]=b=>R(r).response=b),class:"inp"},[...S[82]||(S[82]=[T("option",{value:"physics"},"物理(弹跳/摩擦)",-1),T("option",{value:"pause"},"暂停(停止不动)",-1),T("option",{value:"destroy"},"消失(立即销毁)",-1)])],512),[[wt,R(r).response]])]),R(r).response==="physics"?(K(),Q("div",WL,[T("label",zL,[S[84]||(S[84]=T("span",null,"弹性 (0-1)",-1)),de(T("input",{"onUpdate:modelValue":S[31]||(S[31]=b=>R(r).elasticity=b),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[He,R(r).elasticity,void 0,{number:!0}]])]),T("label",qL,[S[85]||(S[85]=T("span",null,"摩擦 (0-1)",-1)),de(T("input",{"onUpdate:modelValue":S[32]||(S[32]=b=>R(r).friction=b),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[He,R(r).friction,void 0,{number:!0}]])])])):Te("",!0),T("div",KL,[T("label",ZL,[de(T("input",{"onUpdate:modelValue":S[33]||(S[33]=b=>R(r).followPath=b),type:"checkbox"},null,512),[[Et,R(r).followPath]]),S[86]||(S[86]=At("跟随路径移动",-1))]),R(r).followPath?(K(),Q(Fe,{key:0},[T("label",JL,[S[88]||(S[88]=T("span",null,"目标路径",-1)),de(T("select",{"onUpdate:modelValue":S[34]||(S[34]=b=>R(r).followPathId=b),class:"inp"},[S[87]||(S[87]=T("option",{value:0},"(未选择)",-1)),(K(!0),Q(Fe,null,Dt(R(e).paths,b=>(K(),Q("option",{key:b.id,value:b.id},_e(b.name),9,QL))),128))],512),[[wt,R(r).followPathId,void 0,{number:!0}]])]),T("div",eD,[T("label",tD,[S[89]||(S[89]=T("span",null,"移动时长(秒)",-1)),de(T("input",{"onUpdate:modelValue":S[35]||(S[35]=b=>R(r).followDuration=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,R(r).followDuration,void 0,{number:!0}]])]),T("label",iD,[S[91]||(S[91]=T("span",null,"曲线模式",-1)),de(T("select",{"onUpdate:modelValue":S[36]||(S[36]=b=>R(r).followCurveMode=b),class:"inp"},[...S[90]||(S[90]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],512),[[wt,R(r).followCurveMode]])])]),T("label",sD,[de(T("input",{"onUpdate:modelValue":S[37]||(S[37]=b=>R(r).followPathRotation=b),type:"checkbox"},null,512),[[Et,R(r).followPathRotation]]),S[92]||(S[92]=At("方向沿路径",-1))]),S[93]||(S[93]=T("div",{class:"collider-curve-title"},[At("移动进度曲线 "),T("small",null,"横轴:实时/移动时长 纵轴:路径进度(0=起点 → 1=终点)")],-1)),be(qs,{"model-value":R(r).followCurve||R(_),"default-value":R(_),mode:R(t)(R(r).followCurveMode),"onUpdate:modelValue":S[38]||(S[38]=b=>R(r).followCurve=b)},null,8,["model-value","default-value","mode"])],64)):Te("",!0)])],64)):R(o)?(K(),Q(Fe,{key:2},[S[104]||(S[104]=T("div",{class:"object-editor-title"},"路径属性",-1)),T("label",nD,[S[95]||(S[95]=T("span",null,"路径名称",-1)),de(T("input",{"onUpdate:modelValue":S[39]||(S[39]=b=>R(o).name=b),class:"inp"},null,512),[[He,R(o).name]])]),T("div",rD,[T("label",oD,[S[96]||(S[96]=T("span",null,"X 位置",-1)),de(T("input",{"onUpdate:modelValue":S[40]||(S[40]=b=>R(o).x=b),type:"number",class:"inp"},null,512),[[He,R(o).x,void 0,{number:!0}]])]),T("label",aD,[S[97]||(S[97]=T("span",null,"Y 位置",-1)),de(T("input",{"onUpdate:modelValue":S[41]||(S[41]=b=>R(o).y=b),type:"number",class:"inp"},null,512),[[He,R(o).y,void 0,{number:!0}]])])]),be(Be,{label:"旋转",min:-360,max:360,step:1,modelValue:R(o).rotation,"onUpdate:modelValue":S[42]||(S[42]=b=>R(o).rotation=b)},null,8,["modelValue"]),T("div",lD,[T("label",cD,[S[98]||(S[98]=T("span",null,"缩放 X",-1)),de(T("input",{"onUpdate:modelValue":S[43]||(S[43]=b=>R(o).scaleX=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,R(o).scaleX,void 0,{number:!0}]])]),T("label",hD,[S[99]||(S[99]=T("span",null,"缩放 Y",-1)),de(T("input",{"onUpdate:modelValue":S[44]||(S[44]=b=>R(o).scaleY=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,R(o).scaleY,void 0,{number:!0}]])])]),T("label",uD,[S[100]||(S[100]=T("span",null,"闭合路径",-1)),de(T("input",{"onUpdate:modelValue":S[45]||(S[45]=b=>R(o).closed=b),type:"checkbox"},null,512),[[Et,R(o).closed]])]),T("label",dD,[S[101]||(S[101]=T("span",null,"路径颜色",-1)),de(T("input",{"onUpdate:modelValue":S[46]||(S[46]=b=>R(o).color=b),type:"color",class:"path-color"},null,512),[[He,R(o).color]])]),S[105]||(S[105]=es('
操作说明:
  • 双击空白处/曲线:新建锚点
  • 双击锚点:删除节点
  • 双击第二下按住拖动:新建并拉出手柄
  • 拖动锚点移动位置,拖动手柄调整曲线
  • Shift+拖动手柄:两侧完全对称
  • Alt+拖动手柄:独立控制单侧
  • Ctrl+点击/框选:加选节点
  • Alt+点击/框选:减选节点
  • Alt+单击空白处:清除全部选中
  • 选中多个节点后可整体拖动
',1)),T("label",fD,[S[103]||(S[103]=T("span",null,"应用预设形状",-1)),de(T("select",{"onUpdate:modelValue":S[47]||(S[47]=b=>R(o).preset=b),class:"inp"},[...S[102]||(S[102]=[es('',5)])],512),[[wt,R(o).preset]])]),T("button",{class:"path-action primary",onClick:S[48]||(S[48]=(...b)=>R(v)&&R(v)(...b))},"应用预设"),T("button",{class:"path-action",onClick:S[49]||(S[49]=(...b)=>R(x)&&R(x)(...b))},"清空锚点")],64)):R(a)?(K(),Mt(KB,{key:3,"spine-object":R(a)},null,8,["spine-object"])):(K(),Q("div",mD,"使用右上角按钮创建场景对象"))],512),[[vi,!R(l).scene]])]))}}),gD=Qt(pD,[["__scopeId","data-v-3873124f"]]),vD={class:"group"},yD={class:"caret"},xD={class:"group-body"},bD={class:"segs"},wD={class:"segs stream-behavior-segs"},SD={key:2,class:"stream-loop-options"},_D={class:"loop-section-row"},TD={class:"switch-row"},MD=["checked"],CD={key:0,class:"loop-duration-control"},AD={class:"switch-row loop-duration-toggle"},ED=["checked"],ID={class:"loop-section-duration"},RD=["value"],PD={key:1},kD={key:2,class:"loop-auto-duration"},FD={class:"loop-section-row"},OD={class:"switch-row"},BD=["checked"],LD={key:0,class:"loop-duration-control"},DD={class:"switch-row loop-duration-toggle"},ND=["checked"],UD={class:"loop-section-duration"},$D=["value"],XD={key:1},VD={key:2,class:"loop-auto-duration"},YD={key:3,class:"modifier-hint stream-loop-hint"},GD={class:"group"},HD={class:"caret"},jD={class:"group-body"},WD={class:"row"},zD={class:"row"},qD=["value","disabled"],KD={key:0,class:"row"},ZD={class:"row"},JD={key:0,value:"radial"},QD={key:1,value:"path-normal"},eN={key:2,value:"path-tangent"},tN=Jt({__name:"EmissionSection",setup(s){const{store:e,sys:t,automaticLoopDuration:i,loopDurationFrames:n,collapsed:r,toggle:o,setEmitMode:a,setLoopDurationFrames:c,setStreamBehavior:l,setLoopSection:h,setLoopSectionDuration:u,setLoopCustomDuration:d,resetModule:f,select:p,onShapeChange:m,onSpawnPathChange:g}=br();return(v,x)=>(K(),Q(Fe,null,[T("div",vD,[T("div",{class:"group-head",onClick:x[1]||(x[1]=y=>R(o)("emitMode"))},[T("span",yD,_e(R(r).emitMode?"▸":"▾"),1),x[35]||(x[35]=T("span",null,"发射模式",-1)),T("button",{class:"group-reset",title:"重置发射模式参数",onClick:x[0]||(x[0]=et(y=>R(f)("emitMode"),["stop"]))},"重置")]),de(T("div",xD,[T("div",bD,[T("button",{class:Le(["seg",{on:R(t).config.mode==="stream"}]),onClick:x[2]||(x[2]=y=>R(a)("stream"))},"持续",2),T("button",{class:Le(["seg",{on:R(t).config.mode==="burst"}]),onClick:x[3]||(x[3]=y=>R(a)("burst"))},"爆发",2)]),R(t).config.mode==="stream"?(K(),Q(Fe,{key:0},[T("div",wD,[T("button",{class:Le(["seg",{on:R(t).config.streamBehavior==="normal"}]),onClick:x[4]||(x[4]=y=>R(l)("normal"))},"常规持续",2),T("button",{class:Le(["seg",{on:R(t).config.streamBehavior==="loop"}]),onClick:x[5]||(x[5]=y=>R(l)("loop"))},"循环持续",2)]),be(Be,{label:"发射速率",min:1,max:300,step:1,modelValue:R(t).config.rate,"onUpdate:modelValue":x[6]||(x[6]=y=>R(t).config.rate=y)},null,8,["modelValue"]),R(t).config.streamBehavior==="normal"?(K(),Mt(Be,{key:0,label:"发射时长",min:1/30,max:60,step:1/30,modelValue:R(t).config.duration,"onUpdate:modelValue":x[7]||(x[7]=y=>R(t).config.duration=y)},null,8,["modelValue"])):(K(),Mt(Be,{key:1,label:"发射时长 (f)",min:1,max:1800,step:1,"model-value":R(n),"onUpdate:modelValue":R(c)},null,8,["model-value","onUpdate:modelValue"])),R(t).config.streamBehavior==="loop"?(K(),Q("div",SD,[T("div",_D,[T("label",TD,[T("input",{type:"checkbox",checked:R(t).config.generateLoopStartAnimation,onChange:x[8]||(x[8]=y=>R(h)("start",y))},null,40,MD),x[36]||(x[36]=T("span",{class:"switch-ui"},null,-1)),x[37]||(x[37]=T("span",null,"生成开始循环动画",-1))]),R(t).config.generateLoopStartAnimation?(K(),Q("div",CD,[T("label",AD,[T("input",{type:"checkbox",checked:R(t).config.loopStartUseCustomDuration,onChange:x[9]||(x[9]=y=>R(d)("start",y))},null,40,ED),x[38]||(x[38]=T("span",{class:"switch-ui"},null,-1)),x[39]||(x[39]=T("span",null,"指定时长",-1))]),T("label",ID,[R(t).config.loopStartUseCustomDuration?(K(),Q("input",{key:0,value:R(t).config.loopStartDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"开始循环段时长",onChange:x[10]||(x[10]=y=>R(u)("start",y))},null,40,RD)):Te("",!0),R(t).config.loopStartUseCustomDuration?(K(),Q("span",PD,"f")):(K(),Q("span",kD,"自动 "+_e(R(i))+"f",1))])])):Te("",!0)]),T("div",FD,[T("label",OD,[T("input",{type:"checkbox",checked:R(t).config.generateLoopEndAnimation,onChange:x[11]||(x[11]=y=>R(h)("end",y))},null,40,BD),x[40]||(x[40]=T("span",{class:"switch-ui"},null,-1)),x[41]||(x[41]=T("span",null,"生成结束循环动画",-1))]),R(t).config.generateLoopEndAnimation?(K(),Q("div",LD,[T("label",DD,[T("input",{type:"checkbox",checked:R(t).config.loopEndUseCustomDuration,onChange:x[12]||(x[12]=y=>R(d)("end",y))},null,40,ND),x[42]||(x[42]=T("span",{class:"switch-ui"},null,-1)),x[43]||(x[43]=T("span",null,"指定时长",-1))]),T("label",UD,[R(t).config.loopEndUseCustomDuration?(K(),Q("input",{key:0,value:R(t).config.loopEndDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"结束循环段时长",onChange:x[13]||(x[13]=y=>R(u)("end",y))},null,40,$D)):Te("",!0),R(t).config.loopEndUseCustomDuration?(K(),Q("span",XD,"f")):(K(),Q("span",VD,"自动 "+_e(R(i))+"f",1))])])):Te("",!0)])])):Te("",!0),R(t).config.streamBehavior==="loop"?(K(),Q("div",YD,"循环持续模式不支持骨骼跟随和路径跟随;进入或退出时会将粒子跟随设置恢复默认值。")):Te("",!0)],64)):(K(),Mt(Be,{key:1,label:"单次数量",min:1,max:1e3,step:1,modelValue:R(t).config.burstCount,"onUpdate:modelValue":x[14]||(x[14]=y=>R(t).config.burstCount=y)},null,8,["modelValue"])),be(Be,{label:"延迟时间",min:0,max:5,step:.1,modelValue:R(t).config.delay,"onUpdate:modelValue":x[15]||(x[15]=y=>R(t).config.delay=y)},null,8,["modelValue"])],512),[[vi,!R(r).emitMode]])]),T("div",GD,[T("div",{class:"group-head",onClick:x[17]||(x[17]=y=>R(o)("shape"))},[T("span",HD,_e(R(r).shape?"▸":"▾"),1),x[44]||(x[44]=T("span",null,"发射器形状",-1)),T("button",{class:"group-reset",title:"重置发射器形状参数",onClick:x[16]||(x[16]=et(y=>R(f)("shape"),["stop"]))},"重置")]),de(T("div",jD,[T("label",WD,[x[46]||(x[46]=T("span",null,"形状",-1)),de(T("select",{"onUpdate:modelValue":x[18]||(x[18]=y=>R(t).config.shape=y),class:"inp",onChange:x[19]||(x[19]=(...y)=>R(m)&&R(m)(...y))},[...x[45]||(x[45]=[es('',5)])],544),[[wt,R(t).config.shape]])]),R(t).config.shape==="circle"||R(t).config.shape==="cone"?(K(),Q(Fe,{key:0},[be(Be,{label:R(t).config.shape==="cone"?"内径":"内半径",min:0,max:R(t).config.outerRadius,step:1,modelValue:R(t).config.innerRadius,"onUpdate:modelValue":x[20]||(x[20]=y=>R(t).config.innerRadius=y)},null,8,["label","max","modelValue"]),be(Be,{label:R(t).config.shape==="cone"?"外径":"外半径",min:R(t).config.innerRadius,max:300,step:1,modelValue:R(t).config.outerRadius,"onUpdate:modelValue":x[21]||(x[21]=y=>R(t).config.outerRadius=y)},null,8,["label","min","modelValue"])],64)):Te("",!0),R(t).config.shape==="cone"?(K(),Q(Fe,{key:1},[be(Be,{label:"锥形朝向",min:-360,max:360,step:1,modelValue:R(t).config.coneDirection,"onUpdate:modelValue":x[22]||(x[22]=y=>R(t).config.coneDirection=y)},null,8,["modelValue"]),be(Be,{label:"锥形开口角度",min:1,max:360,step:1,modelValue:R(t).config.coneAngle,"onUpdate:modelValue":x[23]||(x[23]=y=>R(t).config.coneAngle=y)},null,8,["modelValue"])],64)):R(t).config.shape==="rect"?(K(),Q(Fe,{key:2},[be(Be,{label:"内宽",min:0,max:R(t).config.outerRectW,step:1,modelValue:R(t).config.innerRectW,"onUpdate:modelValue":x[24]||(x[24]=y=>R(t).config.innerRectW=y)},null,8,["max","modelValue"]),be(Be,{label:"内高",min:0,max:R(t).config.outerRectH,step:1,modelValue:R(t).config.innerRectH,"onUpdate:modelValue":x[25]||(x[25]=y=>R(t).config.innerRectH=y)},null,8,["max","modelValue"]),be(Be,{label:"外宽",min:R(t).config.innerRectW,max:400,step:1,modelValue:R(t).config.outerRectW,"onUpdate:modelValue":x[26]||(x[26]=y=>R(t).config.outerRectW=y)},null,8,["min","modelValue"]),be(Be,{label:"外高",min:R(t).config.innerRectH,max:400,step:1,modelValue:R(t).config.outerRectH,"onUpdate:modelValue":x[27]||(x[27]=y=>R(t).config.outerRectH=y)},null,8,["min","modelValue"])],64)):R(t).config.shape==="path"?(K(),Q(Fe,{key:3},[T("label",zD,[x[48]||(x[48]=T("span",null,"选择路径",-1)),de(T("select",{"onUpdate:modelValue":x[28]||(x[28]=y=>R(t).config.spawnPathId=y),class:"inp",onChange:x[29]||(x[29]=(...y)=>R(g)&&R(g)(...y))},[x[47]||(x[47]=T("option",{value:0},"无路径(点发射)",-1)),(K(!0),Q(Fe,null,Dt(R(e).paths,y=>(K(),Q("option",{key:y.id,value:y.id,disabled:!y.enabled},_e(y.name),9,qD))),128))],544),[[wt,R(t).config.spawnPathId,void 0,{number:!0}]])]),R(t).config.spawnPathId>0?(K(),Q("label",KD,[x[50]||(x[50]=T("span",null,"出生分布",-1)),de(T("select",{"onUpdate:modelValue":x[30]||(x[30]=y=>R(t).config.spawnPathDistribution=y),class:"inp"},[...x[49]||(x[49]=[T("option",{value:"fixed"},"等间距固定分布",-1),T("option",{value:"random"},"随机分布",-1)])],512),[[wt,R(t).config.spawnPathDistribution]])])):Te("",!0)],64)):Te("",!0),x[54]||(x[54]=T("div",{class:"divider"},null,-1)),T("label",ZD,[x[53]||(x[53]=T("span",null,"发射角度",-1)),de(T("select",{"onUpdate:modelValue":x[31]||(x[31]=y=>R(t).config.emissionAngleMode=y),class:"inp"},[x[51]||(x[51]=T("option",{value:"fixed"},"固定",-1)),x[52]||(x[52]=T("option",{value:"random"},"随机",-1)),R(t).config.shape==="circle"||R(t).config.shape==="rect"||R(t).config.shape==="cone"?(K(),Q("option",JD,"径向(中心向外)")):Te("",!0),R(t).config.shape==="path"&&R(t).config.spawnPathId>0?(K(),Q("option",QD,"垂直于路径")):Te("",!0),R(t).config.shape==="path"&&R(t).config.spawnPathId>0?(K(),Q("option",eN,"沿路径方向")):Te("",!0)],512),[[wt,R(t).config.emissionAngleMode]])]),R(t).config.emissionAngleMode==="fixed"?(K(),Mt(Be,{key:4,label:"固定角度",min:-360,max:360,step:1,modelValue:R(t).config.direction,"onUpdate:modelValue":x[32]||(x[32]=y=>R(t).config.direction=y)},null,8,["modelValue"])):R(t).config.emissionAngleMode==="random"?(K(),Q(Fe,{key:5},[be(Be,{label:"基准角度",min:-360,max:360,step:1,modelValue:R(t).config.direction,"onUpdate:modelValue":x[33]||(x[33]=y=>R(t).config.direction=y)},null,8,["modelValue"]),be(Be,{label:"随机范围",min:0,max:360,step:1,modelValue:R(t).config.spread,"onUpdate:modelValue":x[34]||(x[34]=y=>R(t).config.spread=y)},null,8,["modelValue"])],64)):Te("",!0)],512),[[vi,!R(r).shape]])])],64))}}),iN=Qt(tN,[["__scopeId","data-v-59bf8cf4"]]),sN={class:"pac"},nN={class:"pac-head"},rN={class:"pac-label"},oN={key:0,class:"pac-modes"},aN=["onClick"],lN={class:"pac-range"},cN={class:"pac-curve"},hN={class:"pac-axis"},uN=Jt({__name:"ParticleAttributeControl",props:{label:{},mode:{},valueMin:{},valueMax:{},curve:{},defaultCurve:{default:()=>[{x:0,y:0},{x:1,y:1}]},min:{},max:{},step:{default:1},allowDirection:{type:Boolean,default:!1},allowCurve:{type:Boolean,default:!0},showModes:{type:Boolean,default:!0},curveLabel:{default:"曲线输入 →"}},emits:["update:mode","update:valueMin","update:valueMax","update:curve"],setup(s){const e=s,t=qe(()=>{const i=[{label:"固定",value:"fixed"},{label:"随机",value:"random"}];return e.allowCurve&&i.push({label:"曲线",value:"curve"}),e.allowDirection&&i.push({label:"发射方向",value:"direction"}),i});return(i,n)=>(K(),Q("div",sN,[T("div",nN,[T("span",rN,_e(s.label),1),s.showModes?(K(),Q("div",oN,[(K(!0),Q(Fe,null,Dt(t.value,r=>(K(),Q("button",{key:r.value,class:Le(["pac-mode",{on:s.mode===r.value}]),onClick:o=>i.$emit("update:mode",r.value)},_e(r.label),11,aN))),128))])):Te("",!0)]),s.mode==="fixed"||s.mode==="direction"?(K(),Mt(Be,{key:0,label:s.mode==="direction"?"角度偏移":"数值",min:s.min,max:s.max,step:s.step,"model-value":s.valueMin,"onUpdate:modelValue":n[0]||(n[0]=r=>i.$emit("update:valueMin",r))},null,8,["label","min","max","step","model-value"])):s.mode==="random"?(K(),Q(Fe,{key:1},[be(Be,{label:"下限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMin,"onUpdate:modelValue":n[1]||(n[1]=r=>i.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),be(Be,{label:"上限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMax,"onUpdate:modelValue":n[2]||(n[2]=r=>i.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])],64)):(K(),Q(Fe,{key:2},[T("div",lN,[be(Be,{label:"范围下限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMin,"onUpdate:modelValue":n[3]||(n[3]=r=>i.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),be(Be,{label:"范围上限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMax,"onUpdate:modelValue":n[4]||(n[4]=r=>i.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])]),T("div",cN,[be(qs,{"model-value":s.curve,"default-value":s.defaultCurve,"onUpdate:modelValue":n[5]||(n[5]=r=>i.$emit("update:curve",r))},null,8,["model-value","default-value"]),T("div",hN,[n[6]||(n[6]=T("span",null,"0",-1)),T("span",null,_e(s.curveLabel),1),n[7]||(n[7]=T("span",null,"1",-1))])])],64))]))}}),mn=Qt(uN,[["__scopeId","data-v-238f838c"]]),dN={class:"group"},fN={class:"caret"},mN={class:"group-body attr-body"},pN={class:"attr-axis-head"},gN={class:"axis-modes"},vN={class:"life-item"},yN={class:"switch-row"},xN={class:"life-item"},bN={class:"switch-row"},wN={class:"axis-modes life-axis"},SN={class:"life-item"},_N={class:"switch-row"},TN=Jt({__name:"ParticleAttributesSection",setup(s){const{sys:e,collapsed:t,toggle:i,resetModule:n,setSpeedOverLifeMode:r,prepareScaleOverLifeCurve:o,setScaleOverLifeMode:a,LINEAR_CURVE:c,FLAT_CURVE:l}=br();return(h,u)=>(K(),Q("div",dN,[T("div",{class:"group-head",onClick:u[1]||(u[1]=d=>R(i)("attr"))},[T("span",fN,_e(R(t).attr?"▸":"▾"),1),u[44]||(u[44]=T("span",null,"粒子属性",-1)),T("button",{class:"group-reset",title:"重置粒子属性参数",onClick:u[0]||(u[0]=et(d=>R(n)("attr"),["stop"]))},"重置")]),de(T("div",mN,[u[52]||(u[52]=T("div",{class:"attr-section-title"},"粒子初始参数",-1)),be(mn,{label:"初始生命周期","allow-curve":!1,mode:R(e).config.lifeMode,"onUpdate:mode":u[2]||(u[2]=d=>R(e).config.lifeMode=d),"value-min":R(e).config.lifeMin,"onUpdate:valueMin":u[3]||(u[3]=d=>R(e).config.lifeMin=d),"value-max":R(e).config.lifeMax,"onUpdate:valueMax":u[4]||(u[4]=d=>R(e).config.lifeMax=d),curve:R(e).config.lifeCurve,"onUpdate:curve":u[5]||(u[5]=d=>R(e).config.lifeCurve=d),min:.1,max:10,step:.1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),be(mn,{label:"初始速度","allow-curve":!1,mode:R(e).config.speedMode,"onUpdate:mode":u[6]||(u[6]=d=>R(e).config.speedMode=d),"value-min":R(e).config.speedMin,"onUpdate:valueMin":u[7]||(u[7]=d=>R(e).config.speedMin=d),"value-max":R(e).config.speedMax,"onUpdate:valueMax":u[8]||(u[8]=d=>R(e).config.speedMax=d),curve:R(e).config.speedCurve,"onUpdate:curve":u[9]||(u[9]=d=>R(e).config.speedCurve=d),min:0,max:1e3,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),T("div",pN,[u[45]||(u[45]=T("span",null,"初始缩放",-1)),T("div",gN,[T("button",{class:Le(["axis-mode",{on:R(e).config.scaleAxisMode==="uniform"}]),onClick:u[10]||(u[10]=d=>R(e).config.scaleAxisMode="uniform")},"统一",2),T("button",{class:Le(["axis-mode",{on:R(e).config.scaleAxisMode==="separate"}]),onClick:u[11]||(u[11]=d=>R(e).config.scaleAxisMode="separate")},"XY分离",2)])]),be(mn,{label:R(e).config.scaleAxisMode==="uniform"?"初始缩放":"缩放 X","allow-curve":!1,mode:R(e).config.scaleMode,"onUpdate:mode":u[12]||(u[12]=d=>R(e).config.scaleMode=d),"value-min":R(e).config.scaleMin,"onUpdate:valueMin":u[13]||(u[13]=d=>R(e).config.scaleMin=d),"value-max":R(e).config.scaleMax,"onUpdate:valueMax":u[14]||(u[14]=d=>R(e).config.scaleMax=d),curve:R(e).config.scaleCurve,"onUpdate:curve":u[15]||(u[15]=d=>R(e).config.scaleCurve=d),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["label","mode","value-min","value-max","curve"]),R(e).config.scaleAxisMode==="separate"?(K(),Mt(mn,{key:0,label:"缩放 Y","show-modes":!1,"allow-curve":!1,mode:R(e).config.scaleMode,"onUpdate:mode":u[16]||(u[16]=d=>R(e).config.scaleMode=d),"value-min":R(e).config.scaleYMin,"onUpdate:valueMin":u[17]||(u[17]=d=>R(e).config.scaleYMin=d),"value-max":R(e).config.scaleYMax,"onUpdate:valueMax":u[18]||(u[18]=d=>R(e).config.scaleYMax=d),curve:R(e).config.scaleYCurve,"onUpdate:curve":u[19]||(u[19]=d=>R(e).config.scaleYCurve=d),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"])):Te("",!0),be(mn,{label:"初始旋转","allow-direction":"","allow-curve":!1,mode:R(e).config.initialRotationMode,"onUpdate:mode":u[20]||(u[20]=d=>R(e).config.initialRotationMode=d),"value-min":R(e).config.initialRotationMin,"onUpdate:valueMin":u[21]||(u[21]=d=>R(e).config.initialRotationMin=d),"value-max":R(e).config.initialRotationMax,"onUpdate:valueMax":u[22]||(u[22]=d=>R(e).config.initialRotationMax=d),curve:R(e).config.initialRotationCurve,"onUpdate:curve":u[23]||(u[23]=d=>R(e).config.initialRotationCurve=d),min:-360,max:360,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),u[53]||(u[53]=T("div",{class:"attr-section-title life-title"},"粒子生命周期变化参数",-1)),T("div",vN,[T("label",yN,[de(T("input",{type:"checkbox","onUpdate:modelValue":u[24]||(u[24]=d=>R(e).config.speedOverLifeEnabled=d)},null,512),[[Et,R(e).config.speedOverLifeEnabled]]),u[46]||(u[46]=T("span",{class:"switch-ui"},null,-1)),u[47]||(u[47]=T("span",null,"生命周期内速度",-1))]),R(e).config.speedOverLifeEnabled?(K(),Mt(mn,{key:0,label:"速度倍率",mode:R(e).config.speedOverLifeMode,"onUpdate:mode":R(r),"value-min":R(e).config.speedOverLifeMin,"onUpdate:valueMin":u[25]||(u[25]=d=>R(e).config.speedOverLifeMin=d),"value-max":R(e).config.speedOverLifeMax,"onUpdate:valueMax":u[26]||(u[26]=d=>R(e).config.speedOverLifeMax=d),curve:R(e).config.speedOverLifeCurve,"onUpdate:curve":u[27]||(u[27]=d=>R(e).config.speedOverLifeCurve=d),"default-curve":R(l),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","onUpdate:mode","value-min","value-max","curve","default-curve"])):Te("",!0)]),T("div",xN,[T("label",bN,[de(T("input",{type:"checkbox","onUpdate:modelValue":u[28]||(u[28]=d=>R(e).config.scaleOverLifeEnabled=d),onChange:u[29]||(u[29]=(...d)=>R(o)&&R(o)(...d))},null,544),[[Et,R(e).config.scaleOverLifeEnabled]]),u[48]||(u[48]=T("span",{class:"switch-ui"},null,-1)),u[49]||(u[49]=T("span",null,"生命周期内缩放",-1))]),R(e).config.scaleOverLifeEnabled?(K(),Q(Fe,{key:0},[T("div",wN,[T("button",{class:Le(["axis-mode",{on:R(e).config.scaleOverLifeAxisMode==="uniform"}]),onClick:u[30]||(u[30]=d=>R(e).config.scaleOverLifeAxisMode="uniform")},"统一",2),T("button",{class:Le(["axis-mode",{on:R(e).config.scaleOverLifeAxisMode==="separate"}]),onClick:u[31]||(u[31]=d=>R(e).config.scaleOverLifeAxisMode="separate")},"XY分离",2)]),be(mn,{label:R(e).config.scaleOverLifeAxisMode==="uniform"?"缩放倍率":"倍率 X",mode:R(e).config.scaleOverLifeMode,"onUpdate:mode":R(a),"value-min":R(e).config.scaleOverLifeMin,"onUpdate:valueMin":u[32]||(u[32]=d=>R(e).config.scaleOverLifeMin=d),"value-max":R(e).config.scaleOverLifeMax,"onUpdate:valueMax":u[33]||(u[33]=d=>R(e).config.scaleOverLifeMax=d),curve:R(e).config.scaleOverLifeCurve,"onUpdate:curve":u[34]||(u[34]=d=>R(e).config.scaleOverLifeCurve=d),"default-curve":R(l),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["label","mode","onUpdate:mode","value-min","value-max","curve","default-curve"]),R(e).config.scaleOverLifeAxisMode==="separate"?(K(),Mt(mn,{key:0,label:"倍率 Y","show-modes":!1,mode:R(e).config.scaleOverLifeMode,"onUpdate:mode":u[35]||(u[35]=d=>R(e).config.scaleOverLifeMode=d),"value-min":R(e).config.scaleYOverLifeMin,"onUpdate:valueMin":u[36]||(u[36]=d=>R(e).config.scaleYOverLifeMin=d),"value-max":R(e).config.scaleYOverLifeMax,"onUpdate:valueMax":u[37]||(u[37]=d=>R(e).config.scaleYOverLifeMax=d),curve:R(e).config.scaleYOverLifeCurve,"onUpdate:curve":u[38]||(u[38]=d=>R(e).config.scaleYOverLifeCurve=d),"default-curve":R(l),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve","default-curve"])):Te("",!0)],64)):Te("",!0)]),T("div",SN,[T("label",_N,[de(T("input",{type:"checkbox","onUpdate:modelValue":u[39]||(u[39]=d=>R(e).config.rotationOverLifeEnabled=d)},null,512),[[Et,R(e).config.rotationOverLifeEnabled]]),u[50]||(u[50]=T("span",{class:"switch-ui"},null,-1)),u[51]||(u[51]=T("span",null,"生命周期内旋转",-1))]),R(e).config.rotationOverLifeEnabled?(K(),Mt(mn,{key:0,label:"旋转速度",mode:R(e).config.rotationOverLifeMode,"onUpdate:mode":u[40]||(u[40]=d=>R(e).config.rotationOverLifeMode=d),"value-min":R(e).config.rotationSpeedMin,"onUpdate:valueMin":u[41]||(u[41]=d=>R(e).config.rotationSpeedMin=d),"value-max":R(e).config.rotationSpeedMax,"onUpdate:valueMax":u[42]||(u[42]=d=>R(e).config.rotationSpeedMax=d),curve:R(e).config.rotationOverLifeCurve,"onUpdate:curve":u[43]||(u[43]=d=>R(e).config.rotationOverLifeCurve=d),"default-curve":R(c),min:-720,max:720,step:10,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve","default-curve"])):Te("",!0)])],512),[[vi,!R(t).attr]])]))}}),MN=Qt(TN,[["__scopeId","data-v-cf6b86a5"]]),CN={class:"gradient-editor"},AN=["title","onClick","onDblclick","onPointerdown"],EN={key:0,class:"gradient-controls"},IN=["value"],RN=["value"],PN={class:"gradient-position"},kN=["value"],FN=["disabled"],ON=Jt({__name:"ColorGradientEditor",props:{modelValue:{}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=Ge(null),r=Ge(0),o=qe(()=>t.modelValue[r.value]||null),a=qe(()=>[...t.modelValue].sort((M,I)=>M.position-I.position)),c=qe(()=>{const M=a.value;return M.length?`linear-gradient(90deg, ${M.map(I=>`${I.color} ${l(I.position)*100}%`).join(", ")})`:"#ffffff"});Xi(()=>t.modelValue.length,M=>{r.value>=M&&(r.value=Math.max(0,M-1))});function l(M){return Math.min(1,Math.max(0,Number(M)||0))}function h(){return t.modelValue.map(M=>({position:l(M.position),color:M.color}))}function u(M,I){const F=h();F[M]&&(F[M]={...F[M],...I},i("update:modelValue",F))}function d(M){u(r.value,{color:M.target.value})}function f(M){var E;const I=M.target,F=b(I.value,((E=o.value)==null?void 0:E.color)||"#ffffff");I.value=F,u(r.value,{color:F})}function p(M){const I=M.target;f(M),I.blur()}function m(M){const I=Number(M.target.value);Number.isFinite(I)&&u(r.value,{position:l(I/100)})}function g(M){const I=h();I.push({position:l(M),color:C(I,M)}),r.value=I.length-1,i("update:modelValue",I)}function v(M){if(!n.value)return;const I=n.value.getBoundingClientRect();g((M.clientX-I.left)/Math.max(1,I.width))}function x(){const M=a.value;let I=.5;if(M.length>1){let F=-1;for(let E=0;EF&&(F=k,I=(M[E].position+M[E+1].position)/2)}}g(I)}function y(M){if(t.modelValue.length<=2||M<0)return;const I=h().filter((F,E)=>E!==M);r.value=Math.min(M,I.length-1),i("update:modelValue",I)}function _(M,I){if(!n.value)return;r.value=I;const F=k=>{const O=n.value.getBoundingClientRect();u(I,{position:l((k.clientX-O.left)/Math.max(1,O.width))})},E=()=>{window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",E),window.removeEventListener("pointercancel",E)};window.addEventListener("pointermove",F),window.addEventListener("pointerup",E),window.addEventListener("pointercancel",E),M.preventDefault()}function C(M,I){const F=[...M].sort((E,k)=>E.position-k.position);if(!F.length)return"#ffffff";if(I<=F[0].position)return F[0].color;if(I>=F[F.length-1].position)return F[F.length-1].color;for(let E=0;EO.position)continue;const D=(I-k.position)/Math.max(1e-4,O.position-k.position);return S(k.color,O.color,D)}return F[F.length-1].color}function S(M,I,F){const E=$=>{const N=parseInt($.replace("#","").padEnd(6,"0").slice(0,6),16);return[N>>16&255,N>>8&255,N&255]},k=E(M),O=E(I),D=$=>Math.round(k[$]+(O[$]-k[$])*F);return`#${[D(0),D(1),D(2)].map($=>$.toString(16).padStart(2,"0")).join("")}`}function b(M,I){let F=M.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(F)&&(F=F.split("").map(E=>E+E).join("")),/^[0-9a-f]{6}$/i.test(F)?`#${F.toLowerCase()}`:I}return(M,I)=>(K(),Q("div",CN,[T("div",{ref_key:"bar",ref:n,class:"gradient-bar",style:di({background:c.value}),title:"双击色带添加色标",onDblclick:v},[(K(!0),Q(Fe,null,Dt(s.modelValue,(F,E)=>(K(),Q("button",{key:E,type:"button",class:Le(["gradient-stop",{selected:E===r.value}]),style:di({left:`${l(F.position)*100}%`,"--stop-color":F.color}),title:`${Math.round(l(F.position)*100)}% · ${F.color}`,onClick:et(k=>r.value=E,["stop"]),onDblclick:et(k=>y(E),["stop"]),onPointerdown:et(k=>_(k,E),["stop"])},null,46,AN))),128))],36),o.value?(K(),Q("div",EN,[T("input",{type:"color",class:"gradient-color",value:o.value.color,"aria-label":"色标颜色",onInput:d},null,40,IN),T("input",{type:"text",class:"gradient-hex-input",value:o.value.color,"aria-label":"色标颜色值",spellcheck:"false",onChange:f,onKeydown:zr(p,["enter"])},null,40,RN),T("label",PN,[T("input",{type:"number",min:"0",max:"100",step:"1",value:Math.round(l(o.value.position)*100),"aria-label":"色标位置",onInput:m},null,40,kN),I[1]||(I[1]=T("span",null,"%",-1))]),T("button",{type:"button",class:"gradient-action",title:"在中间新增颜色",onClick:x},"+"),T("button",{type:"button",class:"gradient-action danger",title:"删除当前色标",disabled:s.modelValue.length<=2,onClick:I[0]||(I[0]=F=>y(r.value))},"×",8,FN)])):Te("",!0),I[2]||(I[2]=T("div",{class:"gradient-hint"},"双击色带新增 · 拖动色标调整位置 · 双击色标删除",-1))]))}}),gS=Qt(ON,[["__scopeId","data-v-f6ab10bf"]]),BN={class:"image-card"},LN={class:"imgrow"},DN=["title"],NN=["src","alt"],UN={key:1,viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#8a93bb","stroke-width":"1.6"},$N={class:"img-fields"},XN={key:0,class:"row"},VN={class:"row"},YN=["placeholder"],GN={class:"img-actions"},HN=["title"],jN=["disabled"],WN={class:"thumb-note"},zN={key:0,class:"row"},qN={class:"row"},KN={class:"row"},ZN={class:"sequence-note"},JN={class:"resource-weight-row"},QN=["disabled","title"],e4={key:0,viewBox:"0 0 24 24","aria-hidden":"true"},t4={key:1,viewBox:"0 0 24 24","aria-hidden":"true"},i4=Jt({__name:"ImageResourceCard",props:{resource:{},resourceCount:{},defaultFile:{},namePlaceholder:{default:"particle"},showFolder:{type:Boolean,default:!0},supportsSequence:{type:Boolean,default:!1}},emits:["pick","pickSequence","reset","remove","updateWeight","toggleLock"],setup(s,{emit:e}){const t=s,i=e,n=qe(()=>{var l,h;if(t.resource.imageMode==="sequence"){const u=t.resource.sequenceFrames||[];if(!u.length)return"未选择序列帧";const d=((l=u[0])==null?void 0:l.name)||"第 1 帧",f=((h=u[u.length-1])==null?void 0:h.name)||d;return u.length===1?`1 帧 · ${d}`:`${u.length} 帧 · ${d} → ${f}`}const c=t.resource.textureName||t.defaultFile.replace(/\.[^.]+$/,"");return c.includes(".")?c:`${c}.png`}),r=qe(()=>{var c,l;return t.resource.imageMode==="sequence"?((l=(c=t.resource.sequenceFrames)==null?void 0:c[0])==null?void 0:l.previewUrl)||"":t.resource.previewUrl}),o=qe(()=>{var u,d;const c=t.resource.sequenceFrames||[];if(!c.length)return"未选择序列帧";const l=((u=c[0])==null?void 0:u.name)||"第一张图片",h=((d=c[c.length-1])==null?void 0:d.name)||"最后一张图片";return`已选择 ${c.length} 帧,按 ${l}-${h} 顺序播放`});function a(){t.supportsSequence&&t.resource.imageMode==="sequence"?i("pickSequence",t.resource.id):i("pick",t.resource.id)}return(c,l)=>(K(),Q("div",BN,[T("div",LN,[T("button",{class:"img-thumb",title:s.supportsSequence&&s.resource.imageMode==="sequence"?"选择序列帧图片":"选择本地图片",onClick:a},[r.value?(K(),Q("img",{key:0,src:r.value,alt:s.resource.textureName},null,8,NN)):(K(),Q("svg",UN,[...l[10]||(l[10]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"},null,-1),T("circle",{cx:"8.5",cy:"8.5",r:"1.6"},null,-1),T("path",{d:"M21 15l-5-5-9 9"},null,-1)])]))],8,DN),T("div",$N,[s.showFolder?(K(),Q("label",XN,[l[11]||(l[11]=T("span",null,"子文件夹",-1)),de(T("input",{"onUpdate:modelValue":l[0]||(l[0]=h=>s.resource.textureFolder=h),type:"text",class:"inp",placeholder:"subfolder/"},null,512),[[He,s.resource.textureFolder]])])):Te("",!0),T("label",VN,[l[12]||(l[12]=T("span",null,"名称",-1)),de(T("input",{"onUpdate:modelValue":l[1]||(l[1]=h=>s.resource.textureName=h),type:"text",class:"inp",placeholder:s.namePlaceholder},null,8,YN),[[He,s.resource.textureName]])])]),T("div",GN,[T("button",{class:"mini-btn2",title:`恢复 ${s.defaultFile}`,onClick:l[2]||(l[2]=h=>c.$emit("reset",s.resource.id))},"⟳",8,HN),T("button",{class:"mini-btn2",title:"删除图片资源",disabled:s.resourceCount===1,onClick:l[3]||(l[3]=h=>c.$emit("remove",s.resource.id))},"🗑",8,jN)])]),T("div",WN,_e(n.value),1),s.supportsSequence?(K(),Q("label",zN,[l[14]||(l[14]=T("span",null,"图片模式",-1)),de(T("select",{"onUpdate:modelValue":l[4]||(l[4]=h=>s.resource.imageMode=h),class:"inp"},[...l[13]||(l[13]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"sequence"},"序列帧",-1)])],512),[[wt,s.resource.imageMode]])])):Te("",!0),s.supportsSequence&&s.resource.imageMode==="sequence"?(K(),Q(Fe,{key:1},[T("label",qN,[l[16]||(l[16]=T("span",null,"播放模式",-1)),de(T("select",{"onUpdate:modelValue":l[5]||(l[5]=h=>s.resource.sequencePlayback=h),class:"inp"},[...l[15]||(l[15]=[T("option",{value:"once-hide"},"单次-尾帧消失",-1),T("option",{value:"once-hold"},"单次-尾帧固定",-1),T("option",{value:"loop-forward"},"正向循环",-1),T("option",{value:"loop-reverse"},"反向循环",-1)])],512),[[wt,s.resource.sequencePlayback]])]),T("label",KN,[l[17]||(l[17]=T("span",null,"播放帧率",-1)),de(T("input",{"onUpdate:modelValue":l[6]||(l[6]=h=>s.resource.sequenceFps=h),type:"number",min:"1",max:"120",step:"1",class:"inp"},null,512),[[He,s.resource.sequenceFps,void 0,{number:!0}]])]),T("button",{class:"sequence-pick",onClick:l[7]||(l[7]=h=>c.$emit("pickSequence",s.resource.id))},"选择序列帧(多选)"),T("div",ZN,_e(o.value),1)],64)):Te("",!0),T("div",JN,[be(Be,{class:"resource-weight-control",label:"占比%",min:0,max:100,step:1,"model-value":s.resource.weight,disabled:s.resource.locked||s.resourceCount===1,"onUpdate:modelValue":l[8]||(l[8]=h=>c.$emit("updateWeight",s.resource.id,h))},null,8,["model-value","disabled"]),T("button",{class:Le(["weight-lock",{on:s.resource.locked}]),disabled:s.resourceCount===1,title:s.resource.locked?"解除占比锁定":"锁定当前占比",onClick:l[9]||(l[9]=h=>c.$emit("toggleLock",s.resource.id))},[s.resource.locked?(K(),Q("svg",e4,[...l[18]||(l[18]=[T("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),T("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"},null,-1)])])):(K(),Q("svg",t4,[...l[19]||(l[19]=[T("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),T("path",{d:"M16 10V7a4 4 0 0 0-7.5-2"},null,-1)])]))],10,QN)]),R_(c.$slots,"default",{},void 0)]))}}),vS=Qt(i4,[["__scopeId","data-v-68ff5314"]]),s4={class:"group"},n4={class:"caret"},r4={class:"group-body"},o4={class:"seg"},a4={class:"row"},l4={class:"curve-wrap"},c4={class:"look-title image-title"},h4={class:"row"},u4=["onUpdate:modelValue"],d4=["onUpdate:modelValue"],f4={class:"row resource-color-row"},m4=["onUpdate:modelValue"],p4=["onUpdate:modelValue"],g4={key:0,class:"row resource-color-picker"},v4=["onUpdate:modelValue"],y4=["value","onChange","onKeydown"],x4={key:0,class:"random-color-hint"},b4={class:"resource-alpha-head"},w4={class:"alpha-modes"},S4=["onClick"],_4=["onClick"],T4=["onClick"],M4={class:"row"},C4=["onUpdate:modelValue"],A4={class:"resource-alpha-curve"},E4=Jt({__name:"ParticleAppearanceSection",setup(s){const{resolvedCurveEditorMode:e,sys:t,textureFileInput:i,sequenceFileInput:n,addImageResource:r,openTexturePicker:o,openSequencePicker:a,onTextureFile:c,onSequenceFiles:l,resetTexture:h,setResourceFixedColor:u,commitResourceFixedColor:d,removeImageResource:f,setResourceWeight:p,toggleResourceLock:m,collapsed:g,toggle:v,resetModule:x,select:y,ALPHA_CURVE:_,RESOURCE_ALPHA_CURVE:C}=br();return(S,b)=>(K(),Q("div",s4,[T("div",{class:"group-head",onClick:b[1]||(b[1]=M=>R(v)("look"))},[T("span",n4,_e(R(g).look?"▸":"▾"),1),b[10]||(b[10]=T("span",null,"外观与资源",-1)),T("button",{class:"group-reset",title:"重置外观与资源参数",onClick:b[0]||(b[0]=et(M=>R(x)("look"),["stop"]))},"重置")]),de(T("div",r4,[b[24]||(b[24]=T("div",{class:"look-title"},"透明度",-1)),T("div",o4,[T("button",{class:Le(["seg-btn",{active:R(t).config.alphaMode==="curve"}]),onClick:b[2]||(b[2]=M=>R(t).config.alphaMode="curve")},"曲线",2),T("button",{class:Le(["seg-btn",{active:R(t).config.alphaMode==="fixed"}]),onClick:b[3]||(b[3]=M=>R(t).config.alphaMode="fixed")},"固定",2)]),R(t).config.alphaMode==="fixed"?(K(),Mt(Be,{key:0,label:"透明度",min:0,max:1,step:.01,modelValue:R(t).config.alpha,"onUpdate:modelValue":b[4]||(b[4]=M=>R(t).config.alpha=M)},null,8,["modelValue"])):(K(),Q(Fe,{key:1},[T("label",a4,[b[12]||(b[12]=T("span",null,"曲线模式",-1)),de(T("select",{"onUpdate:modelValue":b[5]||(b[5]=M=>R(t).config.curveMode=M),class:"inp"},[...b[11]||(b[11]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],512),[[wt,R(t).config.curveMode]])]),T("div",l4,[be(qs,{modelValue:R(t).config.alphaCurve,"onUpdate:modelValue":b[6]||(b[6]=M=>R(t).config.alphaCurve=M),"default-value":R(_),mode:R(e)(R(t).config.curveMode)},null,8,["modelValue","default-value","mode"]),b[13]||(b[13]=T("div",{class:"curve-labels"},[T("span",null,"0(透明)"),T("span",null,"生命周期 →"),T("span",null,"1(不透明)")],-1))])],64)),T("div",c4,[b[14]||(b[14]=T("span",null,"图片资源",-1)),T("button",{class:"image-add",title:"新增图片资源",onClick:b[7]||(b[7]=(...M)=>R(r)&&R(r)(...M))},"+")]),(K(!0),Q(Fe,null,Dt(R(t).config.imageResources,M=>(K(),Mt(vS,{key:M.id,resource:M,"resource-count":R(t).config.imageResources.length,"supports-sequence":"","default-file":"star.png",onPick:R(o),onPickSequence:R(a),onReset:R(h),onRemove:R(f),onUpdateWeight:R(p),onToggleLock:R(m)},{default:$h(()=>[be(Be,{label:"缩放",min:.1,max:3,step:.05,modelValue:M.scale,"onUpdate:modelValue":I=>M.scale=I},null,8,["modelValue","onUpdate:modelValue"]),T("label",h4,[b[15]||(b[15]=T("span",null,"轴心 x,y",-1)),de(T("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":I=>M.anchorX=I},null,8,u4),[[He,M.anchorX,void 0,{number:!0}]]),de(T("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":I=>M.anchorY=I},null,8,d4),[[He,M.anchorY,void 0,{number:!0}]])]),b[23]||(b[23]=T("div",{class:"resource-divider"},null,-1)),T("label",f4,[b[18]||(b[18]=T("span",null,"颜色",-1)),de(T("select",{"onUpdate:modelValue":I=>M.colorMode=I,class:"inp"},[...b[16]||(b[16]=[T("option",{value:"fixed"},"固定色",-1),T("option",{value:"random"},"随机颜色",-1),T("option",{value:"lifetime"},"生命周期",-1)])],8,m4),[[wt,M.colorMode]]),de(T("select",{"onUpdate:modelValue":I=>M.blend=I,class:"inp blend-select"},[...b[17]||(b[17]=[T("option",{value:"normal"},"正常",-1),T("option",{value:"add"},"相加",-1),T("option",{value:"multiply"},"相乘",-1),T("option",{value:"screen"},"滤色",-1)])],8,p4),[[wt,M.blend]])]),M.colorMode==="fixed"?(K(),Q("label",g4,[b[19]||(b[19]=T("span",null,"固定色",-1)),de(T("input",{type:"color","onUpdate:modelValue":I=>M.colorStart=I,class:"colr"},null,8,v4),[[He,M.colorStart]]),T("input",{type:"text",class:"hex-input",value:M.colorStart,spellcheck:"false","aria-label":"固定颜色值",onChange:I=>R(u)(M,I),onKeydown:zr(I=>R(d)(M,I),["enter"])},null,40,y4)])):(K(),Q(Fe,{key:1},[be(gS,{modelValue:M.colorGradient,"onUpdate:modelValue":I=>M.colorGradient=I},null,8,["modelValue","onUpdate:modelValue"]),M.colorMode==="random"?(K(),Q("div",x4,"每个粒子出生时从色带随机取色,生命周期内保持不变")):Te("",!0)],64)),T("div",b4,[b[20]||(b[20]=T("span",null,"独立透明度",-1)),T("div",w4,[T("button",{class:Le({on:M.independentAlpha==="off"}),onClick:I=>M.independentAlpha="off"},"关闭",10,S4),T("button",{class:Le({on:M.independentAlpha==="fixed"}),onClick:I=>M.independentAlpha="fixed"},"固定",10,_4),T("button",{class:Le({on:M.independentAlpha==="curve"}),onClick:I=>M.independentAlpha="curve"},"曲线",10,T4)])]),M.independentAlpha==="fixed"?(K(),Mt(Be,{key:2,label:"透明度",min:0,max:1,step:.01,modelValue:M.alpha,"onUpdate:modelValue":I=>M.alpha=I},null,8,["modelValue","onUpdate:modelValue"])):M.independentAlpha==="curve"?(K(),Q(Fe,{key:3},[T("label",M4,[b[22]||(b[22]=T("span",null,"曲线模式",-1)),de(T("select",{"onUpdate:modelValue":I=>M.alphaCurveMode=I,class:"inp"},[...b[21]||(b[21]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],8,C4),[[wt,M.alphaCurveMode]])]),T("div",A4,[be(qs,{modelValue:M.alphaCurve,"onUpdate:modelValue":I=>M.alphaCurve=I,"default-value":R(C),mode:R(e)(M.alphaCurveMode)},null,8,["modelValue","onUpdate:modelValue","default-value","mode"])])],64)):Te("",!0)]),_:2},1032,["resource","resource-count","onPick","onPickSequence","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),T("input",{ref_key:"textureFileInput",ref:i,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:b[8]||(b[8]=(...M)=>R(c)&&R(c)(...M))},null,544),T("input",{ref_key:"sequenceFileInput",ref:n,class:"file-input",type:"file",multiple:"",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:b[9]||(b[9]=(...M)=>R(l)&&R(l)(...M))},null,544)],512),[[vi,!R(g).look]])]))}}),I4=Qt(E4,[["__scopeId","data-v-d8fe7aad"]]),R4={class:"group"},P4={class:"caret"},k4={class:"group-body"},F4={class:"modifier-item"},O4={class:"switch-row modifier-switch"},B4={key:0,class:"modifier-params"},L4={class:"modifier-item"},D4={class:"switch-row modifier-switch"},N4={key:0,class:"modifier-params gravity-params"},U4={class:"modifier-mode-row"},$4={class:"modifier-item"},X4={class:"switch-row modifier-switch"},V4={key:0,class:"modifier-params gravity-params"},Y4={class:"modifier-mode-row"},G4={class:"modifier-item"},H4={class:"switch-row modifier-switch"},j4={key:0,class:"modifier-params"},W4={class:"row"},z4={class:"modifier-item"},q4={class:"switch-row modifier-switch"},K4={key:0,class:"modifier-params"},Z4={class:"row"},J4={class:"row"},Q4={class:"modifier-item"},e8={class:"switch-row modifier-switch"},t8={key:0,class:"modifier-params trail-params"},i8={class:"trail-section-head"},s8={class:"row"},n8=["onUpdate:modelValue"],r8={class:"row"},o8=["onUpdate:modelValue"],a8={class:"row"},l8=["onUpdate:modelValue"],c8={class:"switch-row trail-sub-switch"},h8=["onUpdate:modelValue"],u8={class:"switch-row trail-sub-switch"},d8=["onUpdate:modelValue"],f8={class:"trail-mode-head"},m8={class:"alpha-modes"},p8=["onClick"],g8=["onClick"],v8=["onClick"],y8={class:"row"},x8=["onUpdate:modelValue"],b8={key:6,class:"row trail-fixed-color"},w8=["onUpdate:modelValue"],S8=["value","onChange","onKeydown"],_8={class:"trail-mode-head"},T8={class:"alpha-modes"},M8=["onClick"],C8=["onClick"],A8=["onClick"],E8={class:"trail-grid-row"},I8={class:"modifier-item"},R8={class:"switch-row modifier-switch"},P8=["disabled"],k8={key:0,class:"modifier-params emitter-follow-params"},F8={class:"field-block"},O8=["value"],B8={key:0,value:"bone"},L8={class:"field-block"},D8=["value"],N8={class:"field-block"},U8={class:"field-grid follow-grid"},$8={class:"compact-field"},X8={class:"compact-field"},V8={class:"field-block"},Y8={key:0,class:"bone-follow-target"},G8={key:1,class:"bone-follow-missing"},H8={class:"field-block"},j8={class:"field-grid follow-grid"},W8={class:"compact-field"},z8={class:"compact-field"},q8={class:"bone-follow-transform-grid"},K8={class:"compact-field"},Z8={class:"compact-field"},J8={class:"compact-field"},Q8={class:"modifier-item"},e5={class:"switch-row modifier-switch"},t5={key:0,class:"modifier-params collision-filter-params"},i5={class:"collision-filter-tags"},s5=["title"],n5=["aria-label","onClick"],r5=["disabled","title"],o5={key:0,class:"collision-filter-empty"},a5={key:1,class:"collision-filter-picker"},l5=["onClick"],c5=Jt({__name:"ParticleModifiersSection",setup(s){const{store:e,sys:t,trailTextureFileInput:i,addTrailResource:n,openTrailTexturePicker:r,onTrailRigChange:o,onTrailResourceBoneCountChange:a,onTrailResourceRotationChange:c,onTrailTextureFile:l,resetTrailTexture:h,removeTrailResource:u,setTrailResourceWeight:d,toggleTrailResourceLock:f,setTrailColor:p,commitTrailColor:m,selectedSpineBone:g,boundSpineBone:v,collisionPickerOpen:x,selectedCollisionBodies:y,availableCollisionBodies:_,addCollisionBody:C,removeCollisionBody:S,collapsed:b,toggle:M,onEmitterFollowModeChange:I,bindSelectedBone:F,resetModule:E,select:k,LINEAR_CURVE:O,FLAT_CURVE:D,TRAIL_ALPHA_CURVE:$,TRAIL_SHAPE_CURVE:N}=br();return(U,A)=>(K(),Q("div",R4,[T("div",{class:"group-head",onClick:A[1]||(A[1]=P=>R(M)("mods"))},[T("span",P4,_e(R(b).mods?"▸":"▾"),1),A[60]||(A[60]=T("span",null,"修改器",-1)),T("button",{class:"group-reset",title:"重置修改器参数",onClick:A[0]||(A[0]=et(P=>R(E)("mods"),["stop"]))},"重置")]),de(T("div",k4,[T("div",F4,[T("label",O4,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[2]||(A[2]=P=>R(t).config.noise=P)},null,512),[[Et,R(t).config.noise]]),A[61]||(A[61]=T("span",{class:"switch-ui"},null,-1)),A[62]||(A[62]=T("span",null,"开启移动噪声",-1))]),R(t).config.noise?(K(),Q("div",B4,[be(Be,{label:"强度",min:0,max:100,step:1,modelValue:R(t).config.noiseAmt,"onUpdate:modelValue":A[3]||(A[3]=P=>R(t).config.noiseAmt=P)},null,8,["modelValue"]),be(Be,{label:"波动范围",min:0,max:500,step:1,modelValue:R(t).config.noiseRange,"onUpdate:modelValue":A[4]||(A[4]=P=>R(t).config.noiseRange=P)},null,8,["modelValue"]),be(Be,{label:"时间流速",min:0,max:10,step:.1,modelValue:R(t).config.noiseSpeed,"onUpdate:modelValue":A[5]||(A[5]=P=>R(t).config.noiseSpeed=P)},null,8,["modelValue"]),A[63]||(A[63]=T("div",{class:"modifier-hint"},"强度控制影响比例 · 波动范围控制最大偏移 · 时间流速控制变化速度",-1))])):Te("",!0)]),T("div",L4,[T("label",D4,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[6]||(A[6]=P=>R(t).config.useGravity=P)},null,512),[[Et,R(t).config.useGravity]]),A[64]||(A[64]=T("span",{class:"switch-ui"},null,-1)),A[65]||(A[65]=T("span",null,"开启重力",-1))]),R(t).config.useGravity?(K(),Q("div",N4,[T("div",U4,[T("button",{class:Le(["axis-mode",{on:R(t).config.gravityMode==="fixed"}]),onClick:A[7]||(A[7]=P=>R(t).config.gravityMode="fixed")},"固定",2),T("button",{class:Le(["axis-mode",{on:R(t).config.gravityMode==="random"}]),onClick:A[8]||(A[8]=P=>R(t).config.gravityMode="random")},"随机",2)]),R(t).config.gravityMode==="fixed"?(K(),Mt(Be,{key:0,label:"重力强度",min:-3e3,max:3e3,step:10,modelValue:R(t).config.gravityMin,"onUpdate:modelValue":A[9]||(A[9]=P=>R(t).config.gravityMin=P)},null,8,["modelValue"])):(K(),Q(Fe,{key:1},[be(Be,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:R(t).config.gravityMin,"onUpdate:modelValue":A[10]||(A[10]=P=>R(t).config.gravityMin=P)},null,8,["modelValue"]),be(Be,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:R(t).config.gravityMax,"onUpdate:modelValue":A[11]||(A[11]=P=>R(t).config.gravityMax=P)},null,8,["modelValue"])],64)),be(Be,{label:"方向",min:-360,max:360,step:1,modelValue:R(t).config.gravityDirection,"onUpdate:modelValue":A[12]||(A[12]=P=>R(t).config.gravityDirection=P)},null,8,["modelValue"]),A[66]||(A[66]=T("div",{class:"gravity-curve-title"},[T("span",null,"生命周期内重力"),T("span",null,"纵轴:强度 0~1")],-1)),be(qs,{modelValue:R(t).config.gravityCurve,"onUpdate:modelValue":A[13]||(A[13]=P=>R(t).config.gravityCurve=P),"default-value":R(D)},null,8,["modelValue","default-value"]),A[67]||(A[67]=T("div",{class:"gravity-curve-axis"},[T("span",null,"0"),T("span",null,"生命周期 →"),T("span",null,"1")],-1)),A[68]||(A[68]=T("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):Te("",!0)]),T("div",$4,[T("label",X4,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[14]||(A[14]=P=>R(t).config.wind=P)},null,512),[[Et,R(t).config.wind]]),A[69]||(A[69]=T("span",{class:"switch-ui"},null,-1)),A[70]||(A[70]=T("span",null,"开启风力",-1))]),R(t).config.wind?(K(),Q("div",V4,[T("div",Y4,[T("button",{class:Le(["axis-mode",{on:R(t).config.windMode==="fixed"}]),onClick:A[15]||(A[15]=P=>R(t).config.windMode="fixed")},"固定",2),T("button",{class:Le(["axis-mode",{on:R(t).config.windMode==="random"}]),onClick:A[16]||(A[16]=P=>R(t).config.windMode="random")},"随机",2)]),R(t).config.windMode==="fixed"?(K(),Mt(Be,{key:0,label:"风力强度",min:-3e3,max:3e3,step:10,modelValue:R(t).config.windMin,"onUpdate:modelValue":A[17]||(A[17]=P=>R(t).config.windMin=P)},null,8,["modelValue"])):(K(),Q(Fe,{key:1},[be(Be,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:R(t).config.windMin,"onUpdate:modelValue":A[18]||(A[18]=P=>R(t).config.windMin=P)},null,8,["modelValue"]),be(Be,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:R(t).config.windMax,"onUpdate:modelValue":A[19]||(A[19]=P=>R(t).config.windMax=P)},null,8,["modelValue"])],64)),be(Be,{label:"方向",min:-360,max:360,step:1,modelValue:R(t).config.windDirection,"onUpdate:modelValue":A[20]||(A[20]=P=>R(t).config.windDirection=P)},null,8,["modelValue"]),A[71]||(A[71]=T("div",{class:"gravity-curve-title"},[T("span",null,"生命周期内风力"),T("span",null,"纵轴:强度 0~1")],-1)),be(qs,{modelValue:R(t).config.windCurve,"onUpdate:modelValue":A[21]||(A[21]=P=>R(t).config.windCurve=P),"default-value":R(D)},null,8,["modelValue","default-value"]),A[72]||(A[72]=T("div",{class:"gravity-curve-axis"},[T("span",null,"0"),T("span",null,"生命周期 →"),T("span",null,"1")],-1)),A[73]||(A[73]=T("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):Te("",!0)]),T("div",G4,[T("label",H4,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[22]||(A[22]=P=>R(t).config.forceField=P)},null,512),[[Et,R(t).config.forceField]]),A[74]||(A[74]=T("span",{class:"switch-ui"},null,-1)),A[75]||(A[75]=T("span",null,"开启力场",-1))]),R(t).config.forceField?(K(),Q("div",j4,[be(Be,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:R(t).config.forceCenterX,"onUpdate:modelValue":A[23]||(A[23]=P=>R(t).config.forceCenterX=P)},null,8,["modelValue"]),be(Be,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:R(t).config.forceCenterY,"onUpdate:modelValue":A[24]||(A[24]=P=>R(t).config.forceCenterY=P)},null,8,["modelValue"]),be(Be,{label:"力场强度",min:-300,max:300,step:1,modelValue:R(t).config.forceStrength,"onUpdate:modelValue":A[25]||(A[25]=P=>R(t).config.forceStrength=P)},null,8,["modelValue"]),be(Be,{label:"力场半径",min:1,max:2e3,step:1,modelValue:R(t).config.forceRadius,"onUpdate:modelValue":A[26]||(A[26]=P=>R(t).config.forceRadius=P)},null,8,["modelValue"]),T("label",W4,[A[77]||(A[77]=T("span",null,"衰减模式",-1)),de(T("select",{"onUpdate:modelValue":A[27]||(A[27]=P=>R(t).config.forceFalloff=P),class:"inp"},[...A[76]||(A[76]=[T("option",{value:"constant"},"恒定(范围内力度不变)",-1),T("option",{value:"linear"},"线性衰减(边缘为 0)",-1),T("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[wt,R(t).config.forceFalloff]])]),A[78]||(A[78]=T("div",{class:"modifier-hint"},"正数吸向中心 · 负数向外排斥 · 可在画布内拖动力场圆",-1))])):Te("",!0)]),T("div",z4,[T("label",q4,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[28]||(A[28]=P=>R(t).config.attraction=P)},null,512),[[Et,R(t).config.attraction]]),A[79]||(A[79]=T("span",{class:"switch-ui"},null,-1)),A[80]||(A[80]=T("span",null,"开启吸附",-1))]),R(t).config.attraction?(K(),Q("div",K4,[be(Be,{label:"吸附点 X",min:-5e3,max:5e3,step:1,modelValue:R(t).config.attractionCenterX,"onUpdate:modelValue":A[29]||(A[29]=P=>R(t).config.attractionCenterX=P)},null,8,["modelValue"]),be(Be,{label:"吸附点 Y",min:-5e3,max:5e3,step:1,modelValue:R(t).config.attractionCenterY,"onUpdate:modelValue":A[30]||(A[30]=P=>R(t).config.attractionCenterY=P)},null,8,["modelValue"]),be(Be,{label:"吸附半径",min:0,max:2e3,step:1,modelValue:R(t).config.attractionRadius,"onUpdate:modelValue":A[31]||(A[31]=P=>R(t).config.attractionRadius=P)},null,8,["modelValue"]),be(Be,{label:"吸附时长",min:.05,max:30,step:.05,modelValue:R(t).config.attractionDuration,"onUpdate:modelValue":A[32]||(A[32]=P=>R(t).config.attractionDuration=P)},null,8,["modelValue"]),be(Be,{label:"延迟时间",min:0,max:30,step:.05,modelValue:R(t).config.attractionDelay,"onUpdate:modelValue":A[33]||(A[33]=P=>R(t).config.attractionDelay=P)},null,8,["modelValue"]),T("label",Z4,[A[82]||(A[82]=T("span",null,"延迟方式",-1)),de(T("select",{"onUpdate:modelValue":A[34]||(A[34]=P=>R(t).config.attractionDelayMode=P),class:"inp"},[...A[81]||(A[81]=[T("option",{value:"global"},"统一时间",-1),T("option",{value:"particle"},"单粒子生命",-1)])],512),[[wt,R(t).config.attractionDelayMode]])]),T("label",J4,[A[84]||(A[84]=T("span",null,"吸附方式",-1)),de(T("select",{"onUpdate:modelValue":A[35]||(A[35]=P=>R(t).config.attractionPath=P),class:"inp"},[...A[83]||(A[83]=[T("option",{value:"linear"},"直线",-1),T("option",{value:"curve"},"曲线",-1)])],512),[[wt,R(t).config.attractionPath]])]),A[85]||(A[85]=T("div",{class:"modifier-hint"},"延迟后从当前位置开始吸附 · 到达红色范围即死亡 · 可在画布内拖动吸附圆",-1))])):Te("",!0)]),T("div",Q4,[T("label",e8,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[36]||(A[36]=P=>R(t).config.trail=P)},null,512),[[Et,R(t).config.trail]]),A[86]||(A[86]=T("span",{class:"switch-ui"},null,-1)),A[87]||(A[87]=T("span",null,"开启拖尾",-1))]),R(t).config.trail?(K(),Q("div",t8,[T("div",i8,[A[88]||(A[88]=T("div",{class:"trail-section-title"},"拖尾独立图片",-1)),T("button",{class:"image-add",title:"增加拖尾图片资源",onClick:A[37]||(A[37]=(...P)=>R(n)&&R(n)(...P))},"+")]),(K(!0),Q(Fe,null,Dt(R(t).config.trailResources,P=>(K(),Mt(vS,{key:P.id,resource:P,"resource-count":R(t).config.trailResources.length,"default-file":"trail.png","name-placeholder":"trail","show-folder":!1,onPick:R(r),onReset:R(h),onRemove:R(u),onUpdateWeight:R(d),onToggleLock:R(f)},{default:$h(()=>[A[104]||(A[104]=T("div",{class:"resource-divider"},null,-1)),be(Be,{label:"旋转",min:-360,max:360,step:1,"model-value":P.rotation,"onUpdate:modelValue":L=>R(c)(P.id,L)},null,8,["model-value","onUpdate:modelValue"]),be(Be,{label:"拖尾骨骼数",min:2,max:16,step:1,"model-value":P.boneCount,"onUpdate:modelValue":L=>R(a)(P.id,L)},null,8,["model-value","onUpdate:modelValue"]),be(Be,{label:"拖尾比例 (%)",min:0,max:100,step:1,modelValue:P.trailRatio,"onUpdate:modelValue":L=>P.trailRatio=L},null,8,["modelValue","onUpdate:modelValue"]),T("label",s8,[A[90]||(A[90]=T("span",null,"拖尾长度",-1)),de(T("select",{"onUpdate:modelValue":L=>P.lengthMode=L,class:"inp"},[...A[89]||(A[89]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"random"},"随机范围",-1)])],8,n8),[[wt,P.lengthMode]])]),P.lengthMode==="fixed"?(K(),Mt(Be,{key:0,label:"长度比例 (%)",min:0,max:500,step:1,modelValue:P.length,"onUpdate:modelValue":L=>P.length=L},null,8,["modelValue","onUpdate:modelValue"])):(K(),Q(Fe,{key:1},[be(Be,{label:"长度最小 (%)",min:0,max:500,step:1,modelValue:P.lengthMin,"onUpdate:modelValue":L=>P.lengthMin=L},null,8,["modelValue","onUpdate:modelValue"]),be(Be,{label:"长度最大 (%)",min:0,max:500,step:1,modelValue:P.lengthMax,"onUpdate:modelValue":L=>P.lengthMax=L},null,8,["modelValue","onUpdate:modelValue"])],64)),T("label",r8,[A[92]||(A[92]=T("span",null,"拖尾宽度",-1)),de(T("select",{"onUpdate:modelValue":L=>P.widthSizeMode=L,class:"inp"},[...A[91]||(A[91]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"random"},"随机范围",-1)])],8,o8),[[wt,P.widthSizeMode]])]),P.widthSizeMode==="fixed"?(K(),Mt(Be,{key:2,label:"宽度比例 (%)",min:0,max:500,step:1,modelValue:P.width,"onUpdate:modelValue":L=>P.width=L},null,8,["modelValue","onUpdate:modelValue"])):(K(),Q(Fe,{key:3},[be(Be,{label:"宽度最小 (%)",min:0,max:500,step:1,modelValue:P.widthMin,"onUpdate:modelValue":L=>P.widthMin=L},null,8,["modelValue","onUpdate:modelValue"]),be(Be,{label:"宽度最大 (%)",min:0,max:500,step:1,modelValue:P.widthMax,"onUpdate:modelValue":L=>P.widthMax=L},null,8,["modelValue","onUpdate:modelValue"])],64)),T("label",a8,[A[94]||(A[94]=T("span",null,"宽度缩放",-1)),de(T("select",{"onUpdate:modelValue":L=>P.widthMode=L,class:"inp"},[...A[93]||(A[93]=[T("option",{value:"particle"},"跟随粒子",-1),T("option",{value:"fixed"},"固定",-1)])],8,l8),[[wt,P.widthMode]])]),T("label",c8,[de(T("input",{type:"checkbox","onUpdate:modelValue":L=>P.lifeLengthEnabled=L},null,8,h8),[[Et,P.lifeLengthEnabled]]),A[95]||(A[95]=T("span",{class:"switch-ui"},null,-1)),A[96]||(A[96]=T("span",null,"生命周期长度曲线",-1))]),P.lifeLengthEnabled?(K(),Mt(qs,{key:4,modelValue:P.lifeLengthCurve,"onUpdate:modelValue":L=>P.lifeLengthCurve=L,"default-value":R(D)},null,8,["modelValue","onUpdate:modelValue","default-value"])):Te("",!0),T("label",u8,[de(T("input",{type:"checkbox","onUpdate:modelValue":L=>P.shapeEnabled=L},null,8,d8),[[Et,P.shapeEnabled]]),A[97]||(A[97]=T("span",{class:"switch-ui"},null,-1)),A[98]||(A[98]=T("span",null,"形状曲线(首端 → 尾端宽度)",-1))]),P.shapeEnabled?(K(),Mt(qs,{key:5,modelValue:P.shapeCurve,"onUpdate:modelValue":L=>P.shapeCurve=L,"default-value":R(N)},null,8,["modelValue","onUpdate:modelValue","default-value"])):Te("",!0),T("div",f8,[A[99]||(A[99]=T("span",null,"颜色模式",-1)),T("div",m8,[T("button",{class:Le(["axis-mode",{on:P.colorMode==="particle"}]),onClick:L=>P.colorMode="particle"},"跟随粒子",10,p8),T("button",{class:Le(["axis-mode",{on:P.colorMode==="fixed"}]),onClick:L=>P.colorMode="fixed"},"固定",10,g8),T("button",{class:Le(["axis-mode",{on:P.colorMode==="curve"}]),onClick:L=>P.colorMode="curve"},"曲线",10,v8)])]),T("label",y8,[A[101]||(A[101]=T("span",null,"混合模式",-1)),de(T("select",{"onUpdate:modelValue":L=>P.blend=L,class:"inp"},[...A[100]||(A[100]=[T("option",{value:"normal"},"正常",-1),T("option",{value:"add"},"相加",-1),T("option",{value:"multiply"},"相乘",-1),T("option",{value:"screen"},"滤色",-1)])],8,x8),[[wt,P.blend]])]),P.colorMode==="fixed"?(K(),Q("label",b8,[A[102]||(A[102]=T("span",null,"固定颜色",-1)),de(T("input",{class:"colr",type:"color","onUpdate:modelValue":L=>P.color=L},null,8,w8),[[He,P.color]]),T("input",{class:"hex-input",value:P.color,onChange:L=>R(p)(P,L),onKeydown:zr(et(L=>R(m)(P,L),["prevent"]),["enter"])},null,40,S8)])):P.colorMode==="curve"?(K(),Mt(gS,{key:7,modelValue:P.colorGradient,"onUpdate:modelValue":L=>P.colorGradient=L},null,8,["modelValue","onUpdate:modelValue"])):Te("",!0),T("div",_8,[A[103]||(A[103]=T("span",null,"透明度模式",-1)),T("div",T8,[T("button",{class:Le(["axis-mode",{on:P.alphaMode==="particle"}]),onClick:L=>P.alphaMode="particle"},"跟随粒子",10,M8),T("button",{class:Le(["axis-mode",{on:P.alphaMode==="fixed"}]),onClick:L=>P.alphaMode="fixed"},"固定",10,C8),T("button",{class:Le(["axis-mode",{on:P.alphaMode==="curve"}]),onClick:L=>P.alphaMode="curve"},"曲线",10,A8)])]),P.alphaMode==="fixed"?(K(),Mt(Be,{key:8,label:"透明度",min:0,max:1,step:.01,modelValue:P.alpha,"onUpdate:modelValue":L=>P.alpha=L},null,8,["modelValue","onUpdate:modelValue"])):Te("",!0),P.alphaMode==="curve"?(K(),Mt(qs,{key:9,modelValue:P.alphaCurve,"onUpdate:modelValue":L=>P.alphaCurve=L,"default-value":R($)},null,8,["modelValue","onUpdate:modelValue","default-value"])):Te("",!0)]),_:2},1032,["resource","resource-count","onPick","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),T("input",{ref_key:"trailTextureFileInput",ref:i,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:A[38]||(A[38]=(...P)=>R(l)&&R(l)(...P))},null,544),T("div",E8,[be(Be,{label:"网格行数",min:2,max:16,step:1,"model-value":R(t).config.trailGridRows,"onUpdate:modelValue":A[39]||(A[39]=P=>R(o)("trailGridRows",P))},null,8,["model-value"]),be(Be,{label:"网格列数",min:2,max:32,step:1,"model-value":R(t).config.trailGridCols,"onUpdate:modelValue":A[40]||(A[40]=P=>R(o)("trailGridCols",P))},null,8,["model-value"])]),A[105]||(A[105]=T("div",{class:"modifier-hint"},"每个粒子按资源比例生成一组同级拖尾骨骼;随机长度与宽度在粒子出生时确定,相同种子可稳定复现",-1))])):Te("",!0)]),T("div",I8,[T("label",R8,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[41]||(A[41]=P=>R(t).config.emitterFollow=P),disabled:R(t).config.streamBehavior==="loop"},null,8,P8),[[Et,R(t).config.emitterFollow]]),A[106]||(A[106]=T("span",{class:"switch-ui"},null,-1)),A[107]||(A[107]=T("span",null,"开启发射器跟随",-1))]),R(t).config.emitterFollow&&R(t).config.streamBehavior!=="loop"?(K(),Q("div",k8,[T("label",F8,[A[110]||(A[110]=T("span",null,"跟随模式",-1)),T("select",{value:R(t).config.emitterFollowMode,class:"inp",onChange:A[42]||(A[42]=P=>R(I)(P,R(t).config))},[A[108]||(A[108]=T("option",{value:"none"},"无",-1)),A[109]||(A[109]=T("option",{value:"path"},"跟随路径",-1)),R(g)||R(t).config.emitterFollowMode==="bone"?(K(),Q("option",B8,"选中的骨骼")):Te("",!0)],40,O8)]),R(t).config.emitterFollowMode==="path"?(K(),Q(Fe,{key:0},[T("label",L8,[A[112]||(A[112]=T("span",null,"跟随路径",-1)),de(T("select",{"onUpdate:modelValue":A[43]||(A[43]=P=>R(t).config.emitterFollowPathId=P),class:"inp"},[A[111]||(A[111]=T("option",{value:0},"无",-1)),(K(!0),Q(Fe,null,Dt(R(e).paths,P=>(K(),Q("option",{key:P.id,value:P.id},_e(P.name),9,D8))),128))],512),[[wt,R(t).config.emitterFollowPathId,void 0,{number:!0}]])]),T("label",N8,[A[114]||(A[114]=T("span",null,"发射器角度模式",-1)),de(T("select",{"onUpdate:modelValue":A[44]||(A[44]=P=>R(t).config.emitterAngleMode=P),class:"inp"},[...A[113]||(A[113]=[T("option",{value:"fixed"},"固定角度",-1),T("option",{value:"direction"},"跟随移动方向",-1)])],512),[[wt,R(t).config.emitterAngleMode]])]),A[120]||(A[120]=T("div",{class:"gravity-curve-title"},[T("span",null,"移动进度曲线 (0→1)")],-1)),be(qs,{modelValue:R(t).config.emitterFollowCurve,"onUpdate:modelValue":A[45]||(A[45]=P=>R(t).config.emitterFollowCurve=P),"default-value":R(O)},null,8,["modelValue","default-value"]),T("div",U8,[T("label",$8,[A[115]||(A[115]=T("span",null,"移动时长 (s)",-1)),de(T("input",{"onUpdate:modelValue":A[46]||(A[46]=P=>R(t).config.emitterFollowDuration=P),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,R(t).config.emitterFollowDuration,void 0,{number:!0}]])]),T("label",X8,[A[117]||(A[117]=T("span",null,"跟随空间",-1)),de(T("select",{"onUpdate:modelValue":A[47]||(A[47]=P=>R(t).config.emitterFollowSpace=P),class:"inp"},[...A[116]||(A[116]=[T("option",{value:"local"},"局部空间(GEN 移动)",-1),T("option",{value:"world"},"世界空间(粒子生成点移动)",-1)])],512),[[wt,R(t).config.emitterFollowSpace]])])]),T("label",V8,[A[119]||(A[119]=T("span",null,"移动方向",-1)),de(T("select",{"onUpdate:modelValue":A[48]||(A[48]=P=>R(t).config.emitterFollowDirection=P),class:"inp"},[...A[118]||(A[118]=[T("option",{value:"forward"},"正向(起点 → 终点)",-1),T("option",{value:"reverse"},"反向(终点 → 起点)",-1)])],512),[[wt,R(t).config.emitterFollowDirection]])]),be(Be,{label:"偏移起始点 (0-1)",min:0,max:1,step:.01,modelValue:R(t).config.emitterFollowOffset,"onUpdate:modelValue":A[49]||(A[49]=P=>R(t).config.emitterFollowOffset=P)},null,8,["modelValue"]),A[121]||(A[121]=T("div",{class:"modifier-hint"},"局部空间会移动整个发射器;世界空间只移动新粒子的生成点,已出生粒子留在世界位置。",-1))],64)):R(t).config.emitterFollowMode==="bone"?(K(),Q(Fe,{key:1},[R(v)?(K(),Q("div",Y8,[A[122]||(A[122]=At("跟随目标:",-1)),T("strong",null,_e(R(v).spine.name)+" / "+_e(R(v).boneName),1)])):(K(),Q("div",G8,"尚未绑定有效骨骼,请先在 Spine 层级树中选择骨骼。")),R(g)&&(!R(v)||R(g).spine.id!==R(v).spine.id||R(g).boneName!==R(v).boneName)?(K(),Q("button",{key:2,class:"bone-follow-rebind",onClick:A[50]||(A[50]=P=>R(F)(R(t).config))},_e(R(v)?"重新绑定":"绑定")+"当前选中骨骼:"+_e(R(g).spine.name)+" / "+_e(R(g).boneName),1)):Te("",!0),R(v)?(K(),Q(Fe,{key:3},[T("label",H8,[A[124]||(A[124]=T("span",null,"跟随空间",-1)),de(T("select",{"onUpdate:modelValue":A[51]||(A[51]=P=>R(t).config.emitterFollowSpace=P),class:"inp"},[...A[123]||(A[123]=[T("option",{value:"local"},"本地空间(随骨骼移动)",-1),T("option",{value:"world"},"世界空间(粒子生成后保持位置)",-1)])],512),[[wt,R(t).config.emitterFollowSpace]])]),T("div",j8,[T("label",W8,[A[125]||(A[125]=T("span",null,"位移偏移 X",-1)),de(T("input",{"onUpdate:modelValue":A[52]||(A[52]=P=>R(t).config.emitterFollowBoneOffsetX=P),type:"number",step:"1",class:"inp"},null,512),[[He,R(t).config.emitterFollowBoneOffsetX,void 0,{number:!0}]])]),T("label",z8,[A[126]||(A[126]=T("span",null,"位移偏移 Y",-1)),de(T("input",{"onUpdate:modelValue":A[53]||(A[53]=P=>R(t).config.emitterFollowBoneOffsetY=P),type:"number",step:"1",class:"inp"},null,512),[[He,R(t).config.emitterFollowBoneOffsetY,void 0,{number:!0}]])])]),T("div",q8,[T("label",K8,[A[127]||(A[127]=T("span",null,"旋转偏移",-1)),de(T("input",{"onUpdate:modelValue":A[54]||(A[54]=P=>R(t).config.emitterFollowBoneRotation=P),type:"number",step:"1",class:"inp"},null,512),[[He,R(t).config.emitterFollowBoneRotation,void 0,{number:!0}]])]),T("label",Z8,[A[128]||(A[128]=T("span",null,"缩放偏移 X",-1)),de(T("input",{"onUpdate:modelValue":A[55]||(A[55]=P=>R(t).config.emitterFollowBoneScaleX=P),type:"number",step:"0.05",class:"inp"},null,512),[[He,R(t).config.emitterFollowBoneScaleX,void 0,{number:!0}]])]),T("label",J8,[A[129]||(A[129]=T("span",null,"缩放偏移 Y",-1)),de(T("input",{"onUpdate:modelValue":A[56]||(A[56]=P=>R(t).config.emitterFollowBoneScaleY=P),type:"number",step:"0.05",class:"inp"},null,512),[[He,R(t).config.emitterFollowBoneScaleY,void 0,{number:!0}]])])]),A[130]||(A[130]=T("div",{class:"modifier-hint"},"发射器只跟随所选 Spine 骨骼的位置,不继承 Spine 的旋转或缩放;粒子变换使用粒子系统自身参数和上方偏移。",-1))],64)):Te("",!0)],64)):Te("",!0)])):Te("",!0)]),T("div",Q8,[T("label",e5,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[57]||(A[57]=P=>R(t).config.collision=P)},null,512),[[Et,R(t).config.collision]]),A[131]||(A[131]=T("span",{class:"switch-ui"},null,-1)),A[132]||(A[132]=T("span",null,"开启碰撞",-1))]),R(t).config.collision?(K(),Q("div",t5,[A[133]||(A[133]=T("div",{class:"collision-filter-title"},"参与的碰撞对象",-1)),T("div",i5,[(K(!0),Q(Fe,null,Dt(R(y),P=>(K(),Q("span",{key:P.id,class:Le(["collision-filter-tag",{disabled:!P.enabled}]),title:P.enabled?P.name:`${P.name}(碰撞体已禁用)`},[T("span",null,_e(P.name),1),T("button",{type:"button","aria-label":`清除碰撞对象 ${P.name}`,onClick:L=>R(S)(P.id)},"×",8,n5)],10,s5))),128)),T("button",{type:"button",class:Le(["collision-filter-add",{active:R(x)}]),disabled:R(_).length===0,title:R(_).length?"加入场景碰撞对象":"没有可加入的碰撞对象",onClick:A[58]||(A[58]=P=>x.value=!R(x))},"+",10,r5)]),R(y).length===0?(K(),Q("div",o5,"未选择碰撞对象,当前粒子不会发生碰撞")):Te("",!0),R(x)&&R(_).length?(K(),Q("div",a5,[(K(!0),Q(Fe,null,Dt(R(_),P=>(K(),Q("button",{key:P.id,type:"button",onClick:L=>R(C)(P.id)},[T("span",null,_e(P.name),1),T("small",null,_e(P.enabled?"可用":"已禁用"),1)],8,l5))),128))])):Te("",!0),A[134]||(A[134]=T("div",{class:"modifier-hint"},"只有已加入且启用的场景碰撞对象会参与当前粒子系统的碰撞",-1))])):Te("",!0)]),be(Be,{label:"阻尼",min:0,max:2,step:.05,modelValue:R(t).config.damping,"onUpdate:modelValue":A[59]||(A[59]=P=>R(t).config.damping=P)},null,8,["modelValue"])],512),[[vi,!R(b).mods]])]))}}),h5=Qt(c5,[["__scopeId","data-v-1798235e"]]),u5={class:"group"},d5={class:"caret"},f5={class:"group-body export-settings"},m5={class:"export-field"},p5={class:"export-field"},g5={class:"export-field"},v5={key:0,class:"export-help"},y5={class:"export-fps-row"},x5={class:"export-field export-fps-field"},b5={class:"export-checkbox"},w5={class:"export-switches"},S5={class:"switch-row export-switch"},_5={class:"switch-row export-switch"},T5={class:"switch-row export-switch export-switch-last"},M5=Jt({__name:"ExportSettingsSection",setup(s){const{exportSettings:e,collapsed:t,toggle:i,resetModule:n,normalizeExportFps:r,select:o}=br();return(a,c)=>(K(),Q("div",u5,[T("div",{class:"group-head",onClick:c[1]||(c[1]=l=>R(i)("export"))},[T("span",d5,_e(R(t).export?"▸":"▾"),1),c[11]||(c[11]=T("span",null,"导出设置",-1)),T("button",{class:"group-reset",title:"重置导出设置",onClick:c[0]||(c[0]=et(l=>R(n)("export"),["stop"]))},"重置")]),de(T("div",f5,[T("label",m5,[c[12]||(c[12]=T("span",null,"图片路径 (Spine Images Path)",-1)),de(T("input",{"onUpdate:modelValue":c[2]||(c[2]=l=>R(e).imagesPath=l),class:"inp export-input",type:"text",placeholder:"./images/"},null,512),[[He,R(e).imagesPath,void 0,{trim:!0}]])]),T("label",p5,[c[14]||(c[14]=T("span",null,"Spine 版本",-1)),de(T("select",{"onUpdate:modelValue":c[3]||(c[3]=l=>R(e).spineVersion=l),class:"inp export-input"},[...c[13]||(c[13]=[es('',5)])],512),[[wt,R(e).spineVersion]])]),T("label",g5,[c[16]||(c[16]=T("span",null,"关键帧插值曲线",-1)),de(T("select",{"onUpdate:modelValue":c[4]||(c[4]=l=>R(e).keyframeCurve=l),class:"inp export-input"},[...c[15]||(c[15]=[T("option",{value:"linear"},"线性 (Linear)",-1),T("option",{value:"bezier"},"平滑贝塞尔 (Smooth Bézier)",-1)])],512),[[wt,R(e).keyframeCurve]])]),c[25]||(c[25]=T("div",{class:"export-help"},"平滑贝塞尔会在误差允许范围内拟合连续运动;出生、死亡、附件切换和突变仍使用阶跃关键帧。",-1)),R(e).spineVersion==="3.8"?(K(),Q("div",v5,"Spine 3.8 不支持 4.x 的逐通道数组贝塞尔,导出时会转换为经过容差精简的分段线性关键帧。")):Te("",!0),T("div",y5,[T("label",x5,[c[17]||(c[17]=T("span",null,"导出 FPS",-1)),de(T("input",{"onUpdate:modelValue":c[5]||(c[5]=l=>R(e).fps=l),class:"inp export-input",type:"number",min:"1",max:"240",step:"1",onChange:c[6]||(c[6]=(...l)=>R(r)&&R(r)(...l))},null,544),[[He,R(e).fps,void 0,{number:!0}]])]),T("label",b5,[de(T("input",{"onUpdate:modelValue":c[7]||(c[7]=l=>R(e).omitFps=l),type:"checkbox"},null,512),[[Et,R(e).omitFps]]),c[18]||(c[18]=At("不写 fps",-1))])]),c[26]||(c[26]=T("div",{class:"export-help"},"修改 FPS 时保持动画实际秒数不变;“不写 fps”只省略 Spine 的 fps 元数据。",-1)),T("div",w5,[T("label",S5,[de(T("input",{"onUpdate:modelValue":c[8]||(c[8]=l=>R(e).integerFrameAlignment=l),type:"checkbox"},null,512),[[Et,R(e).integerFrameAlignment]]),c[19]||(c[19]=T("span",{class:"switch-ui"},null,-1)),c[20]||(c[20]=T("span",null,"整数帧对齐",-1))]),T("label",_5,[de(T("input",{"onUpdate:modelValue":c[9]||(c[9]=l=>R(e).bonePool=l),type:"checkbox"},null,512),[[Et,R(e).bonePool]]),c[21]||(c[21]=T("span",{class:"switch-ui"},null,-1)),c[22]||(c[22]=T("span",null,"骨骼对象池",-1))]),T("label",T5,[de(T("input",{"onUpdate:modelValue":c[10]||(c[10]=l=>R(e).excludeEmptyAnimations=l),type:"checkbox"},null,512),[[Et,R(e).excludeEmptyAnimations]]),c[23]||(c[23]=T("span",{class:"switch-ui"},null,-1)),c[24]||(c[24]=T("span",null,"排除无内容动画",-1))])])],512),[[vi,!R(t).export]])]))}}),C5=Qt(M5,[["__scopeId","data-v-04462c7a"]]),A5={class:"spine-export-actions"},E5=["disabled","title"],I5=["disabled"],R5=["disabled","title"],P5={key:0},k5=["href"],F5=["href"],O5=Jt({__name:"ParticleExportFooter",setup(s){const{exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:c,connectorReady:l,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:p,exportSpineProject:m,exportSpineImages:g}=br();return(v,x)=>(K(),Q(Fe,null,[T("div",A5,[T("button",{type:"button",class:"export-spine-json",disabled:R(t),title:R(t)?"正在重新计算并烘焙动画":`导出 Spine ${R(e).spineVersion} JSON`,onClick:x[0]||(x[0]=(...y)=>R(p)&&R(p)(...y))},_e(R(t)&&R(i)==="json"?"正在准备导出…":"导出Spine Json"),9,E5),T("button",{type:"button",class:"export-spine-images",disabled:R(t),title:"单独下载当前粒子系统使用的图片 ZIP",onClick:x[1]||(x[1]=(...y)=>R(g)&&R(g)(...y))},_e(R(t)&&R(i)==="images"?"正在整理图片…":"导出 images 包"),9,I5),T("button",{type:"button",class:"export-spine-project",disabled:R(t)||!R(l),title:R(d),onClick:x[2]||(x[2]=(...y)=>R(m)&&R(m)(...y))},[T("span",null,_e(R(t)&&R(i)==="spine"?"正在生成工程…":"导出 .spine 包"),1),!R(t)&&R(u)?(K(),Q("small",P5,_e(R(u)),1)):Te("",!0)],8,R5)]),T("div",{class:Le(["connector-status",R(c)])},[x[5]||(x[5]=T("span",{class:"connector-dot"},null,-1)),At(_e(R(a))+" ",1),R(h)?(K(),Q("a",{key:0,href:R(h),target:"_blank",rel:"noopener",title:"在本机连接器中授权当前网站"},"授权当前网站",8,k5)):Te("",!0),T("button",{type:"button",title:"重新检测连接器",onClick:x[3]||(x[3]=(...y)=>R(f)&&R(f)(...y))},"刷新")],2),R(n)?(K(),Q("div",{key:0,class:Le(["export-message",{error:R(r)}])},[At(_e(R(n))+" ",1),R(o)?(K(),Q("a",{key:0,href:R(o),target:"_blank",rel:"noopener",onClick:x[4]||(x[4]=y=>o.value="")},"授权当前网站",8,F5)):Te("",!0)],2)):Te("",!0)],64))}}),B5=Qt(O5,[["__scopeId","data-v-7ff40afe"]]),L5={class:"panel"},D5={class:"panel-scroll"},N5=Jt({__name:"ParticlePanel",setup(s){const{activeObjectType:e,sys:t}=BO();return(i,n)=>(K(),Q("div",L5,[n[0]||(n[0]=T("div",{class:"panel-header"},[T("span",null,"Spine粒子编辑器-Yeomai")],-1)),T("div",D5,[be(GO),be(gD),R(e)==="particle"&&R(t)?(K(),Q(Fe,{key:0},[be(iN),be(MN),be(I4),be(h5),be(C5)],64)):Te("",!0)]),be(B5)]))}}),U5=Qt(N5,[["__scopeId","data-v-283ef8eb"]]),$5={class:"timeline"},X5={class:"tl-controls"},V5=["title"],Y5={class:"tl-range",title:"自定义播放起始帧"},G5=["max","onKeydown"],H5={class:"tl-range",title:"自定义播放结束帧"},j5=["min","max","onKeydown"],W5=["title"],z5={class:"tl-frame"},q5=["disabled"],K5=["onClick"],Z5={key:0},J5={class:"tl-animation-editor"},Q5={key:0,class:"tl-animation-error"},eU={class:"tl-animation-actions"},tU=["disabled"],iU={key:1,class:"tl-animation-hint"},sU={class:"tl-anim tl-spine-preview"},nU=["value","disabled"],rU={value:""},oU=["value"],aU={class:"tl-zoom"},lU={class:"tl-ticks"},cU={class:"tl-ticklabel"},hU={class:"tl-lanes"},uU=["onPointerdown"],dU={class:"lane-name"},fU=["onPointerdown"],mU=["onPointerdown"],pU=["onPointerdown"],gU={class:"lane-name"},vU={key:0,class:"tl-empty"},yU=Jt({__name:"Timeline",setup(s){const e=ao(),t=Ge(null),i=Ge(null),n=Ge(!1),r=Ge("animation"),o=Ge("");Ma(()=>{(!Array.isArray(e.timeline.animations)||!e.timeline.animations.length)&&(e.timeline.animations=["animation"]),e.timeline.animations.includes(e.timeline.animation)||(e.timeline.animation=e.timeline.animations[0]);for(const H of e.systems)(!H.animation||!e.timeline.animations.includes(H.animation))&&(H.animation=e.timeline.animations[0])});const a=qe(()=>e.systems.find(H=>H.id===e.activeId)||null),c=qe(()=>{const H=a.value;return!H||!V(H)?null:tb(H.config,m.value)});function l(){a.value&&(n.value=!n.value,r.value=a.value.animation,o.value="")}function h(H){const G=a.value;G&&(e.setSystemAnimation(G.id,H),r.value=H,o.value="")}function u(){const H=e.addAnimation();r.value=H,o.value=""}function d(){var z;const H=((z=a.value)==null?void 0:z.animation)||e.timeline.animation,G=r.value.trim();if(!G){o.value="动画名称不能为空";return}if(G!==H&&e.timeline.animations.includes(G)){o.value="动画名称不能重复";return}if(!e.renameAnimation(H,G)){o.value="无法修改动画名称";return}r.value=G,o.value=""}function f(){var z,ie;const H=((z=a.value)==null?void 0:z.animation)||e.timeline.animation;if(!e.removeAnimation(H)){o.value="至少需要保留一个动画";return}const G=((ie=a.value)==null?void 0:ie.animation)||e.timeline.animation;r.value=G,o.value=""}function p(H){var G;(G=i.value)!=null&&G.contains(H.target)||(n.value=!1)}Vn(()=>document.addEventListener("pointerdown",p)),pl(()=>document.removeEventListener("pointerdown",p));const m=qe(()=>Math.max(1,e.timeline.fps||30)),g=Ge(120),v=Ge({}),x=Ge({}),y=Ge({}),_=Ge({}),C=Ge(String(e.timeline.playbackStart)),S=Ge(String(e.timeline.playbackEnd));Xi(()=>e.timeline.playbackStart,H=>{C.value=String(H)}),Xi(()=>e.timeline.playbackEnd,H=>{S.value=String(H)});const b=qe(()=>e.timeline.totalFrames),M=qe(()=>g.value<=30?"放大":g.value>=300?"缩小":"适中"),I=qe(()=>e.spines.filter(H=>H.selectedAnimation&&H.animations.some(G=>G.name===H.selectedAnimation&&G.duration>0))),F=qe(()=>(e.activeObjectType==="spine"?e.spines.find(G=>G.id===e.activeObjectId&&G.animations.length):null)||e.spines.find(G=>G.animations.length)||null);function E(H){const G=F.value;G&&(G.selectedAnimation=H.target.value,e.recalcTotalFrames(),e.timeline.frame=0)}function k(){e.setPlaybackStart(Number(C.value)),C.value=String(e.timeline.playbackStart)}function O(){e.setPlaybackEnd(Number(S.value)),S.value=String(e.timeline.playbackEnd)}function D(){const H=c.value;H&&(e.setPlaybackEnd(H.end),e.setPlaybackStart(H.start))}function $(){var G;const H=((G=t.value)==null?void 0:G.clientWidth)||600;return g.value/H}const N=qe(()=>{const H=[],G=g.value;let z=1;g.value<=10?z=1:g.value<=50?z=5:g.value<=200?z=10:g.value<=500?z=50:z=100;for(let ie=0;ie<=G;ie+=z)H.push({f:ie,px:ie/$()});return H}),U=qe(()=>e.timeline.frame/$());function A(H){const G=H.config;return(v.value[H.id]??Math.max(0,Number(G.delay)||0))*m.value/$()}function P(H){const G=H.config,z=Math.max(0,Number(G.lifeMin)||0),ie=Math.max(0,Number(G.lifeMax)||0);return G.lifeMode==="fixed"?z:Math.max(z,ie)}function L(H){return X(H)}function B(H){if(H.config.mode!=="stream")return 0;if(H.config.streamBehavior==="loop"){const z=H.config;return(y.value[H.id]??lr(z,m.value).loop)/$()}return(x.value[H.id]??Math.max(1/m.value,Number(H.config.duration)||1))*m.value/$()}function X(H){const G=H.config;return G.mode==="stream"&&G.streamBehavior==="loop"?q(H)+B(H)+W(H):B(H)+P(H)*m.value/$()}function V(H){const G=H.config;return G.mode==="stream"&&G.streamBehavior==="loop"}function q(H){return V(H)?lr(H.config,m.value).start/$():0}function W(H){return V(H)?lr(H.config,m.value).end/$():0}function ne(H){var G;return((G=H.animations.find(z=>z.name===H.selectedAnimation))==null?void 0:G.duration)||0}function re(H){return(_.value[H.id]??Math.max(0,Number(H.timeOffset)||0))*m.value/$()}function le(H){return ne(H)*m.value/$()}function ue(H){const G=H.deltaY<0?.8:1.25;let z=g.value*G;z=Math.min(2e3,Math.max(10,z)),g.value=Math.round(z)}function ae(H){const G=t.value,z=fe=>{const te=G.getBoundingClientRect(),oe=Math.floor((fe.clientX-te.left)/te.width*g.value);e.timeline.frame=Math.max(0,Math.min(oe,b.value-1))};z(H);const ie=()=>{window.removeEventListener("pointermove",z),window.removeEventListener("pointerup",ie)};window.addEventListener("pointermove",z),window.addEventListener("pointerup",ie)}function xe(H,G){H.stopPropagation();const z=H.clientX,ie=Math.max(0,Number(G.config.delay)||0),fe=$()/m.value,te=ye=>{const we=(ye.clientX-z)*fe,Me=Math.max(0,Math.min(ie+we,600));v.value[G.id]=Math.round(Me*m.value)/m.value},oe=ye=>{window.removeEventListener("pointermove",te),window.removeEventListener("pointerup",ce),window.removeEventListener("pointercancel",Ce);const we=v.value[G.id];delete v.value[G.id],ye&&we!=null&&we!==ie&&(G.config.delay=we)},ce=()=>oe(!0),Ce=()=>oe(!1);window.addEventListener("pointermove",te),window.addEventListener("pointerup",ce),window.addEventListener("pointercancel",Ce)}function Y(H,G){var Xe;H.stopPropagation();const z=V(G),ie=Math.max(0,Number(G.config.duration)||0),fe=lr(G.config,m.value).loop,te=$()/m.value,oe=((Xe=H.currentTarget.closest(".lane-bar"))==null?void 0:Xe.getBoundingClientRect().left)??H.clientX,ce=q(G);let Ce=!1;const ye=pe=>{if(Ce=!0,z){const Ke=Math.min(1800,Math.max(1,Math.round((pe.clientX-oe-ce)/$())));y.value[G.id]=Ke}else{const Ke=Math.max(1/m.value,Math.min((pe.clientX-oe)*te,600));x.value[G.id]=Math.round(Ke*m.value)/m.value}},we=pe=>{window.removeEventListener("pointermove",ye),window.removeEventListener("pointerup",Me),window.removeEventListener("pointercancel",ve);const Ke=x.value[G.id],Ze=y.value[G.id];delete x.value[G.id],delete y.value[G.id],pe&&Ce&&z&&Ze!=null&&Ze!==fe?G.config.loopDurationFrames=Ze:pe&&Ce&&!z&&Ke!=null&&Ke!==ie&&(G.config.duration=Ke)},Me=()=>we(!0),ve=()=>we(!1);window.addEventListener("pointermove",ye),window.addEventListener("pointerup",Me),window.addEventListener("pointercancel",ve)}function j(H,G){H.stopPropagation();const z=H.clientX,ie=Math.max(0,Number(G.timeOffset)||0),fe=$()/m.value,te=ye=>{const we=Math.max(0,Math.min(ie+(ye.clientX-z)*fe,600));_.value[G.id]=Math.round(we*m.value)/m.value},oe=ye=>{window.removeEventListener("pointermove",te),window.removeEventListener("pointerup",ce),window.removeEventListener("pointercancel",Ce);const we=_.value[G.id];delete _.value[G.id],ye&&we!=null&&we!==ie&&(G.timeOffset=we,e.recalcTotalFrames())},ce=()=>oe(!0),Ce=()=>oe(!1);window.addEventListener("pointermove",te),window.addEventListener("pointerup",ce),window.addEventListener("pointercancel",Ce)}return(H,G)=>{var z,ie,fe;return K(),Q("div",$5,[T("div",X5,[T("button",{class:Le(["tl-btn",{on:R(e).timeline.playing}]),onClick:G[0]||(G[0]=te=>R(e).togglePlay()),title:R(e).timeline.playing?"暂停 (D)":"播放 (D)"},_e(R(e).timeline.playing?"❚❚":"▶"),11,V5),T("button",{class:"tl-btn",onClick:G[1]||(G[1]=te=>R(e).toStart()),title:"回到第一帧 (S)"},"⏮"),T("button",{class:"tl-btn",onClick:G[2]||(G[2]=te=>R(e).previousFrame()),title:"前一帧"},"◀"),T("button",{class:"tl-btn",onClick:G[3]||(G[3]=te=>R(e).nextFrame()),title:"后一帧"},"▶"),T("button",{class:"tl-btn",onClick:G[4]||(G[4]=te=>R(e).toEnd()),title:"移动到最后一帧"},"⏭"),T("button",{class:Le(["tl-btn",{on:R(e).timeline.loop}]),onClick:G[5]||(G[5]=te=>R(e).toggleLoop()),title:"循环"},"⟳",2),T("label",Y5,[G[10]||(G[10]=T("span",null,"A",-1)),de(T("input",{"onUpdate:modelValue":G[6]||(G[6]=te=>C.value=te),type:"number",min:"0",max:Math.max(0,R(e).timeline.playbackEnd-1),"aria-label":"播放起始帧",onChange:k,onKeydown:zr(et(k,["prevent"]),["enter"])},null,40,G5),[[He,C.value]])]),T("label",H5,[G[11]||(G[11]=T("span",null,"B",-1)),de(T("input",{"onUpdate:modelValue":G[7]||(G[7]=te=>S.value=te),type:"number",min:R(e).timeline.playbackStart+1,max:Math.max(1,R(e).timeline.totalFrames-1),"aria-label":"播放结束帧",onChange:O,onKeydown:zr(et(O,["prevent"]),["enter"])},null,40,j5),[[He,S.value]])]),c.value?(K(),Q("button",{key:0,class:"tl-loop-range",title:`设为闭合自循环范围 ${c.value.start}–${c.value.end}f`,onClick:D},"循环段",8,W5)):Te("",!0),T("span",z5,[G[12]||(G[12]=At("帧 ",-1)),T("b",null,_e(R(e).timeline.frame),1),G[13]||(G[13]=At(" / ",-1)),T("b",null,_e(Math.max(0,R(e).timeline.totalFrames-1)),1)]),G[18]||(G[18]=T("span",{class:"tl-legend"},[T("i",{class:"legend-emission"}),At("持续发射 "),T("i",{class:"legend-life"}),At("粒子存在 "),T("i",{class:"legend-spine"}),At("Spine 动画")],-1)),T("div",{ref_key:"animationMenuRef",ref:i,class:"tl-anim tl-owner-animation"},[G[16]||(G[16]=T("span",null,"所属动画",-1)),T("button",{class:"tl-animation-trigger",disabled:!a.value,title:"设置当前粒子系统所属的动画",onClick:et(l,["stop"])},[T("span",null,_e(((z=a.value)==null?void 0:z.animation)||R(e).timeline.animation),1),G[14]||(G[14]=T("i",null,"⌄",-1))],8,q5),n.value?(K(),Q("div",{key:0,class:"tl-animation-menu",onPointerdown:G[9]||(G[9]=et(()=>{},["stop"]))},[G[15]||(G[15]=T("div",{class:"tl-animation-menu-title"},"选择所属动画",-1)),(K(!0),Q(Fe,null,Dt(R(e).timeline.animations,te=>{var oe,ce;return K(),Q("button",{key:te,class:Le(["tl-animation-option",{on:((oe=a.value)==null?void 0:oe.animation)===te}]),onClick:Ce=>h(te)},[T("span",null,_e(te),1),((ce=a.value)==null?void 0:ce.animation)===te?(K(),Q("i",Z5,"✓")):Te("",!0)],10,K5)}),128)),T("div",J5,[de(T("input",{"onUpdate:modelValue":G[8]||(G[8]=te=>r.value=te),class:"tl-animation-name",maxlength:"64","aria-label":"动画名称",onKeydown:zr(d,["enter"])},null,544),[[He,r.value]]),T("button",{title:"重命名当前动画",onClick:d},"重命名")]),o.value?(K(),Q("div",Q5,_e(o.value),1)):Te("",!0),T("div",eU,[T("button",{onClick:u},"+ 新增"),T("button",{disabled:R(e).timeline.animations.length<=1,onClick:f},"删除",8,tU)]),R(e).timeline.animations.length<=1?(K(),Q("div",iU,"至少需要保留一个动画")):Te("",!0)],32)):Te("",!0)],512),T("label",sU,[G[17]||(G[17]=At("Spine 预览动画 ",-1)),T("select",{class:"tl-sel",value:((ie=F.value)==null?void 0:ie.selectedAnimation)||"",disabled:!F.value,onChange:E},[T("option",rU,_e(F.value?"无":"无可用 Spine 动画"),1),(K(!0),Q(Fe,null,Dt(((fe=F.value)==null?void 0:fe.animations)||[],te=>(K(),Q("option",{key:te.name,value:te.name},_e(te.name)+"("+_e(te.duration.toFixed(2))+"s) ",9,oU))),128))],40,nU)]),T("span",aU,_e(M.value),1)]),T("div",{class:"tl-viewport",ref_key:"vpRef",ref:t,onWheel:et(ue,["prevent"]),onPointerdown:ae},[T("div",lU,[(K(!0),Q(Fe,null,Dt(N.value,te=>(K(),Q("div",{key:te.f,class:"tl-tickline",style:di({left:te.px+"px"})},[T("span",cU,_e(te.f)+"f",1)],4))),128))]),T("div",{class:"tl-playhead",style:di({left:U.value+"px"})},null,4),T("div",hU,[(K(!0),Q(Fe,null,Dt(R(e).systems,(te,oe)=>(K(),Q("div",{key:te.id,class:"tl-lane"},[G[19]||(G[19]=T("span",{class:"lane-ico"},"●",-1)),T("div",{class:"lane-bar",style:di({left:A(te)+"px",width:L(te)+"px"}),onPointerdown:et(ce=>xe(ce,te),["stop"])},[T("span",dU,_e(te.config.name||"系统 "+(oe+1)),1),T("span",{class:Le(["bar-life",{"loop-life":V(te)}]),style:di({width:X(te)+"px"})},null,6),V(te)?(K(),Q(Fe,{key:0},[q(te)?(K(),Q("span",{key:0,class:"bar-loop-transition bar-loop-start",style:di({width:q(te)+"px"})},null,4)):Te("",!0),T("span",{class:"bar-emission bar-loop",style:di({left:q(te)+"px",width:B(te)+"px"})},[T("span",{class:"bar-handle",title:"拖动循环段时长",onPointerdown:et(ce=>Y(ce,te),["stop"])},null,40,fU)],4),W(te)?(K(),Q("span",{key:1,class:"bar-loop-transition bar-loop-end",style:di({left:q(te)+B(te)+"px",width:W(te)+"px"})},null,4)):Te("",!0)],64)):te.config.mode==="stream"?(K(),Q("span",{key:1,class:"bar-emission",style:di({width:B(te)+"px"})},[T("span",{class:"bar-handle",title:"拖动持续发射时长",onPointerdown:et(ce=>Y(ce,te),["stop"])},null,40,mU)],4)):Te("",!0)],44,uU)]))),128)),(K(!0),Q(Fe,null,Dt(I.value,te=>(K(),Q("div",{key:`spine-${te.id}`,class:"tl-lane spine-lane"},[G[20]||(G[20]=T("span",{class:"lane-ico spine-ico"},"◆",-1)),T("div",{class:"spine-bar",style:di({left:re(te)+"px",width:le(te)+"px"}),title:"拖动调整动画开始时间",onPointerdown:et(oe=>j(oe,te),["stop"])},[T("span",gU,_e(te.name)+" · "+_e(te.selectedAnimation),1)],44,pU)]))),128)),!R(e).systems.length&&!I.value.length?(K(),Q("div",vU,"暂无可显示的动画数据")):Te("",!0)])],544)])}}}),xU=Qt(yU,[["__scopeId","data-v-8d9981a9"]]),bU={class:"transfer-heading"},wU={key:0},SU={class:"transfer-detail"},_U=Jt({__name:"TransferProgressOverlay",setup(s){const e=Ge(null);return Xi(()=>qt.visible,async t=>{var i;t&&(await Uh(),(i=e.value)==null||i.focus({preventScroll:!0}))},{flush:"post"}),(t,i)=>(K(),Mt(wT,{name:"transfer-fade"},{default:$h(()=>[R(qt).visible?(K(),Q("div",{key:0,ref_key:"overlayElement",ref:e,class:"transfer-overlay",role:"dialog","aria-modal":"true","aria-live":"polite",tabindex:"-1",onPointerdown:i[0]||(i[0]=et(()=>{},["stop","prevent"])),onPointerup:i[1]||(i[1]=et(()=>{},["stop","prevent"])),onClick:i[2]||(i[2]=et(()=>{},["stop","prevent"])),onDblclick:i[3]||(i[3]=et(()=>{},["stop","prevent"])),onContextmenu:i[4]||(i[4]=et(()=>{},["stop","prevent"])),onWheel:i[5]||(i[5]=et(()=>{},["stop","prevent"])),onKeydown:i[6]||(i[6]=et(()=>{},["stop","prevent"]))},[T("div",{class:Le(["transfer-dialog",{failed:R(qt).failed}])},[T("div",bU,[T("span",null,_e(R(qt).title),1),R(qt).indeterminate?Te("",!0):(K(),Q("strong",wU,_e(Math.round(R(qt).progress))+"%",1))]),T("div",{class:Le(["transfer-track",{indeterminate:R(qt).indeterminate}])},[T("div",{class:"transfer-bar",style:di(R(qt).indeterminate?void 0:{width:`${R(qt).progress}%`})},null,4)],2),T("div",SU,_e(R(qt).detail),1)],2)],544)):Te("",!0)]),_:1}))}}),TU=Qt(_U,[["__scopeId","data-v-592b922e"]]),MU=["inert","aria-hidden"],CU={class:"right"},AU={class:"stage-area"},EU=Jt({__name:"App",setup(s){const e=ao();zI(e);const t=Ge(360),i=Ge(180);function n(o){o.preventDefault();const a=l=>{const h=e.settings.parameterPanelOnRight?window.innerWidth-l.clientX:l.clientX,u=Math.max(240,Math.min(h,window.innerWidth-200));t.value=u},c=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",c)};window.addEventListener("pointermove",a),window.addEventListener("pointerup",c)}function r(o){o.preventDefault();const a=o.clientY,c=i.value,l=u=>{const d=Math.max(80,Math.min(c+(a-u.clientY),window.innerHeight-200));i.value=d},h=()=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",h)};window.addEventListener("pointermove",l),window.addEventListener("pointerup",h)}return(o,a)=>(K(),Q(Fe,null,[T("div",{class:Le(["layout",{"panel-right":R(e).settings.parameterPanelOnRight}]),inert:R(qt).visible?!0:void 0,"aria-hidden":R(qt).visible?"true":void 0},[T("div",{class:"parameter-panel",style:di({width:t.value+"px"})},[be(U5)],4),T("div",{class:"resizer-col",onPointerdown:n},null,32),T("div",CU,[T("div",AU,[be(PF)]),T("div",{class:"resizer-row",onPointerdown:r,title:"拖动调整时间轴高度"},null,32),T("div",{class:"timeline-area",style:di({height:i.value+"px"})},[be(xU)],4)])],10,MU),be(TU)],64))}}),IU=Qt(EU,[["__scopeId","data-v-42c4fa00"]]);qT(IU).use(JT()).mount("#app");export{Kv as $,tn as A,Th as B,St as C,Si as D,Pe as E,$i as F,an as G,tt as H,pt as I,rS as J,zi as K,ns as L,gs as M,gr as N,cu as O,en as P,al as Q,ta as R,Cs as S,u3 as T,Ye as U,Gv as V,Is as W,nX as X,lO as Y,dl as Z,op as _,ze as a,ym as a$,qv as a0,Nw as a1,vp as a2,iX as a3,bh as a4,Ha as a5,w3 as a6,ja as a7,hu as a8,mm as a9,Cm as aA,Am as aB,mc as aC,Jn as aD,Rc as aE,pm as aF,Vw as aG,Yt as aH,Bw as aI,z$ as aJ,qo as aK,zv as aL,Ee as aM,Ue as aN,vm as aO,Pc as aP,jw as aQ,gm as aR,Gw as aS,Hw as aT,uu as aU,qw as aV,kc as aW,Jw as aX,Ww as aY,Kw as aZ,Qw as a_,ho as aa,yp as ab,xp as ac,jv as ad,Tl as ae,Ml as af,_l as ag,co as ah,En as ai,K$ as aj,Xw as ak,b3 as al,sa as am,dr as an,Sp as ao,nS as ap,y3 as aq,ul as ar,Wi as as,Wv as at,Q$ as au,la as av,Mm as aw,Em as ax,Im as ay,Rm as az,Qo as b,$n as b$,_h as b0,zw as b1,xr as b2,Zw as b3,bp as b4,h3 as b5,iS as b6,sS as b7,wp as b8,on as b9,eS as bA,_p as bB,lu as bC,oS as bD,xm as bE,ci as bF,l3 as bG,f3 as bH,Tw as bI,_w as bJ,Z$ as bK,Rt as bL,ca as bM,aS as bN,hS as bO,uS as bP,dS as bQ,lS as bR,cS as bS,v3 as bT,Tp as bU,xt as bV,Tm as bW,Yw as bX,Cw as bY,Aw as bZ,Ew as b_,c3 as ba,q$ as bb,Qe as bc,$w as bd,Uw as be,Lw as bf,Dw as bg,Qr as bh,wh as bi,x3 as bj,Iw as bk,Rw as bl,Ni as bm,Pw as bn,ia as bo,bi as bp,Mw as bq,Sh as br,kw as bs,Fw as bt,Ow as bu,Zv as bv,Sm as bw,Xr as bx,tS as by,wm as bz,ea as c,J$ as c0,p3 as c1,g3 as c2,m3 as c3,je as d,Ne as e,eX as f,Je as g,mi as h,Qc as i,Ki as j,Ot as k,De as l,ks as m,Bt as n,Qm as o,Zt as p,ll as q,Kn as r,ke as s,Hx as t,rp as u,nh as v,bm as w,Ur as x,Hv as y,_m as z}; +`;class tw extends Kn{constructor(e){super(e),this.shaderGenerator=new Hx(bP,wP),this.geometryClass=xP,this.vertexSize=7}packInterleavedGeometry(e,t,i,n,r){const{uint32View:o,float32View:a}=t,c=n/this.vertexSize,l=e.uvs,h=e.indices,u=e.vertexData,d=e._texture.baseTexture._batchLocation,f=Math.min(e.worldAlpha,1),p=St.shared.setValue(e._tintRGB).toPremultiplied(f,!0),m=St.shared.setValue(e._darkTintRGB).premultiply(f,!0).toPremultiplied(1,!1);for(let g=0;g0){let o=function(l){return Promise.all(l.map(h=>Promise.resolve(h).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));n=o(t.map(l=>{if(l=CP(l),l in Ev)return;Ev[l]=!0;const h=l.endsWith(".css"),u=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=h?"stylesheet":MP,h||(d.as="script"),d.crossOrigin="",d.href=l,c&&d.setAttribute("nonce",c),document.head.appendChild(d),h)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return n.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};async function sw(){const[s,e]=await Promise.all([Iv(()=>import("./index-Cz2cACyM.js"),[]),Iv(()=>import("./index-D13mN481.js"),__vite__mapDeps([0,1]))]);return{core:s,pixi:e}}async function AP(s,e,t){const{core:i,pixi:n}=await sw(),r=new i.TextureAtlas(e);return dp(r,t,n.SpineTexture),{skeletonData:new i.SkeletonJson(new i.AtlasAttachmentLoader(r)).readSkeletonData(s),SpineClass:n.Spine}}async function EP(s,e,t){const{core:i,pixi:n}=await sw(),r=new i.TextureAtlas(e);return dp(r,t,n.SpineTexture),{skeletonData:new i.SkeletonBinary(new i.AtlasAttachmentLoader(r)).readSkeletonData(s),SpineClass:n.Spine}}function sr(s,e,t){const i=Number(s[e]);return Number.isFinite(i)?i:t}function qi(s,e,t,i){s[e]==null&&(s[e]=sr(s,t,i))}function fp(s,e,t){if(typeof s.curve!="number")return;const i=sr(s,"time",0),r=sr(e,"time",0)-i,o=s.curve,a=sr(s,"c2",0),c=sr(s,"c3",1),l=sr(s,"c4",1);s.curve=t.flatMap(([h,u])=>[i+r*o,h+(u-h)*a,i+r*c,h+(u-h)*l]),delete s.c2,delete s.c3,delete s.c4}function hr(s,e){if(Array.isArray(s))for(let t=0;t[sr(i,r,o),sr(n,r,o)]))}}function IP(s){if(Array.isArray(s))for(let e=0;eNumber.parseInt(i.slice(r,r+2),16)/255);return e?n:n.slice(0,3)}function Rv(s,e){if(Array.isArray(s))for(let t=0;t[a,o[c]]))}}function RP(s){for(const e of s.bones||[])e.inherit==null&&e.transform!=null&&(e.inherit=e.transform);for(const e of s.transform||[])qi(e,"mixRotate","rotateMix",1),qi(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX),qi(e,"mixScaleX","scaleMix",1),e.mixScaleY==null&&(e.mixScaleY=e.mixScaleX),qi(e,"mixShearY","shearMix",1);for(const e of s.path||[])qi(e,"mixRotate","rotateMix",1),qi(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX)}function PP(s){for(const e of s.skins||[])for(const t of Object.values(e.attachments||{}))for(const i of Object.values(t||{}))i.parent!=null&&i.timelines==null&&i.deform!=null&&(i.timelines=i.deform)}function kP(s){for(const e of Object.values(s.slots||{}))e.color&&!e.rgba&&(e.rgba=e.color,delete e.color),e.twoColor&&!e.rgba2&&(e.rgba2=e.twoColor,delete e.twoColor),Rv(e.rgba,!1),Rv(e.rgba2,!0)}function FP(s){for(const e of Object.values(s.bones||{})){for(const t of e.rotate||[])qi(t,"value","angle",0);hr(e.rotate,[{key:"value",fallback:0}]),hr(e.translate,[{key:"x",fallback:0},{key:"y",fallback:0}]),hr(e.scale,[{key:"x",fallback:1},{key:"y",fallback:1}]),hr(e.shear,[{key:"x",fallback:0},{key:"y",fallback:0}])}}function OP(s){for(const e of Object.values(s.ik||{}))hr(e,[{key:"mix",fallback:1},{key:"softness",fallback:0}])}function BP(s){for(const e of Object.values(s.transform||{})){for(const t of e)qi(t,"mixRotate","rotateMix",1),qi(t,"mixX","translateMix",1),t.mixY==null&&(t.mixY=t.mixX),qi(t,"mixScaleX","scaleMix",1),t.mixScaleY==null&&(t.mixScaleY=t.mixScaleX),qi(t,"mixShearY","shearMix",1);hr(e,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1},{key:"mixScaleX",fallback:1},{key:"mixScaleY",fallback:1},{key:"mixShearY",fallback:1}])}}function LP(s){for(const e of Object.values(s.path||{})){for(const i of["position","spacing"]){const n=e[i];for(const r of n||[])qi(r,"value",i,0);hr(n,[{key:"value",fallback:0}])}const t=e.mix;for(const i of t||[])qi(i,"mixRotate","rotateMix",1),qi(i,"mixX","translateMix",1),i.mixY==null&&(i.mixY=i.mixX);hr(t,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1}])}}function DP(s){if(!s.deform)return;const e=s.attachments||(s.attachments={});for(const[t,i]of Object.entries(s.deform)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(i)){const a=n[r]||(n[r]={});for(const[c,l]of Object.entries(o)){const h=a[c]||(a[c]={});h.deform=l,IP(l)}}}delete s.deform}function nw(s){RP(s),PP(s);for(const e of Object.values(s.animations||{}))kP(e),FP(e),OP(e),BP(e),LP(e),DP(e),!e.drawOrder&&e.draworder&&(e.drawOrder=e.draworder);return s}function NP(s){return s.replace(/\\/g,"/").split("/").pop()||s}async function UP(s){const e=await Promise.all(s.map(async t=>{const i=URL.createObjectURL(t);try{return[NP(t.name).toLowerCase(),await ze.fromURL(i)]}finally{URL.revokeObjectURL(i)}}));return new Map(e)}function $P(s){const e=new Map;return s.bones.map(t=>{var r;const i=((r=t.parent)==null?void 0:r.name)||null,n=i?(e.get(i)||0)+1:0;return e.set(t.name,n),{name:t.name,parent:i,depth:n}})}async function rw(s,e,t){var o;if(!/\.(json|skel)$/i.test(s.name))throw new Error("Spine 数据仅支持 .json 或 .skel");if(!/\.atlas$/i.test(e.name))throw new Error("图集文件仅支持 .atlas");if(!t.length)throw new Error("请至少选择一张纹理图片");const i=await e.text(),n=await UP(t),r=[...n.values()];try{let a,c,l=null,h;if(/\.skel$/i.test(s.name)){const u=await s.arrayBuffer();try{({skeletonData:a,SpineClass:c}=await EP(u,i,n)),h="4.3"}catch(d){try{({skeletonData:a,SpineClass:c}=TP(u,i,n)),h="4.2"}catch(f){const p=d instanceof Error?d.message:String(d),m=f instanceof Error?f.message:String(f);throw new Error(`Spine 二进制解析失败(4.3:${p};旧版:${m})`)}}l=ah(a.version)}else{let u;try{u=JSON.parse(await s.text())}catch{throw new Error("Spine JSON 文件格式无效")}if(l=ah((o=u==null?void 0:u.skeleton)==null?void 0:o.spine),!l)throw new Error(`Spine JSON 版本不受支持,仅支持 ${im()}`);h=VI(l),l==="3.8"&&nw(u);const d=h==="4.3"?await AP(u,i,n):_P(u,i,n);a=d.skeletonData,c=d.SpineClass}if(!l)throw new Error(`Spine 数据版本不受支持,仅支持 ${im()}`);return{skeletonData:a,textures:r,runtimeVersion:h,SpineClass:c,dataVersion:l,animations:a.animations.map(u=>({name:u.name,duration:u.duration})),bones:$P(a)}}catch(a){for(const c of r)c.destroy(!0);throw a}}function Ic(s){return new Promise((e,t)=>{const i=new FileReader;i.onload=()=>e(String(i.result||"")),i.onerror=()=>t(i.error),i.readAsDataURL(s)})}async function XP(s,e,t){return{skeleton:{name:s.name,dataUrl:await Ic(s)},atlas:{name:e.name,dataUrl:await Ic(e)},textures:await Promise.all(t.map(async i=>({name:i.name,dataUrl:await Ic(i)})))}}async function tf(s){const e=await fetch(s.dataUrl);if(!e.ok)throw new Error(`无法读取内嵌 Spine 文件:${s.name}`);return new File([await e.blob()],s.name)}async function VP(s){return{skeleton:await tf(s.skeleton),atlas:await tf(s.atlas),textures:await Promise.all(s.textures.map(tf))}}const ow="SpineParticle.EditorConfig",aw=1;function lw(s){return{backgroundX:s.backgroundX,backgroundY:s.backgroundY,backgroundOpacity:s.backgroundOpacity,backgroundImageName:s.backgroundImageName,backgroundImageData:s.backgroundImageData,showGrid:s.showGrid,exportSettings:Nt(s.exportSettings)}}function YP(s){return JSON.parse(JSON.stringify(s,(e,t)=>{if(!(e==="texture"||e==="trailTexture"||e==="frames"))return t}))}function cw(s){const e=Nt(s);return delete e.tags,delete e.selectedTag,e}function GP(s){const e=lw(s.settings);return YP({format:ow,version:aw,savedAt:new Date().toISOString(),editor:Nt(s.editor),settings:e,timeline:{fps:s.timeline.fps,loop:s.timeline.loop,playbackStart:s.timeline.playbackStart,playbackEnd:s.timeline.playbackEnd,animations:[...s.timeline.animations]},selection:{type:s.activeObjectType,id:s.activeObjectId},scene:{systems:s.systems.map(t=>({...Nt(t),frames:void 0})),colliders:s.colliders.map(cw),paths:Nt(s.paths),spines:Nt(s.spines)}})}function HP(){return`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.json`}function hw(s){const e=GP(s),t=new Blob([JSON.stringify(e,null,2)],{type:"application/json;charset=utf-8"}),i=URL.createObjectURL(t),n=document.createElement("a");return n.href=i,n.download=HP(),document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),0),e}function uw(s){let e;try{e=JSON.parse(s)}catch{throw new Error("配置文件不是有效的 JSON")}const t=e;if(t.format!==ow)throw new Error("不是 SpineParticle 编辑器配置文件");if(t.version!==aw)throw new Error(`暂不支持配置版本:${t.version??"未知"}`);if(!t.scene||!Array.isArray(t.scene.systems)||!Array.isArray(t.scene.colliders)||!Array.isArray(t.scene.paths)||!Array.isArray(t.scene.spines))throw new Error("配置文件缺少完整场景数据");return t}async function jP(s){const e=new Map,t=n=>{const r=n==="/particles/star.png"?"/images/star.png":n==="/trails/trail.png"?"/images/trail.png":n||"/images/star.png";let o=e.get(r);return o||(o=ze.fromURL(r).then(a=>nr(a)),e.set(r,o)),o},i=await t("/images/star.png");await Promise.all(s.map(async n=>{var o;const r=pr(n.config);r.texture=i,await Promise.all(r.imageResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/star.png"),await Promise.all(a.sequenceFrames.map(async c=>{c.texture=await t(c.previewUrl||a.previewUrl||"/images/star.png")}))})),await Promise.all(r.trailResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/trail.png")})),r.trailTexture=((o=r.trailResources[0])==null?void 0:o.texture)||null,n.frames=[]}))}async function WP(s){const e=new Map;try{for(const t of s){if(!t.sourceBundle)continue;const i=await VP(t.sourceBundle);e.set(t.id,await rw(i.skeleton,i.atlas,i.textures))}return e}catch(t){for(const i of e.values())for(const n of i.textures)n.destroy(!0);throw t}}function zP(s,e){const t=(e==null?void 0:e.type)||"particle",i=Number(e==null?void 0:e.id)||0;(t==="particle"?s.systems.some(r=>r.id===i):t==="collision"?s.colliders.some(r=>r.id===i):t==="path"?s.paths.some(r=>r.id===i):s.spines.some(r=>r.id===i))?s.selectSceneObject(t,i):s.systems[0]?s.selectSceneObject("particle",s.systems[0].id):s.colliders[0]?s.selectSceneObject("collision",s.colliders[0].id):s.paths[0]?s.selectSceneObject("path",s.paths[0].id):s.spines[0]?s.selectSceneObject("spine",s.spines[0].id):(s.activeObjectType="particle",s.activeObjectId=0,s.activeId=0)}async function qP(s,e){var h,u,d,f,p,m,g;const t=uw(JSON.stringify(e)),i=Nt(t.scene.systems),n=t.scene.colliders.map(cw),r=Nt(t.scene.paths),o=Nt(t.scene.spines);for(const v of o)v.sourceBundle==null&&(v.sourceBundle=null),v.dataVersion==null&&(v.dataVersion="");await jP(i);const a=await WP(o),c=new Map(s.spines.map(v=>[v.id,v.assetVersion]));for(const v of s.spines)wl(v.id);s.systems=i,s.colliders=n,s.paths=r,s.spines=o,Object.assign(s.editor,Nt(t.editor||{}));const l=t.settings;if(l)for(const v of["backgroundX","backgroundY","backgroundOpacity","backgroundImageName","backgroundImageData","showGrid"])Object.prototype.hasOwnProperty.call(l,v)&&(s.settings[v]=l[v]);s.settings.exportSettings=Qb((h=t.settings)==null?void 0:h.exportSettings),s.settings.undoLimit=Math.min(200,Math.max(1,Math.round(Number(s.settings.undoLimit)||20))),s.timeline.fps=Math.max(1,Math.round(Number((u=t.timeline)==null?void 0:u.fps)||30)),s.timeline.loop=((d=t.timeline)==null?void 0:d.loop)!==!1,s.timeline.animations=Array.isArray((f=t.timeline)==null?void 0:f.animations)&&t.timeline.animations.length?[...new Set(t.timeline.animations.filter(v=>typeof v=="string"&&v.trim()).map(v=>v.trim()))]:["animation"];for(const v of s.spines){const x=a.get(v.id);if(v.assetVersion=Math.max(Number(v.assetVersion)||0,c.get(v.id)||0)+1,!x){v.status="empty",v.error=v.skeletonFileName?"配置未包含可复用的 Spine 原始资源":"",v.animations=[],v.bones=[],v.selectedAnimation="";continue}nu(v.id,x),v.dataVersion=x.dataVersion,v.animations=x.animations,v.bones=x.bones,x.animations.some(y=>y.name===v.selectedAnimation)||(v.selectedAnimation=((p=x.animations[0])==null?void 0:p.name)||""),v.status="ready",v.error=""}s.syncSceneSequences(),zP(s,t.selection),s.timeline.playbackStart=Math.max(0,Math.floor(Number((m=t.timeline)==null?void 0:m.playbackStart)||0)),s.timeline.playbackEnd=Math.max(1,Math.floor(Number((g=t.timeline)==null?void 0:g.playbackEnd)||Number.MAX_SAFE_INTEGER)),s.timeline.frame=0,s.timeline.recorded=!1,s.timeline.playing=!0;for(const v of s.systems)s.timeline.animations.includes(v.animation)||(v.animation=s.timeline.animations[0]);return s.recalcTotalFrames(),s.timeline.frame=s.timeline.playbackStart,t}async function dw(s,e){return qP(s,uw(e))}async function KP(s,e){if(!/\.json$/i.test(e.name))throw new Error("请选择 .json 配置文件");return dw(s,await e.text())}const au=no({undoCount:0});let ph=null,Cn=null,ur=[],Ta=null,An=null,gh=!1;function mp(s){return{systems:s.systems.map(t=>{const i=Nt(t);return i.frames=void 0,i}),colliders:Nt(s.colliders),paths:Nt(s.paths),spines:Nt(s.spines),animations:[...s.timeline.animations],settings:lw(s.settings)}}function pp(s){return JSON.stringify(s,(e,t)=>e==="texture"||e==="trailTexture"?null:typeof t=="string"&&t.startsWith("data:")&&t.length>256?`${t.length}:${t.slice(0,96)}:${t.slice(-48)}`:t)}function fw(s,e=mp(s),t=pp(e)){const i=new Map;for(const n of e.spines){const r=$I(n.id);r&&i.set(n.id,r)}return{data:e,signature:t,spineAssets:i}}function vh(s){if(s){for(const e of s.spineAssets.values())NI(e);s.spineAssets.clear()}}function mw(s){for(;ur.length>s;)vh(ur.shift()||null);au.undoCount=ur.length}function pw(){const s=ph;if(!s||!Cn||gh)return;const e=mp(s),t=pp(e);t!==Cn.signature&&(ur.push(Cn),Cn=fw(s,e,t),mw(s.settings.undoLimit))}function ZP(){gh||(An&&clearTimeout(An),An=setTimeout(()=>{An=null,pw()},250))}function JP(s){const e=s.activeObjectId;return s.activeObjectType==="particle"?s.systems.some(t=>t.id===e):s.activeObjectType==="collision"?s.colliders.some(t=>t.id===e):s.activeObjectType==="path"?s.paths.some(t=>t.id===e):s.spines.some(t=>t.id===e)}function QP(s){var t,i;if(!JP(s)){const n=s.systems[0],r=s.colliders[0],o=s.paths[0],a=s.spines[0];n?(s.activeObjectType="particle",s.activeObjectId=n.id):r?(s.activeObjectType="collision",s.activeObjectId=r.id):o?(s.activeObjectType="path",s.activeObjectId=o.id):(s.activeObjectType="spine",s.activeObjectId=(a==null?void 0:a.id)||0)}const e=s.activeObjectType==="particle"?s.systems.find(n=>n.id===s.activeObjectId):s.systems.find(n=>n.id===s.activeId);s.activeId=(e==null?void 0:e.id)||((t=s.systems[0])==null?void 0:t.id)||0,s.timeline.animation=(e==null?void 0:e.animation)||((i=s.systems[0])==null?void 0:i.animation)||s.timeline.animations[0]||"animation"}function ek(s,e){const t=Cn;gh=!0;try{for(const i of s.spines)wl(i.id);s.systems=Nt(e.data.systems),s.colliders=Nt(e.data.colliders),s.paths=Nt(e.data.paths),s.spines=Nt(e.data.spines),s.timeline.animations=[...e.data.animations],Object.assign(s.settings,Nt(e.data.settings));for(const[i,n]of e.spineAssets)nu(i,n);for(const i of s.systems)i.frames=[];s.timeline.recorded=!1,s.timeline.playing=!1,QP(s),s.recalcTotalFrames(),Cn=e}finally{gh=!1,vh(t)}}function tk(s){if(!(ph===s&&Ta)){Ta==null||Ta(),An&&clearTimeout(An),vh(Cn);for(const e of ur)vh(e);ur=[],ph=s,Cn=fw(s),au.undoCount=0,Ta=Xi(()=>pp(mp(s)),ZP,{flush:"post"})}}function ik(s,e){const t=Math.min(200,Math.max(1,Math.round(Number(e)||20)));s.settings.undoLimit=t,mw(t)}function gw(){const s=ph;if(!s||!Cn)return!1;An&&(clearTimeout(An),An=null),pw();const e=ur.pop();return e?(ek(s,e),au.undoCount=ur.length,!0):!1}function sk(s){const e=s instanceof HTMLElement?s:null;return!!(e!=null&&e.closest('input, textarea, select, [contenteditable="true"]'))}function nk(s){function e(i){var r;const n=i.target instanceof Node?i.target:null;s.canvasFocused.value=!!n&&!!((r=s.canvasElement.value)!=null&&r.contains(n))}function t(i){const n=i.key.toLowerCase();if((i.ctrlKey||i.metaKey)&&!i.altKey&&n==="s"){i.preventDefault(),i.stopPropagation(),s.save();return}if((i.ctrlKey||i.metaKey)&&!i.altKey&&n==="z"){i.preventDefault(),i.stopPropagation(),s.undo();return}if(i.ctrlKey||i.metaKey||i.altKey||sk(i.target))return;if(n==="d"){i.preventDefault(),s.togglePlay();return}if(n==="s"){i.preventDefault(),s.toStart();return}if(!s.canvasFocused.value)return;const r={q:"",w:"translate",e:"rotate",r:"scale"};n in r&&(i.preventDefault(),s.setTool(r[n]))}Vn(()=>{document.addEventListener("pointerdown",e,!0),window.addEventListener("keydown",t,!0)}),gl(()=>{document.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",t,!0)})}const rk={class:"help-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"help-title"},ok={class:"help-body"},ak=["aria-expanded"],lk={class:"caret"},ck={class:"help-module-body"},hk=["aria-expanded"],uk={class:"caret"},dk={class:"help-module-body"},fk=["aria-expanded"],mk={class:"caret"},pk={class:"help-module-body"},gk=["aria-expanded"],vk={class:"caret"},yk={class:"help-module-body"},xk=["aria-expanded"],bk={class:"caret"},wk={class:"help-module-body"},Sk=["aria-expanded"],_k={class:"caret"},Tk={class:"help-module-body"},Mk=["aria-expanded"],Ck={class:"caret"},Ak={class:"help-module-body"},Ek=["aria-expanded"],Ik={class:"caret"},Rk={class:"help-module-body"},Pk=["aria-expanded"],kk={class:"caret"},Fk={class:"help-module-body"},Ok=Jt({__name:"HelpDialog",props:{show:{type:Boolean}},emits:["close"],setup(s,{emit:e}){const t=e,i=Ge(Array.from({length:9},()=>!1));function n(){t("close")}function r(o){o.key==="Escape"&&n()}return Vn(()=>window.addEventListener("keydown",r)),pl(()=>window.removeEventListener("keydown",r)),(o,a)=>s.show?(K(),Q("div",{key:0,class:"help-overlay",role:"presentation",onClick:et(n,["self"])},[T("section",rk,[T("header",{class:"help-head"},[a[9]||(a[9]=T("div",null,[T("h2",{id:"help-title"},"使用说明"),T("p",null,"从创建粒子到保存、导出的快速入门")],-1)),T("button",{class:"help-close","aria-label":"关闭使用说明",title:"关闭 (Esc)",onClick:n},"✕")]),T("div",ok,[a[37]||(a[37]=es('

快速开始

  1. 创建对象:在左侧“场景对象”中用 +粒子 / +碰撞 / +路径 / +Spine 添加场景对象。
  2. 编辑粒子:选中某个粒子系统,依次调整“发射模式 → 发射器形状 → 粒子属性 → 外观与资源 → 修改器”。
  3. 查看效果:底部时间轴可播放、暂停、逐帧或拖动;修改任意参数后会自动重新计算。
  4. 保存与导出:用“保存配置”保留工程;“导出 Spine Json / images 包 / .spine 包”输出成品。

每个模块组标题右侧的“重置”可把该组参数恢复默认;系统设置会自动保存在当前浏览器。

常用操作

小眼睛
单独显示/隐藏对象;隐藏的粒子系统不会被导出。
+Copy
完整复制当前选中对象,方便对比不同参数。
背景图
上传参考图并调整位置和透明度,只用于画布预览。
系统设置
管理界面布局、辅助显示、刻度等,自动存入浏览器。
撤销/重做
Ctrl+Z 撤回一步;可达成的步数在系统设置中调整。
Spine 骨骼
在层级树搜索并选择骨骼,可用于粒子发射器跟随。

快捷键

Ctrl/⌘+Z撤回上一步
Ctrl/⌘+S保存配置
Q拖动画布
W位移工具
E旋转工具
R缩放工具
D播放 / 暂停
S回到第一帧

Q / W / E / R 需先点击画布;光标位于输入框时,单键快捷键不会触发。

功能模块详解
',3)),T("section",{class:Le(["help-section help-module",{open:i.value[0]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[0]?"true":"false",onClick:a[0]||(a[0]=c=>i.value[0]=!i.value[0])},[a[10]||(a[10]=T("span",{class:"mnum"},"1",-1)),a[11]||(a[11]=T("span",{class:"mtitle"},"配置管理",-1)),T("span",lk,_e(i.value[0]?"▾":"▸"),1)],8,ak),de(T("div",ck,[...a[12]||(a[12]=[es('
保存配置
把当前全部场景对象和参数保存为工程 JSON 文件(也支持 Ctrl+S)。
加载配置
选择本地配置文件,恢复完整工程。
预设
从下拉中选择已保存的预设快速套用;点击下拉即可刷新列表。
范围
配置只含对象与参数,不含“系统设置”;系统设置单独存于浏览器。
',1)])],512),[[vi,i.value[0]]])],2),T("section",{class:Le(["help-section help-module",{open:i.value[1]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[1]?"true":"false",onClick:a[1]||(a[1]=c=>i.value[1]=!i.value[1])},[a[13]||(a[13]=T("span",{class:"mnum"},"2",-1)),a[14]||(a[14]=T("span",{class:"mtitle"},"场景对象",-1)),T("span",uk,_e(i.value[1]?"▾":"▸"),1)],8,hk),de(T("div",dk,[...a[15]||(a[15]=[es('
粒子
核心对象。可设名称、位置 X/Y、偏移、旋转、缩放 X/Y,以及“随机种子”——相同种子可精确复现同一次效果。
碰撞
圆形/椭圆/矩形/多边形/自定义;启用开关、碰撞响应(物理弹跳/暂停/销毁)、弹性与摩擦,还可沿某条路径移动并带进度曲线。
路径
贝塞尔路径,可双击新建/删除锚点、拖手柄调曲线;内置圆/方/多边形/星形预设,支持闭合与颜色。
Spine
加载 .json+.atlas+.png 预览骨骼动画,可查看/搜索骨骼层级树,用于粒子“发射器跟随”。
通用
每个对象都有小眼睛显隐;“+Copy”可以复制当前对象;隐藏的粒子系统不会进入导出。
',1)])],512),[[vi,i.value[1]]])],2),T("section",{class:Le(["help-section help-module",{open:i.value[2]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[2]?"true":"false",onClick:a[2]||(a[2]=c=>i.value[2]=!i.value[2])},[a[16]||(a[16]=T("span",{class:"mnum"},"3",-1)),a[17]||(a[17]=T("span",{class:"mtitle"},"发射模式",-1)),T("span",mk,_e(i.value[2]?"▾":"▸"),1)],8,fk),de(T("div",pk,[...a[18]||(a[18]=[es('
持续
按“每秒发射数量”持续喷射;再分“常规持续”(发射时长)与“循环持续”(三段式:开始循环 / 纯循环 / 结束循环,可自动或自定义帧长,做到无缝衔接)。
爆发
一次性发射“单次数量”颗粒子。
延迟时间
粒子条左端位置,表示发射开始前的等待时间。
注意
循环持续模式不支持骨骼跟随和路径跟随;开关时会把跟随设置恢复默认。
',1)])],512),[[vi,i.value[2]]])],2),T("section",{class:Le(["help-section help-module",{open:i.value[3]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[3]?"true":"false",onClick:a[3]||(a[3]=c=>i.value[3]=!i.value[3])},[a[19]||(a[19]=T("span",{class:"mnum"},"4",-1)),a[20]||(a[20]=T("span",{class:"mtitle"},"发射器形状",-1)),T("span",vk,_e(i.value[3]?"▾":"▸"),1)],8,gk),de(T("div",yk,[...a[21]||(a[21]=[es('
形状
点 / 圆形 / 矩形 / 锥形 / 路径。
圆·锥
内半径与外半径,形成环形或锥形发射区;锥形额外有“锥形朝向”和“开口角度”。
矩形
“外框 − 内框”形成环带,可分别设置内外宽高。
路径
选一条场景路径作为出生线;出生分布可选等距固定或随机。
发射角度
固定 / 随机(基准角度 + 随机范围)/ 径向(圆、矩、锥中心向外)/ 垂直于路径 / 沿路径方向。
',1)])],512),[[vi,i.value[3]]])],2),T("section",{class:Le(["help-section help-module",{open:i.value[4]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[4]?"true":"false",onClick:a[4]||(a[4]=c=>i.value[4]=!i.value[4])},[a[22]||(a[22]=T("span",{class:"mnum"},"5",-1)),a[23]||(a[23]=T("span",{class:"mtitle"},"粒子属性",-1)),T("span",bk,_e(i.value[4]?"▾":"▸"),1)],8,xk),de(T("div",wk,[...a[24]||(a[24]=[T("dl",{class:"help-list"},[T("div",null,[T("dt",null,"初始参数"),T("dd",null,"生命周期、速度、缩放(统一或 X/Y 分离)、初始旋转(可跟随发射方向)。每个属性支持固定 / 随机 / 曲线三种取值。")]),T("div",null,[T("dt",null,"生命周期变化"),T("dd",null,"速度倍率、缩放倍率(统一/分离)、旋转速度,均可用“生命周期 → 倍率”曲线控制。")]),T("div",null,[T("dt",null,"曲线含义"),T("dd",null,"横轴为粒子生命周期 0→1,纵轴为倍率或对应数值。")])],-1)])],512),[[vi,i.value[4]]])],2),T("section",{class:Le(["help-section help-module",{open:i.value[5]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[5]?"true":"false",onClick:a[5]||(a[5]=c=>i.value[5]=!i.value[5])},[a[25]||(a[25]=T("span",{class:"mnum"},"6",-1)),a[26]||(a[26]=T("span",{class:"mtitle"},"外观与资源",-1)),T("span",_k,_e(i.value[5]?"▾":"▸"),1)],8,Sk),de(T("div",Tk,[...a[27]||(a[27]=[T("dl",{class:"help-list"},[T("div",null,[T("dt",null,"透明度"),T("dd",null,"曲线或固定;曲线模式可选“跟随导出 / 线性 / 贝塞尔”。")]),T("div",null,[T("dt",null,"图片资源"),T("dd",null,"“+”新增,可上传单图或序列帧;多张图片按权重随机。每张可调缩放、轴心、颜色(固定/随机/生命周期渐变)、混合模式(正常/相加/相乘/滤色)、独立透明度(关/固定/曲线)。")]),T("div",null,[T("dt",null,"序列帧"),T("dd",null,"播放方式:单次隐藏 / 单次定格 / 正向循环 / 反向循环,可设每秒帧数。")])],-1)])],512),[[vi,i.value[5]]])],2),T("section",{class:Le(["help-section help-module",{open:i.value[6]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[6]?"true":"false",onClick:a[6]||(a[6]=c=>i.value[6]=!i.value[6])},[a[28]||(a[28]=T("span",{class:"mnum"},"7",-1)),a[29]||(a[29]=T("span",{class:"mtitle"},"修改器",-1)),T("span",Ck,_e(i.value[6]?"▾":"▸"),1)],8,Mk),de(T("div",Ak,[...a[30]||(a[30]=[es('
移动噪声
强度、波动范围、时间流速,让粒子轨迹产生抖动。
重力 / 风力
固定或随机强度、方向,以及生命周期内强度曲线。
力场
中心 X/Y、强度(正吸负斥)、半径、衰减(恒定/线性/反比)。
吸附
延迟后把粒子吸到指定点,到达范围即死亡;可直线或曲线。
拖尾
独立拖尾图片(多资源按权重)、旋转、拖尾骨骼数、拖尾比例;长度/宽度可固定或随机并支持放大;可加生命周期长度曲线与形状曲线;颜色/透明度可跟随粒子、固定或曲线。
发射器跟随
跟随某条路径(局部/世界、正/反向、进度曲线),或跟随 Spine 骨骼(选中的骨骼 + 偏移)。
碰撞 + 阻尼
选择场景中已启用的碰撞对象参与,并设置速度阻尼。
',1)])],512),[[vi,i.value[6]]])],2),T("section",{class:Le(["help-section help-module",{open:i.value[7]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[7]?"true":"false",onClick:a[7]||(a[7]=c=>i.value[7]=!i.value[7])},[a[31]||(a[31]=T("span",{class:"mnum"},"8",-1)),a[32]||(a[32]=T("span",{class:"mtitle"},"导出设置",-1)),T("span",Ik,_e(i.value[7]?"▾":"▸"),1)],8,Ek),de(T("div",Rk,[...a[33]||(a[33]=[es('
图片路径
写入 Spine 的 images 路径,例如 ./images/。
Spine 版本
3.8 / 4.0 / 4.1 / 4.2 / 4.3。
关键帧曲线
线性或平滑贝塞尔;出生、死亡、突变仍使用阶跃关键帧。
导出 FPS
修改 FPS 会保持动画实际秒数不变;“不写 fps”只省略元数据。
其它
整数帧对齐、骨骼对象池、排除无内容动画。
导出按钮
“导出 Spine Json”生成骨骼动画文件;“导出 images 包”单独下载图片 ZIP;“导出 .spine 包”需要连接器。
',1)])],512),[[vi,i.value[7]]])],2),T("section",{class:Le(["help-section help-module help-connector",{open:i.value[8]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[8]?"true":"false",onClick:a[8]||(a[8]=c=>i.value[8]=!i.value[8])},[a[34]||(a[34]=T("span",{class:"mnum"},"9",-1)),a[35]||(a[35]=T("span",{class:"mtitle"},"连接器(Spine 连接器)使用说明",-1)),T("span",kk,_e(i.value[8]?"▾":"▸"),1)],8,Pk),de(T("div",Fk,[...a[36]||(a[36]=[es('

连接器用于把网页生成的 JSON 和图片,调用你电脑上已安装并激活的 Spine,转换成可编辑的 .spine 工程。

前置
电脑已安装并激活 Spine;并已启动桌面版连接器APP。
网页端
导出区状态显示“连接器可用 · Spine 已就绪”后,点击“导出 .spine 包”。
首次授权
生产网站首次连接会显示“授权当前网站”;点击后在本机确认页核对完整来源(协议 + 域名 + 端口),再点“允许此网站”。授权一次后本机会保存白名单。本地 127.0.0.1:5173 默认允许。
路径设置
连接器自动检测 Spine 安装位置;检测不到时可在桌面窗口手动指定:Windows 选 Spine.com,macOS 选 Spine.app/Contents/MacOS/Spine。
下载结果
得到 ZIP 包,内含 .spine 工程和图片目录(如 images/star.png)。
版本
连接器按请求与 JSON 内的版本自动匹配 3.8~4.3,使用最新可用补丁。
安全
仅监听本机 127.0.0.1:27843;授权与白名单保存在连接器里;文件在临时目录转换后清理,并有大小限制。
',2)])],512),[[vi,i.value[8]]])],2),a[38]||(a[38]=T("section",{class:"help-section help-export"},[T("h3",null,"配置与导出有什么区别?"),T("p",null,[T("b",null,"保存配置"),At("会保存编辑器中的全部对象和参数,之后可以继续修改;"),T("b",null,"导出 Spine Json"),At("只导出显示中的粒子系统,并把跟随、碰撞和拖尾结果烘焙为独立动画数据。")])],-1))])])])):Te("",!0)}}),Qt=(s,e)=>{const t=s.__vccOpts||s;for(const[i,n]of e)t[i]=n;return t},Bk=Qt(Ok,[["__scopeId","data-v-78204b9d"]]);function zo(s){const e=()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",e),window.removeEventListener("pointercancel",e)};window.addEventListener("pointermove",s),window.addEventListener("pointerup",e),window.addEventListener("pointercancel",e)}function us(s,e,t){const i=s.holder.value,n=s.app(),r=i.getBoundingClientRect(),o=Math.max(1e-4,s.store.editor.viewScale),a=e-r.left,c=t-r.top;return{x:(a-n.screen.width/2-s.store.editor.viewX)/o,y:-(c-n.screen.height*.5-s.store.editor.viewY)/o}}function Lk(s,e){const t=s.holder.value,i=s.app(),n=s.store,r=t.getBoundingClientRect(),o=e.clientX-r.left,a=e.clientY-r.top,c=e.deltaY<0?1.12:1/1.12,l=n.editor.viewScale,h=Math.max(.01,l*c),u=i.screen.width/2,d=i.screen.height*.5,f=n.editor.viewX,p=n.editor.viewY,m=(o-u-f)/l,g=(a-d-p)/l;n.editor.viewX=o-u-m*h,n.editor.viewY=a-d-g*h,n.editor.viewScale=h}function Dk(s,e,t){const i=s.store,n=i.editor.viewX,r=i.editor.viewY;zo(o=>{i.editor.viewX=n+(o.clientX-e),i.editor.viewY=r+(o.clientY-t)})}function vw(s,e){const t=Math.max(.01,s.store.editor.viewScale*e);s.store.editor.viewScale=t}function Nk(s){vw(s,1.2)}function Uk(s){vw(s,1/1.2)}function $k(s){s.store.editor.viewScale=1,s.store.editor.viewX=0,s.store.editor.viewY=0}function Xk(s){s.store.editor.viewScale=1,s.store.editor.viewX=0,s.store.editor.viewY=0}function Vk(s){s.store.settings.showGrid=!s.store.settings.showGrid}const Yk={class:"topbar"},Gk=["disabled"],Hk={class:"tool-group"},jk={class:"tool-group"},Wk={key:0,class:"background-panel"},zk=["disabled"],qk=["title"],Kk={class:"background-position-row"},Zk={class:"background-opacity-row"},Jk={class:"zoom-pct"},Qk=Jt({__name:"StageToolbar",props:{ctx:{},activeTool:{},showSettings:{type:Boolean},showHelp:{type:Boolean}},emits:["update:activeTool","update:showSettings","update:showHelp","clear-background","background-file"],setup(s,{emit:e}){const t=s,i=e,n=ao(),r=Ge(!1),o=Ge(null),a=qe(()=>n.settings.backgroundImageName);function c(m){i("update:activeTool",t.activeTool===m?"":m)}function l(){r.value=!r.value,r.value&&i("update:showSettings",!1)}function h(){const m=!t.showSettings;i("update:showSettings",m),m&&(r.value=!1)}function u(){i("update:showHelp",!0),r.value=!1,i("update:showSettings",!1)}function d(m){i("background-file",m)}function f(m=!0){o.value&&(o.value.value=""),i("clear-background",m)}function p(){gw()}return(m,g)=>(K(),Q("div",Yk,[T("button",{class:"settings-btn",onClick:h,title:"系统设置"},"系统设置"),T("button",{class:"undo-btn",disabled:R(au).undoCount===0,onClick:p,title:"撤回上一步 (Ctrl+Z)"},"↶",8,Gk),T("div",Hk,[T("button",{class:Le(["tool-btn",{on:s.activeTool===""}]),onClick:g[0]||(g[0]=v=>c("")),title:"拖动画布 (Q)"},"✋",2),T("button",{class:Le(["tool-btn",{on:s.activeTool==="translate"}]),onClick:g[1]||(g[1]=v=>c("translate")),title:"位移 (W)"},"✥",2),T("button",{class:Le(["tool-btn",{on:s.activeTool==="rotate"}]),onClick:g[2]||(g[2]=v=>c("rotate")),title:"旋转 (E)"},"⟳",2),T("button",{class:Le(["tool-btn",{on:s.activeTool==="scale"}]),onClick:g[3]||(g[3]=v=>c("scale")),title:"缩放 (R)"},"⤢",2)]),T("div",jk,[T("button",{class:"tool-btn",onClick:g[4]||(g[4]=v=>R(Nk)(s.ctx)),title:"放大"},"+"),T("button",{class:"tool-btn",onClick:g[5]||(g[5]=v=>R(Uk)(s.ctx)),title:"缩小"},"-"),T("button",{class:"tool-btn",onClick:g[6]||(g[6]=v=>R($k)(s.ctx)),title:"适配画布"},"⤢"),T("button",{class:Le(["tool-btn",{on:R(n).settings.showGrid}]),onClick:g[7]||(g[7]=v=>R(Vk)(s.ctx)),title:"切换网格"},"▦",2),T("button",{class:"tool-btn",onClick:g[8]||(g[8]=v=>R(Xk)(s.ctx)),title:"重置视图"},"⟳")]),T("div",{class:"background-menu",onClick:g[14]||(g[14]=et(()=>{},["stop"]))},[T("button",{class:Le(["background-btn",{on:r.value}]),title:"背景图显示设置",onClick:l},"背景图",2),r.value?(K(),Q("div",Wk,[T("button",{class:"background-upload",onClick:g[9]||(g[9]=v=>{var x;return(x=o.value)==null?void 0:x.click()})},_e(a.value?"更换图像":"上传图像"),1),T("button",{class:"background-clear",disabled:!a.value,onClick:g[10]||(g[10]=v=>f())},"清除背景",8,zk),T("input",{ref_key:"backgroundFileInput",ref:o,class:"background-file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:d},null,544),T("div",{class:"background-file-name",title:a.value},_e(a.value||"未上传图像"),9,qk),T("div",Kk,[T("label",null,[g[15]||(g[15]=T("span",null,"X",-1)),de(T("input",{"onUpdate:modelValue":g[11]||(g[11]=v=>R(n).settings.backgroundX=v),type:"number",step:"1","aria-label":"背景图 X 偏移"},null,512),[[He,R(n).settings.backgroundX,void 0,{number:!0}]])]),T("label",null,[g[16]||(g[16]=T("span",null,"Y",-1)),de(T("input",{"onUpdate:modelValue":g[12]||(g[12]=v=>R(n).settings.backgroundY=v),type:"number",step:"1","aria-label":"背景图 Y 偏移"},null,512),[[He,R(n).settings.backgroundY,void 0,{number:!0}]])])]),T("label",Zk,[g[17]||(g[17]=T("span",null,"透明度",-1)),de(T("input",{"onUpdate:modelValue":g[13]||(g[13]=v=>R(n).settings.backgroundOpacity=v),type:"range",min:"0",max:"1",step:"0.01","aria-label":"背景图透明度"},null,512),[[He,R(n).settings.backgroundOpacity,void 0,{number:!0}]]),T("b",null,_e(Math.round(R(n).settings.backgroundOpacity*100))+"%",1)])])):Te("",!0)]),T("button",{class:Le(["help-btn",{on:s.showHelp}]),title:"查看使用说明",onClick:u},"使用说明",2),T("span",Jk,_e(Math.round(R(n).editor.viewScale*100))+"%",1)]))}}),eF=Qt(Qk,[["__scopeId","data-v-612a51be"]]),tF={key:0,class:"settings-panel"},iF={class:"sp-head"},sF={class:"sp-switch-row"},nF={class:"sp-switch-control"},rF={class:"sp-row"},oF={class:"sp-chk"},aF={class:"sp-chk"},lF={class:"sp-row"},cF={class:"sp-row"},hF={class:"sp-chk"},uF={class:"sp-chk"},dF={class:"sp-row"},fF={class:"sp-row"},mF={class:"sp-row"},pF={class:"sp-hex"},gF={class:"sp-chk"},vF=Jt({__name:"StageSettingsPanel",props:{show:{type:Boolean}},emits:["close"],setup(s,{emit:e}){const t=e,i=ao();function n(o){ik(i,Number(o.target.value))}function r(){i.settings.bonePointDrawSize=Math.min(10,Math.max(.1,Number(i.settings.bonePointDrawSize)||1)),i.settings.boneAxisDrawSize=Math.min(10,Math.max(.1,Number(i.settings.boneAxisDrawSize)||2))}return(o,a)=>s.show?(K(),Q("div",tF,[T("div",iF,[a[15]||(a[15]=At("系统设置 ",-1)),T("button",{class:"sp-close",onClick:a[0]||(a[0]=c=>t("close"))},"✕")]),a[29]||(a[29]=T("div",{class:"sp-section-title"},"界面布局",-1)),T("label",sF,[a[17]||(a[17]=T("span",null,"参数面板位置",-1)),T("span",nF,[de(T("input",{type:"checkbox","onUpdate:modelValue":a[1]||(a[1]=c=>R(i).settings.parameterPanelOnRight=c),"aria-label":"参数面板显示在右侧"},null,512),[[Et,R(i).settings.parameterPanelOnRight]]),a[16]||(a[16]=T("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),T("b",null,_e(R(i).settings.parameterPanelOnRight?"右侧":"左侧"),1)])]),a[30]||(a[30]=T("div",{class:"sp-divider"},null,-1)),a[31]||(a[31]=T("div",{class:"sp-section-title"},"操作历史",-1)),T("label",rF,[a[18]||(a[18]=T("span",null,"最大撤回步数",-1)),de(T("input",{class:"sp-num sp-undo-limit",type:"number",min:"1",max:"200","onUpdate:modelValue":a[2]||(a[2]=c=>R(i).settings.undoLimit=c),"aria-label":"最大撤回步数",onChange:n},null,544),[[He,R(i).settings.undoLimit,void 0,{number:!0}]])]),a[32]||(a[32]=T("div",{class:"sp-divider"},null,-1)),a[33]||(a[33]=T("div",{class:"sp-section-title"},"画布辅助显示",-1)),T("label",oF,[de(T("input",{type:"checkbox","onUpdate:modelValue":a[3]||(a[3]=c=>R(i).settings.showEmitter=c)},null,512),[[Et,R(i).settings.showEmitter]]),a[19]||(a[19]=At("发射点",-1))]),T("label",aF,[de(T("input",{type:"checkbox","onUpdate:modelValue":a[4]||(a[4]=c=>R(i).settings.showBones=c)},null,512),[[Et,R(i).settings.showBones]]),a[20]||(a[20]=At("骨骼连线",-1))]),R(i).settings.showBones?(K(),Q(Fe,{key:0},[T("label",lF,[a[21]||(a[21]=T("span",null,"骨骼点绘制大小",-1)),de(T("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":a[5]||(a[5]=c=>R(i).settings.bonePointDrawSize=c),"aria-label":"骨骼点绘制大小",onChange:r},null,544),[[He,R(i).settings.bonePointDrawSize,void 0,{number:!0}]])]),T("label",cF,[a[22]||(a[22]=T("span",null,"坐标轴绘制大小",-1)),de(T("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":a[6]||(a[6]=c=>R(i).settings.boneAxisDrawSize=c),"aria-label":"坐标轴绘制大小",onChange:r},null,544),[[He,R(i).settings.boneAxisDrawSize,void 0,{number:!0}]])])],64)):Te("",!0),T("label",hF,[de(T("input",{type:"checkbox","onUpdate:modelValue":a[7]||(a[7]=c=>R(i).settings.showSkinMesh=c)},null,512),[[Et,R(i).settings.showSkinMesh]]),a[23]||(a[23]=At("蒙皮网格",-1))]),a[34]||(a[34]=T("div",{class:"sp-divider"},null,-1)),T("label",uF,[de(T("input",{type:"checkbox","onUpdate:modelValue":a[8]||(a[8]=c=>R(i).settings.tickEnabled=c)},null,512),[[Et,R(i).settings.tickEnabled]]),a[24]||(a[24]=At("启用刻度",-1))]),R(i).settings.tickEnabled?(K(),Q(Fe,{key:1},[T("label",dF,[a[25]||(a[25]=T("span",null,"刻度文字大小",-1)),de(T("input",{type:"range",min:"8",max:"40",step:"1","onUpdate:modelValue":a[9]||(a[9]=c=>R(i).settings.axisFontSize=c)},null,512),[[He,R(i).settings.axisFontSize,void 0,{number:!0}]]),de(T("input",{type:"number",min:"8",max:"40","onUpdate:modelValue":a[10]||(a[10]=c=>R(i).settings.axisFontSize=c),class:"sp-num"},null,512),[[He,R(i).settings.axisFontSize,void 0,{number:!0}]])]),T("label",fF,[a[26]||(a[26]=T("span",null,"刻度线粗细",-1)),de(T("input",{type:"range",min:"1",max:"5",step:"0.5","onUpdate:modelValue":a[11]||(a[11]=c=>R(i).settings.tickWidth=c)},null,512),[[He,R(i).settings.tickWidth,void 0,{number:!0}]]),de(T("input",{type:"number",min:"1",max:"5","onUpdate:modelValue":a[12]||(a[12]=c=>R(i).settings.tickWidth=c),class:"sp-num"},null,512),[[He,R(i).settings.tickWidth,void 0,{number:!0}]])]),T("label",mF,[a[27]||(a[27]=T("span",null,"坐标轴颜色",-1)),de(T("input",{type:"color","onUpdate:modelValue":a[13]||(a[13]=c=>R(i).settings.axisColor=c),class:"sp-colr"},null,512),[[He,R(i).settings.axisColor]]),T("span",pF,_e(R(i).settings.axisColor),1)]),T("label",gF,[de(T("input",{type:"checkbox","onUpdate:modelValue":a[14]||(a[14]=c=>R(i).settings.showAxisLabels=c)},null,512),[[Et,R(i).settings.showAxisLabels]]),a[28]||(a[28]=At("显示刻度数值",-1))])],64)):Te("",!0),a[35]||(a[35]=T("div",{class:"sp-cache-note"},"整个系统设置会自动保存到当前浏览器",-1))])):Te("",!0)}}),yF=Qt(vF,[["__scopeId","data-v-91f62c22"]]);class sf{constructor(){w(this,"sprite",null);w(this,"texture",null);w(this,"loadVersion",0)}createSprite(e){const t=new yr(ze.EMPTY);return t.anchor.set(.5),t.visible=!1,e.addChild(t),this.sprite=t,t}applyTransform(e,t,i){this.sprite&&(this.sprite.position.set(Number(e)||0,-(Number(t)||0)),this.sprite.alpha=Math.min(1,Math.max(0,Number(i)||0)))}async syncTexture(e){const t=++this.loadVersion;if(!e){this.sprite&&(this.sprite.texture=ze.EMPTY,this.sprite.visible=!1),this.texture&&this.texture.destroy(!0),this.texture=null;return}try{const i=await ze.fromURL(e);if(t!==this.loadVersion||!this.sprite){i.destroy(!0);return}const n=this.texture;this.texture=i,this.sprite.texture=i,this.sprite.visible=!0,n&&n.destroy(!0)}catch(i){console.error("背景图恢复失败",i)}}static clearStoreBackground(e,t){e.settings.backgroundImageData="",e.settings.backgroundImageName="",t&&(e.settings.backgroundX=0,e.settings.backgroundY=0,e.settings.backgroundOpacity=1)}static async handleFileChange(e,t){var r;const i=t.target,n=(r=i.files)==null?void 0:r[0];if(n)try{e.settings.backgroundImageData=await Ic(n),e.settings.backgroundImageName=n.name}catch(o){console.error("背景图加载失败",o)}finally{i.value=""}}destroy(){this.loadVersion++,this.texture&&this.texture.destroy(!0),this.texture=null,this.sprite=null}}class xF{constructor(e){w(this,"selectedNodes",new Set);w(this,"suppressNextDoubleClick",!1);this.ctx=e}resetSelection(){this.selectedNodes.clear()}activePath(){const e=this.ctx.store;if(e.activeObjectType!=="path")return null;const t=e.paths.find(i=>i.id===e.activeObjectId)||null;return(t==null?void 0:t.visible)===!1?null:t}pathInsertIndex(e,t,i){if(e.points.length<2)return e.points.length;const n=e.closed?e.points.length:e.points.length-1;let r=e.points.length,o=1/0;for(let a=0;aMath.hypot(c.x-n.x,c.y-n.y)<=r);if(o>=0){t.points.splice(o,1),this.selectedNodes.clear();return}const a=this.pathInsertIndex(t,n.x,n.y);t.points.splice(a,0,{x:n.x,y:n.y,inX:0,inY:0,outX:0,outY:0}),this.selectedNodes.clear(),this.selectedNodes.add(a)}onPointerDown(e){const t=this.activePath();if(!t||!t.enabled)return!1;const i=us(this.ctx,e.clientX,e.clientY),n=wo(t,i.x,i.y),r=9/Math.max(.01,this.ctx.store.editor.viewScale);if(e.detail>=2){if(t.points.findIndex(u=>Math.hypot(u.x-n.x,u.y-n.y)<=r)>=0)return!0;const l={x:n.x,y:n.y,inX:0,inY:0,outX:0,outY:0},h=this.pathInsertIndex(t,n.x,n.y);return t.points.splice(h,0,l),this.selectedNodes.clear(),this.selectedNodes.add(h),this.suppressNextDoubleClick=!0,zo(u=>{const d=us(this.ctx,u.clientX,u.clientY),f=wo(t,d.x,d.y);l.outX=f.x-l.x,l.outY=f.y-l.y,l.inX=-l.outX,l.inY=-l.outY}),!0}let o=null;for(const c of this.selectedNodes){const l=t.points[c];l&&(Math.hypot(l.x+l.inX-n.x,l.y+l.inY-n.y)<=r&&(o={index:c,side:"in"}),Math.hypot(l.x+l.outX-n.x,l.y+l.outY-n.y)<=r&&(o={index:c,side:"out"}))}if(o){const c=t.points[o.index],l=o.side==="in"?Math.hypot(c.outX,c.outY):Math.hypot(c.inX,c.inY);return zo(u=>{const d=us(this.ctx,u.clientX,u.clientY),f=wo(t,d.x,d.y),p=f.x-c.x,m=f.y-c.y;if(o.side==="in"?(c.inX=p,c.inY=m):(c.outX=p,c.outY=m),!u.altKey){const g=Math.max(1e-4,Math.hypot(p,m)),v=u.shiftKey?g:l;o.side==="in"?(c.outX=-p/g*v,c.outY=-m/g*v):(c.inX=-p/g*v,c.inY=-m/g*v)}}),!0}const a=t.points.findIndex(c=>Math.hypot(c.x-n.x,c.y-n.y)<=r);if(a>=0){if(e.altKey)return this.selectedNodes.delete(a),!0;e.ctrlKey||e.metaKey?this.selectedNodes.add(a):this.selectedNodes.has(a)||(this.selectedNodes.clear(),this.selectedNodes.add(a));const c=n,l=[...this.selectedNodes].map(u=>({index:u,x:t.points[u].x,y:t.points[u].y}));return zo(u=>{const d=us(this.ctx,u.clientX,u.clientY),f=wo(t,d.x,d.y);for(const p of l)t.points[p.index].x=p.x+f.x-c.x,t.points[p.index].y=p.y+f.y-c.y}),!0}if(e.altKey&&!e.ctrlKey&&!e.metaKey)return this.selectedNodes.clear(),!0;if(e.ctrlKey||e.metaKey||e.altKey){const c=n,l=e.altKey,h=u=>{const d=us(this.ctx,u.clientX,u.clientY),f=wo(t,d.x,d.y),p=Math.min(c.x,f.x),m=Math.max(c.x,f.x),g=Math.min(c.y,f.y),v=Math.max(c.y,f.y);t.points.forEach((x,y)=>{x.x>=p&&x.x<=m&&x.y>=g&&x.y<=v&&(l?this.selectedNodes.delete(y):this.selectedNodes.add(y))}),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h)};return window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h),!0}return!1}}class bF{constructor(e,t){this.ctx=e,this.getTool=t}onColliderPointerDown(e){const t=this.ctx.store;if(t.activeObjectType!=="collision")return!1;const i=t.colliders.find(x=>x.id===t.activeObjectId);if(!(i!=null&&i.enabled)||i.visible===!1)return!1;const n=us(this.ctx,e.clientX,e.clientY),r=i.rotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),c=Math.max(1e-4,Math.abs(i.scaleX??1)),l=Math.max(1e-4,Math.abs(i.scaleY??1)),h=n.x-i.x,u=n.y-i.y,d=(o*h+a*u)/c,f=(-a*h+o*u)/l;if(!(i.shape==="circle"?Math.hypot(d,f)<=i.radius:i.shape==="ellipse"?Math.hypot(d/Math.max(1,i.radiusX),f/Math.max(1,i.radiusY))<=1:Math.abs(d)<=i.width*.5&&Math.abs(f)<=i.height*.5))return!1;const m=i.x,g=i.y,v=n;return zo(x=>{const y=us(this.ctx,x.clientX,x.clientY);i.x=m+y.x-v.x,i.y=g+y.y-v.y}),!0}onForceFieldDown(e){const t=this.ctx.store.systems.find(h=>h.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const i=t==null?void 0:t.config;if(!(i!=null&&i.forceField)||i.forceRadius<=0)return!1;const n=us(this.ctx,e.clientX,e.clientY);if(Math.hypot(n.x-i.forceCenterX,n.y-i.forceCenterY)>i.forceRadius)return!1;const o=i.forceCenterX,a=i.forceCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const c=h=>{const u=us(this.ctx,h.clientX,h.clientY);i.forceCenterX=o+u.x-n.x,i.forceCenterY=a+u.y-n.y},l=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)};return window.addEventListener("pointermove",c),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),e.preventDefault(),!0}onAttractionDown(e){const t=this.ctx.store.systems.find(u=>u.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const i=t==null?void 0:t.config;if(!(i!=null&&i.attraction))return!1;const n=us(this.ctx,e.clientX,e.clientY),r=Math.max(i.attractionRadius,12/Math.max(1e-4,this.ctx.store.editor.viewScale));if(Math.hypot(n.x-i.attractionCenterX,n.y-i.attractionCenterY)>r)return!1;const a=i.attractionCenterX,c=i.attractionCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const l=u=>{const d=us(this.ctx,u.clientX,u.clientY);i.attractionCenterX=a+d.x-n.x,i.attractionCenterY=c+d.y-n.y},h=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h)};return window.addEventListener("pointermove",l),window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h),e.preventDefault(),!0}selectedTransformTarget(){const e=this.ctx.store,t=e.activeObjectId;if(e.activeObjectType==="particle"){const r=e.systems.find(a=>a.id===t);if(!r||r.visible===!1)return null;const o=r.config;return{x:o.centerX,y:o.centerY,rotation:o.rootRotation,scaleX:o.rootScaleX??1,scaleY:o.rootScaleY??1,setPosition:(a,c)=>{o.centerX=a,o.centerY=c},setRotation:a=>{o.rootRotation=a},setScale:(a,c)=>{o.rootScaleX=a,o.rootScaleY=c}}}const n=(e.activeObjectType==="collision"?e.colliders:e.activeObjectType==="path"?e.paths:e.spines).find(r=>r.id===t);return!n||n.visible===!1?null:{x:Number(n.x)||0,y:Number(n.y)||0,rotation:Number(n.rotation)||0,scaleX:Math.max(.05,Number(n.scaleX)||1),scaleY:Math.max(.05,Number(n.scaleY)||1),setPosition:(r,o)=>{n.x=r,n.y=o},setRotation:r=>{n.rotation=r},setScale:(r,o)=>{n.scaleX=r,n.scaleY=o}}}onGizmoDown(e){const t=this.selectedTransformTarget();if(!t)return;const i=this.ctx.app(),n=this.ctx.store,r=n.editor.viewScale,o=this.ctx.holder.value.getBoundingClientRect(),a=o.left+i.screen.width/2+n.editor.viewX+t.x*r,c=o.top+i.screen.height*.5+n.editor.viewY+-t.y*r,l=e.clientX,h=e.clientY,u=this.getTool(),d=t.x,f=t.y,p=t.rotation,m=t.scaleX,g=t.scaleY,v=Math.hypot(l-a,h-c)||1,x=Math.atan2(h-c,l-a);zo(_=>{const C=(_.clientX-l)/r,S=(_.clientY-h)/r;if(u==="translate")t.setPosition(d+C,f-S);else if(u==="rotate"){const b=Math.atan2(_.clientY-c,_.clientX-a);t.setRotation(p-(b-x)*180/Math.PI)}else if(u==="scale"){const M=Math.hypot(_.clientX-a,_.clientY-c)/v;t.setScale(Math.max(.05,m*M),Math.max(.05,g*M))}})}}function Pv(s,e,t,i,n){const r=1-n;return r*r*r*s+3*r*r*n*e+3*r*n*n*t+n*n*n*i}function kv(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(s.scaleX??1)),a=Math.max(1e-4,Math.abs(s.scaleY??1));return{x:s.x+n*e*o-r*t*a,y:s.y+r*e*o+n*t*a}}function gp(s,e){if(!s.points.length)return null;if(s.points.length===1)return{...kv(s,s.points[0].x,s.points[0].y),angle:s.rotation};const t=s.closed?s.points.length:s.points.length-1,i=[];let n=0;for(let p=0;p0&&v===0)continue;const x=v/20,y=Pv(m.x,m.x+m.outX,g.x+g.inX,g.x,x),_=Pv(m.y,m.y+m.outY,g.y+g.inY,g.y,x),C=kv(s,y,_),S=i[i.length-1];S&&(n+=Math.hypot(C.x-S.x,C.y-S.y)),i.push({...C,distance:n})}}const r=Math.min(1,Math.max(0,e))*n;let o=i.findIndex(p=>p.distance>=r);o<0&&(o=i.length-1);const a=i[o],c=i[Math.max(0,o-1)],l=i[Math.min(i.length-1,o+1)],h=c.distance,u=o>0?(r-h)/Math.max(1e-4,a.distance-h):0,d=c.x+(a.x-c.x)*Math.min(1,Math.max(0,u)),f=c.y+(a.y-c.y)*Math.min(1,Math.max(0,u));return{x:d,y:f,angle:Math.atan2(l.y-c.y,l.x-c.x)*180/Math.PI}}function yh(s,e,t,i=Math.max(1e-4,Math.abs(s.rootScaleX)),n=Math.max(1e-4,Math.abs(s.rootScaleY))){const r=-s.rootRotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),c=e-s.centerX,l=-t+s.centerY;return{x:(o*c+a*l)/i,y:(-a*c+o*l)/n}}function wF(s,e,t){const i=gp(e,t);if(!i)return null;const n=yh(s,i.x,i.y),r=i.angle*Math.PI/180,o=yh(s,i.x+Math.cos(r),i.y+Math.sin(r)),a=Math.atan2(o.y-n.y,o.x-n.x)*180/Math.PI;return{...n,angle:a}}function SF(s,e){return s.colliders.map(t=>{if(!t.followPath||!t.followPathId)return t;const i=s.paths.find(h=>h.id===t.followPathId&&h.enabled);if(!(i!=null&&i.points.length))return t;const n=Math.max(.05,Number(t.followDuration)||2),r=Math.min(1,Math.max(0,e/n)),o=Array.isArray(t.followCurve)?t.followCurve:[{x:0,y:0},{x:1,y:1}],a=t.followCurveMode==="跟随导出"?s.settings.exportSettings.keyframeCurve==="bezier"?"bezier":"linear":t.followCurveMode==="贝塞尔"?"bezier":"linear",c=Math.min(1,Math.max(0,n1(o,r,a))),l=gp(i,c);return l?{...t,x:l.x,y:l.y,rotation:t.rotation+(t.followPathRotation?l.angle:0)}:t})}class _F{constructor(){w(this,"emitters",new Map);w(this,"configs",new Map)}sync(e,t,i,n){for(const[r,o]of this.emitters){const a=e.systems.find(c=>c.id===r);(!a||this.configs.get(r)!==a.config)&&(t.removeChild(o),o.destroy({children:!0}),this.emitters.delete(r),this.configs.delete(r))}for(const r of e.systems){i&&!r.config.texture&&(r.config.texture=i);const o=pr(r.config);if(n)for(const c of o.trailResources)!c.texture&&(c.previewUrl==="/images/trail.png"||c.previewUrl==="/trails/trail.png")&&(c.texture=n);if(i)for(const c of o.imageResources)!c.texture&&c.textureName==="star"&&(c.texture=i);if(this.emitters.has(r.id))continue;const a=new LI(r.config);t.addChild(a),this.emitters.set(r.id,a),this.configs.set(r.id,r.config)}}destroy(e){for(const[t,i]of this.emitters)e.removeChild(i),i.destroy({children:!0}),this.emitters.delete(t),this.configs.delete(t)}}async function TF(){const[s,e]=await Promise.all([ze.fromURL("/images/star.png"),ze.fromURL("/images/trail.png")]);return{dotTex:s,trailTex:e}}function MF(s,e,t){for(const i of s.systems){i.config.texture=e;const n=pr(i.config);if(t)for(const r of n.trailResources)!r.texture&&(r.previewUrl==="/images/trail.png"||r.previewUrl==="/trails/trail.png")&&(r.texture=t);for(const r of n.imageResources)!r.texture&&r.textureName==="star"&&(r.texture=e)}}const CF={class:"stage-wrap"},AF={key:0,class:"hud"},EF={class:"hud-number hud-system-count"},IF={class:"hud-number hud-particle-count"},RF=Jt({__name:"Stage",setup(s){const e=ao(),t=Ge(null),i=Ge(null),n=Ge(!1),r=Ge(!1),o=Ge(""),a=Ge(!1);e.settings.undoLimit>0||(e.settings.undoLimit=20),e.settings.parameterPanelOnRight==null&&(e.settings.parameterPanelOnRight=!0),Number.isFinite(e.settings.backgroundX)||(e.settings.backgroundX=0),Number.isFinite(e.settings.backgroundY)||(e.settings.backgroundY=0),Number.isFinite(e.settings.backgroundOpacity)||(e.settings.backgroundOpacity=1),e.settings.backgroundImageName==null&&(e.settings.backgroundImageName=""),e.settings.backgroundImageData==null&&(e.settings.backgroundImageData=""),e.settings.showEmitter==null&&(e.settings.showEmitter=!0),e.settings.showBones==null&&(e.settings.showBones=!1),e.settings.bonePointDrawSize>0||(e.settings.bonePointDrawSize=1),e.settings.boneAxisDrawSize>0||(e.settings.boneAxisDrawSize=2),e.settings.showSkinMesh==null&&(e.settings.showSkinMesh=!1),e.settings.showGrid==null&&(e.settings.showGrid=!0);let c=null,l=null,h=null,u=null,d=null,f=null,p=null,m=null,g=null,v=null,x=null,y=null,_=null,C=null,S=[],b=0,M=0,I=0,F=0,E=null,k=null;const O=new sf,D=new _F,$={store:e,holder:t,app:()=>c},N=new xF($),U=new bF($,()=>o.value);let A=[];const P=new Map;function L(){l=new Si,c.stage.addChild(l),_=new Si,c.stage.addChild(_),O.createSprite(l),y=new zi,l.addChild(y),C=new mR,l.addChild(C.container),u=new zi,l.addChild(u),h=new zi,l.addChild(h),f=new zi,l.addChild(f),p=new zi,l.addChild(p),m=new zi,l.addChild(m),g=new zi,l.addChild(g),v=new zi,l.addChild(v),x=new zi,l.addChild(x),d=new zi,l.addChild(d)}function B(le){if(le.button===0){if(o.value&&U.selectedTransformTarget()){U.onGizmoDown(le);return}N.onPointerDown(le)||U.onColliderPointerDown(le)||U.onAttractionDown(le)||U.onForceFieldDown(le)||Dk($,le.clientX,le.clientY)}}function X(le){N.onStageDoubleClick(le)}function V(le){Lk($,le)}function q(le=!0){sf.clearStoreBackground(e,le)}async function W(le){await sf.handleFileChange(e,le)}nk({canvasElement:t,canvasFocused:a,undo:gw,save:()=>hw(e),togglePlay:()=>e.togglePlay(),toStart:()=>e.toStart(),setTool:le=>{o.value=le}});function ne(){l&&D.sync(e,l,E,k)}function re(){var ae,xe,Y;F=requestAnimationFrame(re);const le=performance.now()/1e3;let ue=le-b;if(b=le,ue>.1&&(ue=.1),c&&l){l.scale.set(e.editor.viewScale),l.position.set(c.screen.width/2+e.editor.viewX,c.screen.height*.5+e.editor.viewY),O.applyTransform(e.settings.backgroundX,e.settings.backgroundY,e.settings.backgroundOpacity),KI(e,c,y,_,S),ne();const j=Math.max(1,e.timeline.fps),H=e.timeline.frame,G=H/j;C==null||C.sync(e.spines,H,j),A=SF(e,G);for(const Me of e.systems){const ve=D.emitters.get(Me.id);if(!ve)continue;ve.setFollowExportCurveMode(e.settings.exportSettings.keyframeCurve==="bezier"?"贝塞尔":"线性");const Xe=Me.visible!==!1;ve.visible=Xe,ve.renderable=Xe;const pe=Me.config;ve.scale.set(pe.rootScaleX,pe.rootScaleY);const Ke=new Set(pe.collisionColliderIds);ve.setColliders(pe.collision?A.filter($e=>Ke.has($e.id)):[]),ve.setEmitterFollowSpawn(0,0,0);let Ze={x:pe.centerX,y:pe.centerY,rotation:pe.rootRotation};const Ct=pe.emitterFollow&&pe.emitterFollowMode==="bone"?e.spines.find($e=>$e.id===pe.emitterFollowSpineId&&$e.enabled&&$e.status==="ready"):null,Lt=Ct&&(C==null?void 0:C.getBoneWorldTransform(Ct.id,pe.emitterFollowBoneName))||null,ii=pe.emitterFollow&&pe.emitterFollowMode==="path"?e.paths.find($e=>$e.id===pe.emitterFollowPathId&&$e.enabled):null,rs=Math.max(.05,pe.emitterFollowDuration),zt=Math.min(1,Math.max(0,G/rs)),se=Math.min(1,Math.max(0,n1(pe.emitterFollowCurve,zt))),he=Math.min(1,Math.max(0,pe.emitterFollowOffset)),ot=pe.emitterFollowDirection==="reverse"?(1-he)*(1-se):he+(1-he)*se,at=ii?gp(ii,ot):null;if(Lt){const $e=pe.emitterFollowBoneOffsetX,_i=pe.emitterFollowBoneOffsetY,pi=Lt.x+$e,$t=Lt.y+_i,Fi=pe.rootRotation+pe.emitterFollowBoneRotation,vs=Math.max(1e-4,Math.abs(pe.rootScaleX*pe.emitterFollowBoneScaleX)),Vi=Math.max(1e-4,Math.abs(pe.rootScaleY*pe.emitterFollowBoneScaleY));if(Ze={x:pi,y:$t,rotation:Fi},pe.emitterFollowSpace==="local")ve.position.set(pi,-$t),ve.rotation=-Fi*Math.PI/180,ve.scale.set(vs,Vi),ve.setSimulationTransform(pi,$t,Fi,vs,Vi);else{ve.position.set(pe.centerX,-pe.centerY),ve.rotation=-pe.rootRotation*Math.PI/180,ve.scale.set(vs,Vi),ve.setSimulationTransform(pe.centerX,pe.centerY,pe.rootRotation,vs,Vi);const Ti=yh(pe,pi,$t,vs,Vi),uo=-(Fi-pe.rootRotation);ve.setEmitterFollowSpawn(Ti.x,Ti.y,uo)}}else if(at){const $e=at.angle+(pe.emitterFollowDirection==="reverse"?180:0),_i=pe.emitterAngleMode==="direction"?$e:pe.rootRotation;if(Ze={x:at.x,y:at.y,rotation:_i},pe.emitterFollowSpace==="local")ve.position.set(at.x,-at.y),ve.rotation=-_i*Math.PI/180,ve.setSimulationTransform(at.x,at.y,_i);else{ve.position.set(pe.centerX,-pe.centerY),ve.rotation=-pe.rootRotation*Math.PI/180,ve.setSimulationTransform(pe.centerX,pe.centerY,pe.rootRotation);const pi=yh(pe,at.x,at.y),$t=pe.emitterAngleMode==="direction"?-($e-pe.rootRotation):0;ve.setEmitterFollowSpawn(pi.x,pi.y,$t)}}else ve.position.set(pe.centerX,-pe.centerY),ve.rotation=-pe.rootRotation*Math.PI/180,ve.setSimulationTransform(pe.centerX,pe.centerY,pe.rootRotation);const gt=pe.shape==="path"&&pe.spawnPathId>0&&e.paths.find($e=>$e.id===pe.spawnPathId&&$e.enabled&&$e.points.length>0)||null;ve.setSpawnPathSampler(gt?$e=>wF(pe,gt,$e):null,(gt==null?void 0:gt.closed)===!0),P.set(Me.id,Ze)}let z=0;const ie=[],fe=e.settings.showBones&&e.activeObjectType==="particle"?e.activeObjectId:0,te=(Me,ve,Xe)=>{!Me||Me.id!==fe||Me.visible===!1||aR(ie,Xe,ve.position.x,ve.position.y)},oe=e.timeline,ce=oe.fps,Ce=1/Math.max(1,ce);let ye=I,we=0;if(oe.playing?(M+=ue,we=Math.floor(M/Ce),we>0&&(M-=we*Ce)):M=0,oe.playing&&we>0)for(let Me=0;MeZe.id===e.activeId),Xe=(ve==null?void 0:ve.config.mode)==="stream"&&ve.config.streamBehavior==="loop"?t1(ve.config,ce):null,Ke=oe.loop&&(Xe==null?void 0:Xe.start)===oe.playbackStart&&Xe.end===oe.playbackEnd?oe.playbackEnd-1:oe.playbackEnd;if(oe.frame>Ke)if(oe.loop)oe.frame=oe.playbackStart;else{oe.frame=oe.playbackEnd,oe.playing=!1;break}}else{if(oe.frame===0)for(const ve of e.systems){const Xe=D.emitters.get(ve.id);Xe&&(ve.config.mode==="stream"&&ve.config.streamBehavior==="loop"?fR(ve,Xe,ce,oe.totalFrames):Xe.reset())}for(const[ve,Xe]of D.emitters){const pe=e.systems.find(ii=>ii.id===ve),Ke=(pe==null?void 0:pe.config.mode)==="stream"&&pe.config.streamBehavior==="loop",Ze=Ke?(ae=pe.frames)==null?void 0:ae[oe.frame]:void 0,Ct=oe.frame===0&&!Ke,Lt=Ct?[]:Ze||Xe.update(Ce);if(Ct?Xe.apply([]):Ze&&Xe.apply(Ze),(pe==null?void 0:pe.visible)!==!1)for(const ii of Lt)ii.active&&te(pe,Xe,ii);z+=Lt.length}for(const ve of e.systems){if(!ve.config.texture)continue;ve.frames=ve.frames||[];const Xe=D.emitters.get(ve.id);Xe&&!(ve.config.mode==="stream"&&ve.config.streamBehavior==="loop")&&(ve.frames[oe.frame]=Xe.capture())}oe.frame++,oe.frame>=oe.totalFrames&&(oe.frame=oe.playbackStart,oe.recorded=!0)}else{oe.playing||(ye=oe.frame);for(const Me of e.systems){const ve=D.emitters.get(Me.id),Xe=oe.playing?I:oe.frame,pe=(Y=Me.frames)==null?void 0:Y[Xe],Ke=Me.config.mode==="stream"&&Me.config.streamBehavior==="loop"&&!!pe;if((oe.recorded||Ke)&&ve&&pe){ve.apply(pe);for(const Ze of pe)Ze.active&&(te(Me,ve,Ze),z++)}else if(ve){const Ze=oe.frame===0?[]:ve.update(0);if(oe.frame===0&&ve.apply([]),Me.visible!==!1)for(const Ct of Ze)Ct.active&&te(Me,ve,Ct);z+=ve.activeCount}}}I=ye,C==null||C.sync(e.spines,ye,ce);for(const[,Me]of D.emitters)Me.drawTrailMeshDebug(e.settings.showSkinMesh);rR(e,A,g),oR(e,N.selectedNodes,v),iR(e,C,u),ZI(e,P,h),JI(e,P,f),QI(e,p),eR(e,m),sR(o,U.selectedTransformTarget.bind(U),x),lR(ie,e,d),i.value&&(i.value.systems=e.systems.length,i.value.particles=z)}}return Vn(async()=>{const le=t.value;c=new Ab({width:le.clientWidth||800,height:le.clientHeight||600,backgroundAlpha:0,antialias:!0}),le.appendChild(c.view),L(),Xi(()=>e.settings.backgroundImageData,ae=>O.syncTexture(ae),{immediate:!0});const ue=await TF();E=ue.dotTex,k=ue.trailTex,MF(e,E,k),i.value={systems:e.systems.length,particles:0},e.timeline.recorded=!1,e.timeline.frame=0,M=0,I=0,e.timeline.playing=!0,e.timeline.loop=!0;for(const ae of e.systems)ae.frames=[];e.recalcTotalFrames(),b=performance.now()/1e3,re(),Xi(()=>e.systems.map(ae=>JSON.stringify(ae.config,(xe,Y)=>xe==="texture"||xe==="trailTexture"||xe==="previewUrl"?void 0:Y)).join("|")+`|colliders:${JSON.stringify(e.colliders)}|paths:${JSON.stringify(e.paths)}`,()=>{e.recalcTotalFrames(),e.timeline.recorded=!1,e.timeline.frame=0;for(const ae of e.systems)ae.frames=[];e.timeline.playing=!0,e.timeline.loop=!0}),tk(e)}),gl(()=>{cancelAnimationFrame(F),C==null||C.destroy(),C=null,O.destroy(),l&&c&&D.destroy(l),c&&(c.destroy(!0,{children:!0}),c=null)}),Xi(()=>[e.activeObjectType,e.activeObjectId],()=>N.resetSelection()),(le,ue)=>(K(),Q("div",CF,[T("div",{ref_key:"holder",ref:t,class:Le(["stage-holder",{grid:R(e).settings.showGrid}]),tabindex:"0",onWheel:et(V,["prevent"]),onPointerdown:B,onDblclick:et(X,["prevent"])},null,34),be(eF,{ctx:$,"active-tool":o.value,"show-settings":n.value,"show-help":r.value,"onUpdate:activeTool":ue[0]||(ue[0]=ae=>o.value=ae),"onUpdate:showSettings":ue[1]||(ue[1]=ae=>n.value=ae),"onUpdate:showHelp":ue[2]||(ue[2]=ae=>r.value=ae),onClearBackground:q,onBackgroundFile:W},null,8,["active-tool","show-settings","show-help"]),be(yF,{show:n.value,onClose:ue[3]||(ue[3]=ae=>n.value=!1)},null,8,["show"]),be(Bk,{show:r.value,onClose:ue[4]||(ue[4]=ae=>r.value=!1)},null,8,["show"]),i.value?(K(),Q("div",AF,[ue[5]||(ue[5]=At(" 系统: ",-1)),T("b",EF,_e(i.value.systems),1),ue[6]||(ue[6]=At(" · 粒子(骨骼): ",-1)),T("b",IF,_e(i.value.particles),1),ue[7]||(ue[7]=At(" · 根骨骼: ",-1)),ue[8]||(ue[8]=T("b",null,"root",-1)),ue[9]||(ue[9]=T("span",{class:"hud-tip"},"滚轮缩放 · 左键拖动画布",-1))])):Te("",!0)]))}}),PF=Qt(RF,[["__scopeId","data-v-b4c5a353"]]),kF=[{x:0,y:0},{x:1,y:1}],cm=[{x:0,y:1},{x:1,y:1}],FF=[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],hm=[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}],um=[{x:0,y:1},{x:1,y:1}],dm=[{x:0,y:1},{x:1,y:1}],qt=no({visible:!1,title:"",detail:"",progress:0,indeterminate:!1,failed:!1});let uc=0;function OF(s){return new Promise(e=>window.setTimeout(e,s))}function yw(s,e){const t=++uc,i=performance.now();Object.assign(qt,{visible:!0,title:s,detail:e,progress:0,indeterminate:!1,failed:!1});const n=(o,a)=>{t===uc&&(qt.indeterminate=o==null,o!=null&&(qt.progress=Math.min(100,Math.max(0,o))),a&&(qt.detail=a))},r=async(o,a)=>{if(t!==uc)return;qt.failed=o,qt.indeterminate=!1,qt.progress=o?qt.progress:100,qt.detail=a,await OF(Math.max(180,(o?850:450)-(performance.now()-i))),t===uc&&(qt.visible=!1)};return{update:n,paint:()=>new Promise(o=>requestAnimationFrame(()=>o())),finish:(o="已完成")=>r(!1,o),fail:(o="操作失败")=>r(!0,o)}}async function BF(s,e){if(!s.body)return e(null),s.text();const t=Number(s.headers.get("content-length")),i=Number.isFinite(t)&&t>0,n=s.body.getReader(),r=new TextDecoder;let o=0,a="";for(e(i?0:null);;){const{done:c,value:l}=await n.read();if(c)break;o+=l.byteLength,a+=r.decode(l,{stream:!0}),e(i?Math.min(1,o/t):null)}return a+=r.decode(),i&&e(1),a}const LF="3.8";function ds(s,e,t){s[e]==null&&s[t]!=null&&(s[e]=s[t]),delete s[t]}function fm(s){if(!s||typeof s!="object")return;if(Array.isArray(s)){for(const t of s)fm(t);return}const e=s;Array.isArray(e.curve)&&delete e.curve;for(const t of Object.values(e))fm(t)}function DF(s){for(const e of s.bones)ds(e,"transform","inherit");for(const e of s.transform||[])ds(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),e.scaleMix==null&&(e.scaleMix=e.mixScaleX??e.mixScaleY),ds(e,"shearMix","mixShearY"),delete e.mixX,delete e.mixY,delete e.mixScaleX,delete e.mixScaleY;for(const e of s.path||[])ds(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),delete e.mixX,delete e.mixY;for(const e of s.skins)for(const t of Object.values(e.attachments||{}))for(const i of Object.values(t||{}))i.parent!=null&&ds(i,"deform","timelines")}function NF(s){for(const e of Object.values(s.slots||{}))ds(e,"color","rgba"),ds(e,"twoColor","rgba2")}function UF(s){for(const e of Object.values(s.bones||{}))for(const t of e.rotate||[])ds(t,"angle","value")}function $F(s){for(const e of Object.values(s.transform||{}))for(const t of e)ds(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),t.scaleMix==null&&(t.scaleMix=t.mixScaleX??t.mixScaleY),ds(t,"shearMix","mixShearY"),delete t.mixX,delete t.mixY,delete t.mixScaleX,delete t.mixScaleY}function XF(s){for(const e of Object.values(s.path||{})){for(const t of["position","spacing"])for(const i of e[t]||[])ds(i,t,"value");for(const t of e.mix||[])ds(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),delete t.mixX,delete t.mixY}}function VF(s){if(!s.attachments)return;const e=s.deform||(s.deform={});for(const[t,i]of Object.entries(s.attachments)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(i)){const a=n[r]||(n[r]={});for(const[c,l]of Object.entries(o))l.deform&&(a[c]=l.deform)}}delete s.attachments}function YF(s){s.skeleton.spine=LF,DF(s);for(const e of Object.values(s.animations))NF(e),UF(e),$F(e),XF(e),VF(e);return fm(s.animations),s}function GF(s,e,t,i){const n=t.frame-e.frame,r=n<=0?0:(s.frame-e.frame)/n;let o=0;for(let a=0;a[...i].sort((o,a)=>o-a);let r=!0;for(;r;){r=!1;const o=n();for(let a=0;au&&(u=f,h=d)}h>=0&&(i.add(h),r=!0)}}return n().map(o=>s[o])}function Fv(s,e,t,i,n){const r=t-e+1;if(r<2)return 0;const o=n?e:t,a=n?e+1:t-1,c=n?e+2:t-2,l=Math.abs(s[a].frame-s[o].frame);if(r>=3&&l>0&&Math.abs(Math.abs(s[c].frame-s[a].frame)-l)<1e-6){const u=s[o].values[i],d=s[a].values[i],f=s[c].values[i];return n?(-3*u+4*d-f)/(2*l):(3*u-4*d+f)/(2*l)}const h=s[a].frame-s[o].frame;return h?(s[a].values[i]-s[o].values[i])/h:0}function Ov(s,e,t){const i=s[t].frame-s[e].frame,n=[];for(let r=0;rd.values[r])),l=Math.max(...s.slice(e,t+1).map(d=>d.values[r])),h=o+Fv(s,e,t,r,!0)*i/3,u=a-Fv(s,e,t,r,!1)*i/3;n.push([Math.max(c,Math.min(l,h)),Math.max(c,Math.min(l,u))])}return{values:n}}function HF(s,e,t,i,n){const r=1-n;return r*r*r*s+3*r*r*n*e+3*r*n*n*t+n*n*n*i}function jF(s,e,t,i,n){const r=t.frame-e.frame,o=r<=0?0:(s.frame-e.frame)/r;let a=0;for(let c=0;c[...i].sort((a,c)=>a-c);let r=!0;for(;r;){r=!1;const a=n();for(let c=0;cf&&(f=m,d=p)}d>=0&&(i.add(d),r=!0)}}const o=n();return{samples:o.map(a=>s[a]),controls:o.slice(0,-1).map((a,c)=>Ov(s,a,o[c+1]))}}function WF(s){if(!s.length)return[];const e=[s[0]];for(let t=1;t180;)i-=360;for(;i-e[t-1]<-180;)i+=360;e.push(i)}return e}function ti(s){if(!Number.isFinite(s))return 0;const e=Math.round(s*1e5)/1e5;return Object.is(e,-0)?0:e}function zF(s,e,t,i){const n=Math.max(2,Math.min(16,Math.round(Number(s.trailGridRows)||2))),r=Math.max(2,Math.min(32,Math.round(Number(s.trailGridCols)||2))),o=Math.max(2,t.length),a=e.lengthMode==="random"?Math.max(1,Number(e.lengthMin)||0,Number(e.lengthMax)||0):Math.max(.001,Number(e.length)||100),c=e.widthSizeMode==="random"?Math.max(1,Number(e.widthMin)||0,Number(e.widthMax)||0):Math.max(.001,Number(e.width)||100),l=(Number(e.rotation)||0)*Math.PI/180,h=Math.cos(l),u=Math.sin(l),d=[],f=[],p=[],m=[],g=[];for(let y=0;y=0;y--)g.push({col:y,row:n-1});for(let y=n-2;y>=1;y--)g.push({col:0,row:y});const v=g.length;for(let y=1;y|\s]+/g,"_").replace(/^_+|_+$/g,"")||e}function ww(s,e){let t=s,i=2;for(;e.has(t);)t=`${s}_${i++}`;return e.add(t),t}function KF(s){return s.replace(/\.[^./\\]+$/,"")}function Sw(s,e){return KF([s,e].filter(Boolean).join("/").replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/^\.\//,""))}function ZF(s){var i,n;const e=Number(((i=s==null?void 0:s.orig)==null?void 0:i.width)??(s==null?void 0:s.width))||0,t=Number(((n=s==null?void 0:s.orig)==null?void 0:n.height)??(s==null?void 0:s.height))||0;return{width:e,height:t}}function fc(s){return Math.round(Math.max(0,Math.min(1,s))*255).toString(16).padStart(2,"0")}function Uv(s,e){return[(s>>16&255)/255,(s>>8&255)/255,(s&255)/255,Math.max(0,Math.min(1,e))]}function Ga(s,e){return ti(s/e)}function JF(s,e){const t=s.config,i=t.lifeMode==="fixed"?Math.max(0,Number(t.lifeMin)||0):Math.max(0,Number(t.lifeMin)||0,Number(t.lifeMax)||0),n=Math.max(0,Number(t.delay)||0);let r;return t.mode!=="stream"?r=n+i:t.streamBehavior!=="loop"?r=n+Math.max(1/e,Number(t.duration)||0)+i:r=n+lr(t,e).total/e,Math.max(1,Math.ceil(r*e)+1)}function xh(s,e){return e?s.boneName:`${s.spawnId??"legacy"}_${s.boneName}`}function QF(s,e,t){const i=new Set;for(const n of s)for(const r of n)i.add(xh(r,e));return[...i].sort().map((n,r)=>({key:n,name:ww(`_particle_${String(r).padStart(3,"0")}`,t),states:s.map(o=>o.find(a=>xh(a,e)===n)||null)}))}function $v(s,e){const t=new Set(e.states.map(i=>i==null?void 0:i.resourceId).filter(i=>typeof i=="number"));return s.config.imageResources.filter(i=>t.has(i.id))}function e3(s,e,t,i){const n=e*t/i,r=Math.min(s.states.length-1,Math.max(0,Math.floor(n))),o=Math.min(s.states.length-1,r+1),a=s.states[r],c=s.states[o];if(!a||!c||xh(a,!0)!==xh(c,!0)||a.spawnId!==c.spawnId)return a;const l=n-r;if(l<=1e-6)return a;const h=(d,f)=>(d??0)+((f??d??0)-(d??0))*l,u=a.trailState&&c.trailState&&a.trailState.resourceId===c.trailState.resourceId?{...a.trailState,width:h(a.trailState.width,c.trailState.width),alpha:h(a.trailState.alpha,c.trailState.alpha),bones:a.trailState.bones.map((d,f)=>{const p=c.trailState.bones[f]||d;return{...d,worldX:h(d.worldX??d.x,p.worldX??p.x),worldY:h(d.worldY??d.y,p.worldY??p.y),worldRotation:h(d.worldRotation??-d.rotation,p.worldRotation??-p.rotation)}})}:a.trailState;return{...a,worldX:h(a.worldX,c.worldX),worldY:h(a.worldY,c.worldY),worldRotation:h(a.worldRotation,c.worldRotation),worldScaleX:h(a.worldScaleX,c.worldScaleX),worldScaleY:h(a.worldScaleY,c.worldScaleY),alpha:h(a.alpha,c.alpha),trailState:u}}function Xv(s,e){return!s||s==="跟随导出"?e.keyframeCurve:s==="贝塞尔"?"bezier":"linear"}function _o(s,e,t,i,n,r=new Set,o=n.keyframeCurve){if(!s.length)return[];const a=o==="bezier"&&n.spineVersion!=="3.8"?bw(s,i,r):{samples:xw(s,i,r),controls:[]},c=a.samples.map(l=>{const h={time:Ga(l.frame,e)};return t.forEach((u,d)=>{h[u]=ti(l.values[d])}),h});for(let l=0;l0&&n&&e.add(t-1),i&&e.add(t))}return e}function i3(s){const e=new Set;for(let t=0;t0&&n&&e.add(t-1),i&&e.add(t))}return e}function s3(s,e){var i;if(!s.shapeEnabled||!((i=s.shapeCurve)!=null&&i.length))return 1;const t=[...s.shapeCurve].sort((n,r)=>n.x-r.x);if(e<=t[0].x)return Math.max(0,t[0].y);for(let n=1;n{r!==n&&(i.push(t(r,o)),n=r)}),i}function r3(s,e,t){const i=s.imageMode==="sequence"?s.sequenceFrames[e]:void 0,n=(i==null?void 0:i.name)||s.textureName||`image_${s.id}`,r=(i==null?void 0:i.texture)||s.texture,o=ZF(r);(!o.width||!o.height)&&t.push({code:"missing-image",message:`图片“${n}”缺失或尺寸不可读,已保留路径。`});const a=o.width||1,c=o.height||1;return{path:Sw(s.textureFolder,n),x:ti((.5-s.anchorX)*a),y:ti((s.anchorY-.5)*c),width:ti(a),height:ti(c)}}function o3(s,e,t,i,n=i.keyframeCurve){if(!s.length)return[];const r=new Set;for(let h=1;h({frame:u,values:h})),a=1/255,c=n==="bezier"&&i.spineVersion!=="3.8"?bw(o,[a,a,a,.01],r):{samples:xw(o,[a,a,a,.01],r),controls:[]},l=c.samples.map(h=>({time:Ga(h.frame,t),color:`${fc(h.values[0])}${fc(h.values[1])}${fc(h.values[2])}${fc(h.values[3])}`}));if(c.controls.length)for(let h=0;h({time:Ga(d,n),name:u??null}));c.length&&(a.attachment=c);const l=o3(i,t,n,r,o);l.length&&(a.rgba=l)}function Yv(s){var p;const e=s.settings,t=Math.max(1,Number(s.timeline.fps)||30),i=Math.max(1,Math.round(e.fps||30)),n=e.integerFrameAlignment?i:t,r=[],o=s.systems.filter(m=>m.visible!==!1),a={skeleton:{hash:"",spine:e.spineVersion,x:0,y:0,width:0,height:0,images:e.imagesPath||"./images/"},bones:[{name:"root"}],slots:[],skins:[{name:"default",attachments:{}}],animations:{}};e.omitFps||(a.skeleton.fps=i);const c=a.skins[0].attachments,l=new Set(["root"]),h=[...new Set([...s.timeline.animations.length?s.timeline.animations:["animation"],...o.map(m=>m.animation||"animation")])],u=new Map;for(const m of o){const g=Math.min(((p=m.frames)==null?void 0:p.length)||0,JF(m,t)),v=(m.frames||[]).slice(0,g);v.length||r.push({code:"empty-cache",message:`“${m.config.name}”没有可用帧缓存。`});const x=ww(qF(m.config.name,`system_${m.id}`),l);a.bones.push({name:x,parent:"root"});const y=QF(v,e.bonePool,l),_=Math.max(0,(g-1)/t),C=Math.max(1,Math.ceil(_*n)+1),S=u.get(m.animation)||[];S.push({system:m,tracks:y,targetFrames:C}),u.set(m.animation,S);for(const b of y){a.bones.push({name:b.name,parent:x});const M=$v(m,b),I=new Set(M.map(O=>O.blend));for(const O of I){const D=`${b.name}_image_${O}`;a.slots.push({name:D,bone:b.name,color:"ffffff00",blend:Bv[O]});const $=c[D]||(c[D]={});for(const N of M.filter(U=>U.blend===O)){const U=N.imageMode==="sequence"?Math.max(1,N.sequenceFrames.length):1;for(let A=0;A{var L;return((L=P==null?void 0:P.trailState)==null?void 0:L.resourceId)===O.id}))continue;const D=Math.max(2,Math.min(16,Math.round(O.boneCount||3))),$=[];for(let P=0;Pa.bones.findIndex(L=>L.name===P)),A=Sw("",O.textureName||`trail_${O.id}`);(c[N]||(c[N]={}))[`trail_${O.id}`]=zF(m.config,O,U,A),O.texture||r.push({code:"missing-image",message:`拖尾图片“${O.textureName||O.id}”缺失,已保留路径。`})}const F=`${b.name}_image_`,E=`${b.name}_trail_`,k=a.slots.filter(O=>String(O.name).startsWith(F)||String(O.name).startsWith(E));k.length&&(a.slots=a.slots.filter(O=>!k.includes(O)),a.slots.push(...k.filter(O=>String(O.name).startsWith(E)),...k.filter(O=>String(O.name).startsWith(F))))}}for(const m of h){const g=u.get(m)||[],v={bones:{},slots:{}};let x=!1;for(const{system:y,tracks:_,targetFrames:C}of g)for(const S of _){const b=Array.from({length:C},(B,X)=>e3(S,X,t,n)),M=b.map(B=>!!(B!=null&&B.active)),I=[],F=[],E=[];b.forEach((B,X)=>{B!=null&&B.active&&(I.push({frame:X,values:[B.worldX??B.x,B.worldY??B.y]}),F.push(B.worldRotation??B.rotation),E.push({frame:X,values:[B.worldScaleX??B.scaleX,B.worldScaleY??B.scaleY]}))});const k=WF(F),O=I.map((B,X)=>({frame:B.frame,values:[k[X]??0]})),D=t3(b),$={},N=_o(I,n,["x","y"],[Lv,Lv],e,D),U=_o(O,n,["value"],[Nv],e,D),A=_o(E,n,["x","y"],[dc,dc],e,D);N.length&&($.translate=N),U.length&&($.rotate=U),A.length&&($.scale=A),Object.keys($).length&&(v.bones[S.name]=$,x=!0);const P=$v(y,S),L=new Set(P.map(B=>B.blend));for(const B of L){const X=[],V=[];let q=16777215;for(let le=0;leY.id===ue.resourceId):void 0,xe=!!ue&&M[le]&&ue.imageVisible!==!1&&(ae==null?void 0:ae.blend)===B;ue&&(ae==null?void 0:ae.blend)===B&&(q=ue.colorHex),X.push(xe?`image_${ae.id}_${ue.imageFrameIndex??0}`:null),V.push(Uv(q,xe?ue.alpha:0))}const ne=P.filter(le=>le.blend===B).filter(le=>le.independentAlpha==="curve").map(le=>Xv(le.alphaCurveMode,e)),re=ne.length?ne.includes("bezier")?"bezier":"linear":Xv(y.config.alphaMode==="curve"?y.config.curveMode:void 0,e);Vv(v,`${S.name}_image_${B}`,X,V,n,e,re),X.some(Boolean)&&(x=!0)}if(y.config.trail)for(const B of y.config.trailResources){const X=Math.max(2,Math.min(16,Math.round(B.boneCount||3))),V=b.map(Y=>{var j;return((j=Y==null?void 0:Y.trailState)==null?void 0:j.resourceId)===B.id?Y.trailState:void 0}),q=V.find(Y=>!!Y);if(!q)continue;const W=i3(V),ne=B.widthSizeMode==="random"?Math.max(1,Number(B.widthMin)||0,Number(B.widthMax)||0):Math.max(.001,Number(B.width)||100);let re=q;const le=V.map(Y=>(Y&&(re=Y),re));for(let Y=0;Y{const Me=ye==null?void 0:ye.bones[Math.min(ye.bones.length-1,Y)];if(!Me)return;const ve={x:Me.worldX??Me.x,y:Me.worldY??Me.y,rotation:Me.worldRotation??-Me.rotation};j.push({frame:we,values:[ve.x,ve.y]}),H.push({frame:we,values:[ve.rotation]}),G.push({frame:we,values:[1,Math.max(0,ye.width/ne)*ie]})});const fe=`${S.name}_trail_${B.id}_${Y}`,te={},oe=_o(j,n,["x","y"],[Dv,Dv],e,z),ce=_o(H,n,["value"],[Nv],e,z),Ce=_o(G,n,["x","y"],[dc,dc],e,z);oe.length&&(te.translate=oe),ce.length&&(te.rotate=ce),Ce.length&&(te.scale=Ce),Object.keys(te).length&&(v.bones[fe]=te)}const ue=V.map(()=>`trail_${B.id}`);let ae=q.colorHex;const xe=V.map(Y=>(Y&&(ae=Y.colorHex),Uv(ae,Y?Y.alpha:0)));Vv(v,`${S.name}_trail_${B.id}`,ue,xe,n,e),x=!0}}(x||!e.excludeEmptyAnimations)&&(a.animations[m]=v)}!Object.keys(a.animations).length&&!e.excludeEmptyAnimations&&(a.animations.animation={bones:{},slots:{}});const d=e.spineVersion==="3.8"?YF(a):a,f=JSON.stringify(d,null,2);return{json:d,text:f,warnings:r,particleSystemCount:o.length,animationCount:Object.keys(d.animations).length,boneCount:d.bones.length}}function a3(s,e){const t=new Blob([s.text],{type:"application/json;charset=utf-8"}),i=URL.createObjectURL(t),n=document.createElement("a");n.href=i,n.download=/\.json$/i.test(e)?e:`${e||"SpineParticle"}.json`,n.style.display="none",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3)}class z${constructor(){w(this,"array",[])}add(e){const t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!==void 0}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}}class l3{constructor(){w(this,"entries",{});w(this,"size",0)}add(e){const t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){const t=this.size;for(let i=0,n=e.length;i1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}toRgb888(){const e=t=>`0${(t*255).toString(16)}`.slice(-2);return+`0x${e(this.r)}${e(this.g)}${e(this.b)}`}static fromString(e,t=new Qi){return t.setFromString(e)}};w(Qi,"WHITE",new Qi(1,1,1,1)),w(Qi,"RED",new Qi(1,0,0,1)),w(Qi,"GREEN",new Qi(0,1,0,1)),w(Qi,"BLUE",new Qi(0,0,1,1)),w(Qi,"MAGENTA",new Qi(1,0,1,1));let tt=Qi;const Xt=class Xt{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*Xt.degRad)}static sinDeg(e){return Math.sin(e*Xt.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*Xt.radDeg}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){const t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return Xt.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,i){const n=Math.random(),r=t-e;return n<=(i-e)/r?e+Math.sqrt(n*r*(i-e)):t-Math.sqrt((1-n)*r*(t-i))}static isPowerOfTwo(e){return e&&(e&e-1)===0}};w(Xt,"epsilon",1e-5),w(Xt,"epsilon2",Xt.epsilon*Xt.epsilon),w(Xt,"PI",3.1415927),w(Xt,"PI2",Xt.PI*2),w(Xt,"invPI2",1/Xt.PI2),w(Xt,"radiansToDegrees",180/Xt.PI),w(Xt,"radDeg",Xt.radiansToDegrees),w(Xt,"degreesToRadians",Xt.PI/180),w(Xt,"degRad",Xt.degreesToRadians);let Ee=Xt;const as=class as{apply(e,t,i){return t===void 0||i===void 0?this.applyInternal(e):e+(t-e)*this.applyInternal(i)}};w(as,"linear",new class extends as{applyInternal(e){return e}}),w(as,"smooth",new class extends as{applyInternal(e){return e*e*(3-2*e)}}),w(as,"slowFast",new class extends as{applyInternal(e){return e*e}}),w(as,"fastSlow",new class extends as{applyInternal(e){return(e-1)*(e-1)*-1+1}}),w(as,"circle",new class extends as{applyInternal(e){return e<=.5?(e*=2,(1-Math.sqrt(1-e*e))/2):(e--,e*=2,(Math.sqrt(1-e*e)+1)/2)}});let qo=as;class c3 extends qo{constructor(t){super();w(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 q$ extends c3{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2===0?-1:1)+1}}const Qn=class Qn{static arrayCopy(e,t,i,n,r){for(let o=t,a=n;o=t?e:Qn.setArraySize(e,t,i)}static newArray(e,t){const i=[];for(let n=0;n0?this.items.pop():this.instantiator()}free(e){var t;(t=e.reset)==null||t.call(e),this.items.push(e)}freeAll(e){for(let t=0;tthis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}class J${constructor(e=32){w(this,"values");w(this,"addedValues",0);w(this,"lastValue",0);w(this,"mean",0);w(this,"dirty",!0);this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t{h.width=parseInt(i[1]),h.height=parseInt(i[2])},n.format=()=>{},n.filter=h=>{h.minFilter=Ye.enumValue(Qo,i[1]),h.magFilter=Ye.enumValue(Qo,i[2])},n.repeat=h=>{i[1].indexOf("x")!==-1&&(h.uWrap=ea.Repeat),i[1].indexOf("y")!==-1&&(h.vWrap=ea.Repeat)},n.pma=h=>{h.pma=i[1]==="true"};var r={};r.xy=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2])},r.size=h=>{h.width=parseInt(i[1]),h.height=parseInt(i[2])},r.bounds=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2]),h.width=parseInt(i[3]),h.height=parseInt(i[4])},r.offset=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2])},r.orig=h=>{h.originalWidth=parseInt(i[1]),h.originalHeight=parseInt(i[2])},r.offsets=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2]),h.originalWidth=parseInt(i[3]),h.originalHeight=parseInt(i[4])},r.rotate=h=>{const u=i[1];u==="true"?h.degrees=90:u!=="false"&&(h.degrees=parseInt(u))},r.index=h=>{h.index=parseInt(i[1])};let o=t.readLine();for(;o&&o.trim().length===0;)o=t.readLine();for(;!(!o||o.trim().length===0||t.readEntry(i,o)===0);)o=t.readLine();let a=null,c=null,l=null;for(;o!==null;)if(o.trim().length===0)a=null,o=t.readLine();else if(a){const h=new Tw(a,o);for(;;){const u=t.readEntry(i,o=t.readLine());if(u===0)break;const d=r[i[0]];if(d)d(h);else{c||(c=[]),l||(l=[]),c.push(i[0]);const f=[];for(let p=0;p0&&l&&l.length>0&&(h.names=c,h.values=l,c=null,l=null),h.u=h.x/a.width,h.v=h.y/a.height,h.degrees===90?(h.u2=(h.x+h.height)/a.width,h.v2=(h.y+h.width)/a.height):(h.u2=(h.x+h.width)/a.width,h.v2=(h.y+h.height)/a.height),this.regions.push(h)}else{for(a=new f3(o.trim());t.readEntry(i,o=t.readLine())!==0;){const h=n[i[0]];h&&h(a)}this.pages.push(a)}}findRegion(e){for(let t=0;t=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length===0))return 0;const i=t.indexOf(":");if(i===-1)return 0;e[0]=t.substr(0,i).trim();for(let n=1,r=i+1;;n++){const o=t.indexOf(",",r);if(o===-1)return e[n]=t.substr(r).trim(),n;if(e[n]=t.substr(r,o-r).trim(),r=o+1,n===4)return 4}}}class f3{constructor(e){w(this,"name");w(this,"minFilter",Qo.Nearest);w(this,"magFilter",Qo.Nearest);w(this,"uWrap",ea.ClampToEdge);w(this,"vWrap",ea.ClampToEdge);w(this,"texture",null);w(this,"width",0);w(this,"height",0);w(this,"pma",!1);w(this,"regions",[]);this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(const t of this.regions)t.texture=e}}class Tw extends _w{constructor(t,i){super();w(this,"page");w(this,"name");w(this,"x",0);w(this,"y",0);w(this,"offsetX",0);w(this,"offsetY",0);w(this,"originalWidth",0);w(this,"originalHeight",0);w(this,"index",0);w(this,"degrees",0);w(this,"names",null);w(this,"values",null);this.page=t,this.name=i,t.regions.push(this)}}const Ch=class Ch{constructor(e){w(this,"name");w(this,"timelineAttachment");w(this,"timelineSlots",Ch.empty);if(!e)throw new Error("name cannot be null.");this.name=e,this.timelineAttachment=this}isTimelineActive(e,t,i){let n=e[t];if(n.bone.isActive()){const r=(i?n.getAppliedPose():n.getPose()).getAttachment();if(r!=null&&r.timelineAttachment===this)return!0}for(let r=0,o=this.timelineSlots.length;r>1)*c;const l=i.appliedPose.deform;let h=this.vertices;const u=this.bones;if(!u){l.length>0&&(h=l);const m=i.bone.appliedPose,g=m.worldX,v=m.worldY,x=m.a,y=m.b,_=m.c,C=m.d;for(let S=n,b=a;b=this.regions.length&&(t=this.regions.length-1),t}getUVs(e){return this.uvs[e]}hasPathSuffix(){return this.pathSuffix}getPath(e,t){if(!this.pathSuffix)return e;let i=e;const n=(this.start+t).toString();for(let r=this.digits-n.length;r>0;r--)i+="0";return i+=n,i}static nextID(){return Fo._nextID++}};w(Fo,"_nextID",0);let ia=Fo;var bi;(function(s){s[s.hold=0]="hold",s[s.once=1]="once",s[s.loop=2]="loop",s[s.pingpong=3]="pingpong",s[s.onceReverse=4]="onceReverse",s[s.loopReverse=5]="loopReverse",s[s.pingpongReverse=6]="pingpongReverse"})(bi||(bi={}));const Mw=[bi.hold,bi.once,bi.loop,bi.pingpong,bi.onceReverse,bi.loopReverse,bi.pingpongReverse];class vp{constructor(e,t,i){w(this,"name");w(this,"timelines",[]);w(this,"timelineIds");w(this,"bones");w(this,"color",new tt(1,1,1,1));w(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.duration=i,this.timelineIds=new l3,this.bones=[],this.setTimelines(t)}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e;const t=e.length;this.timelineIds.clear(),this.bones.length=0;const i=new Set,n=e;for(let r=0;r0&&(t%=this.duration));const u=this.timelines;for(let d=0,f=u.length;dt)return r-i;return n-i}};function m3(s){return typeof s=="object"&&s!==null&&typeof s.slotIndex=="number"}class co extends Rt{constructor(t,i,...n){super(t,...n);w(this,"curves");this.curves=Ye.newFloatArray(t+i*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){const i=this.getFrameCount()+t*18;if(this.curves.length>i){const n=Ye.newFloatArray(i);Ye.arrayCopy(this.curves,0,n,0,i),this.curves=n}}setBezier(t,i,n,r,o,a,c,l,h,u,d){const f=this.curves;let p=this.getFrameCount()+t*18;n===0&&(f[i]=2+p);const m=(r-a*2+l)*.03,g=(o-c*2+h)*.03,v=((a-l)*3-r+u)*.006,x=((c-h)*3-o+d)*.006;let y=m*2+v,_=g*2+x,C=(a-r)*.3+m+v*.16666667,S=(c-o)*.3+g+x*.16666667,b=r+C,M=o+S;for(let I=p+18;pt){const h=this.frames[i],u=this.frames[i+n];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}const a=r+18;for(r+=2;r=t){const h=o[r-2],u=o[r-1];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}i+=this.getFrameEntries();const c=o[a-2],l=o[a-1];return l+(t-c)/(this.frames[i]-c)*(this.frames[i+n]-l)}}class En extends co{constructor(e,t,i){super(e,t,i)}getFrameEntries(){return 2}setFrame(e,t,i){e<<=1,this.frames[e]=t,this.frames[e+1]=i}getCurveValue(e){const t=this.frames;let i=t.length-2;for(let r=2;r<=i;r+=2)if(t[r]>e){i=r-2;break}const n=this.curves[i>>1];switch(n){case 0:{const r=t[i],o=t[i+1];return o+(e-r)/(t[i+2]-r)*(t[i+2+1]-o)}case 1:return t[i+1]}return this.getBezierValue(e,i,1,n-2)}getRelativeValue(e,t,i,n,r,o){if(e>2];switch(f){case 0:{const p=u[d];c=u[d+1],l=u[d+2],h=u[d+3];const m=(i-p)/(u[d+4]-p);c+=(u[d+4+1]-c)*m,l+=(u[d+4+2]-l)*m,h+=(u[d+4+3]-h)*m;break}case 1:c=u[d+1],l=u[d+2],h=u[d+3];break;default:c=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),h=this.getBezierValue(i,d,3,f+36-2)}if(n!==1)if(r===Ue.setup){const p=e.data.setupPose.color;c=p.r+(c-p.r)*n,l=p.g+(l-p.g)*n,h=p.b+(h-p.b)*n}else c=a.r+(c-a.r)*n,l=a.g+(l-a.g)*n,h=a.b+(h-a.b)*n;a.r=c<0?0:c>1?1:c,a.g=l<0?0:l>1?1:l,a.b=h<0?0:h>1?1:h}}class Nw extends En{constructor(t,i,n){super(t,i,`${Qe.alpha}|${n}`);w(this,"slotIndex",0);this.slotIndex=n}apply(t,i,n,r,o,a,c,l,h){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=(h?u.appliedPose:u.pose).color;let f=0;const p=this.frames;if(n1?1:f}}class Uw extends lu{constructor(e,t,i){super(e,t,i,`${Qe.rgb}|${i}`,`${Qe.alpha}|${i}`,`${Qe.rgb2}|${i}`)}getFrameEntries(){return 8}setFrame(e,t,i,n,r,o,a,c,l){e<<=3,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=n,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=c,this.frames[e+7]=l}apply1(e,t,i,n,r,o){const a=t.color,c=t.darkColor;let l=0,h=0,u=0;const d=this.frames;if(i>3];switch(x){case 0:{const y=d[v];f=d[v+1],p=d[v+2],m=d[v+3],g=d[v+4],l=d[v+5],h=d[v+6],u=d[v+7];const _=(i-y)/(d[v+8]-y);f+=(d[v+8+1]-f)*_,p+=(d[v+8+2]-p)*_,m+=(d[v+8+3]-m)*_,g+=(d[v+8+4]-g)*_,l+=(d[v+8+5]-l)*_,h+=(d[v+8+6]-h)*_,u+=(d[v+8+7]-u)*_;break}case 1:f=d[v+1],p=d[v+2],m=d[v+3],g=d[v+4],l=d[v+5],h=d[v+6],u=d[v+7];break;default:f=this.getBezierValue(i,v,1,x-2),p=this.getBezierValue(i,v,2,x+18-2),m=this.getBezierValue(i,v,3,x+36-2),g=this.getBezierValue(i,v,4,x+54-2),l=this.getBezierValue(i,v,5,x+72-2),h=this.getBezierValue(i,v,6,x+90-2),u=this.getBezierValue(i,v,7,x+108-2)}if(n===1)a.set(f,p,m,g);else if(r===Ue.setup){const y=e.data.setupPose;let _=y.color;a.set(_.r+(f-_.r)*n,_.g+(p-_.g)*n,_.b+(m-_.b)*n,_.a+(g-_.a)*n),_=y.darkColor,l=_.r+(l-_.r)*n,h=_.g+(h-_.g)*n,u=_.b+(u-_.b)*n}else a.add((f-a.r)*n,(p-a.g)*n,(m-a.b)*n,(g-a.a)*n),l=c.r+(l-c.r)*n,h=c.g+(h-c.g)*n,u=c.b+(u-c.b)*n;c.r=l<0?0:l>1?1:l,c.g=h<0?0:h>1?1:h,c.b=u<0?0:u>1?1:u}}class $w extends lu{constructor(e,t,i){super(e,t,i,`${Qe.rgb}|${i}`,`${Qe.rgb2}|${i}`)}getFrameEntries(){return 7}setFrame(e,t,i,n,r,o,a,c){e*=7,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=n,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=c}apply1(e,t,i,n,r,o){const a=t.color,c=t.darkColor;let l=0,h=0,u=0,d=0,f=0,p=0;const m=this.frames;if(i1?1:l,a.g=h<0?0:h>1?1:h,a.b=u<0?0:u>1?1:u,c.r=d<0?0:d>1?1:d,c.g=f<0?0:f>1?1:f,c.b=p<0?0:p>1?1:p}}class Ha extends Rt{constructor(t,i){super(t,`${Qe.attachment}|${i}`);w(this,"slotIndex",0);w(this,"attachmentNames");this.slotIndex=i,this.attachmentNames=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i,n){this.frames[t]=i,this.attachmentNames[t]=n}apply(t,i,n,r,o,a,c,l,h){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=h?u.appliedPose:u.pose;l||nt){const l=this.frames[i];return n[r+1]*(t-l)/(n[r]-l)}const o=r+18;for(r+=2;r=t){const l=n[r-2],h=n[r-1];return h+(t-l)/(n[r]-l)*(n[r+1]-h)}const a=n[o-2],c=n[o-1];return c+(1-c)*(t-a)/(this.frames[i+this.getFrameEntries()]-a)}apply(t,i,n,r,o,a,c,l,h){const u=t.slots;if(!this.attachment.isTimelineActive(u,this.slotIndex,h))return;const d=this.attachment.timelineSlots,f=this.frames;if(n=f[f.length-1])g=0,p=this.vertices[f.length-1],m=null;else{const x=Rt.search(f,n);g=this.getCurvePercent(n,x),p=this.vertices[x],m=this.vertices[x+1]}const v=this.vertices[0].length;this.applyToSlot(u[this.slotIndex],h,p,m,g,v,o,a,c);for(const x of d)this.applyToSlot(u[x],h,p,m,g,v,o,a,c)}applyBeforeFirst(t,i,n,r){if(!t.bone.active)return;const o=i?t.appliedPose:t.pose;if(o.attachment==null||o.attachment.timelineAttachment!==this.attachment)return;const a=o.deform;switch(a.length===0&&(r=Ue.setup),r){case Ue.setup:a.length=0;break;case Ue.first:{if(n===1){a.length=0;return}const c=this.vertices[0].length;a.length=c;const l=a,h=o.attachment;if(h.bones===null){const u=h.vertices;for(let d=0;d>4,h=c.attachment.sequence.regions.length;const u=Mw[o&15];if(u!==bi.hold)switch(l+=(n-r)/a+1e-5|0,u){case bi.once:l=Math.min(h-1,l);break;case bi.loop:l%=h;break;case bi.pingpong:{const d=(h<<1)-2;l=d===0?0:l%d,l>=h&&(l=d-l);break}case bi.onceReverse:l=Math.max(h-1-l,0);break;case bi.loopReverse:l=h-1-l%h;break;case bi.pingpongReverse:{const d=(h<<1)-2;l=d===0?0:(l+h-1)%d,l>=h&&(l=d-l)}}c.sequenceIndex=l}};w(ls,"ENTRIES",3),w(ls,"MODE",1),w(ls,"DELAY",2);let Sh=ls;const Eh=class Eh extends Rt{constructor(t){super(t,...Eh.propertyIds);w(this,"events");this.events=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i.time,this.events[t]=i}apply(t,i,n,r,o,a,c,l,h){if(!r)return;const u=this.frames,d=this.frames.length;if(i>n)this.apply(null,i,Number.MAX_VALUE,r,0,a,!1,!1,!1),i=-1;else if(i>=u[d-1])return;if(n0&&u[f-1]===p;)f--}for(;f=u[f];f++)r.push(this.events[f])}};w(Eh,"propertyIds",[`${Qe.event}`]);let ul=Eh;const Oo=class Oo extends Rt{constructor(t){super(t,...Oo.propertyIds);w(this,"drawOrders");this.drawOrders=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i,n){this.frames[t]=i,this.drawOrders[t]=n}apply(t,i,n,r,o,a,c,l,h){const u=h?t.drawOrder.appliedPose:t.drawOrder.pose,d=t.slots;if(l||n>2];switch(x){case 0:{const _=f[v];p=f[v+1],m=f[v+2],g=f[v+3];const C=(n-_)/(f[v+4]-_);p+=(f[v+4+1]-p)*C,m+=(f[v+4+2]-m)*C,g+=(f[v+4+3]-g)*C;break}case 1:p=f[v+1],m=f[v+2],g=f[v+3];break;default:p=this.getBezierValue(n,v,1,x-2),m=this.getBezierValue(n,v,2,x+18-2),g=this.getBezierValue(n,v,3,x+36-2)}const y=a===Ue.setup?u.data.setupPose:d;c?(d.mixRotate=y.mixRotate+p*o,d.mixX=y.mixX+m*o,d.mixY=y.mixY+g*o):(d.mixRotate=y.mixRotate+(p-y.mixRotate)*o,d.mixX=y.mixX+(m-y.mixX)*o,d.mixY=y.mixY+(g-y.mixY)*o)}}class xr extends _l{constructor(e,t,i,n){super(e,t,i,n)}apply(e,t,i,n,r,o,a,c,l){if(a&&!this.additive&&(a=!1),this.constraintIndex===-1){const h=i>=this.frames[0]?this.getCurveValue(i):0,u=e.physics;for(const d of u)if(d.active&&this.global(d.data)){const f=l?d.appliedPose:d.pose;this.set(f,this.getAbsoluteValue(i,r,o,a,this.get(f),this.get(d.data.setupPose),h))}}else{const h=e.constraints[this.constraintIndex];if(h.active){const u=l?h.appliedPose:h.pose;this.set(u,this.getAbsoluteValue(i,r,o,a,this.get(u),this.get(h.data.setupPose)))}}}}class Ww extends xr{constructor(e,t,i){super(e,t,i,Qe.physicsConstraintInertia)}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}}class zw extends xr{constructor(e,t,i){super(e,t,i,Qe.physicsConstraintStrength)}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}}class qw extends xr{constructor(e,t,i){super(e,t,i,Qe.physicsConstraintDamping)}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}}class Kw extends xr{constructor(e,t,i){super(e,t,i,Qe.physicsConstraintMass)}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}}class Zw extends xr{constructor(e,t,i){super(e,t,i,Qe.physicsConstraintWind),this.additive=!0}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}}class Jw extends xr{constructor(e,t,i){super(e,t,i,Qe.physicsConstraintGravity),this.additive=!0}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}}class Qw extends xr{constructor(e,t,i){super(e,t,i,Qe.physicsConstraintMix)}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}}const Ih=class Ih extends Rt{constructor(t,i){super(t,...Ih.propertyIds);w(this,"constraintIndex");this.constraintIndex=i,this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i}apply(t,i,n,r,o,a,c,l,h){let u;if(this.constraintIndex!==-1&&(u=t.constraints[this.constraintIndex],!u.active))return;const d=this.frames;if(i>n)this.apply(t,i,Number.MAX_VALUE,[],o,a,!1,!1,!1),i=-1;else if(i>=d[d.length-1])return;if(!(n=d[Rt.search(d,i)+1]))if(u!=null)u.reset(t);else for(const f of t.physics)f.active&&f.reset(t)}};w(Ih,"propertyIds",[Qe.physicsConstraintReset.toString()]);let _h=Ih;class eS extends _l{constructor(e,t,i){super(e,t,i,Qe.sliderTime)}apply(e,t,i,n,r,o,a,c,l){const h=e.constraints[this.constraintIndex];if(h.active){const u=l?h.appliedPose:h.pose;u.time=this.getAbsoluteValue(i,r,o,a,u.time,h.data.setupPose.time)}}}class tS extends _l{constructor(e,t,i){super(e,t,i,Qe.sliderMix),this.additive=!0}apply(e,t,i,n,r,o,a,c,l){const h=e.constraints[this.constraintIndex];if(h.active){const u=l?h.appliedPose:h.pose;u.mix=this.getAbsoluteValue(i,r,o,a,u.mix,h.data.setupPose.mix)}}}const za=class za{constructor(e){w(this,"data");w(this,"tracks",[]);w(this,"timeScale",1);w(this,"unkeyedState",0);w(this,"events",[]);w(this,"listeners",[]);w(this,"queue",new y3(this));w(this,"propertyIds",new Map);w(this,"animationsChanged",!1);w(this,"trackEntryPool",new h3(()=>new v3));this.data=e}update(e){e*=this.timeScale;const t=this.tracks;for(let i=0,n=t.length;i0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){const c=r.trackLast-a.delay;if(c>=0){for(a.delay=0,a.trackTime+=r.timeScale===0?0:(c/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setTrack(i,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[i]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let c=r.mixingFrom;for(r.mixingFrom=null,c&&(c.mixingTo=null);c;)this.queue.end(c),c=c.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){const i=e.mixingFrom;if(!i)return!0;const n=this.updateMixingFrom(i,t);if(i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,e.nextTrackLast!==-1&&e.mixTime>=e.mixDuration){if(i.totalAlpha===0||e.mixDuration===0){if(e.mixingFrom=i.mixingFrom,i.mixingFrom!=null&&(i.mixingFrom.mixingTo=e),i.totalAlpha===0)for(let r=e;r.mixingTo!=null;r=r.mixingTo)r.keepHold=!0;this.queue.end(i)}return n}return i.trackTime+=t*i.timeScale,e.mixTime+=t,!1}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const t=this.events,i=this.tracks;let n=!1;for(let a=0,c=i.length;a0)continue;n=!0;let h=l.alpha;l.mixingFrom?h*=this.applyMixingFrom(l,e):l.trackTime>=l.trackEnd&&!l.next&&(h=0);let u=l.animationLast,d=l.getAnimationTime(),f=d,p=t;l.reverse&&(f=l.animation.duration-f,p=null);const m=l.animation.timelines,g=m.length;if(a===0&&h===1)for(let v=0;v=l.alphaAttachmentThreshold,y=l.additive,_=y||l.shortestRotation,C=!_&&l.timelinesRotation.length!==g<<1;C&&(l.timelinesRotation.length=g<<1);for(let S=0;S0?c/a:o,h=i.animation.timelines,u=h.length,d=i.timelineMode,f=i.timelineHoldMix,p=r=i.alphaAttachmentThreshold);else{const O=!m||!(I instanceof dr)||E===Ue.current;I.apply(t,_,S,b,k,E,g,O,!1)}}return i.reverse&&r0&&this.queueEvents(i,C),this.events.length=0,i.nextAnimationLast=C,i.nextTrackLast=i.trackTime,r}applyAttachmentTimeline(e,t,i,n,r){const o=t.slots[e.slotIndex];if(!o.bone.active||!r&&o.attachmentState===this.unkeyedState+Kv)return;let a=i=0,C=v>=0;Math.abs(x)<=90&&Ee.signum(x)!==Ee.signum(g)&&(Math.abs(v-y)>180?(m+=360*Ee.signum(v),C=_):y!==0?m-=360*Ee.signum(v):C=_),C!==_&&(m+=360*Ee.signum(v)),o[a]=m}o[a+1]=g,h.rotation=f+m*n}queueEvents(e,t){const i=e.animationStart,n=e.animationEnd,r=n-i,o=e.reverse;let a=e.trackLast%r;o&&(a=r-a);const c=this.events;let l=0,h=c.length;for(;l=i&&d.time<=n&&this.queue.event(e,d)}let u=!1;if(e.loop)if(r===0)u=!0;else{const d=Math.floor(e.trackTime/r);u=d>0&&d>Math.floor(e.trackLast/r)}else u=t>=n&&e.animationLast=i&&d.time<=n&&this.queue.event(e,d)}}eventsReverse(e,t,i){const n=e.animation.duration,r=n-t,o=n-i,a=e.animation.timelines;for(let c=0,l=e.animation.timelines.length;c=o){for(let p=0;p=r)break;this.events.push(u[p])}}else{for(let m=0;m=r);m++)this.events.push(u[m]);let p=0;for(;p=o);p++);for(;p= 0.");if(e>=this.tracks.length)return;const t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let i=t;for(;;){const n=i.mixingFrom;if(!n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[t.trackIndex]=null,this.queue.drain()}setTrack(e,t,i){const n=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,n&&(n.next=null,i&&this.queue.interrupt(n),t.mixingFrom=n,n.mixingTo=t,t.mixTime=0,n.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,i=!1){return typeof t=="string"?this.setAnimation1(e,t,i):this.setAnimation2(e,t,i)}setAnimation1(e,t,i=!1){const n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error(`Animation not found: ${t}`);return this.setAnimation2(e,n,i)}setAnimation2(e,t,i=!1){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let n=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast===-1&&r.animation===t?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,n=!1):this.clearNext(r));const o=this.trackEntry(e,t,i,r);return this.setTrack(e,o,n),this.queue.drain(),o}addAnimation(e,t,i=!1,n=0){return typeof t=="string"?this.addAnimation1(e,t,i,n):this.addAnimation2(e,t,i,n)}addAnimation1(e,t,i=!1,n=0){const r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error(`Animation not found: ${t}`);return this.addAnimation2(e,r,i,n)}addAnimation2(e,t,i=!1,n=0){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;const o=this.trackEntry(e,t,i,r);return r?(r.next=o,o.previous=r,n<=0&&(n=Math.max(n+r.getTrackComplete()-o.mixDuration,0))):(this.setTrack(e,o,!0),this.queue.drain(),n<0&&(n=0)),o.delay=n,o}setEmptyAnimation(e,t=0){const i=this.setAnimation(e,za.emptyAnimation,!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){const n=this.addAnimation(e,za.emptyAnimation,!1,i);return i<=0&&(n.delay=Math.max(n.delay+n.mixDuration-t,0)),n.mixDuration=t,n.trackEnd=t,n}setEmptyAnimations(e=0){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let i=0,n=this.tracks.length;i0&&(o[d]=v);break}}c&&(g=g&~mc|r[d]&mc),r[d]=g}}from(e,t,i){const n=this.propertyIds;let r=x3;for(let o=0,a=i.length;o= 0.");return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){const t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}};w(za,"emptyAnimation",new vp("",[],0));let Hv=za;class v3{constructor(){w(this,"animation",null);w(this,"previous",null);w(this,"next",null);w(this,"mixingFrom",null);w(this,"mixingTo",null);w(this,"listener",null);w(this,"trackIndex",0);w(this,"loop",!1);w(this,"additive",!1);w(this,"reverse",!1);w(this,"shortestRotation",!1);w(this,"keepHold",!1);w(this,"eventThreshold",0);w(this,"mixAttachmentThreshold",0);w(this,"alphaAttachmentThreshold",0);w(this,"mixDrawOrderThreshold",0);w(this,"animationStart",0);w(this,"animationEnd",0);w(this,"animationLast",0);w(this,"nextAnimationLast",0);w(this,"delay",0);w(this,"trackTime",0);w(this,"trackLast",0);w(this,"nextTrackLast",0);w(this,"trackEnd",0);w(this,"timeScale",0);w(this,"alpha",0);w(this,"mixTime",0);w(this,"mixDuration",0);w(this,"totalAlpha",0);w(this,"mixInterpolation",qo.linear);w(this,"timelineMode",[]);w(this,"timelineHoldMix",[]);w(this,"timelinesRotation",[])}setMixDuration(e,t){this.mixDuration=e,t!==void 0&&(t<=0&&(t=this.previous==null?0:Math.max(t+this.previous.getTrackComplete()-e,0)),this.delay=t)}setMixInterpolation(e){if(!e)throw new Error("mixInterpolation cannot be null.");this.mixInterpolation=e}mix(){if(this.mixDuration===0)return 1;let e=this.mixTime/this.mixDuration;return e>=1?1:this.mixInterpolation===qo.linear?e:(e=this.mixInterpolation.apply(e),e<0?0:e>1?1:e)}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.mixInterpolation=qo.linear,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(!this.loop)return Math.min(this.trackTime+this.animationStart,this.animationEnd);const e=this.animationEnd-this.animationStart;return e===0?this.animationStart:this.trackTime%e+this.animationStart}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){const e=this.animationEnd-this.animationStart;if(e!==0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime=0}}class y3{constructor(e){w(this,"objects",[]);w(this,"drainDisabled",!1);w(this,"animState");this.animState=e}start(e){this.objects.push(Wi.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(Wi.interrupt),this.objects.push(e)}end(e){this.objects.push(Wi.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(Wi.dispose),this.objects.push(e)}complete(e){this.objects.push(Wi.complete),this.objects.push(e)}event(e,t){this.objects.push(Wi.event),this.objects.push(e),this.objects.push(t)}drain(){var e,t,i,n,r,o;if(!this.drainDisabled){this.drainDisabled=!0;for(let a=0;a= 0.");if(!i)throw new Error("name cannot be null.");this.index=t,this.parent=n}copy(t){const i=new hu(this.index,this.name,t);return i.length=this.length,i.setupPose.set(this.setupPose),i}}var Yt;(function(s){s[s.Normal=0]="Normal",s[s.OnlyTranslation=1]="OnlyTranslation",s[s.NoRotationOrReflection=2]="NoRotationOrReflection",s[s.NoScale=3]="NoScale",s[s.NoScaleOrReflection=4]="NoScaleOrReflection"})(Yt||(Yt={}));class mm{constructor(){w(this,"bone");w(this,"x",0);w(this,"y",0);w(this,"rotation",0);w(this,"scaleX",0);w(this,"scaleY",0);w(this,"shearX",0);w(this,"shearY",0);w(this,"inherit",Yt.Normal);w(this,"a",0);w(this,"b",0);w(this,"c",0);w(this,"d",0);w(this,"worldY",0);w(this,"worldX",0);w(this,"world",0);w(this,"local",0)}set(e){if(e==null)throw new Error("pose cannot be null.");this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}setPosition(e,t){this.x=e,this.y=t}setScale(e,t){this.scaleX=e,this.scaleY=t===void 0?e:t}getInherit(){return this.inherit}setInherit(e){if(e==null)throw new Error("inherit cannot be null.");this.inherit=e}update(e,t){this.world!==e._update&&this.updateWorldTransform(e)}updateWorldTransform(e){this.local===e._update?this.updateLocalTransform(e):this.world=e._update;const t=this.rotation,i=this.scaleX,n=this.scaleY,r=this.shearX,o=this.shearY;if(!this.bone.parent){const d=e.scaleX,f=e.scaleY,p=(t+r)*Ee.degRad,m=(t+90+o)*Ee.degRad;this.a=Math.cos(p)*i*d,this.b=Math.cos(m)*n*d,this.c=Math.sin(p)*i*f,this.d=Math.sin(m)*n*f,this.worldX=this.x*d+e.x,this.worldY=this.y*f+e.y;return}const a=this.bone.parent.appliedPose;let c=a.a,l=a.b,h=a.c,u=a.d;switch(this.worldX=c*this.x+l*this.y+a.worldX,this.worldY=h*this.x+u*this.y+a.worldY,this.inherit){case Yt.Normal:{const d=(t+r)*Ee.degRad,f=(t+90+o)*Ee.degRad,p=Math.cos(d)*i,m=Math.cos(f)*n,g=Math.sin(d)*i,v=Math.sin(f)*n;this.a=c*p+l*g,this.b=c*m+l*v,this.c=h*p+u*g,this.d=h*m+u*v;return}case Yt.OnlyTranslation:{const d=e.scaleX,f=e.scaleY,p=(t+r)*Ee.degRad,m=(t+90+o)*Ee.degRad;this.a=Math.cos(p)*i*d,this.b=Math.cos(m)*n*d,this.c=Math.sin(p)*i*f,this.d=Math.sin(m)*n*f;break}case Yt.NoRotationOrReflection:{const d=e.scaleX,f=e.scaleY,p=1/d,m=1/f;c*=p,h*=m;let g=c*c+h*h,v=0;g>Ee.epsilon2?(g=Math.abs(c*u*m-l*p*h)/g,l=h*g,u=c*g,v=t-Ee.atan2Deg(h,c)):(c=0,h=0,v=t-90+Ee.atan2Deg(u,l));const x=(v+r)*Ee.degRad,y=(v+o+90)*Ee.degRad,_=Math.cos(x)*i,C=Math.cos(y)*n,S=Math.sin(x)*i,b=Math.sin(y)*n;this.a=(c*_-l*S)*d,this.b=(c*C-l*b)*d,this.c=(h*_+u*S)*f,this.d=(h*C+u*b)*f;break}case Yt.NoScale:case Yt.NoScaleOrReflection:{const d=e.scaleX,f=e.scaleY,p=1/d,m=1/f,g=t*Ee.degRad,v=Math.cos(g),x=Math.sin(g);let y=(c*v+l*x)*p,_=(h*v+u*x)*m;const C=1/Math.sqrt(y*y+_*_);y*=C,_*=C;let S=-_,b=y;this.inherit===Yt.NoScale&&c*u-l*h<0!=(d<0!=f<0)&&(S=-S,b=-b);const M=r*Ee.degRad,I=(90+o)*Ee.degRad,F=Math.cos(M)*i,E=Math.cos(I)*n,k=Math.sin(M)*i,O=Math.sin(I)*n;this.a=(y*F+S*k)*d,this.b=(y*E+S*O)*d,this.c=(_*F+b*k)*f,this.d=(_*E+b*O)*f;break}}}updateLocalTransform(e){this.local=0,this.world=e._update;const t=e.scaleX,i=e.scaleY;if(!this.bone.parent){const v=1/t,x=1/i;this.x=(this.worldX-e.x)*v,this.y=(this.worldY-e.y)*x,this.set5(this.a*v,this.b*v,this.c*x,this.d*x,0);return}const n=this.bone.parent.appliedPose;let r=n.a,o=n.b,a=n.c,c=n.d;const l=r*c-o*a,h=1/(r*c-o*a),u=c*h,d=o*h,f=a*h,p=r*h,m=this.worldX-n.worldX,g=this.worldY-n.worldY;switch(this.x=m*u-g*d,this.y=g*p-m*f,this.inherit){case Yt.Normal:this.set5(u*this.a-d*this.c,u*this.b-d*this.d,p*this.c-f*this.a,p*this.d-f*this.b,0);break;case Yt.OnlyTranslation:{const v=1/t,x=1/i;this.set5(this.a*v,this.b*v,this.c*x,this.d*x,0);break}case Yt.NoRotationOrReflection:{const v=1/t,x=1/i;r*=v,a*=x;const y=this.a*v,_=this.b*v,C=this.c*x,S=this.d*x,b=1/(r*r+a*a),M=1/Math.abs(l*v*x);this.set5((r*y+a*C)*b,(r*_+a*S)*b,(r*C-a*y)*M,(r*S-a*_)*M,Ee.atan2Deg(a,r));break}case Yt.NoScale:case Yt.NoScaleOrReflection:{const v=1/t,x=1/i,y=this.a*v,_=this.b*v,C=this.c*x,S=this.d*x;let b=c*this.a-o*this.c,M=r*this.c-a*this.a;l<0&&(b=-b,M=-M);let I=Ee.atan2Deg(M,b);this.rotation=I,I*=Ee.degRad;const F=Math.cos(I),E=Math.sin(I);let k=(r*F+o*E)*v,O=(a*F+c*E)*x;const D=1/Math.sqrt(k*k+O*O);k*=D,O*=D;const $=this.inherit===Yt.NoScale&&l<0!=(t<0!=i<0)?-1:1;this.set4(k*y+O*C,k*_+O*S,(k*C-O*y)*$,(k*S-O*_)*$)}}}set4(e,t,i,n){const r=e*e+i*i,o=t*t+n*n;r>Ee.epsilon2?(this.shearX=Ee.atan2Deg(i,e),this.scaleX=Math.sqrt(r)):(this.shearX=0,this.scaleX=0),this.scaleY=Math.sqrt(o),o>Ee.epsilon2?(this.shearY=Ee.atan2Deg(n,t),e*n-t*i<0?(this.scaleY=-this.scaleY,this.shearY+=90):this.shearY-=90,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}set5(e,t,i,n,r){this.shearX=0;const o=e*e+i*i,a=t*t+n*n;if(o>Ee.epsilon2){const c=Ee.atan2Deg(i,e);this.rotation=c+r,this.scaleX=Math.sqrt(o),this.scaleY=Math.sqrt(a),a>Ee.epsilon2?(this.shearY=Ee.atan2Deg(n,t),e*n-t*i<0?(this.scaleY=-this.scaleY,this.shearY+=90-c):this.shearY-=90+c,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}else this.scaleX=0,this.scaleY=Math.sqrt(a),this.shearY=0,this.rotation=a>Ee.epsilon2?Ee.atan2Deg(n,t)-90+r:r}validateLocalTransform(e){this.local===e._update&&this.updateLocalTransform(e)}modifyLocal(e){this.local===e._update&&this.updateLocalTransform(e),this.world=0,this.resetWorld(e,e._update)}modifyWorld(e){const t=e._update;this.local=t,this.world=t,this.resetWorld(e,t)}resetWorld(e,t){const i=this.bone.children;for(let n=0,r=i.length;n1&&t.constrained(this.bones[1].bone)}isSourceActive(){return this.target.active}static apply(t,i,n,r,o,a,c,l,h,u){typeof n=="number"?Jn.apply1(t,i,n,r,o,a,c,l):Jn.apply2(t,i,n,r,o,a,c,l,h,u)}static apply1(t,i,n,r,o,a,c,l){i.modifyLocal(t);const h=i.bone.parent.appliedPose;let u=h.a,d=h.b,f=h.c,p=h.d,m=-i.shearX-i.rotation,g=0,v=0;switch(i.inherit){case Yt.OnlyTranslation:g=(n-i.worldX)*Ee.signum(t.scaleX),v=(r-i.worldY)*Ee.signum(t.scaleY);break;case Yt.NoRotationOrReflection:{const x=Math.abs(u*p-d*f)/Math.max(Ee.epsilon,u*u+f*f),y=u/t.scaleX,_=f/t.scaleY;d=-_*x*t.scaleX,p=y*x*t.scaleY,m+=Ee.atan2Deg(_,y)}default:{const x=n-h.worldX,y=r-h.worldY,_=u*p-d*f;Math.abs(_)<=Ee.epsilon?(g=0,v=0):(g=(x*p-y*d)/_-i.x,v=(y*u-x*f)/_-i.y)}}if(m+=Ee.atan2Deg(v,g),i.scaleX<0&&(m+=180),m>180?m-=360:m<=-180&&(m+=360),i.rotation+=m*l,o||a){switch(i.inherit){case Yt.NoScale:case Yt.NoScaleOrReflection:g=n-i.worldX,v=r-i.worldY}const x=i.bone.data.length*i.scaleX;if(x>Ee.epsilon){const y=g*g+v*v;if(o&&yx*x){const _=(Math.sqrt(y)/x-1)*l+1;switch(i.scaleX*=_,c){case Ni.Uniform:i.scaleY*=_;break;case Ni.Volume:i.scaleY/=_<.7?.25+.642857*_:_}}}}}static apply2(t,i,n,r,o,a,c,l,h,u){if(i.inherit!==Yt.Normal||n.inherit!==Yt.Normal)return;i.modifyLocal(t),n.modifyLocal(t);let d=i.x,f=i.y,p=i.scaleX,m=i.scaleY,g=n.scaleX,v=0,x=0,y=0;p<0?(p=-p,v=180,y=-1):(v=0,y=1),m<0&&(m=-m,y=-y),g<0?(g=-g,x=180):x=0;let _=0,C=0,S=i.a,b=i.b,M=i.c,I=i.d;const F=Math.abs(p-m)<=Ee.epsilon;!F||c?(n.y=0,_=S*n.x+i.worldX,C=M*n.x+i.worldY):(_=S*n.x+b*n.y+i.worldX,C=M*n.x+I*n.y+i.worldY);const E=i.bone.parent.appliedPose;S=E.a,b=E.b,M=E.c,I=E.d;let k=S*I-b*M,O=_-E.worldX,D=C-E.worldY;k=Math.abs(k)<=Ee.epsilon?0:1/k;const $=(O*I-D*b)*k-d,N=(D*S-O*M)*k-f;let U=Math.sqrt($*$+N*N),A=n.bone.data.length*g,P,L;if(U0){let re=Math.min(1,ne/(h*2))-1;re=(ne-h*(1-re*re))/W,B-=re*B,X-=re*X,V=B*B+X*X}}e:if(F){A*=p;let W=(V-U*U-A*A)/(2*U*A);if(W<-1)W=-1,L=Math.PI*a;else if(W>1){if(W=1,L=0,c)switch(S=(Math.sqrt(V)/(U+A)-1)*u+1,i.scaleX*=S,l){case Ni.Uniform:i.scaleY*=S;break;case Ni.Volume:i.scaleY/=S<.7?.25+.642857*S:S}}else L=Math.acos(W)*a;S=U+A*W,b=A*Math.sin(L),P=Math.atan2(X*S-B*b,B*S+X*b)}else{S=p*A,b=m*A;const W=S*S,ne=b*b,re=Math.atan2(X,B);M=ne*U*U+W*V-W*ne;const le=-2*ne*U,ue=ne-W;if(I=le*le-4*ue*M,I>=0){let fe=Math.sqrt(I);le<0&&(fe=-fe),fe=-(le+fe)*.5;let te=fe/ue,oe=M/fe;const ce=Math.abs(te)=0){D=Math.sqrt(te)*a,P=re-Math.atan2(D,ce),L=Math.atan2(D/m,(ce-U)/p);break e}}let ae=Ee.PI,xe=U-S,Y=xe*xe,j=0,H=0,G=U+S,z=G*G,ie=0;M=-S*U/(W-ne),M>=-1&&M<=1&&(M=Math.acos(M),O=S*Math.cos(M)+U,D=b*Math.sin(M),I=O*O+D*D,Iz&&(H=M,z=I,G=O,ie=D)),V<=(Y+z)*.5?(P=re-Math.atan2(j*a,xe),L=ae*a):(P=re-Math.atan2(ie*a,G),L=H*a)}const q=Math.atan2(n.y,n.x)*y;P=(P-q)*Ee.radDeg+v-i.rotation,P>180?P-=360:P<=-180&&(P+=360),i.rotation+=P*u,L=((L+q)*Ee.radDeg-n.shearX)*y+x-n.rotation,L>180?L-=360:L<=-180&&(L+=360),n.rotation+=L*u}}class Rc extends Ml{constructor(t){super(t,new pm);w(this,"bones",[]);w(this,"_target",null);w(this,"_scaleYMode",Ni.None)}set target(t){this._target=t}get target(){if(!this._target)throw new Error("target cannot be null.");return this._target}set scaleYMode(t){this._scaleYMode=t}get scaleYMode(){if(this._scaleYMode==null)throw new Error("scaleYMode cannot be null.");return this._scaleYMode}create(t){return new Jn(this,t)}}class gm{constructor(){w(this,"position",0);w(this,"spacing",0);w(this,"mixRotate",0);w(this,"mixX",0);w(this,"mixY",0)}set(e){this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}}class Pc extends Ml{constructor(t){super(t,new gm);w(this,"bones",[]);w(this,"_slot",null);w(this,"positionMode",on.Fixed);w(this,"spacingMode",ci.Fixed);w(this,"rotateMode",Qr.Chain);w(this,"offsetRotation",0)}set slot(t){this._slot=t}get slot(){if(this._slot)return this._slot;throw new Error("SlotData not set.")}create(t){return new vm(this,t)}}var on;(function(s){s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent"})(on||(on={}));var ci;(function(s){s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s[s.Proportional=3]="Proportional"})(ci||(ci={}));var Qr;(function(s){s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale"})(Qr||(Qr={}));const _s=class _s extends Tl{constructor(t,i){super(t,new gm,new gm);w(this,"data");w(this,"bones");w(this,"slot");w(this,"spaces",[]);w(this,"positions",[]);w(this,"world",[]);w(this,"curves",[]);w(this,"lengths",[]);w(this,"segments",[]);if(!i)throw new Error("skeleton cannot be null.");this.data=t,this.bones=[];for(const n of this.data.bones)this.bones.push(i.bones[n.index].constrainedPose);this.slot=i.slots[t.slot.index]}copy(t){var i=new _s(this.data,t);return i.pose.set(this.pose),i}update(t,i){const n=this.slot.appliedPose.attachment;if(!(n instanceof dl))return;const r=this.appliedPose,o=r.mixRotate,a=r.mixX,c=r.mixY;if(o===0&&a===0&&c===0)return;const l=this.data,h=l.rotateMode===Qr.Tangent,u=l.rotateMode===Qr.ChainScale,d=this.bones,f=d.length,p=h?f:f+1,m=Ye.setArraySize(this.spaces,p),g=u?this.lengths=Ye.setArraySize(this.lengths,f):[],v=r.spacing;switch(l.spacingMode){case ci.Percent:if(u)for(let b=0,M=p-1;b0){b=p/b*v;for(let M=1;M0?Ee.degRad:-Ee.degRad}for(let b=0,M=3;b0){let D=I.a,$=I.b,N=I.c,U=I.d,A=0,P=0,L=0;if(h?A=x[M-1]:m[b+1]===0?A=x[M+2]:A=Math.atan2(O,k),A-=Math.atan2(N,D),S){P=Math.cos(A),L=Math.sin(A);const B=I.bone.data.length;y+=(B*(P*D-L*N)-k)*o,_+=(B*(L*D+P*N)-O)*o}else A+=C;A>Ee.PI?A-=Ee.PI2:A<-Ee.PI&&(A+=Ee.PI2),A*=o,P=Math.cos(A),L=Math.sin(A),I.a=P*D-L*N,I.b=P*$-L*U,I.c=L*D+P*N,I.d=L*$+P*U}}}computeWorldPositions(t,i,n,r){const o=this.slot;let a=this.appliedPose.position,c=this.spaces,l=Ye.setArraySize(this.positions,n*3+2),h=this.world;const u=i.closed;let d=i.worldVerticesLength,f=d/6,p=_s.NONE;if(!i.constantSpeed){const L=i.lengths;f-=u?1:2;const B=L[f];this.data.positionMode===on.Percent&&(a*=B);let X;switch(this.data.spacingMode){case ci.Percent:X=B;break;case ci.Proportional:X=B/n;break;default:X=1}h=Ye.setArraySize(this.world,8);for(let V=0,q=0,W=0;VB){p!==_s.AFTER&&(p=_s.AFTER,i.computeWorldVertices(t,o,d-6,4,h,0,2)),this.addAfterPosition(re-B,h,0,l,q);continue}for(;;W++){const le=L[W];if(!(re>le)){if(W===0)re/=le;else{const ue=L[W-1];re=(re-ue)/(le-ue)}break}}W!==p&&(p=W,u&&W===f?(i.computeWorldVertices(t,o,d-4,4,h,0,2),i.computeWorldVertices(t,o,0,4,h,4,2)):i.computeWorldVertices(t,o,W*6+2,8,h,0,2)),this.addCurvePosition(re,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],l,q,r||V>0&&ne===0)}return l}u?(d+=2,h=Ye.setArraySize(this.world,d),i.computeWorldVertices(t,o,2,d-4,h,0,2),i.computeWorldVertices(t,o,0,2,h,d-4,2),h[d-2]=h[0],h[d-1]=h[1]):(f--,d-=4,h=Ye.setArraySize(this.world,d),i.computeWorldVertices(t,o,2,d,h,0,2));const m=Ye.setArraySize(this.curves,f);let g=0,v=h[0],x=h[1],y=0,_=0,C=0,S=0,b=0,M=0,I=0,F=0,E=0,k=0,O=0,D=0,$=0,N=0;for(let L=0,B=2;Lg){this.addAfterPosition(W-g,h,d-4,l,B);continue}for(;;X++){const ne=m[X];if(!(W>ne)){if(X===0)W/=ne;else{const re=m[X-1];W=(W-re)/(ne-re)}break}}if(X!==p){p=X;let ne=X*6;for(v=h[ne],x=h[ne+1],y=h[ne+2],_=h[ne+3],C=h[ne+4],S=h[ne+5],b=h[ne+6],M=h[ne+7],I=(v-y*2+C)*.03,F=(x-_*2+S)*.03,E=((y-C)*3-v+b)*.006,k=((_-S)*3-x+M)*.006,O=I*2+E,D=F*2+k,$=(y-v)*.3+I+E*.16666667,N=(_-x)*.3+F+k*.16666667,P=Math.sqrt($*$+N*N),A[0]=P,ne=1;ne<8;ne++)$+=O,N+=D,O+=E,D+=k,P+=Math.sqrt($*$+N*N),A[ne]=P;$+=O,N+=D,P+=Math.sqrt($*$+N*N),A[8]=P,$+=O+E,N+=D+k,P+=Math.sqrt($*$+N*N),A[9]=P,V=0}for(W*=P;;V++){const ne=A[V];if(!(W>ne)){if(V===0)W/=ne;else{const re=A[V-1];W=V+(W-re)/(ne-re)}break}}this.addCurvePosition(W*.1,v,x,y,_,C,S,b,M,l,B,r||L>0&&q===0)}return l}addBeforePosition(t,i,n,r,o){const a=i[n],c=i[n+1],l=i[n+2]-a,h=i[n+3]-c,u=Math.atan2(h,l);r[o]=a+t*Math.cos(u),r[o+1]=c+t*Math.sin(u),r[o+2]=u}addAfterPosition(t,i,n,r,o){const a=i[n+2],c=i[n+3],l=a-i[n],h=c-i[n+1],u=Math.atan2(h,l);r[o]=a+t*Math.cos(u),r[o+1]=c+t*Math.sin(u),r[o+2]=u}addCurvePosition(t,i,n,r,o,a,c,l,h,u,d,f){if(t===0||Number.isNaN(t)){u[d]=i,u[d+1]=n,u[d+2]=Math.atan2(o-n,r-i);return}const p=t*t,m=p*t,g=1-t,v=g*g,x=v*g,y=g*t,_=y*3,C=g*_,S=_*t,b=i*x+r*C+a*S+l*m,M=n*x+o*C+c*S+h*m;u[d]=b,u[d+1]=M,f&&(t<.001?u[d+2]=Math.atan2(o-n,r-i):u[d+2]=Math.atan2(M-(n*v+o*y*2+c*p),b-(i*v+r*y*2+a*p)))}sort(t){const i=this.slot.data.index,n=this.slot.bone;t.skin!=null&&this.sortPathSlot(t,t.skin,i,n),t.data.defaultSkin!=null&&t.data.defaultSkin!==t.skin&&this.sortPathSlot(t,t.data.defaultSkin,i,n),this.sortPath(t,this.slot.pose.attachment,n);const r=this.bones,o=this.bones.length;for(let a=0;a0,a=this.data.y>0,c=this.data.rotate>0||this.data.shearX>0,l=this.data.scaleX>0,h=this.bone;let u=h.bone.data.length,d=this.data.step,f=0;if(i!==Ur.none){switch(h.modifyWorld(t),i){case Ur.reset:this.reset(t);case Ur.update:{const p=Math.max(t.time-this.lastTime,0),m=this.remaining;this.remaining+=p,this.lastTime=t.time;const g=h.worldX,v=h.worldY;if(this._reset)this._reset=!1,this.ux=g,this.uy=v;else{let x=this.remaining,y=n.inertia,_=t.data.referenceScale,C=-1,S=0,b=0,M=this.data.limit*p,I=M*Math.abs(t.scaleY);if(M*=Math.abs(t.scaleX),o||a){if(o){const F=(this.ux-g)*y;this.xOffset+=F>M?M:F<-M?-M:F,this.ux=g}if(a){const F=(this.uy-v)*y;this.yOffset+=F>I?I:F<-I?-I:F,this.uy=v}if(x>=d){const F=this.xOffset,E=this.yOffset;C=n.damping**(60*d),S=d*n.massInverse,b=n.strength;const k=_*n.wind,O=_*n.gravity,D=(k*t.windX+O*t.gravityX)*t.scaleX,$=(k*t.windY+O*t.gravityY)*t.scaleY;do o&&(this.xVelocity+=(D-this.xOffset*b)*S,this.xOffset+=this.xVelocity*d,this.xVelocity*=C),a&&(this.yVelocity-=($+this.yOffset*b)*S,this.yOffset+=this.yVelocity*d,this.yVelocity*=C),x-=d;while(x>=d);this.xLag=this.xOffset-F,this.yLag=this.yOffset-E}f=Math.max(0,1-x/d),o&&(h.worldX+=(this.xOffset-this.xLag*f)*r*this.data.x),a&&(h.worldY+=(this.yOffset-this.yLag*f)*r*this.data.y)}if(c||l){let F=Math.atan2(h.c,h.a),E=0,k=0,O=0,D=this.cx-h.worldX,$=this.cy-h.worldY;if(D>M?D=M:D<-M&&(D=-M),$>I?$=I:$<-I&&($=-I),x=this.remaining,c){O=(this.data.rotate+this.data.shearX)*r,f=this.rotateLag*Math.max(0,1-m/d);let N=Math.atan2($+this.ty,D+this.tx)-F-(this.rotateOffset-f)*O;this.rotateOffset+=(N-Math.ceil(N*Ee.invPI2-.5)*Ee.PI2)*y,N=(this.rotateOffset-f)*O+F,E=Math.cos(N),k=Math.sin(N),l&&(N=u*h.getWorldScaleX(),N>0&&(this.scaleOffset+=(D*E+$*k)*y/N))}else{E=Math.cos(F),k=Math.sin(F);const N=u*h.getWorldScaleX()-this.scaleLag*Math.max(0,1-m/d);N>0&&(this.scaleOffset+=(D*E+$*k)*y/N)}if(x>=d){C===-1&&(C=n.damping**(60*d),S=d*n.massInverse,b=n.strength);const N=n.wind*t.windX+n.gravity*t.gravityX,U=(n.wind*t.windY+n.gravity*t.gravityY)*bm.yDir,A=this.rotateOffset,P=this.scaleOffset,L=u/_;for(;;)if(x-=d,l&&(this.scaleVelocity+=(N*E-U*k-this.scaleOffset*b)*S,this.scaleOffset+=this.scaleVelocity*d,this.scaleVelocity*=C),c){if(this.rotateVelocity-=((N*k+U*E)*L+this.rotateOffset*b)*S,this.rotateOffset+=this.rotateVelocity*d,this.rotateVelocity*=C,x0){let x=0;this.data.rotate>0&&(x=p*this.data.rotate,m=Math.sin(x),g=Math.cos(x),v=h.b,h.b=g*v-m*h.d,h.d=m*v+g*h.d),x+=p*this.data.shearX,m=Math.sin(x),g=Math.cos(x),v=h.a,h.a=g*v-m*h.c,h.c=m*v+g*h.c}else p*=this.data.rotate,m=Math.sin(p),g=Math.cos(p),v=h.a,h.a=g*v-m*h.c,h.c=m*v+g*h.c,v=h.b,h.b=g*v-m*h.d,h.d=m*v+g*h.d}if(l){let p=1+(this.scaleOffset-this.scaleLag*f)*r*this.data.scaleX;switch(h.a*=p,h.c*=p,this.data.scaleYMode){case Ni.Uniform:h.b*=p,h.d*=p;break;case Ni.Volume:p=Math.abs(p),p=p>=.7?1/p:4-3.67347*p,h.b*=p,h.d*=p}}i!==Ur.pose&&(this.tx=u*h.a,this.ty=u*h.c)}}sort(t){const i=this.bone.bone;t.sortBone(i),t._updateCache.push(this),t.sortReset(i.children),t.constrained(i)}isSourceActive(){return this.bone.bone.active}}class kc extends Ml{constructor(t){super(t,new ym);w(this,"_bone",null);w(this,"x",0);w(this,"y",0);w(this,"rotate",0);w(this,"scaleX",0);w(this,"shearX",0);w(this,"limit",0);w(this,"step",0);w(this,"inertiaGlobal",!1);w(this,"strengthGlobal",!1);w(this,"dampingGlobal",!1);w(this,"massGlobal",!1);w(this,"windGlobal",!1);w(this,"gravityGlobal",!1);w(this,"mixGlobal",!1);w(this,"_scaleYMode",Ni.None)}set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}get scaleYMode(){return this._scaleYMode}set scaleYMode(t){if(t==null)throw new Error("scaleYMode cannot be null.");this._scaleYMode=t}create(t){return new uu(this,t)}}typeof Math.fround>"u"&&(Math.fround=(s=>e=>(s[0]=e,s[0]))(new Float32Array(1)));class wm{constructor(){w(this,"time",0);w(this,"mix",0)}set(e){this.time=e.time,this.mix=e.mix}}const qa=class qa extends Tl{constructor(t,i){super(t,new wm,new wm);w(this,"bone",null);if(!i)throw new Error("skeleton cannot be null.");t.bone!=null&&(this.bone=i.bones[t.bone.index])}copy(t){var i=new qa(this.data,t);return i.pose.set(this.pose),i}update(t,i){const n=this.appliedPose;if(n.mix===0)return;const r=this.data,o=r.animation,a=this.bone;if(a!==null){if(!a.active)return;r.local&&a.appliedPose.validateLocalTransform(t),n.time=r.offset+(r.property.value(t,a.appliedPose,r.local,qa.offsets)-r.property.offset)*r.scale,r.loop?n.time=o.duration+n.time%o.duration:n.time=Math.max(0,n.time)}const c=t.bones,l=o.bones;for(let h=0,u=o.bones.length;h=n.length&&(n.length=e+1),n[e]||(n[e]={}),n[e][t]=i}addSkin(e){for(let i=0;i= 0.");if(!n)throw new Error("boneData cannot be null.");this.index=t,this.boneData=n}}var Th;(function(s){s[s.Normal=0]="Normal",s[s.Additive=1]="Additive",s[s.Multiply=2]="Multiply",s[s.Screen=3]="Screen"})(Th||(Th={}));class Tm{constructor(){w(this,"mixRotate",0);w(this,"mixX",0);w(this,"mixY",0);w(this,"mixScaleX",0);w(this,"mixScaleY",0);w(this,"mixShearY",0)}set(e){this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}}class Tp extends Tl{constructor(t,i){super(t,new Tm,new Tm);w(this,"bones");w(this,"source");if(!i)throw new Error("skeleton cannot be null.");this.bones=[];for(const r of t.bones)this.bones.push(i.bones[r.index].constrainedPose);const n=i.bones[t.source.index];if(n==null)throw new Error("source cannot be null.");this.source=n}copy(t){var i=new Tp(this.data,t);return i.pose.set(this.pose),i}update(t,i){const n=this.appliedPose;if(n.mixRotate===0&&n.mixX===0&&n.mixY===0&&n.mixScaleX===0&&n.mixScaleY===0&&n.mixShearY===0)return;const r=this.data,o=r.localSource,a=r.localTarget,c=r.additive,l=r.clamp,h=r.offsets,u=this.source.appliedPose;o&&u.validateLocalTransform(t);const d=r.properties,f=r.properties.length,p=this.bones;for(let m=0,g=this.bones.length;m0?n[xt.ROTATION]:-n[xt.ROTATION]);return a<0&&(a+=360),a}}class aS extends ca{mix(e){return e.mixRotate}apply(e,t,i,n,r,o){if(r)i.rotation+=(o?n:n-i.rotation)*t.mixRotate;else{const a=e.scaleX,c=e.scaleY,l=1/a,h=1/c,u=i.a*l,d=i.b*l,f=i.c*h,p=i.d*h;n*=Ee.degRad,o||(n-=Math.atan2(f,u)),n>Ee.PI?n-=Ee.PI2:n<-Ee.PI&&(n+=Ee.PI2),n*=t.mixRotate;const m=Math.cos(n),g=Math.sin(n);i.a=(m*u-g*f)*a,i.b=(m*d-g*p)*a,i.c=(g*u+m*f)*c,i.d=(g*d+m*p)*c}}}class Cm extends la{value(e,t,i,n){return i?t.x+n[xt.X]:(n[xt.X]*t.a+n[xt.Y]*t.b+t.worldX)/e.scaleX}}class lS extends ca{mix(e){return e.mixX}apply(e,t,i,n,r,o){r?i.x+=(o?n:n-i.x)*t.mixX:(o||(n-=i.worldX/e.scaleX),i.worldX+=n*t.mixX*e.scaleX)}}class Am extends la{value(e,t,i,n){return i?t.y+n[xt.Y]:(n[xt.X]*t.c+n[xt.Y]*t.d+t.worldY)/e.scaleY}}class cS extends ca{mix(e){return e.mixY}apply(e,t,i,n,r,o){r?i.y+=(o?n:n-i.y)*t.mixY:(o||(n-=i.worldY/e.scaleY),i.worldY+=n*t.mixY*e.scaleY)}}class Em extends la{value(e,t,i,n){if(i)return t.scaleX+n[xt.SCALEX];const r=t.a/e.scaleX,o=t.c/e.scaleY;return Math.sqrt(r*r+o*o)+n[xt.SCALEX]}}class hS extends ca{mix(e){return e.mixScaleX}apply(e,t,i,n,r,o){if(r)o?i.scaleX*=1+(n-1)*t.mixScaleX:i.scaleX!==0&&(i.scaleX+=(n-i.scaleX)*t.mixScaleX);else if(o){const a=1+(n-1)*t.mixScaleX;i.a*=a,i.c*=a}else{let a=i.a/e.scaleX,c=i.c/e.scaleY,l=Math.sqrt(a*a+c*c);l!==0&&(l=1+(n-l)*t.mixScaleX/l,i.a*=l,i.c*=l)}}}class Im extends la{value(e,t,i,n){if(i)return t.scaleY+n[xt.SCALEY];const r=t.b/e.scaleX,o=t.d/e.scaleY;return Math.sqrt(r*r+o*o)+n[xt.SCALEY]}}class uS extends ca{mix(e){return e.mixScaleY}apply(e,t,i,n,r,o){if(r)o?i.scaleY*=1+(n-1)*t.mixScaleY:i.scaleY!==0&&(i.scaleY+=(n-i.scaleY)*t.mixScaleY);else if(o){const a=1+(n-1)*t.mixScaleY;i.b*=a,i.d*=a}else{let a=i.b/e.scaleX,c=i.d/e.scaleY,l=Math.sqrt(a*a+c*c);l!==0&&(l=1+(n-l)*t.mixScaleY/l,i.b*=l,i.d*=l)}}}class Rm extends la{value(e,t,i,n){if(i)return t.shearY+n[xt.SHEARY];const r=1/e.scaleX,o=1/e.scaleY;return(Math.atan2(t.d*o,t.b*r)-Math.atan2(t.c*o,t.a*r))*Ee.radDeg-90+n[xt.SHEARY]}}class dS extends ca{mix(e){return e.mixShearY}apply(e,t,i,n,r,o){if(r)o||(n-=i.shearY),i.shearY+=n*t.mixShearY;else{const a=e.scaleX,c=e.scaleY,l=i.b/a,h=i.d/c,u=Math.atan2(h,l);n=(n+90)*Ee.degRad,o?n-=Ee.PI/2:(n-=u-Math.atan2(i.c/c,i.a/a),n>Ee.PI?n-=Ee.PI2:n<-Ee.PI&&(n+=Ee.PI2)),n=u+n*t.mixShearY;const d=Math.sqrt(l*l+h*h);i.b=Math.cos(n)*d*a,i.d=Math.sin(n)*d*c}}}class nX{constructor(e){w(this,"scale",1);w(this,"attachmentLoader");w(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new rS;i.name="";const n=new w3(e),r=n.readInt32(),o=n.readInt32();i.hash=o===0&&r===0?null:o.toString(16)+r.toString(16),i.version=n.readString(),i.x=n.readFloat(),i.y=n.readFloat(),i.width=n.readFloat(),i.height=n.readFloat(),i.referenceScale=n.readFloat()*t;const a=n.readBoolean();a&&(i.fps=n.readFloat(),i.imagesPath=n.readString(),i.audioPath=n.readString());let c=0;c=n.readInt(!0);for(let p=0;p>5;for(let _=0,C;_>1&1,v.spacingMode=x>>2&3,v.rotateMode=x>>4&3,(x&128)!==0&&(v.offsetRotation=n.readFloat());const y=v.setupPose;y.position=n.readFloat(),v.positionMode===on.Fixed&&(y.position*=t),y.spacing=n.readFloat(),(v.spacingMode===ci.Length||v.spacingMode===ci.Fixed)&&(y.spacing*=t),y.mixRotate=n.readFloat(),y.mixX=n.readFloat(),y.mixY=n.readFloat(),h.push(v);break}case H3:{const v=new kc(m);v.bone=l[n.readInt(!0)];let x=n.readByte();if(v.skinRequired=(x&1)!==0,(x&2)!==0&&(v.x=n.readFloat()),(x&4)!==0&&(v.y=n.readFloat()),(x&8)!==0&&(v.rotate=n.readFloat()),(x&16)!==0){let _=n.readFloat();_<-2?(v.scaleYMode=Ni.Volume,_=-2-_):_<0&&(v.scaleYMode=Ni.Uniform,_=-1-_),v.scaleX=_}(x&32)!==0&&(v.shearX=n.readFloat()),v.limit=((x&64)!==0?n.readFloat():5e3)*t,v.step=1/n.readUnsignedByte();const y=v.setupPose;y.inertia=n.readFloat(),y.strength=n.readFloat(),y.damping=n.readFloat(),y.massInverse=(x&128)!==0?n.readFloat():1,y.wind=n.readFloat(),y.gravity=n.readFloat(),x=n.readByte(),(x&1)!==0&&(v.inertiaGlobal=!0),(x&2)!==0&&(v.strengthGlobal=!0),(x&4)!==0&&(v.dampingGlobal=!0),(x&8)!==0&&(v.massGlobal=!0),(x&16)!==0&&(v.windGlobal=!0),(x&32)!==0&&(v.gravityGlobal=!0),(x&64)!==0&&(v.mixGlobal=!0),y.mix=(x&128)!==0?n.readFloat():1,h.push(v);break}case j3:{const v=new Xr(m),x=n.readByte();if(v.skinRequired=(x&1)!==0,v.loop=(x&2)!==0,v.additive=(x&4)!==0,(x&8)!==0){const y=n.readFloat();a&&(x&64)!==0?v.max=y:v.setupPose.time=y}if((x&16)!==0&&(v.setupPose.mix=(x&32)!==0?n.readFloat():1),(x&64)!==0){v.local=(x&128)!==0,v.bone=l[n.readInt(!0)];const y=n.readFloat();let _=1;switch(n.readByte()){case 0:v.property=new Mm;break;case 1:{_=t,v.property=new Cm;break}case 2:{_=t,v.property=new Am;break}case 3:v.property=new Em;break;case 4:v.property=new Im;break;case 5:v.property=new Rm;break;default:continue}v.property.offset=y*_,v.offset=n.readFloat(),v.scale=n.readFloat()/_}h.push(v);break}}}const d=this.readSkin(n,i,!0,a);d&&(i.defaultSkin=d,i.skins.push(d));{let p=i.skins.length;for(Ye.setArraySize(i.skins,c=p+n.readInt(!0));p0){x=[];for(let b=0;b>4,e.readFloat())}r.push(F);break}}}}}const a=i.slots.length,c=e.readInt(!0);if(c>0){const f=new dr(c);for(let p=0;p0){const f=new ul(h);for(let p=0;p>>1^-(i&1)}readStringRef(){const e=this.readInt(!0);return e===0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="";for(let i=0;i>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),i+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),i+=3;break;default:t+=String.fromCharCode(n),i++}}return t}readFloat(){const e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!==0}}let S3=class{constructor(e,t,i,n,r,o){w(this,"source");w(this,"skinIndex");w(this,"slotIndex");w(this,"sourceIndex");w(this,"mesh");w(this,"inheritTimelines");this.mesh=e,this.skinIndex=t,this.slotIndex=i,this.sourceIndex=n,this.source=r,this.inheritTimelines=o}};class Jv{constructor(e=null,t,i=0){w(this,"bones");w(this,"vertices");w(this,"length");this.bones=e,this.vertices=t,this.length=i}}var vn;(function(s){s[s.Region=0]="Region",s[s.BoundingBox=1]="BoundingBox",s[s.Mesh=2]="Mesh",s[s.LinkedMesh=3]="LinkedMesh",s[s.Path=4]="Path",s[s.Point=5]="Point",s[s.Clipping=6]="Clipping"})(vn||(vn={}));function ei(s,e,t,i){t instanceof En?_3(s,e,t,i):T3(s,e,t,i)}function _3(s,e,t,i){let n=s.readFloat(),r=s.readFloat()*i;for(let o=0,a=0,c=t.getFrameCount()-1;t.setFrame(o,n,r),o!==c;o++){const l=s.readFloat(),h=s.readFloat()*i;switch(s.readByte()){case Gs:t.setStepped(o);break;case Hs:ut(s,t,a++,o,0,n,l,r,h,i)}n=l,r=h}e.push(t)}function T3(s,e,t,i){let n=s.readFloat(),r=s.readFloat()*i,o=s.readFloat()*i;for(let a=0,c=0,l=t.getFrameCount()-1;t.setFrame(a,n,r,o),a!==l;a++){const h=s.readFloat(),u=s.readFloat()*i,d=s.readFloat()*i;switch(s.readByte()){case Gs:t.setStepped(a);break;case Hs:ut(s,t,c++,a,0,n,h,r,u,i),ut(s,t,c++,a,1,n,h,o,d,i)}n=h,r=u,o=d}e.push(t)}function Qv(s,e){const t=s.readInt(!0);if(t===0)return null;const i=new Array(e).fill(-1),n=new Array(e-t);let r=0,o=0;for(let a=0;a=0;a--)i[a]===-1&&(i[a]=n[--o]);return i}function ut(s,e,t,i,n,r,o,a,c,l){e.setBezier(t,i,n,r,a,s.readFloat(),s.readFloat()*l,s.readFloat(),s.readFloat()*l,o,c)}const M3=0,C3=1,A3=2,E3=3,I3=4,R3=5,P3=6,k3=7,F3=8,O3=9,B3=10,L3=0,D3=1,N3=2,U3=3,$3=4,X3=5,V3=0,Y3=1,G3=2,H3=3,j3=4,W3=0,z3=1,q3=0,K3=1,Z3=2,J3=0,Q3=1,eO=2,tO=4,iO=5,sO=6,nO=7,rO=8,oO=0,aO=1,Gs=1,Hs=2;class lO{constructor(e){w(this,"attachmentLoader");w(this,"scale",1);w(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new rS,n=typeof e=="string"?JSON.parse(e):e,r=n.skeleton;if(r&&(i.hash=r.hash,i.version=r.spine,i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height,i.referenceScale=Z(r,"referenceScale",100)*t,i.fps=r.fps,i.imagesPath=r.images??null,i.audioPath=r.audio??null),n.bones)for(let o=0;o0&&l.properties.push(S)}l.offsets[xt.ROTATION]=Z(o,"rotation",0),l.offsets[xt.X]=Z(o,"x",0)*t,l.offsets[xt.Y]=Z(o,"y",0)*t,l.offsets[xt.SCALEX]=Z(o,"scaleX",0),l.offsets[xt.SCALEY]=Z(o,"scaleY",0),l.offsets[xt.SHEARY]=Z(o,"shearY",0);const y=l.setupPose;d&&(y.mixRotate=Z(o,"mixRotate",1)),f&&(y.mixX=Z(o,"mixX",1)),p&&(y.mixY=Z(o,"mixY",y.mixX)),m&&(y.mixScaleX=Z(o,"mixScaleX",1)),g&&(y.mixScaleY=Z(o,"mixScaleY",y.mixScaleX)),v&&(y.mixShearY=Z(o,"mixShearY",1)),i.constraints.push(l);break}case"path":{const l=new Pc(a);l.skinRequired=c;for(let f=0;f0){const d=i.findConstraint(l,kc);if(!d)throw new Error(`Physics constraint not found: ${l}`);u=i.constraints.indexOf(d)}for(const d in h){const f=h[d];let p=f[0];if(!p)continue;const m=f.length;let g,v=0;if(d==="reset"){const x=new _h(m,u);for(let y=0;p!=null;p=f[y+1],y++)x.setFrame(y,Z(p,"time",0));r.push(x);continue}switch(d){case"inertia":g=new Ww(m,m,u);break;case"strength":g=new zw(m,m,u);break;case"damping":g=new qw(m,m,u);break;case"mass":g=new Kw(m,m,u);break;case"wind":g=new Zw(m,m,u);break;case"gravity":g=new Jw(m,m,u);break;case"mix":{v=1,g=new Qw(m,m,u);break}default:continue}Zi(r,f,g,v,1)}}if(e.slider)for(const l in e.slider){const h=e.slider[l],u=i.findConstraint(l,Xr);if(!u)throw new Error(`Slider not found: ${l}`);const d=i.constraints.indexOf(u);for(const f in h){const p=h[f];if(!p[0])continue;const g=p.length;switch(f){case"time":Zi(r,p,new eS(g,g,d),1,1);break;case"mix":Zi(r,p,new tS(g,g,d),1,1);break}}}if(e.attachments)for(const l in e.attachments){const h=e.attachments[l],u=i.findSkin(l);if(!u)throw new Error(`Skin not found: ${l}`);for(const d in h){const f=h[d],p=i.findSlot(d);if(!p)throw new Error(`Attachment slot not found: ${d}`);const m=p.index;for(const g in f){const v=f[g],x=u.getAttachment(m,g);if(!x)throw new Error(`Timeline attachment not found: ${g}`);for(const y in v){const _=v[y];let C=_[0];if(C){if(y==="deform"){const S=x.bones,b=x.vertices,M=S?b.length/3*2:b.length,I=new Xw(_.length,_.length,m,x);let F=Z(C,"time",0);for(let E=0,k=0;;E++){let O;const D=Z(C,"vertices",null);if(!D)O=S?Ye.newFloatArray(M):b;else{O=Ye.newFloatArray(M);const A=Z(C,"offset",0);if(Ye.arrayCopy(D,0,O,A,D.length),n!==1)for(let P=A,L=P+D.length;P=0;l--)r[l]===-1&&(r[l]=o[--c]);return r}function mt(s,e,t,i,n,r,o,a,c,l){if(s==="stepped")return e.setStepped(i),t;const h=n<<2,u=s[h],d=s[h+1]*l,f=s[h+2],p=s[h+3]*l;return e.setBezier(t,i,n,r,a,u,d,f,p,o,c),t+1}function Z(s,e,t){return s[e]!==void 0?s[e]:t}class hO{newRegionAttachment(e,t,i,n){return new ru(t,i)}newMeshAttachment(e,t,i,n){return new Sl(t,i)}newBoundingBoxAttachment(e,t){return new U1(t)}newPathAttachment(e,t){return new hl(t)}newPointAttachment(e,t){return new H1(t)}newClippingAttachment(e,t){return new Wo(t)}}class uO{sequence(e){for(let t=0;t!Number.isInteger(h)||h<0||h>=o))throw new Error(`拖尾网格“${e}”的三角形索引越界`);const a=Number(s.hull)||0;if(!Number.isInteger(a)||a<0||a>o)throw new Error(`拖尾网格“${e}”的外轮廓数量无效`);if(Array.isArray(s.edges)&&s.edges.some(h=>!Number.isInteger(h)||h<0||h>=o*2||h%2))throw new Error(`拖尾网格“${e}”的外轮廓边索引越界`);if(n.length===i.length)return;let c=0,l=0;for(;c=t)throw new Error(`拖尾网格“${e}”引用了不存在的骨骼`);if(![p,m,g].every(Number.isFinite)||g<0)throw new Error(`拖尾网格“${e}”包含无效权重数据`);u+=g}if(Math.abs(u-1)>.001)throw new Error(`拖尾网格“${e}”的顶点权重之和不为 1`);l++}if(c!==n.length||l!==o)throw new Error(`拖尾网格“${e}”的顶点数量与 UV 不一致`)}function mO(s,e){var r,o,a,c;const t=Array.isArray(s.bones)?s.bones:[],i=new Map(t.map(l=>[String(l.name||""),l])),n=new Set;for(const l of t){if(l.inherit!=null&&!dO.has(l.inherit))throw new Error(`骨骼“${l.name||""}”的 inherit 值“${l.inherit}”不符合 Spine ${e} JSON 格式`);if(/_particle_\d+_trail_/.test(String(l.name||""))){const h=i.get(String(l.parent||""));if(!h||/_particle_\d+_trail_/.test(String(h.name||"")))throw new Error(`拖尾骨骼“${l.name||""}”必须直接挂在粒子系统骨骼下,不能组成骨骼链`)}}for(const l of Array.isArray(s.skins)?s.skins:[]){const h=(l==null?void 0:l.attachments)||{};for(const u of Object.keys(h))for(const d of Object.keys(h[u]||{})){const f=h[u][d];(f==null?void 0:f.type)==="mesh"&&(fO(f,d,t.length),((r=f.vertices)==null?void 0:r.length)!==((o=f.uvs)==null?void 0:o.length)&&n.add(u))}}for(const l of Object.values(s.animations||{}))for(const h of n){const u=(c=(a=l==null?void 0:l.slots)==null?void 0:a[h])==null?void 0:c.attachment;if(Array.isArray(u)&&u.some(d=>!(d!=null&&d.name)))throw new Error(`加权拖尾插槽“${h}”不能使用空附件,未出现或死亡阶段应将对应骨骼缩放设为 0`)}}function pO(s){var e;if(String(((e=s==null?void 0:s.skeleton)==null?void 0:e.spine)||"")!=="3.8")throw new Error("Spine 3.8 导出的版本标识必须为 3.8");for(const t of s.bones||[])if(t.inherit!=null)throw new Error(`Spine 3.8 骨骼“${t.name||""}”应使用 transform,不能使用 inherit`);for(const t of Object.values(s.animations||{})){for(const n of Object.values(t.slots||{})){if(n.rgba||n.rgba2)throw new Error("Spine 3.8 插槽颜色时间轴必须使用 color / twoColor");for(const r of n.attachment||[])if(!Object.prototype.hasOwnProperty.call(r,"name"))throw new Error("Spine 3.8 附件时间轴的隐藏帧必须显式写入 name: null")}for(const n of Object.values(t.bones||{}))for(const r of n.rotate||[])if(r.value!=null||r.angle==null)throw new Error("Spine 3.8 旋转时间轴必须使用 angle");const i=[t];for(;i.length;){const n=i.pop();if(!(!n||typeof n!="object")){if(!Array.isArray(n)&&Array.isArray(n.curve))throw new Error("Spine 3.8 不支持 4.x 数组曲线格式");i.push(...Object.values(n))}}}}function ty(s,e){var o;const t=JSON.parse(s),i=ah((o=t==null?void 0:t.skeleton)==null?void 0:o.spine);if(!i)throw new Error(`导出版本不受支持,仅支持 Spine ${im()}`);if(e&&i!==e)throw new Error(`导出版本不一致:设置为 Spine ${e},JSON 标记为 Spine ${i}`);mO(t,i),i==="3.8"&&pO(t);const n=i==="3.8"?nw(JSON.parse(JSON.stringify(t))):t,r=i==="4.3"?new lO(new uO).readSkeletonData(n):new fh(new hO).readSkeletonData(n);if(!r.bones.length)throw new Error("导出结果缺少骨骼");return{version:i,bones:r.bones.length,slots:r.slots.length,animations:r.animations.length}}const fS="http://127.0.0.1:27843";class Mh extends Error{constructor(t,i="CONNECTOR_ERROR",n){super(t);w(this,"code");w(this,"pairUrl");this.name="SpineConnectorError",this.code=i,this.pairUrl=n}}function Pm(s,e){return String(s||"").trim().replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||e}function gO(s,e){const t=/\.([a-z0-9]{2,5})$/i.exec(s);return t?`.${t[1].toLowerCase()}`:e.includes("jpeg")?".jpg":e.includes("webp")?".webp":e.includes("gif")?".gif":".png"}function vO(s,e,t){const i=String(s||"").replace(/\\/g,"/").split("/").filter(Boolean).map(r=>Pm(r,"images")),n=Pm(e.replace(/\.[^./\\]+$/,""),"image");return[...i,`${n}${gO(e,t)}`].join("/")}async function rf(s,e,t){if(!s)return null;const i=await fetch(s);if(!i.ok)throw new Error(`无法读取导出图片:${t}`);const n=await i.blob(),r=new Uint8Array(await n.arrayBuffer());let o="";const a=32768;for(let c=0;co.finally(()=>{i++,e==null||e(i,t.length)});for(const o of s.filter(a=>a.visible!==!1)){for(const a of o.config.imageResources)if(a.imageMode==="sequence"&&a.sequenceFrames.length)for(const c of a.sequenceFrames)t.push(n(rf(c.previewUrl,a.textureFolder,c.name||a.textureName)));else t.push(n(rf(a.previewUrl,a.textureFolder,a.textureName)));if(o.config.trail)for(const a of o.config.trailResources)t.push(n(rf(a.previewUrl,"",a.textureName)))}const r=new Map;for(const o of await Promise.all(t))o&&!r.has(o.path)&&r.set(o.path,o);return[...r.values()]}async function yO(){try{const s=await fetch(`${fS}/v1/health`,{cache:"no-store"});if(!s.ok)throw new Error(`HTTP ${s.status}`);return{available:!0,...await s.json()}}catch(s){return{available:!1,authorized:!1,error:s instanceof Error?s.message:String(s)}}}async function xO(s,e){const t=await mS(s.systems,(n,r)=>{e==null||e({phase:"images",progress:r?n/r:1})}),i=JSON.stringify({schemaVersion:1,projectName:s.projectName,spineVersion:s.spineVersion,skeletonJson:s.skeletonJson,images:t});return new Promise((n,r)=>{const o=new XMLHttpRequest;o.open("POST",`${fS}/v1/convert`),o.responseType="blob",o.setRequestHeader("Content-Type","application/json"),o.upload.onprogress=a=>{e==null||e({phase:"upload",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.upload.onloadend=()=>e==null?void 0:e({phase:"processing",progress:null}),o.onprogress=a=>{e==null||e({phase:"download",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.onerror=()=>r(new Mh("未检测到本地 Spine 连接器,请先启动连接器","CONNECTOR_OFFLINE")),o.onload=async()=>{const a=o.response;if(o.status<200||o.status>=300){let h={};try{h=JSON.parse(await a.text())}catch{}r(new Mh(h.message||`Spine 连接器返回错误:HTTP ${o.status}`,h.code,h.pairUrl));return}const c=o.getResponseHeader("X-Spine-File-Name");let l=`${Pm(s.projectName,"SpineParticle")}.zip`;if(c)try{l=decodeURIComponent(c)}catch{}n({blob:a,fileName:l,spineEditorVersion:o.getResponseHeader("X-Spine-Editor-Version")||s.spineVersion,imageCount:t.length})},o.send(i)})}function bO(s,e){const t=URL.createObjectURL(s),i=document.createElement("a");i.href=t,i.download=/\.zip$/i.test(e)?e:`${e}.zip`,i.style.display="none",document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}const wO=Array.from({length:256},(s,e)=>{let t=e;for(let i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;return t>>>0});function SO(s){let e=4294967295;for(const t of s)e=wO[(e^t)&255]^e>>>8;return(e^4294967295)>>>0}function _O(s){const e=String(s||"").replace(/\\/g,"/").split("/").filter(t=>t&&t!==".");if(!e.length||e.some(t=>t===".."))throw new Error("ZIP 文件路径无效");return e.join("/")}function TO(s=new Date){const e=Math.max(1980,s.getFullYear());return{time:s.getHours()<<11|s.getMinutes()<<5|Math.floor(s.getSeconds()/2),date:e-1980<<9|s.getMonth()+1<<5|s.getDate()}}function of(s){const e=new Uint8Array(s);return{bytes:e,view:new DataView(e.buffer)}}function iy(s){const e=new Uint8Array(s.reduce((i,n)=>i+n.length,0));let t=0;for(const i of s)e.set(i,t),t+=i.length;return e}function MO(s){const e=new TextEncoder,t=[],i=[],n=TO();let r=0;for(const c of s){const l=e.encode(_O(c.name)),h=SO(c.data),u=of(30);u.view.setUint32(0,67324752,!0),u.view.setUint16(4,20,!0),u.view.setUint16(6,2048,!0),u.view.setUint16(10,n.time,!0),u.view.setUint16(12,n.date,!0),u.view.setUint32(14,h,!0),u.view.setUint32(18,c.data.length,!0),u.view.setUint32(22,c.data.length,!0),u.view.setUint16(26,l.length,!0),t.push(u.bytes,l,c.data);const d=of(46);d.view.setUint32(0,33639248,!0),d.view.setUint16(4,20,!0),d.view.setUint16(6,20,!0),d.view.setUint16(8,2048,!0),d.view.setUint16(12,n.time,!0),d.view.setUint16(14,n.date,!0),d.view.setUint32(16,h,!0),d.view.setUint32(20,c.data.length,!0),d.view.setUint32(24,c.data.length,!0),d.view.setUint16(28,l.length,!0),d.view.setUint32(42,r,!0),i.push(d.bytes,l),r+=u.bytes.length+l.length+c.data.length}const o=iy(i),a=of(22);return a.view.setUint32(0,101010256,!0),a.view.setUint16(8,s.length,!0),a.view.setUint16(10,s.length,!0),a.view.setUint32(12,o.length,!0),a.view.setUint32(16,r,!0),new Blob([iy([...t,o,a.bytes])],{type:"application/zip"})}function CO(s){const e=atob(s),t=new Uint8Array(e.length);for(let i=0;ii===".."||/^[a-z]+:/i.test(i))?"images":t.join("/")}function EO(s){return String(s||"SpineParticle").replace(/\.json$/i,"").replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||"SpineParticle"}async function IO(s){const e=await mS(s.systems);if(!e.length)throw new Error("当前可见粒子系统没有可导出的图片");const t=AO(s.imagesPath);return{blob:MO(e.map(n=>({name:`${t}/${n.path}`,data:CO(n.dataBase64)}))),imageCount:e.length,folder:t}}function RO(s,e){const t=`${EO(e)}-images.zip`,i=URL.createObjectURL(s),n=document.createElement("a");return n.href=i,n.download=t,n.style.display="none",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3),t}function PO(s){s.settings.exportSettings=Qb(s.settings.exportSettings);const e=qe(()=>s.settings.exportSettings),t=Ge(!1),i=Ge(null),n=Ge(""),r=Ge(!1),o=Ge(null),a=Ge(""),c=Ge(""),l=qe(()=>{const b=o.value;return b?b.available?b.spineFound?b.authorized?"连接器可用 · Spine 已就绪":"连接器已启动,当前网站尚未授权":"连接器已启动,但未找到 Spine":"本地 Spine 连接器未启动":"正在检测本地 Spine 连接器…"}),h=qe(()=>{var b,M,I,F,E,k;return{ready:!!((b=o.value)!=null&&b.available)&&!!((M=o.value)!=null&&M.spineFound)&&!!((I=o.value)!=null&&I.authorized),warning:!!((F=o.value)!=null&&F.available)&&(!((E=o.value)!=null&&E.spineFound)||!((k=o.value)!=null&&k.authorized))}}),u=qe(()=>{var b,M,I;return!!((b=o.value)!=null&&b.available)&&!!((M=o.value)!=null&&M.spineFound)&&!!((I=o.value)!=null&&I.authorized)}),d=qe(()=>{const b=o.value;return!(b!=null&&b.available)||!b.spineFound||b.authorized||typeof window>"u"?"":`http://127.0.0.1:27843/pair?origin=${encodeURIComponent(window.location.origin)}`}),f=qe(()=>{const b=o.value;return b?b.available?b.spineFound?b.authorized?"":"未授权":"未找到 Spine":"未启动":"检测中"}),p=qe(()=>t.value?"正在重新计算并生成 Spine 工程":f.value?`暂不可用:${f.value}`:`调用本机 Spine 自动生成 ${e.value.spineVersion} 工程`);Vn(()=>{v(),m=window.setInterval(v,3e3)});let m,g=0;pl(()=>{m!==void 0&&window.clearInterval(m)});async function v(){const b=++g,M=await yO();if(b!==g)return;o.value=M;const I=c.value;(I==="CONNECTOR_OFFLINE"?M.available:I==="SPINE_NOT_FOUND"?M.available&&M.spineFound:I==="ORIGIN_NOT_ALLOWED"?M.available&&M.spineFound&&M.authorized:!!I&&M.available&&M.spineFound&&M.authorized)&&(c.value="",a.value="",r.value&&(r.value=!1,n.value=""))}function x(){return new Promise(b=>requestAnimationFrame(()=>b()))}async function y(b){s.timeline.playing=!1,s.timeline.frame=0,s.timeline.recorded=!1;for(const F of s.systems)F.frames=void 0;s.recalcTotalFrames(),await x(),s.timeline.playing=!0;const M=s.timeline.totalFrames/Math.max(1,s.timeline.fps)*1e3,I=performance.now()+Math.max(8e3,M*2.5+3e3);for(;!s.timeline.recorded;){if(performance.now()>I)throw new Error("重新计算动画超时,请确认页面仍在运行后重试");b==null||b(Math.min(.98,s.timeline.frame/Math.max(1,s.timeline.totalFrames-1))),await new Promise(F=>setTimeout(F,50))}b==null||b(1)}async function _(){if(!t.value){t.value=!0,i.value="json",r.value=!1,c.value="",a.value="",n.value="正在重新计算粒子动画…";try{await y();const b=Yv({systems:s.systems,timeline:s.timeline,settings:e.value});ty(b.text,e.value.spineVersion),a3(b,e.value.fileName);const M=b.warnings.length?`;${b.warnings.length} 条资源提示(缺图仍已导出)`:"";n.value=`已导出 Spine ${e.value.spineVersion}:${b.particleSystemCount} 个粒子系统、${b.animationCount} 个动画、${b.boneCount} 根骨骼${M}`}catch(b){r.value=!0,n.value=b instanceof Error?b.message:String(b)}finally{t.value=!1,i.value=null}}}async function C(){if(t.value)return;t.value=!0,i.value="spine",r.value=!1,c.value="",a.value="",n.value="正在重新计算粒子动画…";const b=yw("导出 Spine 包","正在重新计算粒子动画…");try{await b.paint(),await y(E=>b.update(E*18,"正在重新计算粒子动画…")),b.update(20,"正在生成 Spine JSON…");const M=Yv({systems:s.systems,timeline:s.timeline,settings:e.value});ty(M.text,e.value.spineVersion),n.value="正在整理图片并调用本机 Spine…";const I=e.value.fileName.replace(/\.json$/i,"")||"SpineParticle",F=await xO({projectName:I,spineVersion:e.value.spineVersion,skeletonJson:M.text,systems:s.systems},({phase:E,progress:k})=>{E==="images"?b.update(k==null?null:22+k*18,"正在整理工程图片…"):E==="upload"?b.update(k==null?null:40+k*30,"正在上传数据到 Spine 连接器…"):E==="processing"?b.update(null,"Spine 正在转换工程,请稍候…"):b.update(k==null?null:82+k*16,"正在下载生成的 Spine 工程包…")});b.update(99,"正在交给浏览器下载…"),bO(F.blob,F.fileName),n.value=`已生成 ${F.fileName}:包含 .spine 工程和 ${F.imageCount} 张图片,Spine ${F.spineEditorVersion}`,await v(),await b.finish("Spine 工程包已开始下载")}catch(M){const I=M instanceof Error?M.message:String(M);r.value=!0,c.value=M instanceof Mh?M.code:"",M instanceof Mh&&M.pairUrl&&(a.value=M.pairUrl),n.value=I,await v(),await b.fail(I)}finally{t.value=!1,i.value=null}}async function S(){if(!t.value){t.value=!0,i.value="images",r.value=!1,c.value="",a.value="",n.value="正在整理当前粒子系统使用的图片…";try{const b=await IO({systems:s.systems,imagesPath:e.value.imagesPath}),M=RO(b.blob,e.value.fileName);n.value=`已生成 ${M}:${b.folder}/ 内包含 ${b.imageCount} 张图片`}catch(b){r.value=!0,n.value=b instanceof Error?b.message:String(b)}finally{t.value=!1,i.value=null}}}return{exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorHealth:o,connectorPairUrl:a,connectorExportErrorCode:c,connectorStatusText:l,connectorStatusClass:h,connectorReady:u,connectorAuthorizationUrl:d,connectorDisabledReason:f,connectorButtonTitle:p,connectorHealthTimer:m,connectorHealthRequestId:g,refreshConnectorHealth:v,nextPaint:x,prepareExportFrames:y,exportSpineJson:_,exportSpineProject:C,exportSpineImages:S}}function kO(s){const e=Ge(null),t=Ge(""),i=Ge([]),n=Ge(!1),r=Ge(""),o=Ge(!1);function a(){hw(s),o.value=!1,r.value="配置已保存到本地"}async function c(u){var p;const d=u.target,f=(p=d.files)==null?void 0:p[0];if(f){r.value="正在加载配置…",o.value=!1;try{await KP(s,f),r.value=`已加载:${f.name}`}catch(m){o.value=!0,r.value=m instanceof Error?m.message:String(m)}finally{d.value=""}}}async function l(){try{const u=await fetch(`/Preset/index.json?t=${Date.now()}`,{cache:"no-store"});if(!u.ok)throw new Error("无法读取预设列表");const d=await u.json();i.value=Array.isArray(d)?d.filter(f=>!!f&&typeof f.name=="string"&&typeof f.file=="string"):[]}catch{i.value=[]}}async function h(){const u=t.value;if(!u)return;n.value=!0,o.value=!1,r.value="正在加载预设…";const d=yw("加载预设",`正在下载 ${u}…`);try{await d.paint();const f=await fetch(`/Preset/${encodeURIComponent(u)}`,{cache:"no-store"});if(!f.ok)throw new Error(`无法读取预设:${u}`);const p=await BF(f,m=>{d.update(m==null?null:m*55,`正在下载 ${u}…`)});d.update(58,"正在解析预设配置…"),d.update(70,"正在解析并恢复预设资源…"),await dw(s,p),r.value=`已加载预设:${u.replace(/\.json$/i,"")}`,await d.finish("预设加载完成")}catch(f){o.value=!0;const p=f instanceof Error?f.message:String(f);r.value=`${p},请检查预设文件命名`,await d.fail(p)}finally{n.value=!1,t.value=""}}return Vn(l),{configFileInput:e,selectedPreset:t,presetOptions:i,presetLoading:n,configMessage:r,configError:o,saveConfig:a,onConfigFileChange:c,refreshPresets:l,loadSelectedPreset:h}}function FO(s){const e=Ge(null),t=Ge(null),i=Ge(null),n=Ge(null),r=Ge(null);function o(){var B;const P=(B=s.value)==null?void 0:B.config;if(!P)return;const L=Math.max(0,...P.trailResources.map(X=>X.id))+1;P.trailResources.push({id:L,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:um.map(X=>({...X})),boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:cm.map(X=>({...X})),shapeEnabled:!1,shapeCurve:dm.map(X=>({...X}))}),p()}function a(P){var L;r.value=P,(L=n.value)==null||L.click()}function c(P,L){var V;const B=(V=s.value)==null?void 0:V.config;if(!B)return;const X=P==="trailGridCols"?32:16;B[P]=Math.min(X,Math.max(2,Math.round(Number(L)||2)))}function l(P,L){var X;const B=(X=s.value)==null?void 0:X.config.trailResources.find(V=>V.id===P);B&&(B.boneCount=Math.min(16,Math.max(2,Math.round(Number(L)||2))))}function h(P,L){var X;const B=(X=s.value)==null?void 0:X.config.trailResources.find(V=>V.id===P);B&&(B.rotation=Math.max(-360,Math.min(360,Number(L)||0)))}async function u(P){var W,ne;const L=P.target,B=(W=L.files)==null?void 0:W[0],X=(ne=s.value)==null?void 0:ne.config,V=X==null?void 0:X.trailResources.find(re=>re.id===r.value);if(!B||!V){L.value="";return}const q=await M(B);V.texture=nr(await ze.fromURL(q)),V.previewUrl=q,V.textureName=B.name.replace(/\.[^.]+$/,"")||"trail",L.value="",r.value=null}async function d(P){var X;const L=(X=s.value)==null?void 0:X.config,B=L==null?void 0:L.trailResources.find(V=>V.id===P);B&&(B.texture=nr(await ze.fromURL("/images/trail.png")),B.previewUrl="/images/trail.png",B.textureName="trail",B.weight=100,B.locked=!1,B.rotation=0,B.boneCount=3,B.trailRatio=100,B.lengthMode="fixed",B.length=100,B.lengthMin=100,B.lengthMax=100,B.widthSizeMode="fixed",B.width=100,B.widthMin=100,B.widthMax=100,B.widthMode="particle",B.lifeLengthEnabled=!1,B.lifeLengthCurve=cm.map(V=>({...V})),B.shapeEnabled=!1,B.shapeCurve=dm.map(V=>({...V})),B.colorMode="particle",B.color="#ffffff",B.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],B.blend="normal",B.alphaMode="particle",B.alpha=1,B.alphaCurve=um.map(V=>({...V})),p())}function f(P){var X;const L=(X=s.value)==null?void 0:X.config.trailResources;if(!L||L.length<=1)return;const B=L.findIndex(V=>V.id===P);B>=0&&L.splice(B,1),p()}function p(){var V;const P=(V=s.value)==null?void 0:V.config.trailResources;if(!(P!=null&&P.length))return;if(P.length===1){P[0].weight=100,P[0].locked=!1;return}const L=P.filter(q=>q.locked),B=P.filter(q=>!q.locked);let X=L.reduce((q,W)=>q+Math.max(0,Number(W.weight)||0),0);X>100&&($(L,100,!0),X=100),$(B,100-X)}function m(P,L){var ne;const B=(ne=s.value)==null?void 0:ne.config.trailResources;if(!(B!=null&&B.length))return;if(B.length===1){B[0].weight=100,B[0].locked=!1;return}const X=B.find(re=>re.id===P);if(!X||X.locked)return;const V=B.filter(re=>re.id!==P&&re.locked).reduce((re,le)=>re+Math.max(0,Number(le.weight)||0),0),q=Math.max(0,100-V),W=B.filter(re=>re.id!==P&&!re.locked);X.weight=D(Math.min(q,Math.max(0,Number(L)||0))),W.length?$(W,q-X.weight,!0):X.weight=D(q)}function g(P){var X;const L=(X=s.value)==null?void 0:X.config.trailResources;if(!L||L.length===1)return;const B=L.find(V=>V.id===P);B&&(B.locked=!B.locked)}function v(P,L){const B=L.target;P.color=F(B.value,P.color),B.value=P.color}function x(P,L){v(P,L),L.target.blur()}function y(){var B;const P=(B=s.value)==null?void 0:B.config;if(!P)return;const L=Math.max(0,...P.imageResources.map(X=>X.id))+1;P.imageResources.push({id:L,texture:P.texture,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],blend:"normal",independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:hm.map(X=>({...X}))}),N()}function _(P){var L;i.value=P,(L=e.value)==null||L.click()}function C(P){var L;i.value=P,(L=t.value)==null||L.click()}async function S(P){var ne,re;const L=P.target,B=(ne=L.files)==null?void 0:ne[0],X=(re=s.value)==null?void 0:re.config,V=X==null?void 0:X.imageResources.find(le=>le.id===i.value);if(!B||!V){L.value="";return}const q=await M(B),W=nr(await ze.fromURL(q));V.texture=W,V.previewUrl=q,V.textureFolder="",V.textureName=B.name.replace(/\.[^.]+$/,"")||"particle",L.value="",i.value=null}async function b(P){var q;const L=P.target,B=Array.from(L.files||[]).sort((W,ne)=>W.name.localeCompare(ne.name,void 0,{numeric:!0,sensitivity:"base"})),X=(q=s.value)==null?void 0:q.config,V=X==null?void 0:X.imageResources.find(W=>W.id===i.value);if(!B.length||!V){L.value="";return}V.sequenceFrames=await Promise.all(B.map(async W=>{const ne=await M(W);return{name:W.name,previewUrl:ne,texture:nr(await ze.fromURL(ne))}})),V.imageMode="sequence",L.value="",i.value=null}function M(P){return new Promise((L,B)=>{const X=new FileReader;X.onload=()=>L(String(X.result||"")),X.onerror=()=>B(X.error),X.readAsDataURL(P)})}function I(P){var X;const L=(X=s.value)==null?void 0:X.config,B=L==null?void 0:L.imageResources.find(V=>V.id===P);!L||!B||(B.texture=L.texture,B.textureName="star",B.textureFolder="",B.previewUrl="/images/star.png",B.imageMode="fixed",B.sequencePlayback="loop-forward",B.sequenceFps=30,B.sequenceFrames=[],B.scale=1,B.anchorX=.5,B.anchorY=.5,B.colorMode="fixed",B.colorStart="#ffffff",B.colorEnd="#ff4d4d",B.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],B.blend="normal",B.independentAlpha="off",B.alpha=1,B.alphaCurveMode="跟随导出",B.alphaCurve=hm.map(V=>({...V})),B.locked=!1,N())}function F(P,L){let B=P.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(B)&&(B=B.split("").map(X=>X+X).join("")),/^[0-9a-f]{6}$/i.test(B)?`#${B.toLowerCase()}`:L}function E(P,L){const B=L.target;P.colorStart=F(B.value,P.colorStart),B.value=P.colorStart}function k(P,L){E(P,L),L.target.blur()}function O(P){var X;const L=(X=s.value)==null?void 0:X.config.imageResources;if(!L||L.length<=1)return;const B=L.findIndex(V=>V.id===P);B>=0&&L.splice(B,1),N()}function D(P){return Math.round(P)}function $(P,L,B=!1){if(!P.length)return;const X=Math.max(0,D(L)),V=B?P.reduce((W,ne)=>W+Math.max(0,Number(ne.weight)||0),0):0;let q=0;P.forEach((W,ne)=>{const re=ne===P.length-1,le=D(re?X-q:V>0?X*Math.max(0,Number(W.weight)||0)/V:X/P.length);W.weight=le,q+=le})}function N(){var V;const P=(V=s.value)==null?void 0:V.config.imageResources;if(!(P!=null&&P.length))return;if(P.length===1){P[0].weight=100,P[0].locked=!1;return}const L=P.filter(q=>q.locked),B=P.filter(q=>!q.locked);let X=L.reduce((q,W)=>q+Math.max(0,Number(W.weight)||0),0);X>100&&($(L,100,!0),X=100),$(B,100-X)}function U(P,L){var ne;const B=(ne=s.value)==null?void 0:ne.config.imageResources;if(!(B!=null&&B.length))return;if(B.length===1){B[0].weight=100,B[0].locked=!1;return}const X=B.find(re=>re.id===P);if(!X||X.locked)return;const V=B.filter(re=>re.id!==P&&re.locked).reduce((re,le)=>re+Math.max(0,Number(le.weight)||0),0),q=Math.max(0,100-V),W=B.filter(re=>re.id!==P&&!re.locked);if(X.weight=D(Math.min(q,Math.max(0,Number(L)||0))),!W.length){X.weight=D(q);return}$(W,q-X.weight,!0)}function A(P){var X;const L=(X=s.value)==null?void 0:X.config.imageResources;if(!L||L.length===1)return;const B=L.find(V=>V.id===P);B&&(B.locked=!B.locked)}return{textureFileInput:e,sequenceFileInput:t,pendingResourceId:i,trailTextureFileInput:n,pendingTrailResourceId:r,addTrailResource:o,openTrailTexturePicker:a,onTrailRigChange:c,onTrailResourceBoneCountChange:l,onTrailResourceRotationChange:h,onTrailTextureFile:u,resetTrailTexture:d,removeTrailResource:f,rebalanceTrailWeights:p,setTrailResourceWeight:m,toggleTrailResourceLock:g,setTrailColor:v,commitTrailColor:x,addImageResource:y,openTexturePicker:_,openSequencePicker:C,onTextureFile:S,onSequenceFiles:b,readFileAsDataUrl:M,resetTexture:I,normalizeHex:F,setResourceFixedColor:E,commitResourceFixedColor:k,removeImageResource:O,roundWeight:D,distributeImageWeights:$,rebalanceImageWeights:N,setResourceWeight:U,toggleResourceLock:A}}function OO(){const s=ao(),{exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:c,connectorReady:l,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:p,exportSpineProject:m,exportSpineImages:g}=PO(s),{configFileInput:v,selectedPreset:x,presetOptions:y,presetLoading:_,configMessage:C,configError:S,saveConfig:b,onConfigFileChange:M,refreshPresets:I,loadSelectedPreset:F}=kO(s);function E(ee){return ee==="跟随导出"?e.value.keyframeCurve==="bezier"?"bezier":"linear":ee==="贝塞尔"?"bezier":"linear"}s.systems.length||s.addSystem();const k=qe(()=>{const ee=s.systems.findIndex(me=>me.id===s.activeId);return ee>=0?ee:0}),O=qe(()=>s.systems[k.value]||null),{textureFileInput:D,sequenceFileInput:$,trailTextureFileInput:N,addTrailResource:U,openTrailTexturePicker:A,onTrailRigChange:P,onTrailResourceBoneCountChange:L,onTrailResourceRotationChange:B,onTrailTextureFile:X,resetTrailTexture:V,removeTrailResource:q,setTrailResourceWeight:W,toggleTrailResourceLock:ne,setTrailColor:re,commitTrailColor:le,addImageResource:ue,openTexturePicker:ae,openSequencePicker:xe,onTextureFile:Y,onSequenceFiles:j,resetTexture:H,setResourceFixedColor:G,commitResourceFixedColor:z,removeImageResource:ie,setResourceWeight:fe,toggleResourceLock:te}=FO(O),oe=qe(()=>O.value?e1(O.value.config,s.timeline.fps):30),ce=qe(()=>{var me;const ee=(me=O.value)==null?void 0:me.config;return ee?Math.max(1,Math.ceil(Number(ee.loopDurationFrames)||1)):1}),Ce=qe(()=>s.activeObjectType),ye=qe(()=>s.activeObjectType==="collision"&&s.colliders.find(ee=>ee.id===s.activeObjectId)||null),we=qe(()=>s.activeObjectType==="path"&&s.paths.find(ee=>ee.id===s.activeObjectId)||null),Me=qe(()=>s.activeObjectType==="spine"&&s.spines.find(ee=>ee.id===s.activeObjectId)||null),ve=qe(()=>s.activeObjectType==="particle"?s.systems.some(ee=>ee.id===s.activeObjectId):s.activeObjectType==="collision"?s.colliders.some(ee=>ee.id===s.activeObjectId):s.activeObjectType==="path"?s.paths.some(ee=>ee.id===s.activeObjectId):s.spines.some(ee=>ee.id===s.activeObjectId)),Xe=qe(()=>{const ee=s.spines.find(me=>me.selectedBone&&me.bones.some(Ae=>Ae.name===me.selectedBone));return ee?{spine:ee,boneName:ee.selectedBone}:null}),pe=qe(()=>{var Ae;const ee=(Ae=O.value)==null?void 0:Ae.config;if(!ee||ee.emitterFollowMode!=="bone")return null;const me=s.spines.find(bt=>bt.id===ee.emitterFollowSpineId);return!me||!me.bones.some(bt=>bt.name===ee.emitterFollowBoneName)?null:{spine:me,boneName:ee.emitterFollowBoneName}}),Ke=Ge(!1),Ze=qe(()=>{var me;const ee=new Set(((me=O.value)==null?void 0:me.config.collisionColliderIds)||[]);return s.colliders.filter(Ae=>ee.has(Ae.id))}),Ct=qe(()=>{var me;const ee=new Set(((me=O.value)==null?void 0:me.config.collisionColliderIds)||[]);return s.colliders.filter(Ae=>!ee.has(Ae.id))});Xi(()=>{var ee,me;return[(ee=O.value)==null?void 0:ee.id,(me=O.value)==null?void 0:me.config.collision]},()=>{Ke.value=!1});function Lt(ee){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;!me||me.collisionColliderIds.includes(ee)||(me.collisionColliderIds.push(ee),Ke.value=!1)}function ii(ee){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;me&&(me.collisionColliderIds=me.collisionColliderIds.filter(bt=>bt!==ee))}Ma(()=>{for(const ee of s.systems)ee.visible==null&&(ee.visible=!0);for(const ee of s.colliders)ee.visible==null&&(ee.visible=!0);for(const ee of s.paths)ee.visible==null&&(ee.visible=!0);for(const ee of s.spines)ee.visible==null&&(ee.visible=!0)}),Ma(()=>{if(!O.value)return;const ee=pr(O.value.config);ee.lifeMode==="curve"&&(ee.lifeMode="random"),ee.speedMode==="curve"&&(ee.speedMode="random"),ee.scaleMode==="curve"&&(ee.scaleMode="random"),ee.initialRotationMode==="curve"&&(ee.initialRotationMode="random"),ee.mode==="stream"&&!(ee.duration>0)&&(ee.duration=1),ee.streamBehavior==="loop"&&(ee.emitterFollow||ee.emitterFollowMode!=="none")&&ot(ee)}),Ma(()=>{const ee=new Set(s.colliders.map(me=>me.id));for(const me of s.systems){const Ae=pr(me.config),bt=Ae.collisionColliderIds.filter(Sr=>ee.has(Sr));if(bt.length!==Ae.collisionColliderIds.length&&(Ae.collisionColliderIds=bt),Ae.spawnPathId>0&&!s.paths.some(Sr=>Sr.id===Ae.spawnPathId)&&(Ae.spawnPathId=0,(Ae.emissionAngleMode==="path-normal"||Ae.emissionAngleMode==="path-tangent")&&(Ae.emissionAngleMode="fixed")),Ae.emitterFollowMode!=="bone")continue;const Pt=s.spines.find(Sr=>Sr.id===Ae.emitterFollowSpineId);!!(Pt!=null&&Pt.bones.some(Sr=>Sr.name===Ae.emitterFollowBoneName))||(Ae.emitterFollowMode="none",Ae.emitterFollowSpineId=0,Ae.emitterFollowBoneName="")}}),Ma(()=>{for(const ee of s.colliders)ee.followPathId==null&&(ee.followPathId=0),ee.followDuration>0||(ee.followDuration=2),ee.followPathRotation==null&&(ee.followPathRotation=!1),["跟随导出","线性","贝塞尔"].includes(ee.followCurveMode)||(ee.followCurveMode="跟随导出"),(!Array.isArray(ee.followCurve)||ee.followCurve.length<2)&&(ee.followCurve=[{x:0,y:0},{x:1,y:1}])});const rs=no({config:!0,scene:!1,emitMode:!0,shape:!0,attr:!0,look:!0,mods:!0,export:!1});function zt(ee){rs[ee]=!rs[ee]}function se(ee){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;me&&(me.mode=ee,ee==="stream"&&!(me.duration>0)&&(me.duration=1))}function he(ee){var bt;const me=(bt=O.value)==null?void 0:bt.config;if(!me)return;const Ae=Math.min(1800,Math.max(1,Math.ceil(Number(ee)||1)));me.loopDurationFrames=Ae}function ot(ee){const me=cl();ee.emitterFollow=!1,ee.emitterFollowMode="none",ee.emitterFollowPathId=me.emitterFollowPathId,ee.emitterFollowSpineId=me.emitterFollowSpineId,ee.emitterFollowBoneName=me.emitterFollowBoneName,ee.emitterFollowBoneOffsetX=me.emitterFollowBoneOffsetX,ee.emitterFollowBoneOffsetY=me.emitterFollowBoneOffsetY,ee.emitterFollowBoneRotation=me.emitterFollowBoneRotation,ee.emitterFollowBoneScaleX=me.emitterFollowBoneScaleX,ee.emitterFollowBoneScaleY=me.emitterFollowBoneScaleY,ee.emitterAngleMode=me.emitterAngleMode,ee.emitterFollowCurve=me.emitterFollowCurve.map(Ae=>({...Ae})),ee.emitterFollowDuration=me.emitterFollowDuration,ee.emitterFollowSpace=me.emitterFollowSpace,ee.emitterFollowDirection=me.emitterFollowDirection,ee.emitterFollowOffset=me.emitterFollowOffset}function at(ee){var Pt;const me=(Pt=O.value)==null?void 0:Pt.config;if(!me||me.streamBehavior===ee)return;const Ae=ee==="loop",bt=Ae?"进入循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?":"退出循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?";window.confirm(bt)&&(ot(me),me.streamBehavior=ee,Ae||(me.generateLoopStartAnimation=!1,me.generateLoopEndAnimation=!1))}function gt(ee,me){var Pt;const Ae=(Pt=O.value)==null?void 0:Pt.config;if(!Ae)return;const bt=me.target.checked;ee==="start"?Ae.generateLoopStartAnimation=bt:Ae.generateLoopEndAnimation=bt}function $e(ee,me){var Pt;const Ae=(Pt=O.value)==null?void 0:Pt.config;if(!Ae)return;const bt=Math.min(1800,Math.max(1,Math.ceil(Number(me.target.value)||30)));ee==="start"?Ae.loopStartDurationFrames=bt:Ae.loopEndDurationFrames=bt}function _i(ee,me){var Pt;const Ae=(Pt=O.value)==null?void 0:Pt.config;if(!Ae)return;const bt=me.target.checked;ee==="start"?Ae.loopStartUseCustomDuration=bt:Ae.loopEndUseCustomDuration=bt}function pi(ee,me){const Ae=ee.target.value;if(me.emitterFollowMode=Ae,Ae!=="bone"){me.emitterFollowSpineId=0,me.emitterFollowBoneName="";return}$t(me)}function $t(ee){const me=Xe.value;if(!me){ee.emitterFollowMode="none",ee.emitterFollowSpineId=0,ee.emitterFollowBoneName="";return}ee.emitterFollowMode="bone",ee.emitterFollowSpineId=me.spine.id,ee.emitterFollowBoneName=me.boneName}const Fi={emitMode:["mode","rate","streamBehavior","loopDurationFrames","generateLoopStartAnimation","loopStartUseCustomDuration","loopStartDurationFrames","generateLoopEndAnimation","loopEndUseCustomDuration","loopEndDurationFrames","burstCount","burstLoop","delay","duration"],shape:["shape","shapeRangeVersion","innerRadius","outerRadius","innerRectW","innerRectH","outerRectW","outerRectH","spawnPathId","spawnPathDistribution","radius","rectW","rectH","emissionAngleMode","direction","spread","coneDirection","coneAngle"],attr:["lifeMin","lifeMax","lifeMode","lifeCurve","speedMin","speedMax","speedMode","speedCurve","scaleMin","scaleMax","scaleMode","scaleAxisMode","scaleYMin","scaleYMax","scaleCurve","scaleYCurve","scaleEndRatio","initialRotationMode","initialRotationMin","initialRotationMax","initialRotationCurve","rotationSpeedMin","rotationSpeedMax","speedOverLifeEnabled","speedOverLifeMode","speedOverLifeMin","speedOverLifeMax","speedOverLifeCurve","scaleOverLifeEnabled","scaleOverLifeMode","scaleOverLifeAxisMode","scaleOverLifeMin","scaleOverLifeMax","scaleYOverLifeMin","scaleYOverLifeMax","scaleOverLifeCurve","scaleYOverLifeCurve","rotationOverLifeEnabled","rotationOverLifeMode","rotationOverLifeCurve"],look:["texture","imageResources","imageWeightVersion","alpha","alphaEnd","colorStart","colorEnd","colorOverLife","blend","alphaMode","curveMode","alphaCurve","textureName","textureFolder","alphaScale","anchorX","anchorY","independentAlpha"],mods:["noise","noiseAmt","noiseRange","noiseSpeed","useGravity","gravity","gravityMode","gravityMin","gravityMax","gravityDirection","gravityCurve","wind","windX","windY","windMode","windMin","windMax","windDirection","windCurve","forceField","forceStrength","forceRadius","forceCenterX","forceCenterY","forceFalloff","attraction","attractionCenterX","attractionCenterY","attractionRadius","attractionDuration","attractionDelay","attractionDelayMode","attractionPath","trail","trailConfigVersion","trailResources","trailResourceVersion","trailTexture","trailTextureName","trailPreviewUrl","trailColorMode","trailColor","trailColorGradient","trailAlphaMode","trailAlpha","trailAlphaCurve","trailBoneCount","trailLength","trailWidth","trailWidthMode","trailLifeLengthEnabled","trailLifeLengthCurve","trailShapeEnabled","trailShapeCurve","trailGridRows","trailGridCols","collision","collisionColliderIds","pathFollow","emitterFollow","emitterFollowMode","emitterFollowPathId","emitterFollowSpineId","emitterFollowBoneName","emitterFollowBoneOffsetX","emitterFollowBoneOffsetY","emitterFollowBoneRotation","emitterFollowBoneScaleX","emitterFollowBoneScaleY","emitterAngleMode","emitterFollowCurve","emitterFollowDuration","emitterFollowSpace","emitterFollowDirection","emitterFollowOffset","damping"]};function vs(ee){var bt;const me=(bt=O.value)==null?void 0:bt.config;if(ee==="export"){s.settings.exportSettings=ap();return}if(!me)return;const Ae=cl();for(const Pt of Fi[ee])me[Pt]=Ae[Pt]}function Vi(){e.value.fps=Math.min(240,Math.max(1,Math.round(Number(e.value.fps)||30)))}function Ti(ee){var me;s.selectSystem(((me=s.systems[ee])==null?void 0:me.id)??0)}function uo(){s.addSystem()}function Cl(){s.addCollider()}function Al(){s.addPath()}function wr(){s.addSpine()}function ha(){s.duplicateSelectedObject()}function Yi(ee,me,Ae=0,bt=0,Pt=0,ma=0){return{x:ee,y:me,inX:Ae,inY:bt,outX:Pt,outY:ma}}function ua(){const ee=we.value;if(!(!ee||!ee.preset))if(ee.preset==="circle"){const Ae=60.751328;ee.points=[Yi(110,0,0,-Ae,0,Ae),Yi(0,110,Ae,0,-Ae,0),Yi(-110,0,0,Ae,0,-Ae),Yi(0,-110,-Ae,0,Ae,0)],ee.closed=!0}else if(ee.preset==="square")ee.points=[Yi(-100,-100),Yi(100,-100),Yi(100,100),Yi(-100,100)],ee.closed=!0;else{const me=ee.preset==="star"?10:6;ee.points=Array.from({length:me},(Ae,bt)=>{const Pt=ee.preset==="star"&&bt%2?50:110,ma=-Math.PI*.5+bt/me*Math.PI*2;return Yi(Math.cos(ma)*Pt,Math.sin(ma)*Pt)}),ee.closed=!0}}function da(){we.value&&(we.value.points=[])}function El(){O.value&&(O.value.config.seed=Math.floor(Math.random()*999999)+1)}function Il(ee){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;!me||ee==="direction"||(me.speedOverLifeMode=ee,ee==="curve"&&me.speedOverLifeMin===me.speedOverLifeMax&&(me.speedOverLifeMin=0,me.speedOverLifeMax=1))}function fo(){var me;const ee=(me=O.value)==null?void 0:me.config;!ee||ee.scaleOverLifeMode!=="curve"||(ee.scaleOverLifeMin===ee.scaleOverLifeMax&&(ee.scaleOverLifeMin=0,ee.scaleOverLifeMax=1),ee.scaleYOverLifeMin===ee.scaleYOverLifeMax&&(ee.scaleYOverLifeMin=0,ee.scaleYOverLifeMax=1))}function Rl(ee){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;!me||ee==="direction"||(me.scaleOverLifeMode=ee,fo())}const fa={point:{emissionAngleMode:"random",direction:0,spread:360},circle:{innerRadius:0,outerRadius:100,emissionAngleMode:"fixed",direction:-90,spread:0},rect:{innerRectW:0,innerRectH:0,outerRectW:200,outerRectH:100,emissionAngleMode:"fixed",direction:-90,spread:0},cone:{innerRadius:0,outerRadius:100,coneAngle:90,coneDirection:90,emissionAngleMode:"random",direction:90,spread:90},path:{spawnPathId:0,spawnPathDistribution:"fixed",emissionAngleMode:"fixed",direction:0,spread:0}};function Pl(){var Ae;const ee=(Ae=O.value)==null?void 0:Ae.config;if(!ee)return;const me=fa[ee.shape];me&&Object.assign(ee,me)}function du(){var me;const ee=(me=O.value)==null?void 0:me.config;!ee||ee.spawnPathId>0||(ee.emissionAngleMode==="path-normal"||ee.emissionAngleMode==="path-tangent")&&(ee.emissionAngleMode="fixed")}return{store:s,exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:c,connectorReady:l,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:p,exportSpineProject:m,exportSpineImages:g,configFileInput:v,selectedPreset:x,presetOptions:y,presetLoading:_,configMessage:C,configError:S,saveConfig:b,onConfigFileChange:M,refreshPresets:I,loadSelectedPreset:F,resolvedCurveEditorMode:E,sys:O,textureFileInput:D,sequenceFileInput:$,trailTextureFileInput:N,addTrailResource:U,openTrailTexturePicker:A,onTrailRigChange:P,onTrailResourceBoneCountChange:L,onTrailResourceRotationChange:B,onTrailTextureFile:X,resetTrailTexture:V,removeTrailResource:q,setTrailResourceWeight:W,toggleTrailResourceLock:ne,setTrailColor:re,commitTrailColor:le,addImageResource:ue,openTexturePicker:ae,openSequencePicker:xe,onTextureFile:Y,onSequenceFiles:j,resetTexture:H,setResourceFixedColor:G,commitResourceFixedColor:z,removeImageResource:ie,setResourceWeight:fe,toggleResourceLock:te,automaticLoopDuration:oe,loopDurationFrames:ce,activeObjectType:Ce,activeCollider:ye,activePath:we,activeSpine:Me,canCopyObject:ve,selectedSpineBone:Xe,boundSpineBone:pe,collisionPickerOpen:Ke,selectedCollisionBodies:Ze,availableCollisionBodies:Ct,addCollisionBody:Lt,removeCollisionBody:ii,collapsed:rs,toggle:zt,setEmitMode:se,setLoopDurationFrames:he,setStreamBehavior:at,setLoopSection:gt,setLoopSectionDuration:$e,setLoopCustomDuration:_i,onEmitterFollowModeChange:pi,bindSelectedBone:$t,resetModule:vs,normalizeExportFps:Vi,select:Ti,addSys:uo,addCollider:Cl,addPath:Al,addSpine:wr,copySelectedObject:ha,applyPathPreset:ua,clearPathAnchors:da,randomizeSeed:El,setSpeedOverLifeMode:Il,prepareScaleOverLifeCurve:fo,setScaleOverLifeMode:Rl,onShapeChange:Pl,onSpawnPathChange:du,LINEAR_CURVE:kF,FLAT_CURVE:cm,ALPHA_CURVE:FF,RESOURCE_ALPHA_CURVE:hm,TRAIL_ALPHA_CURVE:um,TRAIL_SHAPE_CURVE:dm}}const pS=Symbol("particle-panel");function BO(){const s=OO();return By(pS,s),s}function br(){const s=No(pS);if(!s)throw new Error("Particle panel sections require a ParticlePanel parent");return s}const LO={class:"group config-management"},DO={class:"caret"},NO={class:"group-body config-management-body"},UO={class:"config-toolbar"},$O=["disabled"],XO={value:""},VO=["value"],YO=Jt({__name:"ProjectConfigSection",setup(s){const{configFileInput:e,selectedPreset:t,presetOptions:i,presetLoading:n,configMessage:r,configError:o,saveConfig:a,onConfigFileChange:c,refreshPresets:l,loadSelectedPreset:h,collapsed:u,toggle:d,select:f}=br();return(p,m)=>(K(),Q("div",LO,[T("div",{class:"group-head",onClick:m[0]||(m[0]=g=>R(d)("config"))},[T("span",DO,_e(R(u).config?"▸":"▾"),1),m[8]||(m[8]=T("span",null,"配置管理",-1))]),de(T("div",NO,[T("div",UO,[T("button",{title:"保存全部编辑器配置 (Ctrl+S)",onClick:m[1]||(m[1]=(...g)=>R(a)&&R(a)(...g))},"保存配置"),T("button",{title:"加载本地编辑器配置",onClick:m[2]||(m[2]=g=>{var v;return(v=R(e))==null?void 0:v.click()})},"加载配置"),de(T("select",{"onUpdate:modelValue":m[3]||(m[3]=g=>jt(t)?t.value=g:null),"aria-label":"预设列表",disabled:!R(i).length||R(n),onPointerdown:m[4]||(m[4]=(...g)=>R(l)&&R(l)(...g)),onFocus:m[5]||(m[5]=(...g)=>R(l)&&R(l)(...g)),onChange:m[6]||(m[6]=(...g)=>R(h)&&R(h)(...g))},[T("option",XO,_e(R(i).length?"选择预设":"无预设文件"),1),(K(!0),Q(Fe,null,Dt(R(i),g=>(K(),Q("option",{key:g.file,value:g.file},_e(g.name),9,VO))),128))],40,$O),[[wt,R(t)]]),T("input",{ref_key:"configFileInput",ref:e,hidden:"",type:"file",accept:".json,application/json",onChange:m[7]||(m[7]=(...g)=>R(c)&&R(c)(...g))},null,544)]),R(r)?(K(),Q("div",{key:0,class:Le(["config-message",{error:R(o)}])},_e(R(r)),3)):Te("",!0)],512),[[vi,!R(u).config]])]))}}),GO=Qt(YO,[["__scopeId","data-v-7ab00fa9"]]),HO={class:"ns-label"},jO=["min","max","step","value","disabled"],WO=["min","max","step","value","disabled"],zO=Jt({__name:"NumSlider",props:{label:{},modelValue:{},min:{},max:{},step:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=Ge(String(t.modelValue));Xi(()=>t.modelValue,c=>{n.value=String(c)});function r(c){const l=parseFloat(c.target.value);Number.isNaN(l)||i("update:modelValue",l)}function o(c){n.value=c.target.value;const l=parseFloat(n.value);Number.isNaN(l)||i("update:modelValue",l)}function a(){const c=parseFloat(n.value);Number.isNaN(c)&&(n.value=String(t.modelValue))}return(c,l)=>(K(),Q("div",{class:Le(["ns",{disabled:s.disabled}])},[T("span",HO,_e(s.label),1),T("input",{type:"range",class:"ns-range",min:s.min,max:s.max,step:s.step,value:s.modelValue,disabled:s.disabled,onInput:r},null,40,jO),T("input",{type:"number",class:"ns-num",min:s.min,max:s.max,step:s.step,value:n.value,disabled:s.disabled,onInput:o,onBlur:a},null,40,WO)],2))}}),Be=Qt(zO,[["__scopeId","data-v-45669c72"]]),qO={class:"ce"},KO={class:"ce-editor"},ZO={class:"ce-grid"},JO=["x1","x2","y2"],QO=["y1","x2","y2"],eB=["x","y","width","height"],tB=["d"],iB={key:0,class:"ce-handles"},sB=["x1","y1","x2","y2"],nB=["cx","cy","onPointerdown"],rB=["x1","y1","x2","y2"],oB=["cx","cy","onPointerdown"],aB=["cx","cy"],lB=["cx","cy","onPointerdown","onDblclick"],cB={class:"ce-nav"},hB={class:"ce-tip"},Hn=8,uB=Jt({__name:"CurveEditor",props:{modelValue:{},defaultValue:{default:()=>[{x:0,y:0},{x:1,y:1}]},mode:{default:"linear"}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=Ge(null),r=Ge(300),o=Ge(110);let a=null;function c(){if(!n.value)return;const E=n.value.getBoundingClientRect();r.value=E.width,o.value=E.height}function l(E){return Hn+E*(r.value-Hn*2)}function h(E){return Hn+(1-E)*(o.value-Hn*2)}function u(){return[...t.modelValue].sort((E,k)=>E.x-k.x)}function d(E){i("update:modelValue",[...E].sort((k,O)=>k.x-O.x))}function f(){d(t.defaultValue.map(E=>({...E})))}const p=qe(()=>u());function m(E){const k=p.value[E],O=p.value[Math.max(0,E-1)];return{x:k.x-(k.x-O.x)/3,y:k.y-(k.y-O.y)/3}}function g(E){const k=p.value[E],O=p.value[Math.min(p.value.length-1,E+1)];return{x:k.x+(O.x-k.x)/3,y:k.y+(O.y-k.y)/3}}function v(E){const k=p.value[E],O=m(E);return{x:k.x+(k.inX??O.x-k.x),y:k.y+(k.inY??O.y-k.y)}}function x(E){const k=p.value[E],O=g(E);return{x:k.x+(k.outX??O.x-k.x),y:k.y+(k.outY??O.y-k.y)}}const y=qe(()=>{if(!p.value.length)return"";let E=`M ${l(p.value[0].x)} ${h(p.value[0].y)}`;for(let k=1;kMath.abs($.x-k)>.02);D.push({x:k,y:O}),d(D)}let b={t:0,i:-1,x:0,y:0};function M(E,k){E.stopPropagation();const O=u().findIndex(U=>Math.abs(U.x-p.value[k].x)<1e-6&&Math.abs(U.y-p.value[k].y)<1e-6);if(O<0)return;const D=Date.now();if(D-b.t<300&&b.i===k&&Math.abs(E.clientX-b.x)<8&&Math.abs(E.clientY-b.y)<8){b={t:0,i:-1,x:0,y:0},F(k);return}b={t:D,i:k,x:E.clientX,y:E.clientY};const $=U=>{(Math.abs(U.clientX-E.clientX)>8||Math.abs(U.clientY-E.clientY)>8)&&(b={t:0,i:-1,x:0,y:0});const{x:A,y:P}=_(U.clientX,U.clientY),L=u();L[O]={x:A,y:P},d(L)},N=()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",N)};window.addEventListener("pointermove",$),window.addEventListener("pointerup",N)}function I(E,k,O){E.stopPropagation();const D=N=>{const U=_(N.clientX,N.clientY),A=u(),P=A[k],L=O==="in"?A[Math.max(0,k-1)].x:P.x,B=O==="in"?P.x:A[Math.min(A.length-1,k+1)].x,X=Math.min(B,Math.max(L,U.x)),V=Math.round((X-P.x)*100)/100,q=Math.round((U.y-P.y)*100)/100;A[k]=O==="in"?{...P,inX:V,inY:q}:{...P,outX:V,outY:q},d(A)},$=()=>{window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",$)};window.addEventListener("pointermove",D),window.addEventListener("pointerup",$)}function F(E,k){k==null||k.stopPropagation();const O=u();O.length<=2||(C=Date.now(),d(O.filter((D,$)=>$!==E)))}return Vn(()=>{c(),a=new ResizeObserver(c),n.value&&a.observe(n.value)}),gl(()=>{a==null||a.disconnect()}),(E,k)=>(K(),Q("div",qO,[T("div",KO,[(K(),Q("svg",{ref_key:"svg",ref:n,class:"ce-svg",onDblclick:S},[T("g",ZO,[(K(),Q(Fe,null,Dt([.25,.5,.75],O=>T("line",{key:"v"+O,x1:l(O),y1:"0",x2:l(O),y2:h(0)},null,8,JO)),64)),(K(),Q(Fe,null,Dt([.25,.5,.75],O=>T("line",{key:"h"+O,x1:"0",y1:h(O),x2:l(1),y2:h(O)},null,8,QO)),64))]),T("rect",{x:l(0),y:h(1),width:l(1)-l(0),height:h(0)-h(1),class:"ce-frame",fill:"none"},null,8,eB),T("path",{d:y.value,class:"ce-line",fill:"none"},null,8,tB),s.mode==="bezier"?(K(),Q("g",iB,[(K(!0),Q(Fe,null,Dt(p.value,(O,D)=>(K(),Q(Fe,{key:"handles-"+D},[D>0?(K(),Q("line",{key:0,x1:l(O.x),y1:h(O.y),x2:l(v(D).x),y2:h(v(D).y)},null,8,sB)):Te("",!0),D>0?(K(),Q("circle",{key:1,cx:l(v(D).x),cy:h(v(D).y),r:"4",onPointerdown:$=>I($,D,"in")},null,40,nB)):Te("",!0),DI($,D,"out")},null,40,oB)):Te("",!0)],64))),128))])):Te("",!0),(K(!0),Q(Fe,null,Dt(p.value,(O,D)=>(K(),Q("g",{key:D},[T("circle",{cx:l(O.x),cy:h(O.y),r:"5",class:"ce-node"},null,8,aB),T("circle",{cx:l(O.x),cy:h(O.y),r:"9",class:"ce-hit",onPointerdown:$=>M($,D),onDblclick:$=>F(D,$)},null,40,lB)]))),128))],544)),T("div",cB,[T("span",hB,_e(s.mode==="bezier"?"拖动方形手柄调整弧度·双击空白新建·双击节点删除":"双击空白新建·双击节点删除·拖动节点调整"),1)])]),T("button",{class:"ce-reset",type:"button",title:"恢复默认曲线",onClick:f},"重置")]))}}),qs=Qt(uB,[["__scopeId","data-v-3c8d1b94"]]),dB={class:"spine-editor"},fB={class:"field wide"},mB={class:"grid three"},pB={class:"field"},gB={class:"field"},vB={class:"field"},yB={class:"grid three"},xB={class:"field"},bB={class:"field"},wB={class:"field"},SB=["disabled"],_B={class:"asset-row"},TB=["title"],MB={class:"asset-row"},CB=["title"],AB={class:"asset-row"},EB=["title"],IB={class:"asset-actions"},RB=["disabled"],PB={class:"runtime-note"},kB={key:0},FB={key:0,class:"error"},OB={class:"section-box"},BB={key:0,class:"empty"},LB={key:1,class:"field wide"},DB=["value"],NB={class:"section-box"},UB={class:"tree-title-row"},$B=["disabled","title"],XB={key:0,class:"empty"},VB={key:1,class:"bone-search"},YB={key:2,class:"empty"},GB={key:3,class:"bone-tree"},HB=["onClick","onKeydown"],jB=["title","onClick"],WB={key:1,class:"bone-leaf"},zB={class:"bone-name"},qB=Jt({__name:"SpineObjectPanel",props:{spineObject:{}},setup(s){const e=s,t=ao(),i=Ge(null),n=Ge(null),r=Ge(null),o=Ge(null),a=Ge(new Set),c=Ge(""),l=Ge(null),h=Ge(null),u=Ge([]);e.spineObject.selectedBone==null&&(e.spineObject.selectedBone=""),e.spineObject.sourceBundle==null&&(e.spineObject.sourceBundle=null),e.spineObject.dataVersion==null&&(e.spineObject.dataVersion="");const d=qe(()=>{var U;return((U=l.value)==null?void 0:U.name)||e.spineObject.skeletonFileName}),f=qe(()=>{var U;return((U=h.value)==null?void 0:U.name)||e.spineObject.atlasFileName}),p=qe(()=>u.value.length?u.value.map(U=>U.name):e.spineObject.textureFileNames),m=qe(()=>p.value.length?`${p.value.length} 张:${p.value.join(", ")}`:"PNG / JPEG / WebP..."),g=qe(()=>new Set(e.spineObject.bones.map(U=>U.parent).filter(U=>!!U))),v=qe(()=>new Map(e.spineObject.bones.map(U=>[U.name,U]))),x=qe(()=>e.spineObject.bones.filter(U=>{var L;const A=c.value.trim().toLocaleLowerCase();if(A)return U.name.toLocaleLowerCase().includes(A);let P=U.parent;for(;P;){if(a.value.has(P))return!1;P=((L=v.value.get(P))==null?void 0:L.parent)||null}return!0})),y=qe(()=>g.value.size>0&&[...g.value].every(U=>a.value.has(U)));function _(U){const A=e.spineObject.selectedBone===U;for(const P of t.spines)P.selectedBone="";A||(e.spineObject.selectedBone=U)}function C(U){a.value.has(U)?a.value.delete(U):a.value.add(U)}function S(){a.value=y.value?new Set:new Set(g.value)}function b(U){var A;return((A=U.target.files)==null?void 0:A[0])||null}function M(U){l.value=b(U)}function I(U){h.value=b(U)}function F(U){u.value=Array.from(U.target.files||[])}function E(U){return U.name.replace(/\.[^.]+$/,"").toLocaleLowerCase()}async function k(U){const A=Array.from(U.target.files||[]);if(!A.length)return;const P=A.filter(W=>/\.(json|skel)$/i.test(W.name)),L=A.filter(W=>/\.atlas$/i.test(W.name)),B=A.filter(W=>/\.(png|jpe?g|webp|wepb)$/i.test(W.name)),X=L.map(W=>({atlas:W,skeleton:P.find(ne=>E(ne)===E(W))})).find(W=>W.skeleton),V=(X==null?void 0:X.skeleton)||P[0]||null,q=(X==null?void 0:X.atlas)||L[0]||null;if(l.value=V,h.value=q,u.value=B,!V||!q||!B.length){const W=[!V&&"JSON / SKEL",!q&&"Atlas",!B.length&&"纹理图片"].filter(Boolean).join("、");e.spineObject.status="error",e.spineObject.error=`所选文件夹缺少:${W}`;return}await $()}function O(){t.recalcTotalFrames()}function D(){O(),t.timeline.frame=0}async function $(){var P;const U=l.value,A=h.value;if(!U||!A||!u.value.length){e.spineObject.status="error",e.spineObject.error="请依次选择 Spine 数据、Atlas 和全部纹理图片";return}e.spineObject.status="loading",e.spineObject.error="";try{const L=await rw(U,A,u.value);nu(e.spineObject.id,L),e.spineObject.skeletonFileName=U.name,e.spineObject.atlasFileName=A.name,e.spineObject.textureFileNames=u.value.map(B=>B.name),e.spineObject.dataVersion=L.dataVersion,e.spineObject.animations=L.animations,e.spineObject.bones=L.bones,e.spineObject.selectedBone="",c.value="",a.value=new Set,e.spineObject.selectedAnimation=((P=L.animations[0])==null?void 0:P.name)||"",e.spineObject.assetVersion++,e.spineObject.status="ready",O(),t.timeline.frame=0;try{e.spineObject.sourceBundle=await XP(U,A,u.value)}catch(B){e.spineObject.sourceBundle=null,console.warn("Spine 配置资源嵌入失败",B)}}catch(L){e.spineObject.status="error",e.spineObject.error=L instanceof Error?L.message:String(L)}}function N(){wl(e.spineObject.id),l.value=null,h.value=null,u.value=[],i.value&&(i.value.value=""),n.value&&(n.value.value=""),r.value&&(r.value.value=""),o.value&&(o.value.value=""),e.spineObject.skeletonFileName="",e.spineObject.atlasFileName="",e.spineObject.textureFileNames=[],e.spineObject.dataVersion="",e.spineObject.sourceBundle=null,e.spineObject.animations=[],e.spineObject.bones=[],e.spineObject.selectedBone="",c.value="",a.value=new Set,e.spineObject.selectedAnimation="",e.spineObject.assetVersion++,e.spineObject.status="empty",e.spineObject.error="",O()}return(U,A)=>(K(),Q("div",dB,[A[30]||(A[30]=T("div",{class:"editor-title"},"Spine 属性",-1)),T("label",fB,[A[15]||(A[15]=T("span",null,"Spine 名称",-1)),de(T("input",{"onUpdate:modelValue":A[0]||(A[0]=P=>s.spineObject.name=P)},null,512),[[He,s.spineObject.name]])]),T("div",mB,[T("label",pB,[A[16]||(A[16]=T("span",null,"X 位置",-1)),de(T("input",{"onUpdate:modelValue":A[1]||(A[1]=P=>s.spineObject.x=P),type:"number"},null,512),[[He,s.spineObject.x,void 0,{number:!0}]])]),T("label",gB,[A[17]||(A[17]=T("span",null,"Y 位置",-1)),de(T("input",{"onUpdate:modelValue":A[2]||(A[2]=P=>s.spineObject.y=P),type:"number"},null,512),[[He,s.spineObject.y,void 0,{number:!0}]])]),T("label",vB,[A[18]||(A[18]=T("span",null,"旋转",-1)),de(T("input",{"onUpdate:modelValue":A[3]||(A[3]=P=>s.spineObject.rotation=P),type:"number"},null,512),[[He,s.spineObject.rotation,void 0,{number:!0}]])])]),T("div",yB,[T("label",xB,[A[19]||(A[19]=T("span",null,"Scale X",-1)),de(T("input",{"onUpdate:modelValue":A[4]||(A[4]=P=>s.spineObject.scaleX=P),type:"number",step:"0.05"},null,512),[[He,s.spineObject.scaleX,void 0,{number:!0}]])]),T("label",bB,[A[20]||(A[20]=T("span",null,"Scale Y",-1)),de(T("input",{"onUpdate:modelValue":A[5]||(A[5]=P=>s.spineObject.scaleY=P),type:"number",step:"0.05"},null,512),[[He,s.spineObject.scaleY,void 0,{number:!0}]])]),T("label",wB,[A[21]||(A[21]=T("span",null,"开始时间",-1)),de(T("input",{"onUpdate:modelValue":A[6]||(A[6]=P=>s.spineObject.timeOffset=P),type:"number",min:"0",step:"0.033333",onChange:O},null,544),[[He,s.spineObject.timeOffset,void 0,{number:!0}]])])]),A[31]||(A[31]=T("div",{class:"divider"},null,-1)),A[32]||(A[32]=T("div",{class:"section-title"},"Spine 资源",-1)),T("input",{ref_key:"skeletonInput",ref:i,hidden:"",type:"file",accept:".json,.skel,application/json,application/octet-stream",onChange:M},null,544),T("input",{ref_key:"atlasInput",ref:n,hidden:"",type:"file",accept:".atlas,text/plain",onChange:I},null,544),T("input",{ref_key:"textureInput",ref:r,hidden:"",type:"file",multiple:"",accept:".png,.jpg,.jpeg,.webp,.wepb,image/png,image/jpeg,image/webp",onChange:F},null,544),T("input",{ref_key:"folderInput",ref:o,hidden:"",type:"file",multiple:"",webkitdirectory:"",directory:"",onChange:k},null,544),T("button",{class:"folder-select",disabled:s.spineObject.status==="loading",onClick:A[7]||(A[7]=P=>{var L;return(L=o.value)==null?void 0:L.click()})},"选择文件夹并加载",8,SB),A[33]||(A[33]=T("div",{class:"folder-hint"},"一次读取文件夹中的 JSON / SKEL、Atlas 和全部纹理;仍可在下方单独替换资源。",-1)),T("div",_B,[T("div",{class:"asset-name",title:d.value},_e(d.value||"JSON / SKEL..."),9,TB),T("button",{onClick:A[8]||(A[8]=P=>{var L;return(L=i.value)==null?void 0:L.click()})},"选择")]),T("div",MB,[T("div",{class:"asset-name",title:f.value},_e(f.value||"Atlas..."),9,CB),T("button",{onClick:A[9]||(A[9]=P=>{var L;return(L=n.value)==null?void 0:L.click()})},"选择")]),T("div",AB,[T("div",{class:"asset-name",title:p.value.join(", ")},_e(m.value),9,EB),T("button",{onClick:A[10]||(A[10]=P=>{var L;return(L=r.value)==null?void 0:L.click()})},"选择(多选)")]),T("div",IB,[T("button",{class:"load",disabled:s.spineObject.status==="loading",onClick:$},_e(s.spineObject.status==="loading"?"加载中…":"↧ 加载"),9,RB),T("button",{class:"clear",onClick:N},"清除")]),T("div",PB,[A[22]||(A[22]=At(" 支持 Spine 3.8 / 4.0 / 4.1 / 4.2 / 4.3 JSON · 对应版本运行时按需加载 · 本地离线 ",-1)),s.spineObject.dataVersion?(K(),Q("span",kB," · 当前资源 "+_e(s.spineObject.dataVersion),1)):Te("",!0)]),s.spineObject.error?(K(),Q("div",FB,_e(s.spineObject.error),1)):Te("",!0),T("div",OB,[A[25]||(A[25]=T("div",{class:"section-title"},"Spine 动画",-1)),s.spineObject.animations.length?(K(),Q("label",LB,[A[24]||(A[24]=T("span",null,"时间轴播放动画",-1)),de(T("select",{"onUpdate:modelValue":A[11]||(A[11]=P=>s.spineObject.selectedAnimation=P),onChange:D},[A[23]||(A[23]=T("option",{value:""},"无",-1)),(K(!0),Q(Fe,null,Dt(s.spineObject.animations,P=>(K(),Q("option",{key:P.name,value:P.name},_e(P.name)+"("+_e(P.duration.toFixed(2))+"s) ",9,DB))),128))],544),[[wt,s.spineObject.selectedAnimation]])])):(K(),Q("div",BB,"无可用动画"))]),T("div",NB,[T("div",UB,[A[29]||(A[29]=T("div",{class:"section-title"},"层级树",-1)),T("button",{class:Le(["selected-bone",{active:s.spineObject.selectedBone}]),disabled:!s.spineObject.selectedBone,title:s.spineObject.selectedBone?"点击清除骨骼选择":"当前未选择骨骼",onClick:A[12]||(A[12]=P=>s.spineObject.selectedBone="")},[s.spineObject.selectedBone?(K(),Q(Fe,{key:0},[A[26]||(A[26]=At("清除选中骨骼:",-1)),T("strong",null,_e(s.spineObject.selectedBone),1)],64)):(K(),Q(Fe,{key:1},[A[27]||(A[27]=At("当前骨骼:",-1)),A[28]||(A[28]=T("strong",null,"未选择",-1))],64))],10,$B),s.spineObject.bones.length?(K(),Q("button",{key:0,class:"tree-action",onClick:S},_e(y.value?"全部展开":"全部折叠"),1)):Te("",!0)]),s.spineObject.bones.length?(K(),Q("div",VB,[de(T("input",{"onUpdate:modelValue":A[13]||(A[13]=P=>c.value=P),type:"search","aria-label":"搜索骨骼",placeholder:"搜索骨骼名称…"},null,512),[[He,c.value,void 0,{trim:!0}]]),c.value?(K(),Q("button",{key:0,title:"清空搜索","aria-label":"清空骨骼搜索",onClick:A[14]||(A[14]=P=>c.value="")},"✕")):Te("",!0)])):(K(),Q("div",XB,"未加载 Spine")),s.spineObject.bones.length&&!x.value.length?(K(),Q("div",YB,"未找到匹配的骨骼")):s.spineObject.bones.length?(K(),Q("div",GB,[(K(!0),Q(Fe,null,Dt(x.value,P=>(K(),Q("div",{key:P.name,class:Le(["bone",{selected:s.spineObject.selectedBone===P.name}]),style:di({paddingLeft:`${6+P.depth*16}px`}),role:"button",tabindex:"0",onClick:L=>_(P.name),onKeydown:zr(et(L=>_(P.name),["prevent"]),["enter"])},[g.value.has(P.name)?(K(),Q("button",{key:0,class:"bone-toggle",title:a.value.has(P.name)?"展开子骨骼":"折叠子骨骼",onClick:et(L=>C(P.name),["stop"])},_e(a.value.has(P.name)?"▸":"▾"),9,jB)):(K(),Q("span",WB,"•")),T("span",zB,_e(P.name),1)],46,HB))),128))])):Te("",!0)])]))}}),KB=Qt(qB,[["__scopeId","data-v-3af7b738"]]),ZB={class:"group"},JB={class:"caret"},QB={class:"scene-actions"},eL=["disabled"],tL={class:"group-body"},iL={class:"tree scene-tree"},sL=["onClick"],nL={class:"tlabel"},rL=["title","aria-label","onClick"],oL={viewBox:"0 0 24 24","aria-hidden":"true"},aL={key:0,class:"eye-slash",d:"M4 4l16 16"},lL=["onClick"],cL=["onClick"],hL={class:"tlabel"},uL=["title","aria-label","onClick"],dL={viewBox:"0 0 24 24","aria-hidden":"true"},fL={key:0,class:"eye-slash",d:"M4 4l16 16"},mL=["onClick"],pL=["onClick"],gL={class:"tlabel"},vL=["title","aria-label","onClick"],yL={viewBox:"0 0 24 24","aria-hidden":"true"},xL={key:0,class:"eye-slash",d:"M4 4l16 16"},bL=["onClick"],wL=["onClick"],SL={class:"tlabel"},_L=["title","aria-label","onClick"],TL={viewBox:"0 0 24 24","aria-hidden":"true"},ML={key:0,class:"eye-slash",d:"M4 4l16 16"},CL=["onClick"],AL={key:0,class:"empty"},EL={class:"row"},IL={class:"seed-row scene-seed"},RL={class:"field-block"},PL={class:"field-grid"},kL={class:"field-block"},FL={class:"field-block check-field"},OL={class:"field-grid"},BL={class:"compact-field"},LL={class:"compact-field"},DL={class:"field-grid"},NL={class:"compact-field"},UL={class:"compact-field"},$L={key:1,class:"field-grid"},XL={class:"compact-field"},VL={class:"compact-field"},YL={key:2,class:"field-grid"},GL={class:"compact-field"},HL={class:"compact-field"},jL={class:"field-block"},WL={key:4,class:"field-grid"},zL={class:"compact-field"},qL={class:"compact-field"},KL={class:"collider-follow-section"},ZL={class:"follow-path"},JL={class:"field-block"},QL=["value"],eD={class:"field-grid"},tD={class:"compact-field"},iD={class:"compact-field"},sD={class:"follow-path"},nD={class:"field-block"},rD={class:"field-grid"},oD={class:"compact-field"},aD={class:"compact-field"},lD={class:"field-grid"},cD={class:"compact-field"},hD={class:"compact-field"},uD={class:"setting-line"},dD={class:"setting-line"},fD={class:"field-block"},mD={key:4,class:"panel-hint"},pD=Jt({__name:"SceneObjectsSection",setup(s){const{store:e,resolvedCurveEditorMode:t,sys:i,activeObjectType:n,activeCollider:r,activePath:o,activeSpine:a,canCopyObject:c,collapsed:l,toggle:h,select:u,addSys:d,addCollider:f,addPath:p,addSpine:m,copySelectedObject:g,applyPathPreset:v,clearPathAnchors:x,randomizeSeed:y,LINEAR_CURVE:_}=br();return(C,S)=>(K(),Q("div",ZB,[T("div",{class:"group-head scene-head",onClick:S[5]||(S[5]=b=>R(h)("scene"))},[T("span",JB,_e(R(l).scene?"▸":"▾"),1),S[50]||(S[50]=T("span",null,"场景对象",-1)),T("div",QB,[T("button",{class:"scene-add",title:"添加粒子系统",onClick:S[0]||(S[0]=et((...b)=>R(d)&&R(d)(...b),["stop"]))},"+粒子"),T("button",{class:"scene-add",title:"添加碰撞体",onClick:S[1]||(S[1]=et((...b)=>R(f)&&R(f)(...b),["stop"]))},"+碰撞"),T("button",{class:"scene-add",title:"添加路径",onClick:S[2]||(S[2]=et((...b)=>R(p)&&R(p)(...b),["stop"]))},"+路径"),T("button",{class:"scene-add",title:"添加 Spine",onClick:S[3]||(S[3]=et((...b)=>R(m)&&R(m)(...b),["stop"]))},"+Spine"),T("button",{class:"scene-add",disabled:!R(c),title:"复制当前选中的场景对象",onClick:S[4]||(S[4]=et((...b)=>R(g)&&R(g)(...b),["stop"]))},"+Copy",8,eL)])]),de(T("div",tL,[T("div",iL,[(K(!0),Q(Fe,null,Dt(R(e).systems,(b,M)=>(K(),Q("div",{key:`particle-${b.id}`,class:Le(["tree-item scene-object-item",{on:R(n)==="particle"&&b.id===R(e).activeObjectId}]),onClick:I=>R(u)(M)},[S[53]||(S[53]=T("span",{class:"tdot"},"●",-1)),T("span",nL,_e(b.config.name||"ParticleSystem"+(M+1)),1),T("button",{class:Le(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示粒子系统":"隐藏粒子系统","aria-label":b.visible===!1?"显示粒子系统":"隐藏粒子系统",onClick:et(I=>b.visible=b.visible===!1,["stop"])},[(K(),Q("svg",oL,[S[51]||(S[51]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[52]||(S[52]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),Q("path",aL)):Te("",!0)]))],10,rL),S[54]||(S[54]=T("span",{class:"scene-object-kind"},"粒子",-1)),T("button",{class:"scene-object-delete",title:"删除粒子系统",onClick:et(I=>R(e).removeSystem(b.id),["stop"])},"✕",8,lL)],10,sL))),128)),(K(!0),Q(Fe,null,Dt(R(e).colliders,b=>(K(),Q("div",{key:`collision-${b.id}`,class:Le(["tree-item scene-object-item",{on:R(n)==="collision"&&b.id===R(e).activeObjectId}]),onClick:M=>R(e).selectSceneObject("collision",b.id)},[S[57]||(S[57]=T("span",{class:"tdot collision-dot"},"■",-1)),T("span",hL,_e(b.name),1),T("button",{class:Le(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示碰撞体":"隐藏碰撞体","aria-label":b.visible===!1?"显示碰撞体":"隐藏碰撞体",onClick:et(M=>b.visible=b.visible===!1,["stop"])},[(K(),Q("svg",dL,[S[55]||(S[55]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[56]||(S[56]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),Q("path",fL)):Te("",!0)]))],10,uL),S[58]||(S[58]=T("span",{class:"scene-object-kind"},"碰撞",-1)),T("button",{class:"scene-object-delete",title:"删除碰撞体",onClick:et(M=>R(e).removeCollider(b.id),["stop"])},"✕",8,mL)],10,cL))),128)),(K(!0),Q(Fe,null,Dt(R(e).paths,b=>(K(),Q("div",{key:`path-${b.id}`,class:Le(["tree-item scene-object-item",{on:R(n)==="path"&&b.id===R(e).activeObjectId}]),onClick:M=>R(e).selectSceneObject("path",b.id)},[S[61]||(S[61]=T("span",{class:"tdot path-dot"},"◇",-1)),T("span",gL,_e(b.name),1),T("button",{class:Le(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示路径":"隐藏路径","aria-label":b.visible===!1?"显示路径":"隐藏路径",onClick:et(M=>b.visible=b.visible===!1,["stop"])},[(K(),Q("svg",yL,[S[59]||(S[59]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[60]||(S[60]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),Q("path",xL)):Te("",!0)]))],10,vL),S[62]||(S[62]=T("span",{class:"scene-object-kind"},"路径",-1)),T("button",{class:"scene-object-delete",title:"删除路径",onClick:et(M=>R(e).removePath(b.id),["stop"])},"✕",8,bL)],10,pL))),128)),(K(!0),Q(Fe,null,Dt(R(e).spines,b=>(K(),Q("div",{key:`spine-${b.id}`,class:Le(["tree-item scene-object-item",{on:R(n)==="spine"&&b.id===R(e).activeObjectId}]),onClick:M=>R(e).selectSceneObject("spine",b.id)},[S[65]||(S[65]=T("span",{class:"tdot spine-dot"},"◆",-1)),T("span",SL,_e(b.name),1),T("button",{class:Le(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示 Spine":"隐藏 Spine","aria-label":b.visible===!1?"显示 Spine":"隐藏 Spine",onClick:et(M=>b.visible=b.visible===!1,["stop"])},[(K(),Q("svg",TL,[S[63]||(S[63]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[64]||(S[64]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),Q("path",ML)):Te("",!0)]))],10,_L),S[66]||(S[66]=T("span",{class:"scene-object-kind"},"Spine",-1)),T("button",{class:"scene-object-delete",title:"删除 Spine",onClick:et(M=>R(e).removeSpine(b.id),["stop"])},"✕",8,CL)],10,wL))),128)),!R(e).systems.length&&!R(e).colliders.length&&!R(e).paths.length&&!R(e).spines.length?(K(),Q("div",AL,"场景中暂无对象")):Te("",!0)]),R(n)==="particle"&&R(i)?(K(),Q(Fe,{key:0},[T("label",EL,[S[67]||(S[67]=T("span",null,"名称",-1)),de(T("input",{"onUpdate:modelValue":S[6]||(S[6]=b=>R(i).config.name=b),class:"inp"},null,512),[[He,R(i).config.name]])]),be(Be,{label:"位置X",min:-2e3,max:2e3,step:1,modelValue:R(i).config.centerX,"onUpdate:modelValue":S[7]||(S[7]=b=>R(i).config.centerX=b)},null,8,["modelValue"]),be(Be,{label:"位置Y",min:-2e3,max:2e3,step:1,modelValue:R(i).config.centerY,"onUpdate:modelValue":S[8]||(S[8]=b=>R(i).config.centerY=b)},null,8,["modelValue"]),be(Be,{label:"偏移X",min:-2e3,max:2e3,step:1,modelValue:R(i).config.offsetX,"onUpdate:modelValue":S[9]||(S[9]=b=>R(i).config.offsetX=b)},null,8,["modelValue"]),be(Be,{label:"偏移Y",min:-2e3,max:2e3,step:1,modelValue:R(i).config.offsetY,"onUpdate:modelValue":S[10]||(S[10]=b=>R(i).config.offsetY=b)},null,8,["modelValue"]),be(Be,{label:"旋转",min:-360,max:360,step:1,modelValue:R(i).config.rootRotation,"onUpdate:modelValue":S[11]||(S[11]=b=>R(i).config.rootRotation=b)},null,8,["modelValue"]),be(Be,{label:"缩放X",min:.05,max:10,step:.05,modelValue:R(i).config.rootScaleX,"onUpdate:modelValue":S[12]||(S[12]=b=>R(i).config.rootScaleX=b)},null,8,["modelValue"]),be(Be,{label:"缩放Y",min:.05,max:10,step:.05,modelValue:R(i).config.rootScaleY,"onUpdate:modelValue":S[13]||(S[13]=b=>R(i).config.rootScaleY=b)},null,8,["modelValue"]),T("div",IL,[S[68]||(S[68]=T("label",{for:"system-seed"},"随机种子",-1)),de(T("input",{id:"system-seed",class:"seed-input",type:"number",min:"0",step:"1","onUpdate:modelValue":S[14]||(S[14]=b=>R(i).config.seed=b),title:"控制粒子系统内全部随机属性、资源选择与修改器随机采样"},null,512),[[He,R(i).config.seed,void 0,{number:!0}]]),T("button",{class:"seed-random",title:"生成新的全局随机种子",onClick:S[15]||(S[15]=(...b)=>R(y)&&R(y)(...b))},"⚄")]),S[69]||(S[69]=T("div",{class:"seed-hint"},"控制初始随机参数、资源选择和修改器随机采样;相同种子可复现相同效果",-1))],64)):R(r)?(K(),Q(Fe,{key:1},[S[94]||(S[94]=T("div",{class:"object-editor-title"},"碰撞体属性",-1)),T("label",RL,[S[70]||(S[70]=T("span",null,"碰撞体名称",-1)),de(T("input",{"onUpdate:modelValue":S[16]||(S[16]=b=>R(r).name=b),class:"inp"},null,512),[[He,R(r).name]])]),T("div",PL,[T("label",kL,[S[72]||(S[72]=T("span",null,"类型",-1)),de(T("select",{"onUpdate:modelValue":S[17]||(S[17]=b=>R(r).shape=b),class:"inp"},[...S[71]||(S[71]=[es('',5)])],512),[[wt,R(r).shape]])]),T("label",FL,[S[73]||(S[73]=T("span",null,"启用",-1)),de(T("input",{"onUpdate:modelValue":S[18]||(S[18]=b=>R(r).enabled=b),type:"checkbox"},null,512),[[Et,R(r).enabled]])])]),T("div",OL,[T("label",BL,[S[74]||(S[74]=T("span",null,"X 位置",-1)),de(T("input",{"onUpdate:modelValue":S[19]||(S[19]=b=>R(r).x=b),type:"number",class:"inp"},null,512),[[He,R(r).x,void 0,{number:!0}]])]),T("label",LL,[S[75]||(S[75]=T("span",null,"Y 位置",-1)),de(T("input",{"onUpdate:modelValue":S[20]||(S[20]=b=>R(r).y=b),type:"number",class:"inp"},null,512),[[He,R(r).y,void 0,{number:!0}]])])]),be(Be,{label:"旋转",min:-360,max:360,step:1,modelValue:R(r).rotation,"onUpdate:modelValue":S[21]||(S[21]=b=>R(r).rotation=b)},null,8,["modelValue"]),T("div",DL,[T("label",NL,[S[76]||(S[76]=T("span",null,"缩放 X",-1)),de(T("input",{"onUpdate:modelValue":S[22]||(S[22]=b=>R(r).scaleX=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,R(r).scaleX,void 0,{number:!0}]])]),T("label",UL,[S[77]||(S[77]=T("span",null,"缩放 Y",-1)),de(T("input",{"onUpdate:modelValue":S[23]||(S[23]=b=>R(r).scaleY=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,R(r).scaleY,void 0,{number:!0}]])])]),R(r).shape==="circle"?(K(),Mt(Be,{key:0,label:"半径",min:1,max:1e3,step:1,modelValue:R(r).radius,"onUpdate:modelValue":S[24]||(S[24]=b=>R(r).radius=b)},null,8,["modelValue"])):R(r).shape==="ellipse"?(K(),Q("div",$L,[T("label",XL,[S[78]||(S[78]=T("span",null,"X 半径",-1)),de(T("input",{"onUpdate:modelValue":S[25]||(S[25]=b=>R(r).radiusX=b),type:"number",min:"1",class:"inp"},null,512),[[He,R(r).radiusX,void 0,{number:!0}]])]),T("label",VL,[S[79]||(S[79]=T("span",null,"Y 半径",-1)),de(T("input",{"onUpdate:modelValue":S[26]||(S[26]=b=>R(r).radiusY=b),type:"number",min:"1",class:"inp"},null,512),[[He,R(r).radiusY,void 0,{number:!0}]])])])):(K(),Q("div",YL,[T("label",GL,[S[80]||(S[80]=T("span",null,"宽度",-1)),de(T("input",{"onUpdate:modelValue":S[27]||(S[27]=b=>R(r).width=b),type:"number",min:"1",class:"inp"},null,512),[[He,R(r).width,void 0,{number:!0}]])]),T("label",HL,[S[81]||(S[81]=T("span",null,"高度",-1)),de(T("input",{"onUpdate:modelValue":S[28]||(S[28]=b=>R(r).height=b),type:"number",min:"1",class:"inp"},null,512),[[He,R(r).height,void 0,{number:!0}]])])])),R(r).shape==="polygon"||R(r).shape==="custom"?(K(),Mt(Be,{key:3,label:"边数",min:3,max:16,step:1,modelValue:R(r).sides,"onUpdate:modelValue":S[29]||(S[29]=b=>R(r).sides=b)},null,8,["modelValue"])):Te("",!0),T("label",jL,[S[83]||(S[83]=T("span",null,"碰撞响应",-1)),de(T("select",{"onUpdate:modelValue":S[30]||(S[30]=b=>R(r).response=b),class:"inp"},[...S[82]||(S[82]=[T("option",{value:"physics"},"物理(弹跳/摩擦)",-1),T("option",{value:"pause"},"暂停(停止不动)",-1),T("option",{value:"destroy"},"消失(立即销毁)",-1)])],512),[[wt,R(r).response]])]),R(r).response==="physics"?(K(),Q("div",WL,[T("label",zL,[S[84]||(S[84]=T("span",null,"弹性 (0-1)",-1)),de(T("input",{"onUpdate:modelValue":S[31]||(S[31]=b=>R(r).elasticity=b),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[He,R(r).elasticity,void 0,{number:!0}]])]),T("label",qL,[S[85]||(S[85]=T("span",null,"摩擦 (0-1)",-1)),de(T("input",{"onUpdate:modelValue":S[32]||(S[32]=b=>R(r).friction=b),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[He,R(r).friction,void 0,{number:!0}]])])])):Te("",!0),T("div",KL,[T("label",ZL,[de(T("input",{"onUpdate:modelValue":S[33]||(S[33]=b=>R(r).followPath=b),type:"checkbox"},null,512),[[Et,R(r).followPath]]),S[86]||(S[86]=At("跟随路径移动",-1))]),R(r).followPath?(K(),Q(Fe,{key:0},[T("label",JL,[S[88]||(S[88]=T("span",null,"目标路径",-1)),de(T("select",{"onUpdate:modelValue":S[34]||(S[34]=b=>R(r).followPathId=b),class:"inp"},[S[87]||(S[87]=T("option",{value:0},"(未选择)",-1)),(K(!0),Q(Fe,null,Dt(R(e).paths,b=>(K(),Q("option",{key:b.id,value:b.id},_e(b.name),9,QL))),128))],512),[[wt,R(r).followPathId,void 0,{number:!0}]])]),T("div",eD,[T("label",tD,[S[89]||(S[89]=T("span",null,"移动时长(秒)",-1)),de(T("input",{"onUpdate:modelValue":S[35]||(S[35]=b=>R(r).followDuration=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,R(r).followDuration,void 0,{number:!0}]])]),T("label",iD,[S[91]||(S[91]=T("span",null,"曲线模式",-1)),de(T("select",{"onUpdate:modelValue":S[36]||(S[36]=b=>R(r).followCurveMode=b),class:"inp"},[...S[90]||(S[90]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],512),[[wt,R(r).followCurveMode]])])]),T("label",sD,[de(T("input",{"onUpdate:modelValue":S[37]||(S[37]=b=>R(r).followPathRotation=b),type:"checkbox"},null,512),[[Et,R(r).followPathRotation]]),S[92]||(S[92]=At("方向沿路径",-1))]),S[93]||(S[93]=T("div",{class:"collider-curve-title"},[At("移动进度曲线 "),T("small",null,"横轴:实时/移动时长 纵轴:路径进度(0=起点 → 1=终点)")],-1)),be(qs,{"model-value":R(r).followCurve||R(_),"default-value":R(_),mode:R(t)(R(r).followCurveMode),"onUpdate:modelValue":S[38]||(S[38]=b=>R(r).followCurve=b)},null,8,["model-value","default-value","mode"])],64)):Te("",!0)])],64)):R(o)?(K(),Q(Fe,{key:2},[S[104]||(S[104]=T("div",{class:"object-editor-title"},"路径属性",-1)),T("label",nD,[S[95]||(S[95]=T("span",null,"路径名称",-1)),de(T("input",{"onUpdate:modelValue":S[39]||(S[39]=b=>R(o).name=b),class:"inp"},null,512),[[He,R(o).name]])]),T("div",rD,[T("label",oD,[S[96]||(S[96]=T("span",null,"X 位置",-1)),de(T("input",{"onUpdate:modelValue":S[40]||(S[40]=b=>R(o).x=b),type:"number",class:"inp"},null,512),[[He,R(o).x,void 0,{number:!0}]])]),T("label",aD,[S[97]||(S[97]=T("span",null,"Y 位置",-1)),de(T("input",{"onUpdate:modelValue":S[41]||(S[41]=b=>R(o).y=b),type:"number",class:"inp"},null,512),[[He,R(o).y,void 0,{number:!0}]])])]),be(Be,{label:"旋转",min:-360,max:360,step:1,modelValue:R(o).rotation,"onUpdate:modelValue":S[42]||(S[42]=b=>R(o).rotation=b)},null,8,["modelValue"]),T("div",lD,[T("label",cD,[S[98]||(S[98]=T("span",null,"缩放 X",-1)),de(T("input",{"onUpdate:modelValue":S[43]||(S[43]=b=>R(o).scaleX=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,R(o).scaleX,void 0,{number:!0}]])]),T("label",hD,[S[99]||(S[99]=T("span",null,"缩放 Y",-1)),de(T("input",{"onUpdate:modelValue":S[44]||(S[44]=b=>R(o).scaleY=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,R(o).scaleY,void 0,{number:!0}]])])]),T("label",uD,[S[100]||(S[100]=T("span",null,"闭合路径",-1)),de(T("input",{"onUpdate:modelValue":S[45]||(S[45]=b=>R(o).closed=b),type:"checkbox"},null,512),[[Et,R(o).closed]])]),T("label",dD,[S[101]||(S[101]=T("span",null,"路径颜色",-1)),de(T("input",{"onUpdate:modelValue":S[46]||(S[46]=b=>R(o).color=b),type:"color",class:"path-color"},null,512),[[He,R(o).color]])]),S[105]||(S[105]=es('
操作说明:
  • 双击空白处/曲线:新建锚点
  • 双击锚点:删除节点
  • 双击第二下按住拖动:新建并拉出手柄
  • 拖动锚点移动位置,拖动手柄调整曲线
  • Shift+拖动手柄:两侧完全对称
  • Alt+拖动手柄:独立控制单侧
  • Ctrl+点击/框选:加选节点
  • Alt+点击/框选:减选节点
  • Alt+单击空白处:清除全部选中
  • 选中多个节点后可整体拖动
',1)),T("label",fD,[S[103]||(S[103]=T("span",null,"应用预设形状",-1)),de(T("select",{"onUpdate:modelValue":S[47]||(S[47]=b=>R(o).preset=b),class:"inp"},[...S[102]||(S[102]=[es('',5)])],512),[[wt,R(o).preset]])]),T("button",{class:"path-action primary",onClick:S[48]||(S[48]=(...b)=>R(v)&&R(v)(...b))},"应用预设"),T("button",{class:"path-action",onClick:S[49]||(S[49]=(...b)=>R(x)&&R(x)(...b))},"清空锚点")],64)):R(a)?(K(),Mt(KB,{key:3,"spine-object":R(a)},null,8,["spine-object"])):(K(),Q("div",mD,"使用右上角按钮创建场景对象"))],512),[[vi,!R(l).scene]])]))}}),gD=Qt(pD,[["__scopeId","data-v-f97ddd48"]]),vD={class:"group"},yD={class:"caret"},xD={class:"group-body"},bD={class:"segs"},wD={class:"segs stream-behavior-segs"},SD={key:2,class:"stream-loop-options"},_D={class:"loop-section-row"},TD={class:"switch-row"},MD=["checked"],CD={key:0,class:"loop-duration-control"},AD={class:"switch-row loop-duration-toggle"},ED=["checked"],ID={class:"loop-section-duration"},RD=["value"],PD={key:1},kD={key:2,class:"loop-auto-duration"},FD={class:"loop-section-row"},OD={class:"switch-row"},BD=["checked"],LD={key:0,class:"loop-duration-control"},DD={class:"switch-row loop-duration-toggle"},ND=["checked"],UD={class:"loop-section-duration"},$D=["value"],XD={key:1},VD={key:2,class:"loop-auto-duration"},YD={key:3,class:"modifier-hint stream-loop-hint"},GD={class:"group"},HD={class:"caret"},jD={class:"group-body"},WD={class:"row"},zD={class:"row"},qD=["value","disabled"],KD={key:0,class:"row"},ZD={class:"row"},JD={key:0,value:"radial"},QD={key:1,value:"path-normal"},eN={key:2,value:"path-tangent"},tN=Jt({__name:"EmissionSection",setup(s){const{store:e,sys:t,automaticLoopDuration:i,loopDurationFrames:n,collapsed:r,toggle:o,setEmitMode:a,setLoopDurationFrames:c,setStreamBehavior:l,setLoopSection:h,setLoopSectionDuration:u,setLoopCustomDuration:d,resetModule:f,select:p,onShapeChange:m,onSpawnPathChange:g}=br();return(v,x)=>(K(),Q(Fe,null,[T("div",vD,[T("div",{class:"group-head",onClick:x[1]||(x[1]=y=>R(o)("emitMode"))},[T("span",yD,_e(R(r).emitMode?"▸":"▾"),1),x[35]||(x[35]=T("span",null,"发射模式",-1)),T("button",{class:"group-reset",title:"重置发射模式参数",onClick:x[0]||(x[0]=et(y=>R(f)("emitMode"),["stop"]))},"重置")]),de(T("div",xD,[T("div",bD,[T("button",{class:Le(["seg",{on:R(t).config.mode==="stream"}]),onClick:x[2]||(x[2]=y=>R(a)("stream"))},"持续",2),T("button",{class:Le(["seg",{on:R(t).config.mode==="burst"}]),onClick:x[3]||(x[3]=y=>R(a)("burst"))},"爆发",2)]),R(t).config.mode==="stream"?(K(),Q(Fe,{key:0},[T("div",wD,[T("button",{class:Le(["seg",{on:R(t).config.streamBehavior==="normal"}]),onClick:x[4]||(x[4]=y=>R(l)("normal"))},"常规持续",2),T("button",{class:Le(["seg",{on:R(t).config.streamBehavior==="loop"}]),onClick:x[5]||(x[5]=y=>R(l)("loop"))},"循环持续",2)]),be(Be,{label:"发射速率",min:1,max:300,step:1,modelValue:R(t).config.rate,"onUpdate:modelValue":x[6]||(x[6]=y=>R(t).config.rate=y)},null,8,["modelValue"]),R(t).config.streamBehavior==="normal"?(K(),Mt(Be,{key:0,label:"发射时长",min:1/30,max:60,step:1/30,modelValue:R(t).config.duration,"onUpdate:modelValue":x[7]||(x[7]=y=>R(t).config.duration=y)},null,8,["modelValue"])):(K(),Mt(Be,{key:1,label:"发射时长 (f)",min:1,max:1800,step:1,"model-value":R(n),"onUpdate:modelValue":R(c)},null,8,["model-value","onUpdate:modelValue"])),R(t).config.streamBehavior==="loop"?(K(),Q("div",SD,[T("div",_D,[T("label",TD,[T("input",{type:"checkbox",checked:R(t).config.generateLoopStartAnimation,onChange:x[8]||(x[8]=y=>R(h)("start",y))},null,40,MD),x[36]||(x[36]=T("span",{class:"switch-ui"},null,-1)),x[37]||(x[37]=T("span",null,"生成开始循环动画",-1))]),R(t).config.generateLoopStartAnimation?(K(),Q("div",CD,[T("label",AD,[T("input",{type:"checkbox",checked:R(t).config.loopStartUseCustomDuration,onChange:x[9]||(x[9]=y=>R(d)("start",y))},null,40,ED),x[38]||(x[38]=T("span",{class:"switch-ui"},null,-1)),x[39]||(x[39]=T("span",null,"指定时长",-1))]),T("label",ID,[R(t).config.loopStartUseCustomDuration?(K(),Q("input",{key:0,value:R(t).config.loopStartDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"开始循环段时长",onChange:x[10]||(x[10]=y=>R(u)("start",y))},null,40,RD)):Te("",!0),R(t).config.loopStartUseCustomDuration?(K(),Q("span",PD,"f")):(K(),Q("span",kD,"自动 "+_e(R(i))+"f",1))])])):Te("",!0)]),T("div",FD,[T("label",OD,[T("input",{type:"checkbox",checked:R(t).config.generateLoopEndAnimation,onChange:x[11]||(x[11]=y=>R(h)("end",y))},null,40,BD),x[40]||(x[40]=T("span",{class:"switch-ui"},null,-1)),x[41]||(x[41]=T("span",null,"生成结束循环动画",-1))]),R(t).config.generateLoopEndAnimation?(K(),Q("div",LD,[T("label",DD,[T("input",{type:"checkbox",checked:R(t).config.loopEndUseCustomDuration,onChange:x[12]||(x[12]=y=>R(d)("end",y))},null,40,ND),x[42]||(x[42]=T("span",{class:"switch-ui"},null,-1)),x[43]||(x[43]=T("span",null,"指定时长",-1))]),T("label",UD,[R(t).config.loopEndUseCustomDuration?(K(),Q("input",{key:0,value:R(t).config.loopEndDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"结束循环段时长",onChange:x[13]||(x[13]=y=>R(u)("end",y))},null,40,$D)):Te("",!0),R(t).config.loopEndUseCustomDuration?(K(),Q("span",XD,"f")):(K(),Q("span",VD,"自动 "+_e(R(i))+"f",1))])])):Te("",!0)])])):Te("",!0),R(t).config.streamBehavior==="loop"?(K(),Q("div",YD,"循环持续模式不支持骨骼跟随和路径跟随;进入或退出时会将粒子跟随设置恢复默认值。")):Te("",!0)],64)):(K(),Mt(Be,{key:1,label:"单次数量",min:1,max:1e3,step:1,modelValue:R(t).config.burstCount,"onUpdate:modelValue":x[14]||(x[14]=y=>R(t).config.burstCount=y)},null,8,["modelValue"])),be(Be,{label:"延迟时间",min:0,max:5,step:.1,modelValue:R(t).config.delay,"onUpdate:modelValue":x[15]||(x[15]=y=>R(t).config.delay=y)},null,8,["modelValue"])],512),[[vi,!R(r).emitMode]])]),T("div",GD,[T("div",{class:"group-head",onClick:x[17]||(x[17]=y=>R(o)("shape"))},[T("span",HD,_e(R(r).shape?"▸":"▾"),1),x[44]||(x[44]=T("span",null,"发射器形状",-1)),T("button",{class:"group-reset",title:"重置发射器形状参数",onClick:x[16]||(x[16]=et(y=>R(f)("shape"),["stop"]))},"重置")]),de(T("div",jD,[T("label",WD,[x[46]||(x[46]=T("span",null,"形状",-1)),de(T("select",{"onUpdate:modelValue":x[18]||(x[18]=y=>R(t).config.shape=y),class:"inp",onChange:x[19]||(x[19]=(...y)=>R(m)&&R(m)(...y))},[...x[45]||(x[45]=[es('',5)])],544),[[wt,R(t).config.shape]])]),R(t).config.shape==="circle"||R(t).config.shape==="cone"?(K(),Q(Fe,{key:0},[be(Be,{label:R(t).config.shape==="cone"?"内径":"内半径",min:0,max:R(t).config.outerRadius,step:1,modelValue:R(t).config.innerRadius,"onUpdate:modelValue":x[20]||(x[20]=y=>R(t).config.innerRadius=y)},null,8,["label","max","modelValue"]),be(Be,{label:R(t).config.shape==="cone"?"外径":"外半径",min:R(t).config.innerRadius,max:300,step:1,modelValue:R(t).config.outerRadius,"onUpdate:modelValue":x[21]||(x[21]=y=>R(t).config.outerRadius=y)},null,8,["label","min","modelValue"])],64)):Te("",!0),R(t).config.shape==="cone"?(K(),Q(Fe,{key:1},[be(Be,{label:"锥形朝向",min:-360,max:360,step:1,modelValue:R(t).config.coneDirection,"onUpdate:modelValue":x[22]||(x[22]=y=>R(t).config.coneDirection=y)},null,8,["modelValue"]),be(Be,{label:"锥形开口角度",min:1,max:360,step:1,modelValue:R(t).config.coneAngle,"onUpdate:modelValue":x[23]||(x[23]=y=>R(t).config.coneAngle=y)},null,8,["modelValue"])],64)):R(t).config.shape==="rect"?(K(),Q(Fe,{key:2},[be(Be,{label:"内宽",min:0,max:R(t).config.outerRectW,step:1,modelValue:R(t).config.innerRectW,"onUpdate:modelValue":x[24]||(x[24]=y=>R(t).config.innerRectW=y)},null,8,["max","modelValue"]),be(Be,{label:"内高",min:0,max:R(t).config.outerRectH,step:1,modelValue:R(t).config.innerRectH,"onUpdate:modelValue":x[25]||(x[25]=y=>R(t).config.innerRectH=y)},null,8,["max","modelValue"]),be(Be,{label:"外宽",min:R(t).config.innerRectW,max:400,step:1,modelValue:R(t).config.outerRectW,"onUpdate:modelValue":x[26]||(x[26]=y=>R(t).config.outerRectW=y)},null,8,["min","modelValue"]),be(Be,{label:"外高",min:R(t).config.innerRectH,max:400,step:1,modelValue:R(t).config.outerRectH,"onUpdate:modelValue":x[27]||(x[27]=y=>R(t).config.outerRectH=y)},null,8,["min","modelValue"])],64)):R(t).config.shape==="path"?(K(),Q(Fe,{key:3},[T("label",zD,[x[48]||(x[48]=T("span",null,"选择路径",-1)),de(T("select",{"onUpdate:modelValue":x[28]||(x[28]=y=>R(t).config.spawnPathId=y),class:"inp",onChange:x[29]||(x[29]=(...y)=>R(g)&&R(g)(...y))},[x[47]||(x[47]=T("option",{value:0},"无路径(点发射)",-1)),(K(!0),Q(Fe,null,Dt(R(e).paths,y=>(K(),Q("option",{key:y.id,value:y.id,disabled:!y.enabled},_e(y.name),9,qD))),128))],544),[[wt,R(t).config.spawnPathId,void 0,{number:!0}]])]),R(t).config.spawnPathId>0?(K(),Q("label",KD,[x[50]||(x[50]=T("span",null,"出生分布",-1)),de(T("select",{"onUpdate:modelValue":x[30]||(x[30]=y=>R(t).config.spawnPathDistribution=y),class:"inp"},[...x[49]||(x[49]=[T("option",{value:"fixed"},"等间距固定分布",-1),T("option",{value:"random"},"随机分布",-1)])],512),[[wt,R(t).config.spawnPathDistribution]])])):Te("",!0)],64)):Te("",!0),x[54]||(x[54]=T("div",{class:"divider"},null,-1)),T("label",ZD,[x[53]||(x[53]=T("span",null,"发射角度",-1)),de(T("select",{"onUpdate:modelValue":x[31]||(x[31]=y=>R(t).config.emissionAngleMode=y),class:"inp"},[x[51]||(x[51]=T("option",{value:"fixed"},"固定",-1)),x[52]||(x[52]=T("option",{value:"random"},"随机",-1)),R(t).config.shape==="circle"||R(t).config.shape==="rect"||R(t).config.shape==="cone"?(K(),Q("option",JD,"径向(中心向外)")):Te("",!0),R(t).config.shape==="path"&&R(t).config.spawnPathId>0?(K(),Q("option",QD,"垂直于路径")):Te("",!0),R(t).config.shape==="path"&&R(t).config.spawnPathId>0?(K(),Q("option",eN,"沿路径方向")):Te("",!0)],512),[[wt,R(t).config.emissionAngleMode]])]),R(t).config.emissionAngleMode==="fixed"?(K(),Mt(Be,{key:4,label:"固定角度",min:-360,max:360,step:1,modelValue:R(t).config.direction,"onUpdate:modelValue":x[32]||(x[32]=y=>R(t).config.direction=y)},null,8,["modelValue"])):R(t).config.emissionAngleMode==="random"?(K(),Q(Fe,{key:5},[be(Be,{label:"基准角度",min:-360,max:360,step:1,modelValue:R(t).config.direction,"onUpdate:modelValue":x[33]||(x[33]=y=>R(t).config.direction=y)},null,8,["modelValue"]),be(Be,{label:"随机范围",min:0,max:360,step:1,modelValue:R(t).config.spread,"onUpdate:modelValue":x[34]||(x[34]=y=>R(t).config.spread=y)},null,8,["modelValue"])],64)):Te("",!0)],512),[[vi,!R(r).shape]])])],64))}}),iN=Qt(tN,[["__scopeId","data-v-fcf44933"]]),sN={class:"pac"},nN={class:"pac-head"},rN={class:"pac-label"},oN={key:0,class:"pac-modes"},aN=["onClick"],lN={class:"pac-range"},cN={class:"pac-curve"},hN={class:"pac-axis"},uN=Jt({__name:"ParticleAttributeControl",props:{label:{},mode:{},valueMin:{},valueMax:{},curve:{},defaultCurve:{default:()=>[{x:0,y:0},{x:1,y:1}]},min:{},max:{},step:{default:1},allowDirection:{type:Boolean,default:!1},allowCurve:{type:Boolean,default:!0},showModes:{type:Boolean,default:!0},curveLabel:{default:"曲线输入 →"}},emits:["update:mode","update:valueMin","update:valueMax","update:curve"],setup(s){const e=s,t=qe(()=>{const i=[{label:"固定",value:"fixed"},{label:"随机",value:"random"}];return e.allowCurve&&i.push({label:"曲线",value:"curve"}),e.allowDirection&&i.push({label:"发射方向",value:"direction"}),i});return(i,n)=>(K(),Q("div",sN,[T("div",nN,[T("span",rN,_e(s.label),1),s.showModes?(K(),Q("div",oN,[(K(!0),Q(Fe,null,Dt(t.value,r=>(K(),Q("button",{key:r.value,class:Le(["pac-mode",{on:s.mode===r.value}]),onClick:o=>i.$emit("update:mode",r.value)},_e(r.label),11,aN))),128))])):Te("",!0)]),s.mode==="fixed"||s.mode==="direction"?(K(),Mt(Be,{key:0,label:s.mode==="direction"?"角度偏移":"数值",min:s.min,max:s.max,step:s.step,"model-value":s.valueMin,"onUpdate:modelValue":n[0]||(n[0]=r=>i.$emit("update:valueMin",r))},null,8,["label","min","max","step","model-value"])):s.mode==="random"?(K(),Q(Fe,{key:1},[be(Be,{label:"下限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMin,"onUpdate:modelValue":n[1]||(n[1]=r=>i.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),be(Be,{label:"上限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMax,"onUpdate:modelValue":n[2]||(n[2]=r=>i.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])],64)):(K(),Q(Fe,{key:2},[T("div",lN,[be(Be,{label:"范围下限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMin,"onUpdate:modelValue":n[3]||(n[3]=r=>i.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),be(Be,{label:"范围上限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMax,"onUpdate:modelValue":n[4]||(n[4]=r=>i.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])]),T("div",cN,[be(qs,{"model-value":s.curve,"default-value":s.defaultCurve,"onUpdate:modelValue":n[5]||(n[5]=r=>i.$emit("update:curve",r))},null,8,["model-value","default-value"]),T("div",hN,[n[6]||(n[6]=T("span",null,"0",-1)),T("span",null,_e(s.curveLabel),1),n[7]||(n[7]=T("span",null,"1",-1))])])],64))]))}}),mn=Qt(uN,[["__scopeId","data-v-7a931847"]]),dN={class:"group"},fN={class:"caret"},mN={class:"group-body attr-body"},pN={class:"attr-axis-head"},gN={class:"axis-modes"},vN={class:"life-item"},yN={class:"switch-row"},xN={class:"life-item"},bN={class:"switch-row"},wN={class:"axis-modes life-axis"},SN={class:"life-item"},_N={class:"switch-row"},TN=Jt({__name:"ParticleAttributesSection",setup(s){const{sys:e,collapsed:t,toggle:i,resetModule:n,setSpeedOverLifeMode:r,prepareScaleOverLifeCurve:o,setScaleOverLifeMode:a,LINEAR_CURVE:c,FLAT_CURVE:l}=br();return(h,u)=>(K(),Q("div",dN,[T("div",{class:"group-head",onClick:u[1]||(u[1]=d=>R(i)("attr"))},[T("span",fN,_e(R(t).attr?"▸":"▾"),1),u[44]||(u[44]=T("span",null,"粒子属性",-1)),T("button",{class:"group-reset",title:"重置粒子属性参数",onClick:u[0]||(u[0]=et(d=>R(n)("attr"),["stop"]))},"重置")]),de(T("div",mN,[u[52]||(u[52]=T("div",{class:"attr-section-title"},"粒子初始参数",-1)),be(mn,{label:"初始生命周期","allow-curve":!1,mode:R(e).config.lifeMode,"onUpdate:mode":u[2]||(u[2]=d=>R(e).config.lifeMode=d),"value-min":R(e).config.lifeMin,"onUpdate:valueMin":u[3]||(u[3]=d=>R(e).config.lifeMin=d),"value-max":R(e).config.lifeMax,"onUpdate:valueMax":u[4]||(u[4]=d=>R(e).config.lifeMax=d),curve:R(e).config.lifeCurve,"onUpdate:curve":u[5]||(u[5]=d=>R(e).config.lifeCurve=d),min:.1,max:10,step:.1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),be(mn,{label:"初始速度","allow-curve":!1,mode:R(e).config.speedMode,"onUpdate:mode":u[6]||(u[6]=d=>R(e).config.speedMode=d),"value-min":R(e).config.speedMin,"onUpdate:valueMin":u[7]||(u[7]=d=>R(e).config.speedMin=d),"value-max":R(e).config.speedMax,"onUpdate:valueMax":u[8]||(u[8]=d=>R(e).config.speedMax=d),curve:R(e).config.speedCurve,"onUpdate:curve":u[9]||(u[9]=d=>R(e).config.speedCurve=d),min:0,max:1e3,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),T("div",pN,[u[45]||(u[45]=T("span",null,"初始缩放",-1)),T("div",gN,[T("button",{class:Le(["axis-mode",{on:R(e).config.scaleAxisMode==="uniform"}]),onClick:u[10]||(u[10]=d=>R(e).config.scaleAxisMode="uniform")},"统一",2),T("button",{class:Le(["axis-mode",{on:R(e).config.scaleAxisMode==="separate"}]),onClick:u[11]||(u[11]=d=>R(e).config.scaleAxisMode="separate")},"XY分离",2)])]),be(mn,{label:R(e).config.scaleAxisMode==="uniform"?"初始缩放":"缩放 X","allow-curve":!1,mode:R(e).config.scaleMode,"onUpdate:mode":u[12]||(u[12]=d=>R(e).config.scaleMode=d),"value-min":R(e).config.scaleMin,"onUpdate:valueMin":u[13]||(u[13]=d=>R(e).config.scaleMin=d),"value-max":R(e).config.scaleMax,"onUpdate:valueMax":u[14]||(u[14]=d=>R(e).config.scaleMax=d),curve:R(e).config.scaleCurve,"onUpdate:curve":u[15]||(u[15]=d=>R(e).config.scaleCurve=d),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["label","mode","value-min","value-max","curve"]),R(e).config.scaleAxisMode==="separate"?(K(),Mt(mn,{key:0,label:"缩放 Y","show-modes":!1,"allow-curve":!1,mode:R(e).config.scaleMode,"onUpdate:mode":u[16]||(u[16]=d=>R(e).config.scaleMode=d),"value-min":R(e).config.scaleYMin,"onUpdate:valueMin":u[17]||(u[17]=d=>R(e).config.scaleYMin=d),"value-max":R(e).config.scaleYMax,"onUpdate:valueMax":u[18]||(u[18]=d=>R(e).config.scaleYMax=d),curve:R(e).config.scaleYCurve,"onUpdate:curve":u[19]||(u[19]=d=>R(e).config.scaleYCurve=d),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"])):Te("",!0),be(mn,{label:"初始旋转","allow-direction":"","allow-curve":!1,mode:R(e).config.initialRotationMode,"onUpdate:mode":u[20]||(u[20]=d=>R(e).config.initialRotationMode=d),"value-min":R(e).config.initialRotationMin,"onUpdate:valueMin":u[21]||(u[21]=d=>R(e).config.initialRotationMin=d),"value-max":R(e).config.initialRotationMax,"onUpdate:valueMax":u[22]||(u[22]=d=>R(e).config.initialRotationMax=d),curve:R(e).config.initialRotationCurve,"onUpdate:curve":u[23]||(u[23]=d=>R(e).config.initialRotationCurve=d),min:-360,max:360,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),u[53]||(u[53]=T("div",{class:"attr-section-title life-title"},"粒子生命周期变化参数",-1)),T("div",vN,[T("label",yN,[de(T("input",{type:"checkbox","onUpdate:modelValue":u[24]||(u[24]=d=>R(e).config.speedOverLifeEnabled=d)},null,512),[[Et,R(e).config.speedOverLifeEnabled]]),u[46]||(u[46]=T("span",{class:"switch-ui"},null,-1)),u[47]||(u[47]=T("span",null,"生命周期内速度",-1))]),R(e).config.speedOverLifeEnabled?(K(),Mt(mn,{key:0,label:"速度倍率",mode:R(e).config.speedOverLifeMode,"onUpdate:mode":R(r),"value-min":R(e).config.speedOverLifeMin,"onUpdate:valueMin":u[25]||(u[25]=d=>R(e).config.speedOverLifeMin=d),"value-max":R(e).config.speedOverLifeMax,"onUpdate:valueMax":u[26]||(u[26]=d=>R(e).config.speedOverLifeMax=d),curve:R(e).config.speedOverLifeCurve,"onUpdate:curve":u[27]||(u[27]=d=>R(e).config.speedOverLifeCurve=d),"default-curve":R(l),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","onUpdate:mode","value-min","value-max","curve","default-curve"])):Te("",!0)]),T("div",xN,[T("label",bN,[de(T("input",{type:"checkbox","onUpdate:modelValue":u[28]||(u[28]=d=>R(e).config.scaleOverLifeEnabled=d),onChange:u[29]||(u[29]=(...d)=>R(o)&&R(o)(...d))},null,544),[[Et,R(e).config.scaleOverLifeEnabled]]),u[48]||(u[48]=T("span",{class:"switch-ui"},null,-1)),u[49]||(u[49]=T("span",null,"生命周期内缩放",-1))]),R(e).config.scaleOverLifeEnabled?(K(),Q(Fe,{key:0},[T("div",wN,[T("button",{class:Le(["axis-mode",{on:R(e).config.scaleOverLifeAxisMode==="uniform"}]),onClick:u[30]||(u[30]=d=>R(e).config.scaleOverLifeAxisMode="uniform")},"统一",2),T("button",{class:Le(["axis-mode",{on:R(e).config.scaleOverLifeAxisMode==="separate"}]),onClick:u[31]||(u[31]=d=>R(e).config.scaleOverLifeAxisMode="separate")},"XY分离",2)]),be(mn,{label:R(e).config.scaleOverLifeAxisMode==="uniform"?"缩放倍率":"倍率 X",mode:R(e).config.scaleOverLifeMode,"onUpdate:mode":R(a),"value-min":R(e).config.scaleOverLifeMin,"onUpdate:valueMin":u[32]||(u[32]=d=>R(e).config.scaleOverLifeMin=d),"value-max":R(e).config.scaleOverLifeMax,"onUpdate:valueMax":u[33]||(u[33]=d=>R(e).config.scaleOverLifeMax=d),curve:R(e).config.scaleOverLifeCurve,"onUpdate:curve":u[34]||(u[34]=d=>R(e).config.scaleOverLifeCurve=d),"default-curve":R(l),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["label","mode","onUpdate:mode","value-min","value-max","curve","default-curve"]),R(e).config.scaleOverLifeAxisMode==="separate"?(K(),Mt(mn,{key:0,label:"倍率 Y","show-modes":!1,mode:R(e).config.scaleOverLifeMode,"onUpdate:mode":u[35]||(u[35]=d=>R(e).config.scaleOverLifeMode=d),"value-min":R(e).config.scaleYOverLifeMin,"onUpdate:valueMin":u[36]||(u[36]=d=>R(e).config.scaleYOverLifeMin=d),"value-max":R(e).config.scaleYOverLifeMax,"onUpdate:valueMax":u[37]||(u[37]=d=>R(e).config.scaleYOverLifeMax=d),curve:R(e).config.scaleYOverLifeCurve,"onUpdate:curve":u[38]||(u[38]=d=>R(e).config.scaleYOverLifeCurve=d),"default-curve":R(l),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve","default-curve"])):Te("",!0)],64)):Te("",!0)]),T("div",SN,[T("label",_N,[de(T("input",{type:"checkbox","onUpdate:modelValue":u[39]||(u[39]=d=>R(e).config.rotationOverLifeEnabled=d)},null,512),[[Et,R(e).config.rotationOverLifeEnabled]]),u[50]||(u[50]=T("span",{class:"switch-ui"},null,-1)),u[51]||(u[51]=T("span",null,"生命周期内旋转",-1))]),R(e).config.rotationOverLifeEnabled?(K(),Mt(mn,{key:0,label:"旋转速度",mode:R(e).config.rotationOverLifeMode,"onUpdate:mode":u[40]||(u[40]=d=>R(e).config.rotationOverLifeMode=d),"value-min":R(e).config.rotationSpeedMin,"onUpdate:valueMin":u[41]||(u[41]=d=>R(e).config.rotationSpeedMin=d),"value-max":R(e).config.rotationSpeedMax,"onUpdate:valueMax":u[42]||(u[42]=d=>R(e).config.rotationSpeedMax=d),curve:R(e).config.rotationOverLifeCurve,"onUpdate:curve":u[43]||(u[43]=d=>R(e).config.rotationOverLifeCurve=d),"default-curve":R(c),min:-720,max:720,step:10,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve","default-curve"])):Te("",!0)])],512),[[vi,!R(t).attr]])]))}}),MN=Qt(TN,[["__scopeId","data-v-909c781b"]]),CN={class:"gradient-editor"},AN=["title","onClick","onDblclick","onPointerdown"],EN={key:0,class:"gradient-controls"},IN=["value"],RN=["value"],PN={class:"gradient-position"},kN=["value"],FN=["disabled"],ON=Jt({__name:"ColorGradientEditor",props:{modelValue:{}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=Ge(null),r=Ge(0),o=qe(()=>t.modelValue[r.value]||null),a=qe(()=>[...t.modelValue].sort((M,I)=>M.position-I.position)),c=qe(()=>{const M=a.value;return M.length?`linear-gradient(90deg, ${M.map(I=>`${I.color} ${l(I.position)*100}%`).join(", ")})`:"#ffffff"});Xi(()=>t.modelValue.length,M=>{r.value>=M&&(r.value=Math.max(0,M-1))});function l(M){return Math.min(1,Math.max(0,Number(M)||0))}function h(){return t.modelValue.map(M=>({position:l(M.position),color:M.color}))}function u(M,I){const F=h();F[M]&&(F[M]={...F[M],...I},i("update:modelValue",F))}function d(M){u(r.value,{color:M.target.value})}function f(M){var E;const I=M.target,F=b(I.value,((E=o.value)==null?void 0:E.color)||"#ffffff");I.value=F,u(r.value,{color:F})}function p(M){const I=M.target;f(M),I.blur()}function m(M){const I=Number(M.target.value);Number.isFinite(I)&&u(r.value,{position:l(I/100)})}function g(M){const I=h();I.push({position:l(M),color:C(I,M)}),r.value=I.length-1,i("update:modelValue",I)}function v(M){if(!n.value)return;const I=n.value.getBoundingClientRect();g((M.clientX-I.left)/Math.max(1,I.width))}function x(){const M=a.value;let I=.5;if(M.length>1){let F=-1;for(let E=0;EF&&(F=k,I=(M[E].position+M[E+1].position)/2)}}g(I)}function y(M){if(t.modelValue.length<=2||M<0)return;const I=h().filter((F,E)=>E!==M);r.value=Math.min(M,I.length-1),i("update:modelValue",I)}function _(M,I){if(!n.value)return;r.value=I;const F=k=>{const O=n.value.getBoundingClientRect();u(I,{position:l((k.clientX-O.left)/Math.max(1,O.width))})},E=()=>{window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",E),window.removeEventListener("pointercancel",E)};window.addEventListener("pointermove",F),window.addEventListener("pointerup",E),window.addEventListener("pointercancel",E),M.preventDefault()}function C(M,I){const F=[...M].sort((E,k)=>E.position-k.position);if(!F.length)return"#ffffff";if(I<=F[0].position)return F[0].color;if(I>=F[F.length-1].position)return F[F.length-1].color;for(let E=0;EO.position)continue;const D=(I-k.position)/Math.max(1e-4,O.position-k.position);return S(k.color,O.color,D)}return F[F.length-1].color}function S(M,I,F){const E=$=>{const N=parseInt($.replace("#","").padEnd(6,"0").slice(0,6),16);return[N>>16&255,N>>8&255,N&255]},k=E(M),O=E(I),D=$=>Math.round(k[$]+(O[$]-k[$])*F);return`#${[D(0),D(1),D(2)].map($=>$.toString(16).padStart(2,"0")).join("")}`}function b(M,I){let F=M.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(F)&&(F=F.split("").map(E=>E+E).join("")),/^[0-9a-f]{6}$/i.test(F)?`#${F.toLowerCase()}`:I}return(M,I)=>(K(),Q("div",CN,[T("div",{ref_key:"bar",ref:n,class:"gradient-bar",style:di({background:c.value}),title:"双击色带添加色标",onDblclick:v},[(K(!0),Q(Fe,null,Dt(s.modelValue,(F,E)=>(K(),Q("button",{key:E,type:"button",class:Le(["gradient-stop",{selected:E===r.value}]),style:di({left:`${l(F.position)*100}%`,"--stop-color":F.color}),title:`${Math.round(l(F.position)*100)}% · ${F.color}`,onClick:et(k=>r.value=E,["stop"]),onDblclick:et(k=>y(E),["stop"]),onPointerdown:et(k=>_(k,E),["stop"])},null,46,AN))),128))],36),o.value?(K(),Q("div",EN,[T("input",{type:"color",class:"gradient-color",value:o.value.color,"aria-label":"色标颜色",onInput:d},null,40,IN),T("input",{type:"text",class:"gradient-hex-input",value:o.value.color,"aria-label":"色标颜色值",spellcheck:"false",onChange:f,onKeydown:zr(p,["enter"])},null,40,RN),T("label",PN,[T("input",{type:"number",min:"0",max:"100",step:"1",value:Math.round(l(o.value.position)*100),"aria-label":"色标位置",onInput:m},null,40,kN),I[1]||(I[1]=T("span",null,"%",-1))]),T("button",{type:"button",class:"gradient-action",title:"在中间新增颜色",onClick:x},"+"),T("button",{type:"button",class:"gradient-action danger",title:"删除当前色标",disabled:s.modelValue.length<=2,onClick:I[0]||(I[0]=F=>y(r.value))},"×",8,FN)])):Te("",!0),I[2]||(I[2]=T("div",{class:"gradient-hint"},"双击色带新增 · 拖动色标调整位置 · 双击色标删除",-1))]))}}),gS=Qt(ON,[["__scopeId","data-v-8816e4a4"]]),BN={class:"image-card"},LN={class:"imgrow"},DN=["title"],NN=["src","alt"],UN={key:1,viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#8a93bb","stroke-width":"1.6"},$N={class:"img-fields"},XN={key:0,class:"row"},VN={class:"row"},YN=["placeholder"],GN={class:"img-actions"},HN=["title"],jN=["disabled"],WN={class:"thumb-note"},zN={key:0,class:"row"},qN={class:"row"},KN={class:"row"},ZN={class:"sequence-note"},JN={class:"resource-weight-row"},QN=["disabled","title"],e4={key:0,viewBox:"0 0 24 24","aria-hidden":"true"},t4={key:1,viewBox:"0 0 24 24","aria-hidden":"true"},i4=Jt({__name:"ImageResourceCard",props:{resource:{},resourceCount:{},defaultFile:{},namePlaceholder:{default:"particle"},showFolder:{type:Boolean,default:!0},supportsSequence:{type:Boolean,default:!1}},emits:["pick","pickSequence","reset","remove","updateWeight","toggleLock"],setup(s,{emit:e}){const t=s,i=e,n=qe(()=>{var l,h;if(t.resource.imageMode==="sequence"){const u=t.resource.sequenceFrames||[];if(!u.length)return"未选择序列帧";const d=((l=u[0])==null?void 0:l.name)||"第 1 帧",f=((h=u[u.length-1])==null?void 0:h.name)||d;return u.length===1?`1 帧 · ${d}`:`${u.length} 帧 · ${d} → ${f}`}const c=t.resource.textureName||t.defaultFile.replace(/\.[^.]+$/,"");return c.includes(".")?c:`${c}.png`}),r=qe(()=>{var c,l;return t.resource.imageMode==="sequence"?((l=(c=t.resource.sequenceFrames)==null?void 0:c[0])==null?void 0:l.previewUrl)||"":t.resource.previewUrl}),o=qe(()=>{var u,d;const c=t.resource.sequenceFrames||[];if(!c.length)return"未选择序列帧";const l=((u=c[0])==null?void 0:u.name)||"第一张图片",h=((d=c[c.length-1])==null?void 0:d.name)||"最后一张图片";return`已选择 ${c.length} 帧,按 ${l}-${h} 顺序播放`});function a(){t.supportsSequence&&t.resource.imageMode==="sequence"?i("pickSequence",t.resource.id):i("pick",t.resource.id)}return(c,l)=>(K(),Q("div",BN,[T("div",LN,[T("button",{class:"img-thumb",title:s.supportsSequence&&s.resource.imageMode==="sequence"?"选择序列帧图片":"选择本地图片",onClick:a},[r.value?(K(),Q("img",{key:0,src:r.value,alt:s.resource.textureName},null,8,NN)):(K(),Q("svg",UN,[...l[10]||(l[10]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"},null,-1),T("circle",{cx:"8.5",cy:"8.5",r:"1.6"},null,-1),T("path",{d:"M21 15l-5-5-9 9"},null,-1)])]))],8,DN),T("div",$N,[s.showFolder?(K(),Q("label",XN,[l[11]||(l[11]=T("span",null,"子文件夹",-1)),de(T("input",{"onUpdate:modelValue":l[0]||(l[0]=h=>s.resource.textureFolder=h),type:"text",class:"inp",placeholder:"subfolder/"},null,512),[[He,s.resource.textureFolder]])])):Te("",!0),T("label",VN,[l[12]||(l[12]=T("span",null,"名称",-1)),de(T("input",{"onUpdate:modelValue":l[1]||(l[1]=h=>s.resource.textureName=h),type:"text",class:"inp",placeholder:s.namePlaceholder},null,8,YN),[[He,s.resource.textureName]])])]),T("div",GN,[T("button",{class:"mini-btn2",title:`恢复 ${s.defaultFile}`,onClick:l[2]||(l[2]=h=>c.$emit("reset",s.resource.id))},"⟳",8,HN),T("button",{class:"mini-btn2",title:"删除图片资源",disabled:s.resourceCount===1,onClick:l[3]||(l[3]=h=>c.$emit("remove",s.resource.id))},"🗑",8,jN)])]),T("div",WN,_e(n.value),1),s.supportsSequence?(K(),Q("label",zN,[l[14]||(l[14]=T("span",null,"图片模式",-1)),de(T("select",{"onUpdate:modelValue":l[4]||(l[4]=h=>s.resource.imageMode=h),class:"inp"},[...l[13]||(l[13]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"sequence"},"序列帧",-1)])],512),[[wt,s.resource.imageMode]])])):Te("",!0),s.supportsSequence&&s.resource.imageMode==="sequence"?(K(),Q(Fe,{key:1},[T("label",qN,[l[16]||(l[16]=T("span",null,"播放模式",-1)),de(T("select",{"onUpdate:modelValue":l[5]||(l[5]=h=>s.resource.sequencePlayback=h),class:"inp"},[...l[15]||(l[15]=[T("option",{value:"once-hide"},"单次-尾帧消失",-1),T("option",{value:"once-hold"},"单次-尾帧固定",-1),T("option",{value:"loop-forward"},"正向循环",-1),T("option",{value:"loop-reverse"},"反向循环",-1)])],512),[[wt,s.resource.sequencePlayback]])]),T("label",KN,[l[17]||(l[17]=T("span",null,"播放帧率",-1)),de(T("input",{"onUpdate:modelValue":l[6]||(l[6]=h=>s.resource.sequenceFps=h),type:"number",min:"1",max:"120",step:"1",class:"inp"},null,512),[[He,s.resource.sequenceFps,void 0,{number:!0}]])]),T("button",{class:"sequence-pick",onClick:l[7]||(l[7]=h=>c.$emit("pickSequence",s.resource.id))},"选择序列帧(多选)"),T("div",ZN,_e(o.value),1)],64)):Te("",!0),T("div",JN,[be(Be,{class:"resource-weight-control",label:"占比%",min:0,max:100,step:1,"model-value":s.resource.weight,disabled:s.resource.locked||s.resourceCount===1,"onUpdate:modelValue":l[8]||(l[8]=h=>c.$emit("updateWeight",s.resource.id,h))},null,8,["model-value","disabled"]),T("button",{class:Le(["weight-lock",{on:s.resource.locked}]),disabled:s.resourceCount===1,title:s.resource.locked?"解除占比锁定":"锁定当前占比",onClick:l[9]||(l[9]=h=>c.$emit("toggleLock",s.resource.id))},[s.resource.locked?(K(),Q("svg",e4,[...l[18]||(l[18]=[T("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),T("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"},null,-1)])])):(K(),Q("svg",t4,[...l[19]||(l[19]=[T("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),T("path",{d:"M16 10V7a4 4 0 0 0-7.5-2"},null,-1)])]))],10,QN)]),R_(c.$slots,"default",{},void 0)]))}}),vS=Qt(i4,[["__scopeId","data-v-7a2d016a"]]),s4={class:"group"},n4={class:"caret"},r4={class:"group-body"},o4={class:"seg"},a4={class:"row"},l4={class:"curve-wrap"},c4={class:"look-title image-title"},h4={class:"row"},u4=["onUpdate:modelValue"],d4=["onUpdate:modelValue"],f4={class:"row resource-color-row"},m4=["onUpdate:modelValue"],p4=["onUpdate:modelValue"],g4={key:0,class:"row resource-color-picker"},v4=["onUpdate:modelValue"],y4=["value","onChange","onKeydown"],x4={key:0,class:"random-color-hint"},b4={class:"resource-alpha-head"},w4={class:"alpha-modes"},S4=["onClick"],_4=["onClick"],T4=["onClick"],M4={class:"row"},C4=["onUpdate:modelValue"],A4={class:"resource-alpha-curve"},E4=Jt({__name:"ParticleAppearanceSection",setup(s){const{resolvedCurveEditorMode:e,sys:t,textureFileInput:i,sequenceFileInput:n,addImageResource:r,openTexturePicker:o,openSequencePicker:a,onTextureFile:c,onSequenceFiles:l,resetTexture:h,setResourceFixedColor:u,commitResourceFixedColor:d,removeImageResource:f,setResourceWeight:p,toggleResourceLock:m,collapsed:g,toggle:v,resetModule:x,select:y,ALPHA_CURVE:_,RESOURCE_ALPHA_CURVE:C}=br();return(S,b)=>(K(),Q("div",s4,[T("div",{class:"group-head",onClick:b[1]||(b[1]=M=>R(v)("look"))},[T("span",n4,_e(R(g).look?"▸":"▾"),1),b[10]||(b[10]=T("span",null,"外观与资源",-1)),T("button",{class:"group-reset",title:"重置外观与资源参数",onClick:b[0]||(b[0]=et(M=>R(x)("look"),["stop"]))},"重置")]),de(T("div",r4,[b[24]||(b[24]=T("div",{class:"look-title"},"透明度",-1)),T("div",o4,[T("button",{class:Le(["seg-btn",{active:R(t).config.alphaMode==="curve"}]),onClick:b[2]||(b[2]=M=>R(t).config.alphaMode="curve")},"曲线",2),T("button",{class:Le(["seg-btn",{active:R(t).config.alphaMode==="fixed"}]),onClick:b[3]||(b[3]=M=>R(t).config.alphaMode="fixed")},"固定",2)]),R(t).config.alphaMode==="fixed"?(K(),Mt(Be,{key:0,label:"透明度",min:0,max:1,step:.01,modelValue:R(t).config.alpha,"onUpdate:modelValue":b[4]||(b[4]=M=>R(t).config.alpha=M)},null,8,["modelValue"])):(K(),Q(Fe,{key:1},[T("label",a4,[b[12]||(b[12]=T("span",null,"曲线模式",-1)),de(T("select",{"onUpdate:modelValue":b[5]||(b[5]=M=>R(t).config.curveMode=M),class:"inp"},[...b[11]||(b[11]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],512),[[wt,R(t).config.curveMode]])]),T("div",l4,[be(qs,{modelValue:R(t).config.alphaCurve,"onUpdate:modelValue":b[6]||(b[6]=M=>R(t).config.alphaCurve=M),"default-value":R(_),mode:R(e)(R(t).config.curveMode)},null,8,["modelValue","default-value","mode"]),b[13]||(b[13]=T("div",{class:"curve-labels"},[T("span",null,"0(透明)"),T("span",null,"生命周期 →"),T("span",null,"1(不透明)")],-1))])],64)),T("div",c4,[b[14]||(b[14]=T("span",null,"图片资源",-1)),T("button",{class:"image-add",title:"新增图片资源",onClick:b[7]||(b[7]=(...M)=>R(r)&&R(r)(...M))},"+")]),(K(!0),Q(Fe,null,Dt(R(t).config.imageResources,M=>(K(),Mt(vS,{key:M.id,resource:M,"resource-count":R(t).config.imageResources.length,"supports-sequence":"","default-file":"star.png",onPick:R(o),onPickSequence:R(a),onReset:R(h),onRemove:R(f),onUpdateWeight:R(p),onToggleLock:R(m)},{default:$h(()=>[be(Be,{label:"缩放",min:.1,max:3,step:.05,modelValue:M.scale,"onUpdate:modelValue":I=>M.scale=I},null,8,["modelValue","onUpdate:modelValue"]),T("label",h4,[b[15]||(b[15]=T("span",null,"轴心 x,y",-1)),de(T("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":I=>M.anchorX=I},null,8,u4),[[He,M.anchorX,void 0,{number:!0}]]),de(T("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":I=>M.anchorY=I},null,8,d4),[[He,M.anchorY,void 0,{number:!0}]])]),b[23]||(b[23]=T("div",{class:"resource-divider"},null,-1)),T("label",f4,[b[18]||(b[18]=T("span",null,"颜色",-1)),de(T("select",{"onUpdate:modelValue":I=>M.colorMode=I,class:"inp"},[...b[16]||(b[16]=[T("option",{value:"fixed"},"固定色",-1),T("option",{value:"random"},"随机颜色",-1),T("option",{value:"lifetime"},"生命周期",-1)])],8,m4),[[wt,M.colorMode]]),de(T("select",{"onUpdate:modelValue":I=>M.blend=I,class:"inp blend-select"},[...b[17]||(b[17]=[T("option",{value:"normal"},"正常",-1),T("option",{value:"add"},"相加",-1),T("option",{value:"multiply"},"相乘",-1),T("option",{value:"screen"},"滤色",-1)])],8,p4),[[wt,M.blend]])]),M.colorMode==="fixed"?(K(),Q("label",g4,[b[19]||(b[19]=T("span",null,"固定色",-1)),de(T("input",{type:"color","onUpdate:modelValue":I=>M.colorStart=I,class:"colr"},null,8,v4),[[He,M.colorStart]]),T("input",{type:"text",class:"hex-input",value:M.colorStart,spellcheck:"false","aria-label":"固定颜色值",onChange:I=>R(u)(M,I),onKeydown:zr(I=>R(d)(M,I),["enter"])},null,40,y4)])):(K(),Q(Fe,{key:1},[be(gS,{modelValue:M.colorGradient,"onUpdate:modelValue":I=>M.colorGradient=I},null,8,["modelValue","onUpdate:modelValue"]),M.colorMode==="random"?(K(),Q("div",x4,"每个粒子出生时从色带随机取色,生命周期内保持不变")):Te("",!0)],64)),T("div",b4,[b[20]||(b[20]=T("span",null,"独立透明度",-1)),T("div",w4,[T("button",{class:Le({on:M.independentAlpha==="off"}),onClick:I=>M.independentAlpha="off"},"关闭",10,S4),T("button",{class:Le({on:M.independentAlpha==="fixed"}),onClick:I=>M.independentAlpha="fixed"},"固定",10,_4),T("button",{class:Le({on:M.independentAlpha==="curve"}),onClick:I=>M.independentAlpha="curve"},"曲线",10,T4)])]),M.independentAlpha==="fixed"?(K(),Mt(Be,{key:2,label:"透明度",min:0,max:1,step:.01,modelValue:M.alpha,"onUpdate:modelValue":I=>M.alpha=I},null,8,["modelValue","onUpdate:modelValue"])):M.independentAlpha==="curve"?(K(),Q(Fe,{key:3},[T("label",M4,[b[22]||(b[22]=T("span",null,"曲线模式",-1)),de(T("select",{"onUpdate:modelValue":I=>M.alphaCurveMode=I,class:"inp"},[...b[21]||(b[21]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],8,C4),[[wt,M.alphaCurveMode]])]),T("div",A4,[be(qs,{modelValue:M.alphaCurve,"onUpdate:modelValue":I=>M.alphaCurve=I,"default-value":R(C),mode:R(e)(M.alphaCurveMode)},null,8,["modelValue","onUpdate:modelValue","default-value","mode"])])],64)):Te("",!0)]),_:2},1032,["resource","resource-count","onPick","onPickSequence","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),T("input",{ref_key:"textureFileInput",ref:i,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:b[8]||(b[8]=(...M)=>R(c)&&R(c)(...M))},null,544),T("input",{ref_key:"sequenceFileInput",ref:n,class:"file-input",type:"file",multiple:"",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:b[9]||(b[9]=(...M)=>R(l)&&R(l)(...M))},null,544)],512),[[vi,!R(g).look]])]))}}),I4=Qt(E4,[["__scopeId","data-v-f3235ea1"]]),R4={class:"group"},P4={class:"caret"},k4={class:"group-body"},F4={class:"modifier-item"},O4={class:"switch-row modifier-switch"},B4={key:0,class:"modifier-params"},L4={class:"modifier-item"},D4={class:"switch-row modifier-switch"},N4={key:0,class:"modifier-params gravity-params"},U4={class:"modifier-mode-row"},$4={class:"modifier-item"},X4={class:"switch-row modifier-switch"},V4={key:0,class:"modifier-params gravity-params"},Y4={class:"modifier-mode-row"},G4={class:"modifier-item"},H4={class:"switch-row modifier-switch"},j4={key:0,class:"modifier-params"},W4={class:"row"},z4={class:"modifier-item"},q4={class:"switch-row modifier-switch"},K4={key:0,class:"modifier-params"},Z4={class:"row"},J4={class:"row"},Q4={class:"modifier-item"},e8={class:"switch-row modifier-switch"},t8={key:0,class:"modifier-params trail-params"},i8={class:"trail-section-head"},s8={class:"row"},n8=["onUpdate:modelValue"],r8={class:"row"},o8=["onUpdate:modelValue"],a8={class:"row"},l8=["onUpdate:modelValue"],c8={class:"switch-row trail-sub-switch"},h8=["onUpdate:modelValue"],u8={class:"switch-row trail-sub-switch"},d8=["onUpdate:modelValue"],f8={class:"trail-mode-head"},m8={class:"alpha-modes"},p8=["onClick"],g8=["onClick"],v8=["onClick"],y8={class:"row"},x8=["onUpdate:modelValue"],b8={key:6,class:"row trail-fixed-color"},w8=["onUpdate:modelValue"],S8=["value","onChange","onKeydown"],_8={class:"trail-mode-head"},T8={class:"alpha-modes"},M8=["onClick"],C8=["onClick"],A8=["onClick"],E8={class:"trail-grid-row"},I8={class:"modifier-item"},R8={class:"switch-row modifier-switch"},P8=["disabled"],k8={key:0,class:"modifier-params emitter-follow-params"},F8={class:"field-block"},O8=["value"],B8={key:0,value:"bone"},L8={class:"field-block"},D8=["value"],N8={class:"field-block"},U8={class:"field-grid follow-grid"},$8={class:"compact-field"},X8={class:"compact-field"},V8={class:"field-block"},Y8={key:0,class:"bone-follow-target"},G8={key:1,class:"bone-follow-missing"},H8={class:"field-block"},j8={class:"field-grid follow-grid"},W8={class:"compact-field"},z8={class:"compact-field"},q8={class:"bone-follow-transform-grid"},K8={class:"compact-field"},Z8={class:"compact-field"},J8={class:"compact-field"},Q8={class:"modifier-item"},e5={class:"switch-row modifier-switch"},t5={key:0,class:"modifier-params collision-filter-params"},i5={class:"collision-filter-tags"},s5=["title"],n5=["aria-label","onClick"],r5=["disabled","title"],o5={key:0,class:"collision-filter-empty"},a5={key:1,class:"collision-filter-picker"},l5=["onClick"],c5=Jt({__name:"ParticleModifiersSection",setup(s){const{store:e,sys:t,trailTextureFileInput:i,addTrailResource:n,openTrailTexturePicker:r,onTrailRigChange:o,onTrailResourceBoneCountChange:a,onTrailResourceRotationChange:c,onTrailTextureFile:l,resetTrailTexture:h,removeTrailResource:u,setTrailResourceWeight:d,toggleTrailResourceLock:f,setTrailColor:p,commitTrailColor:m,selectedSpineBone:g,boundSpineBone:v,collisionPickerOpen:x,selectedCollisionBodies:y,availableCollisionBodies:_,addCollisionBody:C,removeCollisionBody:S,collapsed:b,toggle:M,onEmitterFollowModeChange:I,bindSelectedBone:F,resetModule:E,select:k,LINEAR_CURVE:O,FLAT_CURVE:D,TRAIL_ALPHA_CURVE:$,TRAIL_SHAPE_CURVE:N}=br();return(U,A)=>(K(),Q("div",R4,[T("div",{class:"group-head",onClick:A[1]||(A[1]=P=>R(M)("mods"))},[T("span",P4,_e(R(b).mods?"▸":"▾"),1),A[60]||(A[60]=T("span",null,"修改器",-1)),T("button",{class:"group-reset",title:"重置修改器参数",onClick:A[0]||(A[0]=et(P=>R(E)("mods"),["stop"]))},"重置")]),de(T("div",k4,[T("div",F4,[T("label",O4,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[2]||(A[2]=P=>R(t).config.noise=P)},null,512),[[Et,R(t).config.noise]]),A[61]||(A[61]=T("span",{class:"switch-ui"},null,-1)),A[62]||(A[62]=T("span",null,"开启移动噪声",-1))]),R(t).config.noise?(K(),Q("div",B4,[be(Be,{label:"强度",min:0,max:100,step:1,modelValue:R(t).config.noiseAmt,"onUpdate:modelValue":A[3]||(A[3]=P=>R(t).config.noiseAmt=P)},null,8,["modelValue"]),be(Be,{label:"波动范围",min:0,max:500,step:1,modelValue:R(t).config.noiseRange,"onUpdate:modelValue":A[4]||(A[4]=P=>R(t).config.noiseRange=P)},null,8,["modelValue"]),be(Be,{label:"时间流速",min:0,max:10,step:.1,modelValue:R(t).config.noiseSpeed,"onUpdate:modelValue":A[5]||(A[5]=P=>R(t).config.noiseSpeed=P)},null,8,["modelValue"]),A[63]||(A[63]=T("div",{class:"modifier-hint"},"强度控制影响比例 · 波动范围控制最大偏移 · 时间流速控制变化速度",-1))])):Te("",!0)]),T("div",L4,[T("label",D4,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[6]||(A[6]=P=>R(t).config.useGravity=P)},null,512),[[Et,R(t).config.useGravity]]),A[64]||(A[64]=T("span",{class:"switch-ui"},null,-1)),A[65]||(A[65]=T("span",null,"开启重力",-1))]),R(t).config.useGravity?(K(),Q("div",N4,[T("div",U4,[T("button",{class:Le(["axis-mode",{on:R(t).config.gravityMode==="fixed"}]),onClick:A[7]||(A[7]=P=>R(t).config.gravityMode="fixed")},"固定",2),T("button",{class:Le(["axis-mode",{on:R(t).config.gravityMode==="random"}]),onClick:A[8]||(A[8]=P=>R(t).config.gravityMode="random")},"随机",2)]),R(t).config.gravityMode==="fixed"?(K(),Mt(Be,{key:0,label:"重力强度",min:-3e3,max:3e3,step:10,modelValue:R(t).config.gravityMin,"onUpdate:modelValue":A[9]||(A[9]=P=>R(t).config.gravityMin=P)},null,8,["modelValue"])):(K(),Q(Fe,{key:1},[be(Be,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:R(t).config.gravityMin,"onUpdate:modelValue":A[10]||(A[10]=P=>R(t).config.gravityMin=P)},null,8,["modelValue"]),be(Be,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:R(t).config.gravityMax,"onUpdate:modelValue":A[11]||(A[11]=P=>R(t).config.gravityMax=P)},null,8,["modelValue"])],64)),be(Be,{label:"方向",min:-360,max:360,step:1,modelValue:R(t).config.gravityDirection,"onUpdate:modelValue":A[12]||(A[12]=P=>R(t).config.gravityDirection=P)},null,8,["modelValue"]),A[66]||(A[66]=T("div",{class:"gravity-curve-title"},[T("span",null,"生命周期内重力"),T("span",null,"纵轴:强度 0~1")],-1)),be(qs,{modelValue:R(t).config.gravityCurve,"onUpdate:modelValue":A[13]||(A[13]=P=>R(t).config.gravityCurve=P),"default-value":R(D)},null,8,["modelValue","default-value"]),A[67]||(A[67]=T("div",{class:"gravity-curve-axis"},[T("span",null,"0"),T("span",null,"生命周期 →"),T("span",null,"1")],-1)),A[68]||(A[68]=T("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):Te("",!0)]),T("div",$4,[T("label",X4,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[14]||(A[14]=P=>R(t).config.wind=P)},null,512),[[Et,R(t).config.wind]]),A[69]||(A[69]=T("span",{class:"switch-ui"},null,-1)),A[70]||(A[70]=T("span",null,"开启风力",-1))]),R(t).config.wind?(K(),Q("div",V4,[T("div",Y4,[T("button",{class:Le(["axis-mode",{on:R(t).config.windMode==="fixed"}]),onClick:A[15]||(A[15]=P=>R(t).config.windMode="fixed")},"固定",2),T("button",{class:Le(["axis-mode",{on:R(t).config.windMode==="random"}]),onClick:A[16]||(A[16]=P=>R(t).config.windMode="random")},"随机",2)]),R(t).config.windMode==="fixed"?(K(),Mt(Be,{key:0,label:"风力强度",min:-3e3,max:3e3,step:10,modelValue:R(t).config.windMin,"onUpdate:modelValue":A[17]||(A[17]=P=>R(t).config.windMin=P)},null,8,["modelValue"])):(K(),Q(Fe,{key:1},[be(Be,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:R(t).config.windMin,"onUpdate:modelValue":A[18]||(A[18]=P=>R(t).config.windMin=P)},null,8,["modelValue"]),be(Be,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:R(t).config.windMax,"onUpdate:modelValue":A[19]||(A[19]=P=>R(t).config.windMax=P)},null,8,["modelValue"])],64)),be(Be,{label:"方向",min:-360,max:360,step:1,modelValue:R(t).config.windDirection,"onUpdate:modelValue":A[20]||(A[20]=P=>R(t).config.windDirection=P)},null,8,["modelValue"]),A[71]||(A[71]=T("div",{class:"gravity-curve-title"},[T("span",null,"生命周期内风力"),T("span",null,"纵轴:强度 0~1")],-1)),be(qs,{modelValue:R(t).config.windCurve,"onUpdate:modelValue":A[21]||(A[21]=P=>R(t).config.windCurve=P),"default-value":R(D)},null,8,["modelValue","default-value"]),A[72]||(A[72]=T("div",{class:"gravity-curve-axis"},[T("span",null,"0"),T("span",null,"生命周期 →"),T("span",null,"1")],-1)),A[73]||(A[73]=T("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):Te("",!0)]),T("div",G4,[T("label",H4,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[22]||(A[22]=P=>R(t).config.forceField=P)},null,512),[[Et,R(t).config.forceField]]),A[74]||(A[74]=T("span",{class:"switch-ui"},null,-1)),A[75]||(A[75]=T("span",null,"开启力场",-1))]),R(t).config.forceField?(K(),Q("div",j4,[be(Be,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:R(t).config.forceCenterX,"onUpdate:modelValue":A[23]||(A[23]=P=>R(t).config.forceCenterX=P)},null,8,["modelValue"]),be(Be,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:R(t).config.forceCenterY,"onUpdate:modelValue":A[24]||(A[24]=P=>R(t).config.forceCenterY=P)},null,8,["modelValue"]),be(Be,{label:"力场强度",min:-300,max:300,step:1,modelValue:R(t).config.forceStrength,"onUpdate:modelValue":A[25]||(A[25]=P=>R(t).config.forceStrength=P)},null,8,["modelValue"]),be(Be,{label:"力场半径",min:1,max:2e3,step:1,modelValue:R(t).config.forceRadius,"onUpdate:modelValue":A[26]||(A[26]=P=>R(t).config.forceRadius=P)},null,8,["modelValue"]),T("label",W4,[A[77]||(A[77]=T("span",null,"衰减模式",-1)),de(T("select",{"onUpdate:modelValue":A[27]||(A[27]=P=>R(t).config.forceFalloff=P),class:"inp"},[...A[76]||(A[76]=[T("option",{value:"constant"},"恒定(范围内力度不变)",-1),T("option",{value:"linear"},"线性衰减(边缘为 0)",-1),T("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[wt,R(t).config.forceFalloff]])]),A[78]||(A[78]=T("div",{class:"modifier-hint"},"正数吸向中心 · 负数向外排斥 · 可在画布内拖动力场圆",-1))])):Te("",!0)]),T("div",z4,[T("label",q4,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[28]||(A[28]=P=>R(t).config.attraction=P)},null,512),[[Et,R(t).config.attraction]]),A[79]||(A[79]=T("span",{class:"switch-ui"},null,-1)),A[80]||(A[80]=T("span",null,"开启吸附",-1))]),R(t).config.attraction?(K(),Q("div",K4,[be(Be,{label:"吸附点 X",min:-5e3,max:5e3,step:1,modelValue:R(t).config.attractionCenterX,"onUpdate:modelValue":A[29]||(A[29]=P=>R(t).config.attractionCenterX=P)},null,8,["modelValue"]),be(Be,{label:"吸附点 Y",min:-5e3,max:5e3,step:1,modelValue:R(t).config.attractionCenterY,"onUpdate:modelValue":A[30]||(A[30]=P=>R(t).config.attractionCenterY=P)},null,8,["modelValue"]),be(Be,{label:"吸附半径",min:0,max:2e3,step:1,modelValue:R(t).config.attractionRadius,"onUpdate:modelValue":A[31]||(A[31]=P=>R(t).config.attractionRadius=P)},null,8,["modelValue"]),be(Be,{label:"吸附时长",min:.05,max:30,step:.05,modelValue:R(t).config.attractionDuration,"onUpdate:modelValue":A[32]||(A[32]=P=>R(t).config.attractionDuration=P)},null,8,["modelValue"]),be(Be,{label:"延迟时间",min:0,max:30,step:.05,modelValue:R(t).config.attractionDelay,"onUpdate:modelValue":A[33]||(A[33]=P=>R(t).config.attractionDelay=P)},null,8,["modelValue"]),T("label",Z4,[A[82]||(A[82]=T("span",null,"延迟方式",-1)),de(T("select",{"onUpdate:modelValue":A[34]||(A[34]=P=>R(t).config.attractionDelayMode=P),class:"inp"},[...A[81]||(A[81]=[T("option",{value:"global"},"统一时间",-1),T("option",{value:"particle"},"单粒子生命",-1)])],512),[[wt,R(t).config.attractionDelayMode]])]),T("label",J4,[A[84]||(A[84]=T("span",null,"吸附方式",-1)),de(T("select",{"onUpdate:modelValue":A[35]||(A[35]=P=>R(t).config.attractionPath=P),class:"inp"},[...A[83]||(A[83]=[T("option",{value:"linear"},"直线",-1),T("option",{value:"curve"},"曲线",-1)])],512),[[wt,R(t).config.attractionPath]])]),A[85]||(A[85]=T("div",{class:"modifier-hint"},"延迟后从当前位置开始吸附 · 到达红色范围即死亡 · 可在画布内拖动吸附圆",-1))])):Te("",!0)]),T("div",Q4,[T("label",e8,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[36]||(A[36]=P=>R(t).config.trail=P)},null,512),[[Et,R(t).config.trail]]),A[86]||(A[86]=T("span",{class:"switch-ui"},null,-1)),A[87]||(A[87]=T("span",null,"开启拖尾",-1))]),R(t).config.trail?(K(),Q("div",t8,[T("div",i8,[A[88]||(A[88]=T("div",{class:"trail-section-title"},"拖尾独立图片",-1)),T("button",{class:"image-add",title:"增加拖尾图片资源",onClick:A[37]||(A[37]=(...P)=>R(n)&&R(n)(...P))},"+")]),(K(!0),Q(Fe,null,Dt(R(t).config.trailResources,P=>(K(),Mt(vS,{key:P.id,resource:P,"resource-count":R(t).config.trailResources.length,"default-file":"trail.png","name-placeholder":"trail","show-folder":!1,onPick:R(r),onReset:R(h),onRemove:R(u),onUpdateWeight:R(d),onToggleLock:R(f)},{default:$h(()=>[A[104]||(A[104]=T("div",{class:"resource-divider"},null,-1)),be(Be,{label:"旋转",min:-360,max:360,step:1,"model-value":P.rotation,"onUpdate:modelValue":L=>R(c)(P.id,L)},null,8,["model-value","onUpdate:modelValue"]),be(Be,{label:"拖尾骨骼数",min:2,max:16,step:1,"model-value":P.boneCount,"onUpdate:modelValue":L=>R(a)(P.id,L)},null,8,["model-value","onUpdate:modelValue"]),be(Be,{label:"拖尾比例 (%)",min:0,max:100,step:1,modelValue:P.trailRatio,"onUpdate:modelValue":L=>P.trailRatio=L},null,8,["modelValue","onUpdate:modelValue"]),T("label",s8,[A[90]||(A[90]=T("span",null,"拖尾长度",-1)),de(T("select",{"onUpdate:modelValue":L=>P.lengthMode=L,class:"inp"},[...A[89]||(A[89]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"random"},"随机范围",-1)])],8,n8),[[wt,P.lengthMode]])]),P.lengthMode==="fixed"?(K(),Mt(Be,{key:0,label:"长度比例 (%)",min:0,max:500,step:1,modelValue:P.length,"onUpdate:modelValue":L=>P.length=L},null,8,["modelValue","onUpdate:modelValue"])):(K(),Q(Fe,{key:1},[be(Be,{label:"长度最小 (%)",min:0,max:500,step:1,modelValue:P.lengthMin,"onUpdate:modelValue":L=>P.lengthMin=L},null,8,["modelValue","onUpdate:modelValue"]),be(Be,{label:"长度最大 (%)",min:0,max:500,step:1,modelValue:P.lengthMax,"onUpdate:modelValue":L=>P.lengthMax=L},null,8,["modelValue","onUpdate:modelValue"])],64)),T("label",r8,[A[92]||(A[92]=T("span",null,"拖尾宽度",-1)),de(T("select",{"onUpdate:modelValue":L=>P.widthSizeMode=L,class:"inp"},[...A[91]||(A[91]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"random"},"随机范围",-1)])],8,o8),[[wt,P.widthSizeMode]])]),P.widthSizeMode==="fixed"?(K(),Mt(Be,{key:2,label:"宽度比例 (%)",min:0,max:500,step:1,modelValue:P.width,"onUpdate:modelValue":L=>P.width=L},null,8,["modelValue","onUpdate:modelValue"])):(K(),Q(Fe,{key:3},[be(Be,{label:"宽度最小 (%)",min:0,max:500,step:1,modelValue:P.widthMin,"onUpdate:modelValue":L=>P.widthMin=L},null,8,["modelValue","onUpdate:modelValue"]),be(Be,{label:"宽度最大 (%)",min:0,max:500,step:1,modelValue:P.widthMax,"onUpdate:modelValue":L=>P.widthMax=L},null,8,["modelValue","onUpdate:modelValue"])],64)),T("label",a8,[A[94]||(A[94]=T("span",null,"宽度缩放",-1)),de(T("select",{"onUpdate:modelValue":L=>P.widthMode=L,class:"inp"},[...A[93]||(A[93]=[T("option",{value:"particle"},"跟随粒子",-1),T("option",{value:"fixed"},"固定",-1)])],8,l8),[[wt,P.widthMode]])]),T("label",c8,[de(T("input",{type:"checkbox","onUpdate:modelValue":L=>P.lifeLengthEnabled=L},null,8,h8),[[Et,P.lifeLengthEnabled]]),A[95]||(A[95]=T("span",{class:"switch-ui"},null,-1)),A[96]||(A[96]=T("span",null,"生命周期长度曲线",-1))]),P.lifeLengthEnabled?(K(),Mt(qs,{key:4,modelValue:P.lifeLengthCurve,"onUpdate:modelValue":L=>P.lifeLengthCurve=L,"default-value":R(D)},null,8,["modelValue","onUpdate:modelValue","default-value"])):Te("",!0),T("label",u8,[de(T("input",{type:"checkbox","onUpdate:modelValue":L=>P.shapeEnabled=L},null,8,d8),[[Et,P.shapeEnabled]]),A[97]||(A[97]=T("span",{class:"switch-ui"},null,-1)),A[98]||(A[98]=T("span",null,"形状曲线(首端 → 尾端宽度)",-1))]),P.shapeEnabled?(K(),Mt(qs,{key:5,modelValue:P.shapeCurve,"onUpdate:modelValue":L=>P.shapeCurve=L,"default-value":R(N)},null,8,["modelValue","onUpdate:modelValue","default-value"])):Te("",!0),T("div",f8,[A[99]||(A[99]=T("span",null,"颜色模式",-1)),T("div",m8,[T("button",{class:Le(["axis-mode",{on:P.colorMode==="particle"}]),onClick:L=>P.colorMode="particle"},"跟随粒子",10,p8),T("button",{class:Le(["axis-mode",{on:P.colorMode==="fixed"}]),onClick:L=>P.colorMode="fixed"},"固定",10,g8),T("button",{class:Le(["axis-mode",{on:P.colorMode==="curve"}]),onClick:L=>P.colorMode="curve"},"曲线",10,v8)])]),T("label",y8,[A[101]||(A[101]=T("span",null,"混合模式",-1)),de(T("select",{"onUpdate:modelValue":L=>P.blend=L,class:"inp"},[...A[100]||(A[100]=[T("option",{value:"normal"},"正常",-1),T("option",{value:"add"},"相加",-1),T("option",{value:"multiply"},"相乘",-1),T("option",{value:"screen"},"滤色",-1)])],8,x8),[[wt,P.blend]])]),P.colorMode==="fixed"?(K(),Q("label",b8,[A[102]||(A[102]=T("span",null,"固定颜色",-1)),de(T("input",{class:"colr",type:"color","onUpdate:modelValue":L=>P.color=L},null,8,w8),[[He,P.color]]),T("input",{class:"hex-input",value:P.color,onChange:L=>R(p)(P,L),onKeydown:zr(et(L=>R(m)(P,L),["prevent"]),["enter"])},null,40,S8)])):P.colorMode==="curve"?(K(),Mt(gS,{key:7,modelValue:P.colorGradient,"onUpdate:modelValue":L=>P.colorGradient=L},null,8,["modelValue","onUpdate:modelValue"])):Te("",!0),T("div",_8,[A[103]||(A[103]=T("span",null,"透明度模式",-1)),T("div",T8,[T("button",{class:Le(["axis-mode",{on:P.alphaMode==="particle"}]),onClick:L=>P.alphaMode="particle"},"跟随粒子",10,M8),T("button",{class:Le(["axis-mode",{on:P.alphaMode==="fixed"}]),onClick:L=>P.alphaMode="fixed"},"固定",10,C8),T("button",{class:Le(["axis-mode",{on:P.alphaMode==="curve"}]),onClick:L=>P.alphaMode="curve"},"曲线",10,A8)])]),P.alphaMode==="fixed"?(K(),Mt(Be,{key:8,label:"透明度",min:0,max:1,step:.01,modelValue:P.alpha,"onUpdate:modelValue":L=>P.alpha=L},null,8,["modelValue","onUpdate:modelValue"])):Te("",!0),P.alphaMode==="curve"?(K(),Mt(qs,{key:9,modelValue:P.alphaCurve,"onUpdate:modelValue":L=>P.alphaCurve=L,"default-value":R($)},null,8,["modelValue","onUpdate:modelValue","default-value"])):Te("",!0)]),_:2},1032,["resource","resource-count","onPick","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),T("input",{ref_key:"trailTextureFileInput",ref:i,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:A[38]||(A[38]=(...P)=>R(l)&&R(l)(...P))},null,544),T("div",E8,[be(Be,{label:"网格行数",min:2,max:16,step:1,"model-value":R(t).config.trailGridRows,"onUpdate:modelValue":A[39]||(A[39]=P=>R(o)("trailGridRows",P))},null,8,["model-value"]),be(Be,{label:"网格列数",min:2,max:32,step:1,"model-value":R(t).config.trailGridCols,"onUpdate:modelValue":A[40]||(A[40]=P=>R(o)("trailGridCols",P))},null,8,["model-value"])]),A[105]||(A[105]=T("div",{class:"modifier-hint"},"每个粒子按资源比例生成一组同级拖尾骨骼;随机长度与宽度在粒子出生时确定,相同种子可稳定复现",-1))])):Te("",!0)]),T("div",I8,[T("label",R8,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[41]||(A[41]=P=>R(t).config.emitterFollow=P),disabled:R(t).config.streamBehavior==="loop"},null,8,P8),[[Et,R(t).config.emitterFollow]]),A[106]||(A[106]=T("span",{class:"switch-ui"},null,-1)),A[107]||(A[107]=T("span",null,"开启发射器跟随",-1))]),R(t).config.emitterFollow&&R(t).config.streamBehavior!=="loop"?(K(),Q("div",k8,[T("label",F8,[A[110]||(A[110]=T("span",null,"跟随模式",-1)),T("select",{value:R(t).config.emitterFollowMode,class:"inp",onChange:A[42]||(A[42]=P=>R(I)(P,R(t).config))},[A[108]||(A[108]=T("option",{value:"none"},"无",-1)),A[109]||(A[109]=T("option",{value:"path"},"跟随路径",-1)),R(g)||R(t).config.emitterFollowMode==="bone"?(K(),Q("option",B8,"选中的骨骼")):Te("",!0)],40,O8)]),R(t).config.emitterFollowMode==="path"?(K(),Q(Fe,{key:0},[T("label",L8,[A[112]||(A[112]=T("span",null,"跟随路径",-1)),de(T("select",{"onUpdate:modelValue":A[43]||(A[43]=P=>R(t).config.emitterFollowPathId=P),class:"inp"},[A[111]||(A[111]=T("option",{value:0},"无",-1)),(K(!0),Q(Fe,null,Dt(R(e).paths,P=>(K(),Q("option",{key:P.id,value:P.id},_e(P.name),9,D8))),128))],512),[[wt,R(t).config.emitterFollowPathId,void 0,{number:!0}]])]),T("label",N8,[A[114]||(A[114]=T("span",null,"发射器角度模式",-1)),de(T("select",{"onUpdate:modelValue":A[44]||(A[44]=P=>R(t).config.emitterAngleMode=P),class:"inp"},[...A[113]||(A[113]=[T("option",{value:"fixed"},"固定角度",-1),T("option",{value:"direction"},"跟随移动方向",-1)])],512),[[wt,R(t).config.emitterAngleMode]])]),A[120]||(A[120]=T("div",{class:"gravity-curve-title"},[T("span",null,"移动进度曲线 (0→1)")],-1)),be(qs,{modelValue:R(t).config.emitterFollowCurve,"onUpdate:modelValue":A[45]||(A[45]=P=>R(t).config.emitterFollowCurve=P),"default-value":R(O)},null,8,["modelValue","default-value"]),T("div",U8,[T("label",$8,[A[115]||(A[115]=T("span",null,"移动时长 (s)",-1)),de(T("input",{"onUpdate:modelValue":A[46]||(A[46]=P=>R(t).config.emitterFollowDuration=P),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,R(t).config.emitterFollowDuration,void 0,{number:!0}]])]),T("label",X8,[A[117]||(A[117]=T("span",null,"跟随空间",-1)),de(T("select",{"onUpdate:modelValue":A[47]||(A[47]=P=>R(t).config.emitterFollowSpace=P),class:"inp"},[...A[116]||(A[116]=[T("option",{value:"local"},"局部空间(GEN 移动)",-1),T("option",{value:"world"},"世界空间(粒子生成点移动)",-1)])],512),[[wt,R(t).config.emitterFollowSpace]])])]),T("label",V8,[A[119]||(A[119]=T("span",null,"移动方向",-1)),de(T("select",{"onUpdate:modelValue":A[48]||(A[48]=P=>R(t).config.emitterFollowDirection=P),class:"inp"},[...A[118]||(A[118]=[T("option",{value:"forward"},"正向(起点 → 终点)",-1),T("option",{value:"reverse"},"反向(终点 → 起点)",-1)])],512),[[wt,R(t).config.emitterFollowDirection]])]),be(Be,{label:"偏移起始点 (0-1)",min:0,max:1,step:.01,modelValue:R(t).config.emitterFollowOffset,"onUpdate:modelValue":A[49]||(A[49]=P=>R(t).config.emitterFollowOffset=P)},null,8,["modelValue"]),A[121]||(A[121]=T("div",{class:"modifier-hint"},"局部空间会移动整个发射器;世界空间只移动新粒子的生成点,已出生粒子留在世界位置。",-1))],64)):R(t).config.emitterFollowMode==="bone"?(K(),Q(Fe,{key:1},[R(v)?(K(),Q("div",Y8,[A[122]||(A[122]=At("跟随目标:",-1)),T("strong",null,_e(R(v).spine.name)+" / "+_e(R(v).boneName),1)])):(K(),Q("div",G8,"尚未绑定有效骨骼,请先在 Spine 层级树中选择骨骼。")),R(g)&&(!R(v)||R(g).spine.id!==R(v).spine.id||R(g).boneName!==R(v).boneName)?(K(),Q("button",{key:2,class:"bone-follow-rebind",onClick:A[50]||(A[50]=P=>R(F)(R(t).config))},_e(R(v)?"重新绑定":"绑定")+"当前选中骨骼:"+_e(R(g).spine.name)+" / "+_e(R(g).boneName),1)):Te("",!0),R(v)?(K(),Q(Fe,{key:3},[T("label",H8,[A[124]||(A[124]=T("span",null,"跟随空间",-1)),de(T("select",{"onUpdate:modelValue":A[51]||(A[51]=P=>R(t).config.emitterFollowSpace=P),class:"inp"},[...A[123]||(A[123]=[T("option",{value:"local"},"本地空间(随骨骼移动)",-1),T("option",{value:"world"},"世界空间(粒子生成后保持位置)",-1)])],512),[[wt,R(t).config.emitterFollowSpace]])]),T("div",j8,[T("label",W8,[A[125]||(A[125]=T("span",null,"位移偏移 X",-1)),de(T("input",{"onUpdate:modelValue":A[52]||(A[52]=P=>R(t).config.emitterFollowBoneOffsetX=P),type:"number",step:"1",class:"inp"},null,512),[[He,R(t).config.emitterFollowBoneOffsetX,void 0,{number:!0}]])]),T("label",z8,[A[126]||(A[126]=T("span",null,"位移偏移 Y",-1)),de(T("input",{"onUpdate:modelValue":A[53]||(A[53]=P=>R(t).config.emitterFollowBoneOffsetY=P),type:"number",step:"1",class:"inp"},null,512),[[He,R(t).config.emitterFollowBoneOffsetY,void 0,{number:!0}]])])]),T("div",q8,[T("label",K8,[A[127]||(A[127]=T("span",null,"旋转偏移",-1)),de(T("input",{"onUpdate:modelValue":A[54]||(A[54]=P=>R(t).config.emitterFollowBoneRotation=P),type:"number",step:"1",class:"inp"},null,512),[[He,R(t).config.emitterFollowBoneRotation,void 0,{number:!0}]])]),T("label",Z8,[A[128]||(A[128]=T("span",null,"缩放偏移 X",-1)),de(T("input",{"onUpdate:modelValue":A[55]||(A[55]=P=>R(t).config.emitterFollowBoneScaleX=P),type:"number",step:"0.05",class:"inp"},null,512),[[He,R(t).config.emitterFollowBoneScaleX,void 0,{number:!0}]])]),T("label",J8,[A[129]||(A[129]=T("span",null,"缩放偏移 Y",-1)),de(T("input",{"onUpdate:modelValue":A[56]||(A[56]=P=>R(t).config.emitterFollowBoneScaleY=P),type:"number",step:"0.05",class:"inp"},null,512),[[He,R(t).config.emitterFollowBoneScaleY,void 0,{number:!0}]])])]),A[130]||(A[130]=T("div",{class:"modifier-hint"},"发射器只跟随所选 Spine 骨骼的位置,不继承 Spine 的旋转或缩放;粒子变换使用粒子系统自身参数和上方偏移。",-1))],64)):Te("",!0)],64)):Te("",!0)])):Te("",!0)]),T("div",Q8,[T("label",e5,[de(T("input",{type:"checkbox","onUpdate:modelValue":A[57]||(A[57]=P=>R(t).config.collision=P)},null,512),[[Et,R(t).config.collision]]),A[131]||(A[131]=T("span",{class:"switch-ui"},null,-1)),A[132]||(A[132]=T("span",null,"开启碰撞",-1))]),R(t).config.collision?(K(),Q("div",t5,[A[133]||(A[133]=T("div",{class:"collision-filter-title"},"参与的碰撞对象",-1)),T("div",i5,[(K(!0),Q(Fe,null,Dt(R(y),P=>(K(),Q("span",{key:P.id,class:Le(["collision-filter-tag",{disabled:!P.enabled}]),title:P.enabled?P.name:`${P.name}(碰撞体已禁用)`},[T("span",null,_e(P.name),1),T("button",{type:"button","aria-label":`清除碰撞对象 ${P.name}`,onClick:L=>R(S)(P.id)},"×",8,n5)],10,s5))),128)),T("button",{type:"button",class:Le(["collision-filter-add",{active:R(x)}]),disabled:R(_).length===0,title:R(_).length?"加入场景碰撞对象":"没有可加入的碰撞对象",onClick:A[58]||(A[58]=P=>x.value=!R(x))},"+",10,r5)]),R(y).length===0?(K(),Q("div",o5,"未选择碰撞对象,当前粒子不会发生碰撞")):Te("",!0),R(x)&&R(_).length?(K(),Q("div",a5,[(K(!0),Q(Fe,null,Dt(R(_),P=>(K(),Q("button",{key:P.id,type:"button",onClick:L=>R(C)(P.id)},[T("span",null,_e(P.name),1),T("small",null,_e(P.enabled?"可用":"已禁用"),1)],8,l5))),128))])):Te("",!0),A[134]||(A[134]=T("div",{class:"modifier-hint"},"只有已加入且启用的场景碰撞对象会参与当前粒子系统的碰撞",-1))])):Te("",!0)]),be(Be,{label:"阻尼",min:0,max:2,step:.05,modelValue:R(t).config.damping,"onUpdate:modelValue":A[59]||(A[59]=P=>R(t).config.damping=P)},null,8,["modelValue"])],512),[[vi,!R(b).mods]])]))}}),h5=Qt(c5,[["__scopeId","data-v-4d0d64ec"]]),u5={class:"group"},d5={class:"caret"},f5={class:"group-body export-settings"},m5={class:"export-field"},p5={class:"export-field"},g5={class:"export-field"},v5={key:0,class:"export-help"},y5={class:"export-fps-row"},x5={class:"export-field export-fps-field"},b5={class:"export-checkbox"},w5={class:"export-switches"},S5={class:"switch-row export-switch"},_5={class:"switch-row export-switch"},T5={class:"switch-row export-switch export-switch-last"},M5=Jt({__name:"ExportSettingsSection",setup(s){const{exportSettings:e,collapsed:t,toggle:i,resetModule:n,normalizeExportFps:r,select:o}=br();return(a,c)=>(K(),Q("div",u5,[T("div",{class:"group-head",onClick:c[1]||(c[1]=l=>R(i)("export"))},[T("span",d5,_e(R(t).export?"▸":"▾"),1),c[11]||(c[11]=T("span",null,"导出设置",-1)),T("button",{class:"group-reset",title:"重置导出设置",onClick:c[0]||(c[0]=et(l=>R(n)("export"),["stop"]))},"重置")]),de(T("div",f5,[T("label",m5,[c[12]||(c[12]=T("span",null,"图片路径 (Spine Images Path)",-1)),de(T("input",{"onUpdate:modelValue":c[2]||(c[2]=l=>R(e).imagesPath=l),class:"inp export-input",type:"text",placeholder:"./images/"},null,512),[[He,R(e).imagesPath,void 0,{trim:!0}]])]),T("label",p5,[c[14]||(c[14]=T("span",null,"Spine 版本",-1)),de(T("select",{"onUpdate:modelValue":c[3]||(c[3]=l=>R(e).spineVersion=l),class:"inp export-input"},[...c[13]||(c[13]=[es('',5)])],512),[[wt,R(e).spineVersion]])]),T("label",g5,[c[16]||(c[16]=T("span",null,"关键帧插值曲线",-1)),de(T("select",{"onUpdate:modelValue":c[4]||(c[4]=l=>R(e).keyframeCurve=l),class:"inp export-input"},[...c[15]||(c[15]=[T("option",{value:"linear"},"线性 (Linear)",-1),T("option",{value:"bezier"},"平滑贝塞尔 (Smooth Bézier)",-1)])],512),[[wt,R(e).keyframeCurve]])]),c[25]||(c[25]=T("div",{class:"export-help"},"平滑贝塞尔会在误差允许范围内拟合连续运动;出生、死亡、附件切换和突变仍使用阶跃关键帧。",-1)),R(e).spineVersion==="3.8"?(K(),Q("div",v5,"Spine 3.8 不支持 4.x 的逐通道数组贝塞尔,导出时会转换为经过容差精简的分段线性关键帧。")):Te("",!0),T("div",y5,[T("label",x5,[c[17]||(c[17]=T("span",null,"导出 FPS",-1)),de(T("input",{"onUpdate:modelValue":c[5]||(c[5]=l=>R(e).fps=l),class:"inp export-input",type:"number",min:"1",max:"240",step:"1",onChange:c[6]||(c[6]=(...l)=>R(r)&&R(r)(...l))},null,544),[[He,R(e).fps,void 0,{number:!0}]])]),T("label",b5,[de(T("input",{"onUpdate:modelValue":c[7]||(c[7]=l=>R(e).omitFps=l),type:"checkbox"},null,512),[[Et,R(e).omitFps]]),c[18]||(c[18]=At("不写 fps",-1))])]),c[26]||(c[26]=T("div",{class:"export-help"},"修改 FPS 时保持动画实际秒数不变;“不写 fps”只省略 Spine 的 fps 元数据。",-1)),T("div",w5,[T("label",S5,[de(T("input",{"onUpdate:modelValue":c[8]||(c[8]=l=>R(e).integerFrameAlignment=l),type:"checkbox"},null,512),[[Et,R(e).integerFrameAlignment]]),c[19]||(c[19]=T("span",{class:"switch-ui"},null,-1)),c[20]||(c[20]=T("span",null,"整数帧对齐",-1))]),T("label",_5,[de(T("input",{"onUpdate:modelValue":c[9]||(c[9]=l=>R(e).bonePool=l),type:"checkbox"},null,512),[[Et,R(e).bonePool]]),c[21]||(c[21]=T("span",{class:"switch-ui"},null,-1)),c[22]||(c[22]=T("span",null,"骨骼对象池",-1))]),T("label",T5,[de(T("input",{"onUpdate:modelValue":c[10]||(c[10]=l=>R(e).excludeEmptyAnimations=l),type:"checkbox"},null,512),[[Et,R(e).excludeEmptyAnimations]]),c[23]||(c[23]=T("span",{class:"switch-ui"},null,-1)),c[24]||(c[24]=T("span",null,"排除无内容动画",-1))])])],512),[[vi,!R(t).export]])]))}}),C5=Qt(M5,[["__scopeId","data-v-ffed0f1f"]]),A5={class:"spine-export-actions"},E5=["disabled","title"],I5=["disabled"],R5=["disabled","title"],P5={key:0},k5=["href"],F5=["href"],O5=Jt({__name:"ParticleExportFooter",setup(s){const{exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:c,connectorReady:l,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:p,exportSpineProject:m,exportSpineImages:g}=br();return(v,x)=>(K(),Q(Fe,null,[T("div",A5,[T("button",{type:"button",class:"export-spine-json",disabled:R(t),title:R(t)?"正在重新计算并烘焙动画":`导出 Spine ${R(e).spineVersion} JSON`,onClick:x[0]||(x[0]=(...y)=>R(p)&&R(p)(...y))},_e(R(t)&&R(i)==="json"?"正在准备导出…":"导出Spine Json"),9,E5),T("button",{type:"button",class:"export-spine-images",disabled:R(t),title:"单独下载当前粒子系统使用的图片 ZIP",onClick:x[1]||(x[1]=(...y)=>R(g)&&R(g)(...y))},_e(R(t)&&R(i)==="images"?"正在整理图片…":"导出 images 包"),9,I5),T("button",{type:"button",class:"export-spine-project",disabled:R(t)||!R(l),title:R(d),onClick:x[2]||(x[2]=(...y)=>R(m)&&R(m)(...y))},[T("span",null,_e(R(t)&&R(i)==="spine"?"正在生成工程…":"导出 .spine 包"),1),!R(t)&&R(u)?(K(),Q("small",P5,_e(R(u)),1)):Te("",!0)],8,R5)]),T("div",{class:Le(["connector-status",R(c)])},[x[5]||(x[5]=T("span",{class:"connector-dot"},null,-1)),At(_e(R(a))+" ",1),R(h)?(K(),Q("a",{key:0,href:R(h),target:"_blank",rel:"noopener",title:"在本机连接器中授权当前网站"},"授权当前网站",8,k5)):Te("",!0),T("button",{type:"button",title:"重新检测连接器",onClick:x[3]||(x[3]=(...y)=>R(f)&&R(f)(...y))},"刷新")],2),R(n)?(K(),Q("div",{key:0,class:Le(["export-message",{error:R(r)}])},[At(_e(R(n))+" ",1),R(o)?(K(),Q("a",{key:0,href:R(o),target:"_blank",rel:"noopener",onClick:x[4]||(x[4]=y=>o.value="")},"授权当前网站",8,F5)):Te("",!0)],2)):Te("",!0)],64))}}),B5=Qt(O5,[["__scopeId","data-v-5f1ec706"]]),L5={class:"panel"},D5={class:"panel-scroll"},N5=Jt({__name:"ParticlePanel",setup(s){const{activeObjectType:e,sys:t}=BO();return(i,n)=>(K(),Q("div",L5,[n[0]||(n[0]=T("div",{class:"panel-header"},[T("span",null,"Spine粒子编辑器-Yeomai")],-1)),T("div",D5,[be(GO),be(gD),R(e)==="particle"&&R(t)?(K(),Q(Fe,{key:0},[be(iN),be(MN),be(I4),be(h5),be(C5)],64)):Te("",!0)]),be(B5)]))}}),U5=Qt(N5,[["__scopeId","data-v-a28d4278"]]),$5={class:"timeline"},X5={class:"tl-controls"},V5=["title"],Y5={class:"tl-range",title:"自定义播放起始帧"},G5=["max","onKeydown"],H5={class:"tl-range",title:"自定义播放结束帧"},j5=["min","max","onKeydown"],W5=["title"],z5={class:"tl-frame"},q5=["disabled"],K5=["onClick"],Z5={key:0},J5={class:"tl-animation-editor"},Q5={key:0,class:"tl-animation-error"},eU={class:"tl-animation-actions"},tU=["disabled"],iU={key:1,class:"tl-animation-hint"},sU={class:"tl-anim tl-spine-preview"},nU=["value","disabled"],rU={value:""},oU=["value"],aU={class:"tl-zoom"},lU={class:"tl-ticks"},cU={class:"tl-ticklabel"},hU={class:"tl-lanes"},uU=["onPointerdown"],dU={class:"lane-name"},fU=["onPointerdown"],mU=["onPointerdown"],pU=["onPointerdown"],gU={class:"lane-name"},vU={key:0,class:"tl-empty"},yU=Jt({__name:"Timeline",setup(s){const e=ao(),t=Ge(null),i=Ge(null),n=Ge(!1),r=Ge("animation"),o=Ge("");Ma(()=>{(!Array.isArray(e.timeline.animations)||!e.timeline.animations.length)&&(e.timeline.animations=["animation"]),e.timeline.animations.includes(e.timeline.animation)||(e.timeline.animation=e.timeline.animations[0]);for(const H of e.systems)(!H.animation||!e.timeline.animations.includes(H.animation))&&(H.animation=e.timeline.animations[0])});const a=qe(()=>e.systems.find(H=>H.id===e.activeId)||null),c=qe(()=>{const H=a.value;return!H||!V(H)?null:t1(H.config,m.value)});function l(){a.value&&(n.value=!n.value,r.value=a.value.animation,o.value="")}function h(H){const G=a.value;G&&(e.setSystemAnimation(G.id,H),r.value=H,o.value="")}function u(){const H=e.addAnimation();r.value=H,o.value=""}function d(){var z;const H=((z=a.value)==null?void 0:z.animation)||e.timeline.animation,G=r.value.trim();if(!G){o.value="动画名称不能为空";return}if(G!==H&&e.timeline.animations.includes(G)){o.value="动画名称不能重复";return}if(!e.renameAnimation(H,G)){o.value="无法修改动画名称";return}r.value=G,o.value=""}function f(){var z,ie;const H=((z=a.value)==null?void 0:z.animation)||e.timeline.animation;if(!e.removeAnimation(H)){o.value="至少需要保留一个动画";return}const G=((ie=a.value)==null?void 0:ie.animation)||e.timeline.animation;r.value=G,o.value=""}function p(H){var G;(G=i.value)!=null&&G.contains(H.target)||(n.value=!1)}Vn(()=>document.addEventListener("pointerdown",p)),pl(()=>document.removeEventListener("pointerdown",p));const m=qe(()=>Math.max(1,e.timeline.fps||30)),g=Ge(120),v=Ge({}),x=Ge({}),y=Ge({}),_=Ge({}),C=Ge(String(e.timeline.playbackStart)),S=Ge(String(e.timeline.playbackEnd));Xi(()=>e.timeline.playbackStart,H=>{C.value=String(H)}),Xi(()=>e.timeline.playbackEnd,H=>{S.value=String(H)});const b=qe(()=>e.timeline.totalFrames),M=qe(()=>g.value<=30?"放大":g.value>=300?"缩小":"适中"),I=qe(()=>e.spines.filter(H=>H.selectedAnimation&&H.animations.some(G=>G.name===H.selectedAnimation&&G.duration>0))),F=qe(()=>(e.activeObjectType==="spine"?e.spines.find(G=>G.id===e.activeObjectId&&G.animations.length):null)||e.spines.find(G=>G.animations.length)||null);function E(H){const G=F.value;G&&(G.selectedAnimation=H.target.value,e.recalcTotalFrames(),e.timeline.frame=0)}function k(){e.setPlaybackStart(Number(C.value)),C.value=String(e.timeline.playbackStart)}function O(){e.setPlaybackEnd(Number(S.value)),S.value=String(e.timeline.playbackEnd)}function D(){const H=c.value;H&&(e.setPlaybackEnd(H.end),e.setPlaybackStart(H.start))}function $(){var G;const H=((G=t.value)==null?void 0:G.clientWidth)||600;return g.value/H}const N=qe(()=>{const H=[],G=g.value;let z=1;g.value<=10?z=1:g.value<=50?z=5:g.value<=200?z=10:g.value<=500?z=50:z=100;for(let ie=0;ie<=G;ie+=z)H.push({f:ie,px:ie/$()});return H}),U=qe(()=>e.timeline.frame/$());function A(H){const G=H.config;return(v.value[H.id]??Math.max(0,Number(G.delay)||0))*m.value/$()}function P(H){const G=H.config,z=Math.max(0,Number(G.lifeMin)||0),ie=Math.max(0,Number(G.lifeMax)||0);return G.lifeMode==="fixed"?z:Math.max(z,ie)}function L(H){return X(H)}function B(H){if(H.config.mode!=="stream")return 0;if(H.config.streamBehavior==="loop"){const z=H.config;return(y.value[H.id]??lr(z,m.value).loop)/$()}return(x.value[H.id]??Math.max(1/m.value,Number(H.config.duration)||1))*m.value/$()}function X(H){const G=H.config;return G.mode==="stream"&&G.streamBehavior==="loop"?q(H)+B(H)+W(H):B(H)+P(H)*m.value/$()}function V(H){const G=H.config;return G.mode==="stream"&&G.streamBehavior==="loop"}function q(H){return V(H)?lr(H.config,m.value).start/$():0}function W(H){return V(H)?lr(H.config,m.value).end/$():0}function ne(H){var G;return((G=H.animations.find(z=>z.name===H.selectedAnimation))==null?void 0:G.duration)||0}function re(H){return(_.value[H.id]??Math.max(0,Number(H.timeOffset)||0))*m.value/$()}function le(H){return ne(H)*m.value/$()}function ue(H){const G=H.deltaY<0?.8:1.25;let z=g.value*G;z=Math.min(2e3,Math.max(10,z)),g.value=Math.round(z)}function ae(H){const G=t.value,z=fe=>{const te=G.getBoundingClientRect(),oe=Math.floor((fe.clientX-te.left)/te.width*g.value);e.timeline.frame=Math.max(0,Math.min(oe,b.value-1))};z(H);const ie=()=>{window.removeEventListener("pointermove",z),window.removeEventListener("pointerup",ie)};window.addEventListener("pointermove",z),window.addEventListener("pointerup",ie)}function xe(H,G){H.stopPropagation();const z=H.clientX,ie=Math.max(0,Number(G.config.delay)||0),fe=$()/m.value,te=ye=>{const we=(ye.clientX-z)*fe,Me=Math.max(0,Math.min(ie+we,600));v.value[G.id]=Math.round(Me*m.value)/m.value},oe=ye=>{window.removeEventListener("pointermove",te),window.removeEventListener("pointerup",ce),window.removeEventListener("pointercancel",Ce);const we=v.value[G.id];delete v.value[G.id],ye&&we!=null&&we!==ie&&(G.config.delay=we)},ce=()=>oe(!0),Ce=()=>oe(!1);window.addEventListener("pointermove",te),window.addEventListener("pointerup",ce),window.addEventListener("pointercancel",Ce)}function Y(H,G){var Xe;H.stopPropagation();const z=V(G),ie=Math.max(0,Number(G.config.duration)||0),fe=lr(G.config,m.value).loop,te=$()/m.value,oe=((Xe=H.currentTarget.closest(".lane-bar"))==null?void 0:Xe.getBoundingClientRect().left)??H.clientX,ce=q(G);let Ce=!1;const ye=pe=>{if(Ce=!0,z){const Ke=Math.min(1800,Math.max(1,Math.round((pe.clientX-oe-ce)/$())));y.value[G.id]=Ke}else{const Ke=Math.max(1/m.value,Math.min((pe.clientX-oe)*te,600));x.value[G.id]=Math.round(Ke*m.value)/m.value}},we=pe=>{window.removeEventListener("pointermove",ye),window.removeEventListener("pointerup",Me),window.removeEventListener("pointercancel",ve);const Ke=x.value[G.id],Ze=y.value[G.id];delete x.value[G.id],delete y.value[G.id],pe&&Ce&&z&&Ze!=null&&Ze!==fe?G.config.loopDurationFrames=Ze:pe&&Ce&&!z&&Ke!=null&&Ke!==ie&&(G.config.duration=Ke)},Me=()=>we(!0),ve=()=>we(!1);window.addEventListener("pointermove",ye),window.addEventListener("pointerup",Me),window.addEventListener("pointercancel",ve)}function j(H,G){H.stopPropagation();const z=H.clientX,ie=Math.max(0,Number(G.timeOffset)||0),fe=$()/m.value,te=ye=>{const we=Math.max(0,Math.min(ie+(ye.clientX-z)*fe,600));_.value[G.id]=Math.round(we*m.value)/m.value},oe=ye=>{window.removeEventListener("pointermove",te),window.removeEventListener("pointerup",ce),window.removeEventListener("pointercancel",Ce);const we=_.value[G.id];delete _.value[G.id],ye&&we!=null&&we!==ie&&(G.timeOffset=we,e.recalcTotalFrames())},ce=()=>oe(!0),Ce=()=>oe(!1);window.addEventListener("pointermove",te),window.addEventListener("pointerup",ce),window.addEventListener("pointercancel",Ce)}return(H,G)=>{var z,ie,fe;return K(),Q("div",$5,[T("div",X5,[T("button",{class:Le(["tl-btn",{on:R(e).timeline.playing}]),onClick:G[0]||(G[0]=te=>R(e).togglePlay()),title:R(e).timeline.playing?"暂停 (D)":"播放 (D)"},_e(R(e).timeline.playing?"❚❚":"▶"),11,V5),T("button",{class:"tl-btn",onClick:G[1]||(G[1]=te=>R(e).toStart()),title:"回到第一帧 (S)"},"⏮"),T("button",{class:"tl-btn",onClick:G[2]||(G[2]=te=>R(e).previousFrame()),title:"前一帧"},"◀"),T("button",{class:"tl-btn",onClick:G[3]||(G[3]=te=>R(e).nextFrame()),title:"后一帧"},"▶"),T("button",{class:"tl-btn",onClick:G[4]||(G[4]=te=>R(e).toEnd()),title:"移动到最后一帧"},"⏭"),T("button",{class:Le(["tl-btn",{on:R(e).timeline.loop}]),onClick:G[5]||(G[5]=te=>R(e).toggleLoop()),title:"循环"},"⟳",2),T("label",Y5,[G[10]||(G[10]=T("span",null,"A",-1)),de(T("input",{"onUpdate:modelValue":G[6]||(G[6]=te=>C.value=te),type:"number",min:"0",max:Math.max(0,R(e).timeline.playbackEnd-1),"aria-label":"播放起始帧",onChange:k,onKeydown:zr(et(k,["prevent"]),["enter"])},null,40,G5),[[He,C.value]])]),T("label",H5,[G[11]||(G[11]=T("span",null,"B",-1)),de(T("input",{"onUpdate:modelValue":G[7]||(G[7]=te=>S.value=te),type:"number",min:R(e).timeline.playbackStart+1,max:Math.max(1,R(e).timeline.totalFrames-1),"aria-label":"播放结束帧",onChange:O,onKeydown:zr(et(O,["prevent"]),["enter"])},null,40,j5),[[He,S.value]])]),c.value?(K(),Q("button",{key:0,class:"tl-loop-range",title:`设为闭合自循环范围 ${c.value.start}–${c.value.end}f`,onClick:D},"循环段",8,W5)):Te("",!0),T("span",z5,[G[12]||(G[12]=At("帧 ",-1)),T("b",null,_e(R(e).timeline.frame),1),G[13]||(G[13]=At(" / ",-1)),T("b",null,_e(Math.max(0,R(e).timeline.totalFrames-1)),1)]),G[18]||(G[18]=T("span",{class:"tl-legend"},[T("i",{class:"legend-emission"}),At("持续发射 "),T("i",{class:"legend-life"}),At("粒子存在 "),T("i",{class:"legend-spine"}),At("Spine 动画")],-1)),T("div",{ref_key:"animationMenuRef",ref:i,class:"tl-anim tl-owner-animation"},[G[16]||(G[16]=T("span",null,"所属动画",-1)),T("button",{class:"tl-animation-trigger",disabled:!a.value,title:"设置当前粒子系统所属的动画",onClick:et(l,["stop"])},[T("span",null,_e(((z=a.value)==null?void 0:z.animation)||R(e).timeline.animation),1),G[14]||(G[14]=T("i",null,"⌄",-1))],8,q5),n.value?(K(),Q("div",{key:0,class:"tl-animation-menu",onPointerdown:G[9]||(G[9]=et(()=>{},["stop"]))},[G[15]||(G[15]=T("div",{class:"tl-animation-menu-title"},"选择所属动画",-1)),(K(!0),Q(Fe,null,Dt(R(e).timeline.animations,te=>{var oe,ce;return K(),Q("button",{key:te,class:Le(["tl-animation-option",{on:((oe=a.value)==null?void 0:oe.animation)===te}]),onClick:Ce=>h(te)},[T("span",null,_e(te),1),((ce=a.value)==null?void 0:ce.animation)===te?(K(),Q("i",Z5,"✓")):Te("",!0)],10,K5)}),128)),T("div",J5,[de(T("input",{"onUpdate:modelValue":G[8]||(G[8]=te=>r.value=te),class:"tl-animation-name",maxlength:"64","aria-label":"动画名称",onKeydown:zr(d,["enter"])},null,544),[[He,r.value]]),T("button",{title:"重命名当前动画",onClick:d},"重命名")]),o.value?(K(),Q("div",Q5,_e(o.value),1)):Te("",!0),T("div",eU,[T("button",{onClick:u},"+ 新增"),T("button",{disabled:R(e).timeline.animations.length<=1,onClick:f},"删除",8,tU)]),R(e).timeline.animations.length<=1?(K(),Q("div",iU,"至少需要保留一个动画")):Te("",!0)],32)):Te("",!0)],512),T("label",sU,[G[17]||(G[17]=At("Spine 预览动画 ",-1)),T("select",{class:"tl-sel",value:((ie=F.value)==null?void 0:ie.selectedAnimation)||"",disabled:!F.value,onChange:E},[T("option",rU,_e(F.value?"无":"无可用 Spine 动画"),1),(K(!0),Q(Fe,null,Dt(((fe=F.value)==null?void 0:fe.animations)||[],te=>(K(),Q("option",{key:te.name,value:te.name},_e(te.name)+"("+_e(te.duration.toFixed(2))+"s) ",9,oU))),128))],40,nU)]),T("span",aU,_e(M.value),1)]),T("div",{class:"tl-viewport",ref_key:"vpRef",ref:t,onWheel:et(ue,["prevent"]),onPointerdown:ae},[T("div",lU,[(K(!0),Q(Fe,null,Dt(N.value,te=>(K(),Q("div",{key:te.f,class:"tl-tickline",style:di({left:te.px+"px"})},[T("span",cU,_e(te.f)+"f",1)],4))),128))]),T("div",{class:"tl-playhead",style:di({left:U.value+"px"})},null,4),T("div",hU,[(K(!0),Q(Fe,null,Dt(R(e).systems,(te,oe)=>(K(),Q("div",{key:te.id,class:"tl-lane"},[G[19]||(G[19]=T("span",{class:"lane-ico"},"●",-1)),T("div",{class:"lane-bar",style:di({left:A(te)+"px",width:L(te)+"px"}),onPointerdown:et(ce=>xe(ce,te),["stop"])},[T("span",dU,_e(te.config.name||"系统 "+(oe+1)),1),T("span",{class:Le(["bar-life",{"loop-life":V(te)}]),style:di({width:X(te)+"px"})},null,6),V(te)?(K(),Q(Fe,{key:0},[q(te)?(K(),Q("span",{key:0,class:"bar-loop-transition bar-loop-start",style:di({width:q(te)+"px"})},null,4)):Te("",!0),T("span",{class:"bar-emission bar-loop",style:di({left:q(te)+"px",width:B(te)+"px"})},[T("span",{class:"bar-handle",title:"拖动循环段时长",onPointerdown:et(ce=>Y(ce,te),["stop"])},null,40,fU)],4),W(te)?(K(),Q("span",{key:1,class:"bar-loop-transition bar-loop-end",style:di({left:q(te)+B(te)+"px",width:W(te)+"px"})},null,4)):Te("",!0)],64)):te.config.mode==="stream"?(K(),Q("span",{key:1,class:"bar-emission",style:di({width:B(te)+"px"})},[T("span",{class:"bar-handle",title:"拖动持续发射时长",onPointerdown:et(ce=>Y(ce,te),["stop"])},null,40,mU)],4)):Te("",!0)],44,uU)]))),128)),(K(!0),Q(Fe,null,Dt(I.value,te=>(K(),Q("div",{key:`spine-${te.id}`,class:"tl-lane spine-lane"},[G[20]||(G[20]=T("span",{class:"lane-ico spine-ico"},"◆",-1)),T("div",{class:"spine-bar",style:di({left:re(te)+"px",width:le(te)+"px"}),title:"拖动调整动画开始时间",onPointerdown:et(oe=>j(oe,te),["stop"])},[T("span",gU,_e(te.name)+" · "+_e(te.selectedAnimation),1)],44,pU)]))),128)),!R(e).systems.length&&!I.value.length?(K(),Q("div",vU,"暂无可显示的动画数据")):Te("",!0)])],544)])}}}),xU=Qt(yU,[["__scopeId","data-v-e305dee7"]]),bU={class:"transfer-heading"},wU={key:0},SU={class:"transfer-detail"},_U=Jt({__name:"TransferProgressOverlay",setup(s){const e=Ge(null);return Xi(()=>qt.visible,async t=>{var i;t&&(await Uh(),(i=e.value)==null||i.focus({preventScroll:!0}))},{flush:"post"}),(t,i)=>(K(),Mt(wT,{name:"transfer-fade"},{default:$h(()=>[R(qt).visible?(K(),Q("div",{key:0,ref_key:"overlayElement",ref:e,class:"transfer-overlay",role:"dialog","aria-modal":"true","aria-live":"polite",tabindex:"-1",onPointerdown:i[0]||(i[0]=et(()=>{},["stop","prevent"])),onPointerup:i[1]||(i[1]=et(()=>{},["stop","prevent"])),onClick:i[2]||(i[2]=et(()=>{},["stop","prevent"])),onDblclick:i[3]||(i[3]=et(()=>{},["stop","prevent"])),onContextmenu:i[4]||(i[4]=et(()=>{},["stop","prevent"])),onWheel:i[5]||(i[5]=et(()=>{},["stop","prevent"])),onKeydown:i[6]||(i[6]=et(()=>{},["stop","prevent"]))},[T("div",{class:Le(["transfer-dialog",{failed:R(qt).failed}])},[T("div",bU,[T("span",null,_e(R(qt).title),1),R(qt).indeterminate?Te("",!0):(K(),Q("strong",wU,_e(Math.round(R(qt).progress))+"%",1))]),T("div",{class:Le(["transfer-track",{indeterminate:R(qt).indeterminate}])},[T("div",{class:"transfer-bar",style:di(R(qt).indeterminate?void 0:{width:`${R(qt).progress}%`})},null,4)],2),T("div",SU,_e(R(qt).detail),1)],2)],544)):Te("",!0)]),_:1}))}}),TU=Qt(_U,[["__scopeId","data-v-016b4c9d"]]),MU=["inert","aria-hidden"],CU={class:"right"},AU={class:"stage-area"},EU=Jt({__name:"App",setup(s){const e=ao();zI(e);const t=Ge(360),i=Ge(180);function n(o){o.preventDefault();const a=l=>{const h=e.settings.parameterPanelOnRight?window.innerWidth-l.clientX:l.clientX,u=Math.max(240,Math.min(h,window.innerWidth-200));t.value=u},c=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",c)};window.addEventListener("pointermove",a),window.addEventListener("pointerup",c)}function r(o){o.preventDefault();const a=o.clientY,c=i.value,l=u=>{const d=Math.max(80,Math.min(c+(a-u.clientY),window.innerHeight-200));i.value=d},h=()=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",h)};window.addEventListener("pointermove",l),window.addEventListener("pointerup",h)}return(o,a)=>(K(),Q(Fe,null,[T("div",{class:Le(["layout",{"panel-right":R(e).settings.parameterPanelOnRight}]),inert:R(qt).visible?!0:void 0,"aria-hidden":R(qt).visible?"true":void 0},[T("div",{class:"parameter-panel",style:di({width:t.value+"px"})},[be(U5)],4),T("div",{class:"resizer-col",onPointerdown:n},null,32),T("div",CU,[T("div",AU,[be(PF)]),T("div",{class:"resizer-row",onPointerdown:r,title:"拖动调整时间轴高度"},null,32),T("div",{class:"timeline-area",style:di({height:i.value+"px"})},[be(xU)],4)])],10,MU),be(TU)],64))}}),IU=Qt(EU,[["__scopeId","data-v-d7e0e59a"]]);qT(IU).use(JT()).mount("#app");export{Kv as $,tn as A,Th as B,St as C,Si as D,Pe as E,$i as F,an as G,tt as H,pt as I,rS as J,zi as K,ns as L,gs as M,gr as N,cu as O,en as P,al as Q,ta as R,Cs as S,u3 as T,Ye as U,Gv as V,Is as W,nX as X,lO as Y,dl as Z,op as _,ze as a,ym as a$,qv as a0,Nw as a1,vp as a2,iX as a3,bh as a4,Ha as a5,w3 as a6,ja as a7,hu as a8,mm as a9,Cm as aA,Am as aB,mc as aC,Jn as aD,Rc as aE,pm as aF,Vw as aG,Yt as aH,Bw as aI,z$ as aJ,qo as aK,zv as aL,Ee as aM,Ue as aN,vm as aO,Pc as aP,jw as aQ,gm as aR,Gw as aS,Hw as aT,uu as aU,qw as aV,kc as aW,Jw as aX,Ww as aY,Kw as aZ,Qw as a_,ho as aa,yp as ab,xp as ac,jv as ad,Tl as ae,Ml as af,_l as ag,co as ah,En as ai,K$ as aj,Xw as ak,b3 as al,sa as am,dr as an,Sp as ao,nS as ap,y3 as aq,ul as ar,Wi as as,Wv as at,Q$ as au,la as av,Mm as aw,Em as ax,Im as ay,Rm as az,Qo as b,$n as b$,_h as b0,zw as b1,xr as b2,Zw as b3,bp as b4,h3 as b5,iS as b6,sS as b7,wp as b8,on as b9,eS as bA,_p as bB,lu as bC,oS as bD,xm as bE,ci as bF,l3 as bG,f3 as bH,Tw as bI,_w as bJ,Z$ as bK,Rt as bL,ca as bM,aS as bN,hS as bO,uS as bP,dS as bQ,lS as bR,cS as bS,v3 as bT,Tp as bU,xt as bV,Tm as bW,Yw as bX,Cw as bY,Aw as bZ,Ew as b_,c3 as ba,q$ as bb,Qe as bc,$w as bd,Uw as be,Lw as bf,Dw as bg,Qr as bh,wh as bi,x3 as bj,Iw as bk,Rw as bl,Ni as bm,Pw as bn,ia as bo,bi as bp,Mw as bq,Sh as br,kw as bs,Fw as bt,Ow as bu,Zv as bv,Sm as bw,Xr as bx,tS as by,wm as bz,ea as c,J$ as c0,p3 as c1,g3 as c2,m3 as c3,je as d,Ne as e,eX as f,Je as g,mi as h,Qc as i,Ki as j,Ot as k,De as l,ks as m,Bt as n,Qm as o,Zt as p,ll as q,Kn as r,ke as s,Hx as t,rp as u,nh as v,bm as w,Ur as x,Hv as y,_m as z}; diff --git a/dist/assets/index-Btg_SCRJ.js b/dist/assets/index-Cz2cACyM.js similarity index 99% rename from dist/assets/index-Btg_SCRJ.js rename to dist/assets/index-Cz2cACyM.js index 3e71de0..7e55e18 100644 --- a/dist/assets/index-Btg_SCRJ.js +++ b/dist/assets/index-Cz2cACyM.js @@ -1,2 +1,2 @@ -var ft=Object.defineProperty;var gt=(W,t,e)=>t in W?ft(W,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):W[t]=e;var T=(W,t,e)=>gt(W,typeof t!="symbol"?t+"":t,e);import{f as ht,R as pt,N as dt,ac as ut,Z as mt,b4 as yt,O as rt,b5 as at,U as D,B as Tt}from"./index-CyjCNKhS.js";import{$ as Rt,a0 as Yt,a1 as Ft,a2 as Et,y as _t,a3 as Ot,a4 as kt,a5 as Xt,a6 as Bt,a7 as Nt,a8 as Dt,a9 as $t,aa as zt,ab as Wt,ad as qt,H as Gt,ae as Jt,af as Ht,ag as Zt,ah as Kt,ai as Qt,aj as jt,ak as te,al as ee,am as se,an as ne,ao as ie,ap as oe,aq as re,ar as ae,as as le,at as ce,au as he,av as pe,aw as de,ax as ue,ay as fe,az as ge,aA as me,aB as ye,aC as Te,aD as be,aE as we,aF as xe,aG as Ae,aH as Pe,aI as Ie,aJ as Ce,aK as Ve,aL as Le,aM as Se,aN as Me,aO as ve,aP as Ue,aQ as Re,aR as Ye,aS as Fe,aT as Ee,x as _e,aU as Oe,aV as ke,aW as Xe,aX as Be,aY as Ne,aZ as De,a_ as $e,a$ as ze,b0 as We,b1 as qe,b2 as Ge,b3 as Je,b6 as He,b7 as Ze,b8 as Ke,b9 as Qe,ba as je,bb as ts,bc as es,bd as ss,be as ns,bf as is,bg as os,bh as rs,bi as as,bj as ls,bk as cs,bl as hs,bm as ps,bn as ds,bo as us,bp as fs,bq as gs,br as ms,bs as ys,bt as Ts,bu as bs,w as ws,X as xs,J as As,Y as Ps,z as Is,bv as Cs,bw as Vs,bx as Ls,by as Ss,bz as Ms,bA as vs,bB as Us,bC as Rs,bD as Ys,bE as Fs,bF as Es,bG as _s,T as Os,bH as ks,bI as Xs,b as Bs,bJ as Ns,c as Ds,bK as $s,bL as zs,bM as Ws,bN as qs,bO as Gs,bP as Js,bQ as Hs,bR as Zs,bS as Ks,bT as Qs,bU as js,bV as tn,bW as en,bX as sn,bY as nn,bZ as on,b_ as rn,V as an,b$ as ln,c0 as cn,c1 as hn,c2 as pn,c3 as dn}from"./index-CyjCNKhS.js";class It{constructor(t){T(this,"skeletonData");T(this,"animationToMixTime",{});T(this,"defaultMix",0);if(!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,n){return typeof t=="string"?this.setMix1(t,e,n):this.setMix2(t,e,n)}setMix1(t,e,n){const s=this.skeletonData.findAnimation(t);if(!s)throw new Error(`Animation not found: ${t}`);const i=this.skeletonData.findAnimation(e);if(!i)throw new Error(`Animation not found: ${e}`);this.setMix2(s,i,n)}setMix2(t,e,n){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");const s=`${t.name}.${e.name}`;this.animationToMixTime[s]=n}getMix(t,e){const n=`${t.name}.${e.name}`,s=this.animationToMixTime[n];return s===void 0?this.defaultMix:s}}class Ct{constructor(t,e="",n=new bt,s=new lt){T(this,"textureLoader");T(this,"pathPrefix");T(this,"downloader");T(this,"cache");T(this,"errors",{});T(this,"toLoad",0);T(this,"loaded",0);T(this,"texturePmaInfo",{});this.textureLoader=t,this.pathPrefix=e,this.downloader=n,this.cache=s}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,n){this.toLoad--,this.loaded++,this.cache.assets[e]=n,this.cache.assetsRefCount[e]=(this.cache.assetsRefCount[e]||0)+1,t&&t(e,n)}error(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)}loadAll(){return new Promise((e,n)=>{const s=()=>{if(this.isLoadingComplete()){this.hasErrors()?n(this.errors):e(this);return}requestAnimationFrame(s)};requestAnimationFrame(s)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadBinary(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load binary ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}loadText(t,e=()=>{},n=()=>{}){t=this.start(t),this.downloader.downloadText(t,s=>{this.success(e,t,s)},(s,i)=>{this.error(n,t,`Couldn't load text ${t}: status ${s}, ${i}`)})}loadJson(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadJson(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load JSON ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}reuseAssets(t,e=()=>{},n=()=>{}){const s=this.cache.getAsset(t),i=s!==void 0;return i&&(this.cache.assetsLoaded[t]=s.then(o=>(o=o instanceof Image||o instanceof ImageBitmap?this.textureLoader(o):o,this.success(e,t,o),o)).catch(o=>{this.error(n,t,o)})),i}loadTexture(t,e=()=>{},n=()=>{}){if(t=this.start(t),this.reuseAssets(t,e,n))return;const s=this.texturePmaInfo[t];this.cache.assetsLoaded[t]=new Promise((i,o)=>{if(!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(t,{mode:"cors"}).then(c=>{if(c.ok)return c.blob();const a=`Couldn't load image: ${t}`;this.error(n,t,`Couldn't load image: ${t}`),o(a)}).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{if(c){const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)}});else{const c=new Image;c.crossOrigin="anonymous",c.onload=()=>{const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)},c.onerror=()=>{const a=`Couldn't load image: ${t}`;this.error(n,t,a),o(a)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),c.src=t}})}loadTextureAtlas(t,e=()=>{},n=()=>{},s){const i=t.lastIndexOf("/"),o=i>=0?t.substring(0,i+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((r,l)=>{this.downloader.downloadText(t,c=>{try{const a=this.createTextureAtlas(c,o,t,s);let h=a.pages.length,m=!1;if(h===0){this.success(e,t,a),r(a);return}for(const y of a.pages)this.loadTexture(this.texturePath(o,y.name,s),(A,u)=>{m||(y.setTexture(u),--h===0&&(this.success(e,t,a),r(a)))},(A,u)=>{if(!m){const g=`Couldn't load texture ${t} page image: ${A}`;this.error(n,t,g),l(g)}m=!0})}catch(a){const h=`Couldn't parse texture atlas ${t}: ${a.message}`;this.error(n,t,h),l(h)}},(c,a)=>{const h=`Couldn't load texture atlas ${t}: status ${c}, ${a}`;this.error(n,t,h),l(h)})}))}loadTextureAtlasButNoTextures(t,e=()=>{},n=()=>{}){const s=t.lastIndexOf("/"),i=s>=0?t.substring(0,s+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((o,r)=>{this.downloader.downloadText(t,l=>{try{const c=this.createTextureAtlas(l,i,t);this.success(e,t,c),o(c)}catch(c){const a=`Couldn't parse texture atlas ${t}: ${c.message}`;this.error(n,t,a),r(a)}},(l,c)=>{const a=`Couldn't load texture atlas ${t}: status ${l}, ${c}`;this.error(n,t,a),r(a)})}))}async loadBinaryAsync(t){return new Promise((e,n)=>{this.loadBinary(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadJsonAsync(t){return new Promise((e,n)=>{this.loadJson(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAsync(t){return new Promise((e,n)=>{this.loadTexture(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasAsync(t){return new Promise((e,n)=>{this.loadTextureAtlas(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasButNoTexturesAsync(t){return new Promise((e,n)=>{this.loadTextureAtlasButNoTextures(t,(s,i)=>e(i),(s,i)=>n(i))})}setCache(t){this.cache=t}get(t){return this.cache.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;const e=this.cache.assets[t];if(e)return e;const n=this.errors[t];throw Error(`Asset not found: ${t}${n?` +var ft=Object.defineProperty;var gt=(W,t,e)=>t in W?ft(W,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):W[t]=e;var T=(W,t,e)=>gt(W,typeof t!="symbol"?t+"":t,e);import{f as ht,R as pt,N as dt,ac as ut,Z as mt,b4 as yt,O as rt,b5 as at,U as D,B as Tt}from"./index-9ofazf7F.js";import{$ as Rt,a0 as Yt,a1 as Ft,a2 as Et,y as _t,a3 as Ot,a4 as kt,a5 as Xt,a6 as Bt,a7 as Nt,a8 as Dt,a9 as $t,aa as zt,ab as Wt,ad as qt,H as Gt,ae as Jt,af as Ht,ag as Zt,ah as Kt,ai as Qt,aj as jt,ak as te,al as ee,am as se,an as ne,ao as ie,ap as oe,aq as re,ar as ae,as as le,at as ce,au as he,av as pe,aw as de,ax as ue,ay as fe,az as ge,aA as me,aB as ye,aC as Te,aD as be,aE as we,aF as xe,aG as Ae,aH as Pe,aI as Ie,aJ as Ce,aK as Ve,aL as Le,aM as Se,aN as Me,aO as ve,aP as Ue,aQ as Re,aR as Ye,aS as Fe,aT as Ee,x as _e,aU as Oe,aV as ke,aW as Xe,aX as Be,aY as Ne,aZ as De,a_ as $e,a$ as ze,b0 as We,b1 as qe,b2 as Ge,b3 as Je,b6 as He,b7 as Ze,b8 as Ke,b9 as Qe,ba as je,bb as ts,bc as es,bd as ss,be as ns,bf as is,bg as os,bh as rs,bi as as,bj as ls,bk as cs,bl as hs,bm as ps,bn as ds,bo as us,bp as fs,bq as gs,br as ms,bs as ys,bt as Ts,bu as bs,w as ws,X as xs,J as As,Y as Ps,z as Is,bv as Cs,bw as Vs,bx as Ls,by as Ss,bz as Ms,bA as vs,bB as Us,bC as Rs,bD as Ys,bE as Fs,bF as Es,bG as _s,T as Os,bH as ks,bI as Xs,b as Bs,bJ as Ns,c as Ds,bK as $s,bL as zs,bM as Ws,bN as qs,bO as Gs,bP as Js,bQ as Hs,bR as Zs,bS as Ks,bT as Qs,bU as js,bV as tn,bW as en,bX as sn,bY as nn,bZ as on,b_ as rn,V as an,b$ as ln,c0 as cn,c1 as hn,c2 as pn,c3 as dn}from"./index-9ofazf7F.js";class It{constructor(t){T(this,"skeletonData");T(this,"animationToMixTime",{});T(this,"defaultMix",0);if(!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,n){return typeof t=="string"?this.setMix1(t,e,n):this.setMix2(t,e,n)}setMix1(t,e,n){const s=this.skeletonData.findAnimation(t);if(!s)throw new Error(`Animation not found: ${t}`);const i=this.skeletonData.findAnimation(e);if(!i)throw new Error(`Animation not found: ${e}`);this.setMix2(s,i,n)}setMix2(t,e,n){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");const s=`${t.name}.${e.name}`;this.animationToMixTime[s]=n}getMix(t,e){const n=`${t.name}.${e.name}`,s=this.animationToMixTime[n];return s===void 0?this.defaultMix:s}}class Ct{constructor(t,e="",n=new bt,s=new lt){T(this,"textureLoader");T(this,"pathPrefix");T(this,"downloader");T(this,"cache");T(this,"errors",{});T(this,"toLoad",0);T(this,"loaded",0);T(this,"texturePmaInfo",{});this.textureLoader=t,this.pathPrefix=e,this.downloader=n,this.cache=s}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,n){this.toLoad--,this.loaded++,this.cache.assets[e]=n,this.cache.assetsRefCount[e]=(this.cache.assetsRefCount[e]||0)+1,t&&t(e,n)}error(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)}loadAll(){return new Promise((e,n)=>{const s=()=>{if(this.isLoadingComplete()){this.hasErrors()?n(this.errors):e(this);return}requestAnimationFrame(s)};requestAnimationFrame(s)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadBinary(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load binary ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}loadText(t,e=()=>{},n=()=>{}){t=this.start(t),this.downloader.downloadText(t,s=>{this.success(e,t,s)},(s,i)=>{this.error(n,t,`Couldn't load text ${t}: status ${s}, ${i}`)})}loadJson(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadJson(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load JSON ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}reuseAssets(t,e=()=>{},n=()=>{}){const s=this.cache.getAsset(t),i=s!==void 0;return i&&(this.cache.assetsLoaded[t]=s.then(o=>(o=o instanceof Image||o instanceof ImageBitmap?this.textureLoader(o):o,this.success(e,t,o),o)).catch(o=>{this.error(n,t,o)})),i}loadTexture(t,e=()=>{},n=()=>{}){if(t=this.start(t),this.reuseAssets(t,e,n))return;const s=this.texturePmaInfo[t];this.cache.assetsLoaded[t]=new Promise((i,o)=>{if(!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(t,{mode:"cors"}).then(c=>{if(c.ok)return c.blob();const a=`Couldn't load image: ${t}`;this.error(n,t,`Couldn't load image: ${t}`),o(a)}).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{if(c){const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)}});else{const c=new Image;c.crossOrigin="anonymous",c.onload=()=>{const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)},c.onerror=()=>{const a=`Couldn't load image: ${t}`;this.error(n,t,a),o(a)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),c.src=t}})}loadTextureAtlas(t,e=()=>{},n=()=>{},s){const i=t.lastIndexOf("/"),o=i>=0?t.substring(0,i+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((r,l)=>{this.downloader.downloadText(t,c=>{try{const a=this.createTextureAtlas(c,o,t,s);let h=a.pages.length,m=!1;if(h===0){this.success(e,t,a),r(a);return}for(const y of a.pages)this.loadTexture(this.texturePath(o,y.name,s),(A,u)=>{m||(y.setTexture(u),--h===0&&(this.success(e,t,a),r(a)))},(A,u)=>{if(!m){const g=`Couldn't load texture ${t} page image: ${A}`;this.error(n,t,g),l(g)}m=!0})}catch(a){const h=`Couldn't parse texture atlas ${t}: ${a.message}`;this.error(n,t,h),l(h)}},(c,a)=>{const h=`Couldn't load texture atlas ${t}: status ${c}, ${a}`;this.error(n,t,h),l(h)})}))}loadTextureAtlasButNoTextures(t,e=()=>{},n=()=>{}){const s=t.lastIndexOf("/"),i=s>=0?t.substring(0,s+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((o,r)=>{this.downloader.downloadText(t,l=>{try{const c=this.createTextureAtlas(l,i,t);this.success(e,t,c),o(c)}catch(c){const a=`Couldn't parse texture atlas ${t}: ${c.message}`;this.error(n,t,a),r(a)}},(l,c)=>{const a=`Couldn't load texture atlas ${t}: status ${l}, ${c}`;this.error(n,t,a),r(a)})}))}async loadBinaryAsync(t){return new Promise((e,n)=>{this.loadBinary(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadJsonAsync(t){return new Promise((e,n)=>{this.loadJson(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAsync(t){return new Promise((e,n)=>{this.loadTexture(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasAsync(t){return new Promise((e,n)=>{this.loadTextureAtlas(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasButNoTexturesAsync(t){return new Promise((e,n)=>{this.loadTextureAtlasButNoTextures(t,(s,i)=>e(i),(s,i)=>n(i))})}setCache(t){this.cache=t}get(t){return this.cache.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;const e=this.cache.assets[t];if(e)return e;const n=this.errors[t];throw Error(`Asset not found: ${t}${n?` ${n}`:""}`)}remove(t){t=this.pathPrefix+t;const e=this.cache.assets[t];return e.dispose&&e.dispose(),delete this.cache.assets[t],delete this.cache.assetsRefCount[t],delete this.cache.assetsLoaded[t],e}removeAll(){for(const t in this.cache.assets){const e=this.cache.assets[t];e.dispose&&e.dispose()}this.cache.assets={},this.cache.assetsLoaded={},this.cache.assetsRefCount={}}isLoadingComplete(){return this.toLoad===0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}disposeAsset(t){const e=this.cache.assets[t];if(e instanceof ht){e.dispose();return}this.disposeAssetInternal(t)}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}disposeAssetInternal(t){if(this.cache.assetsRefCount[t]>0&&--this.cache.assetsRefCount[t]===0)return this.remove(t)}createTextureAtlas(t,e,n,s){const i=new ht(t);i.dispose=()=>{var o;if(!(this.cache.assetsRefCount[n]<=0)){this.disposeAssetInternal(n);for(const r of i.pages)(o=r.texture)==null||o.dispose()}};for(const o of i.pages){const r=this.texturePath(e,o.name,s);this.texturePmaInfo[this.pathPrefix+r]=o.pma}return i}createTexture(t,e,n){const s=this.textureLoader(n,e),i=s.dispose.bind(s);return s.dispose=()=>{this.disposeAssetInternal(t)&&i()},s}texturePath(t,e,n){return n?n[e]:t+e}}const nt=class nt{constructor(){T(this,"assets",{});T(this,"assetsRefCount",{});T(this,"assetsLoaded",{})}static getCache(t){const e=nt.AVAILABLE_CACHES.get(t);if(e)return e;const n=new nt;return nt.AVAILABLE_CACHES.set(t,n),n}async addAsset(t,e){return this.assetsLoaded[t]=Promise.resolve(e),this.assets[t]=e,e}getAsset(t){return this.assetsLoaded[t]}};T(nt,"AVAILABLE_CACHES",new Map);let lt=nt;class bt{constructor(){T(this,"callbacks",{});T(this,"rawDataUris",{})}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return e!==-1?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){var e=window.atob(t),n=e.length,s=new Uint8Array(n);for(let i=0;i{this.finish(t,i.status,i.responseText)};i.onload=o,i.onerror=o,i.send()}downloadJson(t,e,n){this.downloadText(t,s=>{e(JSON.parse(s))},n)}downloadBinary(t,e,n){if(this.start(t,e,n))return;const s=this.rawDataUris[t];if(s&&!s.includes(".")){try{this.finish(t,200,this.dataUriToUint8Array(s))}catch(r){this.finish(t,400,JSON.stringify(r))}return}const i=new XMLHttpRequest;i.open("GET",s||t,!0),i.responseType="arraybuffer";const o=()=>{this.finish(t,i.status,i.response)};i.onload=()=>{i.status===200||i.status===0?this.finish(t,200,new Uint8Array(i.response)):o()},i.onerror=o,i.send()}start(t,e,n){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,n)}}finish(t,e,n){const s=this.callbacks[t];if(delete this.callbacks[t],e===200||e===0)for(let i=0,o=s.length;iD.newFloatArray(16)))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");const n=this.boundingBoxes,s=this.polygons,i=this.polygonPool,o=t.slots,r=o.length;n.length=0,i.freeAll(s),s.length=0;for(let l=0;l=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,n,s){const i=this.minX,o=this.minY,r=this.maxX,l=this.maxY;if(t<=i&&n<=i||e<=o&&s<=o||t>=r&&n>=r||e>=l&&s>=l)return!1;const c=(s-e)/(n-t);let a=c*(i-t)+e;if(a>o&&ao&&ai&&hi&&ht.minX&&this.minYt.minY}containsPoint(t,e){const n=this.polygons;for(let s=0,i=n.length;s=n||a=n){const h=s[l];h+(n-c)/(a-c)*(s[o]-h)=h&&f<=A||f>=A&&f<=h)&&(f>=e&&f<=s||f>=s&&f<=e)){const x=(a*L-c*g)/C;if((x>=m&&x<=u||x>=u&&x<=m)&&(x>=n&&x<=i||x>=i&&x<=n))return!0}h=A,m=u}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");const e=this.boundingBoxes.indexOf(t);return e===-1?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}}class z{constructor(){T(this,"convexPolygons",[]);T(this,"convexPolygonsIndices",[]);T(this,"indicesArray",[]);T(this,"isConcaveArray",[]);T(this,"triangles",[]);T(this,"polygonPool",new at(()=>[]));T(this,"polygonIndicesPool",new at(()=>[]))}triangulate(t){const e=t;let n=t.length>>1;const s=this.indicesArray;s.length=0;for(let r=0;r3;){let r=n-1,l=0,c=1;for(;;){t:if(!i[l]){const m=s[r]<<1,y=s[l]<<1,A=s[c]<<1,u=e[m],g=e[m+1],b=e[y],L=e[y+1],C=e[A],f=e[A+1];for(let x=c+10);r=l>0?l-1:n-1,c=l+10?l-1:n-1,h=l0&&(s.push(r),i.push(o),r=this.polygonPool.obtain(),o=this.polygonIndicesPool.obtain()),r.length=0,r.push(u,g,b,L),r.push(C,f),o.length=0,o.push(m,y,A),c=z.winding(u,g,b,L,C,f),l=m}r.length>0&&(s.push(r),i.push(o));for(let a=0,h=s.length;a=0;a--)r=s[a],r.length===0?(s.splice(a,1),this.polygonPool.free(r),o=i[a],i.splice(a,1),this.polygonIndicesPool.free(o)):r.push(r[0],r[1]);return s}static isConcave(t,e,n,s){const i=s[t>0?t-1:e-1]<<1,o=s[t]<<1,r=s[t+1=0}static winding(t,e,n,s,i,o){return t*(o-s)+n*(e-o)+i*(s-e)>=0?1:-1}}class wt{constructor(){T(this,"triangulator",null);T(this,"clippingPolygon",[]);T(this,"clippingPolygons",[]);T(this,"clipOutput",[]);T(this,"clippedVertices",[]);T(this,"clippedUVs",[]);T(this,"clippedTriangles",[]);T(this,"inverseVertices",[]);T(this,"_clippedVerticesTyped",new Float32Array(1024));T(this,"_clippedUVsTyped",new Float32Array(1024));T(this,"_clippedTrianglesTyped",new Uint16Array(1024));T(this,"clippedVerticesTyped",new Float32Array(0));T(this,"clippedUVsTyped",new Float32Array(0));T(this,"clippedTrianglesTyped",new Uint16Array(0));T(this,"clippedVerticesLength",0);T(this,"clippedUVsLength",0);T(this,"clippedTrianglesLength",0);T(this,"scratch",[]);T(this,"inverse",!1);T(this,"clipAttachment",null)}clipStart(t,e,n){if(this.clipAttachment)return;const s=n.worldVerticesLength;this.clipAttachment=n,this.inverse=n.inverse;const i=D.setArraySize(this.clippingPolygon,s);n.computeWorldVertices(t,e,0,s,i,0,2);const o=this.clippingPolygon,r=this.makeClockwise(o);r||this.inverse||n.convex?(r||this.makeConvex(o),this.clippingPolygon.push(o[0],o[1]),this.clippingPolygons.push(o)):(this.triangulator===null&&(this.triangulator=new z),this.clippingPolygons.push(...this.triangulator.decompose(o,this.triangulator.triangulate(o))))}clipEnd(t){this.clipAttachment&&(t&&this.clipAttachment.endSlot!==t.data||(this.clipAttachment=null,this.clippingPolygons.length=0))}isClipping(){return this.clipAttachment!=null}clipTriangles(t,e,n,s,i,o,r,l){return s&&i&&o&&typeof r=="boolean"&&typeof l=="number"?this.clipTrianglesRender(t,e,n,s,i,o,r,l):this.clipTrianglesNoRender(t,e,n)}clipTrianglesNoRender(t,e,n){const s=this.clippedVertices;s.length=0;const i=this.clippedTriangles;i.length=0;let o=0;if(this.inverse){const h=this.clippingPolygons[0];for(let m=0;m>1,I=s.length;const R=D.setArraySize(s,I+P);D.arrayCopy(f,x,R,I,P),I=i.length;const v=D.setArraySize(i,I+3*(M-2));for(let V=1;V>1;const P=D.setArraySize(s,f+x);D.arrayCopy(a,0,P,f,x),f=i.length;const M=D.setArraySize(i,f+3*(S-2));S--;for(let I=1;I>1;let F=c.length;const N=D.setArraySize(c,F+G*l);for(let X=0;X>1;q===0&&(U=P-v,O=R-S,B=L-R,K=v-C,q=1/(U*B-O*K));const E=D.setArraySize(c,d+_*l);for(let Y=0;Y>1;let Y=this.clippedVerticesLength;const G=Y+k*o,F=this.clippedUVsLength+k*2;r.length>1;J===0&&(O=M-V,B=v-P,K=L-v,q=V-C,J=1/(O*K-B*q));const k=p+E*o;r.length=2?(a=this.clipOutput,h=this.scratch):(a=this.scratch,h=this.clipOutput);const m=r;a.length=8;const y=a;y[0]=t,y[1]=e,y[2]=n,y[3]=s,y[4]=i,y[5]=o,y[6]=t,y[7]=e,h.length=0;const A=r.length-4;for(let u=0;;u+=2){const g=m[u],b=m[u+1],L=g-m[u+2],C=b-m[u+3],f=h.length,x=a;t=x[0],e=x[1];let S=C*(g-t)-L*(b-e);for(let M=2,I=a.length-2;M<=I;M+=2){n=x[M],s=x[M+1];const R=C*(g-n)-L*(b-s);if(S>0)if(R>0)h.push(n,s);else{const v=n-t,V=s-e,w=S/(v*C-V*L);w>=0&&w<=1?(h.push(t+v*w,e+V*w),c=!0):h.push(n,s)}else if(R>0){const v=n-t,V=s-e,w=S/(v*C-V*L);w>=0&&w<=1?(h.push(t+v*w,e+V*w,n,s),c=!0):h.push(n,s)}else c=!0;t=n,e=s,S=R}if(f===h.length)return l.length=0,!0;if(h.push(h[0],h[1]),u===A)break;const P=h;h=a,h.length=0,a=P}if(l!==h){l.length=0;for(let u=0,g=h.length-2;u=2?(c=this.clipOutput,a=this.scratch):(c=this.scratch,a=this.clipOutput),c.length=8;let h=r,m=c;m[0]=t,m[1]=e,m[2]=n,m[3]=s,m[4]=i,m[5]=o,m[6]=t,m[7]=e,a.length=0;for(let y=0;;y+=2){const A=h[y],u=h[y+1],g=A-h[y+2],b=u-h[y+3],L=a.length,C=this.inverseVertices.length;this.inverseVertices.push(0),m=c,t=m[0],e=m[1];let f=b*(A-t)-g*(u-e);for(let P=2,M=c.length-2;P<=M;P+=2){n=m[P],s=m[P+1];const I=b*(A-n)-g*(u-s);if(f>0)if(I>0)a.push(n,s);else{const R=n-t,v=s-e,V=f/(R*b-v*g);if(V>=0&&V<=1){const w=t+R*V,U=e+v*V;a.push(w,U),this.inverseVertices.push(w,U,n,s)}else a.push(n,s)}else if(I>0){const R=n-t,v=s-e,V=f/(R*b-v*g);if(V>=0&&V<=1){const w=t+R*V,U=e+v*V;this.inverseVertices.push(w,U),a.push(w,U,n,s)}else a.push(n,s)}else this.inverseVertices.push(n,s);t=n,e=s,f=I}const x=this.inverseVertices.length-C-1;if(x>=6?this.inverseVertices[C]=x:this.inverseVertices.length=C,L===a.length||(a.push(a[0],a[1]),y===l))break;const S=a;a=c,a.length=0,c=S}}makeClockwise(t){const e=t,n=t.length;let s=!0,i=!0,o=0,r=e[n-2],l=e[n-1],c=e[0],a=e[1];for(let m=2;m=0,r=c,l=a,c=y,a=A}o+=c*e[1]-e[0]*a;const h=(c-r)*(e[1]-a)-(a-l)*(e[0]-c);if(i=i&&h<=0,s=s&&h>=0,o>=0){for(let m=0,y=n-2,A=n>>1;m=0&&(s[a]>l||s[a]===l&&s[a+1]>c);a-=2)s[a+2]=s[a],s[a+3]=s[a+1];s[a+2]=l,s[a+3]=c}n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3];let i=4;for(let r=4;r=0&&(i-=2,i!==2););n[i]=l,n[i+1]=c}n[i]=s[e-4],n[i+1]=s[e-3];const o=i;i+=2;for(let r=e-6;r>=0;r-=2,i+=2){const l=s[r],c=s[r+1];for(;(n[i-2]-n[i-4])*(c-n[i-3])-(n[i-1]-n[i-3])*(l-n[i-4])>=0&&(i-=2,i!==o););n[i]=l,n[i+1]=c}t.length=i-2}}class St{constructor(t,e,n={}){T(this,"skeleton");T(this,"adapter");T(this,"positionInheritanceFactorX",0);T(this,"positionInheritanceFactorY",0);T(this,"rotationInheritanceFactor",0);T(this,"hasLastTransform",!1);T(this,"lastX",0);T(this,"lastY",0);T(this,"lastZ",0);T(this,"lastRotation",0);T(this,"currentTransform",{x:0,y:0,z:0,rotation:0});T(this,"currentPosition",{x:0,y:0,z:0});T(this,"lastPosition",{x:0,y:0,z:0});this.skeleton=t,this.adapter=e,this.positionInheritanceFactorX=n.positionInheritanceX??0,this.positionInheritanceFactorY=n.positionInheritanceY??0,this.rotationInheritanceFactor=n.rotationInheritance??0}get positionInheritanceX(){return this.positionInheritanceFactorX}get positionInheritanceY(){return this.positionInheritanceFactorY}setPositionInheritance(t,e){const n=this.positionInheritanceFactorX===0&&this.positionInheritanceFactorY===0,s=t!==0||e!==0;this.positionInheritanceFactorX=t,this.positionInheritanceFactorY=e,n&&s&&this.resetPosition()}get rotationInheritance(){return this.rotationInheritanceFactor}set rotationInheritance(t){const e=this.rotationInheritanceFactor===0;this.rotationInheritanceFactor=t,e&&t!==0&&this.resetRotation()}resetPosition(){const t=this.currentTransform,e=!this.hasLastTransform&&this.rotationInheritanceFactor!==0;this.adapter.readTransform(t,e),this.lastX=t.x,this.lastY=t.y,this.lastZ=t.z,e&&(this.lastRotation=t.rotation),this.hasLastTransform=!0}resetRotation(){const t=this.currentTransform;this.adapter.readTransform(t,!0),this.lastRotation=t.rotation,this.hasLastTransform||(this.lastX=t.x,this.lastY=t.y,this.lastZ=t.z),this.hasLastTransform=!0}resetTransform(){const t=this.currentTransform;this.adapter.readTransform(t,!0),this.setLastTransform(t.x,t.y,t.z,t.rotation)}applyTransformMovement(){const t=this.positionInheritanceFactorX!==0||this.positionInheritanceFactorY!==0,e=this.rotationInheritanceFactor!==0;if(!t&&!e)return;const n=this.currentTransform;this.adapter.readTransform(n,e);const{x:s,y:i,z:o}=n,r=e?n.rotation:this.lastRotation,l=s!==this.lastX||i!==this.lastY||o!==this.lastZ;if(this.hasLastTransform){if(!l&&r===this.lastRotation)return;t&&l&&this.applyPositionMovement(s,i,o),e&&r!==this.lastRotation&&this.applyRotationMovement(r)}this.setLastTransform(s,i,o,r)}applyPositionMovement(t,e,n){const s=this.currentPosition;s.x=t,s.y=e,s.z=n,this.adapter.worldToSkeleton(s);const i=this.lastPosition;i.x=this.lastX,i.y=this.lastY,i.z=this.lastZ,this.adapter.worldToSkeleton(i),this.skeleton.physicsTranslate((s.x-i.x)*this.positionInheritanceFactorX,(s.y-i.y)*this.positionInheritanceFactorY)}applyRotationMovement(t){const e=this.rotationInheritanceFactor;e!==0&&this.skeleton.physicsRotate(0,0,this.getRotationDelta(t,this.lastRotation)*e)}setLastTransform(t,e,n,s){this.lastX=t,this.lastY=e,this.lastZ=n,this.lastRotation=s,this.hasLastTransform=!0}getRotationDelta(t,e){let n=t-e;return n=(n+180)%360-180,n<-180?n+360:n}}class Mt{constructor(){T(this,"commandPool",new xt);T(this,"worldVertices",new Float32Array(12*1024));T(this,"quadIndices",new Uint16Array([0,1,2,2,3,0]));T(this,"clipping",new wt);T(this,"renderCommands",[])}render(t,e=!1,n,s=2,i=0){var c,a;this.commandPool.reset(),this.renderCommands.length=0;const o=this.clipping;let r=0;const l=t.drawOrder.appliedPose;for(let h=0,m=l.length;h>1;const w=u.sequence,U=w.resolveIndex(A);f=w.getUVs(U),x=u.triangles,S=x.length,M=(a=w.regions[U])==null?void 0:a.texture}else if(u instanceof rt){o.clipEnd(y),o.clipStart(t,y,u);continue}else{o.clipEnd(y);continue}if(!M){o.clipEnd(y);continue}const I=t.color;let R,v;if(e){let w;if(n){w=Math.floor(n[3]*I.a*g.a*P.a*255);const U=Math.floor(w*n[0]*I.r*g.r*P.r),O=Math.floor(w*n[1]*I.g*g.g*P.g),B=Math.floor(w*n[2]*I.b*g.b*P.b);R=w<<24|U<<16|O<<8|B}else{w=Math.floor(I.a*g.a*P.a*255);const U=Math.floor(w*I.r*g.r*P.r),O=Math.floor(w*I.g*g.g*P.g),B=Math.floor(w*I.b*g.b*P.b);R=w<<24|U<<16|O<<8|B}if(v=4278190080,A.darkColor){const{r:U,g:O,b:B}=A.darkColor;v=4278190080|Math.floor(U*w)<<16|Math.floor(O*w)<<8|Math.floor(B*w)}}else{if(n){const w=Math.floor(n[3]*I.a*g.a*P.a*255),U=Math.floor(n[0]*I.r*g.r*P.r*255),O=Math.floor(n[1]*I.g*g.g*P.g*255),B=Math.floor(n[2]*I.b*g.b*P.b*255);R=w<<24|U<<16|O<<8|B}else{const w=Math.floor(I.a*g.a*P.a*255),U=Math.floor(I.r*g.r*P.r*255),O=Math.floor(I.g*g.g*P.g*255),B=Math.floor(I.b*g.b*P.b*255);R=w<<24|U<<16|O<<8|B}if(v=0,A.darkColor){const{r:w,g:U,b:O}=A.darkColor;v=Math.floor(w*255)<<16|Math.floor(U*255)<<8|Math.floor(O*255)}}o.isClipping()&&(o.clipTrianglesUnpacked(L,0,x,S,f,s),L=o.clippedVerticesTyped,C=o.clippedVerticesLength/s,f=o.clippedUVsTyped,x=o.clippedTrianglesTyped,S=o.clippedTrianglesLength);const V=this.commandPool.getCommand(C,S,s);if(V.blendMode=y.data.blendMode,V.texture=M,V.positions.set(L.subarray(0,C*s)),s>=3)for(let w=2,U=C*s;w=t*n&&i._indices.length>=e){s=i;break}if(s)this.pool.splice(this.pool.indexOf(s),1),s.next=void 0,s.numVertices=t,s.numIndices=e,s.positions=s._positions.subarray(0,t*n),s.uvs=s._uvs.subarray(0,t<<1),s.colors=s._colors.subarray(0,t),s.darkColors=s._darkColors.subarray(0,t),s.indices=s._indices.subarray(0,e);else{const i=new Float32Array(t*n),o=new Float32Array(t<<1),r=new Uint32Array(t),l=new Uint32Array(t),c=new Uint16Array(e);s={positions:i,uvs:o,colors:r,darkColors:l,indices:c,_positions:i,_uvs:o,_colors:r,_darkColors:l,_indices:c,numVertices:t,numIndices:e,blendMode:Tt.Normal,texture:null}}return this.inUse.push(s),s}reset(){this.pool.push(...this.inUse),this.inUse.length=0}}export{Rt as ATTACH_RETAIN,Yt as ATTACH_SETUP,Ft as AlphaTimeline,Et as Animation,_t as AnimationState,Ot as AnimationStateAdapter,It as AnimationStateData,lt as AssetCache,Ct as AssetManagerBase,Vt as AtlasAttachmentLoader,kt as Attachment,Xt as AttachmentTimeline,Bt as BinaryInput,Tt as BlendMode,Nt as Bone,Dt as BoneData,$t as BonePose,zt as BoneTimeline1,Wt as BoneTimeline2,ut as BoundingBoxAttachment,qt as CURRENT,rt as ClippingAttachment,Gt as Color,Jt as Constraint,Ht as ConstraintData,Zt as ConstraintTimeline1,Kt as CurveTimeline,Qt as CurveTimeline1,jt as DebugUtils,te as DeformTimeline,bt as Downloader,ee as DrawOrder,se as DrawOrderFolderTimeline,ne as DrawOrderTimeline,ie as Event,oe as EventData,re as EventQueue,ae as EventTimeline,le as EventType,ce as FIRST,he as FakeTexture,pe as FromProperty,de as FromRotate,ue as FromScaleX,fe as FromScaleY,ge as FromShearY,me as FromX,ye as FromY,Te as HOLD,be as IkConstraint,we as IkConstraintData,xe as IkConstraintPose,Ae as IkConstraintTimeline,Pe as Inherit,Ie as InheritTimeline,Ce as IntSet,Ve as Interpolation,Le as MODE,Se as MathUtils,dt as MeshAttachment,Me as MixFrom,mt as PathAttachment,ve as PathConstraint,Ue as PathConstraintData,Re as PathConstraintMixTimeline,Ye as PathConstraintPose,Fe as PathConstraintPositionTimeline,Ee as PathConstraintSpacingTimeline,_e as Physics,Oe as PhysicsConstraint,ke as PhysicsConstraintDampingTimeline,Xe as PhysicsConstraintData,Be as PhysicsConstraintGravityTimeline,Ne as PhysicsConstraintInertiaTimeline,De as PhysicsConstraintMassTimeline,$e as PhysicsConstraintMixTimeline,ze as PhysicsConstraintPose,We as PhysicsConstraintResetTimeline,qe as PhysicsConstraintStrengthTimeline,Ge as PhysicsConstraintTimeline,Je as PhysicsConstraintWindTimeline,yt as PointAttachment,at as Pool,He as Posed,Ze as PosedActive,Ke as PosedData,Qe as PositionMode,je as Pow,ts as PowOut,es as Property,ss as RGB2Timeline,ns as RGBA2Timeline,is as RGBATimeline,os as RGBTimeline,pt as RegionAttachment,rs as RotateMode,as as RotateTimeline,ls as SETUP,cs as ScaleTimeline,hs as ScaleXTimeline,ps as ScaleYMode,ds as ScaleYTimeline,us as Sequence,fs as SequenceMode,gs as SequenceModeValues,ms as SequenceTimeline,ys as ShearTimeline,Ts as ShearXTimeline,bs as ShearYTimeline,ws as Skeleton,xs as SkeletonBinary,Lt as SkeletonBounds,wt as SkeletonClipping,As as SkeletonData,Ps as SkeletonJson,St as SkeletonPhysicsMovement,Mt as SkeletonRendererCore,Is as Skin,Cs as SkinEntry,Vs as Slider,Ls as SliderData,Ss as SliderMixTimeline,Ms as SliderPose,vs as SliderTimeline,Us as Slot,Rs as SlotCurveTimeline,Ys as SlotData,Fs as SlotPose,Es as SpacingMode,_s as StringSet,Os as Texture,ht as TextureAtlas,ks as TextureAtlasPage,Xs as TextureAtlasRegion,Bs as TextureFilter,Ns as TextureRegion,Ds as TextureWrap,$s as TimeKeeper,zs as Timeline,Ws as ToProperty,qs as ToRotate,Gs as ToScaleX,Js as ToScaleY,Hs as ToShearY,Zs as ToX,Ks as ToY,Qs as TrackEntry,js as TransformConstraint,tn as TransformConstraintData,en as TransformConstraintPose,sn as TransformConstraintTimeline,nn as TranslateTimeline,on as TranslateXTimeline,rn as TranslateYTimeline,z as Triangulator,D as Utils,an as Vector2,ln as VertexAttachment,cn as WindowedMean,hn as isBoneTimeline,pn as isConstraintTimeline,dn as isSlotTimeline}; diff --git a/dist/assets/index-De2_H8wT.js b/dist/assets/index-D13mN481.js similarity index 99% rename from dist/assets/index-De2_H8wT.js rename to dist/assets/index-D13mN481.js index 502466b..cb6d0db 100644 --- a/dist/assets/index-De2_H8wT.js +++ b/dist/assets/index-D13mN481.js @@ -1,4 +1,4 @@ -var Ae=Object.defineProperty;var Be=(m,o,e)=>o in m?Ae(m,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[o]=e;var a=(m,o,e)=>Be(m,typeof o!="symbol"?o+"":o,e);import{T as Fe,a as he,b as F,S as ue,M as pe,c as oe,W as ne,B as H,d as z,L as Te,E as O,e as ce,p as q,f as Ee,g as fe,A as Q,h as me,i as De,j as V,s as re,G as we,k as $,l as Y,m as Le,P as Ie,n as Re,o as Ne,C as X,q as be,r as _e,t as Ue,u as Ye,v as Xe,w as ee,x as j,y as ke,z as Ve,D as J,F as ge,V as Ge,H as ae,I as We,J as $e,U as xe,K as E,R as ve,N as ye,O as Pe,Q as Oe,X as He,Y as ze,Z as qe,_ as Ke}from"./index-CyjCNKhS.js";import{$ as bt,a0 as kt,a1 as vt,a2 as yt,a3 as Pt,a4 as St,a5 as Mt,a6 as At,a7 as Bt,a8 as Ft,a9 as Et,aa as Dt,ab as Lt,ac as It,ad as Rt,ae as Nt,af as _t,ag as Ut,ah as Yt,ai as Xt,aj as Vt,ak as Gt,al as Wt,am as $t,an as Ot,ao as Ht,ap as zt,aq as qt,ar as Kt,as as Zt,at as Jt,au as Qt,av as jt,aw as es,ax as ts,ay as ss,az as os,aA as ns,aB as as,aC as rs,aD as is,aE as ls,aF as hs,aG as cs,aH as ds,aI as us,aJ as ps,aK as fs,aL as ms,aM as gs,aN as xs,aO as Cs,aP as Ts,aQ as ws,aR as bs,aS as ks,aT as vs,aU as ys,aV as Ps,aW as Ss,aX as Ms,aY as As,aZ as Bs,a_ as Fs,a$ as Es,b0 as Ds,b1 as Ls,b2 as Is,b3 as Rs,b4 as Ns,b5 as _s,b6 as Us,b7 as Ys,b8 as Xs,b9 as Vs,ba as Gs,bb as Ws,bc as $s,bd as Os,be as Hs,bf as zs,bg as qs,bh as Ks,bi as Zs,bj as Js,bk as Qs,bl as js,bm as eo,bn as to,bo as so,bp as oo,bq as no,br as ao,bs as ro,bt as io,bu as lo,bv as ho,bw as co,bx as uo,by as po,bz as fo,bA as mo,bB as go,bC as xo,bD as Co,bE as To,bF as wo,bG as bo,bH as ko,bI as vo,bJ as yo,bK as Po,bL as So,bM as Mo,bN as Ao,bO as Bo,bP as Fo,bQ as Eo,bR as Do,bS as Lo,bT as Io,bU as Ro,bV as No,bW as _o,bX as Uo,bY as Yo,bZ as Xo,b_ as Vo,b$ as Go,c0 as Wo,c1 as $o,c2 as Oo,c3 as Ho}from"./index-CyjCNKhS.js";import{SkeletonClipping as de,SkeletonPhysicsMovement as Ze,AnimationStateData as Je,AtlasAttachmentLoader as Qe,SkeletonBounds as je}from"./index-Btg_SCRJ.js";import{AssetCache as qo,AssetManagerBase as Ko,Downloader as Zo,SkeletonRendererCore as Jo,Triangulator as Qo}from"./index-Btg_SCRJ.js";if(typeof window<"u"&&window.PIXI){const m=window.require;window.require=o=>{if(m)return m(o);if(o.startsWith("@pixi/"))return window.PIXI}}const _=class _ extends Fe{constructor(e){super(e.resource.source);a(this,"texture");this.texture=he.from(e)}static from(e){return _.textureMap.has(e)?_.textureMap.get(e):new _(e)}setFilters(e,t){this.texture.baseTexture.scaleMode=_.toPixiTextureFilter(e),this.texture.baseTexture.mipmap=_.toPixiMipMap(e)}setWraps(e,t){this.texture.baseTexture.wrapMode=_.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiTextureFilter(e){switch(e){case F.Nearest:case F.MipMapNearestLinear:case F.MipMapNearestNearest:return ue.NEAREST;case F.Linear:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return ue.LINEAR;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiMipMap(e){switch(e){case F.Nearest:case F.Linear:return pe.OFF;case F.MipMapNearestLinear:case F.MipMapNearestNearest:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return pe.ON;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case oe.ClampToEdge:return ne.CLAMP;case oe.MirroredRepeat:return ne.MIRRORED_REPEAT;case oe.Repeat:return ne.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case H.Normal:return z.NORMAL;case H.Additive:return z.ADD;case H.Multiply:return z.MULTIPLY;case H.Screen:return z.SCREEN;default:throw new Error(`Unknown blendMode: ${String(e)}`)}}};a(_,"textureMap",new Map);let G=_;const K="spineTextureAtlasLoader",et={extension:O.Asset,resolver:{test:m=>V(m,".atlas"),parse:m=>{var e,t;const o=m.split(".");return{resolution:parseFloat(((t=(e=re.RETINA_PREFIX)==null?void 0:e.exec(m))==null?void 0:t[1])??"1"),format:o[o.length-2],src:m}}},loader:{name:K,extension:{type:O.LoadParser,priority:Te.Normal,name:K},test(m){return V(m,".atlas")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${K}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return await o.text()},testParse(m,o){const e=V(o.src,".atlas"),t=typeof m=="string",s=o.loadParser===K;return Promise.resolve((e||s)&&t)},unload(m){m.dispose()},async parse(m,o,e){var p;const t=o.data||{};let s=q.dirname(o.src);s&&s.lastIndexOf("/")!==s.length-1&&(s+="/");const n=new Ee(m);if(t.images instanceof fe||typeof t.images=="string"){const h=t.images;t.images={},t.images[n.pages[0].name]=h}const r=[];let l=!0;for(const h of e.parsers)if(h.name==="loadTextures"){l=(p=h.config)==null?void 0:p.preferCreateImageBitmap;break}Q.setPreferences({preferCreateImageBitmap:!1});for(const h of n.pages){const u=h.name,c=t!=null&&t.images?t.images[u]:void 0;if(c instanceof fe)h.setTexture(G.from(c));else{const i=c??q.normalize([...s.split(q.sep),u].join(q.sep)),g={src:De(i,o.src),data:{...t.imageMetadata,alphaMode:h.pma?me.PMA:me.UNPACK}},x=e.load(g).then(d=>{h.setTexture(G.from(d.baseTexture))});r.push(x)}}return await Promise.all(r),Q.setPreferences({preferCreateImageBitmap:l}),n}}};ce.add(et);const Z="spineSkeletonLoader";function tt(m){return m.hasOwnProperty("bones")}function st(m){return m instanceof Uint8Array}const ot={extension:O.Asset,loader:{name:Z,extension:{type:O.LoadParser,priority:Te.Normal,name:Z},test(m){return V(m,".skel")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${Z}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return new Uint8Array(await o.arrayBuffer())},testParse(m,o){const e=V(o.src,".json")&&tt(m),t=V(o.src,".skel")&&st(m),s=o.loadParser===Z;return Promise.resolve(e||t||s)}}};ce.add(ot);class nt extends we{constructor(o=!1){super();const e=new $(void 0),t=new $(void 0,!0),s=new $(void 0,!0,!0);this.addAttribute("aVertexPosition",e,2,!1,Y.FLOAT),this.addAttribute("aTextureCoord",t,2,!1,Y.FLOAT),this.addIndex(s)}}const at=` +var Ae=Object.defineProperty;var Be=(m,o,e)=>o in m?Ae(m,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[o]=e;var a=(m,o,e)=>Be(m,typeof o!="symbol"?o+"":o,e);import{T as Fe,a as he,b as F,S as ue,M as pe,c as oe,W as ne,B as H,d as z,L as Te,E as O,e as ce,p as q,f as Ee,g as fe,A as Q,h as me,i as De,j as V,s as re,G as we,k as $,l as Y,m as Le,P as Ie,n as Re,o as Ne,C as X,q as be,r as _e,t as Ue,u as Ye,v as Xe,w as ee,x as j,y as ke,z as Ve,D as J,F as ge,V as Ge,H as ae,I as We,J as $e,U as xe,K as E,R as ve,N as ye,O as Pe,Q as Oe,X as He,Y as ze,Z as qe,_ as Ke}from"./index-9ofazf7F.js";import{$ as bt,a0 as kt,a1 as vt,a2 as yt,a3 as Pt,a4 as St,a5 as Mt,a6 as At,a7 as Bt,a8 as Ft,a9 as Et,aa as Dt,ab as Lt,ac as It,ad as Rt,ae as Nt,af as _t,ag as Ut,ah as Yt,ai as Xt,aj as Vt,ak as Gt,al as Wt,am as $t,an as Ot,ao as Ht,ap as zt,aq as qt,ar as Kt,as as Zt,at as Jt,au as Qt,av as jt,aw as es,ax as ts,ay as ss,az as os,aA as ns,aB as as,aC as rs,aD as is,aE as ls,aF as hs,aG as cs,aH as ds,aI as us,aJ as ps,aK as fs,aL as ms,aM as gs,aN as xs,aO as Cs,aP as Ts,aQ as ws,aR as bs,aS as ks,aT as vs,aU as ys,aV as Ps,aW as Ss,aX as Ms,aY as As,aZ as Bs,a_ as Fs,a$ as Es,b0 as Ds,b1 as Ls,b2 as Is,b3 as Rs,b4 as Ns,b5 as _s,b6 as Us,b7 as Ys,b8 as Xs,b9 as Vs,ba as Gs,bb as Ws,bc as $s,bd as Os,be as Hs,bf as zs,bg as qs,bh as Ks,bi as Zs,bj as Js,bk as Qs,bl as js,bm as eo,bn as to,bo as so,bp as oo,bq as no,br as ao,bs as ro,bt as io,bu as lo,bv as ho,bw as co,bx as uo,by as po,bz as fo,bA as mo,bB as go,bC as xo,bD as Co,bE as To,bF as wo,bG as bo,bH as ko,bI as vo,bJ as yo,bK as Po,bL as So,bM as Mo,bN as Ao,bO as Bo,bP as Fo,bQ as Eo,bR as Do,bS as Lo,bT as Io,bU as Ro,bV as No,bW as _o,bX as Uo,bY as Yo,bZ as Xo,b_ as Vo,b$ as Go,c0 as Wo,c1 as $o,c2 as Oo,c3 as Ho}from"./index-9ofazf7F.js";import{SkeletonClipping as de,SkeletonPhysicsMovement as Ze,AnimationStateData as Je,AtlasAttachmentLoader as Qe,SkeletonBounds as je}from"./index-Cz2cACyM.js";import{AssetCache as qo,AssetManagerBase as Ko,Downloader as Zo,SkeletonRendererCore as Jo,Triangulator as Qo}from"./index-Cz2cACyM.js";if(typeof window<"u"&&window.PIXI){const m=window.require;window.require=o=>{if(m)return m(o);if(o.startsWith("@pixi/"))return window.PIXI}}const _=class _ extends Fe{constructor(e){super(e.resource.source);a(this,"texture");this.texture=he.from(e)}static from(e){return _.textureMap.has(e)?_.textureMap.get(e):new _(e)}setFilters(e,t){this.texture.baseTexture.scaleMode=_.toPixiTextureFilter(e),this.texture.baseTexture.mipmap=_.toPixiMipMap(e)}setWraps(e,t){this.texture.baseTexture.wrapMode=_.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiTextureFilter(e){switch(e){case F.Nearest:case F.MipMapNearestLinear:case F.MipMapNearestNearest:return ue.NEAREST;case F.Linear:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return ue.LINEAR;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiMipMap(e){switch(e){case F.Nearest:case F.Linear:return pe.OFF;case F.MipMapNearestLinear:case F.MipMapNearestNearest:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return pe.ON;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case oe.ClampToEdge:return ne.CLAMP;case oe.MirroredRepeat:return ne.MIRRORED_REPEAT;case oe.Repeat:return ne.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case H.Normal:return z.NORMAL;case H.Additive:return z.ADD;case H.Multiply:return z.MULTIPLY;case H.Screen:return z.SCREEN;default:throw new Error(`Unknown blendMode: ${String(e)}`)}}};a(_,"textureMap",new Map);let G=_;const K="spineTextureAtlasLoader",et={extension:O.Asset,resolver:{test:m=>V(m,".atlas"),parse:m=>{var e,t;const o=m.split(".");return{resolution:parseFloat(((t=(e=re.RETINA_PREFIX)==null?void 0:e.exec(m))==null?void 0:t[1])??"1"),format:o[o.length-2],src:m}}},loader:{name:K,extension:{type:O.LoadParser,priority:Te.Normal,name:K},test(m){return V(m,".atlas")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${K}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return await o.text()},testParse(m,o){const e=V(o.src,".atlas"),t=typeof m=="string",s=o.loadParser===K;return Promise.resolve((e||s)&&t)},unload(m){m.dispose()},async parse(m,o,e){var p;const t=o.data||{};let s=q.dirname(o.src);s&&s.lastIndexOf("/")!==s.length-1&&(s+="/");const n=new Ee(m);if(t.images instanceof fe||typeof t.images=="string"){const h=t.images;t.images={},t.images[n.pages[0].name]=h}const r=[];let l=!0;for(const h of e.parsers)if(h.name==="loadTextures"){l=(p=h.config)==null?void 0:p.preferCreateImageBitmap;break}Q.setPreferences({preferCreateImageBitmap:!1});for(const h of n.pages){const u=h.name,c=t!=null&&t.images?t.images[u]:void 0;if(c instanceof fe)h.setTexture(G.from(c));else{const i=c??q.normalize([...s.split(q.sep),u].join(q.sep)),g={src:De(i,o.src),data:{...t.imageMetadata,alphaMode:h.pma?me.PMA:me.UNPACK}},x=e.load(g).then(d=>{h.setTexture(G.from(d.baseTexture))});r.push(x)}}return await Promise.all(r),Q.setPreferences({preferCreateImageBitmap:l}),n}}};ce.add(et);const Z="spineSkeletonLoader";function tt(m){return m.hasOwnProperty("bones")}function st(m){return m instanceof Uint8Array}const ot={extension:O.Asset,loader:{name:Z,extension:{type:O.LoadParser,priority:Te.Normal,name:Z},test(m){return V(m,".skel")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${Z}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return new Uint8Array(await o.arrayBuffer())},testParse(m,o){const e=V(o.src,".json")&&tt(m),t=V(o.src,".skel")&&st(m),s=o.loadParser===Z;return Promise.resolve(e||t||s)}}};ce.add(ot);class nt extends we{constructor(o=!1){super();const e=new $(void 0),t=new $(void 0,!0),s=new $(void 0,!0,!0);this.addAttribute("aVertexPosition",e,2,!1,Y.FLOAT),this.addAttribute("aTextureCoord",t,2,!1,Y.FLOAT),this.addIndex(s)}}const at=` attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; diff --git a/dist/assets/index-DCezqRpu.css b/dist/assets/index-DCezqRpu.css new file mode 100644 index 0000000..25be67d --- /dev/null +++ b/dist/assets/index-DCezqRpu.css @@ -0,0 +1 @@ +.help-overlay[data-v-78204b9d]{position:absolute;top:0;right:0;bottom:0;left:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:72px 24px 28px;box-sizing:border-box;background:#05080fb8;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.help-dialog[data-v-78204b9d]{width:min(820px,100%);max-height:100%;display:flex;flex-direction:column;overflow:hidden;border:1px solid #3a4864;border-radius:14px;background:#141a27;color:#b8c3d8;box-shadow:0 22px 70px #0000009e}.help-head[data-v-78204b9d]{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:18px 20px 15px;border-bottom:1px solid #2b354a;background:linear-gradient(135deg,#202942,#181e2d)}.help-head h2[data-v-78204b9d]{margin:0;color:#eef2ff;font-size:19px}.help-head p[data-v-78204b9d]{margin:5px 0 0;color:#7786a3;font-size:11px}.help-close[data-v-78204b9d]{width:28px;height:28px;flex:0 0 28px;border:1px solid #43516b;border-radius:6px;background:#273249;color:#ccd7ed;cursor:pointer}.help-close[data-v-78204b9d]:hover{border-color:#7774ff;background:#3b4670;color:#fff}.help-body[data-v-78204b9d]{min-height:0;overflow:auto;padding:18px 20px 21px}.help-section[data-v-78204b9d]{padding:14px 15px;border:1px solid #2c3850;border-radius:10px;background:#181f2e}.help-section h3[data-v-78204b9d]{margin:0 0 11px;color:#9fb2ff;font-size:13px}.help-start ol[data-v-78204b9d]{margin:0;padding-left:21px;color:#aab6cc;font-size:12px;line-height:1.75}.help-start li[data-v-78204b9d]::marker{color:#7774ff;font-weight:700}.help-section b[data-v-78204b9d]{color:#dce4f7}.help-grid[data-v-78204b9d]{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(250px,.85fr);gap:12px;margin-top:12px}.help-list[data-v-78204b9d]{display:grid;gap:0;margin:0}.help-list>div[data-v-78204b9d]{display:grid;grid-template-columns:78px 1fr;gap:9px;padding:7px 0;border-bottom:1px solid #263146}.help-list>div[data-v-78204b9d]:last-child{border-bottom:0}.help-list dt[data-v-78204b9d]{color:#d3dcf0;font-size:11px;font-weight:700}.help-list dd[data-v-78204b9d]{margin:0;color:#8795ae;font-size:11px;line-height:1.5}.shortcut-list[data-v-78204b9d]{display:grid;gap:7px}.shortcut-list>div[data-v-78204b9d]{display:flex;align-items:center;min-height:25px;gap:5px}.shortcut-list kbd[data-v-78204b9d]{min-width:24px;box-sizing:border-box;padding:3px 6px;border:1px solid #465470;border-bottom-width:2px;border-radius:5px;background:#101623;color:#e0e7f6;font:10px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center}.shortcut-list span[data-v-78204b9d]{color:#65728b;font-size:10px}.shortcut-list em[data-v-78204b9d]{margin-left:auto;color:#9ca9c1;font-size:11px;font-style:normal}.help-note[data-v-78204b9d]{margin:11px 0 0;padding-top:9px;border-top:1px solid #2a3549;color:#697791;font-size:10px;line-height:1.55}.help-export[data-v-78204b9d]{margin-top:12px}.help-export p[data-v-78204b9d]{margin:0;color:#8997b0;font-size:11px;line-height:1.65}.help-doc-title[data-v-78204b9d]{margin:16px 2px 2px;color:#9fb2ff;font-size:13px;font-weight:700;letter-spacing:.5px}.help-module[data-v-78204b9d]{margin-top:12px}.help-module-head[data-v-78204b9d]{display:flex;align-items:center;gap:8px;width:100%;padding:0;border:0;background:transparent;color:#9fb2ff;font:inherit;font-size:13px;font-weight:700;text-align:left;cursor:pointer}.help-module-head[data-v-78204b9d]:hover{color:#fff}.help-module-head .mtitle[data-v-78204b9d]{flex:1;min-width:0}.help-module-head .caret[data-v-78204b9d]{flex:0 0 auto;color:#7b86a2;font-size:12px}.help-module.open .help-module-head[data-v-78204b9d]{color:#fff}.help-module.open .help-module-head .caret[data-v-78204b9d]{color:#9fb2ff}.help-module .mnum[data-v-78204b9d]{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;background:linear-gradient(135deg,#4a53b8,#6a5fd0);color:#fff;font-size:12px;font-weight:700}.help-module.help-connector[data-v-78204b9d]{border-color:#4a4f8a;background:linear-gradient(135deg,#1d2442,#181d2f)}.help-module.help-connector .help-module-head[data-v-78204b9d]{color:#b8c2ff}.help-module .connector-intro[data-v-78204b9d]{margin:0 0 10px;color:#9aa8c4;font-size:11px;line-height:1.6}.help-module .connector-intro b[data-v-78204b9d]{color:#dce4f7}.help-module .dl-link[data-v-78204b9d]{display:inline-flex;flex-direction:column;align-items:flex-start;gap:2px;margin:0 10px 6px 0;padding:6px 12px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;font-size:12px;font-weight:700;text-decoration:none}.help-module .dl-link[data-v-78204b9d]:hover{border-color:#8982ff;background:#554dc2}.help-module .dl-link small[data-v-78204b9d]{color:#cfe0ff;font-weight:500;font-size:9px}.help-module-body[data-v-78204b9d]{padding-top:10px}@media(max-width:760px){.help-overlay[data-v-78204b9d]{padding:66px 12px 14px}.help-grid[data-v-78204b9d]{grid-template-columns:1fr}}.topbar[data-v-612a51be]{position:absolute;top:10px;left:10px;right:10px;display:flex;align-items:center;gap:10px;padding:8px 12px;background:#141420d9;border-radius:10px;border:1px solid rgba(255,255,255,.08);font-size:12px;color:#aab;z-index:5;flex-wrap:wrap}.topbar input[type=range][data-v-612a51be]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px}.tool-group[data-v-612a51be]{display:flex;gap:6px;margin-left:6px;padding-left:12px;border-left:1px solid #2a2a3c}.tool-btn[data-v-612a51be]{width:30px;height:26px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center}.tool-btn[data-v-612a51be]:hover{background:#2b3a5c;color:#fff}.tool-btn.on[data-v-612a51be]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.background-menu[data-v-612a51be]{position:relative;flex:0 0 auto}.background-btn[data-v-612a51be]{height:28px;padding:0 11px;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cbd7ed;font-size:12px;cursor:pointer}.background-btn[data-v-612a51be]:hover,.background-btn.on[data-v-612a51be]{border-color:#7774ff;background:#343b63;color:#fff}.background-panel[data-v-612a51be]{position:absolute;top:calc(100% + 9px);right:0;width:248px;box-sizing:border-box;padding:10px;border:1px solid #343b50;border-radius:9px;background:#141420fa;color:#aeb8cc;box-shadow:0 8px 24px #0000007a;z-index:12}.background-upload[data-v-612a51be]{width:100%;height:30px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;cursor:pointer}.background-upload[data-v-612a51be]:hover{border-color:#8982ff;background:#554dc2}.background-clear[data-v-612a51be]{width:100%;height:28px;margin-top:6px;border:1px solid #70404a;border-radius:6px;background:#512a33;color:#efb5bd;cursor:pointer}.background-clear[data-v-612a51be]:hover:not(:disabled){border-color:#b65b6a;background:#6a303b;color:#fff}.background-clear[data-v-612a51be]:disabled{opacity:.42;cursor:not-allowed}.background-file-input[data-v-612a51be]{display:none}.background-file-name[data-v-612a51be]{margin:7px 2px 9px;overflow:hidden;color:#737f98;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.background-position-row[data-v-612a51be]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.background-position-row label[data-v-612a51be]{display:flex;align-items:center;gap:5px;color:#8995ad;font-size:11px}.background-position-row input[data-v-612a51be]{width:0;min-width:0;flex:1;box-sizing:border-box;height:28px;padding:0 6px;border:1px solid #343e55;border-radius:5px;background:#101522;color:#e1e6f2}.background-opacity-row[data-v-612a51be]{display:grid;grid-template-columns:46px 1fr 34px;align-items:center;gap:7px;margin-top:10px;font-size:11px}.background-opacity-row input[data-v-612a51be]{min-width:0;accent-color:#675de0}.background-opacity-row b[data-v-612a51be]{color:#aeb8cc;font-size:10px;text-align:right;font-variant-numeric:tabular-nums}.help-btn[data-v-612a51be]{height:28px;margin-left:auto;padding:0 11px;flex:0 0 auto;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cbd7ed;font-size:12px;font-weight:700;cursor:pointer}.help-btn[data-v-612a51be]:hover,.help-btn.on[data-v-612a51be]{border-color:#7774ff;background:#343b63;color:#fff}.zoom-pct[data-v-612a51be]{margin-left:0;font-variant-numeric:tabular-nums;color:#9aa;min-width:44px;text-align:center}.settings-btn[data-v-612a51be]{height:28px;padding:0 12px;flex:0 0 auto;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cdf;font-size:12px;font-weight:700;cursor:pointer}.settings-btn[data-v-612a51be]:hover{border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-612a51be]{width:30px;height:28px;flex:0 0 30px;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cdd8ed;font-size:18px;line-height:1;cursor:pointer}.undo-btn[data-v-612a51be]:hover:not(:disabled){border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-612a51be]:disabled{opacity:.38;cursor:not-allowed}.settings-panel[data-v-91f62c22]{position:absolute;top:52px;left:10px;width:240px;z-index:10;background:#141420f7;border:1px solid #2a2a3c;border-radius:10px;padding:10px 12px;font-size:12px;color:#aab;box-shadow:0 6px 20px #0006}.sp-head[data-v-91f62c22]{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:#cdf;margin-bottom:10px}.sp-section-title[data-v-91f62c22]{margin:2px 0 8px;color:#8a93bb;font-size:11px}.sp-switch-row[data-v-91f62c22]{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#aab}.sp-switch-control[data-v-91f62c22]{display:inline-flex;align-items:center;gap:7px}.sp-switch-control input[data-v-91f62c22]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.sp-switch-ui[data-v-91f62c22]{position:relative;width:34px;height:18px;border-radius:999px;background:#39445a;cursor:pointer;transition:background .16s ease}.sp-switch-ui[data-v-91f62c22]:after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#f4f6fb;transition:transform .16s ease}.sp-switch-control input:checked+.sp-switch-ui[data-v-91f62c22]{background:#655df0}.sp-switch-control input:checked+.sp-switch-ui[data-v-91f62c22]:after{transform:translate(16px)}.sp-switch-control input:focus-visible+.sp-switch-ui[data-v-91f62c22]{outline:2px solid #8b86ff;outline-offset:2px}.sp-switch-control b[data-v-91f62c22]{min-width:24px;color:#8a93bb;font-size:11px;font-weight:500}.sp-cache-note[data-v-91f62c22]{margin-top:10px;padding-top:9px;border-top:1px solid #2a2a3c;color:#647089;font-size:10px;text-align:center}.sp-divider[data-v-91f62c22]{height:1px;margin:10px 0;background:#2a2a3c}.sp-close[data-v-91f62c22]{background:#2e3a55;border:none;color:#cdf;border-radius:4px;width:18px;height:18px;cursor:pointer;font-size:11px}.sp-row[data-v-91f62c22]{display:flex;align-items:center;gap:8px;margin:8px 0}.sp-row>span[data-v-91f62c22]:first-child{width:76px;flex-shrink:0;color:#8a93bb}.sp-row input[type=range][data-v-91f62c22]{flex:1;background:#1a1a28;accent-color:#3a5a8c}.sp-num[data-v-91f62c22]{width:52px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;padding:2px 4px}.sp-undo-limit[data-v-91f62c22]{margin-left:auto;width:64px;height:26px;box-sizing:border-box}.sp-colr[data-v-91f62c22]{width:26px;height:22px;border:none;background:none;cursor:pointer}.sp-hex[data-v-91f62c22]{font-size:11px;color:#889;font-variant-numeric:tabular-nums}.sp-chk[data-v-91f62c22]{display:flex;align-items:center;gap:6px;margin:8px 0;color:#aab}.stage-wrap[data-v-b4c5a353]{position:relative;width:100%;height:100%;overflow:hidden}.stage-holder[data-v-b4c5a353]{width:100%;height:100%;cursor:grab;touch-action:none;background-color:#0e1219;outline:none}.stage-holder.grid[data-v-b4c5a353]{background:conic-gradient(#141a26 90deg,transparent 90deg 180deg,#141a26 180deg 270deg,#141a26 180deg 270deg,transparent 270deg);background-size:28px 28px}.stage-holder[data-v-b4c5a353]:active{cursor:grabbing}.hud[data-v-b4c5a353]{position:absolute;bottom:12px;left:12px;padding:8px 12px;background:#141420bf;border-radius:8px;font-size:12px;color:#a0a8cc}.hud-number[data-v-b4c5a353]{display:inline-block;box-sizing:border-box;text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1}.hud-system-count[data-v-b4c5a353]{width:3ch}.hud-particle-count[data-v-b4c5a353]{width:7ch;text-align:left}.hud-tip[data-v-b4c5a353]{margin-left:12px;color:#5f6a8a;font-size:11px}b[data-v-b4c5a353]{color:#fc3}.config-management-body[data-v-7ab00fa9]{padding-bottom:2px}.config-toolbar[data-v-7ab00fa9]{display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:6px;margin-bottom:10px}.config-toolbar button[data-v-7ab00fa9],.config-toolbar select[data-v-7ab00fa9]{min-width:0;height:30px;box-sizing:border-box;border:1px solid #3b4864;border-radius:6px;background:#263149;color:#d6def0;font-size:11px}.config-toolbar button[data-v-7ab00fa9]{padding:0 9px;cursor:pointer}.config-toolbar button[data-v-7ab00fa9]:hover{border-color:#7169dc;background:#343d68;color:#fff}.config-toolbar select[data-v-7ab00fa9]{padding:0 7px;overflow:hidden;text-overflow:ellipsis}.config-toolbar select[data-v-7ab00fa9]:disabled{color:#68738a;background:#1b2130}.config-message[data-v-7ab00fa9]{margin:-4px 0 9px;color:#83b9a2;font-size:10px}.config-message.error[data-v-7ab00fa9]{color:#e8959e}.group[data-v-7ab00fa9]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-7ab00fa9]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-7ab00fa9]:hover{background:#20202e}.group-body[data-v-7ab00fa9]{padding:8px 10px 12px}.caret[data-v-7ab00fa9]{display:inline-block;width:12px;color:#667;font-size:11px}.ns[data-v-45669c72]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.ns-label[data-v-45669c72]{width:60px;flex-shrink:0;color:#8a93bb}.ns-range[data-v-45669c72]{flex:1;accent-color:#3a7cd6}.ns-num[data-v-45669c72]{width:56px;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;text-align:right}.ns.disabled[data-v-45669c72]{opacity:.55}.ns.disabled .ns-range[data-v-45669c72],.ns.disabled .ns-num[data-v-45669c72]{cursor:not-allowed}.ce[data-v-3c8d1b94]{display:flex;align-items:flex-start;gap:6px;width:100%}.ce-editor[data-v-3c8d1b94]{flex:1;min-width:0}.ce-reset[data-v-3c8d1b94]{flex:0 0 auto;padding:5px 7px;border:1px solid #3b4b65;border-radius:5px;background:#242f42;color:#c4cee2;font-size:10px;cursor:pointer}.ce-reset[data-v-3c8d1b94]:hover{border-color:#7774ff;background:#4f4dc2;color:#fff}.ce-svg[data-v-3c8d1b94]{width:100%;height:110px;display:block;border:1px solid #2a2a3c;border-radius:6px;background:#10101a;cursor:crosshair;touch-action:none}.ce-grid line[data-v-3c8d1b94]{stroke:#1e1e30;stroke-width:1}.ce-frame[data-v-3c8d1b94]{stroke:#2e2e44;stroke-width:1}.ce-line[data-v-3c8d1b94]{stroke:#6ea0e8;stroke-width:2;stroke-linejoin:round}.ce-handles line[data-v-3c8d1b94]{stroke:#8d96b5;stroke-width:1;stroke-dasharray:3 2}.ce-handles circle[data-v-3c8d1b94]{fill:#b7c2dd;stroke:#344d94;stroke-width:1.2;cursor:grab}.ce-handles circle[data-v-3c8d1b94]:active{cursor:grabbing}.ce-node[data-v-3c8d1b94]{fill:#fff;stroke:#3a55aa;stroke-width:1.6;pointer-events:none}.ce-hit[data-v-3c8d1b94]{fill:transparent;stroke:none;cursor:grab}.ce-hit[data-v-3c8d1b94]:active{cursor:grabbing}.ce-nav[data-v-3c8d1b94]{display:flex;justify-content:space-between;margin-top:3px}.ce-tip[data-v-3c8d1b94]{color:#566;font-size:10px}.spine-editor[data-v-3af7b738]{display:grid;gap:10px;color:#c5cbe0}.editor-title[data-v-3af7b738],.section-title[data-v-3af7b738]{color:#dce2f5;font-weight:700}.editor-title[data-v-3af7b738]{padding-bottom:9px;border-bottom:1px solid #30394d}.grid[data-v-3af7b738]{display:grid;gap:8px}.grid.three[data-v-3af7b738]{grid-template-columns:repeat(3,minmax(0,1fr))}.field[data-v-3af7b738]{display:grid;gap:5px;min-width:0;color:#919bb7;font-size:12px}.field input[data-v-3af7b738],.field select[data-v-3af7b738],.asset-name[data-v-3af7b738]{box-sizing:border-box;width:100%;min-width:0;height:35px;padding:0 10px;color:#e2e6f3;background:#101625;border:1px solid #32405b;border-radius:6px}.divider[data-v-3af7b738]{height:1px;background:#30394d;margin:2px 0}.asset-row[data-v-3af7b738]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.asset-name[data-v-3af7b738]{display:flex;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#7f8aa7}button[data-v-3af7b738]{height:35px;padding:0 13px;border:1px solid #3b4a67;border-radius:6px;background:#33415b;color:#e2e6f3;cursor:pointer}button[data-v-3af7b738]:hover{filter:brightness(1.13)}button[data-v-3af7b738]:disabled{opacity:.55;cursor:wait}.folder-select[data-v-3af7b738]{width:100%;border-color:#6659c7;background:#4940a8;color:#fff}.folder-hint[data-v-3af7b738]{margin-top:-5px;color:#69758e;font-size:10px;line-height:1.45}.asset-actions[data-v-3af7b738]{display:grid;grid-template-columns:1fr 1fr;gap:5px}.asset-actions .load[data-v-3af7b738]{background:#5543df;border-color:#6959ec}.asset-actions .clear[data-v-3af7b738]{background:#702b34;border-color:#803842}.runtime-note[data-v-3af7b738]{color:#69758e;font-size:11px;text-align:center}.error[data-v-3af7b738]{padding:8px 10px;color:#ffabb2;background:#4b2028;border:1px solid #76323e;border-radius:6px;font-size:12px}.section-box[data-v-3af7b738]{display:grid;gap:8px;padding:10px;background:#182132;border:1px solid #303c54;border-radius:7px}.empty[data-v-3af7b738]{color:#667187;font-size:12px;padding:5px 0}.bone-tree[data-v-3af7b738]{max-height:240px;overflow:auto;padding:4px 0;background:#111827;border-radius:5px}.tree-title-row[data-v-3af7b738]{display:flex;align-items:center;justify-content:space-between;gap:8px}.selected-bone[data-v-3af7b738]{width:auto;min-width:0;max-width:100%;height:24px;flex:0 1 auto;overflow:hidden;padding:0 7px;color:#75819c;background:#182132;border:1px solid transparent;border-radius:5px;font-size:10px;text-align:right;white-space:nowrap;text-overflow:ellipsis}.selected-bone.active[data-v-3af7b738]{color:#aeb9d4;background:#242f44;border-color:#35445e;cursor:pointer}.selected-bone.active[data-v-3af7b738]:hover{border-color:#675ec4;background:#302b57}.selected-bone[data-v-3af7b738]:disabled{opacity:1;cursor:default}.selected-bone strong[data-v-3af7b738]{color:#c5cde3;font-weight:600}.tree-action[data-v-3af7b738]{height:24px;padding:0 8px;color:#9aa7c2;background:#242f44;border-color:#35445e;font-size:10px}.bone-search[data-v-3af7b738]{position:relative}.bone-search input[data-v-3af7b738]{box-sizing:border-box;width:100%;height:30px;padding:0 32px 0 9px;color:#dce2f2;background:#101827;border:1px solid #33415b;border-radius:5px;font-size:11px;outline:none}.bone-search input[data-v-3af7b738]:focus{border-color:#7065df;box-shadow:0 0 0 1px #7065df38}.bone-search button[data-v-3af7b738]{position:absolute;top:3px;right:3px;width:24px;height:24px;padding:0;border:0;color:#8d98b0;background:transparent}.bone[data-v-3af7b738]{display:flex;align-items:center;gap:4px;min-height:25px;color:#aeb8d2;font-size:12px;border-bottom:1px solid rgba(72,84,112,.22);cursor:pointer;outline:none}.bone[data-v-3af7b738]:hover{background:#45567e38}.bone.selected[data-v-3af7b738]{color:#f0edff;background:#6b53dd52;box-shadow:inset 2px 0 #8e72ff}.bone[data-v-3af7b738]:focus-visible{box-shadow:inset 0 0 0 1px #7d72dd}.bone-toggle[data-v-3af7b738]{width:22px;height:22px;padding:0;border:0;background:transparent;color:#9aa7c2}.bone-toggle[data-v-3af7b738]:hover{background:#26324a}.bone-leaf[data-v-3af7b738]{display:inline-flex;width:22px;justify-content:center;color:#58647d}.bone-name[data-v-3af7b738]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media(max-width:430px){.grid.three[data-v-3af7b738]{grid-template-columns:1fr}}.panel[data-v-f97ddd48]{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden;background:#14141f;border-left:1px solid #2a2a3c;padding:12px;box-sizing:border-box}.empty[data-v-f97ddd48],.panel-hint[data-v-f97ddd48]{color:#667;font-size:12px;padding:8px 0}.group[data-v-f97ddd48]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-f97ddd48]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-f97ddd48]:hover{background:#20202e}.scene-head[data-v-f97ddd48]{padding-right:6px}.scene-actions[data-v-f97ddd48]{margin-left:auto;display:flex;align-items:center;gap:4px}.scene-add[data-v-f97ddd48]{height:24px;padding:0 6px;border:1px solid #3a4a6a;border-radius:5px;background:#2e3a55;color:#cdf;font-size:10px;white-space:nowrap;cursor:pointer}.scene-add[data-v-f97ddd48]:hover{border-color:#7774ff;background:#45426f;color:#fff}.scene-add[data-v-f97ddd48]:disabled{opacity:.42;cursor:not-allowed;border-color:#343a4b;background:#252a38;color:#778095}.group-body[data-v-f97ddd48]{padding:8px 10px 12px}.caret[data-v-f97ddd48]{display:inline-block;width:12px;color:#667;font-size:11px}.tree[data-v-f97ddd48]{margin-bottom:8px}.tree-item[data-v-f97ddd48]{display:flex;align-items:center;gap:6px;padding:5px 6px;font-size:12px;color:#bcd;border-radius:6px;margin-bottom:2px}.tree-item.on[data-v-f97ddd48]{background:#26324a;color:#ffe}.tree-item .tdot[data-v-f97ddd48]{color:#fc3;font-size:10px}.tree-item .tdot.dim[data-v-f97ddd48]{color:#556}.tree-item .tdot.collision-dot[data-v-f97ddd48]{color:#ff7070}.tree-item .tdot.path-dot[data-v-f97ddd48]{color:#ff933e;font-size:14px}.tree-item .tdot.spine-dot[data-v-f97ddd48]{color:#c08cff;font-size:11px}.tree-item .tlabel[data-v-f97ddd48]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.scene-tree[data-v-f97ddd48]{padding-bottom:8px;border-bottom:1px solid #2a2a3c}.scene-object-item[data-v-f97ddd48]{min-height:28px;cursor:pointer}.scene-object-item[data-v-f97ddd48]:hover{background:#202b40}.scene-object-kind[data-v-f97ddd48]{color:#75829c;font-size:10px}.scene-object-eye[data-v-f97ddd48]{width:24px;height:22px;padding:3px;flex:0 0 24px;border:1px solid transparent;border-radius:5px;background:transparent;color:#9aa6bf;cursor:pointer}.scene-object-eye[data-v-f97ddd48]:hover{border-color:#4b5972;background:#29354a;color:#e1e7f4}.scene-object-eye.off[data-v-f97ddd48]{color:#59647a}.scene-object-eye svg[data-v-f97ddd48]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.scene-object-eye .eye-slash[data-v-f97ddd48]{stroke:#d47b88;stroke-width:2}.scene-object-delete[data-v-f97ddd48]{width:24px;height:22px;padding:0;border:1px solid #59414a;border-radius:5px;background:#3a272f;color:#efb4bd;font-size:11px;cursor:pointer}.scene-object-delete[data-v-f97ddd48]:hover{border-color:#a45c69;background:#57303a;color:#fff}.object-editor-title[data-v-f97ddd48]{margin:10px 0 8px;padding-top:8px;border-top:1px solid #2a2a3c;color:#cbd4e8;font-weight:700}.field-block[data-v-f97ddd48]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-f97ddd48]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-f97ddd48]{color:#5f6d86;line-height:1.5}.field-grid[data-v-f97ddd48]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-f97ddd48]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-f97ddd48]{width:100%;min-height:30px;box-sizing:border-box}.check-field[data-v-f97ddd48]{align-items:flex-start}.check-field input[data-v-f97ddd48]{width:18px;height:18px;margin:4px 0;accent-color:#4f7ee8}.follow-path[data-v-f97ddd48],.setting-line[data-v-f97ddd48]{display:flex;align-items:center;gap:8px;margin:12px 0 4px;color:#aeb8cf;font-size:12px}.setting-line[data-v-f97ddd48]{justify-content:space-between}.follow-path input[data-v-f97ddd48],.setting-line input[type=checkbox][data-v-f97ddd48]{width:17px;height:17px;accent-color:#4f7ee8}.collider-follow-section[data-v-f97ddd48]{margin-top:12px;padding-top:4px;border-top:1px solid #30394d}.collider-curve-title[data-v-f97ddd48]{display:flex;flex-direction:column;gap:3px;margin:12px 0 6px;color:#aeb8cf;font-size:12px}.collider-curve-title small[data-v-f97ddd48]{color:#67738c;font-size:10px;line-height:1.45}.path-color[data-v-f97ddd48]{width:48px;height:28px;padding:0;border:1px solid #3a4963;background:transparent;cursor:pointer}.path-help[data-v-f97ddd48]{margin:12px 0;color:#7d89a2;font-size:11px;line-height:1.55}.path-help>span[data-v-f97ddd48]{color:#aeb8cf}.path-help ul[data-v-f97ddd48]{margin:6px 0 0;padding-left:20px}.path-help li[data-v-f97ddd48]{margin:3px 0}.path-action[data-v-f97ddd48]{width:100%;height:31px;margin-top:7px;border:0;border-radius:5px;background:#33425b;color:#c9d1e1;cursor:pointer}.path-action[data-v-f97ddd48]:hover{filter:brightness(1.12)}.path-action.primary[data-v-f97ddd48]{background:#f05408;color:#fff}.row[data-v-f97ddd48]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-f97ddd48]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-f97ddd48]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.inp.tiny[data-v-f97ddd48]{width:46px;flex:0 0 46px;text-align:center}.seed-row[data-v-f97ddd48]{display:flex;align-items:center;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid #2d3950}.seed-row label[data-v-f97ddd48]{width:64px;color:#8f9bb5;font-size:12px}.seed-input[data-v-f97ddd48]{min-width:0;flex:1;padding:6px 8px;border:1px solid #344158;border-radius:6px;outline:none;background:#0f1625;color:#e2e7f2;font-size:12px}.seed-input[data-v-f97ddd48]:focus{border-color:#625ff1}.seed-random[data-v-f97ddd48]{width:34px;height:30px;border:1px solid #3a4860;border-radius:6px;background:#2c3950;color:#d7def0;cursor:pointer}.seed-random[data-v-f97ddd48]:hover{background:#394964}.scene-seed[data-v-f97ddd48]{margin-top:10px}.seed-hint[data-v-f97ddd48]{margin:5px 0 1px 72px;color:#657188;font-size:9px;line-height:1.45}.group[data-v-fcf44933]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-fcf44933]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-fcf44933]:hover{background:#20202e}.group-reset[data-v-fcf44933]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-fcf44933]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-fcf44933]{padding:8px 10px 12px}.caret[data-v-fcf44933]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-fcf44933]{height:1px;background:#2a2a3c;margin:8px 0}.row[data-v-fcf44933]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-fcf44933]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-fcf44933]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.segs[data-v-fcf44933]{display:flex;gap:6px;margin:6px 0}.stream-behavior-segs[data-v-fcf44933]{margin-top:10px}.stream-loop-options[data-v-fcf44933]{display:grid;gap:8px;margin:8px 0 4px;padding:9px 10px;border:1px solid #32405a;border-radius:6px;background:#171f2e}.loop-section-row[data-v-fcf44933]{display:flex;min-height:27px;align-items:center;justify-content:space-between;gap:8px}.loop-duration-control[data-v-fcf44933]{display:flex;flex:0 0 auto;align-items:center;gap:7px}.loop-duration-toggle[data-v-fcf44933]{gap:5px;font-size:10px;white-space:nowrap}.loop-duration-toggle .switch-ui[data-v-fcf44933]{width:26px;height:14px}.loop-duration-toggle .switch-ui[data-v-fcf44933]:after{width:10px;height:10px}.loop-duration-toggle input:checked+.switch-ui[data-v-fcf44933]:after{transform:translate(12px)}.loop-section-duration[data-v-fcf44933]{display:flex;flex:0 0 auto;align-items:center;gap:4px;color:#7f8ba4;font-size:11px}.loop-section-duration input[data-v-fcf44933]{position:static;width:54px;height:25px;padding:0 6px;border:1px solid #3a465f;border-radius:5px;outline:none;background:#101725;color:#e4e8f2;text-align:right;opacity:1;pointer-events:auto}.loop-section-duration input[data-v-fcf44933]:focus{border-color:#716eff}.loop-auto-duration[data-v-fcf44933]{min-width:54px;color:#77839a;text-align:right;white-space:nowrap}.seg[data-v-fcf44933]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-fcf44933]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.seg[data-v-fcf44933]{display:flex;gap:6px;margin:6px 0}.inp.tiny[data-v-fcf44933]{width:46px;flex:0 0 46px;text-align:center}.switch-row[data-v-fcf44933]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-fcf44933]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-fcf44933]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-fcf44933]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-fcf44933]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-fcf44933]:after{transform:translate(14px)}.modifier-hint[data-v-fcf44933]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.stream-loop-hint[data-v-fcf44933]{margin:9px 2px 3px;padding:7px 8px;border:1px solid #4a436e;border-radius:5px;background:#211f35;color:#aaa4d7}.switch-row input:disabled+.switch-ui[data-v-fcf44933]{opacity:.45;cursor:not-allowed}.pac[data-v-7a931847]{padding:10px;margin:8px 0;border:1px solid #2c3850;border-radius:7px;background:#171d2a}.pac-head[data-v-7a931847]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}.pac-label[data-v-7a931847]{color:#aeb8cf;font-size:12px;font-weight:600;white-space:nowrap}.pac-modes[data-v-7a931847]{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end}.pac-mode[data-v-7a931847]{padding:4px 7px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.pac-mode.on[data-v-7a931847]{border-color:#7774ff;background:#605df0;color:#fff}.pac-curve[data-v-7a931847]{margin-top:8px}.pac-axis[data-v-7a931847]{display:flex;justify-content:space-between;margin-top:3px;color:#5f6b82;font-size:10px}.pac[data-v-7a931847] .ns-label{width:58px}.pac[data-v-7a931847] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.pac[data-v-7a931847] .ce-tip{color:#657188}.group[data-v-909c781b]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-909c781b]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-909c781b]:hover{background:#20202e}.group-reset[data-v-909c781b]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-909c781b]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-909c781b]{padding:8px 10px 12px}.caret[data-v-909c781b]{display:inline-block;width:12px;color:#667;font-size:11px}.row[data-v-909c781b]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-909c781b]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.attr-body[data-v-909c781b]{padding:10px;background:#151b27}.attr-section-title[data-v-909c781b]{margin:2px 0 8px;color:#9ca8c0;font-size:12px;font-weight:700}.attr-section-title.life-title[data-v-909c781b]{margin-top:14px;padding-top:12px;border-top:1px solid #2d3950}.attr-axis-head[data-v-909c781b]{display:flex;align-items:center;justify-content:space-between;margin:10px 1px -2px;color:#aeb8cf;font-size:12px;font-weight:600}.axis-modes[data-v-909c781b]{display:flex;gap:4px}.axis-mode[data-v-909c781b]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-909c781b]{border-color:#7774ff;background:#605df0;color:#fff}.life-item[data-v-909c781b]{padding:9px 0;border-bottom:1px solid #2a3549}.switch-row[data-v-909c781b]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-909c781b]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-909c781b]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-909c781b]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-909c781b]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-909c781b]:after{transform:translate(14px)}.life-axis[data-v-909c781b]{margin:9px 0 2px 42px}.switch-row input:disabled+.switch-ui[data-v-909c781b]{opacity:.45;cursor:not-allowed}.gradient-editor[data-v-8816e4a4]{margin:8px 0 11px 68px}.gradient-bar[data-v-8816e4a4]{position:relative;height:18px;margin-bottom:14px;border:1px solid #465570;border-radius:6px;cursor:crosshair}.gradient-stop[data-v-8816e4a4]{position:absolute;top:15px;width:14px;height:17px;padding:0;transform:translate(-50%);border:2px solid #d8deea;border-radius:2px 2px 5px 5px;background:var(--stop-color);cursor:grab;box-shadow:0 1px 3px #0009}.gradient-stop[data-v-8816e4a4]:before{content:"";position:absolute;left:2px;top:-7px;border-left:3px solid transparent;border-right:3px solid transparent;border-bottom:5px solid #d8deea}.gradient-stop.selected[data-v-8816e4a4]{outline:2px solid #7774ff;outline-offset:1px;z-index:2}.gradient-stop[data-v-8816e4a4]:active{cursor:grabbing}.gradient-controls[data-v-8816e4a4]{display:flex;align-items:center;gap:5px;margin-top:30px}.gradient-color[data-v-8816e4a4]{width:28px;height:24px;padding:1px;border:1px solid #465570;border-radius:4px;background:#151b27;cursor:pointer}.gradient-hex-input[data-v-8816e4a4]{width:66px;padding:4px 5px;border:1px solid #344158;border-radius:4px;outline:none;background:#101725;color:#aeb8cb;font-size:10px;font-family:monospace}.gradient-hex-input[data-v-8816e4a4]:focus{border-color:#7774ff;color:#fff}.gradient-position[data-v-8816e4a4]{display:flex;align-items:center;color:#71809a;font-size:10px}.gradient-position input[data-v-8816e4a4]{width:43px;padding:3px 4px;border:1px solid #344158;border-radius:4px;outline:none;background:#101725;color:#dce3ef;text-align:right}.gradient-action[data-v-8816e4a4]{width:25px;height:24px;padding:0;border:1px solid #3a4860;border-radius:4px;background:#273246;color:#cbd4e5;cursor:pointer}.gradient-action[data-v-8816e4a4]:hover:not(:disabled){border-color:#7774ff;color:#fff}.gradient-action.danger[data-v-8816e4a4]{color:#e3a5aa}.gradient-action[data-v-8816e4a4]:disabled{opacity:.35;cursor:not-allowed}.gradient-hint[data-v-8816e4a4]{margin-top:5px;color:#59667b;font-size:9px}.image-card[data-v-7a2d016a]{margin:8px 0;padding:9px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.imgrow[data-v-7a2d016a]{display:flex;align-items:flex-start;gap:8px}.img-thumb[data-v-7a2d016a]{width:48px;height:48px;padding:0;border:1px solid #3a4963;border-radius:6px;background:#1a2232;display:flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer;overflow:hidden}.img-thumb[data-v-7a2d016a]:hover{border-color:#7774ff}.img-thumb img[data-v-7a2d016a]{display:block;width:100%;height:100%;object-fit:contain}.img-fields[data-v-7a2d016a]{flex:1;min-width:0}.img-actions[data-v-7a2d016a]{display:flex;flex-direction:column;gap:4px}.row[data-v-7a2d016a]{display:flex;align-items:center;gap:8px;margin:6px 0;color:#aab;font-size:12px}.row>span[data-v-7a2d016a]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-7a2d016a]{min-width:0;flex:1;padding:3px 5px;border:1px solid #2e2e44;border-radius:5px;background:#1a1a28;color:#dde;font-size:12px}.mini-btn2[data-v-7a2d016a]{width:26px;height:24px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:5px;color:#aab;font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center}.mini-btn2[data-v-7a2d016a]:hover{background:#2b3a5c}.mini-btn2[data-v-7a2d016a]:disabled{opacity:.35;cursor:not-allowed}.thumb-note[data-v-7a2d016a]{margin:4px 0 2px;color:#667;font-size:11px}.sequence-pick[data-v-7a2d016a]{width:100%;margin:2px 0 4px;padding:6px 8px;border:1px solid #4a4a76;border-radius:5px;background:#27264b;color:#d8d7ff;font-size:12px;cursor:pointer}.sequence-pick[data-v-7a2d016a]:hover{border-color:#7774ff;background:#35336a}.sequence-note[data-v-7a2d016a]{margin:0 0 6px;color:#727b9b;font-size:11px;line-height:1.4}.resource-weight-row[data-v-7a2d016a]{display:grid;grid-template-columns:minmax(0,1fr) 28px;align-items:center;gap:7px}.resource-weight-control[data-v-7a2d016a]{width:100%;min-width:0}.resource-weight-control[data-v-7a2d016a] .ns-range{min-width:0}.resource-weight-control[data-v-7a2d016a] .ns-num{flex:0 0 56px;box-sizing:border-box}.weight-lock[data-v-7a2d016a]{width:28px;height:26px;flex:0 0 28px;padding:5px;border:1px solid #35435c;border-radius:5px;background:#202a3b;color:#78859e;cursor:pointer}.weight-lock svg[data-v-7a2d016a]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.weight-lock[data-v-7a2d016a]:hover:not(:disabled){border-color:#7774ff;color:#b8b6ff}.weight-lock.on[data-v-7a2d016a]{border-color:#7774ff;background:#514fd0;color:#fff}.weight-lock[data-v-7a2d016a]:disabled{opacity:.35;cursor:not-allowed}.group[data-v-f3235ea1]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-f3235ea1]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-f3235ea1]:hover{background:#20202e}.group-reset[data-v-f3235ea1]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-f3235ea1]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-f3235ea1]{padding:8px 10px 12px}.caret[data-v-f3235ea1]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-f3235ea1]{height:1px;background:#2a2a3c;margin:8px 0}.row[data-v-f3235ea1]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-f3235ea1]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-f3235ea1]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.colr[data-v-f3235ea1]{width:28px;height:22px;border:none;background:none;cursor:pointer}.seg[data-v-f3235ea1]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-f3235ea1]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.look-title[data-v-f3235ea1]{font-size:12px;font-weight:600;color:#ccd;margin:10px 0 6px;padding-bottom:4px;border-bottom:1px solid #2a2a3c}.look-title[data-v-f3235ea1]:first-child{margin-top:2px}.seg[data-v-f3235ea1]{display:flex;gap:6px;margin:6px 0}.seg-btn[data-v-f3235ea1]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg-btn.active[data-v-f3235ea1]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.curve-wrap[data-v-f3235ea1]{margin:6px 0}.curve-labels[data-v-f3235ea1]{display:flex;justify-content:space-between;color:#566;font-size:10px;margin-top:2px}.image-title[data-v-f3235ea1]{display:flex;align-items:center;justify-content:space-between}.image-add[data-v-f3235ea1]{width:26px;height:24px;border:1px solid #4a4d9a;border-radius:5px;background:#252850;color:#8f8cff;font-size:18px;line-height:1;cursor:pointer}.image-add[data-v-f3235ea1]:hover{background:#4542a8;color:#fff}.resource-divider[data-v-f3235ea1]{height:1px;margin:9px 0 7px;background:#2a3549}.resource-color-row .blend-select[data-v-f3235ea1]{max-width:88px}.resource-color-picker .hex[data-v-f3235ea1]{margin-left:0}.random-color-hint[data-v-f3235ea1]{margin:-5px 0 9px 68px;color:#66758e;font-size:9px;line-height:1.45}.hex-input[data-v-f3235ea1]{width:72px;padding:4px 6px;border:1px solid #344158;border-radius:5px;outline:none;background:#101725;color:#aeb8cb;font-size:11px;font-family:monospace}.hex-input[data-v-f3235ea1]:focus{border-color:#7774ff;color:#fff}.resource-alpha-head[data-v-f3235ea1]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;color:#8a93bb;font-size:12px}.alpha-modes[data-v-f3235ea1]{display:flex;gap:3px}.alpha-modes button[data-v-f3235ea1]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-f3235ea1]:hover{background:#273246}.alpha-modes button.on[data-v-f3235ea1]{border-color:#7774ff;background:#605df0;color:#fff}.resource-alpha-curve[data-v-f3235ea1]{margin-top:7px}.file-input[data-v-f3235ea1]{display:none}.hex[data-v-f3235ea1]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-f3235ea1]{width:46px;flex:0 0 46px;text-align:center}.empty[data-v-4d0d64ec]{color:#667;font-size:12px;padding:8px 0}.group[data-v-4d0d64ec]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-4d0d64ec]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-4d0d64ec]:hover{background:#20202e}.group-reset[data-v-4d0d64ec]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-4d0d64ec]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-4d0d64ec]{padding:8px 10px 12px}.caret[data-v-4d0d64ec]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-4d0d64ec]{height:1px;background:#2a2a3c;margin:8px 0}.field-block[data-v-4d0d64ec]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-4d0d64ec]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-4d0d64ec]{color:#5f6d86;line-height:1.5}.field-grid[data-v-4d0d64ec]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-4d0d64ec]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-4d0d64ec]{width:100%;min-height:30px;box-sizing:border-box}.tag[data-v-4d0d64ec]{font-size:10px;color:#667;background:#1c1c2a;border-radius:4px;padding:1px 5px}.row[data-v-4d0d64ec]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-4d0d64ec]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-4d0d64ec]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.colr[data-v-4d0d64ec]{width:28px;height:22px;border:none;background:none;cursor:pointer}.placeholder[data-v-4d0d64ec]{color:#667;font-size:11px;padding:6px 0}.image-add[data-v-4d0d64ec]{width:26px;height:24px;border:1px solid #4a4d9a;border-radius:5px;background:#252850;color:#8f8cff;font-size:18px;line-height:1;cursor:pointer}.image-add[data-v-4d0d64ec]:hover{background:#4542a8;color:#fff}.resource-divider[data-v-4d0d64ec]{height:1px;margin:9px 0 7px;background:#2a3549}.hex-input[data-v-4d0d64ec]{width:72px;padding:4px 6px;border:1px solid #344158;border-radius:5px;outline:none;background:#101725;color:#aeb8cb;font-size:11px;font-family:monospace}.hex-input[data-v-4d0d64ec]:focus{border-color:#7774ff;color:#fff}.alpha-modes[data-v-4d0d64ec]{display:flex;gap:3px}.alpha-modes button[data-v-4d0d64ec]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-4d0d64ec]:hover{background:#273246}.alpha-modes button.on[data-v-4d0d64ec]{border-color:#7774ff;background:#605df0;color:#fff}.file-input[data-v-4d0d64ec]{display:none}.hex[data-v-4d0d64ec]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-4d0d64ec]{width:46px;flex:0 0 46px;text-align:center}.axis-mode[data-v-4d0d64ec]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-4d0d64ec]{border-color:#7774ff;background:#605df0;color:#fff}.switch-row[data-v-4d0d64ec]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-4d0d64ec]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-4d0d64ec]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-4d0d64ec]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-4d0d64ec]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-4d0d64ec]:after{transform:translate(14px)}.modifier-item[data-v-4d0d64ec]{padding:8px 0 10px;border-bottom:1px solid #2a3549}.modifier-switch[data-v-4d0d64ec]{font-weight:600}.modifier-params[data-v-4d0d64ec]{margin:8px 0 0 10px;padding:2px 0 2px 10px;border-left:2px solid #344158}.modifier-hint[data-v-4d0d64ec]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.collision-filter-params[data-v-4d0d64ec]{position:relative;padding-top:5px;padding-bottom:5px}.collision-filter-title[data-v-4d0d64ec]{margin-bottom:8px;color:#9ba7bd;font-size:11px;font-weight:600}.collision-filter-tags[data-v-4d0d64ec]{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.collision-filter-tag[data-v-4d0d64ec]{display:inline-flex;min-width:0;align-items:center;gap:6px;padding:5px 5px 5px 8px;border:1px solid #625ff1;border-radius:6px;background:#514dcf;color:#fff;font-size:11px}.collision-filter-tag>span[data-v-4d0d64ec]{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-tag.disabled[data-v-4d0d64ec]{border-color:#4b5364;background:#343b4b;color:#929bad}.collision-filter-tag button[data-v-4d0d64ec]{width:18px;height:18px;padding:0;border:0;border-radius:4px;background:#0b0f1a38;color:inherit;line-height:16px;cursor:pointer}.collision-filter-tag button[data-v-4d0d64ec]:hover{background:#0b0f1a80;color:#fff}.collision-filter-add[data-v-4d0d64ec]{width:30px;height:30px;padding:0;border:1px dashed #536079;border-radius:6px;background:#182131;color:#98a5bd;font-size:18px;line-height:28px;cursor:pointer}.collision-filter-add[data-v-4d0d64ec]:hover,.collision-filter-add.active[data-v-4d0d64ec]{border-color:#7774ff;background:#262c52;color:#fff}.collision-filter-add[data-v-4d0d64ec]:disabled{opacity:.42;cursor:not-allowed}.collision-filter-empty[data-v-4d0d64ec]{margin-top:7px;color:#6f7b91;font-size:10px}.collision-filter-picker[data-v-4d0d64ec]{display:grid;gap:4px;margin-top:7px;padding:5px;border:1px solid #344158;border-radius:6px;background:#101725}.collision-filter-picker button[data-v-4d0d64ec]{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border:0;border-radius:4px;background:transparent;color:#c7d0e3;font-size:11px;text-align:left;cursor:pointer}.collision-filter-picker button[data-v-4d0d64ec]:hover{background:#29344a;color:#fff}.collision-filter-picker button span[data-v-4d0d64ec]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-picker button small[data-v-4d0d64ec]{flex:none;color:#68758d;font-size:9px}.switch-row input:disabled+.switch-ui[data-v-4d0d64ec]{opacity:.45;cursor:not-allowed}.bone-follow-target[data-v-4d0d64ec]{margin:7px 0 9px;padding:7px 8px;overflow:hidden;color:#7f8ba3;background:#121a29;border:1px solid #2f3c53;border-radius:5px;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.bone-follow-target strong[data-v-4d0d64ec]{color:#c8d0e4;font-weight:600}.bone-follow-missing[data-v-4d0d64ec]{margin:7px 0 9px;padding:7px 8px;color:#d49aa3;background:#2a1e26;border:1px solid #513540;border-radius:5px;font-size:10px;line-height:1.5}.bone-follow-rebind[data-v-4d0d64ec]{width:100%;min-height:28px;margin:0 0 8px;padding:4px 8px;overflow:hidden;border:1px solid #4a436e;border-radius:5px;background:#2d2947;color:#c8c2ee;font-size:10px;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.bone-follow-rebind[data-v-4d0d64ec]:hover{border-color:#7165bd;background:#3a335d;color:#fff}.bone-follow-transform-grid[data-v-4d0d64ec]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.modifier-mode-row[data-v-4d0d64ec]{display:flex;justify-content:flex-end;gap:4px;margin-bottom:6px}.gravity-curve-title[data-v-4d0d64ec]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0 6px;color:#9ba7bd;font-size:11px}.gravity-curve-title span[data-v-4d0d64ec]:last-child{color:#657188;font-size:9px}.gravity-curve-axis[data-v-4d0d64ec]{display:flex;justify-content:space-between;margin:3px 34px 0 1px;color:#5f6b82;font-size:9px}.gravity-params[data-v-4d0d64ec] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.trail-params[data-v-4d0d64ec]{padding-right:2px}.trail-section-title[data-v-4d0d64ec]{margin:3px 0 8px;color:#aeb8cf;font-size:12px;font-weight:700}.trail-fixed-color .hex-input[data-v-4d0d64ec]{min-width:0;flex:1}.trail-mode-head[data-v-4d0d64ec]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0 6px;color:#9ba7bd;font-size:11px}.trail-sub-switch[data-v-4d0d64ec]{margin:11px 0 7px;padding-top:9px;border-top:1px solid #2a3549}.trail-grid-row[data-v-4d0d64ec]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.trail-grid-row[data-v-4d0d64ec] .ns{min-width:0;flex-wrap:wrap;align-items:center}.trail-grid-row[data-v-4d0d64ec] .ns-label{width:100%}.trail-grid-row[data-v-4d0d64ec] .ns-range{min-width:0}.trail-grid-row[data-v-4d0d64ec] .ns-num{width:42px}.trail-params[data-v-4d0d64ec] .ce-svg{height:92px;background:#0f1625;border-color:#30405a}.group[data-v-ffed0f1f]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-ffed0f1f]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-ffed0f1f]:hover{background:#20202e}.group-reset[data-v-ffed0f1f]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-ffed0f1f]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-ffed0f1f]{padding:8px 10px 12px}.caret[data-v-ffed0f1f]{display:inline-block;width:12px;color:#667;font-size:11px}.row[data-v-ffed0f1f]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-ffed0f1f]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-ffed0f1f]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.placeholder[data-v-ffed0f1f]{color:#667;font-size:11px;padding:6px 0}.export-settings[data-v-ffed0f1f]{padding-top:3px}.export-field[data-v-ffed0f1f]{display:flex;flex-direction:column;gap:6px;margin:10px 0 13px;color:#9ca8bf;font-size:11px;font-weight:600}.export-input[data-v-ffed0f1f]{width:100%;min-height:34px;box-sizing:border-box;padding:6px 9px;color:#e3e7f2;background:#141a29;border-color:#35445f}.export-fps-row[data-v-ffed0f1f]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end}.export-fps-field[data-v-ffed0f1f]{margin-bottom:5px}.export-checkbox[data-v-ffed0f1f]{display:flex;align-items:center;gap:7px;min-height:34px;margin-bottom:5px;color:#aeb8cc;font-size:11px;white-space:nowrap}.export-checkbox input[data-v-ffed0f1f]{width:17px;height:17px;margin:0;accent-color:#625ff1}.export-help[data-v-ffed0f1f]{margin:-6px 0 14px;color:#66758e;font-size:10px;line-height:1.5}.export-switches[data-v-ffed0f1f]{display:grid;gap:13px;margin:4px 0 7px;padding-top:2px}.export-switch[data-v-ffed0f1f]{font-weight:600}.export-switch-last[data-v-ffed0f1f]{margin-top:13px}.inp.tiny[data-v-ffed0f1f]{width:46px;flex:0 0 46px;text-align:center}.switch-row[data-v-ffed0f1f]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-ffed0f1f]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-ffed0f1f]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-ffed0f1f]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-ffed0f1f]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-ffed0f1f]:after{transform:translate(14px)}.switch-row input:disabled+.switch-ui[data-v-ffed0f1f]{opacity:.45;cursor:not-allowed}.spine-export-actions[data-v-5f1ec706]{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}.export-spine-json[data-v-5f1ec706]{width:100%;padding:9px 8px;flex:0 0 auto;border:1px solid #4f4b9a;border-radius:7px;background:#403b91;color:#f1f0ff;font-size:12px;font-weight:700;cursor:pointer}.export-spine-json[data-v-5f1ec706]:hover{border-color:#7774ff;background:#514bc0}.export-spine-json[data-v-5f1ec706]:disabled{cursor:wait;opacity:.68}.export-spine-project[data-v-5f1ec706]{grid-column:1 / -1;width:100%;padding:7px 8px;border:1px solid #287d69;border-radius:7px;background:#196854;color:#edfff9;font-size:12px;font-weight:700;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}.export-spine-project small[data-v-5f1ec706]{color:inherit;font-size:9px;font-weight:500;line-height:1.1}.export-spine-project[data-v-5f1ec706]:hover:not(:disabled){border-color:#47c89f;background:#238267}.export-spine-project[data-v-5f1ec706]:disabled{cursor:not-allowed;opacity:.48}.export-spine-images[data-v-5f1ec706]{width:100%;padding:8px;border:1px solid #3b5f8b;border-radius:7px;background:#243e64;color:#eaf3ff;font-size:12px;font-weight:700;cursor:pointer}.export-spine-images[data-v-5f1ec706]:hover:not(:disabled){border-color:#6099dc;background:#315581}.export-spine-images[data-v-5f1ec706]:disabled{cursor:wait;opacity:.55}.connector-status[data-v-5f1ec706]{display:flex;align-items:center;justify-content:center;gap:5px;padding-top:6px;color:#717b99;font-size:10px}.connector-status .connector-dot[data-v-5f1ec706]{width:6px;height:6px;border-radius:50%;background:#66718f}.connector-status.ready[data-v-5f1ec706]{color:#70d8ae}.connector-status.ready .connector-dot[data-v-5f1ec706]{background:#49c993;box-shadow:0 0 5px #49c99388}.connector-status.warning[data-v-5f1ec706]{color:#d4aa67}.connector-status.warning .connector-dot[data-v-5f1ec706]{background:#d4aa67}.connector-status button[data-v-5f1ec706]{padding:0 3px;border:0;background:transparent;color:#8290b6;font-size:10px;cursor:pointer}.connector-status button[data-v-5f1ec706]:hover{color:#c5caff}.connector-status a[data-v-5f1ec706]{padding:0 3px;color:#a8b0ff;font-size:10px;text-decoration:underline}.connector-status a[data-v-5f1ec706]:hover{color:#d8dcff}.export-message[data-v-5f1ec706]{padding:7px 5px 0;color:#70d8ae;font-size:10px;line-height:1.45;text-align:center}.export-message.error[data-v-5f1ec706]{color:#ff858f}.export-message a[data-v-5f1ec706]{display:inline-block;margin-left:5px;color:#9da7ff;text-decoration:underline}.panel[data-v-a28d4278]{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden;background:#14141f;border-left:1px solid #2a2a3c;padding:12px;box-sizing:border-box}.panel-scroll[data-v-a28d4278]{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;padding-right:2px;scrollbar-width:thin;scrollbar-color:#2e2e44 transparent}.panel-scroll[data-v-a28d4278]::-webkit-scrollbar{width:6px}.panel-scroll[data-v-a28d4278]::-webkit-scrollbar-track{background:transparent}.panel-scroll[data-v-a28d4278]::-webkit-scrollbar-thumb{background:#2e2e44;border-radius:3px}.panel-scroll[data-v-a28d4278]::-webkit-scrollbar-thumb:hover{background:#3a3a55}.panel-header[data-v-a28d4278]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;flex:0 0 auto;font-weight:700;color:#ccd}.timeline[data-v-e305dee7]{height:100%;background:#12121c;border-top:1px solid #2a2a3c;display:flex;flex-direction:column;padding:6px 10px;gap:4px}.tl-controls[data-v-e305dee7]{display:flex;align-items:center;gap:8px}.tl-btn[data-v-e305dee7]{width:30px;height:26px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.tl-btn.on[data-v-e305dee7]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.tl-range[data-v-e305dee7]{display:flex;height:25px;align-items:center;gap:3px;color:#778198;font-size:10px}.tl-range input[data-v-e305dee7]{width:43px;height:25px;padding:0 5px;box-sizing:border-box;border:1px solid #3a3a51;border-radius:5px;outline:none;background:#181824;color:#e1e4ed;font-size:11px;text-align:center}.tl-range input[data-v-e305dee7]:focus{border-color:#716eff}.tl-loop-range[data-v-e305dee7]{height:25px;padding:0 7px;border:1px solid #4e5680;border-radius:5px;background:#252943;color:#bfc8e8;font-size:10px;cursor:pointer;white-space:nowrap}.tl-loop-range[data-v-e305dee7]:hover{border-color:#716eff;color:#fff}.tl-frame[data-v-e305dee7]{display:inline-block;flex:0 0 92px;width:92px;box-sizing:border-box;font-size:12px;color:#aab;text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}.tl-frame b[data-v-e305dee7]{display:inline;color:inherit;font-weight:400}.tl-legend[data-v-e305dee7]{display:flex;align-items:center;gap:4px;color:#778198;font-size:10px}.tl-legend i[data-v-e305dee7]{display:inline-block;width:10px;height:7px;border-radius:2px}.legend-emission[data-v-e305dee7]{margin-left:4px;background:#2f8b62}.legend-life[data-v-e305dee7]{margin-left:5px;background:#a54551}.legend-spine[data-v-e305dee7]{margin-left:5px;background:#7448b8}.tl-anim[data-v-e305dee7]{display:flex;align-items:center;gap:6px;font-size:12px;color:#aab}.tl-owner-animation[data-v-e305dee7]{position:relative}.tl-animation-trigger[data-v-e305dee7]{display:flex;align-items:center;justify-content:space-between;gap:8px;width:116px;height:25px;padding:0 7px;overflow:hidden;border:1px solid #2e2e44;border-radius:5px;background:#1a1a28;color:#dde;cursor:pointer}.tl-animation-trigger>span[data-v-e305dee7]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-trigger>i[data-v-e305dee7]{flex:0 0 auto;color:#8c96ad;font-style:normal}.tl-animation-trigger[data-v-e305dee7]:disabled{opacity:.5;cursor:not-allowed}.tl-animation-menu[data-v-e305dee7]{position:absolute;z-index:30;right:0;bottom:calc(100% + 6px);width:226px;padding:7px;border:1px solid #3c4760;border-radius:8px;background:#171b29;box-shadow:0 10px 24px #00000073}.tl-animation-menu-title[data-v-e305dee7]{padding:2px 4px 6px;color:#77839c;font-size:10px}.tl-animation-option[data-v-e305dee7]{display:flex;align-items:center;justify-content:space-between;width:100%;height:27px;padding:0 7px;border:0;border-radius:5px;background:transparent;color:#b8c1d5;text-align:left;cursor:pointer}.tl-animation-option>span[data-v-e305dee7]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-option[data-v-e305dee7]:hover{background:#252e42}.tl-animation-option.on[data-v-e305dee7]{background:#34335d;color:#fff}.tl-animation-option>i[data-v-e305dee7]{color:#8d8aff;font-style:normal}.tl-animation-editor[data-v-e305dee7]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;margin-top:7px;padding-top:7px;border-top:1px solid #2b3346}.tl-animation-name[data-v-e305dee7]{min-width:0;height:27px;padding:0 7px;box-sizing:border-box;border:1px solid #343e55;border-radius:5px;background:#101522;color:#e1e6f2;outline:none}.tl-animation-name[data-v-e305dee7]:focus{border-color:#6865d8}.tl-animation-editor button[data-v-e305dee7],.tl-animation-actions button[data-v-e305dee7]{height:27px;padding:0 8px;border:1px solid #3c4861;border-radius:5px;background:#29344a;color:#cbd3e3;cursor:pointer}.tl-animation-actions[data-v-e305dee7]{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:6px}.tl-animation-actions button[data-v-e305dee7]:last-child{border-color:#5b3942;background:#3b282f;color:#e2a8b2}.tl-animation-actions button[data-v-e305dee7]:disabled{opacity:.4;cursor:not-allowed}.tl-animation-error[data-v-e305dee7]{margin-top:5px;color:#ef8997;font-size:10px}.tl-animation-hint[data-v-e305dee7]{margin-top:5px;color:#69758d;font-size:9px;text-align:center}.tl-sel[data-v-e305dee7]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px;padding:2px 6px;font-size:12px}.tl-sel[data-v-e305dee7]:disabled{opacity:.5;cursor:not-allowed}.tl-spine-preview .tl-sel[data-v-e305dee7]{max-width:190px}.tl-zoom[data-v-e305dee7]{margin-left:auto;font-size:11px;color:#667}.tl-viewport[data-v-e305dee7]{position:relative;flex:1;overflow:hidden;background:#0d0d14;border:1px solid #2a2a3c;border-radius:6px;cursor:ew-resize}.tl-ticks[data-v-e305dee7]{position:absolute;top:0;left:0;right:0;height:18px}.tl-tickline[data-v-e305dee7]{position:absolute;top:0;bottom:0;width:1px;background:#263040}.tl-ticklabel[data-v-e305dee7]{position:absolute;top:2px;transform:translate(-50%);font-size:9px;color:#667}.tl-playhead[data-v-e305dee7]{position:absolute;top:0;bottom:0;width:2px;background:#fc3;z-index:5;pointer-events:none}.tl-lanes[data-v-e305dee7]{position:absolute;top:22px;left:0;right:0;bottom:0}.tl-lane[data-v-e305dee7]{position:relative;height:26px;margin-bottom:4px}.lane-ico[data-v-e305dee7]{position:absolute;left:4px;top:6px;font-size:11px;color:#dde;z-index:2;pointer-events:none}.lane-bar[data-v-e305dee7]{position:absolute;top:4px;height:18px;display:flex;align-items:stretch;cursor:grab;box-sizing:border-box}.lane-bar[data-v-e305dee7]:active{cursor:grabbing}.lane-name[data-v-e305dee7]{position:absolute;left:14px;right:5px;top:2px;z-index:2;pointer-events:none;font-size:11px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar-life[data-v-e305dee7]{position:absolute;inset:0 auto 0 0;z-index:0;min-width:1px;border:1px solid #c05a66;border-radius:5px;background:#a54551;box-sizing:border-box}.bar-life.loop-life[data-v-e305dee7]{border-color:#667085;background:#242b39}.bar-emission[data-v-e305dee7]{position:absolute;inset:0 auto 0 0;z-index:1;min-width:1px;border:1px solid #45a97d;border-radius:5px 0 0 5px;background:#2f8b62;box-sizing:border-box}.bar-emission.bar-loop[data-v-e305dee7]{border-radius:0}.bar-loop-transition[data-v-e305dee7]{position:absolute;top:0;bottom:0;z-index:1;border:1px solid #7d8799;background:#50596a;box-sizing:border-box}.bar-loop-start[data-v-e305dee7]{left:0;border-radius:5px 0 0 5px}.bar-loop-end[data-v-e305dee7]{border-radius:0 5px 5px 0}.bar-handle[data-v-e305dee7]{position:absolute;z-index:4;right:-4px;top:-1px;bottom:-1px;width:8px;cursor:ew-resize;background:#ffffff2e}.bar-handle[data-v-e305dee7]:hover{background:#ffffff59}.spine-ico[data-v-e305dee7]{color:#c08cff}.spine-bar[data-v-e305dee7]{position:absolute;top:4px;height:18px;min-width:1px;box-sizing:border-box;border:1px solid #a575ed;border-radius:5px;background:#7448b8;cursor:grab;box-shadow:inset 0 0 0 1px #ffffff0d}.spine-bar[data-v-e305dee7]:active{cursor:grabbing}.tl-empty[data-v-e305dee7]{color:#667;font-size:11px;padding:8px}.transfer-overlay[data-v-016b4c9d]{position:fixed;z-index:2000;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:auto;cursor:wait;overscroll-behavior:contain;background:#05080f42;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.transfer-dialog[data-v-016b4c9d]{width:min(420px,calc(100vw - 40px));padding:18px 20px 16px;border:1px solid #414b66;border-radius:10px;box-shadow:0 18px 55px #00000075;background:#171d2b;color:#e7ebf5}.transfer-heading[data-v-016b4c9d]{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;font-size:14px;font-weight:700}.transfer-heading strong[data-v-016b4c9d]{color:#a8a6ff;font-size:12px;font-variant-numeric:tabular-nums}.transfer-track[data-v-016b4c9d]{height:9px;overflow:hidden;border:1px solid #35415a;border-radius:999px;background:#0d1422}.transfer-bar[data-v-016b4c9d]{height:100%;border-radius:inherit;background:linear-gradient(90deg,#4d75e8,#7774ff);transition:width .16s ease}.transfer-track.indeterminate .transfer-bar[data-v-016b4c9d]{width:42%;animation:transfer-slide-016b4c9d 1s ease-in-out infinite}.transfer-detail[data-v-016b4c9d]{min-height:17px;margin-top:9px;color:#8895ae;font-size:11px;line-height:1.5}.transfer-dialog.failed[data-v-016b4c9d]{border-color:#754351}.transfer-dialog.failed .transfer-heading strong[data-v-016b4c9d],.transfer-dialog.failed .transfer-detail[data-v-016b4c9d]{color:#e99aa9}.transfer-dialog.failed .transfer-bar[data-v-016b4c9d]{background:#c85d70}.transfer-fade-enter-active[data-v-016b4c9d],.transfer-fade-leave-active[data-v-016b4c9d]{transition:opacity .16s ease}.transfer-fade-enter-from[data-v-016b4c9d],.transfer-fade-leave-to[data-v-016b4c9d]{opacity:0}@keyframes transfer-slide-016b4c9d{0%{transform:translate(-110%)}to{transform:translate(250%)}}.layout[data-v-d7e0e59a]{display:flex;width:100%;height:100%;min-height:0;overflow:clip}.parameter-panel[data-v-d7e0e59a]{flex-shrink:0;height:100%;min-height:0;overflow:clip}.resizer-col[data-v-d7e0e59a]{width:5px;cursor:col-resize;background:#1c1c2a;border-left:1px solid #2a2a3c;border-right:1px solid #2a2a3c;flex-shrink:0}.resizer-col[data-v-d7e0e59a]:hover{background:#3a5a8c}.right[data-v-d7e0e59a]{flex:1;min-width:0;height:100%;min-height:0;overflow:clip;display:flex;flex-direction:column}.panel-right .right[data-v-d7e0e59a]{order:1}.panel-right .resizer-col[data-v-d7e0e59a]{order:2}.panel-right .parameter-panel[data-v-d7e0e59a]{order:3}.stage-area[data-v-d7e0e59a]{flex:1;min-height:0;overflow:clip}.resizer-row[data-v-d7e0e59a]{height:4px;cursor:row-resize;background:#1c1c2a;border-top:1px solid #2a2a3c;border-bottom:1px solid #2a2a3c;flex-shrink:0}.resizer-row[data-v-d7e0e59a]:hover{background:#3a5a8c}.timeline-area[data-v-d7e0e59a]{position:relative;z-index:10;flex-shrink:0;overflow:visible}html,body{width:100%;height:100%;margin:0;padding:0;overflow:clip;overscroll-behavior:none;background:#0b0b12;color:#e8e8f0;font-family:system-ui,-apple-system,Segoe UI,sans-serif}body{position:fixed;top:0;right:0;bottom:0;left:0}*{box-sizing:border-box}#app{position:fixed;top:0;right:0;bottom:0;left:0;width:auto;height:auto;overflow:clip}input[type=number]{-webkit-appearance:textfield;appearance:textfield;-moz-appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none} diff --git a/dist/assets/index-DIRGlEhR.css b/dist/assets/index-DIRGlEhR.css deleted file mode 100644 index f1e9fc0..0000000 --- a/dist/assets/index-DIRGlEhR.css +++ /dev/null @@ -1 +0,0 @@ -.help-overlay[data-v-12773018]{position:absolute;top:0;right:0;bottom:0;left:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:72px 24px 28px;box-sizing:border-box;background:#05080fb8;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.help-dialog[data-v-12773018]{width:min(820px,100%);max-height:100%;display:flex;flex-direction:column;overflow:hidden;border:1px solid #3a4864;border-radius:14px;background:#141a27;color:#b8c3d8;box-shadow:0 22px 70px #0000009e}.help-head[data-v-12773018]{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:18px 20px 15px;border-bottom:1px solid #2b354a;background:linear-gradient(135deg,#202942,#181e2d)}.help-head h2[data-v-12773018]{margin:0;color:#eef2ff;font-size:19px}.help-head p[data-v-12773018]{margin:5px 0 0;color:#7786a3;font-size:11px}.help-close[data-v-12773018]{width:28px;height:28px;flex:0 0 28px;border:1px solid #43516b;border-radius:6px;background:#273249;color:#ccd7ed;cursor:pointer}.help-close[data-v-12773018]:hover{border-color:#7774ff;background:#3b4670;color:#fff}.help-body[data-v-12773018]{min-height:0;overflow:auto;padding:18px 20px 21px}.help-section[data-v-12773018]{padding:14px 15px;border:1px solid #2c3850;border-radius:10px;background:#181f2e}.help-section h3[data-v-12773018]{margin:0 0 11px;color:#9fb2ff;font-size:13px}.help-start ol[data-v-12773018]{margin:0;padding-left:21px;color:#aab6cc;font-size:12px;line-height:1.75}.help-start li[data-v-12773018]::marker{color:#7774ff;font-weight:700}.help-section b[data-v-12773018]{color:#dce4f7}.help-grid[data-v-12773018]{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(250px,.85fr);gap:12px;margin-top:12px}.help-list[data-v-12773018]{display:grid;gap:0;margin:0}.help-list>div[data-v-12773018]{display:grid;grid-template-columns:78px 1fr;gap:9px;padding:7px 0;border-bottom:1px solid #263146}.help-list>div[data-v-12773018]:last-child{border-bottom:0}.help-list dt[data-v-12773018]{color:#d3dcf0;font-size:11px;font-weight:700}.help-list dd[data-v-12773018]{margin:0;color:#8795ae;font-size:11px;line-height:1.5}.shortcut-list[data-v-12773018]{display:grid;gap:7px}.shortcut-list>div[data-v-12773018]{display:flex;align-items:center;min-height:25px;gap:5px}.shortcut-list kbd[data-v-12773018]{min-width:24px;box-sizing:border-box;padding:3px 6px;border:1px solid #465470;border-bottom-width:2px;border-radius:5px;background:#101623;color:#e0e7f6;font:10px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center}.shortcut-list span[data-v-12773018]{color:#65728b;font-size:10px}.shortcut-list em[data-v-12773018]{margin-left:auto;color:#9ca9c1;font-size:11px;font-style:normal}.help-note[data-v-12773018]{margin:11px 0 0;padding-top:9px;border-top:1px solid #2a3549;color:#697791;font-size:10px;line-height:1.55}.help-export[data-v-12773018]{margin-top:12px}.help-export p[data-v-12773018]{margin:0;color:#8997b0;font-size:11px;line-height:1.65}.help-doc-title[data-v-12773018]{margin:16px 2px 2px;color:#9fb2ff;font-size:13px;font-weight:700;letter-spacing:.5px}.help-module[data-v-12773018]{margin-top:12px}.help-module-head[data-v-12773018]{display:flex;align-items:center;gap:8px;width:100%;padding:0;border:0;background:transparent;color:#9fb2ff;font:inherit;font-size:13px;font-weight:700;text-align:left;cursor:pointer}.help-module-head[data-v-12773018]:hover{color:#fff}.help-module-head .mtitle[data-v-12773018]{flex:1;min-width:0}.help-module-head .caret[data-v-12773018]{flex:0 0 auto;color:#7b86a2;font-size:12px}.help-module.open .help-module-head[data-v-12773018]{color:#fff}.help-module.open .help-module-head .caret[data-v-12773018]{color:#9fb2ff}.help-module .mnum[data-v-12773018]{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;background:linear-gradient(135deg,#4a53b8,#6a5fd0);color:#fff;font-size:12px;font-weight:700}.help-module.help-connector[data-v-12773018]{border-color:#4a4f8a;background:linear-gradient(135deg,#1d2442,#181d2f)}.help-module.help-connector .help-module-head[data-v-12773018]{color:#b8c2ff}.help-module .connector-intro[data-v-12773018]{margin:0 0 10px;color:#9aa8c4;font-size:11px;line-height:1.6}.help-module .connector-intro b[data-v-12773018]{color:#dce4f7}.help-module .dl-link[data-v-12773018]{display:inline-flex;flex-direction:column;align-items:flex-start;gap:2px;margin:0 10px 6px 0;padding:6px 12px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;font-size:12px;font-weight:700;text-decoration:none}.help-module .dl-link[data-v-12773018]:hover{border-color:#8982ff;background:#554dc2}.help-module .dl-link small[data-v-12773018]{color:#cfe0ff;font-weight:500;font-size:9px}.help-module-body[data-v-12773018]{padding-top:10px}@media(max-width:760px){.help-overlay[data-v-12773018]{padding:66px 12px 14px}.help-grid[data-v-12773018]{grid-template-columns:1fr}}.topbar[data-v-4749834a]{position:absolute;top:10px;left:10px;right:10px;display:flex;align-items:center;gap:10px;padding:8px 12px;background:#141420d9;border-radius:10px;border:1px solid rgba(255,255,255,.08);font-size:12px;color:#aab;z-index:5;flex-wrap:wrap}.topbar input[type=range][data-v-4749834a]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px}.tool-group[data-v-4749834a]{display:flex;gap:6px;margin-left:6px;padding-left:12px;border-left:1px solid #2a2a3c}.tool-btn[data-v-4749834a]{width:30px;height:26px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center}.tool-btn[data-v-4749834a]:hover{background:#2b3a5c;color:#fff}.tool-btn.on[data-v-4749834a]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.background-menu[data-v-4749834a]{position:relative;flex:0 0 auto}.background-btn[data-v-4749834a]{height:28px;padding:0 11px;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cbd7ed;font-size:12px;cursor:pointer}.background-btn[data-v-4749834a]:hover,.background-btn.on[data-v-4749834a]{border-color:#7774ff;background:#343b63;color:#fff}.background-panel[data-v-4749834a]{position:absolute;top:calc(100% + 9px);right:0;width:248px;box-sizing:border-box;padding:10px;border:1px solid #343b50;border-radius:9px;background:#141420fa;color:#aeb8cc;box-shadow:0 8px 24px #0000007a;z-index:12}.background-upload[data-v-4749834a]{width:100%;height:30px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;cursor:pointer}.background-upload[data-v-4749834a]:hover{border-color:#8982ff;background:#554dc2}.background-clear[data-v-4749834a]{width:100%;height:28px;margin-top:6px;border:1px solid #70404a;border-radius:6px;background:#512a33;color:#efb5bd;cursor:pointer}.background-clear[data-v-4749834a]:hover:not(:disabled){border-color:#b65b6a;background:#6a303b;color:#fff}.background-clear[data-v-4749834a]:disabled{opacity:.42;cursor:not-allowed}.background-file-input[data-v-4749834a]{display:none}.background-file-name[data-v-4749834a]{margin:7px 2px 9px;overflow:hidden;color:#737f98;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.background-position-row[data-v-4749834a]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.background-position-row label[data-v-4749834a]{display:flex;align-items:center;gap:5px;color:#8995ad;font-size:11px}.background-position-row input[data-v-4749834a]{width:0;min-width:0;flex:1;box-sizing:border-box;height:28px;padding:0 6px;border:1px solid #343e55;border-radius:5px;background:#101522;color:#e1e6f2}.background-opacity-row[data-v-4749834a]{display:grid;grid-template-columns:46px 1fr 34px;align-items:center;gap:7px;margin-top:10px;font-size:11px}.background-opacity-row input[data-v-4749834a]{min-width:0;accent-color:#675de0}.background-opacity-row b[data-v-4749834a]{color:#aeb8cc;font-size:10px;text-align:right;font-variant-numeric:tabular-nums}.help-btn[data-v-4749834a]{height:28px;margin-left:auto;padding:0 11px;flex:0 0 auto;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cbd7ed;font-size:12px;font-weight:700;cursor:pointer}.help-btn[data-v-4749834a]:hover,.help-btn.on[data-v-4749834a]{border-color:#7774ff;background:#343b63;color:#fff}.zoom-pct[data-v-4749834a]{margin-left:0;font-variant-numeric:tabular-nums;color:#9aa;min-width:44px;text-align:center}.settings-btn[data-v-4749834a]{height:28px;padding:0 12px;flex:0 0 auto;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cdf;font-size:12px;font-weight:700;cursor:pointer}.settings-btn[data-v-4749834a]:hover{border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-4749834a]{width:30px;height:28px;flex:0 0 30px;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cdd8ed;font-size:18px;line-height:1;cursor:pointer}.undo-btn[data-v-4749834a]:hover:not(:disabled){border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-4749834a]:disabled{opacity:.38;cursor:not-allowed}.settings-panel[data-v-1bba85d9]{position:absolute;top:52px;left:10px;width:240px;z-index:10;background:#141420f7;border:1px solid #2a2a3c;border-radius:10px;padding:10px 12px;font-size:12px;color:#aab;box-shadow:0 6px 20px #0006}.sp-head[data-v-1bba85d9]{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:#cdf;margin-bottom:10px}.sp-section-title[data-v-1bba85d9]{margin:2px 0 8px;color:#8a93bb;font-size:11px}.sp-switch-row[data-v-1bba85d9]{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#aab}.sp-switch-control[data-v-1bba85d9]{display:inline-flex;align-items:center;gap:7px}.sp-switch-control input[data-v-1bba85d9]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.sp-switch-ui[data-v-1bba85d9]{position:relative;width:34px;height:18px;border-radius:999px;background:#39445a;cursor:pointer;transition:background .16s ease}.sp-switch-ui[data-v-1bba85d9]:after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#f4f6fb;transition:transform .16s ease}.sp-switch-control input:checked+.sp-switch-ui[data-v-1bba85d9]{background:#655df0}.sp-switch-control input:checked+.sp-switch-ui[data-v-1bba85d9]:after{transform:translate(16px)}.sp-switch-control input:focus-visible+.sp-switch-ui[data-v-1bba85d9]{outline:2px solid #8b86ff;outline-offset:2px}.sp-switch-control b[data-v-1bba85d9]{min-width:24px;color:#8a93bb;font-size:11px;font-weight:500}.sp-cache-note[data-v-1bba85d9]{margin-top:10px;padding-top:9px;border-top:1px solid #2a2a3c;color:#647089;font-size:10px;text-align:center}.sp-divider[data-v-1bba85d9]{height:1px;margin:10px 0;background:#2a2a3c}.sp-close[data-v-1bba85d9]{background:#2e3a55;border:none;color:#cdf;border-radius:4px;width:18px;height:18px;cursor:pointer;font-size:11px}.sp-row[data-v-1bba85d9]{display:flex;align-items:center;gap:8px;margin:8px 0}.sp-row>span[data-v-1bba85d9]:first-child{width:76px;flex-shrink:0;color:#8a93bb}.sp-row input[type=range][data-v-1bba85d9]{flex:1;background:#1a1a28;accent-color:#3a5a8c}.sp-num[data-v-1bba85d9]{width:52px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;padding:2px 4px}.sp-undo-limit[data-v-1bba85d9]{margin-left:auto;width:64px;height:26px;box-sizing:border-box}.sp-colr[data-v-1bba85d9]{width:26px;height:22px;border:none;background:none;cursor:pointer}.sp-hex[data-v-1bba85d9]{font-size:11px;color:#889;font-variant-numeric:tabular-nums}.sp-chk[data-v-1bba85d9]{display:flex;align-items:center;gap:6px;margin:8px 0;color:#aab}.stage-wrap[data-v-384a3641]{position:relative;width:100%;height:100%;overflow:hidden}.stage-holder[data-v-384a3641]{width:100%;height:100%;cursor:grab;touch-action:none;background-color:#0e1219;outline:none}.stage-holder.grid[data-v-384a3641]{background:conic-gradient(#141a26 90deg,transparent 90deg 180deg,#141a26 180deg 270deg,#141a26 180deg 270deg,transparent 270deg);background-size:28px 28px}.stage-holder[data-v-384a3641]:active{cursor:grabbing}.hud[data-v-384a3641]{position:absolute;bottom:12px;left:12px;padding:8px 12px;background:#141420bf;border-radius:8px;font-size:12px;color:#a0a8cc}.hud-number[data-v-384a3641]{display:inline-block;box-sizing:border-box;text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1}.hud-system-count[data-v-384a3641]{width:3ch}.hud-particle-count[data-v-384a3641]{width:7ch;text-align:left}.hud-tip[data-v-384a3641]{margin-left:12px;color:#5f6a8a;font-size:11px}b[data-v-384a3641]{color:#fc3}.config-management-body[data-v-cb52d3e0]{padding-bottom:2px}.config-toolbar[data-v-cb52d3e0]{display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:6px;margin-bottom:10px}.config-toolbar button[data-v-cb52d3e0],.config-toolbar select[data-v-cb52d3e0]{min-width:0;height:30px;box-sizing:border-box;border:1px solid #3b4864;border-radius:6px;background:#263149;color:#d6def0;font-size:11px}.config-toolbar button[data-v-cb52d3e0]{padding:0 9px;cursor:pointer}.config-toolbar button[data-v-cb52d3e0]:hover{border-color:#7169dc;background:#343d68;color:#fff}.config-toolbar select[data-v-cb52d3e0]{padding:0 7px;overflow:hidden;text-overflow:ellipsis}.config-toolbar select[data-v-cb52d3e0]:disabled{color:#68738a;background:#1b2130}.config-message[data-v-cb52d3e0]{margin:-4px 0 9px;color:#83b9a2;font-size:10px}.config-message.error[data-v-cb52d3e0]{color:#e8959e}.group[data-v-cb52d3e0]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-cb52d3e0]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-cb52d3e0]:hover{background:#20202e}.group-body[data-v-cb52d3e0]{padding:8px 10px 12px}.caret[data-v-cb52d3e0]{display:inline-block;width:12px;color:#667;font-size:11px}.ns[data-v-7c2fbed0]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.ns-label[data-v-7c2fbed0]{width:60px;flex-shrink:0;color:#8a93bb}.ns-range[data-v-7c2fbed0]{flex:1;accent-color:#3a7cd6}.ns-num[data-v-7c2fbed0]{width:56px;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;text-align:right}.ns.disabled[data-v-7c2fbed0]{opacity:.55}.ns.disabled .ns-range[data-v-7c2fbed0],.ns.disabled .ns-num[data-v-7c2fbed0]{cursor:not-allowed}.ce[data-v-9bfb7b31]{display:flex;align-items:flex-start;gap:6px;width:100%}.ce-editor[data-v-9bfb7b31]{flex:1;min-width:0}.ce-reset[data-v-9bfb7b31]{flex:0 0 auto;padding:5px 7px;border:1px solid #3b4b65;border-radius:5px;background:#242f42;color:#c4cee2;font-size:10px;cursor:pointer}.ce-reset[data-v-9bfb7b31]:hover{border-color:#7774ff;background:#4f4dc2;color:#fff}.ce-svg[data-v-9bfb7b31]{width:100%;height:110px;display:block;border:1px solid #2a2a3c;border-radius:6px;background:#10101a;cursor:crosshair;touch-action:none}.ce-grid line[data-v-9bfb7b31]{stroke:#1e1e30;stroke-width:1}.ce-frame[data-v-9bfb7b31]{stroke:#2e2e44;stroke-width:1}.ce-line[data-v-9bfb7b31]{stroke:#6ea0e8;stroke-width:2;stroke-linejoin:round}.ce-handles line[data-v-9bfb7b31]{stroke:#8d96b5;stroke-width:1;stroke-dasharray:3 2}.ce-handles circle[data-v-9bfb7b31]{fill:#b7c2dd;stroke:#344d94;stroke-width:1.2;cursor:grab}.ce-handles circle[data-v-9bfb7b31]:active{cursor:grabbing}.ce-node[data-v-9bfb7b31]{fill:#fff;stroke:#3a55aa;stroke-width:1.6;pointer-events:none}.ce-hit[data-v-9bfb7b31]{fill:transparent;stroke:none;cursor:grab}.ce-hit[data-v-9bfb7b31]:active{cursor:grabbing}.ce-nav[data-v-9bfb7b31]{display:flex;justify-content:space-between;margin-top:3px}.ce-tip[data-v-9bfb7b31]{color:#566;font-size:10px}.spine-editor[data-v-9257fb45]{display:grid;gap:10px;color:#c5cbe0}.editor-title[data-v-9257fb45],.section-title[data-v-9257fb45]{color:#dce2f5;font-weight:700}.editor-title[data-v-9257fb45]{padding-bottom:9px;border-bottom:1px solid #30394d}.grid[data-v-9257fb45]{display:grid;gap:8px}.grid.three[data-v-9257fb45]{grid-template-columns:repeat(3,minmax(0,1fr))}.field[data-v-9257fb45]{display:grid;gap:5px;min-width:0;color:#919bb7;font-size:12px}.field input[data-v-9257fb45],.field select[data-v-9257fb45],.asset-name[data-v-9257fb45]{box-sizing:border-box;width:100%;min-width:0;height:35px;padding:0 10px;color:#e2e6f3;background:#101625;border:1px solid #32405b;border-radius:6px}.divider[data-v-9257fb45]{height:1px;background:#30394d;margin:2px 0}.asset-row[data-v-9257fb45]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.asset-name[data-v-9257fb45]{display:flex;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#7f8aa7}button[data-v-9257fb45]{height:35px;padding:0 13px;border:1px solid #3b4a67;border-radius:6px;background:#33415b;color:#e2e6f3;cursor:pointer}button[data-v-9257fb45]:hover{filter:brightness(1.13)}button[data-v-9257fb45]:disabled{opacity:.55;cursor:wait}.folder-select[data-v-9257fb45]{width:100%;border-color:#6659c7;background:#4940a8;color:#fff}.folder-hint[data-v-9257fb45]{margin-top:-5px;color:#69758e;font-size:10px;line-height:1.45}.asset-actions[data-v-9257fb45]{display:grid;grid-template-columns:1fr 1fr;gap:5px}.asset-actions .load[data-v-9257fb45]{background:#5543df;border-color:#6959ec}.asset-actions .clear[data-v-9257fb45]{background:#702b34;border-color:#803842}.runtime-note[data-v-9257fb45]{color:#69758e;font-size:11px;text-align:center}.error[data-v-9257fb45]{padding:8px 10px;color:#ffabb2;background:#4b2028;border:1px solid #76323e;border-radius:6px;font-size:12px}.section-box[data-v-9257fb45]{display:grid;gap:8px;padding:10px;background:#182132;border:1px solid #303c54;border-radius:7px}.empty[data-v-9257fb45]{color:#667187;font-size:12px;padding:5px 0}.bone-tree[data-v-9257fb45]{max-height:240px;overflow:auto;padding:4px 0;background:#111827;border-radius:5px}.tree-title-row[data-v-9257fb45]{display:flex;align-items:center;justify-content:space-between;gap:8px}.selected-bone[data-v-9257fb45]{width:auto;min-width:0;max-width:100%;height:24px;flex:0 1 auto;overflow:hidden;padding:0 7px;color:#75819c;background:#182132;border:1px solid transparent;border-radius:5px;font-size:10px;text-align:right;white-space:nowrap;text-overflow:ellipsis}.selected-bone.active[data-v-9257fb45]{color:#aeb9d4;background:#242f44;border-color:#35445e;cursor:pointer}.selected-bone.active[data-v-9257fb45]:hover{border-color:#675ec4;background:#302b57}.selected-bone[data-v-9257fb45]:disabled{opacity:1;cursor:default}.selected-bone strong[data-v-9257fb45]{color:#c5cde3;font-weight:600}.tree-action[data-v-9257fb45]{height:24px;padding:0 8px;color:#9aa7c2;background:#242f44;border-color:#35445e;font-size:10px}.bone-search[data-v-9257fb45]{position:relative}.bone-search input[data-v-9257fb45]{box-sizing:border-box;width:100%;height:30px;padding:0 32px 0 9px;color:#dce2f2;background:#101827;border:1px solid #33415b;border-radius:5px;font-size:11px;outline:none}.bone-search input[data-v-9257fb45]:focus{border-color:#7065df;box-shadow:0 0 0 1px #7065df38}.bone-search button[data-v-9257fb45]{position:absolute;top:3px;right:3px;width:24px;height:24px;padding:0;border:0;color:#8d98b0;background:transparent}.bone[data-v-9257fb45]{display:flex;align-items:center;gap:4px;min-height:25px;color:#aeb8d2;font-size:12px;border-bottom:1px solid rgba(72,84,112,.22);cursor:pointer;outline:none}.bone[data-v-9257fb45]:hover{background:#45567e38}.bone.selected[data-v-9257fb45]{color:#f0edff;background:#6b53dd52;box-shadow:inset 2px 0 #8e72ff}.bone[data-v-9257fb45]:focus-visible{box-shadow:inset 0 0 0 1px #7d72dd}.bone-toggle[data-v-9257fb45]{width:22px;height:22px;padding:0;border:0;background:transparent;color:#9aa7c2}.bone-toggle[data-v-9257fb45]:hover{background:#26324a}.bone-leaf[data-v-9257fb45]{display:inline-flex;width:22px;justify-content:center;color:#58647d}.bone-name[data-v-9257fb45]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media(max-width:430px){.grid.three[data-v-9257fb45]{grid-template-columns:1fr}}.panel[data-v-3873124f]{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden;background:#14141f;border-left:1px solid #2a2a3c;padding:12px;box-sizing:border-box}.empty[data-v-3873124f],.panel-hint[data-v-3873124f]{color:#667;font-size:12px;padding:8px 0}.group[data-v-3873124f]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-3873124f]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-3873124f]:hover{background:#20202e}.scene-head[data-v-3873124f]{padding-right:6px}.scene-actions[data-v-3873124f]{margin-left:auto;display:flex;align-items:center;gap:4px}.scene-add[data-v-3873124f]{height:24px;padding:0 6px;border:1px solid #3a4a6a;border-radius:5px;background:#2e3a55;color:#cdf;font-size:10px;white-space:nowrap;cursor:pointer}.scene-add[data-v-3873124f]:hover{border-color:#7774ff;background:#45426f;color:#fff}.scene-add[data-v-3873124f]:disabled{opacity:.42;cursor:not-allowed;border-color:#343a4b;background:#252a38;color:#778095}.group-body[data-v-3873124f]{padding:8px 10px 12px}.caret[data-v-3873124f]{display:inline-block;width:12px;color:#667;font-size:11px}.tree[data-v-3873124f]{margin-bottom:8px}.tree-item[data-v-3873124f]{display:flex;align-items:center;gap:6px;padding:5px 6px;font-size:12px;color:#bcd;border-radius:6px;margin-bottom:2px}.tree-item.on[data-v-3873124f]{background:#26324a;color:#ffe}.tree-item .tdot[data-v-3873124f]{color:#fc3;font-size:10px}.tree-item .tdot.dim[data-v-3873124f]{color:#556}.tree-item .tdot.collision-dot[data-v-3873124f]{color:#ff7070}.tree-item .tdot.path-dot[data-v-3873124f]{color:#ff933e;font-size:14px}.tree-item .tdot.spine-dot[data-v-3873124f]{color:#c08cff;font-size:11px}.tree-item .tlabel[data-v-3873124f]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.scene-tree[data-v-3873124f]{padding-bottom:8px;border-bottom:1px solid #2a2a3c}.scene-object-item[data-v-3873124f]{min-height:28px;cursor:pointer}.scene-object-item[data-v-3873124f]:hover{background:#202b40}.scene-object-kind[data-v-3873124f]{color:#75829c;font-size:10px}.scene-object-eye[data-v-3873124f]{width:24px;height:22px;padding:3px;flex:0 0 24px;border:1px solid transparent;border-radius:5px;background:transparent;color:#9aa6bf;cursor:pointer}.scene-object-eye[data-v-3873124f]:hover{border-color:#4b5972;background:#29354a;color:#e1e7f4}.scene-object-eye.off[data-v-3873124f]{color:#59647a}.scene-object-eye svg[data-v-3873124f]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.scene-object-eye .eye-slash[data-v-3873124f]{stroke:#d47b88;stroke-width:2}.scene-object-delete[data-v-3873124f]{width:24px;height:22px;padding:0;border:1px solid #59414a;border-radius:5px;background:#3a272f;color:#efb4bd;font-size:11px;cursor:pointer}.scene-object-delete[data-v-3873124f]:hover{border-color:#a45c69;background:#57303a;color:#fff}.object-editor-title[data-v-3873124f]{margin:10px 0 8px;padding-top:8px;border-top:1px solid #2a2a3c;color:#cbd4e8;font-weight:700}.field-block[data-v-3873124f]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-3873124f]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-3873124f]{color:#5f6d86;line-height:1.5}.field-grid[data-v-3873124f]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-3873124f]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-3873124f]{width:100%;min-height:30px;box-sizing:border-box}.check-field[data-v-3873124f]{align-items:flex-start}.check-field input[data-v-3873124f]{width:18px;height:18px;margin:4px 0;accent-color:#4f7ee8}.follow-path[data-v-3873124f],.setting-line[data-v-3873124f]{display:flex;align-items:center;gap:8px;margin:12px 0 4px;color:#aeb8cf;font-size:12px}.setting-line[data-v-3873124f]{justify-content:space-between}.follow-path input[data-v-3873124f],.setting-line input[type=checkbox][data-v-3873124f]{width:17px;height:17px;accent-color:#4f7ee8}.collider-follow-section[data-v-3873124f]{margin-top:12px;padding-top:4px;border-top:1px solid #30394d}.collider-curve-title[data-v-3873124f]{display:flex;flex-direction:column;gap:3px;margin:12px 0 6px;color:#aeb8cf;font-size:12px}.collider-curve-title small[data-v-3873124f]{color:#67738c;font-size:10px;line-height:1.45}.path-color[data-v-3873124f]{width:48px;height:28px;padding:0;border:1px solid #3a4963;background:transparent;cursor:pointer}.path-help[data-v-3873124f]{margin:12px 0;color:#7d89a2;font-size:11px;line-height:1.55}.path-help>span[data-v-3873124f]{color:#aeb8cf}.path-help ul[data-v-3873124f]{margin:6px 0 0;padding-left:20px}.path-help li[data-v-3873124f]{margin:3px 0}.path-action[data-v-3873124f]{width:100%;height:31px;margin-top:7px;border:0;border-radius:5px;background:#33425b;color:#c9d1e1;cursor:pointer}.path-action[data-v-3873124f]:hover{filter:brightness(1.12)}.path-action.primary[data-v-3873124f]{background:#f05408;color:#fff}.row[data-v-3873124f]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-3873124f]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-3873124f]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.inp.tiny[data-v-3873124f]{width:46px;flex:0 0 46px;text-align:center}.seed-row[data-v-3873124f]{display:flex;align-items:center;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid #2d3950}.seed-row label[data-v-3873124f]{width:64px;color:#8f9bb5;font-size:12px}.seed-input[data-v-3873124f]{min-width:0;flex:1;padding:6px 8px;border:1px solid #344158;border-radius:6px;outline:none;background:#0f1625;color:#e2e7f2;font-size:12px}.seed-input[data-v-3873124f]:focus{border-color:#625ff1}.seed-random[data-v-3873124f]{width:34px;height:30px;border:1px solid #3a4860;border-radius:6px;background:#2c3950;color:#d7def0;cursor:pointer}.seed-random[data-v-3873124f]:hover{background:#394964}.scene-seed[data-v-3873124f]{margin-top:10px}.seed-hint[data-v-3873124f]{margin:5px 0 1px 72px;color:#657188;font-size:9px;line-height:1.45}.group[data-v-59bf8cf4]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-59bf8cf4]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-59bf8cf4]:hover{background:#20202e}.group-reset[data-v-59bf8cf4]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-59bf8cf4]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-59bf8cf4]{padding:8px 10px 12px}.caret[data-v-59bf8cf4]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-59bf8cf4]{height:1px;background:#2a2a3c;margin:8px 0}.row[data-v-59bf8cf4]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-59bf8cf4]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-59bf8cf4]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.segs[data-v-59bf8cf4]{display:flex;gap:6px;margin:6px 0}.stream-behavior-segs[data-v-59bf8cf4]{margin-top:10px}.stream-loop-options[data-v-59bf8cf4]{display:grid;gap:8px;margin:8px 0 4px;padding:9px 10px;border:1px solid #32405a;border-radius:6px;background:#171f2e}.loop-section-row[data-v-59bf8cf4]{display:flex;min-height:27px;align-items:center;justify-content:space-between;gap:8px}.loop-duration-control[data-v-59bf8cf4]{display:flex;flex:0 0 auto;align-items:center;gap:7px}.loop-duration-toggle[data-v-59bf8cf4]{gap:5px;font-size:10px;white-space:nowrap}.loop-duration-toggle .switch-ui[data-v-59bf8cf4]{width:26px;height:14px}.loop-duration-toggle .switch-ui[data-v-59bf8cf4]:after{width:10px;height:10px}.loop-duration-toggle input:checked+.switch-ui[data-v-59bf8cf4]:after{transform:translate(12px)}.loop-section-duration[data-v-59bf8cf4]{display:flex;flex:0 0 auto;align-items:center;gap:4px;color:#7f8ba4;font-size:11px}.loop-section-duration input[data-v-59bf8cf4]{position:static;width:54px;height:25px;padding:0 6px;border:1px solid #3a465f;border-radius:5px;outline:none;background:#101725;color:#e4e8f2;text-align:right;opacity:1;pointer-events:auto}.loop-section-duration input[data-v-59bf8cf4]:focus{border-color:#716eff}.loop-auto-duration[data-v-59bf8cf4]{min-width:54px;color:#77839a;text-align:right;white-space:nowrap}.seg[data-v-59bf8cf4]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-59bf8cf4]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.seg[data-v-59bf8cf4]{display:flex;gap:6px;margin:6px 0}.inp.tiny[data-v-59bf8cf4]{width:46px;flex:0 0 46px;text-align:center}.switch-row[data-v-59bf8cf4]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-59bf8cf4]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-59bf8cf4]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-59bf8cf4]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-59bf8cf4]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-59bf8cf4]:after{transform:translate(14px)}.modifier-hint[data-v-59bf8cf4]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.stream-loop-hint[data-v-59bf8cf4]{margin:9px 2px 3px;padding:7px 8px;border:1px solid #4a436e;border-radius:5px;background:#211f35;color:#aaa4d7}.switch-row input:disabled+.switch-ui[data-v-59bf8cf4]{opacity:.45;cursor:not-allowed}.pac[data-v-238f838c]{padding:10px;margin:8px 0;border:1px solid #2c3850;border-radius:7px;background:#171d2a}.pac-head[data-v-238f838c]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}.pac-label[data-v-238f838c]{color:#aeb8cf;font-size:12px;font-weight:600;white-space:nowrap}.pac-modes[data-v-238f838c]{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end}.pac-mode[data-v-238f838c]{padding:4px 7px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.pac-mode.on[data-v-238f838c]{border-color:#7774ff;background:#605df0;color:#fff}.pac-curve[data-v-238f838c]{margin-top:8px}.pac-axis[data-v-238f838c]{display:flex;justify-content:space-between;margin-top:3px;color:#5f6b82;font-size:10px}.pac[data-v-238f838c] .ns-label{width:58px}.pac[data-v-238f838c] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.pac[data-v-238f838c] .ce-tip{color:#657188}.group[data-v-cf6b86a5]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-cf6b86a5]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-cf6b86a5]:hover{background:#20202e}.group-reset[data-v-cf6b86a5]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-cf6b86a5]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-cf6b86a5]{padding:8px 10px 12px}.caret[data-v-cf6b86a5]{display:inline-block;width:12px;color:#667;font-size:11px}.row[data-v-cf6b86a5]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-cf6b86a5]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.attr-body[data-v-cf6b86a5]{padding:10px;background:#151b27}.attr-section-title[data-v-cf6b86a5]{margin:2px 0 8px;color:#9ca8c0;font-size:12px;font-weight:700}.attr-section-title.life-title[data-v-cf6b86a5]{margin-top:14px;padding-top:12px;border-top:1px solid #2d3950}.attr-axis-head[data-v-cf6b86a5]{display:flex;align-items:center;justify-content:space-between;margin:10px 1px -2px;color:#aeb8cf;font-size:12px;font-weight:600}.axis-modes[data-v-cf6b86a5]{display:flex;gap:4px}.axis-mode[data-v-cf6b86a5]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-cf6b86a5]{border-color:#7774ff;background:#605df0;color:#fff}.life-item[data-v-cf6b86a5]{padding:9px 0;border-bottom:1px solid #2a3549}.switch-row[data-v-cf6b86a5]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-cf6b86a5]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-cf6b86a5]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-cf6b86a5]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-cf6b86a5]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-cf6b86a5]:after{transform:translate(14px)}.life-axis[data-v-cf6b86a5]{margin:9px 0 2px 42px}.switch-row input:disabled+.switch-ui[data-v-cf6b86a5]{opacity:.45;cursor:not-allowed}.gradient-editor[data-v-f6ab10bf]{margin:8px 0 11px 68px}.gradient-bar[data-v-f6ab10bf]{position:relative;height:18px;margin-bottom:14px;border:1px solid #465570;border-radius:6px;cursor:crosshair}.gradient-stop[data-v-f6ab10bf]{position:absolute;top:15px;width:14px;height:17px;padding:0;transform:translate(-50%);border:2px solid #d8deea;border-radius:2px 2px 5px 5px;background:var(--stop-color);cursor:grab;box-shadow:0 1px 3px #0009}.gradient-stop[data-v-f6ab10bf]:before{content:"";position:absolute;left:2px;top:-7px;border-left:3px solid transparent;border-right:3px solid transparent;border-bottom:5px solid #d8deea}.gradient-stop.selected[data-v-f6ab10bf]{outline:2px solid #7774ff;outline-offset:1px;z-index:2}.gradient-stop[data-v-f6ab10bf]:active{cursor:grabbing}.gradient-controls[data-v-f6ab10bf]{display:flex;align-items:center;gap:5px;margin-top:30px}.gradient-color[data-v-f6ab10bf]{width:28px;height:24px;padding:1px;border:1px solid #465570;border-radius:4px;background:#151b27;cursor:pointer}.gradient-hex-input[data-v-f6ab10bf]{width:66px;padding:4px 5px;border:1px solid #344158;border-radius:4px;outline:none;background:#101725;color:#aeb8cb;font-size:10px;font-family:monospace}.gradient-hex-input[data-v-f6ab10bf]:focus{border-color:#7774ff;color:#fff}.gradient-position[data-v-f6ab10bf]{display:flex;align-items:center;color:#71809a;font-size:10px}.gradient-position input[data-v-f6ab10bf]{width:43px;padding:3px 4px;border:1px solid #344158;border-radius:4px;outline:none;background:#101725;color:#dce3ef;text-align:right}.gradient-action[data-v-f6ab10bf]{width:25px;height:24px;padding:0;border:1px solid #3a4860;border-radius:4px;background:#273246;color:#cbd4e5;cursor:pointer}.gradient-action[data-v-f6ab10bf]:hover:not(:disabled){border-color:#7774ff;color:#fff}.gradient-action.danger[data-v-f6ab10bf]{color:#e3a5aa}.gradient-action[data-v-f6ab10bf]:disabled{opacity:.35;cursor:not-allowed}.gradient-hint[data-v-f6ab10bf]{margin-top:5px;color:#59667b;font-size:9px}.image-card[data-v-68ff5314]{margin:8px 0;padding:9px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.imgrow[data-v-68ff5314]{display:flex;align-items:flex-start;gap:8px}.img-thumb[data-v-68ff5314]{width:48px;height:48px;padding:0;border:1px solid #3a4963;border-radius:6px;background:#1a2232;display:flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer;overflow:hidden}.img-thumb[data-v-68ff5314]:hover{border-color:#7774ff}.img-thumb img[data-v-68ff5314]{display:block;width:100%;height:100%;object-fit:contain}.img-fields[data-v-68ff5314]{flex:1;min-width:0}.img-actions[data-v-68ff5314]{display:flex;flex-direction:column;gap:4px}.row[data-v-68ff5314]{display:flex;align-items:center;gap:8px;margin:6px 0;color:#aab;font-size:12px}.row>span[data-v-68ff5314]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-68ff5314]{min-width:0;flex:1;padding:3px 5px;border:1px solid #2e2e44;border-radius:5px;background:#1a1a28;color:#dde;font-size:12px}.mini-btn2[data-v-68ff5314]{width:26px;height:24px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:5px;color:#aab;font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center}.mini-btn2[data-v-68ff5314]:hover{background:#2b3a5c}.mini-btn2[data-v-68ff5314]:disabled{opacity:.35;cursor:not-allowed}.thumb-note[data-v-68ff5314]{margin:4px 0 2px;color:#667;font-size:11px}.sequence-pick[data-v-68ff5314]{width:100%;margin:2px 0 4px;padding:6px 8px;border:1px solid #4a4a76;border-radius:5px;background:#27264b;color:#d8d7ff;font-size:12px;cursor:pointer}.sequence-pick[data-v-68ff5314]:hover{border-color:#7774ff;background:#35336a}.sequence-note[data-v-68ff5314]{margin:0 0 6px;color:#727b9b;font-size:11px;line-height:1.4}.resource-weight-row[data-v-68ff5314]{display:grid;grid-template-columns:minmax(0,1fr) 28px;align-items:center;gap:7px}.resource-weight-control[data-v-68ff5314]{width:100%;min-width:0}.resource-weight-control[data-v-68ff5314] .ns-range{min-width:0}.resource-weight-control[data-v-68ff5314] .ns-num{flex:0 0 56px;box-sizing:border-box}.weight-lock[data-v-68ff5314]{width:28px;height:26px;flex:0 0 28px;padding:5px;border:1px solid #35435c;border-radius:5px;background:#202a3b;color:#78859e;cursor:pointer}.weight-lock svg[data-v-68ff5314]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.weight-lock[data-v-68ff5314]:hover:not(:disabled){border-color:#7774ff;color:#b8b6ff}.weight-lock.on[data-v-68ff5314]{border-color:#7774ff;background:#514fd0;color:#fff}.weight-lock[data-v-68ff5314]:disabled{opacity:.35;cursor:not-allowed}.group[data-v-d8fe7aad]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-d8fe7aad]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-d8fe7aad]:hover{background:#20202e}.group-reset[data-v-d8fe7aad]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-d8fe7aad]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-d8fe7aad]{padding:8px 10px 12px}.caret[data-v-d8fe7aad]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-d8fe7aad]{height:1px;background:#2a2a3c;margin:8px 0}.row[data-v-d8fe7aad]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-d8fe7aad]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-d8fe7aad]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.colr[data-v-d8fe7aad]{width:28px;height:22px;border:none;background:none;cursor:pointer}.seg[data-v-d8fe7aad]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-d8fe7aad]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.look-title[data-v-d8fe7aad]{font-size:12px;font-weight:600;color:#ccd;margin:10px 0 6px;padding-bottom:4px;border-bottom:1px solid #2a2a3c}.look-title[data-v-d8fe7aad]:first-child{margin-top:2px}.seg[data-v-d8fe7aad]{display:flex;gap:6px;margin:6px 0}.seg-btn[data-v-d8fe7aad]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg-btn.active[data-v-d8fe7aad]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.curve-wrap[data-v-d8fe7aad]{margin:6px 0}.curve-labels[data-v-d8fe7aad]{display:flex;justify-content:space-between;color:#566;font-size:10px;margin-top:2px}.image-title[data-v-d8fe7aad]{display:flex;align-items:center;justify-content:space-between}.image-add[data-v-d8fe7aad]{width:26px;height:24px;border:1px solid #4a4d9a;border-radius:5px;background:#252850;color:#8f8cff;font-size:18px;line-height:1;cursor:pointer}.image-add[data-v-d8fe7aad]:hover{background:#4542a8;color:#fff}.resource-divider[data-v-d8fe7aad]{height:1px;margin:9px 0 7px;background:#2a3549}.resource-color-row .blend-select[data-v-d8fe7aad]{max-width:88px}.resource-color-picker .hex[data-v-d8fe7aad]{margin-left:0}.random-color-hint[data-v-d8fe7aad]{margin:-5px 0 9px 68px;color:#66758e;font-size:9px;line-height:1.45}.hex-input[data-v-d8fe7aad]{width:72px;padding:4px 6px;border:1px solid #344158;border-radius:5px;outline:none;background:#101725;color:#aeb8cb;font-size:11px;font-family:monospace}.hex-input[data-v-d8fe7aad]:focus{border-color:#7774ff;color:#fff}.resource-alpha-head[data-v-d8fe7aad]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;color:#8a93bb;font-size:12px}.alpha-modes[data-v-d8fe7aad]{display:flex;gap:3px}.alpha-modes button[data-v-d8fe7aad]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-d8fe7aad]:hover{background:#273246}.alpha-modes button.on[data-v-d8fe7aad]{border-color:#7774ff;background:#605df0;color:#fff}.resource-alpha-curve[data-v-d8fe7aad]{margin-top:7px}.file-input[data-v-d8fe7aad]{display:none}.hex[data-v-d8fe7aad]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-d8fe7aad]{width:46px;flex:0 0 46px;text-align:center}.empty[data-v-1798235e]{color:#667;font-size:12px;padding:8px 0}.group[data-v-1798235e]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-1798235e]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-1798235e]:hover{background:#20202e}.group-reset[data-v-1798235e]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-1798235e]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-1798235e]{padding:8px 10px 12px}.caret[data-v-1798235e]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-1798235e]{height:1px;background:#2a2a3c;margin:8px 0}.field-block[data-v-1798235e]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-1798235e]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-1798235e]{color:#5f6d86;line-height:1.5}.field-grid[data-v-1798235e]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-1798235e]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-1798235e]{width:100%;min-height:30px;box-sizing:border-box}.tag[data-v-1798235e]{font-size:10px;color:#667;background:#1c1c2a;border-radius:4px;padding:1px 5px}.row[data-v-1798235e]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-1798235e]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-1798235e]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.colr[data-v-1798235e]{width:28px;height:22px;border:none;background:none;cursor:pointer}.placeholder[data-v-1798235e]{color:#667;font-size:11px;padding:6px 0}.image-add[data-v-1798235e]{width:26px;height:24px;border:1px solid #4a4d9a;border-radius:5px;background:#252850;color:#8f8cff;font-size:18px;line-height:1;cursor:pointer}.image-add[data-v-1798235e]:hover{background:#4542a8;color:#fff}.resource-divider[data-v-1798235e]{height:1px;margin:9px 0 7px;background:#2a3549}.hex-input[data-v-1798235e]{width:72px;padding:4px 6px;border:1px solid #344158;border-radius:5px;outline:none;background:#101725;color:#aeb8cb;font-size:11px;font-family:monospace}.hex-input[data-v-1798235e]:focus{border-color:#7774ff;color:#fff}.alpha-modes[data-v-1798235e]{display:flex;gap:3px}.alpha-modes button[data-v-1798235e]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-1798235e]:hover{background:#273246}.alpha-modes button.on[data-v-1798235e]{border-color:#7774ff;background:#605df0;color:#fff}.file-input[data-v-1798235e]{display:none}.hex[data-v-1798235e]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-1798235e]{width:46px;flex:0 0 46px;text-align:center}.axis-mode[data-v-1798235e]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-1798235e]{border-color:#7774ff;background:#605df0;color:#fff}.switch-row[data-v-1798235e]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-1798235e]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-1798235e]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-1798235e]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-1798235e]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-1798235e]:after{transform:translate(14px)}.modifier-item[data-v-1798235e]{padding:8px 0 10px;border-bottom:1px solid #2a3549}.modifier-switch[data-v-1798235e]{font-weight:600}.modifier-params[data-v-1798235e]{margin:8px 0 0 10px;padding:2px 0 2px 10px;border-left:2px solid #344158}.modifier-hint[data-v-1798235e]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.collision-filter-params[data-v-1798235e]{position:relative;padding-top:5px;padding-bottom:5px}.collision-filter-title[data-v-1798235e]{margin-bottom:8px;color:#9ba7bd;font-size:11px;font-weight:600}.collision-filter-tags[data-v-1798235e]{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.collision-filter-tag[data-v-1798235e]{display:inline-flex;min-width:0;align-items:center;gap:6px;padding:5px 5px 5px 8px;border:1px solid #625ff1;border-radius:6px;background:#514dcf;color:#fff;font-size:11px}.collision-filter-tag>span[data-v-1798235e]{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-tag.disabled[data-v-1798235e]{border-color:#4b5364;background:#343b4b;color:#929bad}.collision-filter-tag button[data-v-1798235e]{width:18px;height:18px;padding:0;border:0;border-radius:4px;background:#0b0f1a38;color:inherit;line-height:16px;cursor:pointer}.collision-filter-tag button[data-v-1798235e]:hover{background:#0b0f1a80;color:#fff}.collision-filter-add[data-v-1798235e]{width:30px;height:30px;padding:0;border:1px dashed #536079;border-radius:6px;background:#182131;color:#98a5bd;font-size:18px;line-height:28px;cursor:pointer}.collision-filter-add[data-v-1798235e]:hover,.collision-filter-add.active[data-v-1798235e]{border-color:#7774ff;background:#262c52;color:#fff}.collision-filter-add[data-v-1798235e]:disabled{opacity:.42;cursor:not-allowed}.collision-filter-empty[data-v-1798235e]{margin-top:7px;color:#6f7b91;font-size:10px}.collision-filter-picker[data-v-1798235e]{display:grid;gap:4px;margin-top:7px;padding:5px;border:1px solid #344158;border-radius:6px;background:#101725}.collision-filter-picker button[data-v-1798235e]{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border:0;border-radius:4px;background:transparent;color:#c7d0e3;font-size:11px;text-align:left;cursor:pointer}.collision-filter-picker button[data-v-1798235e]:hover{background:#29344a;color:#fff}.collision-filter-picker button span[data-v-1798235e]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-picker button small[data-v-1798235e]{flex:none;color:#68758d;font-size:9px}.switch-row input:disabled+.switch-ui[data-v-1798235e]{opacity:.45;cursor:not-allowed}.bone-follow-target[data-v-1798235e]{margin:7px 0 9px;padding:7px 8px;overflow:hidden;color:#7f8ba3;background:#121a29;border:1px solid #2f3c53;border-radius:5px;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.bone-follow-target strong[data-v-1798235e]{color:#c8d0e4;font-weight:600}.bone-follow-missing[data-v-1798235e]{margin:7px 0 9px;padding:7px 8px;color:#d49aa3;background:#2a1e26;border:1px solid #513540;border-radius:5px;font-size:10px;line-height:1.5}.bone-follow-rebind[data-v-1798235e]{width:100%;min-height:28px;margin:0 0 8px;padding:4px 8px;overflow:hidden;border:1px solid #4a436e;border-radius:5px;background:#2d2947;color:#c8c2ee;font-size:10px;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.bone-follow-rebind[data-v-1798235e]:hover{border-color:#7165bd;background:#3a335d;color:#fff}.bone-follow-transform-grid[data-v-1798235e]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.modifier-mode-row[data-v-1798235e]{display:flex;justify-content:flex-end;gap:4px;margin-bottom:6px}.gravity-curve-title[data-v-1798235e]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0 6px;color:#9ba7bd;font-size:11px}.gravity-curve-title span[data-v-1798235e]:last-child{color:#657188;font-size:9px}.gravity-curve-axis[data-v-1798235e]{display:flex;justify-content:space-between;margin:3px 34px 0 1px;color:#5f6b82;font-size:9px}.gravity-params[data-v-1798235e] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.trail-params[data-v-1798235e]{padding-right:2px}.trail-section-title[data-v-1798235e]{margin:3px 0 8px;color:#aeb8cf;font-size:12px;font-weight:700}.trail-fixed-color .hex-input[data-v-1798235e]{min-width:0;flex:1}.trail-mode-head[data-v-1798235e]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0 6px;color:#9ba7bd;font-size:11px}.trail-sub-switch[data-v-1798235e]{margin:11px 0 7px;padding-top:9px;border-top:1px solid #2a3549}.trail-grid-row[data-v-1798235e]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.trail-grid-row[data-v-1798235e] .ns{min-width:0;flex-wrap:wrap;align-items:center}.trail-grid-row[data-v-1798235e] .ns-label{width:100%}.trail-grid-row[data-v-1798235e] .ns-range{min-width:0}.trail-grid-row[data-v-1798235e] .ns-num{width:42px}.trail-params[data-v-1798235e] .ce-svg{height:92px;background:#0f1625;border-color:#30405a}.group[data-v-04462c7a]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-04462c7a]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-04462c7a]:hover{background:#20202e}.group-reset[data-v-04462c7a]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-04462c7a]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-04462c7a]{padding:8px 10px 12px}.caret[data-v-04462c7a]{display:inline-block;width:12px;color:#667;font-size:11px}.row[data-v-04462c7a]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-04462c7a]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-04462c7a]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.placeholder[data-v-04462c7a]{color:#667;font-size:11px;padding:6px 0}.export-settings[data-v-04462c7a]{padding-top:3px}.export-field[data-v-04462c7a]{display:flex;flex-direction:column;gap:6px;margin:10px 0 13px;color:#9ca8bf;font-size:11px;font-weight:600}.export-input[data-v-04462c7a]{width:100%;min-height:34px;box-sizing:border-box;padding:6px 9px;color:#e3e7f2;background:#141a29;border-color:#35445f}.export-fps-row[data-v-04462c7a]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end}.export-fps-field[data-v-04462c7a]{margin-bottom:5px}.export-checkbox[data-v-04462c7a]{display:flex;align-items:center;gap:7px;min-height:34px;margin-bottom:5px;color:#aeb8cc;font-size:11px;white-space:nowrap}.export-checkbox input[data-v-04462c7a]{width:17px;height:17px;margin:0;accent-color:#625ff1}.export-help[data-v-04462c7a]{margin:-6px 0 14px;color:#66758e;font-size:10px;line-height:1.5}.export-switches[data-v-04462c7a]{display:grid;gap:13px;margin:4px 0 7px;padding-top:2px}.export-switch[data-v-04462c7a]{font-weight:600}.export-switch-last[data-v-04462c7a]{margin-top:13px}.inp.tiny[data-v-04462c7a]{width:46px;flex:0 0 46px;text-align:center}.switch-row[data-v-04462c7a]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-04462c7a]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-04462c7a]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-04462c7a]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-04462c7a]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-04462c7a]:after{transform:translate(14px)}.switch-row input:disabled+.switch-ui[data-v-04462c7a]{opacity:.45;cursor:not-allowed}.spine-export-actions[data-v-7ff40afe]{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}.export-spine-json[data-v-7ff40afe]{width:100%;padding:9px 8px;flex:0 0 auto;border:1px solid #4f4b9a;border-radius:7px;background:#403b91;color:#f1f0ff;font-size:12px;font-weight:700;cursor:pointer}.export-spine-json[data-v-7ff40afe]:hover{border-color:#7774ff;background:#514bc0}.export-spine-json[data-v-7ff40afe]:disabled{cursor:wait;opacity:.68}.export-spine-project[data-v-7ff40afe]{grid-column:1 / -1;width:100%;padding:7px 8px;border:1px solid #287d69;border-radius:7px;background:#196854;color:#edfff9;font-size:12px;font-weight:700;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}.export-spine-project small[data-v-7ff40afe]{color:inherit;font-size:9px;font-weight:500;line-height:1.1}.export-spine-project[data-v-7ff40afe]:hover:not(:disabled){border-color:#47c89f;background:#238267}.export-spine-project[data-v-7ff40afe]:disabled{cursor:not-allowed;opacity:.48}.export-spine-images[data-v-7ff40afe]{width:100%;padding:8px;border:1px solid #3b5f8b;border-radius:7px;background:#243e64;color:#eaf3ff;font-size:12px;font-weight:700;cursor:pointer}.export-spine-images[data-v-7ff40afe]:hover:not(:disabled){border-color:#6099dc;background:#315581}.export-spine-images[data-v-7ff40afe]:disabled{cursor:wait;opacity:.55}.connector-status[data-v-7ff40afe]{display:flex;align-items:center;justify-content:center;gap:5px;padding-top:6px;color:#717b99;font-size:10px}.connector-status .connector-dot[data-v-7ff40afe]{width:6px;height:6px;border-radius:50%;background:#66718f}.connector-status.ready[data-v-7ff40afe]{color:#70d8ae}.connector-status.ready .connector-dot[data-v-7ff40afe]{background:#49c993;box-shadow:0 0 5px #49c99388}.connector-status.warning[data-v-7ff40afe]{color:#d4aa67}.connector-status.warning .connector-dot[data-v-7ff40afe]{background:#d4aa67}.connector-status button[data-v-7ff40afe]{padding:0 3px;border:0;background:transparent;color:#8290b6;font-size:10px;cursor:pointer}.connector-status button[data-v-7ff40afe]:hover{color:#c5caff}.connector-status a[data-v-7ff40afe]{padding:0 3px;color:#a8b0ff;font-size:10px;text-decoration:underline}.connector-status a[data-v-7ff40afe]:hover{color:#d8dcff}.export-message[data-v-7ff40afe]{padding:7px 5px 0;color:#70d8ae;font-size:10px;line-height:1.45;text-align:center}.export-message.error[data-v-7ff40afe]{color:#ff858f}.export-message a[data-v-7ff40afe]{display:inline-block;margin-left:5px;color:#9da7ff;text-decoration:underline}.panel[data-v-283ef8eb]{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden;background:#14141f;border-left:1px solid #2a2a3c;padding:12px;box-sizing:border-box}.panel-scroll[data-v-283ef8eb]{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;padding-right:2px;scrollbar-width:thin;scrollbar-color:#2e2e44 transparent}.panel-scroll[data-v-283ef8eb]::-webkit-scrollbar{width:6px}.panel-scroll[data-v-283ef8eb]::-webkit-scrollbar-track{background:transparent}.panel-scroll[data-v-283ef8eb]::-webkit-scrollbar-thumb{background:#2e2e44;border-radius:3px}.panel-scroll[data-v-283ef8eb]::-webkit-scrollbar-thumb:hover{background:#3a3a55}.panel-header[data-v-283ef8eb]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;flex:0 0 auto;font-weight:700;color:#ccd}.timeline[data-v-8d9981a9]{height:100%;background:#12121c;border-top:1px solid #2a2a3c;display:flex;flex-direction:column;padding:6px 10px;gap:4px}.tl-controls[data-v-8d9981a9]{display:flex;align-items:center;gap:8px}.tl-btn[data-v-8d9981a9]{width:30px;height:26px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.tl-btn.on[data-v-8d9981a9]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.tl-range[data-v-8d9981a9]{display:flex;height:25px;align-items:center;gap:3px;color:#778198;font-size:10px}.tl-range input[data-v-8d9981a9]{width:43px;height:25px;padding:0 5px;box-sizing:border-box;border:1px solid #3a3a51;border-radius:5px;outline:none;background:#181824;color:#e1e4ed;font-size:11px;text-align:center}.tl-range input[data-v-8d9981a9]:focus{border-color:#716eff}.tl-loop-range[data-v-8d9981a9]{height:25px;padding:0 7px;border:1px solid #4e5680;border-radius:5px;background:#252943;color:#bfc8e8;font-size:10px;cursor:pointer;white-space:nowrap}.tl-loop-range[data-v-8d9981a9]:hover{border-color:#716eff;color:#fff}.tl-frame[data-v-8d9981a9]{display:inline-block;flex:0 0 92px;width:92px;box-sizing:border-box;font-size:12px;color:#aab;text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}.tl-frame b[data-v-8d9981a9]{display:inline;color:inherit;font-weight:400}.tl-legend[data-v-8d9981a9]{display:flex;align-items:center;gap:4px;color:#778198;font-size:10px}.tl-legend i[data-v-8d9981a9]{display:inline-block;width:10px;height:7px;border-radius:2px}.legend-emission[data-v-8d9981a9]{margin-left:4px;background:#2f8b62}.legend-life[data-v-8d9981a9]{margin-left:5px;background:#a54551}.legend-spine[data-v-8d9981a9]{margin-left:5px;background:#7448b8}.tl-anim[data-v-8d9981a9]{display:flex;align-items:center;gap:6px;font-size:12px;color:#aab}.tl-owner-animation[data-v-8d9981a9]{position:relative}.tl-animation-trigger[data-v-8d9981a9]{display:flex;align-items:center;justify-content:space-between;gap:8px;width:116px;height:25px;padding:0 7px;overflow:hidden;border:1px solid #2e2e44;border-radius:5px;background:#1a1a28;color:#dde;cursor:pointer}.tl-animation-trigger>span[data-v-8d9981a9]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-trigger>i[data-v-8d9981a9]{flex:0 0 auto;color:#8c96ad;font-style:normal}.tl-animation-trigger[data-v-8d9981a9]:disabled{opacity:.5;cursor:not-allowed}.tl-animation-menu[data-v-8d9981a9]{position:absolute;z-index:30;right:0;bottom:calc(100% + 6px);width:226px;padding:7px;border:1px solid #3c4760;border-radius:8px;background:#171b29;box-shadow:0 10px 24px #00000073}.tl-animation-menu-title[data-v-8d9981a9]{padding:2px 4px 6px;color:#77839c;font-size:10px}.tl-animation-option[data-v-8d9981a9]{display:flex;align-items:center;justify-content:space-between;width:100%;height:27px;padding:0 7px;border:0;border-radius:5px;background:transparent;color:#b8c1d5;text-align:left;cursor:pointer}.tl-animation-option>span[data-v-8d9981a9]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-option[data-v-8d9981a9]:hover{background:#252e42}.tl-animation-option.on[data-v-8d9981a9]{background:#34335d;color:#fff}.tl-animation-option>i[data-v-8d9981a9]{color:#8d8aff;font-style:normal}.tl-animation-editor[data-v-8d9981a9]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;margin-top:7px;padding-top:7px;border-top:1px solid #2b3346}.tl-animation-name[data-v-8d9981a9]{min-width:0;height:27px;padding:0 7px;box-sizing:border-box;border:1px solid #343e55;border-radius:5px;background:#101522;color:#e1e6f2;outline:none}.tl-animation-name[data-v-8d9981a9]:focus{border-color:#6865d8}.tl-animation-editor button[data-v-8d9981a9],.tl-animation-actions button[data-v-8d9981a9]{height:27px;padding:0 8px;border:1px solid #3c4861;border-radius:5px;background:#29344a;color:#cbd3e3;cursor:pointer}.tl-animation-actions[data-v-8d9981a9]{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:6px}.tl-animation-actions button[data-v-8d9981a9]:last-child{border-color:#5b3942;background:#3b282f;color:#e2a8b2}.tl-animation-actions button[data-v-8d9981a9]:disabled{opacity:.4;cursor:not-allowed}.tl-animation-error[data-v-8d9981a9]{margin-top:5px;color:#ef8997;font-size:10px}.tl-animation-hint[data-v-8d9981a9]{margin-top:5px;color:#69758d;font-size:9px;text-align:center}.tl-sel[data-v-8d9981a9]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px;padding:2px 6px;font-size:12px}.tl-sel[data-v-8d9981a9]:disabled{opacity:.5;cursor:not-allowed}.tl-spine-preview .tl-sel[data-v-8d9981a9]{max-width:190px}.tl-zoom[data-v-8d9981a9]{margin-left:auto;font-size:11px;color:#667}.tl-viewport[data-v-8d9981a9]{position:relative;flex:1;overflow:hidden;background:#0d0d14;border:1px solid #2a2a3c;border-radius:6px;cursor:ew-resize}.tl-ticks[data-v-8d9981a9]{position:absolute;top:0;left:0;right:0;height:18px}.tl-tickline[data-v-8d9981a9]{position:absolute;top:0;bottom:0;width:1px;background:#263040}.tl-ticklabel[data-v-8d9981a9]{position:absolute;top:2px;transform:translate(-50%);font-size:9px;color:#667}.tl-playhead[data-v-8d9981a9]{position:absolute;top:0;bottom:0;width:2px;background:#fc3;z-index:5;pointer-events:none}.tl-lanes[data-v-8d9981a9]{position:absolute;top:22px;left:0;right:0;bottom:0}.tl-lane[data-v-8d9981a9]{position:relative;height:26px;margin-bottom:4px}.lane-ico[data-v-8d9981a9]{position:absolute;left:4px;top:6px;font-size:11px;color:#dde;z-index:2;pointer-events:none}.lane-bar[data-v-8d9981a9]{position:absolute;top:4px;height:18px;display:flex;align-items:stretch;cursor:grab;box-sizing:border-box}.lane-bar[data-v-8d9981a9]:active{cursor:grabbing}.lane-name[data-v-8d9981a9]{position:absolute;left:14px;right:5px;top:2px;z-index:2;pointer-events:none;font-size:11px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar-life[data-v-8d9981a9]{position:absolute;inset:0 auto 0 0;z-index:0;min-width:1px;border:1px solid #c05a66;border-radius:5px;background:#a54551;box-sizing:border-box}.bar-life.loop-life[data-v-8d9981a9]{border-color:#667085;background:#242b39}.bar-emission[data-v-8d9981a9]{position:absolute;inset:0 auto 0 0;z-index:1;min-width:1px;border:1px solid #45a97d;border-radius:5px 0 0 5px;background:#2f8b62;box-sizing:border-box}.bar-emission.bar-loop[data-v-8d9981a9]{border-radius:0}.bar-loop-transition[data-v-8d9981a9]{position:absolute;top:0;bottom:0;z-index:1;border:1px solid #7d8799;background:#50596a;box-sizing:border-box}.bar-loop-start[data-v-8d9981a9]{left:0;border-radius:5px 0 0 5px}.bar-loop-end[data-v-8d9981a9]{border-radius:0 5px 5px 0}.bar-handle[data-v-8d9981a9]{position:absolute;z-index:4;right:-4px;top:-1px;bottom:-1px;width:8px;cursor:ew-resize;background:#ffffff2e}.bar-handle[data-v-8d9981a9]:hover{background:#ffffff59}.spine-ico[data-v-8d9981a9]{color:#c08cff}.spine-bar[data-v-8d9981a9]{position:absolute;top:4px;height:18px;min-width:1px;box-sizing:border-box;border:1px solid #a575ed;border-radius:5px;background:#7448b8;cursor:grab;box-shadow:inset 0 0 0 1px #ffffff0d}.spine-bar[data-v-8d9981a9]:active{cursor:grabbing}.tl-empty[data-v-8d9981a9]{color:#667;font-size:11px;padding:8px}.transfer-overlay[data-v-592b922e]{position:fixed;z-index:2000;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:auto;cursor:wait;overscroll-behavior:contain;background:#05080f42;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.transfer-dialog[data-v-592b922e]{width:min(420px,calc(100vw - 40px));padding:18px 20px 16px;border:1px solid #414b66;border-radius:10px;box-shadow:0 18px 55px #00000075;background:#171d2b;color:#e7ebf5}.transfer-heading[data-v-592b922e]{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;font-size:14px;font-weight:700}.transfer-heading strong[data-v-592b922e]{color:#a8a6ff;font-size:12px;font-variant-numeric:tabular-nums}.transfer-track[data-v-592b922e]{height:9px;overflow:hidden;border:1px solid #35415a;border-radius:999px;background:#0d1422}.transfer-bar[data-v-592b922e]{height:100%;border-radius:inherit;background:linear-gradient(90deg,#4d75e8,#7774ff);transition:width .16s ease}.transfer-track.indeterminate .transfer-bar[data-v-592b922e]{width:42%;animation:transfer-slide-592b922e 1s ease-in-out infinite}.transfer-detail[data-v-592b922e]{min-height:17px;margin-top:9px;color:#8895ae;font-size:11px;line-height:1.5}.transfer-dialog.failed[data-v-592b922e]{border-color:#754351}.transfer-dialog.failed .transfer-heading strong[data-v-592b922e],.transfer-dialog.failed .transfer-detail[data-v-592b922e]{color:#e99aa9}.transfer-dialog.failed .transfer-bar[data-v-592b922e]{background:#c85d70}.transfer-fade-enter-active[data-v-592b922e],.transfer-fade-leave-active[data-v-592b922e]{transition:opacity .16s ease}.transfer-fade-enter-from[data-v-592b922e],.transfer-fade-leave-to[data-v-592b922e]{opacity:0}@keyframes transfer-slide-592b922e{0%{transform:translate(-110%)}to{transform:translate(250%)}}.layout[data-v-42c4fa00]{display:flex;width:100%;height:100%;min-height:0;overflow:clip}.parameter-panel[data-v-42c4fa00]{flex-shrink:0;height:100%;min-height:0;overflow:clip}.resizer-col[data-v-42c4fa00]{width:5px;cursor:col-resize;background:#1c1c2a;border-left:1px solid #2a2a3c;border-right:1px solid #2a2a3c;flex-shrink:0}.resizer-col[data-v-42c4fa00]:hover{background:#3a5a8c}.right[data-v-42c4fa00]{flex:1;min-width:0;height:100%;min-height:0;overflow:clip;display:flex;flex-direction:column}.panel-right .right[data-v-42c4fa00]{order:1}.panel-right .resizer-col[data-v-42c4fa00]{order:2}.panel-right .parameter-panel[data-v-42c4fa00]{order:3}.stage-area[data-v-42c4fa00]{flex:1;min-height:0;overflow:clip}.resizer-row[data-v-42c4fa00]{height:4px;cursor:row-resize;background:#1c1c2a;border-top:1px solid #2a2a3c;border-bottom:1px solid #2a2a3c;flex-shrink:0}.resizer-row[data-v-42c4fa00]:hover{background:#3a5a8c}.timeline-area[data-v-42c4fa00]{position:relative;z-index:10;flex-shrink:0;overflow:visible}html,body{width:100%;height:100%;margin:0;padding:0;overflow:clip;overscroll-behavior:none;background:#0b0b12;color:#e8e8f0;font-family:system-ui,-apple-system,Segoe UI,sans-serif}body{position:fixed;top:0;right:0;bottom:0;left:0}*{box-sizing:border-box}#app{position:fixed;top:0;right:0;bottom:0;left:0;width:auto;height:auto;overflow:clip}input[type=number]{-webkit-appearance:textfield;appearance:textfield;-moz-appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none} diff --git a/dist/downloads/connector/SpineParticleConnector-macos-arm64.zip b/dist/downloads/connector/SpineParticleConnector-macos-arm64.zip deleted file mode 100644 index 83251e7..0000000 Binary files a/dist/downloads/connector/SpineParticleConnector-macos-arm64.zip and /dev/null differ diff --git a/dist/downloads/connector/SpineParticleConnector-macos-universal.zip b/dist/downloads/connector/SpineParticleConnector-macos-universal.zip new file mode 100644 index 0000000..3d0b969 Binary files /dev/null and b/dist/downloads/connector/SpineParticleConnector-macos-universal.zip differ diff --git a/dist/index.html b/dist/index.html index 14b5948..d7e4426 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1,17 +1,17 @@ - - - - - - Spine粒子编辑器 + + + + + + Spine粒子编辑器 - - - - -
- - + + + + + +
+ + diff --git a/public/downloads/connector/SpineParticleConnector-macos-arm64.zip b/public/downloads/connector/SpineParticleConnector-macos-arm64.zip deleted file mode 100644 index 83251e7..0000000 Binary files a/public/downloads/connector/SpineParticleConnector-macos-arm64.zip and /dev/null differ diff --git a/public/downloads/connector/SpineParticleConnector-macos-universal.zip b/public/downloads/connector/SpineParticleConnector-macos-universal.zip new file mode 100644 index 0000000..3d0b969 Binary files /dev/null and b/public/downloads/connector/SpineParticleConnector-macos-universal.zip differ diff --git a/release/connector/macos-arm64/Spine粒子连接器.app/Contents/Info.plist b/release/connector/macos-arm64/Spine粒子连接器.app/Contents/Info.plist deleted file mode 100644 index 29633a2..0000000 --- a/release/connector/macos-arm64/Spine粒子连接器.app/Contents/Info.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - -CFBundleDisplayNameSpine粒子连接器 -CFBundleExecutableSpineParticleConnector -CFBundleIdentifiercom.spineparticle.connector -CFBundleInfoDictionaryVersion6.0 -CFBundleNameSpine粒子连接器 -CFBundlePackageTypeAPPL -CFBundleShortVersionString2.0.0 -CFBundleVersion2.0.0 -LSMinimumSystemVersion11.0 -NSHighResolutionCapable - diff --git a/release/connector/macos-arm64/Spine粒子连接器.app/Contents/MacOS/SpineParticleConnector b/release/connector/macos-arm64/Spine粒子连接器.app/Contents/MacOS/SpineParticleConnector deleted file mode 100755 index b53b900..0000000 Binary files a/release/connector/macos-arm64/Spine粒子连接器.app/Contents/MacOS/SpineParticleConnector and /dev/null differ diff --git a/release/connector/macos-arm64/使用说明.md b/release/connector/macos-arm64/使用说明.md deleted file mode 100644 index 8885558..0000000 --- a/release/connector/macos-arm64/使用说明.md +++ /dev/null @@ -1,21 +0,0 @@ -# Spine粒子连接器(桌面版) - -连接器是原生桌面应用,**无需安装 Node.js**。 - -## 使用 - -1. 正常安装并激活 Spine;连接器不会包含或替代 Spine 软件。 -2. macOS 打开“Spine粒子连接器.app”;Windows 打开“Spine粒子连接器.exe”。打开应用即启动连接器。 -3. 回到网页,等待导出区域显示“连接器可用 · Spine 已就绪”。 -4. 首次使用生产网站时,点击网页中的“授权当前网站”,在打开的本机页面确认完整域名后点击“允许此网站”。 -5. 可在应用内点击“断开连接”,或直接关闭应用来停止连接器。 - -若状态显示“未找到 Spine”,可在路径输入框中直接输入路径,或点击“选择 Spine.com”。Windows 请选择 `Spine.com`;macOS 请选择 `Spine.app/Contents/MacOS/Spine`。保存后下次启动仍然有效;“恢复自动检测”会清除手动路径。 - -连接器仅监听 `127.0.0.1:27843`,不会对局域网或公网开放。授权按完整来源区分,例如 `https://editor.example.com` 与 `https://editor.example.com:8443` 需要分别授权。 - -## 分发说明 - -- macOS 请完整分发 `.app`;Windows 可直接分发 `.exe` 和本说明。 -- macOS 版本只适用于其标记的 CPU 架构(Apple Silicon 或 Intel)。Windows 版本也需在 Windows 上构建。 -- 面向其他 Mac 分发时,建议使用 Apple Developer ID 签名并公证,避免 Gatekeeper 提示。 diff --git a/release/connector/连接器.zip b/release/connector/连接器.zip deleted file mode 100644 index 632357f..0000000 Binary files a/release/connector/连接器.zip and /dev/null differ diff --git a/src/views/HelpDialog.vue b/src/views/HelpDialog.vue index 6656829..b2965a4 100644 --- a/src/views/HelpDialog.vue +++ b/src/views/HelpDialog.vue @@ -179,7 +179,7 @@
前置
电脑已安装并激活 Spine;并已启动桌面版连接器APP。
网页端
导出区状态显示“连接器可用 · Spine 已就绪”后,点击“导出 .spine 包”。
首次授权
生产网站首次连接会显示“授权当前网站”;点击后在本机确认页核对完整来源(协议 + 域名 + 端口),再点“允许此网站”。授权一次后本机会保存白名单。本地 127.0.0.1:5173 默认允许。