支持spine4.3

This commit is contained in:
tianmo committed 2026-09-02 13:53:12 +08:00
1 parent 63e4f61631
commit 0656684a92
206 files changed
+100597 -1320

No files matched your search

@@ -0,0 +1,72 @@
"use strict";if(typeof window<"u"&&window.PIXI){const e=window.require;window.require=t=>{if(e)return e(t);if(t.startsWith("@pixi/"))return window.PIXI}}var vi=class{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}},on=class{entries={};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 s=0,n=e.length;s<n;s++)this.add(e[s]);return t!==this.size}contains(e){return this.entries[e]}clear(){this.entries={},this.size=0}},z=class Yt{constructor(t=0,s=0,n=0,i=0){this.r=t,this.g=s,this.b=n,this.a=i}static WHITE=new Yt(1,1,1,1);static RED=new Yt(1,0,0,1);static GREEN=new Yt(0,1,0,1);static BLUE=new Yt(0,0,1,1);static MAGENTA=new Yt(1,0,1,1);set(t,s,n,i){return this.r=t,this.g=s,this.b=n,this.a=i,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t=t.charAt(0)==="#"?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=t.length!==8?1:parseInt(t.substr(6,2),16)/255,this}add(t,s,n,i){return this.r+=t,this.g+=s,this.b+=n,this.a+=i,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,s){t.r=((s&4278190080)>>>24)/255,t.g=((s&16711680)>>>16)/255,t.b=((s&65280)>>>8)/255,t.a=(s&255)/255}static rgb888ToColor(t,s){t.r=((s&16711680)>>>16)/255,t.g=((s&65280)>>>8)/255,t.b=(s&255)/255}toRgb888(){const t=s=>`0${(s*255).toString(16)}`.slice(-2);return+`0x${t(this.r)}${t(this.g)}${t(this.b)}`}static fromString(t,s=new Yt){return s.setFromString(t)}},L=class ht{static epsilon=1e-5;static epsilon2=ht.epsilon*ht.epsilon;static PI=3.1415927;static PI2=ht.PI*2;static invPI2=1/ht.PI2;static radiansToDegrees=180/ht.PI;static radDeg=ht.radiansToDegrees;static degreesToRadians=ht.PI/180;static degRad=ht.degreesToRadians;static clamp(t,s,n){return t<s?s:t>n?n:t}static cosDeg(t){return Math.cos(t*ht.degRad)}static sinDeg(t){return Math.sin(t*ht.degRad)}static atan2Deg(t,s){return Math.atan2(t,s)*ht.radDeg}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){const s=Math.pow(Math.abs(t),.3333333333333333);return t<0?-s:s}static randomTriangular(t,s){return ht.randomTriangularWith(t,s,(t+s)*.5)}static randomTriangularWith(t,s,n){const i=Math.random(),r=s-t;return i<=(n-t)/r?t+Math.sqrt(i*r*(n-t)):s-Math.sqrt((1-i)*r*(s-n))}static isPowerOfTwo(t){return t&&(t&t-1)===0}},qt=class _t{static linear=new class extends _t{applyInternal(t){return t}};static smooth=new class extends _t{applyInternal(t){return t*t*(3-2*t)}};static slowFast=new class extends _t{applyInternal(t){return t*t}};static fastSlow=new class extends _t{applyInternal(t){return(t-1)*(t-1)*-1+1}};static circle=new class extends _t{applyInternal(t){return t<=.5?(t*=2,(1-Math.sqrt(1-t*t))/2):(t--,t*=2,(Math.sqrt(1-t*t)+1)/2)}};apply(t,s,n){return s===void 0||n===void 0?this.applyInternal(t):t+(s-t)*this.applyInternal(n)}},an=class extends qt{power=2;constructor(e){super(),this.power=e}applyInternal(e){return e<=.5?Math.pow(e*2,this.power)/2:Math.pow((e-1)*2,this.power)/(this.power%2===0?-2:2)+1}},Ti=class extends an{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2===0?-1:1)+1}},V=class Ut{static SUPPORTS_TYPED_ARRAYS=typeof Float32Array<"u";static arrayCopy(t,s,n,i,r){for(let a=s,c=i;a<s+r;a++,c++)n[c]=t[a]}static arrayFill(t,s,n,i){for(let r=s;r<n;r++)t[r]=i}static setArraySize(t,s,n=0){const i=t.length;if(i===s)return t;if(t.length=s,i<s)for(let r=i;r<s;r++)t[r]=n;return t}static ensureArrayCapacity(t,s,n=0){return t.length>=s?t:Ut.setArraySize(t,s,n)}static newArray(t,s){const n=[];for(let i=0;i<t;i++)n[i]=s;return n}static newFloatArray(t){if(Ut.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{const s=[];for(let n=0;n<s.length;n++)s[n]=0;return s}}static newShortArray(t){if(Ut.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{const s=[];for(let n=0;n<s.length;n++)s[n]=0;return s}}static toFloatArray(t){return Ut.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return Ut.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t){}static contains(t,s,n=!0){for(let i=0;i<t.length;i++)if(t[i]===s)return!0;return!1}static enumValue(t,s){return t[s[0].toUpperCase()+s.slice(1)]}},Ci=class{static logBones(e){for(let t=0;t<e.bones.length;t++){const s=e.bones[t].appliedPose;console.log(`${s.bone.data.name}, ${s.a}, ${s.b}, ${s.c}, ${s.d}, ${s.worldX}, ${s.worldY}`)}}},zt=class{items=[];instantiator;constructor(e){this.instantiator=e}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(e){e.reset?.(),this.items.push(e)}freeAll(e){for(let t=0;t<e.length;t++Line truncated
${s}`:""}`)}remove(e){e=this.pathPrefix+e;const t=this.cache.assets[e];return t.dispose&&t.dispose(),delete this.cache.assets[e],delete this.cache.assetsRefCount[e],delete this.cache.assetsLoaded[e],t}removeAll(){for(const e in this.cache.assets){const t=this.cache.assets[e];t.dispose&&t.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(e){const t=this.cache.assets[e];if(t instanceof he){t.dispose();return}this.disposeAssetInternal(e)}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}disposeAssetInternal(e){if(this.cache.assetsRefCount[e]>0&&--this.cache.assetsRefCount[e]===0)return this.remove(e)}createTextureAtlas(e,t,s,n){const i=new he(e);i.dispose=()=>{if(!(this.cache.assetsRefCount[s]<=0)){this.disposeAssetInternal(s);for(const r of i.pages)r.texture?.dispose()}};for(const r of i.pages){const a=this.texturePath(t,r.name,n);this.texturePmaInfo[this.pathPrefix+a]=r.pma}return i}createTexture(e,t,s){const n=this.textureLoader(s,t),i=n.dispose.bind(n);return n.dispose=()=>{this.disposeAssetInternal(e)&&i()},n}texturePath(e,t,s){return s?s[t]:e+t}},vn=class De{assets={};assetsRefCount={};assetsLoaded={};static AVAILABLE_CACHES=new Map;static getCache(t){const s=De.AVAILABLE_CACHES.get(t);if(s)return s;const n=new De;return De.AVAILABLE_CACHES.set(t,n),n}async addAsset(t,s){return this.assetsLoaded[t]=Promise.resolve(s),this.assets[t]=s,s}getAsset(t){return this.assetsLoaded[t]}},Tn=class{callbacks={};rawDataUris={};dataUriToString(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");return t!==-1?(t+=7,atob(e.substr(t))):e.substr(e.indexOf(",")+1)}base64ToUint8Array(e){var t=window.atob(e),s=t.length,n=new Uint8Array(s);for(let i=0;i<s;i++)n[i]=t.charCodeAt(i);return n}dataUriToUint8Array(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");if(t===-1)throw new Error("Not a binary data URI.");return t+=7,this.base64ToUint8Array(e.substr(t))}downloadText(e,t,s){if(this.start(e,t,s))return;const n=this.rawDataUris[e];if(n&&!n.includes(".")){try{this.finish(e,200,this.dataUriToString(n))}catch(a){this.finish(e,400,JSON.stringify(a))}return}const i=new XMLHttpRequest;i.overrideMimeType("text/html"),i.open("GET",n||e,!0);const r=()=>{this.finish(e,i.status,i.responseText)};i.onload=r,i.onerror=r,i.send()}downloadJson(e,t,s){this.downloadText(e,n=>{t(JSON.parse(n))},s)}downloadBinary(e,t,s){if(this.start(e,t,s))return;const n=this.rawDataUris[e];if(n&&!n.includes(".")){try{this.finish(e,200,this.dataUriToUint8Array(n))}catch(a){this.finish(e,400,JSON.stringify(a))}return}const i=new XMLHttpRequest;i.open("GET",n||e,!0),i.responseType="arraybuffer";const r=()=>{this.finish(e,i.status,i.response)};i.onload=()=>{i.status===200||i.status===0?this.finish(e,200,new Uint8Array(i.response)):r()},i.onerror=r,i.send()}start(e,t,s){let n=this.callbacks[e];try{if(n)return!0;this.callbacks[e]=n=[]}finally{n.push(t,s)}}finish(e,t,s){const n=this.callbacks[e];if(delete this.callbacks[e],t===200||t===0)for(let i=0,r=n.length;i<r;i+=2)n[i](s);else for(let i=1,r=n.length;i<r;i+=2)n[i](t,s)}},Fs=class ui extends vt{color=new z(1,1,1,1);constructor(t){super(t)}copy(){const t=new ui(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},Mt=class fi extends vt{endSlot=null;convex=!1;inverse=!1;color=new z(.2275,.2275,.8078,1);constructor(t){super(t)}copy(){const t=new fi(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.convex=this.convex,t.inverse=this.inverse,t.color.setFromColor(this.color),t}},jt=class mi extends vt{lengths=[];closed=!1;constantSpeed=!1;color=new z(1,1,1,1);constructor(t){super(t)}copy(){const t=new mi(this.name);return this.copyTo(t),t.lengths=[],V.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=this.closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}},Cn=class gi extends vt{x=0;y=0;rotation=0;color=new z(.38,.94,0,1);constructor(t){super(t)}computeWorldPosition(t,s){return s.x=this.x*t.a+this.y*t.b+t.worldX,s.y=this.x*t.c+this.y*t.d+t.worldY,s}computeWorldRotation(t){const s=this.rotation*L.degRad,n=Math.cos(s),i=Math.sin(s),r=n*t.a+i*t.b,a=n*t.c+i*t.d;return L.atan2Deg(a,r)}copy(){const t=new gi(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}},Sn=class{atlas;allowMissingRegions;constructor(e,t=!1){this.atlas=e,this.allowMissingRegions=t}findRegions(e,t,s){const n=s.regions;for(let i=0,r=n.length;i<r;i++)n[i]=this.findRegion(e,s.getPath(t,i))}findRegion(e,t){const s=this.atlas.findRegion(t);if(!s&&!this.allowMissingRegions)throw new Error(`Region not found in atlas: ${t} (attachment: ${e})`);return s}newRegionAttachment(e,t,s,n,i){return this.findRegions(s,n,i),new Tt(s,i)}newMeshAttachment(e,t,s,n,i){retuLine truncated
attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat3 projectionMatrix;
uniform mat3 translationMatrix;
uniform mat3 uTextureMatrix;
varying vec2 vTextureCoord;
void main(void)
{
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
}
`,Nr=`
varying vec2 vTextureCoord;
uniform vec4 uColor;
uniform vec4 uDarkColor;
uniform sampler2D uSampler;
void main(void)
{
vec4 texColor = texture2D(uSampler, vTextureCoord);
gl_FragColor.a = texColor.a * uColor.a;
gl_FragColor.rgb = ((texColor.a - 1.0) * uDarkColor.a + 1.0 - texColor.rgb) * uDarkColor.rgb + texColor.rgb * uColor.rgb;
}
`,Zn=class extends Xr{uvMatrix;batchable;pluginName;_tintRGB;_darkTintRGB;_colorDirty;_alpha;_tintColor;_darkTintColor;constructor(e){const t={uSampler:e??Lr.EMPTY,alpha:1,uTextureMatrix:Er.IDENTITY,uColor:new Float32Array([1,1,1,1]),uDarkColor:new Float32Array([0,0,0,0])},s={tint:16777215,darkTint:0,alpha:1,pluginName:"darkTintBatch"};super(Br.from(Vr,Nr),t),this._colorDirty=!1,this.uvMatrix=new Rr(t.uSampler),this.batchable=!0,this.pluginName=s.pluginName,this._tintColor=new Ve(s.tint),this._darkTintColor=new Ve(s.darkTint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._darkTintRGB=this._darkTintColor.toLittleEndianNumber(),this._alpha=s.alpha,this._colorDirty=!0}get texture(){return this.uniforms.uSampler}set texture(e){this.uniforms.uSampler!==e&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!e.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=e,this.uvMatrix.texture=e)}set alpha(e){e!==this._alpha&&(this._alpha=e,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(e){e!==this.tint&&(this._tintColor.setValue(e),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}set darkTint(e){e!==this.darkTint&&(this._darkTintColor.setValue(e),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,Ve.shared.setValue(this._tintColor).premultiply(this._alpha,!0).toArray(this.uniforms.uColor),Ve.shared.setValue(this._darkTintColor).premultiply(this._alpha,!0).premultiply(1,!1).toArray(this.uniforms.uDarkColor)),this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}},jn=class extends Fr{_darkTintRGB=0;constructor(e){super(new Jn,new Zn(e),void 0,void 0)}get darkTint(){return"darkTint"in this.shader?this.shader.darkTint:null}set darkTint(e){this.shader.darkTint=e}get darkTintValue(){return this.shader.darkTintValue}_renderToBatch(e){const t=this.geometry,s=this.shader;s.uvMatrix&&(s.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=t.indexBuffer.data,this._tintRGB=s._tintRGB,this._darkTintRGB=s._darkTintRGB,this._texture=s.texture;const n=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[n]),e.plugins[n].render(this)}},Qn=class it extends jn{name="";static auxColor=[0,0,0,0];constructor(){super()}updateFromSpineData(t,s,n,i,r,a,c,l){this.texture=t.texture;const o=r/(l?12:8)*2,h=this.geometry.getBuffer("aTextureCoord");h.data?.length!==o&&(h.data=new Float32Array(o));const d=this.geometry.getBuffer("aVertexPosition");d.data?.length!==o&&(d.data=new Float32Array(o));let m=0;const f=h.data,u=d.data;for(let g=0;g<r;g+=l?12:8){let x=g;u[m]=i[x++],u[m+1]=i[x++],x+=4,f[m]=i[x++],f[m+1]=i[x++],m+=2}l?(it.auxColor[0]=i[8],it.auxColor[1]=i[9],it.auxColor[2]=i[10],it.auxColor[3]=i[11],this.darkTint=it.auxColor,it.auxColor[0]=i[2],it.auxColor[1]=i[3],it.auxColor[2]=i[4],it.auxColor[3]=i[5],this.tint=it.auxColor):(it.auxColor[0]=i[2],it.auxColor[1]=i[3],it.auxColor[2]=i[4],it.auxColor[3]=i[5],this.tint=it.auxColor),this.blendMode=ie.toPixiBlending(s),this.alpha=it.auxColor[3];const p=this.geometry.indexBuffer;if(p.data.length!==a.length)p.data=new Uint32Array(a);else{const g=p.data;for(let x=0;x<c;x++)g[x]=a[x]}this.name=n,h.update(),d.update(),p.update()}};import{Buffer as ti,Geometry as Dr,TYPES as re}from"@pixi/core";var ei=class extends Dr{_buffer;_indexBuffer;constructor(e=!1){super(),this._buffer=new ti(void 0,e,!1),this._indexBuffer=new ti(void 0,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,re.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,re.FLOAT).addAttribute("aColor",this._buffer,4,!0,re.UNSIGNED_BYTE).addAttribute("aDarkColor",this._buffer,4,!0,re.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,re.FLOAT).addIndex(this._indexBuffer)}};import{BatchRenderer as Or,BatchShaderGenerator as _r,Color as si,ExtensionType as Ur,extensions as $r}from"@pixi/core";var qr=`
precision highp float;
attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
attribute vec4 aColor;
attribute vec4 aDarkColor;
attribute float aTextureId;
uniform mat3 projectionMatrix;
uniform mat3 translationMatrix;
uniform vec4 tint;
varying vec2 vTextureCoord;
varying vec4 vColor;
varying vec4 vDarkColor;
varying float vTextureId;
void main(void){
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = aTextureCoord;
vTextureId = aTextureId;
vColor = aColor * tint;
vDarkColor = aDarkColor * tint;
}
`,zr=`
varying vec2 vTextureCoord;
varying vec4 vColor;
varying vec4 vDarkColor;
varying float vTextureId;
uniform sampler2D uSamplers[%count%];
void main(void){
vec4 color;
%forloop%
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;
}
`,ni=class extends Or{static extension={name:"darkTintBatch",type:Ur.RendererPlugin};constructor(e){super(e),this.shaderGenerator=new _r(qr,zr),this.geometryClass=ei,this.vertexSize=7}packInterleavedGeometry(e,t,s,n,i){const{uint32View:r,float32View:a}=t,c=n/this.vertexSize,l=e.uvs,o=e.indices,h=e.vertexData,d=e._texture.baseTexture._batchLocation,m=Math.min(e.worldAlpha,1),f=si.shared.setValue(e._tintRGB).toPremultiplied(m,!0),u=si.shared.setValue(e._darkTintRGB).premultiply(m,!0).toPremultiplied(1,!1);for(let p=0;p<h.length;p+=2)a[n++]=h[p],a[n++]=h[p+1],a[n++]=l[p],a[n++]=l[p+1],r[n++]=f,r[n++]=u,a[n++]=d;for(let p=0;p<o.length;p++)s[i++]=c+o[p]}};$r.add(ni);import{Texture as Wr}from"@pixi/core";import{Mesh as Gr,MeshGeometry as Hr,MeshMaterial as Kr}from"@pixi/mesh";var ii=class Lt extends Gr{name="";static auxColor=[0,0,0,0];warnedTwoTint=!1;constructor(){const t=new Hr;t.getBuffer("aVertexPosition").static=!1,t.getBuffer("aTextureCoord").static=!1;const s=new Kr(Wr.EMPTY);super(t,s)}updateFromSpineData(t,s,n,i,r,a,c,l){this.texture=t.texture;const o=r/(l?12:8)*2,h=this.geometry.getBuffer("aTextureCoord");h.data?.length!==o&&(h.data=new Float32Array(o));const d=this.geometry.getBuffer("aVertexPosition");d.data?.length!==o&&(d.data=new Float32Array(o));let m=0;const f=h.data,u=d.data;for(let g=0;g<r;g+=l?12:8){let x=g;u[m]=i[x++],u[m+1]=i[x++],x+=4,f[m]=i[x++],f[m+1]=i[x++],m+=2}l&&!this.warnedTwoTint&&(console.warn("DarkTint is not enabled by default. To enable use a DarkSlotMesh factory while creating the Spine object."),this.warnedTwoTint=!0),Lt.auxColor[0]=i[2],Lt.auxColor[1]=i[3],Lt.auxColor[2]=i[4],Lt.auxColor[3]=i[5],this.tint=Lt.auxColor,this.alpha=Lt.auxColor[3],this.blendMode=ie.toPixiBlending(s);const p=this.geometry.indexBuffer;if(p.data.length!==a.length)p.data=new Uint32Array(a);else{const g=p.data;for(let x=0;x<c;x++)g[x]=a[x]}this.name=n,h.update(),d.update(),p.update()}};import{Assets as ri}from"@pixi/assets";import{Point as Jr,Ticker as oi}from"@pixi/core";import{Bounds as Zr,Container as jr}from"@pixi/display";import{Graphics as Qr}from"@pixi/graphics";import"@pixi/events";var to=class{constructor(e,t,s,n){this.x=e,this.y=t,this.width=s,this.height=n}calculateBounds(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},eo=class{constructor(e=!1){this.clipping=e}calculateBounds(e){if(!e.skeleton)return{x:0,y:0,width:0,height:0};const t=new Ot(e.skeleton.data);t.setupPose(),t.updateWorldTransform(2);const s=t.getBoundsRect(this.clipping?new ne:void 0);return s.width===Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:s}},so=class{constructor(e,t=[],s=.05,n=!1){this.animation=e,this.skins=t,this.timeStep=s,this.clipping=n}calculateBounds(e){if(!e.skeleton||!e.state)return{x:0,y:0,width:0,height:0};const t=new Ss(e.state.data),s=new Ot(e.skeleton.data),n=this.clipping?new ne:void 0,i=s.data;if(this.skins.length>0){const a=new se("custom-skin");for(const c of this.skins){const l=i.findSkin(c);l!=null&&a.addSkin(l)}s.setSkin(a)}s.setupPose();const r=this.animation!=null?i.findAnimation(this.animation):null;if(r==null){s.updateWorldTransform(2);const a=s.getBoundsRect(n);return a.width===Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:a}else{let a=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;t.clearTracks(),t.setAnimation(0,r,!1);const h=Math.max(r.duration/this.timeStep,1);for(let m=0;m<h;m++){const f=m>0?this.timeStep:0;t.update(f),t.apply(s),s.update(f),s.updateWorldTransform(2);const u=s.getBoundsRect(n);a=Math.min(a,u.x),c=Math.min(c,u.y),l=Math.max(l,u.x+u.width),o=Math.max(o,u.y+u.height)}const d={x:a,y:c,width:l-a,height:o-c};return d.width===Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:d}}},no=class j extends jr{skeleton;state;skeletonPhysics;darkTint=!1;hasNeverUpdated=!0;_debug=void 0;get debug(){return this._debug}set debug(t){this._debug&&this._debug.unregisterSpine(this),t&&t.registerSpine(this),this._debug=t}slotMeshFactory=()=>new ii;beforeUpdateWorldTransforms=()=>{};afterUpdateWorldTransforms=()=>{};_autoUpdate=!1;_ticker=oi.shared;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??oi.shared,this._ticker!==t&&(this._autoUpdate&&(this._ticker.remove(this.internalUpdate,this),t.add(this.internalUpdate,this)),this._ticker=t)}meshesCache=new Map;static vectorAux=new le;static clipper=new ne;static QUAD_TRIANGLES=[0,1,2,2,3,0];static VERTEX_SIZE=8;static DARK_VERTEX_SIZE=12;lightColor=new z;darkColor=new z;clippingVertAux=new Float32Array(6);_boundsProvider;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.hasNe Line truncated